@seatlayer/core 0.101.0 → 0.102.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/ar-TGXEBJUB.js +1 -0
- package/dist/be-JIDOHWF6.js +1 -0
- package/dist/bg-ODVJNCC2.js +1 -0
- package/dist/ca-3I7TMWYU.js +1 -0
- package/dist/{categoryInventory-H77A_8pF.d.cts → categoryInventory-7gSFTu0l.d.cts} +1 -1
- package/dist/{categoryInventory-DZ5IcDOy.d.ts → categoryInventory-hJxuFF9L.d.ts} +1 -1
- package/dist/chunk-254ABRJF.js +1 -0
- package/dist/{chunk-5HXTEMRE.js → chunk-4DYJCT62.js} +1 -1
- package/dist/chunk-4R6TXHY2.js +1 -0
- package/dist/{chunk-D723OZEY.js → chunk-66T4EAUA.js} +1 -1
- package/dist/{chunk-GLGXP5I7.js → chunk-AFJWTB7L.js} +1 -1
- package/dist/chunk-COECA63Q.js +1 -0
- package/dist/chunk-EIV3CAGV.js +1 -0
- package/dist/chunk-FOIYJ5NT.js +1 -0
- package/dist/chunk-FUFRWRPM.js +1 -0
- package/dist/{chunk-2RNZOV5I.js → chunk-GPZFVQXV.js} +1 -1
- package/dist/{chunk-L34T3APU.js → chunk-GTRYL7YV.js} +1 -1
- package/dist/chunk-JRZHC75P.js +1 -0
- package/dist/chunk-KTMZ3QAO.js +1 -0
- package/dist/chunk-PHV2U54Y.js +1 -0
- package/dist/chunk-TAMY7HTV.js +1 -0
- package/dist/chunk-UEDS3HJ3.js +1 -0
- package/dist/{chunk-P4J57TK6.js → chunk-YPVYZYMH.js} +1 -1
- package/dist/chunk-ZS5YFXSE.js +1 -0
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +30 -9
- package/dist/core/chart-ops/index.d.ts +30 -9
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +72 -5
- package/dist/core/inventory/index.d.ts +72 -5
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +63 -6
- package/dist/core/layout/index.d.ts +63 -6
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.cjs +1 -1
- package/dist/core/quality/index.d.cts +18 -4
- package/dist/core/quality/index.d.ts +18 -4
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.cjs +1 -1
- package/dist/core/render-assets/index.d.cts +2 -2
- package/dist/core/render-assets/index.d.ts +2 -2
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/cs-XXB624Z3.js +1 -0
- package/dist/cy-W2QNU2GO.js +1 -0
- package/dist/da-Q47YPK2E.js +1 -0
- package/dist/de-TS3DPLM5.js +1 -0
- package/dist/{el-ZPFVDCWA.js → el-3JQUH6DB.js} +1 -1
- package/dist/es-GP7VOX7S.js +1 -0
- package/dist/et-A22OMZ6V.js +1 -0
- package/dist/{eventConfigurations-ClFqXQi9.d.cts → eventConfigurations-BHIfPJJJ.d.cts} +1 -1
- package/dist/{eventConfigurations-B6aS6c-_.d.ts → eventConfigurations-I5UBS6r9.d.ts} +1 -1
- package/dist/fa-5MS3C6YX.js +1 -0
- package/dist/fi-OJLAOJO2.js +1 -0
- package/dist/fr-7ATOYJCF.js +1 -0
- package/dist/he-37LKRY5W.js +1 -0
- package/dist/hi-YXZ5EWK7.js +1 -0
- package/dist/hr-QFOPGLMR.js +1 -0
- package/dist/hu-RHRBK46E.js +1 -0
- package/dist/id-A5Q3MLSX.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +57 -16
- package/dist/index.d.ts +57 -16
- package/dist/index.js +1 -1
- package/dist/it-KG53QPQF.js +1 -0
- package/dist/ja-CC6EPUSN.js +1 -0
- package/dist/ko-7H4RGYFK.js +1 -0
- package/dist/ku-HFYWPSS4.js +1 -0
- package/dist/{labeling-ByEZkLee.d.cts → labeling-2A31f781.d.cts} +11 -3
- package/dist/{labeling-CP3GhUrf.d.ts → labeling-CDKZ9TO1.d.ts} +11 -3
- package/dist/localeLoaders-4YMC7FIZ.js +1 -0
- package/dist/lt-HQXE7W47.js +1 -0
- package/dist/lv-AN25XXPB.js +1 -0
- package/dist/ms-CWAYSF6E.js +1 -0
- package/dist/nl-63QBRZSZ.js +1 -0
- package/dist/no-RAPQMKWU.js +1 -0
- package/dist/pl-ILSTD4ZV.js +1 -0
- package/dist/pt-WF3US5D7.js +1 -0
- package/dist/{renderedQuality--H0toc-2.d.cts → renderedQuality-CwZ8hY-5.d.cts} +1 -1
- package/dist/{renderedQuality-Bo4k99GE.d.ts → renderedQuality-wDIiUId3.d.ts} +1 -1
- package/dist/{renderer-CWbam_zr.d.ts → renderer-CdJx5l3B.d.ts} +8 -1
- package/dist/{renderer-BPhSZUGh.d.cts → renderer-D6ggv3bV.d.cts} +8 -1
- package/dist/ro-XR3HT6DE.js +1 -0
- package/dist/ru-TLJEWDPA.js +1 -0
- package/dist/{seatTypeIcons-CSt1isBY.d.ts → seatTypeIcons-DMJX4rVN.d.cts} +2 -2
- package/dist/{seatTypeIcons-B2tvcQ0H.d.cts → seatTypeIcons-UpUTD8Xf.d.ts} +2 -2
- package/dist/{sections-JHox6Lsw.d.ts → sections-CempT5a0.d.cts} +5 -2
- package/dist/{sections-C_AKwOIh.d.cts → sections-lpdfwSdO.d.ts} +5 -2
- package/dist/{segmentedRowModel-CZ0Ciea-.d.cts → segmentedRowModel-Ddx5ol8T.d.cts} +1 -1
- package/dist/{segmentedRowModel-DQO0vHR1.d.ts → segmentedRowModel-HwY4XuYa.d.ts} +1 -1
- package/dist/sk-OJC2EL3Z.js +1 -0
- package/dist/sl-7RGTVXCV.js +1 -0
- package/dist/sr-NHDJ54BS.js +1 -0
- package/dist/sv-ZODCCBCU.js +1 -0
- package/dist/{tableSizing-Cp5T_6Lw.d.cts → tableSizing-BJqAuJDg.d.cts} +3 -3
- package/dist/{tableSizing-ClgbhNks.d.ts → tableSizing-C0zx97eg.d.ts} +3 -3
- package/dist/th-VCZA4MP5.js +1 -0
- package/dist/{ticketRestrictions-BHNbxzFT.d.cts → ticketRestrictions-AU8UUmdL.d.ts} +39 -3
- package/dist/{ticketRestrictions-DUdzkp4F.d.ts → ticketRestrictions-DDQHiKF-.d.cts} +39 -3
- package/dist/tr-ROKZO3HC.js +1 -0
- package/dist/{types-5AlKCD4j.d.cts → types-DL7qIUrD.d.cts} +68 -2
- package/dist/{types-5AlKCD4j.d.ts → types-DL7qIUrD.d.ts} +68 -2
- package/dist/uk-LP2DPUHC.js +1 -0
- package/dist/vi-JDK3JRJR.js +1 -0
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +54 -54
- package/dist/view3d/index.d.cts +9 -3
- package/dist/view3d/index.d.ts +9 -3
- package/dist/view3d/index.js +10 -10
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/dist/zh-Hans-P3GB3FAZ.js +1 -0
- package/dist/zh-Hant-YU4OKSFZ.js +1 -0
- package/package.json +1 -1
- package/dist/ar-Q44JP5JY.js +0 -1
- package/dist/be-CGFFSIQL.js +0 -1
- package/dist/bg-WOYK6OLH.js +0 -1
- package/dist/ca-77ZVI3X5.js +0 -1
- package/dist/chunk-52XO3LA7.js +0 -1
- package/dist/chunk-5BMXWOE7.js +0 -1
- package/dist/chunk-5ITK5236.js +0 -1
- package/dist/chunk-5PFYIYM5.js +0 -1
- package/dist/chunk-CTIGUXXK.js +0 -1
- package/dist/chunk-FLZKBXHA.js +0 -1
- package/dist/chunk-HO4MFTVX.js +0 -1
- package/dist/chunk-JK3DUFRX.js +0 -1
- package/dist/chunk-N4J4CT6P.js +0 -1
- package/dist/chunk-NO6OLVTT.js +0 -1
- package/dist/chunk-UISTXRO5.js +0 -1
- package/dist/cs-OSBZYCSR.js +0 -1
- package/dist/cy-ZCOJW2WH.js +0 -1
- package/dist/da-2PDK6JTR.js +0 -1
- package/dist/de-R5LLVFUU.js +0 -1
- package/dist/es-7YASJP32.js +0 -1
- package/dist/et-J4TV6KQL.js +0 -1
- package/dist/fa-4TEO7UGM.js +0 -1
- package/dist/fi-GIUDDKMH.js +0 -1
- package/dist/fr-J5J2XJLA.js +0 -1
- package/dist/he-OCEHSVUJ.js +0 -1
- package/dist/hi-EK5CTBW5.js +0 -1
- package/dist/hr-SLDTQOYC.js +0 -1
- package/dist/hu-2QNE77NO.js +0 -1
- package/dist/id-LGDAFQJK.js +0 -1
- package/dist/it-DT4Y3IYB.js +0 -1
- package/dist/ja-D5EY2XCQ.js +0 -1
- package/dist/ko-DD2NV45Q.js +0 -1
- package/dist/ku-KZCMVLBE.js +0 -1
- package/dist/localeLoaders-GGAKX22E.js +0 -1
- package/dist/lt-QWGTJ47Y.js +0 -1
- package/dist/lv-LYAIG3VK.js +0 -1
- package/dist/ms-XTF4KNGD.js +0 -1
- package/dist/nl-QEXY6XHS.js +0 -1
- package/dist/no-HCOXN2CN.js +0 -1
- package/dist/pl-BWY53TSD.js +0 -1
- package/dist/pt-2UJUBCPL.js +0 -1
- package/dist/ro-GGXOLTED.js +0 -1
- package/dist/ru-ZTFK3WCU.js +0 -1
- package/dist/sk-KU543Y2U.js +0 -1
- package/dist/sl-FT576R7A.js +0 -1
- package/dist/sr-WE3J46JE.js +0 -1
- package/dist/sv-YEAOPSEB.js +0 -1
- package/dist/th-BEBRDHJA.js +0 -1
- package/dist/tr-LOAHUPSH.js +0 -1
- package/dist/uk-2GMICSHN.js +0 -1
- package/dist/vi-TC5B6AUR.js +0 -1
- package/dist/zh-Hans-TSZWTZQY.js +0 -1
- package/dist/zh-Hant-TLB4FZYM.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ro,c as so,e as br,f as ci,h as yr,i as Sr,l as vr}from"./chunk-CTIGUXXK.js";import{a as Xg,b as ni,c as Yg}from"./chunk-2RNZOV5I.js";import{a as xg,b as Wn,c as Lg,d as Vn,e as zn,f as Cg,g as Pg,h as Kn,j as ar,m as si,o as lr,p as Ce,q as pe,r as cr,s as dr,t as ai,u as hr}from"./chunk-GLGXP5I7.js";import{b as wr}from"./chunk-FOYQOIWG.js";import{a as Ji,b as Ng,c as Yn,d as Hg}from"./chunk-P4J57TK6.js";import{a as Dg,b as Xn,c as Lt}from"./chunk-FLZKBXHA.js";import{b as sr,e as no,i as li}from"./chunk-D723OZEY.js";import{D as ye,E as Fe,H as ei,I as xt,J as ti,L as tr,M as Ve,N as oo,O as ii,P as q,Q as ue,R as oi,b as Nm,c as Pn,d as Hm,e as Tn,f as Gm,g as Wm,h as Vm,i as zm,j as Km,k as Xm,l as Ym,m as Um,n as $m,o as ge,p as Jn,q as Ge,s as be,t as Qt,u as Jt,v as We,w as z,y as er}from"./chunk-52XO3LA7.js";import{a as Tg,b as Ig,c as Mg}from"./chunk-N4J4CT6P.js";import{b as ri,f as ir,h as nt,i as or,j as nr,l as rr}from"./chunk-4N5CHKHD.js";import{a as ur,b as pr,h as fr,s as mr,t as gr}from"./chunk-TQN2VWQO.js";import{b as Hn,c as Gn,l as wt}from"./chunk-5BMXWOE7.js";import{a as Rg,b as Ag,c as Eg,d as Fg,e as _g,f as Bg,g as Zt,h as Og,i as kt,j as Un,k as Gg,l as $n,m as Wg,n as qn,o as Vg,p as zg,q as Kg,r as Zn}from"./chunk-HO4MFTVX.js";import{Aa as cg,Ba as dg,Ca as hg,Da as ug,Ea as pg,Fa as fg,Ga as mg,Ha as gg,I as In,Ia as bg,Ja as yg,K as Mn,Ka as _n,La as Bn,M as Y,Ma as J,Na as $t,Oa as Sg,Pa as vg,Qa as qt,Ra as wg,Sa as On,Ta as kg,Ua as Dn,Va as He,Wa as Nn,ba as Rn,ca as ot,d as qm,da as lg,e as Zm,f as jm,g as Qm,h as Jm,i as eg,j as tg,k as ig,l as og,la as se,m as ng,ma as An,n as rg,na as Ut,o as sg,p as ag,wa as En,ya as Fn}from"./chunk-UISTXRO5.js";import"./chunk-5ITK5236.js";import{C as D,c as eo,h as to,m as io,o as jn,t as V,u as de,v as Le,w as ee,x as jt,z as Qn}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var Ug=1,ao=90;function lo(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function kr(t,e,i,o=1){if(!Number.isFinite(t))return i;let n=Math.max(0,o);return i?t>=e-n:t>=e+n}function co(t,e,i,o=1){if(!Number.isFinite(t)||!(i>0))return t;let n=Math.max(0,o)/i;return e?t*(1+n):t*(1-n)}function $g(t){let{point:e,camera:i,scale:o,nextScale:n}=t;if(!Number.isFinite(o)||o<=0||!Number.isFinite(n))return{...i};let r=(e.x-i.x)/o,s=(e.y-i.y)/o;return{x:e.x-r*n,y:e.y-s*n}}import{Konva as Wi}from"konva/lib/Core";import{Stage as om}from"konva/lib/Stage";import{Layer as un}from"konva/lib/Layer";import{Group as zt}from"konva/lib/Group";import{Circle as rd}from"konva/lib/shapes/Circle";import{Group as Co}from"konva/lib/Group";import{Circle as De}from"konva/lib/shapes/Circle";import{Line as Io}from"konva/lib/shapes/Line";import{Rect as Po}from"konva/lib/shapes/Rect";import{Text as Xs}from"konva/lib/shapes/Text";var te=9,Se=.9,Z=.55*Se,oe=z/ge,rt=4,fe=14,xr=10;var Lr=14;var ve=.45*Se,we=.9*Se,ae=(ve+we)/2,Cr=Math.max(Se*1.1,we),_e=8,Pr=700,ie=2,Ct=z,oh=12,nh=12;function Tr(t){return t<j?nh:oh}var di=.85,Ir=z,Pt=64,ze=.55*ve,Mr=700,Rr=120,Ar=2500,hi=-11.5,Tt=.58,Er=320,Fr=420,_r=420,Br=1,Ke=1,Or=2,st=16,Be=12,ho=[.85,.72,.62],rh=10,sh=9;function ui(t){return t<j?sh:rh}var pi=13,fi=12,Dr=0,Nr="700",Hr="600",Gr=8,Wr=5,Vr=10,zr=6,Kr=8,Xr=.6,Yr=.6,Ur=.7,$r=[0,18,-18,36,-36,54,-54],Xe="600",qr="500",j=640,Zr=Xe,jr="400",Oe=0,Qr=14,Jr=.34,es=.92,ts=7,is=3;function mi(t){return Math.min(1,Math.max(Be/st,t/900))}function at(t,e){return Math.max(Be,t*mi(e))}var ah=.5,lh=1.15,os=2,ns=3,rs=22,ch=8,dh=6;function It(t){return t<j?dh:ch}var uo=.08;function po(t,e,i,o,n=ah,r=Be){let s=t*mi(e),a=Math.max(r*(1+uo),s*n),l=o>0&&i>o?i/o:1,c=Math.max(a,s*lh);return Math.min(c,a*l)}var ss=.1,Mt=1.02;var gi=1.25;function as(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var hh="#e5e7eb",uh="#c7cbd1",ph="#6b7280",fh=["#6b7280","#5b6470","#4b5563","#374151"],mh=["#cbd5e1","#e2e8f0","#f8fafc"],gh="#d1d5db",bh="#b8bdc4",yh="#273142",Sh="#526078",vh="#f1f5f9",wh="#374151",kh="#64748b",xh="#111827",ls="#6b7280",cs="#374151";var ds="#4b5563",hs=.4,Pe=.16,us="rgba(244,246,248,0.06)",bi=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function ps(t,e,i){let o=new Map;for(let s of t){let a=e(s);!a||i(a)||o.set(a,(o.get(a)??0)+1)}let n=null,r=0;for(let[s,a]of o)(a>r||a===r&&n!=null&&s<n)&&(n=s,r=a);return n}function le(t){return V(t)?{sectionFill:hh,sectionStroke:uh,sectionInk:ph,focalFill:gh,focalStroke:bh}:{sectionFill:yh,sectionStroke:Sh,sectionInk:vh,focalFill:wh,focalStroke:kh}}function fo(t,e){let i=t.sectionFill,o=V(i),n=o?de(i,.6):Qn(Le(i,.2),.85);switch(e){case"closed":return o?de(i,.4):Le(i,.12);case"sold-out":return n;case"nearly-gone":return ee(i,n,.4);default:return i}}var fs=.28,ms=.42,Lh=.55,Ch=.7;function gs(t,e,i){let o=le(t),n=fo(o,e);if(!i||e==="sold-out"||e==="closed")return{fill:n,stroke:o.sectionStroke};let r=V(t);return{fill:ee(n,i,r?ms:fs),stroke:D(i,r?Ch:Lh)}}var Ph=.03;function bs(t,e){let i=le(t);return!["normal","nearly-gone","sold-out","closed"].map(n=>fo(i,n).toLowerCase()).includes(e.trim().toLowerCase())&&mo(t,e)}function mo(t,e){let i=eo(e);if(!i)return!1;let o=le(t),n=Math.max(fs,ms)+Ph;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=eo(fo(o,r));return s?Math.max(Math.abs(s[0]-i[0]),Math.abs(s[1]-i[1]),Math.abs(s[2]-i[2]))/255<=n:!1})}var Th="#f8fafc",Ih="#f4f6fb",Mh="#111827",Rh=.72;function ys(t){let e=V(t),i=e?Th:xh,o=e?Mh:Ih,n=ee(o,i,1-Rh);return{plate:i,ink:o,subInk:io(n,i)>=jn?n:o}}function Ss(t,e,i,o){if(e)return e;let n=V(i)?mh:fh;for(let r of[i,...n])if(io(r,t)>=o)return r;return ue(t,e,i,o)}import{Shape as Eh}from"konva/lib/Shape";import{Circle as Fh}from"konva/lib/shapes/Circle";import{Rect as _h}from"konva/lib/shapes/Rect";var Ah={M:2,L:2,Q:4,C:6,Z:0},go=new Map;function bo(t){let e=go.get(t);if(e)return e;let i=nt(t);if(!i)return go.set(t,[]),[];let o=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],n=[],r=0;for(;r<o.length;){let s=o[r++],a=Ah[s];if(a===void 0||r+a>o.length)throw new Error(`Invalid path data for seat glyph "${t}".`);let l=o.slice(r,r+a).map(Number);if(l.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${t}".`);r+=a,s==="M"||s==="L"?n.push({command:s,points:l}):s==="Q"?n.push({command:s,points:l}):s==="C"?n.push({command:s,points:l}):n.push({command:"Z",points:[]})}return go.set(t,n),n}function vs(t,e,i,o=0,n=0){let r=bo(e),s=ir(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=or(s,i);t.save(),t.translate(o,n),t.scale(a.scale,a.scale),t.translate(-a.centreX,-a.centreY);for(let l of r)l.command==="M"?t.moveTo(l.points[0],l.points[1]):l.command==="L"?t.lineTo(l.points[0],l.points[1]):l.command==="Q"?t.quadraticCurveTo(l.points[0],l.points[1],l.points[2],l.points[3]):l.command==="C"?t.bezierCurveTo(l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]):t.closePath();return t.restore(),!0}function ws(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var Ye=class extends Eh{_sceneFunc(e){let i=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,n=bo(o),r=this.attrs.seatGlyphDetail,s;if(r===void 0){let a=this.getAbsoluteScale(),l=Math.max(Math.abs(a.x),Math.abs(a.y)),c=Number.isFinite(l)&&l>0?l:1;s=i*2*c>=16}else s=r;if(!n.length||!s){ws(e,i),e.fillStrokeShape(this);return}e.beginPath(),vs(e,o,i),e.fillStrokeShape(this)}_hitFunc(e){ws(e,this.attrs.seatRadius||1),e.fillStrokeShape(this)}getSelfRect(){let e=this.attrs.seatRadius||1;return{x:-e,y:-e,width:e*2,height:e*2}}};function yo(t,e){return t==="circle"||!nt(t)?null:new Ye({x:e.x,y:e.y,seatRadius:e.radius,seatGlyph:t,...e.detail===void 0?{}:{seatGlyphDetail:e.detail},...e.fill?{fill:e.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function ks(t){let{x:e,y:i,radius:o}=t;return t.wheelchairBay?new _h({x:e,y:i,width:o*2,height:o*2,offsetX:o,offsetY:o,cornerRadius:2,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):yo(t.glyph,{x:e,y:i,radius:o,detail:t.detail,fill:t.fill})??new Fh({x:e,y:i,radius:o,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Bh(t,e){return t*2*e>=16}function xs(t,e,i,o){let n=Bh(e,i);if(n===o||!t.length)return n;for(let r of t)r.setAttr("seatGlyphDetail",n);return n}function yi(t){return t?.35:.3}function Ps(t){if(t<=0||t>=1)return 1;let e=1.25-1;if(t<.45){let o=t/.45;return 1+e*(1-(1-o)**2)}let i=(t-.45)/(1-.45);return 1+e*Math.cos(i*Math.PI*1.5)*(1-i)**2}function So(t){let e=t<=0?0:t>=1?1:t,i=1-(1-e)**3;return{radiusScale:1+(2.5-1)*i,opacity:.55*(1-e)}}var Ts=700,Oh=2400,vo=12,Is=30,Ls=1,Dh=1.16,Cs=.5,Nh=1;function wo(t){return t*.61803398875%1}function Ms(t,e){let o=((t/Oh+e)%1+1)%1,n=(1-Math.cos(o*2*Math.PI))/2;return{scale:Ls+(Dh-Ls)*n,opacity:Cs+(Nh-Cs)*n}}var As;function Es(t){As=t}function Hh(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var Rs=new Map;function Gh(t,e){let i=t??As,o=`${i??""}|${JSON.stringify(e)}`,n=Rs.get(o);return n||(n=new Intl.DateTimeFormat(i,e),Rs.set(o,n)),n}var Wh={dateStyle:"medium",timeStyle:"short"};function Fs(t,e={}){let{locale:i,...o}=e,n=Hh(t);if(!Number.isFinite(n))return"";let r=Object.keys(o).length?o:Wh;return Gh(i,r).format(n)}var hb="USD",ub=["USD","EUR","GBP","CAD","AUD","INR","AED","SAR","KWD","QAR","BHD","OMR","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL","ARS","CLP","COP","PEN","UYU","IDR","PHP","THB","VND","MYR","NGN","GHS","KES","UGX","TZS","RWF","XAF","XOF","EGP"],Bs;function Os(t){Bs=t}var _s=new Map;function ko(t,e,i,o){let n=o??Bs,r=`${n??""}|${t}|${e??"auto"}|${i??"auto"}`,s=_s.get(r);return s||(s=new Intl.NumberFormat(n,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),_s.set(r,s)),s}function Ue(t,e="USD",i,o){if(typeof i=="object"){let r=i;try{return ko(e,r.minimumFractionDigits,r.maximumFractionDigits,r.locale).format(t)}catch(s){if(r.fallback)return r.fallback(t,e);throw s}}let n=i??(Number.isInteger(t)?0:void 0);return ko(e,n,n,o).format(t)}var Vh={BIF:0,CLP:0,DJF:0,GNF:0,JPY:0,KMF:0,KRW:0,MGA:0,PYG:0,RWF:0,UGX:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,BHD:3,IQD:3,JOD:3,KWD:3,LYD:3,OMR:3,TND:3};function zh(t="USD"){return Vh[t.toUpperCase()]??2}function Kh(t,e="USD"){return t/10**zh(e)}function pb(t,e="USD",i){return Ue(Kh(t,e),e,void 0,i)}function fb(t="USD"){return ko(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Rt={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired and the seats were released. Pick again.","picker.holdExpiredTitle":"Your seats were released","picker.holdExpiredBody":"Your hold time ran out and the seats went back on sale.","picker.holdExpiredRestart":"Choose seats again","picker.holdExpiredPickAgain":"Pick your seats again to continue. They may already be taken.","picker.releasedPair":"{first} \xB7 {second}","picker.releasedSeatPlace":"Section {section}, Row {row}, Seat {seat}","picker.releasedSeatRange":"Section {section}, Row {row}, Seats {from}\u2013{to}","picker.releasedInSection":"{seats} in Section {section}","picker.releasedInSections":"{seats} in Sections {sections}","picker.releasedGa":"{quantity} \xD7 {area}","picker.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","picker.testModeExplained":"Bookings here are not real and no card is charged","picker.findClosestSeatsTogether":"Find the closest seats together","picker.findSeatsTogether":"Find seats together","picker.addSeat":"Add seat","picker.removeSeat":"Remove seat","picker.added":"Added","picker.findSeats":"Find seats","picker.findBestSeats":"Find best seats","picker.displayOptions":"Display options","picker.closeVenueNavigation":"Close venue navigation","picker.orphanHint":"This leaves a single seat stranded. Consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.beaconAria":"Go to your {seats} in {name}","map.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview: groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks: sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats: blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.seatsLeftShort":"{count} left","picker.overview":"Venue","picker.entrance":"Entrance","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","picker.viewSeats":"View seats","picker.tapSeatHint":"Tap any seat to check its view","picker.ticketTierFor":"Ticket tier for {label}","picker.viewFromSeat":"View from seat {label}","picker.real360":"REAL 360\xB0","picker.preview":"PREVIEW","picker.sightline":"\u2248 {m} m to stage","picker.panorama360":"360\xB0 venue photo","picker.illustrationCaption":"illustration \xB7 \u2248 {m} m from stage","picker.restrictedView":"Restricted view","picker.obstructedView":"Obstructed view","picker.premiumSeat":"Premium seat","picker.access.wheelchair":"Wheelchair space","picker.access.companion":"Companion seat","picker.access.semi-ambulatory":"Semi-ambulatory (limited mobility)","picker.access.designated-aisle":"Designated aisle / transfer seat","picker.access.step-free":"Step-free accessible seat","picker.access.hearing":"Assistive listening","picker.access.cart":"CART live-caption view","picker.access.sign-language":"Sign-language view","picker.access.low-vision":"Blind / low-vision viewing","picker.access.sensory-friendly":"Quiet / sensory-friendly seating","picker.access.plus-size":"Plus-size seat","picker.access.lift-armrest":"Lift-up armrest","picker.accessShort.wheelchair":"Wheelchair space","picker.accessShort.companion":"Companion seat","picker.accessShort.semi-ambulatory":"Limited mobility","picker.accessShort.designated-aisle":"Aisle / transfer","picker.accessShort.step-free":"Step-free","picker.accessShort.hearing":"Assistive listening","picker.accessShort.cart":"Live captions","picker.accessShort.sign-language":"Sign language","picker.accessShort.low-vision":"Low vision","picker.accessShort.sensory-friendly":"Sensory-friendly","picker.accessShort.plus-size":"Plus-size","picker.accessShort.lift-armrest":"Lift-up armrest","picker.organizerNote":"Organizer note","picker.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count}. Showing best overall","picker.loading3d":"Building the 3D venue\u2026","picker.unavailable3d":"3D could not start. The seat map is still available.","picker.jumpToSection":"Jump to section","picker.salesClosedPill":"Sales are closed","picker.salesClosedCopy":"Ticket sales for this event have ended.","picker.salesNotOpenPill":"Sales haven\u2019t opened yet","picker.salesNotOpenCopy":"Tickets for this event aren\u2019t on sale yet.","picker.salesPausedPill":"Sales are paused","picker.salesPausedCopy":"Ticket sales are paused for now.","picker.salesClosedCta":"Sales closed","picker.salesClosedToast":"Sales are closed for this event.","picker.securingSeats":"Securing your seats\u2026","picker.openingCheckout":"Opening secure checkout\u2026","picker.peekSecured":"\u2713 {count} secured \xB7 {total}. You won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types. Tap one below to show just those seats.","picker.aboutTicketPrices":"About ticket prices","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now.","picker.accessExpiredTitle":"The seat map timed out","picker.accessInvalidBody":"You can still book anything shown as available. Contact whoever sent you here for access to the rest.","picker.accessInvalidTitle":"We couldn\u2019t verify your access","picker.accessPausedBody":"The organizer has paused this selection. Try again in a few minutes.","picker.accessPausedTitle":"These seats are on hold right now","picker.accessRefresh":"Refresh","picker.accessRetry":"Try again","picker.accessRevokedBody":"Ask whoever sent you here for a new link to keep booking these seats.","picker.accessRevokedTitle":"This access link is no longer active","picker.idlePausedBody":"Refresh to see what\u2019s available now.","picker.idlePausedTitle":"The seat map paused while you were away","picker.accessiblePhysicalSeat":"Accessible physical seat","picker.addMinutes":"+{count} min","picker.accessibilityOptions":"Accessibility and colour options","picker.addingEllipsis":"Adding\u2026","picker.allLevels":"All levels","picker.allPlacesBookedTogether":"All {count} places are booked together as one exclusive table.","picker.allPrices":"All prices","picker.allSeats":"All seats","picker.allSetTitle":"You\u2019re all set","picker.anyTicketType":"Any ticket type","picker.anyVenueZone":"Any venue zone","picker.areas":"Areas","picker.available":"Available","picker.backToMap":"Back to map","picker.backToVenue":"Back to venue","picker.bestSeatsStar":"\u2726 Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.chartDerivedModel":"Chart-derived model","picker.chartDerivedSeatEye":"Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed","picker.checkConnection":"Check your connection and try again.","picker.checkoutCouldNotBeOpened":"Checkout could not be opened. Your seats are still held. Please try again.","picker.chooseAnotherToCompare":"Choose another seat to compare.","picker.chooseGuestsCopy":"Choose how many guests will sit together. This table is held exclusively for your party.","picker.chooseMinMaxGuests":"Choose {min}\u2013{max} guests","picker.clearSavedSeatComparison":"Clear saved seat comparison","picker.close":"Close","picker.closeSeatStatus":"Close seat status","picker.closestGroupChosenInstantly":"Closest available group, chosen instantly.","picker.aboutBestSeats":"About finding seats together","picker.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","picker.accessFreeCount":"{count} free","picker.accessSpreadHint":"{count} accessible spaces in {sections} sections \xB7 tap a highlighted section","picker.holdLapsedStillFree.one":"Your hold ended while you were away. That seat is still free.","picker.holdLapsedStillFree.other":"Your hold ended while you were away. Those seats are still free.","picker.holdLapsedSomeTaken.one":"Your hold ended while you were away, and {count} of those seats has been taken. The rest are still free.","picker.holdLapsedSomeTaken.other":"Your hold ended while you were away, and {count} of those seats have been taken. The rest are still free.","picker.holdLapsedAllTaken.one":"Your hold ended while you were away, and that seat has been taken.","picker.holdLapsedAllTaken.other":"Your hold ended while you were away, and those seats have been taken.","picker.holdLapsedSelectAgain.one":"Select it again","picker.holdLapsedSelectAgain.other":"Select them again","picker.compareCount":"Compare {count}","picker.compareWithSaved":"Compare with saved","picker.confirmOrCancelSeat":"Confirm or cancel this seat","picker.confirmSeatLabel":"Confirm seat {label}","picker.confirmYourTable":"Confirm your table","picker.confirmedAndOnWay":"confirmed. A confirmation is on its way.","picker.continue":"Continue","picker.continueToCheckout":"Continue to checkout","picker.couldNotAddMoreTime":"Couldn\u2019t add more time. Please head to checkout now.","picker.savedSeatsNotRestored":"Your earlier seats could not be restored. Please choose again.","picker.couldNotFindSeatsTogether":"We couldn\u2019t find {count} seats together. Try fewer seats or another ticket type.","picker.couldNotReleaseTickets":"Couldn\u2019t release your tickets. Your hold is unchanged.","picker.couldNotRemoveLabel":"Couldn\u2019t remove {label}. Your hold is unchanged.","picker.currentOffer":"Current offer","picker.currentTicketOffer":"Current ticket offer","picker.dragToLookAround":"Drag to look around \xB7 scroll to zoom","picker.dragToLookTouch":"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close","picker.dragToLookMouse":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close","picker.emptyWheelchairSpace":"Empty wheelchair space","picker.exitFullScreen":"Exit full screen","picker.fewer":"Fewer","picker.fewerGuests":"Fewer guests","picker.fewerSeats":"Fewer seats","picker.filterAndFocusByPrice":"Filter and focus seats by price","picker.filters":"Filters","picker.findBestSeatsCount.one":"Find {count} best seat","picker.findBestSeatsCount.other":"Find {count} best seats","picker.findBestSeatsTogether":"Find the best seats together","picker.findNewSeats":"Find new seats","picker.findingBestSeats":"Finding the best seats\u2026","picker.findingEllipsis":"Finding\u2026","picker.flat2dMap":"Flat 2D map","picker.flexiblePartyTypeWord":"Flexible party \xB7 {typeWord}","picker.fullScreen":"Full screen","picker.generalAdmission":"General admission","picker.guestCountCouldNotBeSecured":"That guest count could not be secured. Your current table hold is unchanged.","picker.guestCountNoLongerAvailable":"That guest count is no longer available. Your current hold is unchanged.","picker.guests":"Guests","picker.guestsCount":"{count} guests","picker.guestsCountEdit":"{count} guests \xB7 Edit","picker.held":"Held","picker.heldByOther":"Held by another buyer, may become available","picker.heldForYou":"Held for you","picker.heldSeatExplanation":"Another buyer is holding this seat. It may become available again.","picker.hidePanel":"Hide panel","picker.hideTicketPanel":"Hide the ticket panel","picker.holdSeatsAndCheckout":"Hold seats & checkout","picker.howOfferWorks":"How the {name} offer works","picker.interactive3dVenueView":"Interactive 3D venue view","picker.keepMine":"Keep mine","picker.labelNoLongerAvailable":"{label} is no longer available.","picker.labelRemoved":"{label} removed.","picker.labelRemovedFromHold":"{label} removed from your hold.","picker.labelRestored":"{label} restored.","picker.labelsNoLongerAvailable.one":"{labels} is no longer available. Choose another seat.","picker.labelsNoLongerAvailable.other":"{labels} are no longer available. Choose another group.","picker.leftCount.one":"{count} left","picker.leftCount.other":"{count} left","picker.levelNumber":"Level {number}","picker.levels":"Levels","picker.loadingSeatMap":"Loading seat map\u2026","picker.lookAroundLive3d":"Look around in live 3D","picker.manualTicketsRemovedNote":"Your manually selected tickets will be removed only after a new group is secured.","picker.map":"Map","picker.mapDidNotLoad":"The seat map didn\u2019t load","picker.eventUnavailableTitle":"This event isn\u2019t available","picker.eventUnavailable":"Tickets can\u2019t be booked here right now.","picker.maxTicketsForOrder":"You can select up to {count} tickets for this order.","picker.selectExactMore":"Select {count} more","picker.selectExactCount":"Select exactly {count} tickets","picker.selectMinimumMore":"Select {count} more","picker.adjustSeatSelection":"Adjust seat selection","picker.selectSeatsTogether":"Choose seats together in the same row and ticket category.","picker.minToMaxGuests":"{min} to {max} guests","picker.more":"More","picker.moreCount":"+{count} more","picker.showLess":"Show less","picker.moreGuests":"More guests","picker.moreSeats":"More seats","picker.moreTimeAdded":"More time added. Your seats are still held.","picker.noAccessibilityMetadata":"No accessibility metadata supplied","picker.noAuthoredRestriction":"No organizer-authored restriction","picker.noSeatsSelected":"No seats selected","picker.notForSale":"Not for sale","picker.notAvailable":"Not available","picker.notForSaleExplanation":"This seat is not included in the current sale.","picker.numberOfGuests":"Number of guests","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.","picker.offerDetailUpcoming":"Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts.","picker.offerRemainingAvailable":"{count} available","picker.offerStarts":"starts {time}","picker.offerUntil":"until {time}","picker.oneSeatSaved":"1 seat saved","picker.oneSeatSavedChooseAnother":"One seat saved; choose another to compare","picker.openAuthored360":"Open venue 360\xB0","picker.openComparison":"Open comparison","picker.openComparisonOfSeats":"Open comparison of {count} seats","picker.openTicketPanel":"Open ticket panel","picker.peekFromPrice":"From {price}","picker.peekTicketsTotal.one":"{count} ticket \xB7 {total}","picker.peekTicketsTotal.other":"{count} tickets \xB7 {total}","picker.perGuestPrice":"{price} per guest","picker.pickYourSeats":"Pick your seats","picker.preferredTicketType":"Preferred ticket type","picker.preferredVenueZone":"Preferred venue zone","picker.priceNotSupplied":"Price not supplied","picker.removeHeldTicketLabel":"Remove held ticket {label}","picker.removeSeatLabel":"Remove {label}","picker.removeTicketsUntilOrFewer":"Remove tickets until your order has {count} or fewer.","picker.replaceCurrentChoices":"Replace your current choices?","picker.review":"Review","picker.row":"Row","picker.rowLabel":"Row {label}","picker.saveToCompare":"Save to compare","picker.savedForComparison":"Saved for comparison","picker.savedSeatComparison":"Saved seat comparison","picker.scheduledOffer":"Scheduled offer","picker.seat":"Seat","picker.seatCount.one":"{count} seat","picker.seatCount.other":"{count} seats","picker.seatJustTakenByAnother":"Seat {label} was just taken by another buyer.","picker.seatLabel":"Seat {label}","picker.seatNoLongerAvailable":"That seat is no longer available.","picker.seatNoLongerYours":"Some seats are no longer available to you. They have been removed from your order.","picker.seatNumberLower":"seat {label}","picker.seatSalesClosedForEvent":"Seat sales have closed for this event.","picker.maintenancePaused.one":"Booking is paused for maintenance. Please try again in about {count} minute.","picker.maintenancePaused.other":"Booking is paused for maintenance. Please try again in about {count} minutes.","picker.maintenancePausedShortly":"Booking is paused for a few minutes for maintenance. Please try again shortly.","picker.seatSelection":"Seat selection","picker.seatStatusLegend":"Seat status legend","picker.seatTaken":"Someone else took a seat you had picked. It has been removed from your order.","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.seeItIn3d":"See it in 3D","picker.select":"Select","picker.selectSeats":"Select seats","picker.selectTable":"Select table","picker.selectWholeTable":"Select whole table","picker.selected":"Selected","picker.selectingEllipsis":"Selecting\u2026","picker.showAllSeats":"Show all seats","picker.showAllTicketTypes":"Show all {count} ticket types","picker.showFewer":"Show fewer","picker.showLabelSeatsOnMap":"Show {label} seats on the map","picker.showTicketPanel":"Show the ticket panel","picker.sold":"Sold","picker.soldOutCopy":"No reserved seats are currently available for this event.","picker.soldOutEyebrow":"This event","picker.soldOutTitle":"Sold out","picker.soldSeatExplanation":"This seat has already been booked.","picker.statusAvailable":"available","picker.statusOnHold":"on hold","picker.statusTaken2":"taken","picker.table":"Table","picker.tableCapacity":"Table capacity","picker.tableUpdatedForGuests":"{label} updated for {count} guests.","picker.temporarilyHeld":"Temporarily held","picker.ticketPrices":"Ticket prices","picker.ticketTypeNotChanged":"That ticket type is not available for this seat. Your hold is unchanged.","picker.ticketTypeSoldOut":"That ticket type is sold out. Try another ticket type.","picker.tickets":"Tickets","picker.ticketsCount.one":"{count} ticket","picker.ticketsCount.other":"{count} tickets","picker.toggleColorblindColors":"Toggle colorblind-friendly colors","picker.total":"Total","picker.trayHintTapOrBest":"Tap a seat on the map, or let us pick the best available for you.","picker.aboutYourSeats":"How to choose seats","picker.trayHintTapOrStanding":"Tap a seat on the map or grab standing tickets below.","picker.undo":"Undo","picker.upcomingTicketOffer":"Upcoming ticket offer","picker.updateTable":"Update table","picker.updatingEllipsis":"Updating\u2026","picker.venueView":"Venue view","picker.recentreOnStage":"Recentre on the stage","picker.stopYourSeat":"Your seat","picker.stopYourRow":"Your row","picker.stopYourSection":"Your section","picker.stopWholeVenue":"Whole venue","picker.viewFromHere":"View from here","picker.viewFromYourSeat":"view from your seat","picker.fromYourSeat":"from your seat","picker.viewFromThisSeat":"View from this seat","picker.wholeTypeWord":"Whole {typeWord}","picker.willChooseClosestGroup":"We\u2019ll choose the closest available group for you.","picker.willFindSeatsTogether":"We\u2019ll find {count} seats together.","picker.yourSeats":"Your seats","picker.zoomIn":"Zoom in","picker.zoomOut":"Zoom out","picker.fitWholeVenue":"Show whole venue","picker.dragToRotateVenue":"Drag to rotate the venue","picker.dragToMoveVenue":"Drag to move the venue","picker.closeVenueNav":"Close","picker.levelsAndAreas":"Levels & areas","picker.gaChooseTickets":"How many tickets?","picker.gaAdd.one":"Add {count} ticket \xB7 {price}","picker.gaAdd.other":"Add {count} tickets \xB7 {price}","picker.gaUpdate.one":"Update \xB7 {count} ticket","picker.gaUpdate.other":"Update \xB7 {count} tickets","picker.gaRemove":"Remove","picker.gaAreasHeading":"Areas","picker.gaTrayHintTapArea":"Tap an area on the map to choose tickets.","picker.gaAdded.one":"{count} {area} ticket added, {price}","picker.gaAdded.other":"{count} {area} tickets added, {price}","picker.gaRemoved":"{area} tickets removed","picker.gaChooseForArea":"Choose tickets for {area}","picker.holdSeatsForAllPerformances":"Hold seats for all {count} performances","picker.completeAllPerformances":"Complete all performances ({complete}/{total})","picker.groupTrayHint":"Choose seats once \u2014 the same seats will be held for every performance.","picker.groupPerPerformanceTrayHint":"Choose seats for this performance, then complete every date above.","picker.group.sameSeatSummary":"Choose once. The same seats will be held for all {count} performances.","picker.group.perPerformanceSummary":"Choose seats for each performance. All {count} selections are held together.","picker.group.allDates":"All {count} dates included","picker.group.flexibleDatesInView":"All {count} dates in view","picker.group.flexibleDatesSelected":"{selected} of {total} dates selected","picker.group.performances":"Performances","picker.group.heldForEveryPerformance":"Held for every performance","picker.group.notStarted":"Not started","picker.group.inProgress":"In progress","picker.group.complete":"Complete","picker.group.needsAttention":"Needs attention","picker.group.previousPerformance":"Previous performance","picker.group.nextPerformance":"Next performance","picker.group.performanceOpened":"Now choosing seats for {performance}.","picker.group.checkingAvailability":"Checking seats available for every performance\u2026","picker.group.securing":"Securing these seats for every performance. Please wait.","picker.group.commitPending":"We\u2019re still securing these seats for every performance. SeatLayer will keep working; this page is checking the result.","picker.group.outcomeUnknown":"We\u2019re checking whether your seats were secured. Don\u2019t choose other seats yet.","picker.group.longRunning":"This is taking longer than usual. We\u2019re still checking the same request. Don\u2019t submit it again. Reference: {reference}.","picker.group.abortPending":"We couldn\u2019t secure every performance. We\u2019re checking that all seats are released before you try again.","picker.group.secured":"Seats secured for every performance. Continue when you are ready.","picker.group.notSecured":"We couldn\u2019t secure these seats for every performance. Nothing is held. Try again.","picker.group.retry":"Try again","picker.group.salesClosed":"Seats for this performance set are not available now. Return to the event page for other options.","picker.group.revisionChanged":"This performance set changed. Review the included performances before choosing seats again.","picker.group.legendTitle":"Seat availability","picker.group.legendUnavailable":"Unavailable","picker.group.partlyAvailableTitle":"Free on some nights only","picker.group.notAvailableOn":"Not available on {dates}","picker.group.nightFree":"Free","picker.group.nightBlocked":"Not available","picker.group.pickSeatFreeEveryNight":"Pick a seat that is free every night.","picker.group.chooseNightByNight":"Choose seats night by night","picker.group.nightByNightStarted":"Now choosing seats for each performance separately. Your selection was cleared.","picker.group.yourSeatsByNight":"Your seats by night","picker.group.noSeatsChosenYet":"No seats yet","picker.group.chosenOfTotal":"{chosen} of {total}","picker.group.needsMoreSeats":"Needs {count} more","picker.group.closeSeatDetails":"Close seat details","picker.group.seatPartlyAvailable":"{label}: free on {free} of {total} performances. Not available on {dates}.","picker.group.selectAvailableDates":"Select for {count} available dates","picker.group.selectedAvailableDates":"Selected for {count} available dates.","picker.group.clearBeforePartial":"Clear your current seats before choosing a different date set.","picker.group.legendAvailable":"Available","picker.group.legendSelected":"Selected","picker.group.legendNotEveryDate":"Not open on every date","picker.group.progressLabel":"Booking steps","picker.group.stepPerformances":"Performances","picker.group.stepSeats":"Seats","picker.group.stepReview":"Review","picker.group.stepDone":"Done","picker.group.stepCurrent":"Current step","picker.group.includedNote":"All {count} performances are included \xB7 dates cannot be removed here","picker.group.flexibleDatesNote":"Choose a partial seat to include only the dates where it is available.","picker.group.flexibleSelectedNote":"Only these {count} dates will be held for this seat.","picker.group.yourSelection":"Your selection","picker.group.pricesPerPerformance":"Prices shown per performance","picker.group.total":"Total","picker.group.heldTogether":"All {count} performance selections are held together \xB7 {time} remaining","picker.group.completeWithSeats":"Complete \xB7 {seats}","picker.group.stillNeedsSeat":"Still needs a seat","picker.group.sameSeatMapHelp":"One chart shows only seats available for every selected performance.","picker.group.perPerformanceMapHelp":"Switch dates above; the map position and each choice stay saved.","picker.group.bookedAll":"You\u2019re all set \u2014 seats booked for all {count} performances.","picker.group.seatsEveryPerformance.one":"{count} seat \xB7 every performance","picker.group.seatsEveryPerformance.other":"{count} seats \xB7 every performance","picker.group.seatsPerPerformance.one":"{count} seat \xB7 {per} per performance","picker.group.seatsPerPerformance.other":"{count} seats \xB7 {per} per performance","picker.group.performancesChosenOf.one":"{chosen} of {total} performances chosen \xB7 {count} seat","picker.group.performancesChosenOf.other":"{chosen} of {total} performances chosen \xB7 {count} seats","picker.group.ticketsConfirmedAcross.one":"{count} ticket confirmed across {performances} performances","picker.group.ticketsConfirmedAcross.other":"{count} tickets confirmed across {performances} performances","checkout.free":"Free","checkout.confirmBooking":"Confirm booking","checkout.price":"Price","checkout.freeNote":"This event is free. Nothing is charged.","checkout.confirmingBooking":"Confirming your booking\u2026","checkout.confirmingSeats":"Confirming your seats\u2026","checkout.busyRetryingBooking":"Busy right now. Still confirming your booking\u2026","checkout.busyRetryingPayment":"Busy right now. Still opening secure payment\u2026","checkout.busyFailedBooking":"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.busyFailedPayment":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.seatsUnavailable":"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.","checkout.title":"Checkout","checkout.back":"Back to seats","checkout.heldFor":"Seats held for {time}","checkout.yourOrder":"Your order","checkout.row":"Row {row}","checkout.seat":"Seat {seat}","checkout.quantity":"{label} \xD7 {count}","checkout.showAll":"Show all {count} seats","checkout.yourDetails":"Your details","checkout.email":"Email","checkout.emailHint":"Your tickets are sent here.","checkout.name":"Name","checkout.namePlaceholder":"Your name","checkout.optional":"Optional","checkout.forSomeoneElse":"Ticket for someone else?","checkout.holderYou":"You \xB7 {name}","checkout.holderYouPlain":"You","checkout.change":"Change","checkout.changeHolder":"Change the holder of {ticket}","checkout.addNames":"Add names for each ticket","checkout.questions":"A few questions","checkout.payWith":"Pay with","checkout.continue":"Continue to payment","checkout.continueTest":"Continue to test payment","checkout.tryAgain":"Try again","checkout.trust":"Secure payment on the organizer\u2019s payment page. We never see your card.","checkout.freeTrust":"Free booking. Nothing is charged.","checkout.testStrip":"No real charge \xB7 tickets not valid for entry","checkout.testStripFree":"Test booking \xB7 tickets not valid for entry","checkout.privacy":"The organizer and SeatLayer use your details to issue and manage your tickets.","checkout.privacyLink":"Privacy Policy","checkout.expiringSoon":"Your seats are held for {time}. Finish soon to keep them.","checkout.opening":"Opening secure payment\u2026","checkout.redirectTitle":"Taking you to secure payment","checkout.redirectBody":"You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.","checkout.waitingPayment":"Waiting for payment\u2026","checkout.dontClose":"Don\u2019t close this tab.","checkout.confirmingTitle":"Confirming your seats","checkout.paymentReceived":"Payment received. This usually takes a few seconds.","checkout.noNeedPayAgain":"You don\u2019t need to pay again.","checkout.stillConfirmingTitle":"Still confirming","checkout.stillConfirming":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.","checkout.nothingCharged":"Nothing was charged.","checkout.expiredTitle":"Your seats were released","checkout.expiredBody":"The hold on {seats} ran out before payment started.","checkout.chooseAgain":"Choose seats again","checkout.takenTitle":"Those seats were just taken","checkout.takenBody":"Someone booked {seats} while you were filling this in.","checkout.chooseOther":"Choose other seats","checkout.networkTitle":"Couldn\u2019t reach checkout.","checkout.networkBody":"Check your connection and try again. Nothing was charged, and your seats are still held.","checkout.error.email":"Enter an email like name@example.com.","checkout.error.notTakingPayments":"This event is not taking online payments yet. Contact the organizer to buy these seats.","checkout.error.accessEnded":"Your access to this private sale has ended. Nothing was charged. Ask whoever sent you the link for a new one.","checkout.error.holdReleased":"Your seats were released before checkout started. Nothing was charged. Please pick again.","checkout.error.releasedBeforePayment":"Your seats were released before payment completed. Nothing was charged. Please pick again.","checkout.error.paymentFailed":"The payment did not complete. If you were charged, it has been refunded automatically.","checkout.error.alreadyStarted":"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.","checkout.error.eventClosed":"Sales for this event have closed.","checkout.error.salesPaused":"Ticket sales are paused for a moment while the organizer updates their account. Nothing was charged. Please try again later or contact the organizer.","checkout.error.pricing":"These seats can\u2019t be checked out right now because of a pricing setup problem. Nothing was charged. Please contact the organizer.","checkout.error.providerRefused":"The organizer\u2019s payment setup refused this payment. Nothing was charged. Please contact the organizer.","checkout.error.rateLimited":"Too many attempts. Wait a moment and try again.","checkout.error.generic":"We couldn\u2019t start the payment. Nothing was charged. Please try again.","checkout.goingTo":"You\u2019re going to {event}","checkout.confirmedTitle":"Your tickets are confirmed","checkout.sentTo":"Your tickets and QR codes are on their way to {email}, with a printable PDF attached. Show a QR at the door, no printing needed.","checkout.sentToYourEmail":"Your tickets and QR codes are on their way to your email, with a printable PDF attached. Show a QR at the door, no printing needed.","checkout.viewTickets":"View tickets & QR codes","checkout.paid":"Paid","checkout.order":"Order","checkout.keepLink":"Keep this link. It opens your tickets any time: no login, and it does not expire.","checkout.copy":"Copy","checkout.copied":"Copied","checkout.selectCopy":"Select & copy","checkout.linkCopied":"Link copied.","checkout.clipboardBlocked":"Your browser blocked the clipboard. The link is selected, press \u2318C / Ctrl+C.","bookingForm.ticketHolders":"Ticket holders","bookingForm.bookingQuestions":"About your booking","bookingForm.ticketNumber":"Ticket {number}","bookingForm.guestOf":"{area} \xB7 Guest {index} of {total}","bookingForm.useMyDetails":"Use my details","bookingForm.syncedHint":"Filled in from your details above.","bookingForm.name":"Name","bookingForm.email":"Email","bookingForm.phone":"Phone","bookingForm.optional":"(optional)","bookingForm.fixErrors":"Some details need attention before you continue.","bookingForm.error.required":"{field} is required.","bookingForm.error.tooLong":"{field} must be {max} characters or fewer.","bookingForm.error.email":"{field} must be a valid email address.","bookingForm.error.phone":"{field} must be 6\u201320 characters: digits, spaces, + - ( ).","bookingForm.error.number":"{field} must be a number.","bookingForm.error.date":"{field} must be a date.","bookingForm.error.choice":"Choose a valid option for {field}.","bookingForm.error.invalid":"Check {field}.","tickets.editNames":"Edit names","tickets.editNamesHint":"You can correct names until the event starts.","tickets.saveNames":"Save names","tickets.savingNames":"Saving\u2026","tickets.cancel":"Cancel","tickets.namesSaved":"Names updated.","tickets.editClosed":"Names can\u2019t be changed after the event starts.","tickets.saveFailed":"Couldn\u2019t save the names. Check your connection and try again.","picker.bookingForm.ticket":"Ticket {number}","picker.bookingForm.useMyDetails":"Use my details","picker.bookingForm.name":"Name","picker.bookingForm.email":"Email","picker.bookingForm.phone":"Phone","picker.bookingForm.optional":"{label} (optional)","picker.bookingForm.choose":"Choose\u2026","picker.bookingForm.required":"This is required.","picker.bookingForm.invalid":"Check this answer.","picker.bookingForm.invalidEmail":"Enter a valid email address.","picker.bookingForm.invalidPhone":"Enter a valid phone number.","picker.bookingForm.tooLong":"This is too long.","picker.bookingForm.fix":"Some details need attention.","picker.bookingForm.unsupported":"This event needs details for each ticket holder that this checkout can\u2019t collect. Your seats are still held and nothing was charged.","picker.bookingForm.continueOnEventPage":"Continue on the event page","picker.bookingForm.guestOfCount":"{label} \xB7 Guest {index} of {total}","buyer.testBookingStrip":"Test booking: no real charge, tickets not valid for entry","buyer.testTicketNotValid":"Test ticket: not valid for entry"};var Xh=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hi","hr","hu","id","it","ja","ko","ku","lt","lv","ms","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-Hans","zh-Hant"],vb={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",be:"\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F",bg:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",cy:"Cymraeg",da:"Dansk",de:"Deutsch",el:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",en:"English",es:"Espa\xF1ol",et:"Eesti",fa:"\u0641\u0627\u0631\u0633\u06CC",fi:"Suomi",fr:"Fran\xE7ais",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",hi:"\u0939\u093F\u0928\u094D\u0926\u0940",hr:"Hrvatski",hu:"Magyar",id:"Bahasa Indonesia",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4",ku:"Kurd\xEE",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",ms:"Bahasa Melayu",nl:"Nederlands",no:"Norsk",pl:"Polski",pt:"Portugu\xEAs",ro:"Rom\xE2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",sk:"Sloven\u010Dina",sl:"Sloven\u0161\u010Dina",sr:"\u0421\u0440\u043F\u0441\u043A\u0438",sv:"Svenska",th:"\u0E44\u0E17\u0E22",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",vi:"Ti\u1EBFng Vi\u1EC7t","zh-Hans":"\u7B80\u4F53\u4E2D\u6587","zh-Hant":"\u7E41\u9AD4\u4E2D\u6587"},Ds=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hi","hr","hu","id","it","ja","ko","ku","lt","lv","ms","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-Hans","zh-Hant"],Yh=new Set(["ar","fa","he"]),xo={li:"lt",iw:"he",mo:"ro",sh:"sr",nb:"no",nn:"no",kmr:"ku",in:"id",zsm:"ms",zh:"zh-Hans","zh-cn":"zh-Hans","zh-sg":"zh-Hans","zh-my":"zh-Hans","zh-tw":"zh-Hant","zh-hk":"zh-Hant","zh-mo":"zh-Hant"},Lo=new Map(Xh.map(t=>[t.toLowerCase(),t]));function Uh(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=Lo.get(e)??xo[e];if(i)return i;let o=e.split("-");if(o.length>=2){let n=`${o[0]}-${o[1]}`,r=Lo.get(n)??xo[n];if(r)return r}return Lo.get(o[0])??xo[o[0]]}var $e={en:Rt},Si={},me="en";function Ns(t,e){let i=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let o of[t,e,...i]){if(!o)continue;let n=Uh(o);if(n)return n}return"en"}function wb(){return me}function kb(t=me){return Yh.has(t)?"rtl":"ltr"}function xb(t){return!!$e[t]}function lt(t,e){e&&($e[t]={...$e[t],...e}),me=$e[t]?t:"en",Os(me),Es(me),typeof document<"u"&&(document.documentElement.lang=me)}function Lb(t){Si=t}var Hs=/\{(\w+)\}/g;function B(t,e){let i=Si[t]??$e[me]?.[t]??Rt[t]??t;return e?i.replace(Hs,(o,n)=>String(e[n]??`{${n}}`)):i}function Gs(t,e,i){let o=new Intl.PluralRules(me).select(e);return(Si[`${t}.${o}`]??$e[me]?.[`${t}.${o}`]??Rt[`${t}.${o}`]??Si[`${t}.other`]??$e[me]?.[`${t}.other`]??Rt[`${t}.other`]??t).replace(Hs,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function Cb(t,e){return Fs(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:me})}function Vs(t,e,i,o=!1){let n=t.displayLabel?.trim()||t.label;return o?{title:n,detail:B("map.statusTaken"),sellable:!1}:e==="booked"?{title:n,detail:B("map.statusTaken"),sellable:!1}:e==="held"?{title:n,detail:B("map.statusHeld"),sellable:!1}:{title:n,detail:i()??"",sellable:!0}}var ct=32,Ws=70;function zs(t,e){let i=ct+6,o=t.y-Ws;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:o>=i?o:Math.min(t.y+Ws,e.height-i)}}var To=.8,jh=Math.hypot(.46,.36),Qh=.26,Jh=1.6,eu=2*(1-jh),$s="#0b1220",Ys="#ffffff";function Us(t,e,i,o,n){let r=Math.min(Math.max(Jh,i*Qh),i*eu);return new Io({x:t,y:e,points:[-i*.42,i*.02,-i*.1,i*.34,i*.46,-i*.36],stroke:o,strokeWidth:r,lineCap:"round",lineJoin:"round",...n?{shadowColor:$s,shadowBlur:1.5,shadowOpacity:.55}:{},listening:!1})}function tu(t){if(!(t instanceof Ye)||t.getAttr("seatGlyphDetail")===!1)return null;let e=t.getAttr("seatGlyph");return e&&nt(e)?e:null}var iu=220,ou=.08,vi=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,i,o){let n=o.get(e);if(o.delete(e),!i){this.retire(n);return}n?.destroy();let r=this.host,s=r.seat(e);if(!s)return;let a=r.seatShape(e)?.fill(),l=q(typeof a=="string"?a:"",r.selectionColor(),Ve),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),h=d?null:tu(r.seatShape(e)),u=r.seatRadius(),m=r.seatPoint(s),f=new Co({name:"selection-ring",x:m.x,y:m.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});if(r.viewMode()==="perspective"){let g=r.perspectiveSeatScale(e);f.scale({x:g,y:g})}f.setAttrs({seatId:e,ringColor:l});let b={name:"selection-halo",stroke:D(r.categoryColor(s.categoryKey),yi(V(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let g=u*1.2;f.add(new Po({...b,width:d.width+g*2,height:d.height+g*2,offsetX:(d.width+g*2)/2,offsetY:(d.height+g*2)/2,cornerRadius:8,strokeWidth:Math.max(2,u*.5)}))}else f.add(new De({...b,radius:u*1.6,strokeWidth:Math.max(2,u*.55)}));let p={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(f.add(new Po({...p,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)f.add(new Po({...p,stroke:ii(r.canvasBackground()),width:d.width+10,height:d.height+10,offsetX:(d.width+10)/2,offsetY:(d.height+10)/2,cornerRadius:7,strokeWidth:2.5,opacity:To}));else{let g=Math.max(0,d.width/2-14),y=-Math.max(0,d.height/2-14);f.add(new De({x:g,y,radius:10,fill:l,listening:!1})),f.add(new Io({x:g,y,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:V(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else if(h)this.addGlyphMark(f,h,u,c,p);else{let g=Math.max(1,u-1.25),y=Math.min(2.5,Math.max(1.8,u*.22));if(f.add(new De({...p,radius:g,strokeWidth:y})),c)f.add(new De({...p,stroke:ii(r.canvasBackground()),radius:u+2,strokeWidth:Math.max(2,u*.2),opacity:To}));else{let S=Math.max(0,g-y/2);f.add(Us(0,0,S,Ys,!0))}}o.set(e,f),this.host.overlayLayer.add(f)}addGlyphMark(e,i,o,n,r){let s=this.host,a=s.canvasBackground();if(n){e.add(new De({...r,stroke:ii(a),radius:o+2,strokeWidth:Math.max(2,o*.2),opacity:To}));return}let l=q(a,s.selectionColor(),Ve),c=yo(i,{x:0,y:0,radius:o,fill:l,detail:!0});if(!c)return;c.name("selection-body"),c.listening(!1),e.add(c);let d=nr(i,o);if(!d)return;let h=V(l)?$s:Ys;e.add(Us(d.x,d.y,d.radius,h,!1))}resyncMarkers(e,i){if(e.size){for(let o of[...e.keys()])this.syncMarker(o,!0,e);i()}}retire(e){let i=this.host;if(!e)return;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden){e.destroy();return}let o=performance.now(),n=r=>{if(i.isDestroyed()||!e.getLayer()){e.destroy();return}let s=Math.min(1,(r-o)/160);e.opacity(1-s),i.overlayLayer.batchDraw(),s<1?requestAnimationFrame(n):(e.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(n)}play(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden||!i.seat(e))return;this.emitPulse(e,!0);let o=this.echoTimers.get(e);o&&clearTimeout(o),this.echoTimers.set(e,setTimeout(()=>{this.echoTimers.delete(e),!(i.isDestroyed()||i.reducedMotion())&&(typeof document<"u"&&document.hidden||this.emitPulse(e,!1))},Ts))}emitPulse(e,i){let o=this.host,n=o.seat(e);if(!n)return;let r=o.seatRadius(),s=o.seatPoint(n);this.pulses.get(e)?.destroy();let a=new De({name:"selection-pulse",x:s.x,y:s.y,radius:r,stroke:o.categoryColor(n.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:So(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,a),this.pulseHome().add(a);let l=i&&!o.isCached()?o.seatShape(e):void 0,c=performance.now(),d=()=>{l?.scale({x:1,y:1}),a.destroy(),this.pulses.get(e)===a&&this.pulses.delete(e),o.overlayLayer.batchDraw(),l&&!o.isCached()&&o.seatLayer.batchDraw()},h=u=>{if(o.isDestroyed()){d();return}a.getLayer()||this.pulseHome().add(a);let m=u-c,f=So(m/420);if(a.radius(r*f.radiusScale),a.opacity(f.opacity),l){let b=Ps(m/320);l.scale({x:b,y:b})}o.overlayLayer.batchDraw(),l&&!o.isCached()&&o.seatLayer.batchDraw(),m<420?requestAnimationFrame(h):d()};queueMicrotask(()=>{o.isDestroyed()||typeof requestAnimationFrame!="function"||requestAnimationFrame(h)})}nudge(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||i.isCached()||typeof document<"u"&&document.hidden)return;let o=i.seatShape(e);if(!o)return;let n=performance.now(),r=()=>{o.scale({x:1,y:1}),i.seatLayer.batchDraw()},s=a=>{if(i.isDestroyed()||i.isCached()||!o.getLayer()){r();return}let l=a-n,c=Math.min(1,l/iu),d=1+ou*Math.sin(Math.PI*c);o.scale({x:d,y:d}),i.seatLayer.batchDraw(),c<1?requestAnimationFrame(s):r()};requestAnimationFrame(s)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Co({name:"seat-pulses",listening:!1})),this.pulseGroup.getLayer()||this.host.overlayLayer.add(this.pulseGroup),this.host.overlayLayer.isCached()&&this.host.overlayLayer.clearCache(),this.pulseGroup.moveToTop(),this.pulseGroup}showLoupe(e){let i=this.host;if(i.isExportMode()||i.isDestroyed())return;let o=i.nearestSeat(e,fe),n=o?i.seat(o):void 0;if(!n){this.hideLoupe();return}let r=Vs(n,i.seatStatus(n.id),()=>i.priceLabel(n),i.seatClosed(n.id)),s=zs(e,{width:i.stage.width(),height:i.stage.height()}),a=1/(i.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=n.id,l.group.position(i.screenToWorld(s)),l.group.scale({x:a,y:a}),l.group.opacity(r.sellable?1:.75),l.group.visible(!0),l.disc.fill(i.categoryColor(n.categoryKey)),l.title.text(r.title),l.title.offsetX(l.title.width()/2),l.detail.text(r.detail),l.detail.offsetX(l.detail.width()/2),i.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,i=e.canvasBackground(),o=q(i,le(i).sectionInk),n=new Co({name:"touch-loupe",listening:!1,visible:!1});n.add(new Io({points:[-7,ct-4,0,ct+12,7,ct-4],closed:!0,fill:i,stroke:D(o,.25),strokeWidth:1,listening:!1})),n.add(new De({radius:ct,fill:i,stroke:D(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new De({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new Xs({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),a=new Xs({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:D(o,.72),listening:!1,perfectDrawEnabled:!1});return n.add(r),n.add(s),n.add(a),e.overlayLayer.add(n),n.moveToTop(),this.loupe={group:n,title:s,detail:a,disc:r,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}destroy(){for(let e of this.echoTimers.values())clearTimeout(e);this.echoTimers.clear()}};import{Animation as nu}from"konva/lib/Animation";var ru=1e3/Is;function qs(t){return t.findOne(".selection-halo")??null}var wi=class{constructor(e){this.animation=null;this.targets=[];this.startedAt=0;this.lastFrameAt=0;this.visibilityBound=!1;this.onVisibilityChange=()=>{this.refresh()};this.markers=new Map;this.beaconRings=[];this.host=e}sync(e){this.markers=e,this.refresh()}syncBeacons(e){this.beaconRings=e,this.refresh()}refresh(){let e=this.host,i=this.markers.size>0||this.beaconRings.length>0;if(i&&!e.isDestroyed()&&!e.reducedMotion()&&this.bindVisibility(),e.isDestroyed()||e.reducedMotion()||!this.pageVisible()||!i){this.stop(),this.rest(),(!i||e.isDestroyed()||e.reducedMotion())&&this.unbindVisibility();return}let o=[],n=0;for(let[s,a]of this.markers){let l=qs(a);if(l){if(this.paintHalo(s,l),n>=vo){l.scale({x:1,y:1}),l.opacity(1);continue}o.push({node:l,phase:wo(n)}),n+=1}}let r=0;for(let s of this.beaconRings){if(r>=vo){s.scale({x:1,y:1}),s.opacity(1);continue}o.push({node:s,phase:wo(r)}),r+=1}if(this.targets=o,!o.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new nu(()=>this.frame(),e.overlayLayer),this.animation.start())}stop(){this.targets=[],this.animation&&(this.animation.stop(),this.animation=null)}destroy(){this.stop(),this.markers=new Map,this.beaconRings=[],this.unbindVisibility()}isRunning(){return!!this.animation?.isRunning()}paintHalo(e,i){let o=this.host,n=yi(V(o.canvasBackground())),r=o.seatCategoryKey(e),s=o.isOwnedHold(e)?ee(o.selectionColor(),o.canvasBackground(),.55):r?o.categoryColor(r):o.selectionColor();i.stroke(D(s,n))}rest(){let e=!1;for(let[i,o]of this.markers){let n=qs(o);n&&(this.paintHalo(i,n),n.scale({x:1,y:1}),n.opacity(1),e=!0)}for(let i of this.beaconRings)i.scale({x:1,y:1}),i.opacity(1),e=!0;e&&!this.host.isDestroyed()&&this.host.overlayLayer.batchDraw()}frame(){if(this.host.isDestroyed()||!this.targets.length)return this.stop(),!1;let i=performance.now();if(i-this.lastFrameAt<ru)return!1;this.lastFrameAt=i;let o=i-this.startedAt;for(let n of this.targets){let{scale:r,opacity:s}=Ms(o,n.phase);n.node.scale({x:r,y:r}),n.node.opacity(s)}return!0}pageVisible(){return typeof document>"u"?!0:document.visibilityState==="visible"}bindVisibility(){this.visibilityBound||typeof document>"u"||(document.addEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!0)}unbindVisibility(){!this.visibilityBound||typeof document>"u"||(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!1)}};import{Group as su}from"konva/lib/Group";import{Circle as Mo}from"konva/lib/shapes/Circle";import{Text as au}from"konva/lib/shapes/Text";var Zs=28,lu=12,cu="800",du=44,js=1.6,Qs=1.95;function Js(t){if(t.rung==="seats")return[];let e=new Map,i=new Map,o=new Map(t.zones.map(n=>[n.id,n.name]));for(let n of t.sections){let r=t.ownedSeatIds(n);if(!r.length)continue;let s=t.rung==="zones"&&n.zone!=null&&o.has(n.zone),a=s?n.zone:n.logicalId,l=e.get(a);if(l){l.count+=r.length,r.length>(i.get(a)??0)&&(i.set(a,r.length),l.seatId=r[0],l.anchor=t.sectionAnchor(n),l.toward=t.sectionCentre(n));continue}i.set(a,r.length),e.set(a,{id:a,kind:s?"zone":"section",name:s?o.get(n.zone):t.sectionName(n),count:r.length,seatId:r[0],anchor:t.sectionAnchor(n),toward:t.sectionCentre(n)})}return[...e.values()]}function hu(t,e){return B("map.beaconAria",{seats:Gs("picker.seatCount",t),name:e})}function uu(t,e){let i=e*Qs,o=t.toward.x-t.anchor.x,n=t.toward.y-t.anchor.y,r=Math.hypot(o,n);return r<1e-6?{x:t.anchor.x,y:t.anchor.y-i}:{x:t.anchor.x+o/r*i,y:t.anchor.y+n/r*i}}var pu="selection-beacon-ring",ki=class{constructor(e){this.group=null;this.buttons=[];this.centres=[];this.rings=[];this.targets=[];this.signature="";this.host=e}breathingRings(){return this.rings}current(){return this.targets}sync(e){let i=Math.max(this.host.stageScale(),1e-4),o=`${i.toFixed(4)}|${e.map(c=>`${c.id}:${c.count}:${c.seatId}`).join(",")}`;if(o===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=o,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let n=Zs/2/i,r=Math.max(du,Math.ceil(2*(n*Qs+n)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new su({listening:!1,name:"selection-beacons"});for(let c of e){let d=uu(c,n);l.add(new Mo({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:n*js,fill:D(s,.1),listening:!1,perfectDrawEnabled:!1}));let h=new Mo({name:pu,x:c.anchor.x,y:c.anchor.y,radius:n*js,stroke:D(s,.55),strokeWidth:Math.max(1,n*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(h),l.add(new Mo({name:"selection-beacon-disc",x:d.x,y:d.y,radius:n,fill:s,stroke:D(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let u=new au({x:d.x,y:d.y,text:String(c.count),fontSize:lu/i,fontStyle:cu,fontFamily:this.host.labelFont(),fill:a,listening:!1,perfectDrawEnabled:!1});u.offsetX(u.width()/2),u.offsetY(u.height()/2),l.add(u),this.rings.push(h),this.centres.push(c.anchor),this.buttons.push(this.buildButton(c,c.anchor,r))}this.host.overlayLayer.add(l),l.moveToTop(),this.group=l,this.host.overlayLayer.batchDraw()}raise(){this.group?.moveToTop()}clear(){this.group?.destroy(),this.group=null,this.rings=[],this.targets=[],this.centres=[],this.signature="";for(let e of this.buttons)e.remove();this.buttons=[]}repositionButtons(){for(let e=0;e<this.buttons.length;e+=1){let i=this.buttons[e],o=this.host.worldToScreen(this.centres[e]),n=i.offsetWidth||parseFloat(i.style.width)||Zs;i.style.left=`${o.x-n/2}px`,i.style.top=`${o.y-n/2}px`}}buildButton(e,i,o){let n=this.host.worldToScreen(i),r=document.createElement("button");return r.type="button",r.className="sl-beacon",r.dataset.beacon=e.id,r.setAttribute("aria-label",hu(e.count,e.name)),Object.assign(r.style,{position:"absolute",left:`${n.x-o/2}px`,top:`${n.y-o/2}px`,width:`${o}px`,height:`${o}px`,padding:"0",margin:"0",border:"none",borderRadius:"50%",background:"transparent",cursor:"pointer",touchAction:"manipulation",zIndex:"3"}),r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.host.activate(e)}),r.addEventListener("pointerdown",s=>s.stopPropagation()),this.host.container.appendChild(r),r}};function At(t,e,i){let o=t.width(),n=t.height(),r=1/0,s=1/0,a=-1/0,l=-1/0,c=o*2,d=n*2;for(let h of e){let u=h.getClientRect();if(!(!(u.width>1)||!(u.height>1))){if(u.x<-c||u.y<-d||u.x+u.width>o+c||u.y+u.height>n+d)return null;u.x<r&&(r=u.x),u.y<s&&(s=u.y),u.x+u.width>a&&(a=u.x+u.width),u.y+u.height>l&&(l=u.y+u.height)}}if(i&&i.width>=0&&i.height>=0){let h=t.scaleX(),u=i.x*h+t.x(),m=i.y*h+t.y();u<r&&(r=u),m<s&&(s=m),u+i.width*h>a&&(a=u+i.width*h),m+i.height*h>l&&(l=m+i.height*h)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var xi=8,fu=.02,ea=1,ta=.5;function ia(t,e,i,o,n){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=At(t,e,n);if(!s)return 0;Ro(t,s,r);let a=Math.min((r.width-2*xi)/s.width,(r.height-2*xi)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>ta?a:Math.min(a,mu(t.scaleX(),o));if(!(c>1+fu)&&!(l>ta)||!(c>0)||c===1)return 1;let d=r.x+r.width/2,h=r.y+r.height/2;t.scale({x:t.scaleX()*c,y:t.scaleY()*c}),t.position({x:d+(t.x()-d)*c,y:h+(t.y()-h)*c});let u=At(t,e,n);return u&&Ro(t,u,r),c}function Ao(t,e,i,o){let n=i??{x:0,y:0,width:t.width(),height:t.height()},r=At(t,e,o);return r?Ro(t,r,n):!1}function mu(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(ea,e):ea)/i}function Ro(t,e,i){let o=i.x+i.width/2-(e.x+e.width/2),n=i.y+i.height/2-(e.y+e.height/2);return o===0&&n===0?!1:(t.position({x:t.x()+o,y:t.y()+n}),!0)}function qe(t){return`${t.x()},${t.y()},${t.scaleX()}`}import{Group as gu}from"konva/lib/Group";import{Circle as oa}from"konva/lib/shapes/Circle";import{Line as bu}from"konva/lib/shapes/Line";import{Text as yu}from"konva/lib/shapes/Text";var Su=6;function Eo(t){return V(t)?"#0b1220":"#ffffff"}function na(t){let{points:e}=t;if(!e.length)return null;let i=t.categoryColor??"#6e7bff",o=0,n=0;for(let r of e)o+=r.x,n+=r.y;return{count:e.length,centroid:{x:o/e.length,y:n/e.length},fill:i,ink:Eo(i)}}var Li=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let i of this.host.sections()){if(i.logicalId!==e&&i.id!==e)continue;let o=na({points:this.host.ownedPoints(i),categoryColor:null});if(o)return o.centroid}return null}badgeAt(e){for(let i of this.badges)if(Math.hypot(e.x-i.centre.x,e.y-i.centre.y)<=i.radius)return i.id;return null}sync(e,i="seats"){if(this.group?.destroy(),this.group=null,this.badges=[],e>=we){this.host.overlayLayer.batchDraw();return}let o=Math.max(this.host.stageScale(),1e-4),n=new gu({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=na({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(Su/2/o,1);for(let b of a)n.add(new oa({name:"owned-seat-dot",x:b.x,y:b.y,radius:c,fill:l.fill,stroke:D("#ffffff",.55),strokeWidth:Math.max(.5,c*.28),shadowColor:l.fill,shadowBlur:c*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(i!=="seats"||r.has(s.logicalId))continue;r.add(s.logicalId);let d=this.host.sections().filter(b=>b.logicalId===s.logicalId).reduce((b,p)=>b+this.host.ownedPoints(p).length,0),h=this.host.labelAnchor(s),u=11/o,m={x:h.x,y:h.y-u*2.1};n.add(new oa({name:"owned-section-badge",x:m.x,y:m.y,radius:u,fill:l.fill,stroke:D(l.ink,.35),strokeWidth:1/o,listening:!1,perfectDrawEnabled:!1})),n.add(new bu({x:m.x-u*.62,y:m.y,points:[-u*.22,0,-u*.02,u*.2,u*.34,-u*.26],stroke:l.ink,strokeWidth:Math.max(.6,u*.16),lineCap:"round",lineJoin:"round",listening:!1}));let f=new yu({x:m.x+u*.12,y:m.y-u*.5,text:String(d),fontSize:u,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});n.add(f),this.badges.push({id:s.logicalId,centre:m,radius:u*1.8})}if(!n.hasChildren()){n.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(n),n.moveToTop(),this.group=n,this.host.overlayLayer.batchDraw()}};import{Text as vu}from"konva/lib/shapes/Text";var wu=4;function Et(t){return V(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function ku(t,e,i,o){let n=Math.max(0,Math.min(o,e/2,i/2));t.beginPath(),t.moveTo(n,0),t.arcTo(e,0,e,i,n),t.arcTo(e,i,0,i,n),t.arcTo(0,i,0,0,n),t.arcTo(0,0,e,0,n),t.closePath()}function ra(t,e){t.padding(wu),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(o){let n=this.width(),r=this.height();o.save(),ku(o,n,r,Math.min(r/2,8)),o.setAttr("fillStyle",e.plate),o.fill(),o.setAttr("strokeStyle",e.stroke),o.setAttr("lineWidth",1),o.stroke(),o.restore(),vu.prototype._sceneFunc.call(this,o)})}function sa(t){return t?"seat":"section"}function aa(t){let e=new Set,i=0;for(let n of t.memberIds){let r=t.categoryKey(n);r&&t.categorySellable(r)&&e.add(r),t.seatSellable(n)&&(i+=1)}let o=[];for(let n of t.categoryOrder)e.has(n)&&o.push({key:n,name:t.categoryLabel(n)||n,price:t.categoryPrice(n),color:t.categoryColor(n)});return o.length?i?{mode:"section",title:t.name,fields:[],rows:o,notes:[],facts:[],note:null}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:B("map.soldOut")}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:B("picker.notForSale")}}function la(t){let e=Lu(t.label,t.sectionLabel,t.rowLabel),i=[t.sectionLabel,t.rowLabel?B("picker.rowLabel",{label:t.rowLabel}):null,e?B("picker.seatLabel",{label:e}):null].filter(Boolean).join(" \xB7 ")||t.label,o=[t.sectionLabel?{caption:B("picker.section"),value:t.sectionLabel}:null,t.rowLabel?{caption:B("picker.row"),value:t.rowLabel}:null,e?{caption:B("picker.seat"),value:e}:null].filter(a=>a!=null),n={key:t.categoryKey,name:t.categoryLabel||t.categoryKey,price:t.categoryPrice,color:t.categoryColor},r=Xn(t).map(a=>{let l=B(a.titleKey);return{icon:a.icon,title:l===a.titleKey?a.titleFallback:l,tone:a.tone,...a.note?{note:a.note}:{}}}),s=t.facts??[];return{mode:"seat",title:i,fields:o,rows:[n],notes:r,facts:s,note:s.length?null:xu(t.status,t.closed)}}function xu(t,e){return e||t==="not_for_sale"?B("picker.notForSale"):t==="booked"?B("map.statusTaken"):t==="held"?B("map.statusHeld"):null}function Lu(t,e,i){let o=t;for(let n of[e,i])!n||!o.startsWith(n)||o.length<=n.length||(o=o.slice(n.length).replace(/^[\s·\-/_]+/,""));return o}var Cu=16,Pu=8;function ca(t,e,i,o=Cu){let n=Pu,r=t.x+o;r+e.width>i.width-n&&(r=t.x-o-e.width);let s=t.y+o;return s+e.height>i.height-n&&(s=t.y-o-e.height),{x:Math.max(n,Math.min(r,Math.max(n,i.width-n-e.width))),y:Math.max(n,Math.min(s,Math.max(n,i.height-n-e.height)))}}var da=16,Fo=14,ha=10.5,Tu=14,Iu=12.5,ua={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},Mu={warn:"#d8a425",premium:"#e8c15a"},Ru=.1,Au=.06,Ci=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.factsEl=null;this.noteEl=null;this.signature="";this.model=null;this.cursor=null;this.presented=null;this.mount=null;this.presentedView=null;this.viewEl=null;this.raf=0;this.attached=!1;this.lastUpdateMs=0;this.rowNames=new Map;this.rowNamesDoc=null;this.onPointerMove=e=>{if(this.fromPresenter(e))return;if(this.presented=null,this.mount=null,this.presentedView=null,e.pointerType!=="mouse"){this.hide();return}let i=this.host.container.getBoundingClientRect();this.cursor={x:e.clientX-i.left,y:e.clientY-i.top},this.schedule()};this.onPointerLeave=e=>{this.fromPresenter(e)||this.hide()};this.onPointerDown=e=>{e.pointerType!=="mouse"&&!this.fromPresenter(e)&&this.hide()};this.onWheel=e=>{this.cursor&&!this.fromPresenter(e)&&this.schedule()};this.host=e}attach(){this.attached||(this.attached=!0,this.host.container.addEventListener("pointermove",this.onPointerMove),this.host.container.addEventListener("pointerleave",this.onPointerLeave),this.host.container.addEventListener("pointerdown",this.onPointerDown),this.host.container.addEventListener("wheel",this.onWheel,{passive:!0}))}destroy(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=0),this.host.container.removeEventListener("pointermove",this.onPointerMove),this.host.container.removeEventListener("pointerleave",this.onPointerLeave),this.host.container.removeEventListener("pointerdown",this.onPointerDown),this.host.container.removeEventListener("wheel",this.onWheel),this.attached=!1,this.cursor=null,this.root?.remove(),this.root=null,this.titleEl=null,this.rowsEl=null,this.notesEl=null,this.factsEl=null,this.noteEl=null,this.viewEl=null,this.signature=""}presentSeat(e,i,o,n){if(!e||!i){this.presented&&(this.presented=null,this.mount=null,this.presentedView=null,this.hide());return}e!==this.presented&&(this.presentedView=null),n!==void 0&&(this.presentedView=n),this.presented=e,this.mount=o,this.cursor=i,this.update()}hide(){this.cursor=null,this.signature="",this.model=null,this.root&&(this.root.style.display="none")}text(){let e=this.model;return!e||!this.root||this.root.style.display==="none"?"":[e.title,...e.rows.map(i=>[i.name,i.price].filter(Boolean).join(" ")),...e.notes.map(i=>[i.title,i.note].filter(Boolean).join(": ")),e.note].filter(Boolean).join(" | ")}fromPresenter(e){return!!this.mount&&e.target instanceof Node&&this.mount.contains(e.target)}schedule(){this.raf||(this.raf=requestAnimationFrame(()=>{this.raf=0,this.update()}))}update(){let e=performance.now(),i=this.cursor;if(!i)return;let o=this.host.hostCardOpen?.()?null:this.resolve(i);if(!o){this.hide(),this.lastUpdateMs=performance.now()-e;return}let n=this.ensureRoot(),r=`${o.mode}|${o.title}|${o.note??""}|${this.host.canvasBackground()}|`+o.rows.map(l=>`${l.key}:${l.price??""}:${l.color}`).join(",")+`|${o.notes.map(l=>`${l.icon}:${l.title}:${l.note??""}`).join(",")}|${o.facts.map(l=>`${l.caption}=${l.value}`).join(",")}`;r!==this.signature&&(this.signature=r,this.paint(o)),this.showView(this.presented?this.presentedView:null),this.model=o,n.style.display="block";let s=this.mount??this.host.container,a=ca(i,{width:n.offsetWidth,height:n.offsetHeight},{width:s.clientWidth,height:s.clientHeight});n.style.left=`${a.x}px`,n.style.top=`${a.y}px`,this.lastUpdateMs=performance.now()-e}showView(e){let i=this.root;if(!i)return;if(!e){this.viewEl&&(this.viewEl.style.display="none");return}let o=this.viewEl;if(!o){o=document.createElement("div"),o.setAttribute("data-seat-view",""),Object.assign(o.style,{position:"relative",width:"100%",aspectRatio:"16 / 9",minWidth:"240px",backgroundSize:"cover",backgroundPosition:"center"});let r=document.createElement("span");r.textContent="View from this seat",Object.assign(r.style,{position:"absolute",left:"8px",bottom:"7px",padding:"2px 8px",borderRadius:"999px",font:"600 11px/1.4 inherit",color:"#ffffff",background:"rgba(8,12,24,0.62)"}),o.appendChild(r),this.viewEl=o}(o.parentElement!==i||i.firstChild!==o)&&i.insertBefore(o,i.firstChild);let n=`url("${e.replace(/"/g,"%22")}")`;o.style.backgroundImage!==n&&(o.style.backgroundImage=n),o.style.display="block"}resolve(e){if(this.presented)return this.seatModel(this.presented);if(sa(this.host.seatsPickable())==="seat"){let n=this.host.hoveredSeatId()??this.host.nearestSeat(e);return n?this.seatModel(n):null}let i=this.host.sectionAt(e),o=i?this.host.sectionLabel(i):null;return!i||o==null||this.host.sectionInteractive?.(i)===!1?null:aa({name:o||i,memberIds:this.host.sectionMembers(i),categoryOrder:this.host.categoryOrder(),categoryKey:n=>this.host.seat(n)?.categoryKey??null,categoryLabel:n=>this.host.categoryLabel(n),categoryPrice:n=>this.host.categoryPrice(n),categoryColor:n=>this.host.categoryColor(n),categorySellable:n=>this.host.categorySellable(n),seatSellable:n=>this.host.seatSellable(n)})}seatModel(e){let i=this.host.seat(e);if(!i)return null;let o=this.host.seatStatus(e),n=this.host.seatFacts?.(e)??null;if((o!=="free"&&!this.host.seatOwnedHold?.(e)||this.host.seatClosed(e))&&!n?.length)return null;let s=this.host.seatSectionLabel(e);return la({label:i.displayLabel?.trim()||i.label,rowLabel:this.rowName(i,s),sectionLabel:s,categoryKey:i.categoryKey,categoryLabel:this.host.categoryLabel(i.categoryKey),categoryPrice:this.host.categoryPrice(i.categoryKey),categoryColor:this.host.categoryColor(i.categoryKey),status:this.host.seatStatus(e),closed:this.host.seatClosed(e),...i.accessibility?.length?{accessibility:i.accessibility}:{},...i.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{},...i.commercial?{commercial:i.commercial}:{},...n?.length?{facts:n}:{}})}rowName(e,i){let o=this.host.chartDoc();if(!o)return null;if(this.rowNamesDoc!==o){this.rowNamesDoc=o,this.rowNames.clear();for(let r of o.objects){if(r.type!=="row")continue;let s=r.segmentedRow?.displayLabel??r.displayLabel??r.label;s&&(this.rowNames.set(r.id,s),r.segmentedRow&&this.rowNames.set(r.segmentedRow.groupId,s))}}let n=this.rowNames.get(e.logicalRowId??e.rowId)??this.rowNames.get(e.rowId);return n?Lt(n,i??void 0)||n:null}ensureRoot(){let e=this.mount??this.host.container;if(this.root)return this.root.parentElement!==e&&e.appendChild(this.root),this.root;let i=Et(this.host.canvasBackground()),o=document.createElement("div");o.className="sl-hover-card",o.setAttribute("aria-hidden","true"),Object.assign(o.style,{position:"absolute",left:"0",top:"0",display:"none",pointerEvents:"none",boxSizing:"border-box",minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",background:i.plate,border:`1px solid ${i.stroke}`,boxShadow:"0 6px 20px rgba(2,6,23,0.22)",fontFamily:this.host.labelFont(),lineHeight:"1.35",zIndex:"2"});let n=document.createElement("div");Object.assign(n.style,{fontSize:`${da}px`,fontWeight:"700",padding:"10px 15px 9px",textAlign:"center",color:q(i.plate,"#0b1220")});let r=document.createElement("div");Object.assign(r.style,{display:"flex",flexDirection:"column",gap:"0"});let s=document.createElement("div");Object.assign(s.style,{display:"none",flexDirection:"column",gap:"0"});let a=document.createElement("div");Object.assign(a.style,{fontSize:`${Fo}px`,fontWeight:"600",padding:"0 15px 10px",textAlign:"center",opacity:"0.72",color:q(i.plate,"#0b1220")});let l=document.createElement("div");return Object.assign(l.style,{display:"none"}),o.append(n,r,s,l,a),e.appendChild(o),this.root=o,this.titleEl=n,this.rowsEl=r,this.notesEl=s,this.factsEl=l,this.noteEl=a,o}paint(e){let i=this.ensureRoot(),o=Et(this.host.canvasBackground());i.style.background=o.plate,i.style.border=`1px solid ${o.stroke}`;let n=this.titleEl,r=this.rowsEl,s=this.notesEl,a=this.noteEl,l=q(o.plate,"#0b1220");if(n.replaceChildren(),n.style.color=l,n.style.paddingBottom=e.rows.length||e.note?"9px":"10px",e.fields.length){let c=e.fields[0]?.caption;n.style.display="flex",n.style.padding="0";for(let[d,h]of e.fields.entries()){let u=document.createElement("div");Object.assign(u.style,{flex:h.caption===c?"1 1 auto":"0 0 auto",minWidth:"0",padding:"9px 13px 10px",textAlign:"center",borderLeft:d?`1px solid ${o.stroke}`:"none"});let m=document.createElement("div");m.textContent=h.caption,Object.assign(m.style,{fontSize:`${ha}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let f=document.createElement("div");f.textContent=h.value,Object.assign(f.style,{marginTop:"2px",fontSize:`${da}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),u.append(m,f),n.append(u)}}else n.style.display="block",n.style.padding="10px 15px 9px",n.textContent=e.title;r.replaceChildren();for(let c of e.rows){let d=document.createElement("div");Object.assign(d.style,{display:"flex",justifyContent:"space-between",gap:"16px",padding:"9px 15px",fontSize:`${Fo}px`,fontWeight:"700",background:c.color,color:oo(c.color)});let h=document.createElement("span");h.textContent=c.name;let u=document.createElement("span");u.textContent=c.price??"",d.append(h,u),r.appendChild(d)}this.paintNotes(s,e,o,l),this.paintFacts(this.factsEl,e,o,l),a.textContent=e.note??"",a.style.display=e.note?"block":"none",a.style.marginTop=e.note&&e.rows.length?"6px":"0",a.style.color=q(o.plate,"#0b1220")}paintFacts(e,i,o,n){if(e.replaceChildren(),!i.facts.length){e.style.display="none";return}Object.assign(e.style,{display:"flex",borderTop:`1px solid ${o.stroke}`,color:n});for(let[r,s]of i.facts.entries()){let a=document.createElement("div");Object.assign(a.style,{flex:"1 1 auto",padding:"8px 12px 9px",textAlign:"center",borderLeft:r?`1px solid ${o.stroke}`:"none"});let l=document.createElement("div");l.textContent=s.caption,Object.assign(l.style,{fontSize:`${ha}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let c=document.createElement("div");c.textContent=s.value,Object.assign(c.style,{marginTop:"2px",fontSize:`${Fo}px`,fontWeight:"700",whiteSpace:"nowrap"}),a.append(l,c),e.append(a)}}paintNotes(e,i,o,n){if(e.replaceChildren(),!i.notes.length){e.style.display="none";return}e.style.display="flex";for(let[r,s]of i.notes.entries()){let a=oo(o.plate)==="#ffffff"?ua.onDark:ua.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:n,c=s.tone==="warn"||s.tone==="premium"?ee(o.plate,Mu[s.tone],Ru):ee(o.plate,n,Au),d=document.createElement("div");Object.assign(d.style,{display:"flex",alignItems:"flex-start",gap:"9px",padding:"9px 15px",background:c,borderTop:r?`1px solid ${o.stroke}`:"none"});let h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("viewBox",`0 0 ${20} ${20}`),h.setAttribute("width","17"),h.setAttribute("height","17"),h.setAttribute("fill","none"),h.setAttribute("stroke",l),h.setAttribute("stroke-width","1.45"),h.setAttribute("stroke-linecap","round"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("aria-hidden","true"),h.innerHTML=Yn(s.icon),Object.assign(h.style,{flex:"none",marginTop:"1px"});let u=document.createElement("div");Object.assign(u.style,{display:"flex",flexDirection:"column",gap:"2px",minWidth:"0"});let m=document.createElement("div");if(m.textContent=s.title,Object.assign(m.style,{fontSize:`${Tu}px`,fontWeight:"750",color:s.tone==="access"?n:l}),u.appendChild(m),s.note){let f=document.createElement("div");f.textContent=s.note,Object.assign(f.style,{fontSize:`${Iu}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:n}),u.appendChild(f)}d.append(h,u),e.appendChild(d)}}};var pa="#5b6db0";function Eu(t,e){if(t===e)return!0;if(!t||!e||t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}function fa(t,e){let i=e?new Set(e):null;Eu(i,t.seatHighlight())||(t.setSeatHighlightState(i),t.repaintSeats(),t.updateLabels(),t.draw())}function ma(t,e){let i=t.labelLayers(),o={...i,...e};o.seatLabels===i.seatLabels&&o.rowLabels===i.rowLabels||(t.setLabelLayersState(o),t.updateLabels(),t.draw())}function ga(t,e){e!==t.categoryColours()&&(t.setCategoryColoursState(e),t.repaintSectionsAndSeats(),t.updateLabels(),t.draw())}function K(t){let e=sr(t);return e?{x:e.x,y:e.y,width:Math.max(1,e.width),height:Math.max(1,e.height)}:{x:0,y:0,width:1,height:1}}function dt(t,e,i,o){let n=o*Math.PI/180,r=Math.cos(n),s=Math.sin(n);return[{x:-e/2,y:-i/2},{x:e/2,y:-i/2},{x:e/2,y:i/2},{x:-e/2,y:i/2}].map(a=>({x:t.x+a.x*r-a.y*s,y:t.y+a.x*s+a.y*r}))}function ht(t,e,i,o,n,r){let s=o*Math.PI/180,a=Math.cos(s),l=Math.sin(s);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let h=e*(d/6-.5),u=i*(c/4-.5),m={x:t.x+h*a-u*l,y:t.y+h*l+u*a};if(!J(m,n,r))return!1}return!0}function ba(t,e,i){let o=K(t),n={x:o.x+o.width/2,y:o.y+o.height/2},r=J(n,t,e)?[n,i]:[i],s=[];for(let l=1;l<12;l+=1)for(let c=1;c<12;c+=1){let d={x:o.x+o.width*c/12,y:o.y+o.height*l/12};J(d,t,e)&&s.push(d)}let a=[t,...e];return[...r,...s.map(l=>({point:l,room:In(l,a)})).sort((l,c)=>c.room-l.room).map(l=>l.point)].filter((l,c,d)=>c===d.findIndex(h=>Math.abs(h.x-l.x)<1e-6&&Math.abs(h.y-l.y)<1e-6))}function ya(t,e){let{stageScale:i,stageX:o,stageY:n}=t;if(t.viewMode==="perspective"&&e.perspectiveAffine)return K(e.outline.map(s=>{let a=t.projectedSectionPoint(e,s);return{x:a.x*i+o,y:a.y*i+n}}));let r=e.liftWorld>0?t.isoLiftLocal(e.liftWorld):{x:0,y:0};return K(e.outline.map(s=>{let a={x:s.x+r.x,y:s.y+r.y},l=t.isoT===0?a:t.isoForward(a);return{x:l.x*i+o,y:l.y*i+n}}))}function Fu(t,e){let i=t.width*t.height;if(i<=0)return 0;let o=Math.max(0,Math.min(t.x+t.width,e.width)-Math.max(t.x,0)),n=Math.max(0,Math.min(t.y+t.height,e.height)-Math.max(t.y,0));return o*n/i}function Sa(t){let{current:e,viewport:i}=t,o=new Map;for(let a of t.sections){let l=Fu(a.bounds,i)*a.members;l<=0||o.set(a.logicalId,(o.get(a.logicalId)??0)+l)}if(!o.size)return e;let n=null,r=0;for(let[a,l]of o)l>r&&(r=l,n=a);if(!n||n===e)return e;let s=e!=null?o.get(e)??0:0;return r>s*1.35?n:e}import{Text as Bu}from"konva/lib/shapes/Text";function _u(t,e){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height}var Te=class{constructor(){this.cells=new Map}insert(e){for(let i of this.keys(e)){let o=this.cells.get(i);o?o.push(e):this.cells.set(i,[e])}}collisionCount(e){let i=new Set,o=0;for(let n of this.keys(e))for(let r of this.cells.get(n)??[])i.has(r)||(i.add(r),_u(e,r)&&o++);return o}keys(e){let i=Math.floor(e.x/Pt),o=Math.floor((e.x+Math.max(0,e.width))/Pt),n=Math.floor(e.y/Pt),r=Math.floor((e.y+Math.max(0,e.height))/Pt),s=[];for(let a=n;a<=r;a++)for(let l=i;l<=o;l++)s.push(`${l}:${a}`);return s}};var _o=new WeakMap;function Ze(){if(typeof document>"u"||!("fonts"in document))return 0;let t=document.fonts;if(!t)return 0;let e=_o.get(t);if(e)e.status!==t.status&&(e.generation+=1,e.status=t.status);else{e={generation:0,status:t.status},_o.set(t,e);let i=()=>{let o=_o.get(t);o&&(o.generation+=1,o.status=t.status)};t.addEventListener?.("loadingdone",i),t.addEventListener?.("loadingerror",i)}return e.generation}var va=new WeakMap,wa=new WeakMap;function ka(t){let e=new Map;return{get(i){let o=JSON.stringify([i.text,i.fontSize,i.rotation]),n=e.get(o);return n||(n=new Bu({text:i.text,fontSize:i.fontSize,fontStyle:"700",fontFamily:t,rotation:i.rotation,listening:!1}),n.offsetX(n.width()/2),n.offsetY(n.height()/2),e.set(o,n)),n},destroy(){for(let i of e.values())i.destroy()}}}function Ou(t){let e=t.labelFont(),i=Ze(),o=wa.get(t.rowLabelPlan);if(o?.font===e&&o.fontGeneration===i)return o.index;let n=new Te,r=ka(e);for(let s of t.rowLabelPlan){let a=r.get(s),l=t.rowLabelBox(a,{x:s.x,y:s.y}),c=s.automaticAway,d=c?Math.max(7,Math.min(16,s.fontSize*.75))*4*(Math.abs(c.x)+Math.abs(c.y)):0;n.insert({x:l.x-d,y:l.y-d,width:l.width+d*2,height:l.height+d*2})}return r.destroy(),wa.set(t.rowLabelPlan,{font:e,fontGeneration:i,index:n}),n}function Du(t){let e=Ou(t),i=[...t.freeTextById.values()].map(({node:l})=>{let c=l.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});return{x:c.x-ie,y:c.y-ie,width:c.width+ie*2,height:c.height+ie*2}}).filter(l=>e.collisionCount(l)>0),o=JSON.stringify([t.labelFont(),Ze(),t.seatR,i]),n=va.get(t.rowLabelPlan);if(n?.key===o&&n.seats===t.seatById)return n.boxes;let r=new Te;for(let l of i)r.insert(l);let s=ka(t.labelFont()),a=t.rowLabelPlan.map(l=>{let c=s.get(l),d=t.resolveAutomaticRowLabelPosition(c,l,r),h=t.rowLabelBox(c,d);return r.insert(h),h});return s.destroy(),va.set(t.rowLabelPlan,{key:o,seats:t.seatById,boxes:a}),a}function xa(t,e){let i=t.sections.filter(f=>f.id===e||f.logicalId===e),o=i.map(f=>{if(t.viewMode==="perspective"&&f.perspectiveAffine)return K(f.outline.map(g=>t.projectedSectionPoint(f,g)));let b=f.liftWorld>0?t.isoLiftLocal(f.liftWorld):{x:0,y:0},p=f.outline.map(g=>{let y={x:g.x+b.x,y:g.y+b.y};return t.isoT===0?y:t.isoForward(y)});return K(p)});if(!o.length)return null;let n=Math.min(...o.map(f=>f.x)),r=Math.min(...o.map(f=>f.y)),s=Math.max(...o.map(f=>f.x+f.width)),a=Math.max(...o.map(f=>f.y+f.height)),l=new Set(i.flatMap(f=>f.memberIds));for(let f of l){let b=t.seatById.get(f);if(!b)continue;let p=t.renderedSeatPoint(b);n=Math.min(n,p.x-t.seatR),r=Math.min(r,p.y-t.seatR),s=Math.max(s,p.x+t.seatR),a=Math.max(a,p.y+t.seatR)}let c=f=>{[f.x,f.y,f.width,f.height].every(Number.isFinite)&&(n=Math.min(n,f.x),r=Math.min(r,f.y),s=Math.max(s,f.x+f.width),a=Math.max(a,f.y+f.height))},d=f=>{let b={x:f.x+f.width/2,y:f.y+f.height/2};return i.some(p=>J(b,p.outline,p.holes))};for(let{node:f,backdrop:b}of t.freeTextById.values()){let p=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(p)&&(c(p),b&&c(b.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:f}of t.iconNodeById.values()){let b=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(b)&&c(b)}let h=Du(t);t.rowLabelPlan.forEach((f,b)=>{(f.focusKeys??[]).some(g=>g===e||i.some(y=>g===y.id||g===y.logicalId))&&c(h[b])});let u=Math.max(s-n,a-r),m=Math.max(t.seatR*2,Math.min(24,u*.025));return{x:n-m,y:r-m,width:Math.max(1,s-n+m*2),height:Math.max(1,a-r+m*2)}}import{Rect as Nu}from"konva/lib/shapes/Rect";import{Text as La}from"konva/lib/shapes/Text";var Bo="\0";function Hu(t){let e=0;for(let i=0;i<t.length;i++){let o=t[i],n=t[(i+1)%t.length];e+=o.x*n.y-n.x*o.y}return Math.abs(e)/2}function Gu(t,e){let i=t.filter(m=>Number.isFinite(m.centroid.x)&&Number.isFinite(m.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let o=i.map(m=>({member:m,weight:Math.max(1,Hu(m.outline))})),n=o.reduce((m,f)=>m+f.weight,0),r=o.reduce((m,f)=>({x:m.x+f.member.centroid.x*f.weight/n,y:m.y+f.member.centroid.y*f.weight/n}),{x:0,y:0}),s={x:r.x-e.x,y:r.y-e.y},a=Math.hypot(s.x,s.y);if(!(a>1e-6))return null;let l={x:s.x/a,y:s.y/a},c=i.map(m=>{let f={x:m.centroid.x-e.x,y:m.centroid.y-e.y},b={x:m.centroid.x-r.x,y:m.centroid.y-r.y};return{member:m,depth:f.x*l.x+f.y*l.y,lateral:Math.abs(b.x*-l.y+b.y*l.x)}}).sort((m,f)=>f.depth-m.depth||m.member.id.localeCompare(f.member.id)),d=c[0].depth-c[c.length-1].depth,h=c[0].depth-d/3,u=c.filter(m=>m.depth>=h);return u.sort((m,f)=>m.lateral-f.lateral||f.depth-m.depth||m.member.id.localeCompare(f.member.id)),u[0].member}function Wu(t){let i=[...B("map.fromPrice",{price:Bo}).toLocaleLowerCase()],o=i.findIndex(n=>n!==Bo&&n.toLocaleUpperCase()!==n.toLocaleLowerCase());return o>=0&&(i[o]=i[o].toLocaleUpperCase()),i.join("").split(Bo).join(t)}function Vu(t,e){let i=o=>o.trim().replace(/\s+/g," ").toLocaleLowerCase();return i(t)===i(e)}function zu(t,e){let i=t.trim();return!i||/^\d{1,3}$/.test(i)?!1:!e.some(o=>Vu(o.label,i))}function Ca(t,e){if(!e.zones?.length||!t.sections.length)return;let i=ys(t.canvasBackground),o=new Map;for(let n of t.sections)n.zone&&(o.get(n.zone)??o.set(n.zone,[]).get(n.zone)).push(n);for(let n of e.zones){let r=o.get(n.id);if(!r||!r.length||!t.derivedFloorGroups&&!zu(n.label,r))continue;let s=r[0];for(let p of r)p.centroid.y<s.centroid.y&&(s=p);t.derivedFloorGroups&&(s=Gu(r,n.focalPoint??e.focalPoint)??s);let a=s.centroid.x,l=s.centroid.y,c=1/0,d=-1/0;for(let p of r)for(let g of p.outline)g.x<c&&(c=g.x),g.x>d&&(d=g.x);let h=isFinite(c)&&d>c?d-c:0,u=1/0;for(let p of r)for(let g of p.memberIds){let y=t.seatById.get(g),S=y&&t.catPrice.get(y.categoryKey);typeof S=="number"&&S<u&&(u=S)}let m=new Nu({x:a,y:l,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:i.plate,stroke:D(n.color??s.outlineTint,Xr),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(m);let f=new La({x:a,y:l,text:n.label,fontSize:pi,fontStyle:Nr,letterSpacing:0,fontFamily:t.labelFont(),fill:i.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});f.offsetX(f.width()/2),f.offsetY(f.height()/2),t.bgLayer.add(f);let b=null;isFinite(u)&&(b=new La({x:a,y:l,text:Wu(Ue(u,t.currency)),fontSize:fi,fontStyle:Hr,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),b.offsetX(b.width()/2),t.bgLayer.add(b)),t.zones.push({id:n.id,anchor:{x:a,y:l},back:m,background:i.plate,name:n.label,spanWorld:h,label:f,sub:b})}}function Pa(t,e){let i=t.zones.find(({back:d})=>{if(!d.visible()||d.opacity()<.5)return!1;let h=d.getClientRect();return e.x>=h.x&&e.x<=h.x+h.width&&e.y>=h.y&&e.y<=h.y+h.height});if(!i)return!1;let o=t.doc,n=o?.floorOverview==="combined"&&!o.zones?.length?o.floors?.find(d=>Wn(d.id)===i.id):void 0;if(n)return t.enterFloor(n.id),!0;let r=t.sections.filter(d=>d.zone===i.id).flatMap(d=>d.outline);if(!r.length)return!1;let s=Math.min(...r.map(d=>d.x)),a=Math.max(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=Math.max(...r.map(d=>d.y));return t.frame({x:s,y:l,width:Math.max(1,a-s),height:Math.max(1,c-l)}),!0}var Ku=new Set,Ta=16,Xu=5,Pi=class{constructor(e,i,o=8e3){this.chunks=e;this.host=i;this.warmSeats=o;this.wanted=new Set;this.built=new Map;this.loose=new Map;this.located=new Map;this.queue=[];this.pinQueue=[];this.frame=0;this.stepping=!1;this.stopped=!1}locate(e){let i=this.located.get(e);if(i===void 0){i=null;let o=this.host.sectionOf?[this.host.sectionOf(e)]:[...this.chunks.keys()];for(let n of o){let r=n===void 0?-1:this.chunks.get(n)?.findIndex(s=>s.id===e)??-1;if(r>=0){i={section:n,seat:this.chunks.get(n)[r],index:r};break}}this.located.set(e,i)}return i??void 0}isResident(e){let i=this.locate(e);return!!i&&(this.loose.has(e)||(this.built.get(i.section)??0)>i.index)}sync(e,i=Ku){if(this.stopped)return;this.wanted=new Set(e),this.queue=e.filter(r=>(this.built.get(r)??0)<(this.chunks.get(r)?.length??0));for(let r of e)if(this.built.has(r)){let s=this.built.get(r);this.built.delete(r),this.built.set(r,s)}let o=0;for(let[r,s]of[...this.built].reverse()){if(this.wanted.has(r)||(o+=s,o<=this.warmSeats))continue;let a=[];this.chunks.get(r).slice(0,s).forEach((l,c)=>{i.has(l.id)?this.loose.set(l.id,{section:r,seat:l,index:c}):a.push(l)}),a.length&&this.host.remove(a),this.built.delete(r)}let n=[];for(let[r,s]of this.loose)i.has(r)||this.wanted.has(s.section)||(n.push(s.seat),this.loose.delete(r));n.length&&this.host.remove(n),this.pinQueue=[];for(let r of i)this.locate(r)&&!this.isResident(r)&&this.pinQueue.push(r);!this.frame&&!this.stepping&&(this.queue.length||this.pinQueue.length)&&(this.frame=this.host.schedule(()=>this.step()))}step(){if(this.frame=0,this.stopped)return;this.stepping=!0;let e=this.host.now(),i=!1,o=()=>!i||this.host.now()-e<Xu;for(;this.pinQueue.length&&o();){let n=[];for(let r of this.pinQueue.splice(0,Ta)){let s=this.locate(r);s&&!this.isResident(r)&&(n.push(s.seat),this.loose.set(r,s))}n.length&&this.host.build(n),i=!0}for(;this.queue.length&&o();){let n=this.queue[0],r=this.chunks.get(n);if(!r){this.queue.shift();continue}let s=this.built.get(n)??0,a=Math.min(s+Ta,r.length),l=[];for(let c=s;c<a;c++)this.loose.delete(r[c].id)||l.push(r[c]);l.length&&this.host.build(l),this.built.set(n,a),a===r.length&&this.queue.shift(),i=!0}this.host.draw(),this.stepping=!1,!this.stopped&&!this.frame&&(this.queue.length||this.pinQueue.length)&&(this.frame=this.host.schedule(()=>this.step()))}finish(){this.cancel();for(let[e,i]of this.chunks){let o=i.slice(this.built.get(e)??0).filter(n=>!this.loose.has(n.id));o.length&&this.host.build(o),this.built.set(e,i.length)}this.loose.clear(),this.queue=[],this.pinQueue=[],this.host.draw()}cancel(){this.stopped=!0,this.frame&&this.host.cancel(this.frame),this.frame=0}get pending(){return(this.queue.length>0||this.pinQueue.length>0)&&!this.stopped}get nodeCount(){return[...this.built.values()].reduce((e,i)=>e+i,0)+this.loose.size}};function Ia(t,e,i,o=1e3){let n=new Set,r=s=>{for(let a of s){if(n.size>=o)return!1;a&&n.add(a)}return n.size<o};return r(t)&&r(e)&&r(i),n}import{Circle as tp}from"konva/lib/shapes/Circle";import{Line as ip}from"konva/lib/shapes/Line";import{Rect as op}from"konva/lib/shapes/Rect";import{Text as np}from"konva/lib/shapes/Text";function Ie(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Me(t,e){return Ie(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var Ma=.35,Ra=.7,je="#0b1220",ut="#ffffff",Aa="#0b1220",Oo="#232c40",Ea="#8b93a7";function Do(t,e,i="normal"){let o=t?"bold":i;return e?`italic ${o}`.trim():o}var No="#f7f8fb";import{Text as _a}from"konva/lib/shapes/Text";var Fa="500",Yu=2.5;function Uu(t,e){return t>=oe||e&&t>=di}function $u(t){return t.effectiveScale<di?!1:t.focusActive||t.stageWidth<j}function qu(t,e,i){return i&&e>=di?Math.max(t,Ir/Math.max(e,1e-4)):t}function Zu(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:o,effectiveScale:n}=t;if(!(i>o)||!(i>0))return e;let r=z/Math.max(n,1e-4),s=e*o/i;return Math.max(Math.min(rt,r),s)}function Ho(t,e){let i=(e?1:3)*Math.min(1,t/te);return Math.max(1,t*2-i)}function Ba(t){let e=new Map;for(let n of t){let r=e.get(n.rowId);r?r.push(n):e.set(n.rowId,[n])}let i=[];for(let n of e.values())if(!(n.length<2))for(let r=1;r<n.length;r+=1){let s=Math.hypot(n[r].x-n[r-1].x,n[r].y-n[r-1].y);s>0&&Number.isFinite(s)&&i.push(s)}if(!i.length)return 0;i.sort((n,r)=>n-r);let o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o])/2}function Oa(t,e){return e>0?Math.min(t,e/2):t}function Da(t){return Ti(Go(t))}function Go(t){let e=Ho(t,!1),i=Ho(te,!1),o=e>0?i/e:1;return ge/Math.max(1,o)}function Ti(t){return z/Math.max(t,1e-4)/co(1,!1,z)}function Na(t){return Ti(t)*gi}function ju(t,e,i){let o=t.seatLabelContainer(e);i.getParent()!==o&&o.add(i)}function Ha(t){let e=t.exportMode?Math.max(t.effScale(),oe):t.effScale(),i=$u({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),o=t.exportMode?e:co(e,t.labelsWereVisible(),z),n=t.labelLayers(),r=n.seatLabels&&Uu(o,i);t.onLabelVisibilityChange(r),t.setSeatLabelRungOpen(r);let s=f=>{let b=t.worldToScreen({x:f.x(),y:f.y()}),p=f.width()*e,g=f.height()*e;return b.x-p/2>=0&&b.y-g/2>=0&&b.x+p/2<=t.stage.width()&&b.y+g/2<=t.stage.height()};for(let[f,b]of t.boothLabelById){let p=t.circleById.get(f);b.visible(ye(b.fontSize(),o)&&!!p?.isVisible()&&t.focusedSeatOpacity(f,p?.getAbsoluteOpacity()??1)>=.5&&s(b))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let a=new Set,l=0;if(r)for(let f of t.visibleSeatCandidates()){if(f.kind==="booth")continue;let b=t.worldToScreen(f);if(b.x<-20||b.x>t.stage.width()+20||b.y<-20||b.y>t.stage.height()+20||t.accessGlyphById.has(f.id)&&t.accessGlyphShouldShow(f.id))continue;let p=t.circleById.get(f.id);if(!p?.isVisible()){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}let g=t.statusById.get(f.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(f.id)&&(g==="booked"||g==="not_for_sale"||g==="held"&&!t.ownedHold.has(f.id))){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(f.id)){t.seatLabelDrops.set(f.id,"selection-tick");continue}if(t.focusedSeatOpacity(f.id,p.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}let x=t.renderedSeatPoint(f),w=t.viewMode==="perspective"?t.perspectiveSeatScale.get(f.id)??1:1,v=qu(ge*t.seatLabelScale(f),e,i),k=ti(f.displayLabel??f.label),P=p?t.seatLabelInk(f,p):t.seatPreferredLabelInk(f),C=t.seatLabelPool.get(f.id);C?(C.position(x),C.text(k),C.fontSize(v),C.fontFamily(t.labelFont()),C.fill(P),C.offset({x:0,y:0}),C.scale({x:1,y:1})):(C=new _a({x:x.x,y:x.y,text:k,fontSize:v,fontStyle:Fa,fontFamily:t.labelFont(),fill:P,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(f.id,C));let T=Ho(t.seatR,i);if(C.fontSize(Zu({authoredFontSize:v,measuredWidth:C.width(),maxWidth:T,effectiveScale:e})),C.width()>T+.01){t.seatLabelDrops.set(f.id,"label-overflows-marker");continue}if(!ye(C.fontSize(),e)){t.seatLabelDrops.set(f.id,"below-minimum-size");continue}if(C.offsetX(C.width()/2),C.offsetY(C.height()/2),C.scale({x:w,y:w}),ju(t,f.id,C),!s(C)){t.seatLabelDrops.set(f.id,"outside-viewport");continue}if(a.add(f.id),t.seatLabelById.set(f.id,C),++l>=Mr)break}for(let[f,b]of t.seatLabelPool)a.has(f)||(b.destroy(),t.seatLabelPool.delete(f));let c=new Te;for(let{node:f}of t.freeTextById.values()){if(!f.isVisible())continue;let b=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});c.insert({x:b.x-ie,y:b.y-ie,width:b.width+ie*2,height:b.height+ie*2})}let d=new Te,h=null,u=()=>{if(h)return h;h=new Te;for(let f of t.seatLabelById.values()){if(!f.isVisible())continue;let b=f.getClientRect({skipShadow:!0,skipStroke:!0});h.insert({x:b.x,y:b.y,width:b.width,height:b.height})}return h},m=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*Yu;if(n.rowLabels)for(let f of Qu(t.rowLabelPlan)){let b=t.rowLabelPlan[f],p=t.focusedSectionId!=null&&b.focusKeys?.includes(t.focusedSectionId),g=Math.max(e,1e-4),y=p?Math.max(b.fontSize,Ct/g):b.fontSize,S=Math.max(Math.min(y,Tr(t.stage.width())/g),p?Ct/g:0);if(!r&&(!p||!m)||!p&&!ye(S,o))continue;let x=t.worldToScreen({x:b.x,y:b.y});if(x.x<-40||x.x>t.stage.width()+40||x.y<-40||x.y>t.stage.height()+40)continue;let w=new _a({x:b.x,y:b.y,text:b.text,fontSize:S,fontStyle:Fa,fontFamily:t.labelFont(),fill:b.ink,rotation:b.rotation,opacity:b.opacity,shadowColor:"#05070c",shadowBlur:b.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:b.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});b.pill&&ra(w,b.pill),w.offsetX(w.width()/2),w.offsetY(w.height()/2);let v=t.resolveAutomaticRowLabelPosition(w,b,c);w.position(v),w.setAttr("rowLabel",!0),b.rowKey&&w.setAttr("rowKey",b.rowKey),w.setAttr("focusKeys",b.focusKeys??[]),t.rowLabelGroup.add(w);let k=w.getClientRect({skipShadow:!0,skipStroke:!0}),P=6,C=k.x<P?P-k.x:k.x+k.width>t.stage.width()-P?t.stage.width()-P-k.x-k.width:0,T=k.y<P?P-k.y:k.y+k.height>t.stage.height()-P?t.stage.height()-P-k.y-k.height:0,L=v;if(C||T){let M=t.labelGroup.getAbsoluteTransform(),R=M.point(v);L=M.copy().invert().point({x:R.x+C,y:R.y+T}),w.position(L);let A=w.getClientRect({skipShadow:!0,skipStroke:!0});if(u().collisionCount({x:A.x,y:A.y,width:A.width,height:A.height})>0){w.destroy();continue}}let I=t.rowLabelBox(w,L);if(d.collisionCount(I)>0){w.destroy();continue}if(b.automaticAway&&c.collisionCount(I)>0){w.destroy();continue}c.insert(I),d.insert(I)}t.isoT>0&&t.viewMode!=="perspective"&&t.applyUprightLabels(),t.overlayLayer.batchDraw()}function Qu(t){let e=n=>n.focusKeys?.length?n.focusKeys.join(" "):"",i=[],o=0;for(;o<t.length;){let n=e(t[o]),r=o;for(;r+1<t.length&&e(t[r+1])===n;)r++;if(n){i.push(o),r>o&&i.push(r);for(let s=o+1;s<r;s++)i.push(s)}else for(let s=o;s<=r;s++)i.push(s);o=r+1}return i}function Wo(t){let e=Math.max(t,1e-4);return{kind:"marker",diameter:e*2,labelFontSize:Go(e)}}function Ju(t){let e=pt(t),i=Math.min(e.width,e.height);return{kind:"block",diameter:i>0?i:te*2,labelFontSize:be({width:e.width,height:e.height,text:t.label})}}function pt(t){let e=t.points;if(!e||e.length<3)return{width:Math.abs(t.width),height:Math.abs(t.height)};let i=1/0,o=1/0,n=-1/0,r=-1/0;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(i=Math.min(i,s.x),n=Math.max(n,s.x),o=Math.min(o,s.y),r=Math.max(r,s.y));return Number.isFinite(i)?{width:n-i,height:r-o}:{width:Math.abs(t.width),height:Math.abs(t.height)}}function Ga(t,e){let i=Wo(e.markerRadius),o=null;for(let n of t){let r=n.kind==="booth"?Ju({...e.blockDims.get(n.rowId)??{width:te*2,height:te*2},label:n.displayLabel??n.label}):i;(!o||r.labelFontSize<o.labelFontSize||r.labelFontSize===o.labelFontSize&&r.diameter<o.diameter)&&(o=r)}return o??i}function ep(t){return Na(t.labelFontSize)}function Wa(t){return Ti(t.labelFontSize)}function Ii(t){let e=Math.max(t.diameter,1e-4);return Math.max(ae,ni/e)}function Va(t){return Math.max(ep(t),Ii(t)*gi)}function za(t){let e=[...t.seats].sort((i,o)=>(t.perspectiveSeatDepth.get(o.id)??0)-(t.perspectiveSeatDepth.get(i.id)??0));for(let i of e){if(i.kind==="booth"){rp(t,i);continue}let o=t.seatContainer(i.id),n=ks({x:i.x,y:i.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:rr(i.glyph,t.catByKey.get(i.categoryKey)),wheelchairBay:i.wheelchairSpaceType==="no-seat"});if(n instanceof Ye&&t.glyphMarkers.push(n),n.setAttr("seatId",i.id),t.circleById.set(i.id,n),t.paintSeat(n,i.id),o.add(n),i.accessible){if(i.wheelchairSpaceType!=="no-seat"){let r=new tp({x:i.x,y:i.y,radius:t.seatR+1.5,stroke:xt(i.accessibility,{colorblind:t.colorblind,canvasBackground:t.canvasBackground}),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.accessRingById.set(i.id,r),o.add(r)}if(ei(i.accessibility??[])){let r=t.buildAccessGlyph(i,typeof n.fill()=="string"?n.fill():"");t.accessGlyphById.set(i.id,r),o.add(r)}}}}function rp(t,e){let i=t.seatContainer(e.id),o=t.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},n=e.x,r=e.y,s;o.points&&o.points.length>=3?(s=new ip({x:e.x,y:e.y,points:o.points.flatMap(c=>[c.x,c.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),n=e.x+o.points.reduce((c,d)=>c+d.x,0)/o.points.length,r=e.y+o.points.reduce((c,d)=>c+d.y,0)/o.points.length):s=new op({x:e.x,y:e.y,width:o.width,height:o.height,offsetX:o.width/2,offsetY:o.height/2,rotation:o.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s.setAttr("seatId",e.id),t.circleById.set(e.id,s),i.add(s);let a=e.displayLabel??e.label,l=new np({x:n,y:r,text:a,fontSize:be({...pt(o),text:a}),fontStyle:"600",fontFamily:t.labelFont(),fill:t.theme.seatLabelColor??je,listening:!1,perfectDrawEnabled:!1});l.offsetX(l.width()/2),l.offsetY(l.height()/2),l.visible(!1),t.setHasBoothText(),t.boothLabelById.set(e.id,l),i.add(l),t.paintSeat(s,e.id)}function Ka(t,e,i,o){let n=null,r=1/0,s=t.stage.scaleX()||1;for(let a of t.seats){if(!o?.includeUnavailable&&!t.selection.has(a.id)&&!t.isSelectable(a.id))continue;let l=t.worldToScreen(a),c=t.viewMode==="perspective"?t.perspectiveSeatScale.get(a.id)??1:1,d=t.seatR*s*c+i,h=Math.hypot(l.x-e.x,l.y-e.y);h<=d&&h<r&&(r=h,n=a.id)}return n}function Xa(t){if(!t.objectFloor.size)return null;let e=t.stage.getPointerPosition();if(!e)return null;let i=t.screenToWorld(e),o=null,n=1/0;for(let r of t.seats){let s=t.renderedSeatPoint(r),a=s.x-i.x,l=s.y-i.y,c=a*a+l*l;c<n&&(n=c,o=r.rowId)}return o?t.objectFloor.get(o)??null:null}import{Circle as Ip}from"konva/lib/shapes/Circle";import{Group as pl}from"konva/lib/Group";import{Rect as Mp}from"konva/lib/shapes/Rect";import{Text as Rp}from"konva/lib/shapes/Text";var Re=1.12;function ft(t,e,i,o){if(e.width<=0||e.height<=0)return t.scaleX();let n=o??{x:0,y:0,width:t.width(),height:t.height()},r=Math.min(n.width/(e.width*Re),n.height/(e.height*Re));return Y(r,i.min,i.max)}var Ft=.55;function _t(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function Vo(t){let{stage:e,box:i,bounds:o,viewport:n,centreScreen:r}=t,s=t.ratio??Mt,a=e.scaleX(),l=ft(e,i,o,n)/Math.max(a,1e-4);if(l>=s||l<=1/s)return!1;let c=r.x-(n.x+n.width/2),d=r.y-(n.y+n.height/2);return Math.hypot(c,d)<=Math.min(n.width,n.height)*.02}function Ya(t,e,i,o){let n=Y(e,o.min,o.max),r=t.scaleX();if(n===r)return!1;let s=(i.x-t.x())/r,a=(i.y-t.y())/r;return t.scale({x:n,y:n}),t.position({x:i.x-s*n,y:i.y-a*n}),!0}function Ua(t,e,i,o,n,r){let s=n??{x:0,y:0,width:t.width(),height:t.height()},a=Math.min(s.width/(e.width*Re),s.height/(e.height*Re)),l=o??i.min,c=Y(Math.max(a,l),i.min,Math.max(l,_t(i,r)));t.scale({x:c,y:c}),t.position({x:s.x+s.width/2-(e.x+e.width/2)*c,y:s.y+s.height/2-(e.y+e.height/2)*c})}function $a(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function zo(t,e){let i=null;for(let o of t){let n=e.get(o)?.logicalId;if(!n||i!=null&&i!==n)return null;i=n}return i}function qa(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var sp=11;function ap(t){let e=at(sp,t),i=ui(t),o=[];for(let n=Math.round(e);n>=i;n-=1)o.push(n);return o.length?o:[i]}var lp=4,cp=2;function dp(t){let e=t.trim();if(!e)return null;if(/^[a-z]{1,3}\d{1,4}[a-z]?$/i.test(e))return e;let i=e.match(/\d+/g);if(i?.length){let o=i[0];for(let n of i)n.length>=o.length&&(o=n);return o}return e.length<=4?e:null}function Za(t,e,i){let o=t.numberLabel,n=dp(t.label);if(!n)return o.visible(!1),!1;o.text()!==n&&o.text(n),o.visible(!0),o.rotation(0);let r=lp/e;for(let s of ap(i)){o.fontSize(s/e),o.offsetX(o.width()/2),o.offsetY(o.height()/2);for(let a of[t.centroid,...t.labelAnchors])if(o.position(a),ht(a,o.width()+r,o.height()+r,0,t.outline,t.holes))return!0}return o.position(t.centroid),!1}function hp(t,e,i){let o=i({x:t.x(),y:t.y()}),n=t.width()*e,r=t.height()*e;return{x:o.x-n/2,y:o.y-r/2,w:n,h:r}}function up(t,e,i){return t.x<e.x+e.w+i&&e.x<t.x+t.w+i&&t.y<e.y+e.h+i&&e.y<t.y+t.h+i}function ja(t,e,i,o){let n=[];for(let r of e){if(r.label.opacity()<=.05)continue;let s=r.back.getAbsolutePosition(),a=r.back.width()*i,l=r.back.height()*i;n.push({x:s.x-a/2,y:s.y-l/2,w:a,h:l})}if(n.length)for(let r of t){if(r.numberLabel.opacity()<=.05)continue;let s=hp(r.numberLabel,i,o);for(let a of n)if(up(s,a,cp)){r.numberLabel.opacity(0);break}}}function Qa(t){let e=new Map;for(let i of t){if(i.numberLabel.opacity()<=.05)continue;let o=e.get(i.logicalId);o?o.push(i):e.set(i.logicalId,[i])}for(let i of e.values()){if(i.length<2)continue;let o=i[0];for(let n of i)n.labelArea>o.labelArea&&(o=n);for(let n of i)n!==o&&n.numberLabel.opacity(0)}}function il(t,e){let i=t.sectionHeat.get(e.id)??t.sectionHeat.get(e.logicalId)??(e.zone?t.sectionHeat.get(e.zone):void 0);if(i==null||i<=0){e.outlinePoly.stroke(D(e.outlineTint,.5)),e.outlinePoly.fill(D(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=ee("#f4b740","#ef4444",i);e.outlinePoly.stroke(D(o,.72+i*.25)),e.outlinePoly.fill(D(o,.08+i*.13)),e.outlinePoly.strokeWidth(2+i*3.5),e.outlinePoly.shadowColor(o),e.outlinePoly.shadowBlur(4+i*12),e.outlinePoly.shadowOpacity(.25+i*.45)}function Xo(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function ol(t,e,i,o){if(!e)return 0;let n=0;for(let r of t){if(i(r)!=="free")continue;let s=o(r);s&&Ie(s,e)&&(n+=1)}return n}function pp(t,e){return Xo(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*ss?"nearly-gone":"normal"}function nl(t,e){let i=pp(t,e),o=t.accessFilterActive&&t.sectionAccessibleFree(e)<=0,n=t.blockPaint?.({id:e.logicalId,label:e.label,free:e.free,total:e.total,state:i})??null;e.stateWord=n?.stateWord??null;let r=gs(t.canvasBackground,i,o?null:n?n.tint??null:e.shellCategoryColor);e.shellFill=r.fill,e.shellStroke=r.stroke,e.blockPoly.fill(r.fill),e.blockPoly.stroke(r.stroke),e.subLabel.text(i==="sold-out"?B("map.soldOut"):B("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function rl(t,e){return ee(e,V(t)?"#ffffff":"#000000",Jr)}function Yo(t,e,i=0){let o=Qr-i;return!e||t.length<=o?t:`${t.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function fp(t,e){return sl(t,e)!=null}function sl(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function al(t,e,i){let o=Yo(t.label,e,i?i.length+1:0),n=t.stateWord?[`${o} \xB7 ${t.stateWord}`]:[];return i?[...n.map(r=>`${i} ${r}`),`${i} ${o}`,i]:[...n,o]}function mp(t,e,i){let o=al(t,e,i),n=(t.nameLabelBadgeOnly?o[1]:o[0])??o[0];t.nameLabel.text()!==n&&t.nameLabel.text(n),t.nameLabel.fontStyle(jr),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*Oe:0)}function gp(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}var bp=.05;function ll(t){if(!t.seatCount)return!1;let e=0;for(let o of t.sections)e+=o.memberIds.length;return(t.seatCount-Math.min(e,t.seatCount))/t.seatCount<=bp}function cl(t,e){let i,o;t.reducedMotion?(i=e<=ve?1:0,o=e<=ze?1:0):(i=Y((we-e)/(we-ve),0,1),o=Y((ve-e)/(ve-ze),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,o=0);let n=!t.floorOverview&&!t.focusedSectionId&&e<Z;n&&(i=1),t.zones.length||(o=0);let r=t.viewMode==="perspective"&&t.glideInProgress&&t.seatCount>2500;t.seatLayer.opacity(r?0:ll(t)?n?0:1-i:1);let s=t.stageScaleX,a=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>uo);a&&t.setLodScale(e);let l=t.focusedSectionId,c=t.stageWidth<j,d=c&&n&&t.zones.length===0,h=le(t.canvasBackground),u=Y((i-.2)/.8,0,1),m=new Set(t.zones.map(p=>p.id)),f=new Set;for(let p of t.sections){let g=t.hasFocusDimOverlay?1:l&&p.id!==l&&p.logicalId!==l&&p.zone!==l?Pe:1,y=sl(t,p);y&&p.zone&&f.add(p.zone);let S=Math.min(g,qa(p.memberCategoryKeys,t.categoryFilter)?Pe:1,t.accessFilterActive&&!y?Pe:1);p.outlinePoly.opacity(n?0:(1-i)*S),p.blockPoly.opacity(Br*i*S);let x=t.sectionIsOwned(p);p.blockPoly.stroke(x?t.selectionColor:p.shellStroke||h.sectionStroke),p.blockPoly.strokeWidth((x?Or:Ke)/Math.max(s,1e-4));let w=p.blockPoly.fill(),v=typeof w=="string"?w:p.baseFill,k=Ss(v,p.explicitInk,p.preferredInk,er);p.nameLabel.fill(k),p.subLabel.fill(k),mp(p,c,y);let P=p.zone!=null&&m.has(p.zone);a&&(u>.01||p.externalLabel)&&wp(t,p,s,al(p,c,y),!P);let C=y||!P?1:1-o;p.nameLabel.opacity(p.nameLabelFits?(p.externalLabel?1:u)*C*S:0),p.subLabel.opacity(0);let T=d&&!p.nameLabelFits,L=P&&o>.01;a&&(p.numberLabelFits=(L||T)&&Za(p,s,t.stageWidth)),p.numberLabelFits&&p.numberLabel.fill(ue(v,p.explicitInk,p.preferredInk)),p.numberLabel.opacity(p.numberLabelFits?(T?u:L?o:0)*S:0)}let b=o*(1-t.isoT);for(let p of t.zones){let g=t.accessFilterActive&&!f.has(p.id)?Pe:1,y=p.label.visible()?b*g:0;p.back.opacity(y),p.label.opacity(y),p.sub&&p.sub.opacity(Ja(t,p)?0:y),a&&kp(t,p,s)}if(!t.glideInProgress&&(u>.01||b>.01)){Sp(t,s,d),yp(t.sections);for(let p of t.zones){let g=p.label.opacity();p.back.opacity(g),p.sub&&p.sub.opacity(Ja(t,p)?0:g)}}(b>.01||d)&&(b>.01&&ja(t.sections,t.zones,s,t.worldToScreen),Qa(t.sections));for(let p of t.sections)gp(p);t.bgLayer.batchDraw()}function Ja(t,e){return t.stageWidth<j||!e.sub||!e.sub.visible()}function yp(t){let e=new Map;for(let i of t)(e.get(i.logicalId)??e.set(i.logicalId,[]).get(i.logicalId)).push(i);for(let i of e.values()){if(i.length<2)continue;let o=i.filter(n=>n.nameLabel.opacity()>.05).sort((n,r)=>{let s=K(n.outline),a=K(r.outline);return a.width*a.height-s.width*s.height});for(let n of o.slice(1))n.nameLabel.opacity(0)}}function Sp(t,e,i=!1){let n=[],r=c=>{let d=t.worldToScreen({x:c.x(),y:c.y()}),h=K(dt({x:0,y:0},c.width()*e,c.height()*e,c.rotation()));return{x:d.x-h.width/2,y:d.y-h.height/2,w:h.width,h:h.height}};for(let c of t.zones){if(c.label.opacity()<=.05)continue;let d=c.back.getAbsolutePosition(),h=c.back.width()*e,u=c.back.height()*e;n.push({node:c.label,tier:0,section:!1,zone:c,box:{x:d.x-h/2,y:d.y-u/2,w:h,h:u}})}for(let c of t.sections){if(c.nameLabel.opacity()>.05){let d=fp(t,c)?-1:1;n.push({node:c.nameLabel,tier:d,section:!0,area:c.labelArea,box:r(c.nameLabel)})}i&&c.numberLabel.opacity()>.05&&n.push({node:c.numberLabel,tier:1,section:!1,area:c.labelArea,box:r(c.numberLabel)})}let s=t.landmarks.map(c=>{let d=t.worldToScreen({x:c.x,y:c.y}),h=t.worldToScreen({x:c.x+c.width,y:c.y+c.height});return{x:Math.min(d.x,h.x),y:Math.min(d.y,h.y),w:Math.abs(h.x-d.x),h:Math.abs(h.y-d.y)}});if(n.length<2&&!s.length)return;n.sort((c,d)=>c.tier-d.tier||(d.area??0)-(c.area??0)||c.box.y-d.box.y||c.box.x-d.box.x);let a=[...s],l=c=>a.some(d=>c.x<d.x+d.w+4&&d.x<c.x+c.w+4&&c.y<d.y+d.h+4&&d.y<c.y+c.h+4);for(let c of n){if(!l(c.box)){a.push(c.box);continue}let d=!1;if(c.zone)for(let h of $r){if(h===0)continue;let u={...c.box,y:c.box.y+h};if(!l(u)){Ko(c.zone,0,h/e),a.push(u),d=!0;break}}if(c.section){let h=c.node.fontSize(),u=c.node.y(),m=c.node.letterSpacing()>0;for(let f of ho){let b=h*f;if(b*e<It(t.stageWidth))break;Ae(c.node,b,u),m&&(c.node.letterSpacing(c.node.fontSize()*Oe),c.node.offsetX(c.node.width()/2));let p=r(c.node);if(!l(p)){a.push(p),d=!0;break}}d||(Ae(c.node,h,u),m&&(c.node.letterSpacing(c.node.fontSize()*Oe),c.node.offsetX(c.node.width()/2)))}d||c.node.opacity(0)}}function Ae(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}function vp(t,e,i){let o=K(t);return be({width:o.width*i,height:o.height*i,text:e})}function wp(t,e,i,o,n=!1){e.subLabelFits=!1;let r=t.stageWidth<j,s=It(t.stageWidth),a=po(st*e.labelScale,t.stageWidth,i,t.fitScale,void 0,s),c=n&&!(t.fitScale>0&&i>t.fitScale)&&ll(t)?Math.max(a,vp(e.outline,o[0]??e.label,i)):a;if(e.externalLabel){e.nameLabel.text(o[0]),e.nameLabel.rotation(e.externalLabel.rotation),Ae(e.nameLabel,c/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[u,m]of o.entries()){e.nameLabel.text(m);let f=K(e.outline),b=e.authoredLabelRotation!=null?[e.authoredLabelRotation]:f.height>f.width*ns?[0,-90]:[0];for(let p of b)for(let g of e.labelAnchors)for(let y=c;y>=s;y-=1){e.nameLabel.rotation(p),Ae(e.nameLabel,y/i,e.nameLabel.y()),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Oe),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(g);let S=os/i;if(ht(g,e.nameLabel.width()+S,e.nameLabel.height()+S,p,e.outline,e.holes)){e.nameLabelFits=!0,e.nameLabelBadgeOnly=u>0;return}}}e.nameLabel.text(o[0]),e.nameLabelBadgeOnly=!1;let d=e.labelAnchors[0]??e.centroid;e.nameLabel.position(d),e.nameLabel.rotation(e.authoredLabelRotation??0),Ae(e.nameLabel,s/i,d.y),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Oe),e.nameLabel.offsetX(e.nameLabel.width()/2));let h=K(e.outline);e.nameLabelFits=e.nameLabel.width()<=h.width&&e.nameLabel.height()<=h.height}function el(t,e,i){let o=n=>(t.text(n),t.width());if(!(o(e)<=i)){for(let n=e.length-1;n>=1;n-=1)if(o(`${e.slice(0,n).trimEnd()}\u2026`)<=i)return;o("\u2026")}}function kp(t,e,i){let o=mi(t.stageWidth),n=t.stageWidth<j,r=e.sub!=null&&!n,s=(n?Gr:Vr)*o/i,a=(n?Wr:zr)*o/i,l=po(pi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Ae(e.label,l/i,e.anchor.y),r&&(Ae(e.sub,at(fi,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*Dr),e.sub.offsetX(e.sub.width()/2));let c=n?t.stageWidth*Yr/i-s*2:1/0,d=!n&&e.spanWorld>0?e.spanWorld*Ur-s*2:1/0,h=Math.min(c,d),u=()=>Math.max(e.label.width(),r?e.sub.width():0);if(r&&u()>h&&(r=!1),u()>h)for(let k of ho){let P=Math.max(Be,l*k);if(P>=e.label.fontSize()*i-.001||(Ae(e.label,P/i,e.anchor.y),e.label.width()<=h))break}if(e.label.width()>h&&(el(e.label,e.name,Math.max(h,1)),xp(e.label.text())<Lp(e.name)&&el(e.label,e.name,Math.max(c,1)),Ae(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){tl(e);return}e.label.visible(!0),e.back.visible(!0);let m=r?3*o/i:0;e.label.x(e.anchor.x),r?e.sub.x(e.anchor.x):e.sub&&e.sub.opacity(0);let f=Math.max(e.label.width(),r?e.sub.width():0)+s*2,b=e.label.height()+(r?m+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(m+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+m)/2),e.back.position(e.anchor),e.back.size({width:f,height:b}),e.back.offset({x:f/2,y:b/2}),e.back.cornerRadius(Kr*o/i),e.back.strokeWidth(1/i);let p=e.back.getAbsolutePosition(),g=6,y=f*i;if(y>t.stageWidth-g*2){tl(e);return}let S=y/2,w=(Y(p.x,g+S,t.stageWidth-g-S)-p.x)/i;Math.abs(w)>.001&&Ko(e,w,0);let v=62+b*i/2;p.y<v&&Ko(e,0,(v-p.y)/i)}function xp(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function Lp(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function tl(t){t.label.visible(!1),t.label.opacity(0),t.back.visible(!1),t.back.opacity(0),t.sub&&(t.sub.visible(!1),t.sub.opacity(0))}function Ko(t,e,i){t.label.x(t.label.x()+e),t.label.y(t.label.y()+i),t.sub&&(t.sub.x(t.sub.x()+e),t.sub.y(t.sub.y()+i)),t.back.x(t.back.x()+e),t.back.y(t.back.y()+i)}function Cp(t,e){if(!t.length)return null;let i=1/0,o=1/0,n=-1/0,r=-1/0;for(let s of t)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(s.x<i&&(i=s.x),s.y<o&&(o=s.y),s.x>n&&(n=s.x),s.y>r&&(r=s.y));return!Number.isFinite(i)||!Number.isFinite(o)?null:{x:i-e,y:o-e,width:n-i+e*2,height:r-o+e*2}}function qo(t,e=0){let i=new Map;for(let n of t){let r=`${n.rowId}|${n.categoryKey}`,s=i.get(r);s||(s={categoryKey:n.categoryKey,points:[]},i.set(r,s)),s.points.push({x:n.x,y:n.y})}let o=[];for(let[n,r]of i){let s=Cp(r.points,e);s&&o.push({id:n,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return o}function Uo(t,e){let i=Math.max(0,Math.max(t.x-(e.x+e.width),e.x-(t.x+t.width))),o=Math.max(0,Math.max(t.y-(e.y+e.height),e.y-(t.y+t.height)));return Math.hypot(i,o)}function $o(t,e){let i=Math.min(t.x,e.x),o=Math.min(t.y,e.y);return{x:i,y:o,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-o}}function dl(t){if(!t.length)return 0;let e=[...t].sort((o,n)=>o-n),i=Math.floor(e.length/2);return e.length%2?e[i]:(e[i-1]+e[i])/2}function Pp(t){if(!t.length)return 0;let e=dl(t.map(o=>Math.min(o.bounds.width,o.bounds.height)));if(t.length<2)return e;let i=[];for(let o=0;o<t.length;o+=1){let n=1/0;for(let r=0;r<t.length;r+=1)o!==r&&(n=Math.min(n,Uo(t[o].bounds,t[r].bounds)));Number.isFinite(n)&&i.push(n)}return dl(i)+e}function Zo(t,e){if(!t.length)return[];let i=Pp(t)*(e?.gapRows??2),o=e?.minRows??2,n=e?.minSeats??12,r=new Map;for(let a of t){let l=r.get(a.categoryKey);l?l.push(a):r.set(a.categoryKey,[a])}let s=[];for(let[a,l]of r){let c=[...l].sort((u,m)=>u.bounds.y-m.bounds.y||u.bounds.x-m.bounds.x||u.id.localeCompare(m.id)),d=[];for(let u of c){let m=d.find(f=>Uo(f.bounds,u.bounds)<=i);m?(m.bounds=$o(m.bounds,u.bounds),m.rowIds.push(u.id),m.seatCount+=u.seatCount):d.push({categoryKey:a,bounds:{...u.bounds},rowIds:[u.id],seatCount:u.seatCount})}let h=!0;for(;h&&d.length>1;){h=!1;e:for(let u=0;u<d.length;u+=1)for(let m=u+1;m<d.length;m+=1)if(!(Uo(d[u].bounds,d[m].bounds)>i)){d[u].bounds=$o(d[u].bounds,d[m].bounds),d[u].rowIds.push(...d[m].rowIds),d[u].seatCount+=d[m].seatCount,d.splice(m,1),h=!0;break e}}for(let u of d)u.rowIds.length<o&&u.seatCount<n||(u.rowIds.sort(),s.push(u))}return s.sort((a,l)=>a.bounds.y-l.bounds.y||a.bounds.x-l.bounds.x||a.categoryKey.localeCompare(l.categoryKey)),s}function hl(t){let e=null;for(let i of t)e=e?$o(e,i.bounds):{...i.bounds};return e}function ul(t,e){let i=null,o=1/0;for(let n of t){let{x:r,y:s,width:a,height:l}=n.bounds;if(e.x<r||e.x>r+a||e.y<s||e.y>s+l)continue;let c=a*l;c<o&&(i=n,o=c)}return i}function ml(t){return t*.3}function fl(t){return ml(t)*2+t*.42}var Mi=class{constructor(e){this.host=e;this.group=null;this.labels=[];this.revealed=!1;this.visible=!1;this.fadeRaf=0;this.lastFontKey="";this.pressOnChart=!0}get all(){return this.labels.map(e=>e.cluster)}clear(){this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),this.group?.destroy(),this.group=null,this.labels=[],this.visible=!1,this.revealed=!1,this.lastFontKey=""}destroy(){this.clear()}rebuild(){if(this.clear(),this.pressOnChart=!0,this.syncCursor(!1),this.host.hasSections()||this.host.exportMode)return;let e=Zo(qo(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),o=le(i),n=rl(i,i),r=q(n,o.sectionInk),s=new pl({listening:!1,opacity:0,visible:!1});for(let a of e){let l=this.host.categoryLabel(a.categoryKey);if(!l)continue;let c={x:a.bounds.x+a.bounds.width/2,y:a.bounds.y+a.bounds.height/2},d=new pl({listening:!1}),h=new Mp({...c,width:0,height:0,fill:n,stroke:o.sectionStroke,strokeWidth:Ke,opacity:es,listening:!1,perfectDrawEnabled:!1}),u=new Ip({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),m=new Rp({...c,text:l,fontSize:st,fontStyle:Xe,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(h),d.add(u),d.add(m),s.add(d),this.labels.push({cluster:a,pill:d,plate:h,swatch:u,text:m,label:l})}if(!this.labels.length){s.destroy();return}this.group=s,this.host.labelLayer.add(s)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let i=this.host.seatR()*2,o=this.host.exportMode||this.host.viewMode()!=="flat"||this.host.seatsPickable()&&e<ae||e>=this.host.readableScale();return this.revealed=o||kr(lo(i,e),lo(i,ae),this.revealed),!this.revealed&&this.size(this.host.stage.scaleX(),this.host.stage.width())&&this.host.labelLayer.batchDraw(),this.revealed||this.capOnePerCategory(),this.applyFilterDim(),this.applyVisibility(!this.revealed),!0}focusCluster(e){if(this.host.viewMode()!=="flat"||this.host.hasSections()||this.host.seatsPickable())return!1;let i=this.clusterAt(this.host.screenToWorld(e));if(!i)return!1;let o=this.host.seatR()*2,n={x:i.bounds.x-o,y:i.bounds.y-o,width:i.bounds.width+o*2,height:i.bounds.height+o*2},r=this.host.stage;if(ft(r,n,this.host.zoomBounds(),this.host.framingViewport())<=r.scaleX()*Mt)return!1;let a=this.diveTarget(n);return a?(this.host.focusRegion(a,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,i){let o=this.host.stage,n=this.host.framingViewport(),r=this.host.zoomBounds(),s=ft(o,e,r,n),a=Math.min(Math.max(this.host.readableScale(),this.host.pickableScale()),r.max);if(s>=a)return e;let l=n.width/(a*Re),c=n.height/(a*Re);if(!(l>0)||!(c>0))return null;let d=i??{x:e.x+e.width/2,y:e.y+e.height/2};return{x:d.x-l/2,y:d.y-c/2,width:l,height:c}}glideTowardTap(e){if(this.host.viewMode()!=="flat")return!1;let i=this.host.stage.scaleX(),o=as(i,this.host.pickableScale());if(o==null||o<=i*Mt)return!1;let n=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(o*Re),a=r.height/(o*Re);return!(s>0)||!(a>0)?!1:(this.host.focusRegion({x:n.x-s/2,y:n.y-a/2,width:s,height:a}),!0)}setPressLandsOnChart(e){this.pressOnChart=e}syncCursor(e){if(this.host.exportMode)return;let i=this.host.viewMode()==="flat"&&!this.host.seatsPickable()?this.pressOnChart?"zoom-in":"default":e?"pointer":"default";for(let o of[this.host.stage.container(),this.host.stage.content])o&&o.style.cursor!==i&&(o.style.cursor=i)}clusterAt(e){let i=ul(this.all,e);if(i)return i;if(!this.visible)return null;for(let o of this.labels){if(!o.pill.visible())continue;let n=o.plate.width()/2,r=o.plate.height()/2;if(Math.abs(e.x-o.text.x())<=n&&Math.abs(e.y-o.text.y())<=r)return o.cluster}return null}size(e,i){let o=Math.max(e,1e-4),n=i<j,r=`${o.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=at(st,i),a=ts/o,l=is/o;for(let c of this.labels){let{text:d,plate:h,swatch:u,cluster:m}=c;d.text(Yo(c.label,n)),d.fontStyle(n?Zr:Xe);let f=s,b=0;for(;d.fontSize(Math.max(1,f/o)),d.letterSpacing(d.fontSize()*Oe),b=fl(d.fontSize())+d.width()+a*2,!(b<=m.bounds.width||f<=Be);)f=Math.max(Be,f-1);let p={x:m.bounds.x+m.bounds.width/2,y:m.bounds.y+m.bounds.height/2},g=d.height()+l*2,y=b-a*2,S=p.x-y/2;u.radius(ml(d.fontSize())),u.position({x:S+u.radius(),y:p.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:S+fl(d.fontSize()),y:p.y}),h.size({width:b,height:g}),h.offset({x:b/2,y:g/2}),h.cornerRadius(g/2),h.strokeWidth(Ke/o),h.position(p)}return!0}capOnePerCategory(){if(this.labels.length<2)return;let e=this.viewportWorldRect(),i={x:e.x+e.width/2,y:e.y+e.height/2},o=new Map;for(let r of this.labels){let s=r.cluster.bounds;if(s.x>e.x+e.width||s.x+s.width<e.x||s.y>e.y+e.height||s.y+s.height<e.y)continue;let a=Math.hypot(s.x+s.width/2-i.x,s.y+s.height/2-i.y),l=o.get(r.cluster.categoryKey);(!l||a<l.distance||a===l.distance&&r.cluster.seatCount>l.entry.cluster.seatCount)&&o.set(r.cluster.categoryKey,{entry:r,distance:a})}let n=!1;for(let r of this.labels){let s=o.get(r.cluster.categoryKey)?.entry===r;r.pill.visible()!==s&&(r.pill.visible(s),n=!0)}n&&this.host.labelLayer.batchDraw()}viewportWorldRect(){let e=this.host.framingViewport(),i=this.host.screenToWorld({x:e.x,y:e.y}),o=this.host.screenToWorld({x:e.x+e.width,y:e.y+e.height});return{x:i.x,y:i.y,width:o.x-i.x,height:o.y-i.y}}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),i=!1;for(let o of this.labels){let n=e&&!e.has(o.cluster.categoryKey)?.22:1;o.pill.opacity()!==n&&(o.pill.opacity(n),i=!0)}i&&this.host.labelLayer.batchDraw()}boundsForSeats(e,i){if(!e.length)return null;let o=qo(e,this.host.seatR()),n=Zo(o);n.length||(n=o.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=hl(n);if(!r)return null;let s=n.reduce((a,l)=>l.seatCount>a.seatCount?l:a,n[0]);return{bounds:{x:r.x-i,y:r.y-i,width:r.width+i*2,height:r.height+i*2},anchor:{x:s.bounds.x+s.bounds.width/2,y:s.bounds.y+s.bounds.height/2},singleBlock:n.length===1&&e.every(a=>a.x>=r.x&&a.x<=r.x+r.width&&a.y>=r.y&&a.y<=r.y+r.height)}}applyVisibility(e){let i=this.group;if(!i||e===this.visible)return;if(this.visible=e,this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),i.visible(!0),this.host.reducedMotion()){i.opacity(e?1:0),i.visible(e),this.host.labelLayer.batchDraw();return}let o=i.opacity(),n=e?1:0,r=performance.now(),s=a=>{if(this.host.destroyed()||!this.group){this.fadeRaf=0;return}let l=Math.min(1,(a-r)/90);i.opacity(o+(n-o)*l),l>=1&&i.visible(n>0),this.host.labelLayer.batchDraw(),this.fadeRaf=l<1?requestAnimationFrame(s):0};this.fadeRaf=requestAnimationFrame(s)}};import{Circle as Ap}from"konva/lib/shapes/Circle";import{Line as Ep}from"konva/lib/shapes/Line";function gl(t,e,i,o){let n=t.seatRadius(),r=new Ap({x:i.x,y:i.y,radius:n,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),s=t.viewMode()==="perspective"?t.perspectiveSeatScale(e):1;r.scale({x:s,y:s}),t.overlayLayer.add(r);let a=performance.now(),l=620,c=d=>{if(!r.getLayer())return;let h=Math.max(0,Math.min(1,(d-a)/l));r.radius(n*(1+h*1.8)),r.opacity(.9*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(c):(r.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(c)}function bl(t,e,i){for(let o of e){let n=t.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(h=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,h))):o.outline.map(h=>{let u=o.liftWorld>0?t.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:h.x+u.x,y:h.y+u.y}}),r=n.reduce((h,u)=>({x:h.x+u.x,y:h.y+u.y}),{x:0,y:0});r.x/=n.length,r.y/=n.length;let s=new Ep({x:r.x,y:r.y,points:n.flatMap(h=>[h.x-r.x,h.y-r.y]),closed:!0,stroke:i,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:i,shadowBlur:14,shadowOpacity:.7});t.overlayLayer.add(s),t.overlayLayer.batchDraw();let a=()=>{s.getLayer()&&(s.destroy(),t.overlayLayer.batchDraw())};if(t.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=h=>{if(t.isDestroyed()||!s.getLayer())return;let u=Math.max(0,Math.min(1,(h-l)/c)),f=1+(1-Math.pow(1-u,3))*.04;s.scale({x:f,y:f}),s.opacity(.92*(1-u)),t.overlayLayer.batchDraw(),u<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as Np}from"konva/lib/Group";import{Shape as Hp}from"konva/lib/Shape";import{Group as Fp}from"konva/lib/Group";import{Shape as _p}from"konva/lib/Shape";function Bp(t,e,i){let o=e.length,n={x:(e[o-1].x+e[0].x)/2,y:(e[o-1].y+e[0].y)/2};t.moveTo(n.x,n.y);for(let r=0;r<o;r+=1){let s=e[r],a=e[(r+1)%o],l=e[(r-1+o)%o],c=Math.min(Math.hypot(s.x-l.x,s.y-l.y)/2,Math.hypot(a.x-s.x,a.y-s.y)/2);t.arcTo(s.x,s.y,a.x,a.y,Math.max(0,Math.min(i,c)))}t.closePath()}function Op(t,e){let i=1/0,o=1/0,n=-1/0,r=-1/0,s=(a,l)=>{!Number.isFinite(a)||!Number.isFinite(l)||(a<i&&(i=a),l<o&&(o=l),a>n&&(n=a),l>r&&(r=l))};for(let a of t)s(a.x,a.y);if(e){let a=e.start;s(a.x,a.y);for(let l of e.segments){if(s(l.end.x,l.end.y),l.kind==="arc")for(let c of Dp(l,a))s(c.x,c.y);else l.kind==="bezier"&&(s(l.control1.x,l.control1.y),s(l.control2.x,l.control2.y));a=l.end}}return!(n>=i)||!(r>=o)?{x:0,y:0,width:0,height:0}:{x:i,y:o,width:n-i,height:r-o}}function Dp(t,e){let{center:i,radius:o}=t;if(!(o>0))return[];let n=Math.PI*2,r=d=>(d%n+n)%n,s=Math.atan2(e.y-i.y,e.x-i.x),a=Math.atan2(t.end.y-i.y,t.end.x-i.x),l=r(t.clockwise?a-s:s-a)||n,c=[];for(let d=0;d<4;d+=1){let h=d*(Math.PI/2);r(t.clockwise?h-s:s-h)<=l&&c.push({x:i.x+o*Math.cos(h),y:i.y+o*Math.sin(h)})}return c}function Qe(t,e,i,o){let n=no(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0,s=new _p({...i,sceneFunc(l,c){l.beginPath();let d=u=>{if(u.length){if(r>0&&u.length>=3)return Bp(l,u,r);l.moveTo(u[0].x,u[0].y);for(let m=1;m<u.length;m+=1)l.lineTo(u[m].x,u[m].y);l.closePath()}};o?(u=>{l.moveTo(u.start.x,u.start.y);let m=u.start;for(let f of u.segments)f.kind==="line"?l.lineTo(f.end.x,f.end.y):f.kind==="arc"?l.arc(f.center.x,f.center.y,f.radius,Math.atan2(m.y-f.center.y,m.x-f.center.x),Math.atan2(f.end.y-f.center.y,f.end.x-f.center.x),!f.clockwise):l.bezierCurveTo(f.control1.x,f.control1.y,f.control2.x,f.control2.y,f.end.x,f.end.y),m=f.end;l.closePath()})(o):d(t);for(let u of Bn(e)){let m=no(u)>0;d(m===n?[...u].reverse():u)}l.fillStrokeShape(c)},perfectDrawEnabled:!1}),a=Op(t,o);return s.getSelfRect=()=>({...a}),s}var mt=class extends Fp{constructor(){super(...arguments);this.viewportCulled=!1}setViewportCulled(i){i!==this.viewportCulled&&(this.viewportCulled=i,i||super._clearSelfAndDescendantCache())}isViewportCulled(){return this.viewportCulled}drawScene(...i){return this.viewportCulled?this:super.drawScene(...i)}drawHit(...i){return this.viewportCulled?this:super.drawHit(...i)}_clearSelfAndDescendantCache(i){if(!this.viewportCulled){super._clearSelfAndDescendantCache(i);return}this._clearCache(i)}};function yl(t,e){if(!e.length)return null;let i=new Np({listening:!1});for(let o of e){let n=t.viewMode==="perspective"&&o.perspectiveAffine,r=n?o.outline.map(a=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,a))):o.outline,s=n?o.holes.map(a=>a.map(l=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,l)))):o.holes;i.add(Qe(r,s,{fill:us,stroke:D("#ffffff",.1),strokeWidth:1,listening:!1},n?void 0:o.outlinePath))}return t.bgLayer.add(i),i.moveToTop(),i}function Sl(t,e){let{bounds:i}=t,n=Math.max(i.width,i.height,1)*4+1e3,r=[{x:i.x-n,y:i.y-n},{x:i.x+i.width+n,y:i.y-n},{x:i.x+i.width+n,y:i.y+i.height+n},{x:i.x-n,y:i.y+i.height+n}],s=new Hp({fill:t.canvasBackground,opacity:1-Pe,listening:!1,perfectDrawEnabled:!1,sceneFunc:(a,l)=>{let c=h=>{if(h.length){a.moveTo(h[0].x,h[0].y);for(let u=1;u<h.length;u++)a.lineTo(h[u].x,h[u].y);a.closePath()}};a.beginPath(),c(r);let d=[];for(let h of e){let u=t.viewMode==="perspective"&&h.perspectiveAffine?h.outline.map(m=>t.perspectiveLocalPoint(t.projectedSectionPoint(h,m))):h.outline.map(m=>{let f=h.liftWorld>0?t.isoLiftLocal(h.liftWorld):{x:0,y:0};return{x:m.x+f.x,y:m.y+f.y}});d.push(u)}d.push(...t.focusedRowLabelCutouts?.()??[]),a.save();for(let h of d)h.length<3||(a.beginPath(),c(r),c(h),a.clip("evenodd"));a.beginPath(),c(r),a.fillStrokeShape(l),a.restore()}});return t.overlayLayer.add(s),s.moveToTop(),s}var Gp=.2;function vl(t,e){return t.startsWith("#")?ee(e,t,Gp):t}var Cl=.5,U=Math.SQRT1_2,Wp="#f3f4f6",wl=4;function Vp(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?Cl:Math.min(1,Math.max(0,e))}function zp(t){return t==="booked"||t==="not_for_sale"?cs:ls}function kl(t,e){return Number.parseInt(t.slice(e,e+2),16)}function xl(t){let e=t.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,i,o,n]=e.toLowerCase();return`#${i}${i}${o}${o}${n}${n}`}function Kp(t,e,i){let o=xl(t),n=xl(e);if(!o||!n)return t;let r=Math.min(1,Math.max(0,i)),s="#";for(let a=1;a<7;a+=2){let l=Math.round(kl(o,a)*(1-r)+kl(n,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function Ll(t,e,i,o){let n=i*4,r=e*U,s=-e*U,a=o*U*2*n,l=o*-U*2*n,c=r+n*U,d=s+n*U,h=r-n*U,u=s-n*U;t.beginPath(),t.moveTo(c,d),t.lineTo(h,u),t.lineTo(h+a,u+l),t.lineTo(c+a,d+l),t.closePath(),t.clip()}function Xp(t,e){let i=e*4,o=Math.max(e*.45,1);t.beginPath();for(let n=-wl;n<=wl;n++){let r=n*o*2,s=r+o,a=r*U,l=-r*U,c=s*U,d=-s*U;t.moveTo(a+i*U,l+i*U),t.lineTo(a-i*U,l-i*U),t.lineTo(c-i*U,d-i*U),t.lineTo(c+i*U,d+i*U),t.closePath()}t.clip()}function Ri(t,e){t._sceneFunc(e)}function Pl(t){let e=this,i=e.attrs,o=i.markRadius||1,n=i.fill,r=e.getStage(),s=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(o*2*s<16){i.fill=i.markMidtone??n,Ri(e,t),i.fill=n;return}let l=(1-2*(i.markFraction??Cl))*o;t.save(),Ll(t,l,o,1),i.fill=i.markBase??n,Ri(e,t),t.restore(),t.save(),Ll(t,l,o,-1),i.fill=i.markFill??n,Ri(e,t),i.markHatch&&(Xp(t,o),i.fill=Wp,Ri(e,t)),t.restore(),i.fill=n}function Yp(t,e,i,o,n,r){let s=Vp(e),a=zp(i),l=t.attrs;l.markFraction=s,l.markBase=o,l.markFill=a,l.markMidtone=Kp(o,a,1-s),l.markHatch=r,l.markRadius=n>0?n:1,t.fill(l.markMidtone),t.stroke(""),t.strokeWidth(0),t.dash([]),t.opacity(1),t.sceneFunc(Pl)}function Up(t){t.setAttr("sceneFunc",void 0)}function Ei(t){return t.attrs.sceneFunc===Pl}var Ai=class{constructor(){this.marks=new Map}get size(){return this.marks.size}get(e){return this.marks.get(e)??null}has(e){return this.marks.has(e)}clear(){this.marks.clear()}merge(e,i){let o=new Set;for(let[n,r]of Object.entries(e))i.has(n)&&(r&&r.kind==="partial"?(this.marks.set(n,r),o.add(n)):this.marks.delete(n)&&o.add(n));return o}paint(e,i,o,n,r,s,a){let l=a?void 0:this.marks.get(i);if(!l){Ei(e)&&Up(e);return}Yp(e,l,o,n,r,s)}};var Tl="#9ca3af";var $p="#f4b740",qp="#854d0e",Zp="#1a1200",jp="#f1f4f9",Qp="#1a2234",Jp="#475569",ef="#c3cbdc";function tf(t){return t==="held"||t==="booked"||t==="not_for_sale"}function Il(t,e=!1,i=!1){if(!tf(t))return null;if(e){if(t==="not_for_sale"){let o=i?ef:Jp;return{fill:i?Qp:jp,stroke:o,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"cross",glyphInk:o}}return t==="booked"?{fill:Tl,stroke:"",strokeWidth:0,dash:[],opacity:.75,scale:1}:{fill:$p,stroke:qp,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"clock",glyphInk:Zp}}return{fill:Tl,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}}function Ml(t){let{focusedId:e}=t;if(!e)return null;let i=new Set([e]),o=t.sectionOf(e);if(o!=null){for(let c of t.seats){let d=t.seatId(c);t.sectionOf(d)===o&&i.add(d)}return i}let n=t.seats.find(c=>t.seatId(c)===e);if(!n)return i;let r=t.seatPoint(n),s=t.seatPitch>0?t.seatPitch:t.seatRadius*2,a=6*(s>0?s:1),l=a*a;for(let c of t.seats){let d=t.seatPoint(c),h=d.x-r.x,u=d.y-r.y;h*h+u*u<=l&&i.add(t.seatId(c))}return i}function Rl(t,e,i){let o=i(t);return o!=null&&o===i(e)}var Fi=Object.freeze([]),of=.18;function Al(t,e,i){let o=t.seat(i),n=t.seatStatus(i),r=t.isSelected(i),s=t.categoryColor(o.categoryKey),a=t.boothLabel(i),l=t.canvasBackground(),c=t.selectionColor();e.dash(Fi),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let d=n==="held"&&t.isOwnedHold(i),h=t.organizer?.()??!1,u=d?null:Il(n,h,h&&!V(l));if(u?(e.fill(u.fill),e.stroke(u.stroke),e.strokeWidth(u.strokeWidth),e.dash(u.dash),e.opacity(u.opacity),u.scale!==1&&e.scale({x:u.scale,y:u.scale})):d?(e.fill(de(s,c===ut?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===ut?de(s,.28):s),t.seatMarks.paint(e,i,n,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),Ei(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&n==="free"&&(e.stroke(xt(o.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),e.strokeWidth(r?3:2),e.dash([3,2])),a){a.text(u?"":o.displayLabel??o.label);let T=t.boothExtent(o.rowId);a.fontSize(T?be({...T,text:o.displayLabel??o.label}):Ge),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??je),a.offsetX(a.width()/2),a.offsetY(a.height()/2)}let m=n==="free"||n==="held"&&!t.isOwnedHold(i),f=()=>{let T=e.fill();typeof T=="string"&&e.fill(vl(T,l))},b=t.accessFilter();if(b&&m&&!r){let T=Me(o,b);T==="other"?(f(),e.opacity(Math.min(e.opacity(),Ma))):T==="companion"&&e.opacity(Math.min(e.opacity(),Ra))}let p=t.categoryHighlight();p&&n==="free"&&!r&&o.categoryKey!==p&&e.opacity(.25);let g=t.seatHighlight();g&&!r&&!g.has(i)&&e.opacity(Math.min(e.opacity(),of));let y=t.categoryFilter();y&&m&&!r&&!y.has(o.categoryKey)&&(f(),e.opacity(.22)),t.commercialLimitedFilter()&&n==="free"&&!r&&(o.commercial?.restrictedView||o.commercial?.obstructedView)&&e.opacity(.22);let S=t.dimmedSections();if(S.size){let T=t.seatSection(i);(T?S.has(T.id)||S.has(T.logicalId)||T.zone!=null&&S.has(T.zone):S.has(Un))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(ds),e.stroke(""),e.strokeWidth(0),e.dash(Fi),e.opacity(hs),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let x=t.boothLabel(i)??t.seatLabel(i);if(x){x.fill(t.seatLabelInk(o,e));let T=!a&&(r||d);x.visible(ye(x.fontSize(),t.effScale())&&e.opacity()>=.5&&!T)}let w=t.organizerGlyph,v=u?.glyph??null,k=Ei(e)||t.closedSections().size>0&&t.seatInClosedSection(i);if(w&&v&&!k){let T=a?t.boothExtent(o.rowId):void 0,L=T?Math.min(T.width,T.height)/2:t.seatRadius();w.apply(e,v,u.glyphInk??"",L)}else w?.isPainted(e)&&w.clear(e);let P=t.accessGlyph(i);if(P){let T=e.fill();P.fill(oi(typeof T=="string"?T:"")),P.opacity(e.opacity()),P.visible(t.accessGlyphShouldShow(i))}let C=t.accessRing(i);C&&(C.stroke(xt(o.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),C.opacity(e.opacity()),C.visible(t.accessRingShouldShow(i)))}function _i(t,e){let i=null,o=1/0;for(let[n,r]of t){if(!r.getLayer())continue;let s=r.getClientRect(),a=s.x+s.width/2,l=s.y+s.height/2,c=Math.max(s.width/2,22),d=Math.max(s.height/2,22),h=Math.abs(e.x-a),u=Math.abs(e.y-l);if(h>c||u>d)continue;let m=h*h+u*u;m<o&&(o=m,i=n)}return i}function Bi(t){return t?.getAttr?.("seatId")??void 0}var jo=.85,nf=.38,rf=Object.freeze([3,3]);function sf(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function El(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function af(t){let e=null,i=0,o=()=>{i=0,!(!e||t.destroyed?.())&&(t.viewMode()!=="flat"||t.seatsPickable()||(t.clusterLabels.setPressLandsOnChart(!El(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return n=>{e=n,i||(i=requestAnimationFrame(o))}}function Fl(t){t.attachHoverCard();let e=af(t);t.seatLayer.on("click tap",i=>{if(t.moved()>_e||t.isGhostClick(i))return;let o=Bi(i.target);o&&t.seatsPickable()&&t.handleSeatTap(o)}),t.seatLayer.on("mouseover",i=>{let o=Bi(i.target);if(!o)return;let n=t.seat(o);if(!n)return;t.setHoveredId(o);let r=lf(t,o);t.hoverRing.position(t.renderedSeatPoint(n));let s=t.viewMode()==="perspective"?t.perspectiveSeatScale(o):1;t.hoverRing.scale({x:s,y:s}),t.hoverRing.opacity(r==="muted"?nf:jo),t.hoverRing.dash(r==="muted"?rf:Fi),t.hoverRing.visible(r!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(r==="full"),t.onHover?.(n,{mark:t.seatMark(o),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let i=t.stage.getPointerPosition();i&&e(i)}),t.stage.on("wheel",i=>{i.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let o=t.container.getBoundingClientRect(),n={x:i.evt.clientX-o.left,y:i.evt.clientY-o.top},r=Math.exp(-i.evt.deltaY*.002);t.zoomAbout(t.stage.scaleX()*Y(r,.5,2),n,"frame"),e(n)}),t.stage.on("click tap",i=>{if(t.moved()>_e||t.isGhostClick(i))return;let o=t.stage.getPointerPosition();if(!o)return;if(t.sectionCount()){let r=t.ownedBadgeAt(t.screenToWorld(o));if(r&&t.focusOwnedSeats(r))return}if(!(Bi(i.target)&&t.seatsPickable())){let r=_i(t.selectionMarkers(),o);if(r){t.focusSeats([r],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(o))return;if(t.rowLabelAt&&t.selectRow){let r=t.rowLabelAt(o);if(r){t.selectRow(r);return}}if(!t.cached()){if(Bi(i.target)&&t.seatsPickable())return;if(t.seatsPickable()){let r=t.focusedSectionId(),s=t.nearestSeatToScreen(o,fe),a=s?t.seatSection(s):null;if(s&&(!r||a&&t.sectionMatchesFocus(a))){t.handleSeatTap(s);return}let l=s?null:t.nearestSeatToScreen(o,fe,!0),c=l?t.seatSection(l):null;if(l&&(!r||c&&t.sectionMatchesFocus(c))){t.handleSeatTap(l);return}if(r&&t.onBackdropTap&&!t.floorOverview()){let h=t.sectionAt(o);if(h&&t.sectionInteractive?.(h)===!1)return;if(h&&h!==r){let u=t.sectionTapAnchor(h,t.screenToWorld(o));t.onSectionTap?t.onSectionTap(h,u):t.focusSection(h,{anchor:u})}else h||t.onBackdropTap();return}if(r)return;let d=t.sectionCount()?sf(t,o):null;if(!d||t.effScale()>=oe||t.sectionFrameScale(d)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let r=t.floorOverview()?t.sectionAt(o):null,s=(r?t.objectFloor(r):null)??t.deckFloorAt();if(s){t.onDeckTap(s);return}}if(t.sectionCount()){let r=t.screenToWorld(o),s=t.ownedBadgeAt(r);if(s&&t.focusOwnedSeats(s)||!s&&El(t,o))return;let a=s??t.sectionAt(o);if(a){let l=t.sectionTapAnchor(a,r);t.onSectionTap?t.onSectionTap(a,l):t.focusSection(a,{anchor:l});return}if(!t.pressLandsOnChart(o))return}if(!t.seatsPickable()){let r=t.tableAt?.(o);if(r?.length&&t.focusSeats(r,{animate:!t.reducedMotion()}))return}if(t.clusterLabels.focusCluster(o)||t.clusterLabels.glideTowardTap(o))return;let n=Math.max(Se*1.2,t.stage.scaleX()*2.5);t.zoomAbout(n,o)})}function _l(t,e){if((t.stacked()||t.floorOverview())&&t.onDeckTap){let o=t.objectFloor(t.seat(e)?.rowId??"");if(o){t.onDeckTap(o);return}}if(t.effScale()<oe&&t.sectionCount()){let o=t.seatSection(e);if(o){let n=t.focusedSectionId()===o.logicalId,r=t.sectionFrameScale(o.logicalId)>t.stage.scaleX()*1.02;if(!n&&r){let s=t.seat(e),a=s?t.renderedSeatPoint(s):void 0;t.onSectionTap?t.onSectionTap(o.logicalId,a):t.focusSection(o.logicalId,{anchor:a});return}}}if(!(t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e))){let o=t.seat(e)??null,n=t.hiddenByAccessFilter(e);o&&(n||t.hasSeatMark(e))&&(t.onHover?.(o,{mark:t.seatMark(e)??null,interaction:"press",unavailable:!0,...n?{filteredOut:!0}:{}}),t.nudgeSeat(e));return}t.hasSeatMark(e)&&t.onHover?.(t.seat(e)??null,{mark:t.seatMark(e),interaction:"press"}),t.toggleSeat(e)}function lf(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function Bl(t,e){return!e.manageMode||!e.marqueeSelect||!e.atSeatRung||t.pointerType==="touch"||t.button!==0?!1:t.shiftKey||e.hitSeatAt(t.local)}function Ol(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<ae}import{Path as nm}from"konva/lib/shapes/Path";var cf=10;function df(t){let e=t.framingViewport();if(t.stage.width()>=j||t.exportMode())return e;let i=cf;return{...e,x:e.x+i,y:e.y+i,width:Math.max(1,e.width-i*2),height:Math.max(1,e.height-i*2)}}function Dl(t){let e=df(t),i=t.revealWorldRect?.()??null,o=e.width,n=e.height,r=t.perspectiveBounds(),s=t.viewMode()==="perspective"&&r?r:t.bounds();if(t.setFitScale(Math.min(o/s.width,n/s.height)||1),t.portraitFitCrop()&&!t.exportMode()){let c=o/s.width<=n/s.height,d=s.height*t.fitScale();c&&d<.55*n&&t.setFitScale(Math.min(t.fitScale()*1.3,.62*n/s.height))}let a=uf(t);a&&t.setFitScale(hf);let l=t.fitScale();if(t.stage.scale({x:l,y:l}),t.stage.position({x:e.x+(o-s.width*l)/2-s.x*l,y:e.y+(n-s.height*l)/2-s.y*l}),t.settleView(),!t.exportMode()){let c=ia(t.stage,[t.bgLayer,t.seatLayer],e,a?t.stage.scaleX()*1.000001:t.effScale()<ae?ae*.999999*(t.stage.scaleX()/Math.max(t.effScale(),1e-9)):void 0,i);c>0&&c!==1&&t.setFitScale(t.fitScale()*c),c>0&&(t.afterViewChange(),Ao(t.stage,[t.bgLayer,t.seatLayer],e,i)),pf(t,e),t.setFitPose(qe(t.stage))}t.stage.batchDraw()}var hf=Z*(1-1e-6);function uf(t){if(!t.openAtSectionsWhenDense?.()||!t.hasSections?.()||t.exportMode())return!1;let e=t.fitScale();return e>=Z&&e<Se}function pf(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let o=t.revealWorldRect?.()??null,n=At(t.stage,[t.bgLayer,t.seatLayer],o);if(!n)return;let r=t.fitClearanceWidth?.()??0;if(r>0&&n.x+n.width<=e.x+e.width-r)return;let s=e.height-i;if(n.height<=s){Ao(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:s},o);return}let a=e.y+xi-n.y;a<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+a})}function Bt(t){let e=t.fitScale();t.zones().length&&(e=Math.min(e,ze*.9));let i=(t.focusedFrameScale?.()??0)*2;return{min:e,max:Math.max(e,t.fitScale(),t.unitZoomCeiling(),i)}}function Nl(t,e,i,o="now"){let n=t.stage.position();Ya(t.stage,e,i,Bt(t))&&(t.stage.position(t.constrainPan(t.stage.position(),n)),o==="frame"?(t.updateSeatGroupVisibility(),ff(t)):t.afterViewChange(),t.stage.batchDraw())}function ff(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function Hl(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function mf(t,e,i,o,n=0){Ua(t.stage,e,Bt(t),i,Ot(t.framingViewport(),n),o),t.settleView(),t.stage.batchDraw()}function Gl(t,e,i){let o=typeof e=="string"?t.sectionBounds(e):e;if(!o)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){mf(t,o,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let n=Ot(t.framingViewport(),i?.focusPaddingPx??0),r=n.width,s=n.height,{min:a,max:l}=Bt(t),c=1.12,d=Math.min(r/(o.width*c),s/(o.height*c)),h=i?.minScale??a,u=Y(Math.max(d,h),a,Math.max(h,_t({min:a,max:l},i?.maxScale))),m=n.x+r/2-(o.x+o.width/2)*u,f=n.y+s/2-(o.y+o.height/2)*u,b=t.stage.scaleX(),p=t.stage.x(),g=t.stage.y();if(Math.abs(u-b)<1e-4&&Math.abs(m-p)<.5&&Math.abs(f-g)<.5){t.settleView();return}let y=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let x=w=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let v=Math.min(1,(w-y)/S),k=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,P=b+(u-b)*k;t.stage.scale({x:P,y:P}),t.stage.position({x:p+(m-p)*k,y:g+(f-g)*k}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),v<1?t.setGlideRaf(requestAnimationFrame(x)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(x))}function Ot(t,e){let i=Math.max(0,Math.min(e,t.width/3,t.height/3));return i===0?t:{x:t.x+i,y:t.y+i,width:t.width-i*2,height:t.height-i*2}}import{Text as gf}from"konva/lib/shapes/Text";function Wl(t){let e=new WeakMap;return()=>{let i=t(),o=i.labelFont(),n=Ze(),r=e.get(i.seats);if(r&&r.radius===i.seatR&&r.font===o&&r.generation===n)return r.value;let s=bf(i);return e.set(i.seats,{radius:i.seatR,font:o,generation:n,value:s}),s}}function bf(t){let e=1/0,i=new gf({fontSize:ge,fontStyle:"600",fontFamily:t.labelFont(),listening:!1}),o=t.seatR*2-3,n=new Map;for(let s of t.seats){if(s.kind==="booth"){let h=t.blockExtent?.(s);e=Math.min(e,h?be({...h,text:s.displayLabel??s.label}):Ge);continue}let a=ge*t.seatLabelScale(s),l=ti(s.displayLabel??s.label),c=n.get(a);c||n.set(a,c=new Map);let d=c.get(l);if(d===void 0&&(i.fontSize(a),i.text(l),d=i.width()>o?Math.max(rt,a*o/i.width()):a,c.set(l,d)),e=Math.min(e,d),e<=rt)break}i.destroy();let r=Number.isFinite(e)?e:Ge;return z/Math.max(rt,r)}function zl(t,e,i,o,n,r=.35){return!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(e)||!(i.width>0)||!(i.height>0)?t:{x:Vl(t.x,e,i.x,i.width,o.x,o.width,r,n?.x),y:Vl(t.y,e,i.y,i.height,o.y,o.height,r,n?.y)}}function Vl(t,e,i,o,n,r,s,a){if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(n)||!Number.isFinite(r))return t;let l=o*e,c=Math.min(l,r*(1-s)),d=n+c-(i+o)*e,h=n+r-c-i*e;if(!(d<=h))return t;if(Number.isFinite(a)){let u=a;return Math.min(Math.max(t,Math.min(d,u)),Math.max(h,u))}return Math.min(Math.max(t,d),h)}var Qo={top:0,right:0,bottom:0,left:0};function Kl(t){let e=i=>typeof i=="number"&&Number.isFinite(i)&&i>0?i:0;return t?{top:e(t.top),right:e(t.right),bottom:e(t.bottom),left:e(t.left)}:{...Qo}}var yf=.7;function Xl(t,e,i){let{top:o,right:n,bottom:r,left:s}=i,a=(u,m,f)=>{let b=u+m,p=f*yf;if(b<=p||b<=0)return[u,m];let g=p/b;return[u*g,m*g]},[l,c]=a(s,n,t),[d,h]=a(o,r,e);return{x:l,y:d,width:Math.max(1,t-l-c),height:Math.max(1,e-d-h)}}function Yl(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function Ul(t,e){return!Number.isFinite(e.x)||!Number.isFinite(e.y)||!(e.scale>0)?!1:(t.scale({x:e.scale,y:e.scale}),t.position({x:e.x,y:e.y}),!0)}function Dt(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function $l(t,e){let i=e({x:t.x,y:t.y}),o=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(i.x,o.x),y:Math.min(i.y,o.y),width:Math.abs(o.x-i.x),height:Math.abs(o.y-i.y)}}function ql(t){let e=[];for(let i of t)i.type==="table"&&e.push({id:i.id,centre:{x:i.center.x,y:i.center.y},radius:i.shape==="round"?i.radius??40:Math.max(Math.abs(i.width??80),Math.abs(i.height??50))/2});return e}function Jo(t,e,i,o){let n=Sf(t,i,o);if(!n)return null;let r=e.filter(s=>s.rowId===n.id).map(s=>s.id);return r.length?r:null}function Sf(t,e,i){let o=Math.max(i,1e-9),n=null;for(let r of t){let s=Math.max(r.radius,ni/2/o),a=Math.hypot(e.x-r.centre.x,e.y-r.centre.y);a>s||(!n||a<n.distance)&&(n={table:r,distance:a})}return n?.table??null}function jl(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?_r:Fr}function Ql(t){return Math.max(t*1.05,Cr,Z*1.3)}var vf=42;function Jl(t){return vf/(2*Math.max(t,1e-4))}function Je(t,e){let i=1/0,o=-1/0,n=1/0,r=-1/0;for(let s of t)i=Math.min(i,s.x),o=Math.max(o,s.x),n=Math.min(n,s.y),r=Math.max(r,s.y);return i-=e,o+=e,n-=e,r+=e,{x:i,y:n,width:Math.max(40,o-i),height:Math.max(40,r-n)}}function ec(t){let{stageWidth:e,stageHeight:i,fullBounds:o,visibleBounds:n,seatPoints:r,minScale:s}=t;if(!r.length)return null;let a=1.12;if(Math.min(e/(o.width*a),i/(o.height*a))>=s)return null;let c=t.tapAnchor??{x:n.x+n.width/2,y:n.y+n.height/2},d=r[0],h=1/0;for(let b of r){let p=(b.x-c.x)**2+(b.y-c.y)**2;p<h&&(d=b,h=p)}let u=e/(s*a),m=i/(s*a),f=Je(r,0);return{bounds:{x:Zl(d.x,u,f.x,f.width),y:Zl(d.y,m,f.y,f.height),width:u,height:m},minScale:s}}function Zl(t,e,i,o){return o<=e?i+o/2-e/2:Math.min(Math.max(t-e/2,i),i+o-e)}import{Shape as kf}from"konva/lib/Shape";var tc=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},wf=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function ic(t,e){let i=new Map;for(let n of t){if(n.kind==="booth")continue;let r=e.get(n.rowId),s=tc(n);if(!(r&&r>0)||s==null)continue;let a=wf(n),l=i.get(a)??[];l.push({seat:n,index:s}),i.set(a,l)}let o=[];for(let n of i.values()){n.sort((a,l)=>a.index-l.index||a.seat.id.localeCompare(l.seat.id));let r=[],s=()=>{r.length&&(o.push({seats:r,points:r.map(({x:a,y:l})=>({x:a,y:l}))}),r=[])};for(let a of n){let l=r[r.length-1];if(l){let c=tc(l),d=Math.hypot(a.seat.x-l.x,a.seat.y-l.y),h=e.get(a.seat.rowId),u=Math.max(1e-6,h*1e-6);(c==null||a.index!==c+1||d<=u||d>h*1.5)&&s()}r.push(a.seat)}s()}return o}var Nt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15}get active(){return this.entries.length>0}clear(){for(let e of this.entries)e.section.liftGroupSeat.opacity(e.opacity),e.section.liftGroupSeat.listening(e.listening),e.shape.destroy();this.entries=[],this.key=""}sync(e,i,o,n,r,s,a,l,c=()=>1,d=()=>!1,h=()=>1/0){if(!l||!e||!o){this.clear(),this.focusKey=null;return}if(this.doc!==e){this.clear(),this.doc=e,this.spacing.clear(),this.focusKey=null;for(let f of[...e.objects,...(e.floors??[]).flatMap(b=>b.objects)])f.type==="row"&&this.spacing.set(f.id,f.seatSpacing)}if(this.focusKey!==o&&(this.focusKey=o,this.detailScale=Math.min(Math.max(1.15,c()*1.15),h()*.9)),n>=this.detailScale){this.clear();return}let u=i.filter(f=>f.id===o||f.logicalId===o||d(f)),m=u.map(f=>f.id).join("|");if(!(this.key===m&&this.active)){this.clear(),this.key=m;for(let f of u){if(f.memberIds.length>2e3||f.memberIds.some(g=>!a.has(g)||!this.spacing.has(s.get(g)?.rowId??"")))continue;let b=ic(f.memberIds.map(g=>s.get(g)).filter(Boolean),this.spacing);if(!b.length||b.reduce((g,y)=>g+y.seats.length,0)!==f.memberIds.length)continue;let p=new kf({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:g=>{let y=g._context,S=p.getStage(),x=S&&S.width()<=j?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;y.save(),y.lineWidth=x*2,y.lineCap="round",y.lineJoin="round";let w=v=>{let k=a.get(v.id);return D(String(k.fill()),k.opacity())};for(let v of b){let k=v.points;if(k.length===1){y.fillStyle=w(v.seats[0]),y.beginPath(),y.arc(k[0].x,k[0].y,x,0,Math.PI*2),y.fill();continue}let P=v.seats.map(w),C=(M,R)=>{let A=Math.hypot(R.x-M.x,R.y-M.y);return{x:-(R.y-M.y)/A,y:(R.x-M.x)/A}},T=k.map((M,R)=>{let A=k[Math.max(0,R-1)],E=k[Math.min(k.length-1,R+1)];return Math.hypot(E.x-A.x,E.y-A.y)>.001?C(A,E):C(k[R],k[R+1]??k[R-1])}),L=(M,R,A)=>({x:M.x+R.x*x*A,y:M.y+R.y*x*A}),I=0;for(;I<k.length;){let M=I;for(;M+1<k.length&&P[M+1]===P[I];)M++;let R=I===0?k[0]:{x:(k[I-1].x+k[I].x)/2,y:(k[I-1].y+k[I].y)/2},A=M===k.length-1?k[M]:{x:(k[M].x+k[M+1].x)/2,y:(k[M].y+k[M+1].y)/2},E=I===0?T[0]:C(k[I-1],k[I]),F=M===k.length-1?T[M]:C(k[M],k[M+1]),H=[R,...k.slice(I,M+1),A],G=[E,...T.slice(I,M+1),F],Q=H.map((_,W)=>L(_,G[W],1)),N=H.map((_,W)=>L(_,G[W],-1));y.fillStyle=P[I],y.beginPath(),y.moveTo(Q[0].x,Q[0].y);for(let _ of Q.slice(1))y.lineTo(_.x,_.y);if(M===k.length-1){let _=Math.atan2(F.y,F.x);y.arc(A.x,A.y,x,_,_-Math.PI,!0)}else y.lineTo(N[N.length-1].x,N[N.length-1].y);for(let _ of N.slice(0,-1).reverse())y.lineTo(_.x,_.y);if(I===0){let _=Math.atan2(-E.y,-E.x);y.arc(R.x,R.y,x,_,_-Math.PI,!0)}y.closePath(),y.fill(),I=M+1}}y.restore()}});this.entries.push({section:f,shape:p,opacity:f.liftGroupSeat.opacity(),listening:f.liftGroupSeat.listening()}),f.liftGroupBg.add(p),f.liftGroupSeat.opacity(0),f.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};import{Text as xf}from"konva/lib/shapes/Text";var oc=new WeakMap,Lf=(t,e)=>{let i=new xf({text:t,fontSize:Ct,fontStyle:"700",fontFamily:e}),o={width:i.width(),height:i.height()};return i.destroy(),o};function nc(t,e,i,o=Lf){let n=oc.get(t);n||oc.set(t,n=new Map);let r=`${e}\0${Ze()}`,s=n.get(r);s||n.set(r,s=new Map);let a=s.get(i);if(a!==void 0)return a;let l=0;for(let d of t){if(!d.focusKeys?.includes(i))continue;let h=o(d.text,e);l=Math.max(l,h.width,h.height)}let c=l>0?Math.ceil(l+z+ie*2+6):0;return s.set(i,c),c}function rc(t){let e=t.getClientRect({skipTransform:!0,skipShadow:!0});!Number.isFinite(e.width)||!Number.isFinite(e.height)||(t.offsetX(e.x+e.width/2),t.offsetY(e.y+e.height/2))}var en=1e6;function Cf(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function tn(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Oi=class{constructor(e,i=Cf()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.lastTapAt=0;this.rect=null;this.onLayoutChanged=()=>{this.rect=null};this.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||(this.rect=null,this.beginPointer(e.pointerId,this.toLocal(e.clientX,e.clientY),e.pointerType,e.button,e.shiftKey))};this.onPointerMove=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId))return;e.preventDefault();let i=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,i)&&this.applyPointerMove(i)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId)};this.onTouchStart=e=>{if(!tn(e)){e.preventDefault(),this.rect=null;for(let i=0;i<e.changedTouches.length;i+=1){let o=e.changedTouches.item(i);o&&this.beginPointer(en+o.identifier,this.toLocal(o.clientX,o.clientY),"touch",0)}}};this.onTouchMove=e=>{if(tn(e))return;e.preventDefault();let i=null;for(let o=0;o<e.changedTouches.length;o+=1){let n=e.changedTouches.item(o);if(!n)continue;let r=this.toLocal(n.clientX,n.clientY);this.updatePointer(en+n.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!tn(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let o=e.changedTouches.item(i);o&&this.endPointer(en+o.identifier)}}};this.host=e,this.useWebKitTouchEvents=i}get moved(){return this.movedPx}attach(){let{container:e}=this.host;this.rect=null,typeof window<"u"&&(window.addEventListener("scroll",this.onLayoutChanged,{capture:!0,passive:!0}),window.addEventListener("resize",this.onLayoutChanged,{passive:!0}),window.visualViewport?.addEventListener("resize",this.onLayoutChanged),window.visualViewport?.addEventListener("scroll",this.onLayoutChanged)),e.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),e.addEventListener("pointermove",this.onPointerMove,{passive:!1}),e.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),e.addEventListener("pointercancel",this.onPointerEnd,{passive:!1}),this.useWebKitTouchEvents&&(e.addEventListener("touchstart",this.onTouchStart,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove,{passive:!1}),e.addEventListener("touchend",this.onTouchEnd,{passive:!1}),e.addEventListener("touchcancel",this.onTouchEnd,{passive:!1}))}detach(){let{container:e}=this.host;typeof window<"u"&&(window.removeEventListener("scroll",this.onLayoutChanged,{capture:!0}),window.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("scroll",this.onLayoutChanged)),e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerEnd),e.removeEventListener("pointercancel",this.onPointerEnd),this.useWebKitTouchEvents&&(e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("touchcancel",this.onTouchEnd))}resetPan(){this.panLast=null,this.panStart=null,this.panStarted=!1}isGhostClick(e){return e.type==="tap"?(this.lastTapAt=performance.now(),!1):this.lastTapAt>0&&performance.now()-this.lastTapAt<Pr}invalidateRect(){this.rect=null}toLocal(e,i){let o=this.rect;if(!o){let n=this.host.container.getBoundingClientRect();o={left:n.left,top:n.top},this.rect=o}return{x:e-o.left,y:i-o.top}}beginPointer(e,i,o,n,r=!1){if(this.host.cancelGlide(),this.host.dismissFocusRing?.(),this.pointers.set(e,i),this.pointers.size===1)this.movedPx=0,this.singleTouch=o==="touch",this.singleTouch&&this.host.touchProbeStart?.(i),this.pinch=null,this.panStart=i,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:o,button:n,local:i,shiftKey:r})?(this.host.beginMarquee(i),this.panLast=null):this.panLast=i;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[s,a]=[...this.pointers.values()],l={x:(s.x+a.x)/2,y:(s.y+a.y)/2},c=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(a.x-s.x,a.y-s.y),startScale:c,worldMid:{x:(l.x-this.host.stage.x())/c,y:(l.y-this.host.stage.y())/c}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=_e+1}}updatePointer(e,i){return this.pointers.has(e)?(this.pointers.set(e,i),this.pointers.size===1&&this.panStart?this.movedPx=Math.max(this.movedPx,Math.hypot(i.x-this.panStart.x,i.y-this.panStart.y)):this.pointers.size>=2&&(this.movedPx=_e+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>_e?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[i,o]=[...this.pointers.values()],n=Math.hypot(o.x-i.x,o.y-i.y);if(this.pinch.startDist<1)return;let r={x:(i.x+o.x)/2,y:(i.y+o.y)/2},{min:s,max:a}=this.host.zoomBounds(),l=Y(this.pinch.startScale*(n/this.pinch.startDist),s,a),c={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.scale({x:l,y:l}),this.host.stage.position(this.host.constrainPan({x:r.x-this.pinch.worldMid.x*l,y:r.y-this.pinch.worldMid.y*l},c)),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=_e)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}let i={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.position(this.host.constrainPan({x:i.x+(e.x-this.panLast.x),y:i.y+(e.y-this.panLast.y)},i)),this.panLast=e,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}}endPointer(e){if(this.pointers.has(e)){if(this.host.marqueeActive()){this.endTouchProbe(),this.host.finishMarquee(),this.pointers.delete(e),this.pointers.size===0&&(this.panLast=null);return}this.pointers.delete(e),this.pointers.size<2&&(this.pinch=null),this.pointers.size===1&&(this.panLast=[...this.pointers.values()][0],this.panStart=this.panLast,this.panStarted=!0),this.pointers.size===0&&(this.panLast=null,this.panStart=null,this.panStarted=!1,this.endTouchProbe(),this.host.afterViewChange())}}endTouchProbe(){this.singleTouch&&(this.singleTouch=!1,this.host.touchProbeEnd?.())}};import{Circle as Pf}from"konva/lib/shapes/Circle";import{Group as Tf}from"konva/lib/Group";import{Text as If}from"konva/lib/shapes/Text";var sc=13,Mf=15,Rf=.3,Af=.08;function dc(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function Ef(t,e){return!e||t.available==null?`cap ${t.capacity}`:t.available<=0?B("map.soldOut"):B("map.seatsLeft",{count:t.available})}function Ff(t,e){return e&&t.available!=null&&t.available<=0}function hc(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),o=t.overviewHidden(e),n=Ff(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:t.dimmed(e.categoryKey)?We*Af:n?We*Rf:We),e.polygon.listening(!t.exportMode&&!o&&!i&&!n),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),_f(t,e,n,r,o,t.dimmed(e.categoryKey))}}function _f(t,e,i,o,n,r){if(e.capacityNode){let s=Ef(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}Bf(t,e,n||r),o>0&&!n?Df(t,e,o):e.chip&&e.chip.visible(!1)}var on=9,ac=.86;function Bf(t,e,i){let{labelNode:o,capacityNode:n}=e;if(!o&&!n)return;let r=Math.max(t.effScale(),1e-4);if(i){o?.visible(!1),n?.visible(!1);return}if(!t.pickerMode){o?.visible(t.labelLegible(o.fontSize())),n?.visible(t.labelLegible(n.fontSize()));return}let s=Of(e,r),a=lc(o,Qt,s.width*ac,r),l=lc(n,Jt,s.width*ac,r),c=a!=null,d=l!=null&&c&&a+l+on<=s.height;cc(o,c?a:null,e.labelPoint.y-on/r,r),cc(n,d?l:null,e.labelPoint.y+on/r,r)}function Of(t,e){let i=1/0,o=-1/0,n=1/0,r=-1/0;for(let s of t.points)s.x<i&&(i=s.x),s.x>o&&(o=s.x),s.y<n&&(n=s.y),s.y>r&&(r=s.y);return Number.isFinite(i)?{width:(o-i)*e,height:(r-n)*e}:{width:0,height:0}}function lc(t,e,i,o){if(!t||!t.text())return null;t.fontSize(e/o);let n=t.width()*o;if(n<=i||n<=0)return e;let r=e*(i/n);return r>=z?r:null}function cc(t,e,i,o){if(t){if(e==null){t.visible(!1);return}t.fontSize(e/o),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i),t.visible(!0)}}function Df(t,e,i){if(!e.chip){let o=new Tf({x:e.labelPoint.x,y:e.labelPoint.y-sc-16,listening:!1}),n=new Pf({radius:sc,fill:t.selectionColor,listening:!1,perfectDrawEnabled:!1}),r=new If({text:String(i),fontSize:Mf,fontStyle:"800",fontFamily:t.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});o.add(n),o.add(r),t.bgLayer.add(o),e.chip=o,e.chipText=r}e.chipText&&e.chipText.text()!==String(i)&&e.chipText.text(String(i)),e.chipText&&(e.chipText.offsetX(e.chipText.width()/2),e.chipText.offsetY(e.chipText.height()/2)),e.chip.visible(!0),e.chip.moveToTop()}function uc(t,e){let i=!1;for(let[o,n]of Object.entries(e)){let r=t.get(o);r&&(n.available!==void 0&&r.available!==n.available&&(r.available=n.available,i=!0),n.selected!==void 0&&r.selected!==n.selected&&(r.selected=n.selected,i=!0))}return i}function pc(t){let{width:e,height:i}=t;return!(e>0)||!(i>0)?"hidden":e===t.stageWidth&&i===t.stageHeight?"unchanged":{width:e,height:i}}function fc(t){let{rung:e,viewCentre:i,target:o,width:n,height:r}=t,s=i.x,a=i.y;if(e==="sections"&&t.sections.length>0){let c=t.sections.map(m=>{let f=K(m.outline);return{x:f.x+f.width/2,y:f.y+f.height/2}}),d=n/(o*2),h=r/(o*2);if(!c.some(m=>Math.abs(m.x-i.x)<=d&&Math.abs(m.y-i.y)<=h)){let m=c.reduce((f,b)=>{let p=(b.x-i.x)**2+(b.y-i.y)**2;return p<f.distance?{point:b,distance:p}:f},{point:c[0],distance:1/0});s=m.point.x,a=m.point.y}}let l=e==="seats"?t.seats.filter(c=>c.kind!=="booth"):[];if(l.length>0){let c=l[0],d=1/0;for(let h of l){let u=h.x-i.x,m=h.y-i.y,f=u*u+m*m;f<d&&(c=h,d=f)}s=c.x,a=c.y}return{x:s,y:a}}function mc(t,e,i,o){if(t.length<3)return[];let n=1/0,r=-1/0,s=1/0,a=-1/0;for(let d of t)d.x<n&&(n=d.x),d.x>r&&(r=d.x),d.y<s&&(s=d.y),d.y>a&&(a=d.y);if((r-n)*i<4&&(a-s)*i<4)return[];let l=t,c=[];for(let d of e){let h=o.rendered(d);h.x<n||h.x>r||h.y<s||h.y>a||_n(h,l)&&o.selectable(d.id)&&c.push(d.id)}return c}function Nf(t){return t.logicalRowId??t.rowId}function gc(t,e,i){let o=[];for(let n of e)n.kind!=="booth"&&(Nf(n)!==t||!i(n.id)||o.push(n.id));return o}function bc(t,e,i=4){for(let o of e){let{box:n}=o;if(t.x>=n.x-i&&t.x<=n.x+n.width+i&&t.y>=n.y-i&&t.y<=n.y+n.height+i)return o.rowKey}return null}import{Line as Hf}from"konva/lib/shapes/Line";import{Rect as Gf}from"konva/lib/shapes/Rect";var Di=class{constructor(e){this.host=e;this.box=null;this.lasso=null}active(){return this.box!==null||this.lasso!==null}begin(e,i){let o=this.host.screenToWorld(e),n=this.host.stageScale()||1,r={stroke:this.host.selectionColor(),strokeWidth:1.5/n,dash:[5/n,4/n],fill:"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(i==="lasso"){let s=new Hf({...r,points:[o.x,o.y],closed:!0,lineJoin:"round"});this.host.overlayLayer().add(s),this.lasso={points:[o],line:s}}else{let s=new Gf({...r,x:o.x,y:o.y,width:0,height:0});this.host.overlayLayer().add(s),this.box={start:o,cur:o,rect:s}}this.host.overlayLayer().batchDraw()}update(e){let i=this.host.screenToWorld(e);if(this.lasso){let r=this.lasso.points[this.lasso.points.length-1];if(Math.hypot(i.x-r.x,i.y-r.y)*(this.host.stageScale()||1)<2)return;this.lasso.points.push(i),this.lasso.line.points(this.lasso.points.flatMap(s=>[s.x,s.y])),this.host.overlayLayer().batchDraw();return}if(!this.box)return;let{start:o,rect:n}=this.box;n.setAttrs({x:Math.min(o.x,i.x),y:Math.min(o.y,i.y),width:Math.abs(i.x-o.x),height:Math.abs(i.y-o.y)}),this.box.cur=i,this.host.overlayLayer().batchDraw()}cancel(){!this.box&&!this.lasso||(this.lasso?.line.destroy(),this.box?.rect.destroy(),this.lasso=null,this.box=null,this.host.overlayLayer().batchDraw())}finish(){let e=this.host.stageScale()||1;if(this.lasso){let{points:l,line:c}=this.lasso;this.lasso=null,c.destroy(),this.host.overlayLayer().batchDraw();let d=l.map(u=>u.x),h=l.map(u=>u.y);if(l.length<3||(Math.max(...d)-Math.min(...d))*e<4&&(Math.max(...h)-Math.min(...h))*e<4)return;this.host.selectMany(mc(l,this.host.seats(),e,{rendered:u=>this.host.renderedSeatPoint(u),selectable:u=>this.host.isSelectable(u)})),this.host.selectionChanged();return}let i=this.box;if(this.box=null,!i)return;i.rect.destroy(),this.host.overlayLayer().batchDraw();let o=Math.min(i.start.x,i.cur.x),n=Math.max(i.start.x,i.cur.x),r=Math.min(i.start.y,i.cur.y),s=Math.max(i.start.y,i.cur.y);if((n-o)*e<4&&(s-r)*e<4)return;let a=[];for(let l of this.host.seats()){let c=this.host.renderedSeatPoint(l);c.x<o||c.x>n||c.y<r||c.y>s||this.host.isSelectable(l.id)&&a.push(l.id)}this.host.selectMany(a),this.host.selectionChanged()}};import{Rect as yc}from"konva/lib/shapes/Rect";import{Text as Wf}from"konva/lib/shapes/Text";function Sc(t){let e=t.effScale(),i=t.stage.scaleX(),o={width:t.stage.width(),height:t.stage.height()},n=p=>Math.round(p*100)/100,r=new Map(t.overlayLayer.find(".selection-ring").map(p=>[String(p.getAttr("seatId")??""),String(p.getAttr("ringColor")??t.effSelection)])),s=t.seats.map(p=>{let g=t.circleById.get(p.id),y=t.boothLabelById.get(p.id)??t.seatLabelById.get(p.id),S=t.viewMode==="perspective"?t.perspectiveSeatScale.get(p.id)??1:1,x=(t.viewMode==="perspective"?i:e)*S,w=p.kind==="booth"?Ge:ge*t.seatLabelScale(p),v=t.viewMode==="perspective"&&p.kind!=="booth"?e*S:x,k=n((y?.fontSize()??w)*v),P=t.worldToScreen(p),C=y?y.width()*i*S:0,T=y?y.height()*(t.viewMode==="perspective"&&p.kind==="booth"?i:e)*S:0,L=P.x-C/2<0||P.x+C/2>o.width||P.y-T/2<0||P.y+T/2>o.height,I=t.focusedSeatOpacity(p.id,g?.getAbsoluteOpacity()??0),M=t.seatSection.get(p.id),R=!!y?.isVisible()&&I>=.5&&!L,A;R||(I<.5?A="dimmed-or-unavailable":k<z?A="below-minimum-size":L?A="outside-viewport":y?A="renderer-hidden":A=t.seatLabelDrops.get(p.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let E=g instanceof yc?g.width()*i*S:t.seatR*2*x,F=g instanceof yc?g.height()*(t.viewMode==="perspective"?i:e)*S:t.seatR*2*x,H=2*(t.seatR*x+fe),G=g?.fill(),Q=y?.fill(),N=t.accessGlyphById.get(p.id),_=N?.getAbsoluteScale();return{seatId:p.id,label:p.label,kind:p.kind==="booth"?"booth":"seat",markerShape:p.kind==="booth"?"booth":p.wheelchairSpaceType==="no-seat"?"square":"circle",...p.wheelchairSpaceType?{wheelchairSpaceType:p.wheelchairSpaceType}:{},categoryKey:p.categoryKey,...M?{sectionId:M.id}:{},...M?.zone?{zoneId:M.zone}:{},status:t.statusById.get(p.id)??"free",selected:t.selection.has(p.id),visible:R,renderedFontPx:k,fill:typeof G=="string"?G:"",ink:typeof Q=="string"?Q:g?t.seatLabelInk(p,g):t.seatPreferredLabelInk(p),...r.has(p.id)?{selectionRingColor:r.get(p.id)}:{},opacity:n(I),...N?{accessibilityMarker:{glyphVisible:N.isVisible(),glyphWidthPx:n(Fe*Math.abs(_?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(p.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(p.id)&&!!g?.isVisible()&&!!g?.isListening()&&t.isSelectable(p.id),directWidthPx:n(E),directHeightPx:n(F),effectiveMinimumPx:n(Math.max(Math.min(E,F),H))},screenCenter:{x:n(P.x),y:n(P.y)},...R?{screenBox:{x:n(P.x-C/2),y:n(P.y-T/2),width:n(C),height:n(T)}}:{},...A?{hiddenReason:A}:{}}}),a=s.filter(p=>p.visible).length,l=(p,g,y,S,x,w,v)=>{let k=dt({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),P=w&&w.liftWorld>0?t.isoLiftLocal(w.liftWorld):{x:0,y:0},C=K(k.map(A=>t.worldToScreen({x:A.x+P.x,y:A.y+P.y}))),T=n(S.opacity()),L=S.fill(),I=C.x+C.width<0||C.x>o.width||C.y+C.height<0||C.y>o.height,M=S.isVisible()&&T>.05&&!I,R=w?ht({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),w.outline,w.holes):void 0;return{id:p,kind:g,role:y,label:S.text(),visible:M,renderedFontPx:n(S.fontSize()*i),...v==null?{}:{sizeFloorPx:v},opacity:T,fill:x,ink:typeof L=="string"?L:"",...R==null?{}:{fitsContainer:R},...M?{screenBox:{x:n(C.x),y:n(C.y),width:n(C.width),height:n(C.height)}}:{}}},c=p=>{let g=p.namePlate.fill();if(p.namePlate.opacity()>.05&&typeof g=="string"&&g)return g;let y=p.blockPoly.fill();return typeof y=="string"?y:p.baseFill},d=p=>{let g=p.blockPoly.fill();return typeof g=="string"?g:p.baseFill},h=[...t.sections.map(p=>l(p.id,"section","name",p.nameLabel,c(p),p,It(o.width))),...t.sections.map(p=>l(`${p.id}:availability`,"section","availability",p.subLabel,c(p),p)),...t.sections.map(p=>l(`${p.id}:number`,"section","number",p.numberLabel,d(p),p,ui(o.width))),...t.zones.flatMap(p=>[l(p.id,"zone","name",p.label,p.background),...p.sub?[l(`${p.id}:price`,"zone","price",p.sub,p.background)]:[]])],u=[...t.gaById].map(([p,g])=>{let y=g.points.map(L=>t.worldToScreen(L)),S=Math.min(...y.map(L=>L.x)),x=Math.min(...y.map(L=>L.y)),w=Math.max(...y.map(L=>L.x)),v=Math.max(...y.map(L=>L.y)),k=w<0||S>o.width||v<0||x>o.height,P=n(g.polygon.opacity()),C=P>=.1&&!k,T=g.polygon.fill();return{areaId:p,label:g.label,capacity:g.capacity,categoryKey:g.categoryKey,...g.sectionId?{sectionId:g.sectionId}:{},visible:C,interactive:g.polygon.listening(),opacity:P,fill:typeof T=="string"?T:"",effectiveBackground:g.effectiveBackground,...C?{screenBox:{x:n(S),y:n(x),width:n(w-S),height:n(v-x)}}:{}}}),m=[...t.freeTextById].map(([p,g])=>{let{node:y,kind:S}=g,x=g.plate&&g.plate.opacity()>.05?g.plate.fill():null,w=typeof x=="string"&&x?x:g.background,v=t.worldToScreen({x:y.x(),y:y.y()}),k=y.width()*i,P=y.height()*e,C=v.x-y.offsetX()*i,T=v.y-y.offsetY()*e,L=n(y.fontSize()*e),I=C+k<0||C>o.width||T+P<0||T>o.height,M=y.isVisible()&&!I,R=y.fill(),A=n(y.getAbsoluteOpacity()),E;return M||(L<z?E="below-minimum-size":I?E="outside-viewport":E="renderer-hidden"),{objectId:g.objectId??p,kind:S,text:y.text(),visible:M,renderedFontPx:L,ink:typeof R=="string"?R:"",background:w,opacity:A,...M?{screenBox:{x:n(C),y:n(T),width:n(k),height:n(P)}}:{},...E?{hiddenReason:E}:{}}}),f=t.labelGroup.find(p=>p.getAttr("rowLabel")===!0).filter(p=>p instanceof Wf).map(p=>{let g=p.getClientRect({skipShadow:!0,skipStroke:!0}),y=g.x+g.width<0||g.x>o.width||g.y+g.height<0||g.y>o.height,S=p.fill();return{text:p.text(),visible:p.isVisible()&&!y,renderedFontPx:n(p.fontSize()*e),ink:typeof S=="string"?S:"",...y?{}:{screenBox:{x:n(g.x),y:n(g.y),width:n(g.width),height:n(g.height)}}}}),b=t.sections.filter(p=>p.blockPoly.opacity()>.05);return{viewport:o,projection:t.viewMode,...t.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:t.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:t.canvasBackground,effectiveScale:n(e),rung:t.getRung(),minimumVisibleLabelPx:z,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+u.reduce((p,g)=>p+g.capacity,0),selectionRingSeatIds:t.overlayLayer.find(".selection-ring").map(p=>String(p.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:t.effSelection,focusedSectionId:t.focusedSectionId,focusBackdropVisible:!!t.focusBackdrop?.isVisible(),categoryFilterKeys:t.categoryFilter?[...t.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:b.length,categoryPaintedSectionShells:b.filter(p=>{let g=p.blockPoly.fill();return typeof g!="string"||!mo(t.canvasBackground,g)}).length,tintedSectionShells:b.filter(p=>{let g=p.blockPoly.fill();return typeof g=="string"&&bs(t.canvasBackground,g)}).length,visibleCategoryDetailOutlines:t.sections.filter(p=>p.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:t.sections.filter(p=>p.subLabel.opacity()>.05).length,visibleSectionGADetails:[...t.gaById.values()].filter(p=>p.sectionId!=null&&p.polygon.opacity()>.05).length},labels:s,gaAreas:u,hierarchyLabels:h,freeTextLabels:m,rowLabels:f}}import{Circle as Vf}from"konva/lib/shapes/Circle";import{Ellipse as zf}from"konva/lib/shapes/Ellipse";import{Line as vc}from"konva/lib/shapes/Line";import{Arrow as Kf}from"konva/lib/shapes/Arrow";import{Path as Xf}from"konva/lib/shapes/Path";import{Rect as Ht}from"konva/lib/shapes/Rect";import{Text as rn}from"konva/lib/shapes/Text";import{Image as kc}from"konva/lib/shapes/Image";function xc(t,e){if(!e.url||e.visible===!1)return;let i=new window.Image;t.trackAssetImage(i,e.url,"Buyer background image",()=>{let o=i.naturalWidth||4,n=i.naturalHeight||3,r=e.crop??{x:0,y:0,width:1,height:1},s=Math.max(0,Math.min(.99,r.x)),a=Math.max(0,Math.min(.99,r.y)),l={x:s,y:a,width:Math.max(.01,Math.min(1-s,r.width)),height:Math.max(.01,Math.min(1-a,r.height))},c=e.width,d=c*(n*l.height/(o*l.width)),h=new kc({image:i,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:d/2,width:c,height:d,rotation:e.rotation??0,crop:{x:l.x*o,y:l.y*n,width:l.width*o,height:l.height*n},opacity:e.opacity,listening:!1}),u=e.layer==="above"?t.fgDecorGroup:t.bgLayer;u.add(h),h.moveToBottom(),u.getLayer()?.batchDraw()})}function Lc(t,e){let i=new window.Image,o=new kc({image:i,x:e.x+e.width/2,y:e.y+e.height/2,offsetX:e.width/2,offsetY:e.height/2,width:e.width,height:e.height,rotation:e.rotation??0,opacity:Y(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?t.fgDecorGroup.add(o):t.bgLayer.add(o),e.role&&t.landmarkBoxes.push(K(dt({x:e.x+e.width/2,y:e.y+e.height/2},e.width,e.height,e.rotation??0))),t.trackAssetImage(i,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let n=o.getLayer();n&&n.batchDraw()})}function Cc(t,e){let i=e.fill??t.theme.decorFill??Oo,o=de(i,.12);if(e.shape==="round")t.bgLayer.add(new Vf({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:i,stroke:o,strokeWidth:1.5,listening:!1}));else{let r=e.width??80,s=e.height??50;t.bgLayer.add(new Ht({x:e.center.x,y:e.center.y,width:r,height:s,offsetX:r/2,offsetY:s/2,rotation:e.rotation,fill:i,stroke:o,strokeWidth:1.5,cornerRadius:4,listening:!1}))}let n=Gt(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,q(i,t.theme.textColor??"#cbd5e1"),12,!0);t.freeTextById.set(e.id,{node:n,background:i,kind:"table"})}var Yf=8,Uf=6;function $f(t,e){let i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),o=Math.max(Yf,e*.35),n=Math.max(Uf,e*.28);return{offsetX:-(i.x-o),offsetY:-(i.y-n),width:i.width+o*2,height:i.height+n*2}}function Pc(t,e){let i=e.background?.color??t.canvasBackground,o=e.color??q(i,t.theme.textColor??Ea),n=e.semanticKind==="icon"?fr(e.iconKey):void 0;if(n){let d=e.fontSize/24,h=new Xf({x:e.position.x,y:e.position.y,data:n,rotation:e.rotation,scaleX:d,scaleY:d,stroke:o,strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});t.iconNodeById.set(e.id,{node:h,fontSize:e.fontSize}),t.bgLayer.add(h);return}let r=e.background?.padding??0,s=e.opacity??1,a=Gn(e),l=new rn({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:Do(e.bold,e.italic,"600"),fill:o,fontFamily:e.fontFamily??t.labelFont(),...e.width!=null?{width:e.width}:{},align:e.align??"left",lineHeight:e.lineHeight??1.2,letterSpacing:e.letterSpacing??0,textDecoration:e.underline?"underline":"",padding:r,opacity:s,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;e.background&&(c=new Ht({x:e.position.x,y:e.position.y,...$f(l,e.fontSize),rotation:e.rotation,fill:e.background.color,opacity:s*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),t.bgLayer.add(c)),t.freeTextById.set(e.id,{node:l,backdrop:c,background:i,kind:a?"direct-landmark":"free-text",...e.labelImportance==="detail"?{showAt:"detail"}:{}}),t.bgLayer.add(l)}function Tc(t,e){let i=e.fill??t.theme.decorFill??Oo,o=e.role==="stage",n=e.role==="reference-focal",r=!!e.role&&!o,s=Hn(e),a=le(t.canvasBackground),l=n?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(o?de(l,.28):n?a.focalStroke:c?"#9aa3b5":void 0),h=e.stroke?.width??(o?1:n||c?2:0),u=e.opacity!=null?Y(e.opacity,.1,1):1,m=0,f=0,b=null;if(c&&e.points&&e.points.length>=2){m=e.points.reduce((S,x)=>S+x.x,0)/e.points.length,f=e.points.reduce((S,x)=>S+x.y,0)/e.points.length;let p=mr(e),g=gr(h),y=new Kf({points:e.points.flatMap(S=>[S.x,S.y]),closed:!1,x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,stroke:d,fill:d,strokeWidth:h,opacity:u,lineCap:p.lineCap,lineJoin:p.lineJoin,pointerAtBeginning:p.startEnding==="arrow",pointerAtEnding:p.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path"});y.setAttr("shapeObjectId",e.id),t.bgLayer.add(y)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let p=o?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,Le(l,.3),1,de(l,.12)]}:{fill:l};m=e.x+e.width/2,f=e.y+e.height/2,b={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Ht({x:m,y:f,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:d,strokeWidth:h,cornerRadius:Y(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:u,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){m=e.x+e.width/2,f=e.y+e.height/2,b={x:e.x,y:e.y,width:e.width,height:e.height};let p=o?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,Le(l,.3),1,de(l,.12)]}:{fill:l};t.bgLayer.add(new zf({x:m,y:f,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...p,stroke:d,strokeWidth:h,opacity:u,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let p=e.points.flatMap(S=>[S.x,S.y]),g=K(e.points);m=e.points.reduce((S,x)=>S+x.x,0)/e.points.length,f=e.points.reduce((S,x)=>S+x.y,0)/e.points.length,b=g;let y=o?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,Le(l,.3),1,de(l,.12)]}:{fill:l};t.bgLayer.add(new vc({points:p,closed:!0,x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,...y,stroke:d,strokeWidth:h,opacity:u,listening:!1}))}b&&e.role&&t.landmarkBoxes.push(b);for(let p of Fn(e))t.bgLayer.add(new vc({points:p.points.flatMap(g=>[g.x,g.y]),closed:p.closed,x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,stroke:p.ink??En,fill:p.fill,strokeWidth:2,opacity:u*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:p,spec:g}=Zf(t,m,f,e.label,l,b,e.labelStyle);t.primaryFocalLabels.set(p,g),t.freeTextById.set(e.id,{node:p,background:l,plate:g.plate,kind:"stage"})}else if(r){let p=n||s,g=Gt(t,t.bgLayer,e.label,m,f,p?q(l,"#e6e9f0"):"#9aa3b5",p?18:12,!1);p&&t.primaryFocalLabels.set(g,{targetPx:18,trackingRatio:0,ink:String(g.fill()??""),plateInk:String(g.fill()??""),plate:new Ht({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:g,background:l,kind:"decor"})}else{let p=Gt(t,t.bgLayer,e.label,m,f,"#cbd5e1",16,!0);t.freeTextById.set(e.id,{node:p,background:l,kind:"decor"})}}var nn=22,wc=z,Ni=6,qf=.5;function Zf(t,e,i,o,n,r,s){let a=s?.size??nn,l=s?.color??t.theme.textColor??"#e6e9f0",c=s?.color??q(n,l),d=r?r.x+r.width/2:e,h=r?r.y+r.height/2:i,u=jf(t.canvasBackground,n),m=new Ht({x:d,y:h,width:0,height:0,cornerRadius:4,fill:u,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(m);let f=new rn({x:d,y:h,text:o,fontSize:a,fontStyle:Do(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/nn),fontFamily:s?.fontFamily??t.labelFont(),fill:c,textDecoration:s?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return f.offsetX(f.width()/2),f.offsetY(f.height()/2),t.bgLayer.add(f),{node:f,spec:{targetPx:a,...r?{bounds:r}:{},trackingRatio:4/nn,...s?.direction?{direction:s.direction}:{},ink:c,plateInk:s?.color??q(u,l),plate:m}}}function jf(t,e){return ee(e,V(t)?"#ffffff":"#000000",.34)}function Ic(t,e,i,o,n=0){let r=Math.max(i,1e-4),s=n>0&&r>n?r/n:1,l=Math.min(e.targetPx,Math.max(wc,e.targetPx*qf)*s)/r,c=g=>{t.letterSpacing(g*e.trackingRatio),o(t,g)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let h=Pn(e.direction,d);t.rotation(h?90:0);let u={width:(h?d.height:d.width)-Ni*2,height:(h?d.width:d.height)-Ni*2},m=Math.min(1,u.width/Math.max(t.width(),1e-6),u.height/Math.max(t.height(),1e-6));if(m<1&&(l=Math.max(wc/r,l*m),c(l)),t.width()<=u.width&&t.height()<=u.height){e.plate.opacity(0),t.fill(e.ink);return}let b=(h?t.height():t.width())+Ni*2,p=(h?t.width():t.height())+Ni;e.plate.size({width:b,height:p}),e.plate.offset({x:b/2,y:p/2}),e.plate.opacity(1),t.fill(e.plateInk)}function Mc(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",o=t.canvasBackground,n=tr(i,o,We),r=t.theme.textColor??"#e6e9f0",s=q(n,r),a=Qe(e.points,e.holes,{fill:i,opacity:We,stroke:i,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",u=>{t.isGhostClick(u)||t.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{t.container.style.cursor="pointer"}),a.on("mouseleave",()=>{t.container.style.cursor="default"}),t.bgLayer.add(a);let l=$t(e.points,e.holes),c=t.sections.find(u=>J(l,u.outline,u.holes)),d=Gt(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-8,s,Qt,!1),h=Gt(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,Jt,!1);t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:d,background:n,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:n,kind:"ga-capacity",categoryKey:e.categoryKey}),t.gaById.set(e.id,{label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:n,strokeColor:i,labelPoint:l,labelNode:d,capacityNode:h,...c?{sectionId:c.logicalId}:{}})}function Gt(t,e,i,o,n,r,s,a){let l=new rn({x:o,y:n,text:i,fontSize:s,fontStyle:a?"700":"500",fontFamily:t.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function Rc(t,e){let i=[],o=e.canvasBackground,n=new Map,r=(d,h)=>{let u=n.get(d)??[];u.push(h),n.set(d,u)};for(let d of e.seats){if(d.kind==="booth")continue;let h=d.logicalRowId??d.rowId;r(h,d),h!==d.rowId&&r(d.rowId,d)}let s=d=>d.logicalSeatIndex??Number(d.id.split(":").pop()??0);for(let d of t.objects){if(d.type!=="row")continue;let h=d.segmentedRow?.repeatLabelOnComponents===!0;if(d.segmentedRow&&!h&&d.segmentedRow.componentIndex!==0)continue;let u=h?d.labelPresentation:d.segmentedRow?.labelPresentation??d.labelPresentation;if(u?.visible===!1||u?.positionPreset==="none")continue;let m=d.segmentedRow&&!h?d.segmentedRow.groupId:d.id,f=(n.get(m)??[]).slice().sort((A,E)=>s(A)-s(E));if(!f.length)continue;let b=f[0],p=f[f.length-1],g=u?.labelStyle,y=u?.style==="pill"?Et(o):null,S=y?y.plate:o,x=ue(S,g?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Ve),w=g?.size??Jn,v=u?.rotation??0,k=e.objectFilteredOut(d)?.15:1,P=f.reduce((A,E)=>A??e.seatSection.get(E.id),void 0),T=d.segmentedRow?.displayLabel??d.displayLabel??Lt(d.label,P?.label);if(!T)continue;let L=P?[...new Set([P.id,P.logicalId,P.zone].filter(A=>!!A))]:void 0,I=(A,E,F)=>i.push({text:T,x:A,y:E,rotation:v,fontSize:w,ink:x,opacity:k,rowKey:m,...y?{pill:y}:{},...L?.length?{focusKeys:L}:{},...F?{automaticAway:F}:{}});if(u?.position){I(u.position.x,u.position.y);continue}let M=e.seatR+12,R=u?.positionPreset??"start";if(R==="start"||R==="both"){let A=d.rotation*Math.PI/180,E={x:-Math.cos(A),y:-Math.sin(A)};I(b.x+E.x*M,b.y+E.y*M,E)}if(R==="end"||R==="both"){let A=(d.rotation+d.curve)*Math.PI/180,E={x:Math.cos(A),y:Math.sin(A)};I(p.x+E.x*M,p.y+E.y*M,E)}}let a=(e.seatR+12)*2.2,l=[],c=new Map;for(let d of i){let h=c.get(d.text),u=h?.find(m=>Math.hypot(m.x-d.x,m.y-d.y)<=a);if(u){u.x=(u.x+d.x)/2,u.y=(u.y+d.y)/2;continue}l.push(d),h?h.push(d):c.set(d.text,[d])}return l}function sn(t,e,i=ie){let o=t.rotation()*Math.PI/180,n=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),s=(t.width()*n+t.height()*r)/2+i,a=(t.width()*r+t.height()*n)/2+i;return{x:e.x-s,y:e.y-a,width:s*2,height:a*2}}function Ac(t,e,i,o){let n={x:e.x,y:e.y},r=e.automaticAway;if(!r)return n;let s={x:-r.y,y:r.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=[{x:0,y:0}];for(let u=1;u<=4;u++){let m=a*u;l.push({x:s.x*m,y:s.y*m},{x:-s.x*m,y:-s.y*m},{x:r.x*m,y:r.y*m},{x:(r.x+s.x)*m,y:(r.y+s.y)*m},{x:(r.x-s.x)*m,y:(r.y-s.y)*m})}let c=n,d=1/0,h=1/0;for(let u of l){let m={x:n.x+u.x,y:n.y+u.y},f=sn(t,m),p=(o?si(o,f,{mode:"overlap"}).length:0)+i.collisionCount(f),g=Math.hypot(u.x,u.y);if((p<d||p===d&&g<h)&&(c=m,d=p,h=g),p===0)break}return c}var Hi=class{constructor(){this.generationCount=0;this.promises=[];this.errors=[];this.cancels=new Set}get generation(){return this.generationCount}get failures(){return this.errors}pending(){return this.promises.slice()}track(e,i,o,n,r){let s=this.generationCount;/^https?:\/\//i.test(i)&&(e.crossOrigin="anonymous");let a=new Promise(l=>{let c=!1,d=()=>{c||(c=!0,this.cancels.delete(h),l())},h=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}d()};this.cancels.add(h),e.onload=()=>{if(!r.exportMode){s===this.generationCount&&n(),d();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.generationCount&&n()}).catch(()=>{s===this.generationCount&&this.errors.push(`${o} could not be decoded.`)}).finally(d)},e.onerror=()=>{s===this.generationCount&&this.errors.push(`${o} could not be loaded.`),d()},e.src=i});this.promises.push(a)}cancelAll(){this.generationCount++;for(let e of[...this.cancels])e();this.cancels.clear(),this.promises=[],this.errors=[]}};function Ec(t,e){let i=e,o=i._cache instanceof Map?i._cache:null,n=i._canvasCache??o?.get("canvas");if(!n){e.isCached?.()&&e.clearCache();return}let r=[n.scene,n.filter,n.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&t.Util.releaseCanvas(...r),i._canvasCache&&(i._canvasCache=void 0),o?.delete("canvas")}function Fc(t,e){let i=0,o=0,n=r=>{i||(i=r),o+=1;let s=r-i;s>=1e3&&(t(Math.round(o*1e3/s)),o=0,i=r),e(requestAnimationFrame(n))};e(requestAnimationFrame(n))}function Qf(t){return t<0?0:t>1?1:t}function _c(t){let e=t.now??(()=>typeof performance<"u"?performance.now():Date.now()),i=t.budgetMs??8,o=t.reducedMotion===!0,n=t.chunks.length>1?Math.min(30,Math.max(0,840/(t.chunks.length-1))):0,r=0,s=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},h=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},u=p=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,p()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,p()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,p()},16)}},m=()=>{a||s||(a=!0,h(),t.done())},f=p=>{for(let g=c.length-1;g>=0;g--){let y=c[g],S=o?1:Qf((p-y.startedAt)/160);t.fade(y.work,S),S>=1&&c.splice(g,1)}return c.length>0},b=()=>{if(s)return;let p=e(),g=p;for(;r<t.chunks.length&&(r===0||e()-g<i);){let S=t.chunks[r++];if(t.build(S.work),t.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:p+(r-1)*n}),e()-g>=i)break}let y=f(p);t.draw(),r<t.chunks.length||y?u(b):m()};return u(b),{cancel(){if(!a){s=!0,h();for(let p of c)t.fade(p.work,1);c.length=0}},finishNow(){if(!(s||a)){for(;r<t.chunks.length;){let p=t.chunks[r++];t.build(p.work)}for(let p of t.chunks)t.fade(p.work,1);c.length=0,t.draw(),m()}},get done(){return a}}}var Jf={width:40,height:30,rotation:0};function Bc(t,e){let i=1/0,o=1/0,n=-1/0,r=-1/0;for(let s of t){if(s.kind==="booth"){let l=e.boothDims.get(s.rowId)??Jf;if(l.points&&l.points.length>=3){for(let f of l.points)s.x+f.x<i&&(i=s.x+f.x),s.y+f.y<o&&(o=s.y+f.y),s.x+f.x>n&&(n=s.x+f.x),s.y+f.y>r&&(r=s.y+f.y);continue}let c=l.rotation*Math.PI/180,d=l.width/2,h=l.height/2,u=Math.abs(d*Math.cos(c))+Math.abs(h*Math.sin(c)),m=Math.abs(d*Math.sin(c))+Math.abs(h*Math.cos(c));s.x-u<i&&(i=s.x-u),s.y-m<o&&(o=s.y-m),s.x+u>n&&(n=s.x+u),s.y+m>r&&(r=s.y+m);continue}let a=e.seatR+(s.accessible&&s.wheelchairSpaceType!=="no-seat"?2.75:0);s.x-a<i&&(i=s.x-a),s.y-a<o&&(o=s.y-a),s.x+a>n&&(n=s.x+a),s.y+a>r&&(r=s.y+a)}return isFinite(i)?{x:i,y:o,width:n-i,height:r-o}:null}function Oc(t){let e=new Map,i=[];for(let n of t.seats){let r=t.sectionIdOf(n.id);if(r==null){i.push(n);continue}let s=e.get(r);s?s.push(n):e.set(r,[n])}let o=[...e.entries()].flatMap(([n,r])=>{let s=t.sections.find(a=>a.id===n);return s?[{chunk:{id:n,work:{seats:r,group:s.liftGroupSeat}},distance:Math.hypot(s.centroid.x-t.viewportCentre.x,s.centroid.y-t.viewportCentre.y)}]:[]}).sort((n,r)=>n.distance-r.distance).map(n=>n.chunk);return i.length&&t.looseGroup&&o.push({id:"",work:{seats:i,group:t.looseGroup}}),o}function Wt(t){return{th:hi*Math.PI/180*t.isoT,sg:1-(1-Tt)*t.isoT}}function Dc(t,e){let{th:i,sg:o}=Wt(e),n=e.centre,r=t.x-n.x,s=t.y-n.y,a=r*Math.cos(i)-s*Math.sin(i),l=(r*Math.sin(i)+s*Math.cos(i))*o;return{x:n.x+a,y:n.y+l}}function Nc(t,e){let{th:i,sg:o}=Wt(e),n=e.centre,r=t.x-n.x,a=(t.y-n.y)/o,l=r*Math.cos(i)+a*Math.sin(i),c=-r*Math.sin(i)+a*Math.cos(i);return{x:n.x+l,y:n.y+c}}function Hc(t,e){let{th:i,sg:o}=Wt(e),n=t*e.isoT;return{x:-(n/o)*Math.sin(i),y:-(n/o)*Math.cos(i)}}function an(t,e,i){let o=hr(e);t.offset(i),t.position(pe(e,i)),t.rotation(o.rotationDeg),t.scale({x:o.scaleX,y:o.scaleY}),t.skewX(o.skewX),t.skewY(0)}function Vt(t){t.position({x:0,y:0}),t.offset({x:0,y:0}),t.scale({x:1,y:1}),t.rotation(0),t.skewX(0),t.skewY(0)}function Gc(t,e){let i=Math.hypot(e.x-t.surfaceFocal.x,e.y-t.surfaceFocal.y),o=Math.max(0,i-t.frontDistanceWorld);return t.liftWorld+o*Math.tan(t.rakeDeg*Math.PI/180)}function Wc(t,e,i){return t.perspectiveAffine?pe(t.perspectiveAffine,e):pe(i,e)}function et(t,e){return e?pe(e,t):t}function Vc(t,e){let i=0;for(let h of t.seats){let u=Math.max(0,(h.eyeHeightM??se)-se);i=Math.max(i,u*ot)}for(let h of t.objects)h.type==="section"&&(i=Math.max(i,Ut(h,{floorBaseHeightM:t.floorBaseHeightMFor(h.id)}).height*ot));let o=lr(t.bounds,i),n=ai(o,o.target),r=cr(n);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let s=1/0,a=1/0,l=-1/0,c=-1/0;for(let h of t.seats){let u=Math.max(0,(h.eyeHeightM??se)-se),m=Ce(o,h,u*ot),f={x:m.x,y:m.y};e.seatProjected.set(h.id,f),e.seatLocal.set(h.id,pe(r,f)),e.seatDepth.set(h.id,m.depth),e.seatScale.set(h.id,m.scale),s=Math.min(s,m.x),a=Math.min(a,m.y),l=Math.max(l,m.x),c=Math.max(c,m.y)}for(let h of[{x:t.bounds.x,y:t.bounds.y},{x:t.bounds.x+t.bounds.width,y:t.bounds.y},{x:t.bounds.x+t.bounds.width,y:t.bounds.y+t.bounds.height},{x:t.bounds.x,y:t.bounds.y+t.bounds.height}]){let u=Ce(o,h,0);s=Math.min(s,u.x),a=Math.min(a,u.y),l=Math.max(l,u.x),c=Math.max(c,u.y)}let d=Math.max(24,t.seatR*3);return{camera:o,baseAffine:n,baseInverse:r,bounds:Number.isFinite(s)?{x:s-d,y:a-d,width:Math.max(1,l-s+d*2),height:Math.max(1,c-a+d*2)}:null}}function zc(t,e,i){let o=i?[...i].map(n=>t.seatById.get(n)).filter(n=>!!n):e?t.seats:[...t.perspectiveAppliedSeats].map(n=>t.seatById.get(n)).filter(n=>!!n);for(let n of o){if(e&&t.perspectiveAppliedSeats.has(n.id))continue;let r=e?t.perspectiveSeatProjected.get(n.id)??n:n,s=e?t.perspectiveSeatScale.get(n.id)??1:1,a=t.circleById.get(n.id);a?.position(r),a?.scale({x:s,y:s});let l=t.accessRingById.get(n.id);l?.position(r),l?.scale({x:s,y:s});let c=t.accessGlyphById.get(n.id);if(c){let h=t.seatR*1.5/Fe;c.position(r),c.scale({x:h*s,y:h*s})}let d=t.boothLabelById.get(n.id);d?.position(r),d?.scale({x:s,y:s}),e&&t.perspectiveAppliedSeats.add(n.id)}e||t.perspectiveAppliedSeats.clear()}function Gi(t,e=!0){let i=e?[t.bgLayer,t.seatLayer,t.overlayLayer]:[t.bgLayer,t.overlayLayer];for(let o of i)o.position({x:0,y:0}),o.offset({x:0,y:0}),o.scale({x:1,y:1}),o.rotation(0),o.skewX(0),o.skewY(0)}function Kc(t,e=!0){for(let i of t.sections()){Vt(i.rootGroupBg),Vt(i.liftGroupBg),e&&Vt(i.liftGroupSeat),i.rootGroupBg.zIndex(i.bgZIndex),e&&i.liftGroupSeat.zIndex(i.seatZIndex);let o=t.labelLiftGroups.get(i.id);o&&e&&Vt(o),i.perspectiveAffine=void 0,i.perspectiveCorrection=void 0,i.perspectiveDepth=void 0}}function Xc(t,e=!0){let i=t.perspectiveCamera(),o=t.perspectiveBaseAffine(),n=t.perspectiveBaseInverse();if(!i||!o||!n)return;let r=t.seats().length>2500&&t.sections().length>0;t.cached()&&!r&&(t.seatLayer.clearCache(),t.seatLayer.listening(!0),t.setCached(!1)),Gi(t,e),Kc(t,e);for(let a of[t.bgLayer,t.overlayLayer])an(a,o,i.target);t.perspectiveAppliedSeats.clear(),r||t.applyExactSeatAnchors(!0);for(let a of t.sections()){let l=h=>Gc(a,h),c=ai(i,a.centroid,l),d=dr(n,c);a.perspectiveAffine=c,a.perspectiveCorrection=d,a.perspectiveDepth=Ce(i,a.centroid,l(a.centroid)).depth,an(a.liftGroupBg,d,a.centroid);for(let h=0;h<a.sideFaces.length;h++){let u=a.outline[h],m=a.outline[(h+1)%a.outline.length],f=et(Ce(i,u,0),n),b=et(Ce(i,m,0),n),p=et(Ce(i,m,l(m)),n),g=et(Ce(i,u,l(u)),n);a.sideFaces[h].points([f.x,f.y,b.x,b.y,p.x,p.y,g.x,g.y]),a.sideFaces[h].opacity(.9)}}let s=[...t.sections()].sort((a,l)=>(l.perspectiveDepth??0)-(a.perspectiveDepth??0));for(let a of s)a.rootGroupBg.moveToTop(),a.liftGroupSeat.moveToTop();t.unsectionedSeatGroup()?.moveToTop(),t.syncSeatOverlayPositions(),r||t.updateSeatGroupVisibility(),t.bgLayer.batchDraw(),t.seatLayer.batchDraw(),t.overlayLayer.batchDraw()}function Yc(t){if(Kc(t),t.applyExactSeatAnchors(!1),t.isoT()===0)Gi(t);else{let{th:i,sg:o}=Wt(t.isoState()),n=Math.cos(i),r=o*Math.sin(i),s=-Math.sin(i),a=o*Math.cos(i),l=Math.sqrt(n*n+r*r),c=n*a-r*s,d=Math.atan2(r,n)*180/Math.PI,h=l,u=c/l,m=(n*s+r*a)/c,f=t.isoCentre();for(let b of[t.bgLayer,t.seatLayer,t.overlayLayer])b.position({x:f.x,y:f.y}),b.offset({x:f.x,y:f.y}),b.rotation(d),b.scaleX(h),b.scaleY(u),b.skewX(m),b.skewY(0)}t.applyUprightLabels(),t.applyElevation(),t.updateSeatGroupVisibility(),t.bgLayer.batchDraw(),t.seatLayer.batchDraw(),t.overlayLayer.batchDraw()}var Uc=(t,e)=>t.length===e.length&&t.every(i=>e.some(o=>Math.abs(i.x-o.x)<.001&&Math.abs(i.y-o.y)<.001));function $c(t,e){let o=(t?.floors?.length?t.floors.flatMap(c=>c.objects):t?.objects??[]).filter(c=>c.type==="section"),n=e.logicalSectionId??e.id,r=c=>(c.elevation??0)===(e.elevation??0)&&JSON.stringify(c.geometry??null)===JSON.stringify(e.geometry??null),s=o.find(c=>c.id===n),a=n!==e.id&&!!s&&r(s)&&(s.holes??[]).some(c=>Uc(c,e.outline)),l=o.filter(c=>c.id!==e.id&&c.logicalSectionId===e.id&&r(c));return{hidden:a,holes:(e.holes??[]).filter(c=>!l.some(d=>Uc(c,d.outline)))}}import{Group as qc}from"konva/lib/Group";import{Line as em}from"konva/lib/shapes/Line";import{Rect as tm}from"konva/lib/shapes/Rect";import{Text as ln}from"konva/lib/shapes/Text";function Zc(t,e){let i=$t(e.outline,e.holes),o=le(t.canvasBackground),n=[],r=new Map,s=0,a=K(e.outline),l=t.seatIndex?si(t.seatIndex,a).map(F=>t.seatById.get(F)).filter(F=>!!F):t.seats;for(let F of l)t.seatSection.has(F.id)||J(F,e.outline,e.holes)&&(n.push(F.id),r.set(F.categoryKey,(r.get(F.categoryKey)??0)+1),(t.statusById.get(F.id)??"free")==="free"&&s++);let c=e.color??jt([...r].map(([F,H])=>({hex:t.catColor.get(F)??"#6e7bff",w:H})),"#3a4358"),d=An(e.elevation),h=Ut(e,{floorBaseHeightM:t.floorBaseHeightMFor(e.id)}),u=h.height*ot,m=new qc({listening:!1});t.bgLayer.add(m);let f=new qc({listening:!1});m.add(f);let b=new mt({listening:!0});t.seatLayer.add(b);let p=[];if(u>0){let F=Le(t.zoneColor.get(e.zone??"")??c,.42);for(let H=0;H<e.outline.length;H++){let G=new em({points:[],closed:!0,fill:F,stroke:D("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});p.push(G),m.add(G)}}f.moveToTop();let g=f,y=$c(t.chartDoc,e),S=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",x=Qe(e.outline,y.holes,{visible:!y.hidden,stroke:D(S,.5),strokeWidth:1,fill:D(S,.08),listening:!1},e.outlinePath);g.add(x);let w=Qe(e.outline,y.holes,{visible:!y.hidden,fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Ke,opacity:0,listening:!1},e.outlinePath);g.add(w);let v=e.labelPresentation?.labelStyle,k=v?.color,P=o.sectionInk,C=(v?.size??18)/18,T=new tm({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});g.add(T);let L=new ln({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*C,fontStyle:Xe,fontFamily:t.labelFont(),fill:ue(o.sectionFill,k,P),listening:!1,perfectDrawEnabled:!1});L.offsetX(L.width()/2),L.offsetY(L.height()/2),g.add(L);let I=new ln({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Xe,fontFamily:t.labelFont(),fill:ue(o.sectionFill,k,P),opacity:0,listening:!1,perfectDrawEnabled:!1});g.add(I);let M=new ln({x:i.x,y:i.y,text:B("map.seatsLeft",{count:s}),fontSize:12,fontStyle:qr,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});M.offsetX(M.width()/2),g.add(M);let R={id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:i,labelAnchors:[...e.labelPresentation?.position?[e.labelPresentation.position]:[],...ba(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(n.map(F=>t.seatById.get(F)?.categoryKey).filter(Boolean)),shellCategoryColor:t.dominantSellableColor(n),shellFill:o.sectionFill,shellStroke:o.sectionStroke,stateWord:null,...e.labelPresentation?.position&&!J(e.labelPresentation.position,e.outline,e.holes)?{externalLabel:{position:e.labelPresentation.position,rotation:e.labelPresentation.rotation??0}}:{},...e.labelPresentation?.rotation?{authoredLabelRotation:e.labelPresentation.rotation}:{},labelArea:Mn(e.outline,e.holes),zone:e.zone,memberIds:n,total:n.length,free:s,baseFill:c,outlineTint:S,outlinePoly:x,blockPoly:w,namePlate:T,nameLabel:L,numberLabel:I,subLabel:M,preferredInk:P,...k?{explicitInk:k}:{},labelScale:C,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,elevation:d,liftWorld:u,rakeDeg:h.rake,surfaceFocal:n.length?{...t.seatById.get(n[0])?.focalPoint??t.isoCentre}:{...t.chartDoc?.focalPoint??t.isoCentre},frontDistanceWorld:0,rootGroupBg:m,bgZIndex:m.zIndex(),seatZIndex:b.zIndex(),liftGroupBg:f,liftGroupSeat:b,sideFaces:p},A=n.map(F=>t.seatById.get(F)).filter(F=>!!F),E=A.length?A:e.outline;return R.frontDistanceWorld=Math.min(...E.map(F=>Math.hypot(F.x-R.surfaceFocal.x,F.y-R.surfaceFocal.y))),R}function Qc(t,e,i){if(!e?.length)return;let o=new Set(e),n=t.seats.filter(h=>!o.has(h.categoryKey)||t.seatInClosedSection(h.id)?!1:(t.statusById.get(h.id)??"free")==="free"||t.ownedHold.has(h.id));if(!n.length)return;let r=zo(n.map(h=>h.id),t.seatSection);r&&t.focusSection(r);let s=Math.max(24,t.seatR*3),a=n.map(h=>t.renderedSeatPoint(h)),l=t.clusterLabels.boundsForSeats(n.map((h,u)=>({...h,...a[u]})),s),c=Je(a,s);if(l?.singleBlock&&(!t.hasSections||r!=null)){let h=t.clusterLabels.diveTarget(l.bounds,l.anchor);if(h){t.focusRegion(h,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),maxScale:gt(t)});return}}let d={x:c.x+c.width/2,y:c.y+c.height/2};Vo({stage:t.stage,box:c,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(d)})||t.focusRegion(c,{animate:i?.animate,durationMs:t.cameraGlideMs})}function gt(t){let e=Jl(Math.max(t.seatR,t.markerR));return Math.max(e,Da(t.markerR))}var jc=.25;function im(t,e){if(e.length===0)return 1/0;let i=Je([...e],t.sellableUnit.diameter/2),o=t.framingViewport();return Math.min(o.width*jc/Math.max(i.width,1e-6),o.height*jc/Math.max(i.height,1e-6))}function Jc(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let o=ed(t,i);if(!o.length)return!1;t.clearSectionFocus();let n=Math.max(24,t.seatR*3),r=Je(o.map(a=>t.renderedSeatPoint(a)),n),s={x:r.x+r.width/2,y:r.y+r.height/2};return Vo({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:gt(t)}),!0}function ed(t,e){return t.seats.filter(i=>t.seatInClosedSection(i.id)||Me(i,e)!=="match"?!1:(t.statusById.get(i.id)??"free")==="free"||t.ownedHold.has(i.id))}function td(t,e,i){let o=i===void 0?t.accessFilter:i;if(!o||!t.sections.some(r=>r.id===e||r.logicalId===e))return!1;let n=t.sectionMembers(e).filter(r=>{if((t.statusById.get(r)??"free")!=="free")return!1;let s=t.seatById.get(r);return s!=null&&Me(s,o)==="match"});return n.length&&cn(t,n)||t.focusSection(e),!0}function id(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let o=ed(t,i);if(!o.length)return null;let n=Math.max(24,t.seatR*3),r=Je(o.map(l=>t.renderedSeatPoint(l)),n),s=t.getWorldBounds(),a=s.width>0&&s.height>0&&r.width>=s.width*Ft&&r.height>=s.height*Ft;return{spaces:o.length,sections:hn(t,i),wholeVenue:a}}function cn(t,e,i){let o=e.map(u=>t.seatById.get(u)).filter(u=>u!=null);if(!o.length)return!1;let n=t.seatPitch>0?t.seatPitch:t.seatR*2,r=Je(o.map(u=>t.renderedSeatPoint(u)),Math.max(24,t.seatR*3,n*4)),s=t.getWorldBounds();if(s.width>0&&s.height>0&&r.width>=s.width*Ft&&r.height>=s.height*Ft)return!1;let a=zo(o.map(u=>u.id),t.seatSection);a&&t.markSectionFocus(a,{x:r.x+r.width/2,y:r.y+r.height/2});let l=t.rowBandDetailScale()*1.08,c=t.zoomBounds(),d=Math.min(Math.max(Math.min(t.seatLabelTargetScale(),c.max),l),c.max),h=im(t,o.map(u=>t.renderedSeatPoint(u)));return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:d,maxScale:Math.max(Math.min(gt(t),h),d)}),!0}function od(t,e,i=!0,o){let n=t.sectionBounds(e);if(!n)return;let r=t.sectionMembers(e).map(d=>t.seatById.get(d)).filter(d=>d!=null),s=r.filter(d=>(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id)),a=(s.length?s:r).map(d=>t.renderedSeatPoint(d)),l=t.focusedRowLabelGutter(e),c=t.narrowSeatDetailFocus(a,n,o,l);t.focusRegion(c?.bounds??n,{animate:i,minScale:c?.minScale,maxScale:gt(t),focusPaddingPx:l})}function dn(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let o=nd(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,o),o}function nd(t,e,i){return ol(e.memberIds,i,o=>t.statusById.get(o)??"free",o=>t.seatById.get(o))}function hn(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return[];let o=i===t.accessFilter,n=new Map;for(let r of t.sections){if(t.isSectionClosed(r))continue;let s=o?dn(t,r):nd(t,r,i);if(s<=0)continue;let a=n.get(r.logicalId);a?a.free+=s:n.set(r.logicalId,{id:r.logicalId,label:r.label,free:s})}return[...n.values()]}var rm=1800,Kt=class Kt{constructor(e,i={}){this.seatLabelPool=new Map;this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;this.canonicalSeatIds=new Set;this.seatIndex=null;this.chartDoc=null;this.activeFloorId="";this.stacked=!1;this.floorOverview=!1;this.floorLabelStyle="number";this.circleById=new Map;this.glyphMarkers=[];this.seatGlyphDetail=!0;this.boothDims=new Map;this.boothLabelById=new Map;this.seatLabelById=new Map;this.seatLabelDrops=new Map;this.seatLabelRungOpen=!1;this.accessRingById=new Map;this.accessGlyphById=new Map;this.freeTextById=new Map;this.iconNodeById=new Map;this.primaryFocalLabels=new Map;this.gaById=new Map;this.statusById=new Map;this.catColor=new Map;this.catByKey=new Map;this.theme={};this.canvasBackground=No;this.effSelection=ut;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;this.catOrder=[];this.selection=new Set;this.selectedSeatById=new Map;this.selectionMarkers=new Map;this.momentsCache=null;this.breathCache=null;this.ownedCache=null;this.beaconsCache=null;this.hoverCardCache=null;this.ownedHold=new Set;this.seatMarks=new Ai;this.seatPaintCache=null;this.selectionFocusId=null;this.selectionFocusKeep=null;this.hiddenPose=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;this.accessFreeBySection=new Map;this.categoryHighlight=null;this.seatHighlight=null;this.labelLayers={seatLabels:!0,rowLabels:!0};this.categoryColours=!0;this.categoryFilter=null;this.commercialLimitedFilter=!1;this.sections=[];this.zones=[];this.landmarkBoxes=[];this.seatSection=new Map;this.unsectionedSeatGroup=null;this.catPrice=new Map;this.dimmedSections=new Set;this.sectionHeat=new Map;this.closedSections=new Set;this.focusedSectionId=null;this.focusMembership=new Map;this.focusMembershipKey=null;this.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.sectionFocusDim=null;this.cameraGestures=0;this.objectFloor=new Map;this.unsectionedSeatIds=null;this.tableFootprints=[];this.zoneColor=new Map;this.hasSections=!1;this.hasBoothText=!1;this.isoT=0;this.isoTarget=0;this.isoRaf=0;this.viewMode="flat";this.perspectiveCamera=null;this.perspectiveBaseAffine=null;this.perspectiveBaseInverse=null;this.perspectiveSeatLocal=new Map;this.perspectiveSeatProjected=new Map;this.perspectiveSeatDepth=new Map;this.perspectiveSeatScale=new Map;this.perspectiveAppliedSeats=new Set;this.perspectiveBounds=null;this.isoCentre={x:0,y:0};this.glideRaf=0;this.labelsVisible=!1;this.labelFadeRaf=0;this.glideInProgress=!1;this.destroyed=!1;this.lodScale=0;this.reducedMotion=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.cameraGlideMs=jl();this.fitScale=1;this.fitPose="";this.viewportInsets={...Qo};this.fitClearance={bottom:0,width:0};this.seatR=te;this.markerR=te;this.seatPitch=0;this.sellableUnit=Wo(te);this.bounds={x:0,y:0,width:1,height:1};this.cached=!1;this.dpr=Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);this.assets=new Hi;this.seatReveal=null;this.seatRevealPending=!1;this.revealWorldRect=null;this.progressiveSeatFloor=800;this.viewportSeats=null;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.zoomSettleRaf=0;this.readingFocusedFrame=!1;this.marquee=new Di({overlayLayer:()=>this.overlayLayer,stageScale:()=>this.stage.scaleX(),screenToWorld:e=>this.screenToWorld(e),selectionColor:()=>this.effSelection,seats:()=>this.seats,renderedSeatPoint:e=>this.renderedSeatPoint(e),isSelectable:e=>this.isSelectable(e),selectMany:e=>{this.selectMany(e)},selectionChanged:()=>{this.opts.onMarquee?.(this.getSelection())}});this.organizerStatus=!0;this.onKeyDown=e=>{if(this.opts.manageMode){if((e.metaKey||e.ctrlKey)&&(e.key==="a"||e.key==="A")){e.preventDefault(),this.opts.onMarquee?.(this.selectAllSelectable());return}if(e.key==="Escape"&&this.selection.size){e.preventDefault(),this.clearSelection(),this.opts.onMarquee?.([]);return}}let i=e.key==="ArrowLeft"?{x:-1,y:0}:e.key==="ArrowRight"?{x:1,y:0}:e.key==="ArrowUp"?{x:0,y:-1}:e.key==="ArrowDown"?{x:0,y:1}:null;if(i){e.preventDefault();let o=this.focusedId?this.nearestSeat(this.focusedId,i):this.seats[0]?.id??null;o&&this.focusSeat(o);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let o=this.seatById.get(this.focusedId);o&&this.opts.onFocusSeat?.(o)}};this.focusRingLinger=null;this.cameraHostCache=null;this.projectionHostCache=null;this.seatAnchorContextCache=null;this.viewportWanted=[];this.viewportPinSync=!1;this.interactionHostCache=null;this.seatLabelTargetScale=Wl(()=>({seats:this.seats,seatR:this.seatR,labelFont:()=>this.labelFont(),seatLabelScale:e=>this.seatLabelScale(e),blockExtent:e=>{let i=this.boothDims.get(e.rowId);return i?pt(i):void 0}}));this.movingLabelTimer=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...i},this.exportMode=i.exportMode===!0,this.loadingReveal=i.loadingReveal??"progressive",this.onSeatsRevealed=i.onSeatsRevealed,this.currency=i.currency;let o=Wi.pixelRatio;if(this.exportMode&&(this.dpr=1),Wi.pixelRatio=this.dpr,this.stage=new om({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Oi(this.pointerHost),this.exportMode||(e.style.touchAction="none",this.gestures.attach(),e.tabIndex<0&&(e.tabIndex=0),e.setAttribute("role","application"),e.getAttribute("aria-label")||e.setAttribute("aria-label",B("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new un({listening:!this.exportMode}),this.seatLayer=new un({listening:!this.exportMode}),this.overlayLayer=new un({listening:!1}),this.labelGroup=new zt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new zt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new zt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new Mi({labelLayer:this.overlayLayer,stage:this.stage,exportMode:this.exportMode,canvasBackground:()=>this.canvasBackground,labelFont:()=>this.labelFont(),reducedMotion:()=>this.reducedMotion,destroyed:()=>this.destroyed,hasSections:()=>this.hasSections,seats:()=>this.seats,seatR:()=>this.seatR,readableScale:()=>Wa(this.sellableUnit),pickableScale:()=>Ii(this.sellableUnit),categoryLabel:n=>this.catByKey.get(n)?.label??"",categoryColor:n=>this.categoryDisplayColor(n),categoryFilter:()=>this.categoryFilter,viewMode:()=>this.viewMode,seatsPickable:()=>this.seatsPickable(),screenToWorld:n=>this.screenToWorld(n),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(n,r)=>this.focusRegion(n,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new rd({radius:te+2,stroke:"#ffffff",strokeWidth:2,opacity:jo,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new rd({radius:te+3,stroke:"#38bdf8",strokeWidth:2.5,dash:[4,3],opacity:.95,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.focusRing),this.stage.add(this.bgLayer,this.seatLayer,this.overlayLayer),this.exportMode&&(Wi.pixelRatio=o),!this.exportMode){this.wireInteraction();let n=this.opts.onFps;n&&Fc(n,r=>{this.rafId=r})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}setRowBandPreview(e){this.rowBandPreview?.clear(),this.rowBandPreview=e?new Nt:null,this.rowBandZoomAnchor=null,this.hoverRing.visible(!1),this.updateLOD(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw()}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get moments(){return this.momentsCache||(this.momentsCache=new vi({overlayLayer:this.overlayLayer,seatLayer:this.seatLayer,stage:this.stage,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,isCached:()=>this.cached,isExportMode:()=>this.exportMode,labelFont:()=>this.labelFont(),viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),seatPoint:e=>this.renderedSeatPoint(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,selectionFocusDims:e=>this.selectionFocusDims(e),categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.categoryPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,i)=>this.nearestSeatToScreen(e,i)})),this.momentsCache}get breath(){return this.breathCache||(this.breathCache=new wi({overlayLayer:this.overlayLayer,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,categoryColor:e=>this.categoryDisplayColor(e),seatCategoryKey:e=>this.seatById.get(e)?.categoryKey??null,isOwnedHold:e=>this.ownedHold.has(e),reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed})),this.breathCache}presentSeatHover(e,i,o,n){this.hoverCard.presentSeat(e,i,o,n)}get hoverCard(){return this.hoverCardCache||(this.hoverCardCache=new Ci({container:this.container,labelFont:()=>this.labelFont(),canvasBackground:()=>this.canvasBackground,seatsPickable:()=>this.seatsPickable(),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionLabel:e=>this.sections.find(i=>i.logicalId===e)?.label??null,sectionMembers:e=>this.sectionMembers(e),hoveredSeatId:()=>this.hoveredId,hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,nearestSeat:e=>this.nearestSeatToScreen(e,fe,!0),seat:e=>this.seatById.get(e),seatSectionLabel:e=>this.seatSection.get(e)?.label??null,seatStatus:e=>this.statusById.get(e)??"free",seatOwnedHold:e=>this.ownedHold.has(e),seatClosed:e=>this.seatInClosedSection(e),seatSellable:e=>this.opts.manageMode?!this.seatInClosedSection(e)&&(this.statusById.get(e)??"free")==="free":this.isSelectable(e),categoryOrder:()=>this.catOrder,categoryLabel:e=>this.catByKey.get(e)?.label??"",categoryPrice:e=>this.categoryPriceLabel(e),categoryColor:e=>this.categoryDisplayColor(e),categorySellable:e=>this.catByKey.get(e)?.notForSale!==!0,chartDoc:()=>this.chartDoc,seatFacts:e=>this.opts.hoverFacts?.(e)??null})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new ki({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>Eo(this.effSelection),labelFont:()=>this.labelFont(),stageScale:()=>this.stage.scaleX(),worldToScreen:e=>this.worldToScreen(e),activate:e=>this.activateBeacon(e)})),this.beaconsCache}activateBeacon(e){let i=e.kind==="section"?e.id:this.seatSection.get(e.seatId)?.logicalId??null;if(i&&this.focusOwnedSeatsIn(i)){this.focusSeat(e.seatId,{move:!1,transient:!0});return}if(i){let o=this.sectionTapAnchor(i,this.renderedSeatPoint(this.seatById.get(e.seatId)??{x:0,y:0}));this.opts.onSectionTap?this.opts.onSectionTap(i,o):this.focusSection(i,{anchor:o})}this.focusSeat(e.seatId,{move:!i,transient:!0})}focusedFrameScaleForBounds(){if(this.readingFocusedFrame||!this.focusedSectionId)return 0;this.readingFocusedFrame=!0;try{return this.sectionBounds(this.focusedSectionId)?this.sectionFrameScale(this.focusedSectionId):0}finally{this.readingFocusedFrame=!1}}focusOwnedSeatsIn(e){let i=this.getSelection().map(o=>o.id).filter(o=>{let n=this.seatSection.get(o);return!!n&&(n.logicalId===e||n.id===e)});return i.length>0&&this.focusSeats(i)}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(Js({rung:this.getRung(),sections:this.sections,zones:this.zones,ownedSeatIds:i=>this.ownedSeatIds(i),sectionName:i=>i.nameLabel.text()||i.logicalId,sectionAnchor:i=>this.ownedAnchor(i),sectionCentre:i=>i.centroid})),this.breath.syncBeacons(e.breathingRings())}ownedSeatIds(e){return e.memberIds.filter(i=>this.selection.has(i)||this.ownedHold.has(i))}ownedAnchor(e){let i=this.ownedSeatIds(e).map(r=>this.seatById.get(r)).filter(r=>r!=null).map(r=>this.renderedSeatPoint(r));if(!i.length)return{x:e.nameLabel.x(),y:e.nameLabel.y()};let o=0,n=0;for(let r of i)o+=r.x,n+=r.y;return{x:o/i.length,y:n/i.length}}get owned(){return this.ownedCache||(this.ownedCache=new Li({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>this.ownedAnchor(e),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,i){return this.owned.anchorFor(e)??i}ownedSeatPoints(e){let i=[];for(let o of e.memberIds){if(!this.selection.has(o)&&!this.ownedHold.has(o))continue;let n=this.seatById.get(o);n&&i.push(this.renderedSeatPoint(n))}return i}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),dismissFocusRing:()=>this.dismissFocusRing(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),constrainPan:(e,i)=>this.constrainPan(e,i),marqueeActive:()=>this.marquee.active(),marqueeShouldStart:e=>Bl(e,{manageMode:this.opts.manageMode===!0,atSeatRung:this.getRung()==="seats",marqueeSelect:this.opts.marqueeSelect===!0,hitSeatAt:i=>this.sectionAt(i)!==null||this.nearestSeatToScreen(i,fe,!0)!==null}),beginMarquee:e=>this.marquee.begin(e,this.opts.marqueeShape==="lasso"?"lasso":"box"),updateMarquee:e=>this.marquee.update(e),finishMarquee:()=>this.marquee.finish(),cancelMarquee:()=>this.marquee.cancel(),touchProbeStart:e=>this.showTouchLoupe(e),touchProbeMove:e=>this.showTouchLoupe(e),touchProbeEnd:()=>this.hideTouchLoupe()}}setChart(e,i){this.rowBandPreview?.clear(),this.rowBandPreview=e.theme?.sectionDetail==="rows"?new Nt:null,this.rowBandZoomAnchor=null;let o=e===this.chartDoc;if(o||(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??qt(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let a of e.floors)for(let l of a.objects)this.objectFloor.set(l.id,a.id),l.type==="section"&&l.logicalSectionId&&this.objectFloor.set(l.logicalSectionId,a.id);let n=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.seatLabelPool.clear(),this.rowLabelGroup=new zt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup.destroyChildren(),this.circleById.clear(),this.glyphMarkers=[],this.boothDims.clear(),this.boothLabelById.clear(),this.seatLabelById.clear(),this.accessRingById.clear(),this.accessGlyphById.clear(),this.freeTextById.clear(),this.iconNodeById.clear(),this.focusMembership.clear(),this.focusMembershipKey=null,this.unsectionedSeatIds=null,this.primaryFocalLabels.clear(),this.gaById.clear();for(let a of this.selectionMarkers.values())a.destroy();this.selectionMarkers.clear(),this.beaconsCache?.clear(),this.breathCache?.syncBeacons([]),this.breathCache?.sync(this.selectionMarkers),o||this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.selectionFocusKeep=null,o||this.statusById.clear(),this.accessFreeBySection.clear(),this.seatAnchorContextCache=null,o||(this.selection.clear(),this.selectedSeatById.clear()),this.seatById.clear(),this.seatIndex=null,this.cached=!1,o||(this.accessFilter=null,this.categoryFilter=null,this.categoryHighlight=null,this.seatHighlight=null,this.commercialLimitedFilter=!1),this.sections=[],this.zones=[],this.landmarkBoxes=[],this.seatSection.clear(),this.focusedSectionId=null,this.focusBackdrop=null,this.catPrice.clear(),this.zoneColor.clear(),this.lodScale=0,this.hasBoothText=!1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.isoT=0,this.isoTarget=0,this.viewMode="flat",this.perspectiveCamera=null,this.perspectiveBaseAffine=null,this.perspectiveBaseInverse=null,this.perspectiveSeatLocal.clear(),this.perspectiveSeatProjected.clear(),this.perspectiveSeatDepth.clear(),this.perspectiveSeatScale.clear(),this.perspectiveAppliedSeats.clear(),this.perspectiveBounds=null,this.resetLayerTransforms(),this.hasSections=n.objects.some(a=>a.type==="section");for(let a of e.zones??[])a.color&&this.zoneColor.set(a.id,a.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=li(this.theme.seatScale)*te,this.container.style.background="",this.canvasBackground=this.resolveCanvasBackground(),this.container.style.background=this.canvasBackground,this.effSelection=this.resolveSelectionColor(),this.hoverRing.stroke(this.effSelection),this.hoverRing.radius(this.seatR+2),this.catColor.clear(),this.catByKey.clear(),this.catPrice.clear(),this.catOrder=e.categories.map(a=>a.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((a,l)=>{this.cbHueByKey.set(a,bi[l%bi.length])});for(let a of e.categories){this.catColor.set(a.key,a.color),this.catByKey.set(a.key,a);let l=this.categoryPriceRanges===null?void 0:this.categoryPriceRanges?.[a.key]?.min??a.price;typeof l=="number"&&this.catPrice.set(a.key,l)}this.tableFootprints=ql(n.objects);for(let a of n.objects)a.type==="booth"&&this.boothDims.set(a.id,{width:a.width,height:a.height,rotation:a.rotation,...a.points&&a.points.length>=3?{points:a.points.map(l=>({x:l.x,y:l.y}))}:{}});if(this.seats=He(n,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!o){let a=n===e?this.seats:He(e);this.canonicalSeatIds=new Set(a.map(l=>l.id))}for(let a of this.seats)this.seatById.set(a.id,a),this.statusById.has(a.id)||this.statusById.set(a.id,"free");this.seatIndex=ar(this.seats,{seatRadius:this.seatR}),this.seatPitch=Ba(this.seats),this.markerR=Oa(this.seatR,this.seatPitch),this.sellableUnit=Ga(this.seats,{markerRadius:this.markerR,blockDims:this.boothDims}),this.clusterLabels.rebuild(),this.bounds=Nn(n,{freeText:"exclude"}),this.isoCentre={x:this.bounds.x+this.bounds.width/2,y:this.bounds.y+this.bounds.height/2},this.buildPerspectiveProjection(n),this.renderBackground(n),this.unsectionedSeatGroup=new zt({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.loadingReveal==="viewport"&&!this.exportMode&&this.viewMode==="flat"&&this.sections.length>1;r&&this.startViewportSeats();let s=this.seatRevealWanted();this.seatRevealPending=s,this.revealWorldRect=s||r?Bc(this.seats,{seatR:this.seatR,boothDims:this.boothDims}):null,!s&&!r&&this.renderSeats(),this.buildRowLabelPlan(n),this.overlayLayer.add(this.labelGroup),this.overlayLayer.add(this.fgDecorGroup),this.overlayLayer.add(this.hoverRing),this.overlayLayer.add(this.focusRing),this.mountCachePending=!s&&!r,this.zoomToFit(),s&&this.startSeatReveal()}seatRevealWanted(){return this.loadingReveal==="progressive"&&!this.exportMode&&this.sections.length>1&&this.seats.length>=this.progressiveSeatFloor}startSeatReveal(){this.cancelSeatReveal();let e=Oc({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=_c({chunks:e,build:i=>this.renderSeats(i.seats),fade:(i,o)=>i.group.opacity(o),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.afterViewChange(),this.fitPose&&qe(this.stage)===this.fitPose&&this.zoomToFit(),this.seatLayer.batchDraw(),this.onSeatsRevealed?.()}})}viewportCentreInChartSpace(){let e=this.stage.scaleX()||1;return{x:(this.stage.width()/2-this.stage.x())/e,y:(this.stage.height()/2-this.stage.y())/e}}cancelSeatReveal(e=!1){if(this.viewportSeats){let o=this.viewportSeats;this.viewportSeats=null,e?o.finish():o.cancel()}let i=this.seatReveal;this.seatRevealPending=!1,i&&(this.seatReveal=null,e?i.finishNow():i.cancel(),this.seats.length&&!this.destroyed&&this.updateLabels())}floorView(e){if(!e.floors?.length)return{...e,referenceImage:void 0,backgroundImage:wt(e)};if(this.floorOverview&&e.floors.length>=2)return e.floorOverview==="combined"?zn(e):Vn(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...Dn(e),referenceImage:void 0,backgroundImage:wt(e)};let i=e.floors.find(o=>o.id===this.activeFloorId)??e.floors[0];return{...e,objects:i.objects,focalPoint:i.focalPoint,referenceImage:void 0,backgroundImage:wt(i),floors:void 0}}floorBaseHeightMFor(e){let i=this.chartDoc?.floors;if(!i?.length)return 0;let o=this.stacked&&e?this.objectFloor.get(e)??this.activeFloorId:this.activeFloorId;return i.find(n=>n.id===o)?.baseHeightM??0}setStacked(e){!this.chartDoc||e===this.stacked||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.stacked=e,e&&(this.floorOverview=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isStacked(){return this.stacked}setFloorOverview(e){!this.chartDoc||e===this.floorOverview||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.floorOverview=e,e&&(this.stacked=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isFloorOverview(){return this.floorOverview}get separatedFloorOverview(){return this.floorOverview&&this.chartDoc?.floorOverview!=="combined"}setFloorLabelStyle(e){e===this.floorLabelStyle||!this.chartDoc||(this.floorLabelStyle=e,this.floorOverview&&this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}getFloorLabelStyle(){return this.floorLabelStyle}setActiveFloor(e){!this.chartDoc||e===this.activeFloorId&&!this.floorOverview&&!this.stacked||(this.floorOverview=!1,this.stacked=!1,this.setChart(this.chartDoc,{floorId:e}))}getFloors(){return this.chartDoc?qt(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let o=!1,n=this.hasSections?new Set:null;for(let r of e){if(!this.canonicalSeatIds.has(r))continue;let s=this.statusById.get(r);if(s===i)continue;this.statusById.set(r,i);let a=this.circleById.get(r);if(a&&(this.paintSeat(a,r),o=!0),n){let l=this.seatSection.get(r);l&&(this.accessFreeBySection.delete(l.id),s==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),n.add(l))}}if(n&&n.size){for(let r of n)this.refreshSectionFill(r);this.bgLayer.batchDraw()}o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>oe&&this.updateLabels())}setSeatCategories(e){let i=!1,o=!1,n=new Set;for(let[s,a]of Object.entries(e)){let l=this.seatById.get(s);if(!l||!this.catColor.has(a)||l.categoryKey===a)continue;l.categoryKey=a,i=!0;let c=this.circleById.get(s);c&&(this.paintSeat(c,s),o=!0);let d=this.seatSection.get(s);d&&n.add(d)}if(!i)return;let r=new Map((this.chartDoc?qt(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of n){if(!r.get(s.id)?.color){let l=new Map;for(let c of s.memberIds){let d=this.seatById.get(c)?.categoryKey;d&&l.set(d,(l.get(d)??0)+1)}s.baseFill=jt([...l].map(([c,d])=>({hex:this.catColor.get(c)??"#6e7bff",w:d})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}n.size&&this.bgLayer.batchDraw(),o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>oe&&this.updateLabels())}setOwnedHold(e){let i=new Set((e??[]).filter(n=>this.statusById.has(n))),o=new Set([...this.ownedHold,...i]);this.ownedHold=i;for(let n of o){let r=this.circleById.get(n);r&&this.paintSeat(r,n),this.syncSelectionMarker(n)}o.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>oe&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;let o=this.selectionFocusId;this.selectionFocusId=i,this.selectionFocusKeep=Ml({focusedId:i,seats:this.seats,seatId:s=>s.id,seatPoint:s=>this.renderedSeatPoint(s),sectionOf:s=>this.seatSection.get(s)?.logicalId??null,seatPitch:this.seatPitch,seatRadius:this.seatR});let r=o!=null&&i!=null&&Rl(o,i,s=>this.seatSection.get(s)?.logicalId??null)?[o,i]:this.seats.map(s=>s.id);for(let s of r){let a=this.circleById.get(s);a&&this.paintSeat(a,s)}o&&this.syncSelectionMarker(o),i&&this.syncSelectionMarker(i);for(let[s,a]of this.selectionMarkers)a.opacity(this.selectionFocusDims(s)?.2:1);this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.updateLabels(),this.overlayLayer.batchDraw()}setSeatMarks(e){let i=this.seatMarks.merge(e,this.statusById);for(let o of i){let n=this.circleById.get(o);n&&this.paintSeat(n,o)}i.size&&(this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}getSeatMark(e){return this.seatMarks.get(e)}getStatus(e){return this.statusById.get(e)??"free"}getSelection(){let e=[];for(let i of this.selection){let o=this.seatById.get(i)??this.selectedSeatById.get(i);o&&e.push(o)}return e}clearSelection(){let e=[...this.selection];for(let i of e)this.setSelected(i,!1,!0);this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let i=[];for(let o of e){if(this.selection.has(o)||!this.isSelectable(o))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(o,!0,!0);let n=this.seatById.get(o);n&&i.push(n)}return i.length&&this.overlayLayer.batchDraw(),i}setManageInteraction(e){this.marquee.cancel(),this.gestures.resetPan();let i=e.organizerStatus!==!1,o=i!==this.organizerStatus;this.organizerStatus=i,this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.marqueeShape=e.marqueeShape??"box",this.opts.rowLabelSelect=e.rowLabelSelect===!0,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let n=[...this.selection].filter(r=>!this.isSelectable(r));n.length&&this.deselect(n),!e.manageMode&&this.selection.size&&this.clearSelection(),this.clusterLabels.syncCursor(!1),o&&this.repaintSectionsAndSeats(),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[i,o]of Object.entries(e??{}))Number.isFinite(o)&&this.sectionHeat.set(i,Math.max(0,Math.min(1,o)));for(let i of this.sections)this.refreshSectionHeat(i);this.bgLayer.batchDraw()}deselect(e){let i=!1;for(let o of e)this.selection.has(o)&&(this.setSelected(o,!1,!0),i=!0);i&&(this.overlayLayer.batchDraw(),this.effScale()>oe&&this.updateLabels())}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let i of this.seats)this.isSelectable(i.id)&&e.push(i.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let i=new Set(e),o=[];for(let n of this.seats)i.has(n.label)&&this.isSelectable(n.id)&&o.push(n.id);return this.selectMany(o)}setEvidenceSelection(e){return!this.seatById.has(e)||!this.isSelectable(e)?!1:(this.selection.size&&this.clearSelection(),this.setSelected(e,!0),this.overlayLayer.batchDraw(),this.selection.has(e))}getSelectableInSection(e){let i=[],o=new Set;for(let n of this.sections)if(!(n.id!==e&&n.logicalId!==e&&n.zone!==e))for(let r of n.memberIds){if(o.has(r)||(o.add(r),!this.isSelectable(r)))continue;let s=this.seatById.get(r);s&&i.push(s)}return i}selectMany(e){let i=e.filter(n=>!this.selection.has(n));if(!i.length)return this.getSelection();let o=this.selection.size+i.length<=Ar;for(let n of i)if(o)this.setSelected(n,!0,!0);else{this.selection.add(n);let r=this.circleById.get(n);r&&this.paintSeat(r,n)}return this.queueViewportPinSync(),this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}rowLabelAtScreen(e){if(!this.opts.manageMode||!this.opts.rowLabelSelect)return null;let i=[],o=this.rowLabelGroup.find(n=>n.getAttr("rowLabel")===!0);for(let n of o){let r=n.getAttr("rowKey");!r||!n.isVisible()||i.push({rowKey:r,box:n.getClientRect({skipShadow:!0,skipStroke:!0})})}return bc(e,i)}selectRow(e){let i=gc(e,this.seats,o=>this.isSelectable(o));return i.length&&(this.selectMany(i),this.opts.onMarquee?.(this.getSelection())),this.getSelection()}flashSeat(e,i="#f43f5e"){let o=this.seatById.get(e);o&&gl(this.flashHost,e,this.renderedSeatPoint(o),i)}flashSection(e,i="#22a06b"){bl(this.flashHost,this.sections.filter(o=>o.id===e||o.zone===e),i)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,i)=>this.projectedSectionPoint(e,i),isoLiftLocal:e=>this.isoLiftLocal(e)}}nearestSeat(e,i){let o=this.seatById.get(e);if(!o)return null;let n=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(o.id)??o:o,r=null,s=1/0;for(let a of this.seats){if(a.id===e)continue;let l=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(a.id)??a:a,c=l.x-n.x,d=l.y-n.y,h=c*i.x+d*i.y;if(h<=.5)continue;let u=Math.abs(c*i.y-d*i.x),m=h+u*2.5;m<s&&(s=m,r=a.id)}return r}focusSeat(e,i){let o=this.seatById.get(e);if(!o)return;this.focusedId=e,this.queueViewportPinSync(),this.focusRing.radius(this.seatR+3),this.focusRing.position(this.renderedSeatPoint(o));let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;this.focusRing.scale({x:n,y:n}),this.focusRing.visible(!0),this.clearFocusRingLinger(),i?.transient&&(this.focusRingLinger=setTimeout(()=>{this.focusRingLinger=null,this.dismissFocusRing()},rm)),i?.move!==!1&&this.ensureVisible(o),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(o)}clearFocusRingLinger(){this.focusRingLinger&&clearTimeout(this.focusRingLinger),this.focusRingLinger=null}dismissFocusRing(){this.clearFocusRingLinger(),this.focusRing.visible()&&(this.focusRing.visible(!1),this.queueViewportPinSync(),this.overlayLayer.batchDraw())}ensureVisible(e){let i=this.stage.width(),o=this.stage.height(),n=Math.max(this.stage.scaleX(),Se*1.2),r=this.worldToScreen(e),s=70,a=r.x<s||r.x>i-s||r.y<s||r.y>o-s;if(this.stage.scaleX()<n||a){let l=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?pe(this.perspectiveBaseAffine,l):this.isoT===0?l:this.isoForward(l);this.stage.scale({x:n,y:n}),this.stage.position({x:i/2-c.x*n,y:o/2-c.y*n}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=Kl(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}setFitClearance(e,i=0){let o={bottom:Math.max(0,e||0),width:Math.max(0,i||0)};o.bottom===this.fitClearance.bottom&&o.width===this.fitClearance.width||(this.fitClearance=o,this.fitPose&&qe(this.stage)===this.fitPose&&this.zoomToFit())}framingViewport(){return Xl(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){let o=this.viewMode==="perspective"?this.perspectiveBounds:null;return zl(e,this.stage.scaleX(),o??this.bounds,this.framingViewport(),i)}framingWorldRect(){return $l(this.framingViewport(),e=>this.screenToWorld(e))}overview(){this.clearSectionFocus(),this.zoomToFit()}zoomToFit(){Dl(this.cameraHost)}isSeatRevealPending(){return this.seatRevealPending||this.seatReveal!==null||!!this.viewportSeats?.pending}get cameraHost(){return this.cameraHostCache??={stage:this.stage,bgLayer:this.bgLayer,seatLayer:this.seatLayer,exportMode:()=>this.exportMode,destroyed:()=>this.destroyed,reducedMotion:()=>this.reducedMotion,cameraGlideMs:()=>this.cameraGlideMs,portraitFitCrop:()=>this.opts.portraitFitCrop,openAtSectionsWhenDense:()=>this.opts.openAtSectionsWhenDense===!0,hasSections:()=>this.hasSections,fitClearanceBottom:()=>this.fitClearance.bottom,fitClearanceWidth:()=>this.fitClearance.width,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),viewMode:()=>this.viewMode,zones:()=>this.zones,markerR:()=>this.markerR,unitZoomCeiling:()=>Math.max(Va(this.sellableUnit),this.hasSections?we:0),bounds:()=>this.bounds,perspectiveBounds:()=>this.perspectiveBounds,fitScale:()=>this.fitScale,setFitScale:e=>{this.fitScale=e},setFitPose:e=>{this.fitPose=e},revealWorldRect:()=>this.viewportSeats||this.isSeatRevealPending()?this.revealWorldRect:null,glideRaf:()=>this.glideRaf,setGlideRaf:e=>{this.glideRaf=e},setGlideInProgress:e=>{this.glideInProgress=e},zoomSettleRaf:()=>this.zoomSettleRaf,setZoomSettleRaf:e=>{this.zoomSettleRaf=e},framingViewport:()=>this.framingViewport(),constrainPan:(e,i)=>this.constrainPan(e,i),sectionBounds:e=>this.sectionBounds(e),effScale:()=>this.effScale(),settleView:()=>this.settleView(),afterViewChange:()=>this.afterViewChange(),scheduleViewChange:()=>this.scheduleViewChange(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),updateLOD:()=>this.updateLOD(),cancelGlide:()=>this.cancelGlide()}}refitCurrentView(e=!1){if(e){this.settleView();return}if(this.focusedSectionId&&this.sectionBounds(this.focusedSectionId)){this.focusSectionCamera(this.focusedSectionId,!1,this.focusAnchor);return}if(this.categoryFilter?.size){this.focusCategories([...this.categoryFilter],{animate:!1});return}this.zoomToFit()}getCameraPose(){return Yl(this.stage)}setCameraPose(e){this.cancelGlide(),Ul(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()*Kt.ZOOM_STEP,Dt(this.framingViewport()))}zoomOut(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()/Kt.ZOOM_STEP,Dt(this.framingViewport()))}zoomOutLevel(){this.dismissFocusRing();let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e,{maxScale:this.diveCeiling(),focusPaddingPx:this.focusedRowLabelGutter(e)}),"section"):"venue":this.getRung()==="seats"&&(this.setRung("sections"),this.getRung()!=="seats")?"sections":(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let i of this.gaById.values())e+=i.capacity;return e}worldToScreen(e){let i=this.stage.scaleX(),o=e.id,n=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let a=n?this.perspectiveSeatProjected.get(n.id)??pe(this.perspectiveBaseAffine,e):pe(this.perspectiveBaseAffine,e);return{x:a.x*i+this.stage.x(),y:a.y*i+this.stage.y()}}let r=n?this.renderedSeatPoint(n):e,s=this.isoT===0?r:this.isoForward(r);return{x:s.x*i+this.stage.x(),y:s.y*i+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let i=e===null?null:[...e];if(!this.sameAccessFilter(i)){this.accessFilter=i,this.accessFreeBySection.clear();for(let o of this.sections)this.refreshSectionFill(o);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale()),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let i=this.accessFilter;return i===null||e===null?i===e:i.length===e.length&&i.every((o,n)=>o===e[n])}setCommercialLimitedFilter(e){this.commercialLimitedFilter!==e&&(this.commercialLimitedFilter=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setCategoryFilter(e){let i=e===null?null:new Set(e);$a(i,this.categoryFilter)||(this.categoryFilter=i,this.lodScale=0,this.updateLOD(),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}applyGAFilterState(){this.clusterLabels.applyFilterDim(),this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){hc({gaById:this.gaById,bgLayer:this.bgLayer,exportMode:this.exportMode,pickerMode:!!this.opts.gaPickerMode,selectionColor:this.effSelection,labelFont:()=>this.labelFont(),filteredOut:e=>!!(this.categoryFilter&&!this.categoryFilter.has(e)),dimmed:e=>dc(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<Z,effScale:()=>this.effScale(),labelLegible:e=>ye(e,this.effScale())})}setGAStates(e){uc(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,i){this.setGAStates({[e]:i})}get focusFramingContext(){return{stage:this.stage,seats:this.seats,sections:this.sections,hasSections:this.hasSections,seatById:this.seatById,seatSection:this.seatSection,statusById:this.statusById,ownedHold:this.ownedHold,accessFilter:this.accessFilter,accessFreeBySection:this.accessFreeBySection,clusterLabels:this.clusterLabels,seatR:this.seatR,markerR:this.markerR,sellableUnit:this.sellableUnit,seatPitch:this.seatPitch,cameraGlideMs:this.cameraGlideMs,seatInClosedSection:e=>this.seatInClosedSection(e),isSectionClosed:e=>this.isSectionClosed(e),renderedSeatPoint:e=>this.renderedSeatPoint(e),sectionMembers:e=>this.sectionMembers(e),sectionBounds:e=>this.sectionBounds(e),focusedRowLabelGutter:e=>this.focusedRowLabelGutter(e),seatLabelTargetScale:()=>this.seatLabelTargetScale(),zoomBounds:()=>this.zoomBounds(),rowBandDetailScale:()=>this.rowBandPreview?.active&&this.viewMode==="flat"?this.rowBandPreview.detailScale:0,framingViewport:()=>this.framingViewport(),worldToScreen:e=>this.worldToScreen(e),getWorldBounds:()=>this.getWorldBounds(),narrowSeatDetailFocus:(e,i,o,n)=>this.narrowSeatDetailFocus(e,i,o,n),focusSection:(e,i)=>this.focusSection(e,i),markSectionFocus:(e,i)=>this.markSectionFocus(e,i),clearSectionFocus:()=>this.clearSectionFocus(),focusRegion:(e,i)=>this.focusRegion(e,i)}}focusCategories(e,i){Qc(this.focusFramingContext,e,i)}diveCeiling(){return gt(this.focusFramingContext)}focusAccessibleSeats(e){return Jc(this.focusFramingContext,e)}focusAccessibleSection(e,i){return td(this.focusFramingContext,e,i)}accessibleSpread(e){return id(this.focusFramingContext,e)}setViewMode(e){if(e!=="flat"&&this.viewportSeats&&this.cancelSeatReveal(!0),e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let a=this.viewMode==="isometric"&&this.isoT>0;this.viewMode=e,this.isoTarget=1,this.isoT=1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.applyPerspective(a),this.zoomToFit();return}let i=e==="isometric"?1:0,o=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=i,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),o){this.isoT=i,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=i,this.applyIso(),this.afterViewChange();return}let n=this.isoT;if(n===i){this.applyIso(),this.afterViewChange();return}let r=performance.now(),s=a=>{if(this.destroyed)return;let l=Math.min(1,(a-r)/Er),c=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2;this.isoT=n+(this.isoTarget-n)*c,this.applyIso(),this.scheduleViewChange(),l<1?this.isoRaf=requestAnimationFrame(s):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(s)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),i=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,i)}return this.stage.scaleX()*(1-(1-Tt)*this.isoT)}isoForward(e){return Dc(e,this.isoState)}isoInverse(e){return Nc(e,this.isoState)}buildPerspectiveProjection(e){let i=Vc({seats:this.seats,objects:e.objects,bounds:this.bounds,seatR:this.seatR,floorBaseHeightMFor:o=>this.floorBaseHeightMFor(o)},{seatLocal:this.perspectiveSeatLocal,seatProjected:this.perspectiveSeatProjected,seatDepth:this.perspectiveSeatDepth,seatScale:this.perspectiveSeatScale});this.perspectiveCamera=i.camera,this.perspectiveBaseAffine=i.baseAffine,this.perspectiveBaseInverse=i.baseInverse,this.perspectiveBounds=i.bounds}projectedSectionPoint(e,i){return Wc(e,i,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return et(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return Hc(e,this.isoState)}get projectionHost(){return this.projectionHostCache??={bgLayer:this.bgLayer,seatLayer:this.seatLayer,overlayLayer:this.overlayLayer,labelLiftGroups:this.labelLiftGroups,perspectiveAppliedSeats:this.perspectiveAppliedSeats,seats:()=>this.seats,sections:()=>this.sections,unsectionedSeatGroup:()=>this.unsectionedSeatGroup,cached:()=>this.cached,setCached:e=>{this.cached=e},isoT:()=>this.isoT,isoState:()=>this.isoState,isoCentre:()=>this.isoCentre,perspectiveCamera:()=>this.perspectiveCamera,perspectiveBaseAffine:()=>this.perspectiveBaseAffine,perspectiveBaseInverse:()=>this.perspectiveBaseInverse,applyExactSeatAnchors:(e,i)=>this.applyExactSeatAnchors(e,i),applyUprightLabels:()=>this.applyUprightLabels(),applyElevation:()=>this.applyElevation(),syncSeatOverlayPositions:()=>this.syncSeatOverlayPositions(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility()}}resetLayerTransforms(e=!0){Gi(this.projectionHost,e)}get seatAnchorContext(){return this.seatAnchorContextCache??={seats:this.seats,seatById:this.seatById,seatR:this.seatR,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,perspectiveAppliedSeats:this.perspectiveAppliedSeats,circleById:this.circleById,accessRingById:this.accessRingById,accessGlyphById:this.accessGlyphById,boothLabelById:this.boothLabelById}}applyExactSeatAnchors(e,i){zc(this.seatAnchorContext,e,i)}applyPerspective(e=!0){Xc(this.projectionHost,e)}applyIso(){Yc(this.projectionHost)}applyUprightLabels(){let e=hi*this.isoT,i=1/(1-(1-Tt)*this.isoT),o=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let n of o){let r=n.find("Text");for(let s of r){let a=s.getAttr("uprightBase");a==null&&(a=s.rotation(),s.setAttr("uprightBase",a)),s.rotation(a-e),s.scaleX(1),s.scaleY(i),s.skewX(0)}}}applyElevation(){let e=this.isoT;for(let i of this.sections){if(i.liftWorld<=0)continue;let o=this.isoLiftLocal(i.liftWorld);i.liftGroupBg?.position(o),i.liftGroupSeat.position(o),this.labelLiftGroups.get(i.id)?.position(o);let n=.9*e;for(let r=0;r<i.sideFaces.length;r++){let s=i.sideFaces[r],a=i.outline[r],l=i.outline[(r+1)%i.outline.length];s.points([a.x,a.y,l.x,l.y,l.x+o.x,l.y+o.y,a.x+o.x,a.y+o.y]),s.opacity(n)}}this.syncSeatOverlayPositions()}destroy(){this.movingLabelTimer&&(clearTimeout(this.movingLabelTimer),this.movingLabelTimer=null),this.rowBandPreview?.clear(),this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.rafId&&cancelAnimationFrame(this.rafId),this.isoRaf&&cancelAnimationFrame(this.isoRaf),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.zoomSettleRaf&&cancelAnimationFrame(this.zoomSettleRaf),this.breathCache?.destroy(),this.momentsCache?.destroy(),this.beaconsCache?.clear(),this.hoverCardCache?.destroy(),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),this.clusterLabels.destroy(),this.container.removeEventListener("keydown",this.onKeyDown),this.stage.destroy()}labelFont(){return this.exportMode?this.theme.fontFamily?.toLowerCase().includes("jetbrains")?"JetBrains Mono, monospace":"Inter, sans-serif":this.theme.fontFamily||"Inter, sans-serif"}seatContainer(e){return this.seatSection.get(e)?.liftGroupSeat??this.unsectionedSeatGroup??this.seatLayer}sectionMatchesFocus(e){let i=this.focusedSectionId;return i==null||e.id===i||e.logicalId===i||e.zone===i}selectionFocusDims(e){return this.selectionFocusId?!(this.selectionFocusKeep?.has(e)??e===this.selectionFocusId):!1}focusedSeatOpacity(e,i){if(!this.focusedSectionId||!this.focusDimOverlay)return i;let o=this.seatSection.get(e);return i*(o&&this.sectionMatchesFocus(o)?1:Pe)}sectionScreenBounds(e){return ya({viewMode:this.viewMode,isoT:this.isoT,stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y(),projectedSectionPoint:(i,o)=>this.projectedSectionPoint(i,o),isoLiftLocal:i=>this.isoLiftLocal(i),isoForward:i=>this.isoForward(i)},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=Z,i=[],o=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,n=96,r=this.stage.width(),s=this.stage.height();for(let a of this.sections){let l=!0;if(e){let d=this.sectionScreenBounds(a);l=d.x+d.width>=-n&&d.y+d.height>=-n&&d.x<=r+n&&d.y<=s+n,l&&this.viewMode==="perspective"&&!o&&this.applyExactSeatAnchors(!0,a.memberIds)}this.viewportSeats&&l&&(e||a.id===this.focusedSectionId||a.logicalId===this.focusedSectionId)&&i.push(a.id),a.liftGroupSeat.setViewportCulled(!l),this.labelLiftGroups.get(a.id)?.setViewportCulled(!l)}this.viewportSeats&&this.viewportSeats.sync(this.viewportWanted=[...i,"__loose"],this.viewportPins()),this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!o&&(this.unsectionedSeatIds||(this.unsectionedSeatIds=this.seats.filter(a=>!this.seatSection.has(a.id)).map(a=>a.id)),this.applyExactSeatAnchors(!0,this.unsectionedSeatIds))}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(let o of i.memberIds){let n=this.seatById.get(o);n&&e.push(n)}this.unsectionedSeatIds??=this.seats.filter(i=>!this.seatSection.has(i.id)).map(i=>i.id);for(let i of this.unsectionedSeatIds){let o=this.seatById.get(i);o&&e.push(o)}return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}renderedSeatPoint(e){if(this.viewMode==="perspective")return this.perspectiveSeatLocal.get(e.id)??e;let i=this.seatSection.get(e.id);if(!i||i.liftWorld<=0||this.isoT===0)return e;let o=this.isoLiftLocal(i.liftWorld);return{x:e.x+o.x,y:e.y+o.y}}seatLabelContainer(e){let i=this.seatSection.get(e);if(!i)return this.labelGroup;let o=this.labelLiftGroups.get(i.id);return o||(o=new mt({listening:!1}),o.setViewportCulled(i.liftGroupSeat.isViewportCulled()),o.position(this.viewMode==="perspective"?{x:0,y:0}:this.isoLiftLocal(i.liftWorld)),this.labelGroup.add(o),this.labelLiftGroups.set(i.id,o)),o}syncSeatOverlayPositions(){if(this.hoveredId){let e=this.seatById.get(this.hoveredId);if(e){this.hoverRing.position(this.renderedSeatPoint(e));let i=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.hoverRing.scale({x:i,y:i})}}if(this.focusedId){let e=this.seatById.get(this.focusedId);if(e){this.focusRing.position(this.renderedSeatPoint(e));let i=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.focusRing.scale({x:i,y:i})}}for(let[e,i]of this.selectionMarkers){let o=this.seatById.get(e);if(o){i.position(this.renderedSeatPoint(o));let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(o.id)??1:1;i.scale({x:n,y:n})}}}viewportPins(){return Ia([this.focusRing.visible()?this.focusedId:null,this.hoveredId],this.ownedHold,this.selection)}queueViewportPinSync(){!this.viewportSeats||this.viewportPinSync||(this.viewportPinSync=!0,queueMicrotask(()=>{this.viewportPinSync=!1,this.viewportSeats?.sync(this.viewportWanted,this.viewportPins())}))}startViewportSeats(){let e=new Map;this.viewportWanted=["__loose"];for(let i of this.seats){let o=this.seatSection.get(i.id)?.id??"__loose",n=e.get(o);n||e.set(o,n=[]),n.push(i)}this.viewportSeats=new Pi(e,{build:i=>this.renderSeats(i),remove:i=>{for(let o of i)for(let n of[this.circleById,this.accessGlyphById,this.accessRingById,this.boothLabelById])n.get(o.id)?.destroy(),n.delete(o.id);this.glyphMarkers=this.glyphMarkers.filter(o=>!!o.getParent())},draw:()=>{this.updateLOD(),this.updateLabels(),this.seatLayer.batchDraw()},schedule:i=>requestAnimationFrame(i),cancel:i=>cancelAnimationFrame(i),now:()=>performance.now(),sectionOf:i=>this.seatById.has(i)?this.seatSection.get(i)?.id??"__loose":void 0})}renderSeats(e=this.seats){za({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,colorblind:this.colorblind,canvasBackground:this.canvasBackground,setHasBoothText:()=>{this.hasBoothText=!0},circleById:this.circleById,glyphMarkers:this.glyphMarkers,boothDims:this.boothDims,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,accessRingById:this.accessRingById,catByKey:this.catByKey,perspectiveSeatDepth:this.perspectiveSeatDepth,seatContainer:i=>this.seatContainer(i),buildAccessGlyph:(i,o)=>this.buildAccessGlyph(i,o),paintSeat:(i,o)=>this.paintSeat(i,o),labelFont:()=>this.labelFont()});for(let i of e)this.selection.has(i.id)&&this.syncSelectionMarker(i.id)}buildAccessGlyph(e,i){let o=this.seatR*1.5/Fe,n=new nm({x:e.x,y:e.y,data:ei(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:oi(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return rc(n),n}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[i,o]of this.accessGlyphById){let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(i)??1:1,r=this.seatR*1.5/Fe*n,a=this.accessGlyphFilterEmphasized(i)?Lr:xr,l=Math.max(r,a/(Fe*Math.max(e,.001)));o.scale({x:l,y:l}),o.visible(this.accessGlyphShouldShow(i))}}accessGlyphFilterEmphasized(e){let i=this.seatById.get(e),o=this.accessFilter;return!!i&&o!==null&&!!i.accessibility?.length&&Ie(i,o)}accessGlyphShouldShow(e){return!this.accessGlyphById.has(e)||!this.accessMarkerEligible(e)?!1:!(this.selection.has(e)||this.ownedHold.has(e))}accessRingShouldShow(e){return this.accessRingById.has(e)&&this.accessMarkerEligible(e)}accessMarkerEligible(e){let i=this.statusById.get(e)??"free";return!(i==="booked"||i==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryPriceLabel(e){if(this.categoryPriceRanges===null)return null;let i=this.categoryPriceRanges?.[e];if(i&&i.max>i.min)return`${Ue(i.min,this.currency)}\u2013${Ue(i.max,this.currency)}`;let o=this.catPrice.get(e);return typeof o=="number"?Ue(o,this.currency):null}setCategoryPriceRanges(e){if(JSON.stringify(e)!==JSON.stringify(this.categoryPriceRanges)&&(this.categoryPriceRanges=e==null?e:Object.fromEntries(Object.entries(e).filter(([,i])=>Number.isFinite(i.min)&&Number.isFinite(i.max)&&i.min>=0&&i.max>=i.min).map(([i,o])=>[i,{min:o.min,max:o.max}])),!!this.chartDoc)){if(this.catPrice.clear(),this.categoryPriceRanges!==null)for(let i of this.chartDoc.categories){let o=this.categoryPriceRanges?.[i.key]?.min??i.price;typeof o=="number"&&this.catPrice.set(i.key,o)}this.hoverCardCache?.hide(),this.clusterLabels.rebuild();for(let i of this.zones)i.back.destroy(),i.label.destroy(),i.sub?.destroy();this.zones.length=0,this.renderZones(this.chartDoc),this.updateLOD(),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw()}}categoryDisplayColor(e){return this.categoryColours?this.colorblind?this.cbHueByKey.get(e)??bi[0]:this.catColor.get(e)??"#6e7bff":pa}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??je}seatLabelInk(e,i){let o=i.fill();return ue(typeof o=="string"?o:"",e.labelStyle?.color,this.theme.seatLabelColor??je,Ve)}get seatPaintContext(){return this.seatPaintCache||(this.seatPaintCache={organizer:()=>this.opts.manageMode===!0&&this.organizerStatus,organizerGlyph:this.opts.organizerGlyph,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",isSelected:e=>this.selection.has(e),isOwnedHold:e=>this.ownedHold.has(e),categoryColor:e=>this.categoryDisplayColor(e),boothLabel:e=>this.boothLabelById.get(e),boothExtent:e=>{let i=this.boothDims.get(e);return i?pt(i):void 0},seatLabel:e=>this.seatLabelById.get(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatMarks:this.seatMarks,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,colorblind:()=>this.colorblind,selectionColor:()=>this.effSelection,theme:()=>this.theme,effScale:()=>this.effScale(),seatInClosedSection:e=>this.seatInClosedSection(e),selectionFocusDims:e=>this.selectionFocusDims(e),accessFilter:()=>this.accessFilter,categoryHighlight:()=>this.categoryHighlight,seatHighlight:()=>this.seatHighlight,categoryFilter:()=>this.categoryFilter,commercialLimitedFilter:()=>this.commercialLimitedFilter,dimmedSections:()=>this.dimmedSections,closedSections:()=>this.closedSections,seatSection:e=>this.seatSection.get(e),accessGlyph:e=>this.accessGlyphById.get(e),accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),accessRing:e=>this.accessRingById.get(e),accessRingShouldShow:e=>this.accessRingShouldShow(e)}),this.seatPaintCache}paintSeat(e,i){Al(this.seatPaintContext,e,i),this.rowBandPreview?.repaint()}repaintSeats(){for(let e of this.seats){let i=this.circleById.get(e.id);i&&this.paintSeat(i,e.id)}}seatInClosedSection(e){if(!this.closedSections.size)return!1;let i=this.seatSection.get(e);return!!i&&(this.closedSections.has(i.id)||this.closedSections.has(i.logicalId)||i.zone!=null&&this.closedSections.has(i.zone))}setColorblindSafe(e){if(e!==this.colorblind){this.colorblind=e,this.repaintSeats();for(let i of this.sections)i.shellCategoryColor=this.dominantSellableColor(i.memberIds),this.refreshSectionFill(i);this.bgLayer.batchDraw(),this.updateLabels(),this.clusterLabels.rebuild(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setDimmedSections(e){let i=new Set(e??[]);i.size===this.dimmedSections.size&&[...i].every(o=>this.dimmedSections.has(o))||(this.dimmedSections=i,this.repaintSeats(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setClosedSections(e){let i=new Set(e??[]);i.size===this.closedSections.size&&[...i].every(o=>this.closedSections.has(o))||(this.closedSections=i,this.repaintSectionsAndSeats())}focusSection(e,i){this.markSectionFocus(e,i?.anchor??null)&&this.focusSectionCamera(e,!0,i?.anchor)}markSectionFocus(e,i){return this.sections.some(o=>o.id===e||o.logicalId===e)?(this.focusedSectionId=e,this.focusAnchor=i,this.focusRoams=!1,this.sectionDimEnabled()&&this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),!0):!1}focusSeats(e,i){return cn(this.focusFramingContext,e,i)}focusSectionCamera(e,i=!0,o){if(this.rowBandPreview&&this.viewMode==="flat"&&!this.exportMode){let n=this.sectionBounds(e);if(n){let r=Math.min(this.sectionFrameScale(e),this.zoomBounds().max*.85);this.focusRegion(n,{animate:i,maxScale:r});return}}od(this.focusFramingContext,e,i,o)}releaseSectionFocusDim(){this.cameraGestures+=1,this.focusRoams=!0,this.dropFocusDim()}dropFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}sectionDimEnabled(){return this.sectionFocusDim??this.stage.width()>=j}setSectionFocusDim(e){let i=this.sectionDimEnabled();this.sectionFocusDim=e,i!==e&&(e||this.dropFocusDim())}clearSectionFocus(){this.focusedSectionId&&(this.focusedSectionId=null,this.focusAnchor=null,this.focusRoams=!1,this.focusBackdrop&&(this.focusBackdrop.destroy(),this.focusBackdrop=null),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD())}getFocusedSection(){return this.focusedSectionId}seatsRevealed(){return this.rowBandPreview?.active?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=ae}atVenueFit(){return this.fitPose!==""&&qe(this.stage)===this.fitPose}canZoomIn(){return this.stage.scaleX()<this.zoomBounds().max*(1-1e-6)}seatsPickable(){return this.rowBandPreview?.active||this.viewportSeats&&this.seatLayer.opacity()===0?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=Ii(this.sellableUnit)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let i=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=yl(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=Sl(this.focusBackdropHost,i);for(let o of this.selectionMarkers.values())o.moveToTop();this.beaconsCache?.raise(),this.hoverRing.moveToTop(),this.focusRing.moveToTop()}}get focusBackdropHost(){return{bgLayer:this.bgLayer,overlayLayer:this.overlayLayer,bounds:this.bounds,canvasBackground:this.canvasBackground,viewMode:this.viewMode,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,i)=>this.projectedSectionPoint(e,i),isoLiftLocal:e=>this.isoLiftLocal(e),focusedRowLabelCutouts:()=>{let e=this.focusedSectionId;return e?this.rowLabelGroup.find(i=>i.getAttr("rowLabel")===!0).filter(i=>i.getAttr("focusKeys")?.includes(e)).map(i=>{let o=i.getClientRect({relativeTo:this.overlayLayer,skipShadow:!0,skipStroke:!0}),n=2;return[{x:o.x-n,y:o.y-n},{x:o.x+o.width+n,y:o.y-n},{x:o.x+o.width+n,y:o.y+o.height+n},{x:o.x-n,y:o.y+o.height+n}]}):[]}}}repaintSectionsAndSeats(){this.repaintSeats();for(let e of this.sections)this.refreshSectionFill(e);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){let e=this.screenToWorld({x:0,y:0}),i=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,i.x),y:Math.min(e.y,i.y),width:Math.abs(i.x-e.x),height:Math.abs(i.y-e.y)}}getWorldBounds(){let e=1/0,i=1/0,o=-1/0,n=-1/0,r=(s,a)=>{s<e&&(e=s),a<i&&(i=a),s>o&&(o=s),a>n&&(n=a)};for(let s of this.seats)r(s.x,s.y);for(let s of this.sections)for(let a of s.outline)r(a.x,a.y);for(let s of this.gaById.values())for(let a of s.points)r(a.x,a.y);return Number.isFinite(e)?{x:e,y:i,width:Math.max(1,o-e),height:Math.max(1,n-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(i=>{let o=this.isSectionClosed(i)||i.free<=0,n=i.memberIds.some(a=>this.selection.has(a)),r=n||i.memberIds.some(a=>this.ownedHold.has(a)),s=this.focusedSectionId===i.id||this.focusedSectionId===i.logicalId;return{id:i.logicalId,label:i.label,outline:i.outline.map(a=>({...a})),...this.objectFloor.get(i.id)?{floorId:this.objectFloor.get(i.id)}:{},state:n?"selected":o?"inactive":"available",active:s,paint:{fill:i.shellFill,stroke:i.shellStroke},owned:r,free:i.free,total:i.memberIds.length}});return{sections:e,seats:e.length?[]:this.seats.map(i=>({x:i.x,y:i.y,categoryKey:i.categoryKey,state:this.selection.has(i.id)?"selected":this.statusById.get(i.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let i=this.worldToScreen(e),o={x:this.stage.x(),y:this.stage.y()};this.stage.position(this.constrainPan({x:o.x+this.stage.width()/2-i.x,y:o.y+this.stage.height()/2-i.y},o)),this.afterViewChange(),this.stage.batchDraw()}panScreenBy(e,i){if(Math.abs(e.x)<.5&&Math.abs(e.y)<.5)return;this.cancelGlide();let o=this.stage.x(),n=this.stage.y(),r=this.constrainPan({x:o+e.x,y:n+e.y},{x:o,y:n}),s=r.x-o,a=r.y-n;if(Math.abs(s)<.5&&Math.abs(a)<.5)return;if(i?.animate===!1||this.reducedMotion||typeof requestAnimationFrame!="function"){this.stage.position({x:r.x,y:r.y}),this.afterViewChange(),this.stage.batchDraw();return}let l=performance.now(),c=Math.max(180,Math.min(1200,this.cameraGlideMs));this.glideInProgress=!0;let d=h=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let u=Math.min(1,(h-l)/c),m=u<.5?4*u*u*u:1-Math.pow(-2*u+2,3)/2;if(this.stage.position({x:o+s*m,y:n+a*m}),this.scheduleViewChange(),this.stage.batchDraw(),u<1){this.glideRaf=requestAnimationFrame(d);return}this.glideRaf=0,this.glideInProgress=!1,this.settleView()};this.glideRaf=requestAnimationFrame(d)}getCameraGestureCount(){return this.cameraGestures}setSeatHighlight(e){fa(this.readingAidsHost,e)}setLabelLayers(e){ma(this.readingAidsHost,e)}getLabelLayers(){return{...this.labelLayers}}setCategoryColours(e){ga(this.readingAidsHost,e)}refreshBlockPaint(){this.repaintSectionsAndSeats(),this.updateLOD()}getCategoryColours(){return this.categoryColours}get readingAidsHost(){return{seatHighlight:()=>this.seatHighlight,setSeatHighlightState:e=>{this.seatHighlight=e},labelLayers:()=>this.labelLayers,setLabelLayersState:e=>{this.labelLayers=e},repaintSeats:()=>this.repaintSeats(),updateLabels:()=>this.updateLabels(),draw:()=>{this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()},categoryColours:()=>this.categoryColours,setCategoryColoursState:e=>{this.categoryColours=e},repaintSectionsAndSeats:()=>this.repaintSectionsAndSeats()}}setCategoryHighlight(e){this.categoryHighlight!==e&&(this.categoryHighlight=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}renderBackground(e){let i=wt(e);i&&this.renderBackgroundImage(i);for(let o of e.objects)o.type==="decorImage"&&this.renderDecorImage(o);for(let o of e.objects)o.type==="section"&&this.renderSection(o);for(let o of e.objects)o.type==="shape"?this.renderShape(o):o.type==="gaArea"?this.renderGA(o):o.type==="table"?this.renderTable(o):o.type==="text"&&this.renderText(o);this.renderZones(e)}trackAssetImage(e,i,o,n){this.assets.track(e,i,o,n,{exportMode:this.exportMode})}cancelAssetLoads(){this.assets.cancelAll()}renderBackgroundImage(e){xc(this.objectDrawContext,e)}get objectDrawContext(){return{bgLayer:this.bgLayer,fgDecorGroup:this.fgDecorGroup,container:this.container,opts:this.opts,theme:this.theme,canvasBackground:this.canvasBackground,catColor:this.catColor,sections:this.sections,freeTextById:this.freeTextById,gaById:this.gaById,iconNodeById:this.iconNodeById,primaryFocalLabels:this.primaryFocalLabels,landmarkBoxes:this.landmarkBoxes,labelFont:()=>this.labelFont(),trackAssetImage:(e,i,o,n)=>this.trackAssetImage(e,i,o,n),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){Lc(this.objectDrawContext,e)}renderTable(e){Cc(this.objectDrawContext,e)}renderText(e){Pc(this.objectDrawContext,e)}renderShape(e){Tc(this.objectDrawContext,e)}renderGA(e){Mc(this.objectDrawContext,e)}renderSection(e){let i=Zc(this.sectionBuildContext,e);for(let o of i.memberIds)this.seatSection.set(o,i);this.unsectionedSeatIds=null,this.refreshSectionFill(i),this.refreshSectionHeat(i),this.sections.push(i)}get sectionBuildContext(){return{bgLayer:this.bgLayer,seatLayer:this.seatLayer,canvasBackground:this.canvasBackground,seats:this.seats,seatById:this.seatById,seatSection:this.seatSection,seatIndex:this.seatIndex,statusById:this.statusById,catColor:this.catColor,zoneColor:this.zoneColor,chartDoc:this.chartDoc,isoCentre:this.isoCentre,labelFont:()=>this.labelFont(),floorBaseHeightMFor:e=>this.floorBaseHeightMFor(e),dominantSellableColor:e=>this.dominantSellableColor(e)}}refreshSectionHeat(e){il(this.sectionLodPaintContext,e)}refreshSectionFill(e){nl(this.sectionLodPaintContext,e)}isSectionClosed(e){return Xo(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=ps(e,o=>this.seatById.get(o)?.categoryKey,o=>this.catByKey.get(o)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return dn(this.focusFramingContext,e)}accessibleSections(e){return hn(this.focusFramingContext,e)}get sectionLodPaintContext(){let e=new Set([...this.selection,...this.ownedHold].map(i=>this.seatSection.get(i)));return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:i=>e.has(i),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:i=>this.sectionAccessibleFree(i),blockPaint:this.opts.blockPaint,selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.separatedFloorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,viewMode:this.viewMode,glideInProgress:this.glideInProgress,reducedMotion:this.reducedMotion,isoT:this.isoT,seatCount:this.seats.length,lodScale:this.lodScale,fitScale:this.fitScale,setLodScale:i=>{this.lodScale=i},worldToScreen:i=>this.worldToScreen(i)}}renderZones(e){Ca({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,derivedFloorGroups:this.chartDoc?.floorOverview==="combined"&&!this.chartDoc.zones?.length,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let i=this.stage.scaleX(),o={x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i};return this.viewMode==="perspective"&&this.perspectiveBaseInverse?pe(this.perspectiveBaseInverse,o):this.isoT===0?o:this.isoInverse(o)}sectionAt(e){if(!this.sections.length)return null;let i=this.screenToWorld(e),o=this.sections.find(n=>{if(this.viewMode==="perspective"&&n.perspectiveAffine)return J(i,n.outline.map(s=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,s))),n.holes.map(s=>s.map(a=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,a)))));let r=n.liftWorld>0?this.isoLiftLocal(n.liftWorld):{x:0,y:0};return J({x:i.x-r.x,y:i.y-r.y},n.outline,n.holes)});return o?o.logicalId:null}pressLandsOnChart(e){if(this.sectionAt(e)||_i(this.selectionMarkers,e))return!0;let i=this.screenToWorld(e);for(let o of this.gaById.values())if(J(i,o.points,[]))return!0;return this.owned.badgeAt(i)||this.clusterLabels.clusterAt(i)||Jo(this.tableFootprints,this.seats,i,this.effScale())||this.nearestSeatToScreen(e,fe,!0)?!0:(this.stacked||this.floorOverview)&&this.deckFloorAt()!==null}sectionInteractive(e){let i=this.sections.filter(o=>o.id===e||o.logicalId===e||o.zone===e);return i.length?i.some(o=>!this.isSectionClosed(o)&&o.free>0?!0:o.memberIds.some(n=>this.selection.has(n)||this.ownedHold.has(n))):!0}sectionMembers(e){return[...new Set(this.sections.filter(i=>i.id===e||i.logicalId===e||i.zone===e).flatMap(i=>i.memberIds))]}isSelectable(e){return this.seatInClosedSection(e)||!(this.opts.selectableStatuses??["free"]).includes(this.statusById.get(e)??"free")?!1:!this.hiddenByAccessFilter(e)}hiddenByAccessFilter(e){if(!this.accessFilter||this.selection.has(e))return!1;let i=this.seatById.get(e);return i?Me(i,this.accessFilter)==="other":!1}toggleSeat(e){if(this.ownedHold.has(e)){let i=this.seatById.get(e);i&&this.opts.onDeselect?.(i);return}if(this.selection.has(e)){this.setSelected(e,!1),this.effScale()>oe&&this.updateLabels();let i=this.seatById.get(e);i&&this.opts.onDeselect?.(i)}else{if(!this.isSelectable(e))return;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);return}this.setSelected(e,!0),this.playSeatPickMoment(e);let i=this.seatById.get(e);i&&this.opts.onSelect?.(i)}this.overlayLayer.batchDraw()}resolveCanvasBackground(){let e=this.theme.background?to(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let o=to(getComputedStyle(i).backgroundColor);if(o)return o;i=i.parentElement}}return No}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:V(this.canvasBackground)?Aa:ut}setSelected(e,i,o=!1){let n=this.circleById.get(e);if(i){this.selection.add(e);let r=this.seatById.get(e);r&&this.selectedSeatById.set(e,r)}else this.selection.delete(e),this.selectedSeatById.delete(e),this.selectionFocusId===e&&this.setSelectionFocus(null),this.focusedId===e&&(this.focusedId=null,this.focusRing.visible(!1),this.overlayLayer.batchDraw());n&&(this.paintSeat(n,e),!o&&!this.cached&&this.seatLayer.batchDraw()),this.syncSelectionMarker(e)}syncSelectionMarker(e){this.moments.syncMarker(e,this.selection.has(e)||this.ownedHold.has(e),this.selectionMarkers),this.queueViewportPinSync(),this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){return xa({sections:this.sections,viewMode:this.viewMode,isoT:this.isoT,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,projectedSectionPoint:(i,o)=>this.projectedSectionPoint(i,o),isoLiftLocal:i=>this.isoLiftLocal(i),isoForward:i=>this.isoForward(i),renderedSeatPoint:i=>this.renderedSeatPoint(i),labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(i,o,n)=>this.resolveAutomaticRowLabelPosition(i,o,n),rowLabelBox:(i,o)=>this.rowLabelBox(i,o)},e)}sectionFrameScale(e){let i=this.sectionBounds(e);return i?Math.min(ft(this.stage,i,this.zoomBounds(),Ot(this.framingViewport(),this.focusedRowLabelGutter(e))),_t(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){return nc(this.rowLabelPlan,this.labelFont(),e)}deckFloorAt(){return Xa(this.screenPickingHost)}nearestSeatToScreen(e,i,o=!1){return Ka(this.screenPickingHost,e,i,{includeUnavailable:o})}get screenPickingHost(){return{seats:this.seats,stage:this.stage,seatR:this.seatR,viewMode:this.viewMode,selection:this.selection,objectFloor:this.objectFloor,perspectiveSeatScale:this.perspectiveSeatScale,renderedSeatPoint:e=>this.renderedSeatPoint(e),screenToWorld:e=>this.screenToWorld(e),worldToScreen:e=>this.worldToScreen(e),isSelectable:e=>this.isSelectable(e)}}wireInteraction(){Fl(this.interactionHost)}handleSeatTap(e){_l(this.interactionHost,e)}get interactionHost(){return this.interactionHostCache??={stage:this.stage,seatLayer:this.seatLayer,overlayLayer:this.overlayLayer,hoverRing:this.hoverRing,clusterLabels:this.clusterLabels,container:this.container,attachHoverCard:()=>this.hoverCard.attach(),moved:()=>this.moved,isGhostClick:e=>this.isGhostClick(e),cached:()=>this.cached,reducedMotion:()=>this.reducedMotion,stacked:()=>this.stacked,floorOverview:()=>this.separatedFloorOverview,viewMode:()=>this.viewMode,focusedSectionId:()=>this.focusedSectionId,sectionCount:()=>this.sections.length,selectionMarkers:()=>this.selectionMarkers,dismissFocusRing:()=>this.dismissFocusRing(),seat:e=>this.seatById.get(e),seatMark:e=>this.seatMarks.get(e),seatSection:e=>this.seatSection.get(e),objectFloor:e=>this.objectFloor.get(e),perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,setHoveredId:e=>{this.hoveredId!==e&&(this.hoveredId=e,this.queueViewportPinSync())},seatsPickable:()=>this.seatsPickable(),handleSeatTap:e=>this.handleSeatTap(e),seatStatus:e=>this.statusById.get(e)??"free",hasSeatMark:e=>this.seatMarks.has(e),isOwnedHold:e=>this.ownedHold.has(e),isSelected:e=>this.selection.has(e),isSelectable:e=>this.isSelectable(e),hiddenByAccessFilter:e=>this.hiddenByAccessFilter(e),seatInClosedSection:e=>this.seatInClosedSection(e),toggleSeat:e=>this.toggleSeat(e),nudgeSeat:e=>this.moments.nudge(e),renderedSeatPoint:e=>this.renderedSeatPoint(e),nearestSeatToScreen:(e,i,o)=>this.nearestSeatToScreen(e,i,o),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionMatchesFocus:e=>this.sectionMatchesFocus(e),navigateGroupAt:e=>Pa({doc:this.chartDoc,zones:this.zones,sections:this.sections,enterFloor:i=>this.opts.onDeckTap?this.opts.onDeckTap(i):this.setActiveFloor(i),frame:i=>this.focusRegion(i)},e),sectionFrameScale:e=>this.sectionFrameScale(e),sectionTapAnchor:(e,i)=>this.sectionTapAnchor(e,i),rowLabelAt:e=>this.rowLabelAtScreen(e),selectRow:e=>{this.selectRow(e)},ownedBadgeAt:e=>this.owned.badgeAt(e),focusOwnedSeats:e=>this.focusOwnedSeatsIn(e),pressLandsOnChart:e=>this.pressLandsOnChart(e),tableAt:e=>Jo(this.tableFootprints,this.seats,this.screenToWorld(e),this.effScale()),destroyed:()=>this.destroyed,deckFloorAt:()=>this.deckFloorAt(),screenToWorld:e=>this.screenToWorld(e),effScale:()=>this.effScale(),focusSeats:(e,i)=>this.focusSeats(e,i),focusSection:(e,i)=>this.focusSection(e,i),zoomAbout:(e,i,o)=>this.zoomAbout(e,i,o),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let o=i?this.worldToScreen(i):Dt(this.framingViewport());this.zoomAbout(Math.max(this.rowBandPreview.detailScale*1.08,this.stage.scaleX()*1.5),o)}else this.opts.onSectionTap?this.opts.onSectionTap(e,i):this.focusSection(e,{anchor:i})},onBackdropTap:this.opts.onBackdropTap,onDeckTap:this.opts.onDeckTap}}zoomBounds(){return Bt(this.cameraHost)}zoomAbout(e,i,o="now"){this.rowBandPreview&&this.focusRoams&&this.viewMode==="flat"&&(this.rowBandZoomAnchor=i),Nl(this.cameraHost,e,i,o)}cancelZoomSettle(){Hl(this.cameraHost)}focusRegion(e,i){Gl(this.cameraHost,e,i)}applyLabelVisibility(e){let i=e!==this.labelsVisible;if(this.labelsVisible=e,!i||!e)return;if(this.labelFadeRaf&&(cancelAnimationFrame(this.labelFadeRaf),this.labelFadeRaf=0),this.reducedMotion){this.labelGroup.opacity(1);return}let o=performance.now();this.labelGroup.opacity(0);let n=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let s=Math.min(1,(r-o)/90);this.labelGroup.opacity(s),this.stage.batchDraw(),this.labelFadeRaf=s<1?requestAnimationFrame(n):0};this.labelFadeRaf=requestAnimationFrame(n)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=Z?"seats":this.zones.length&&e<ze?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,viewMode:this.viewMode,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(e),isoLiftLocal:e=>this.isoLiftLocal(e),seats:this.seats,sections:this.sections,zones:this.zones,seatSection:this.seatSection,statusById:this.statusById,selection:this.selection,circleById:this.circleById,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,seatLabelRungOpen:()=>this.seatLabelRungOpen,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,freeTextById:this.freeTextById,gaById:this.gaById,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,seatR:this.seatR,canvasBackground:this.canvasBackground,effSelection:this.effSelection,categoryFilter:this.categoryFilter,focusedSectionId:this.focusedSectionId,focusBackdrop:this.focusBackdrop,isSelectable:e=>this.isSelectable(e),seatViewportCulled:e=>this.seatViewportCulled(e),focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),Sc(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let i=e==="sections"?(ve+Z)/2:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),o=this.framingViewport(),n=o.width,r=o.height,s=Dt(this.framingWorldRect()),{x:a,y:l}=fc({rung:e,sections:this.sections,seats:this.seats,viewCentre:s,target:i,width:n,height:r}),c=n/(i*1.12),d=r/(i*1.12);this.focusRegion({x:a-c/2,y:l-d/2,width:c,height:d})}seatRungScale(){return Ql(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,o,n=0){let r=Ot(this.framingViewport(),n);return ec({stageWidth:r.width,stageHeight:r.height,fullBounds:i,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}releaseFocusOnPullBack(){this.rowBandPreview&&this.viewMode==="flat"&&this.focusedSectionId&&this.effScale()>=Math.min(Z,this.sectionFrameScale(this.focusedSectionId)*.85)||Ol({focusedSectionId:this.focusedSectionId,roaming:this.focusRoams,floorOverview:this.separatedFloorOverview,effScale:this.effScale()})&&(this.clearSectionFocus(),this.opts.onFocusedSectionChange?.(null))}afterViewChange(){this.releaseFocusOnPullBack(),this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.cancelZoomSettle(),this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){let e=this.rowBandZoomAnchor;if(this.rowBandZoomAnchor=null,!this.focusRoams||this.separatedFloorOverview)return;let i=!!this.rowBandPreview&&this.viewMode==="flat"&&!this.exportMode;if(!this.focusedSectionId&&(!i||this.effScale()<Z))return;let n=(i&&e?this.sectionAt(e):null)??Sa({sections:this.sections.map(r=>({logicalId:r.logicalId,members:r.memberIds.length,bounds:this.sectionScreenBounds(r)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!n||n===this.focusedSectionId||(this.focusedSectionId=n,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(n))}scheduleViewChange(){this.exportMode||(this.refreshLabelsWhileMoving(),!this.viewChangeRaf&&(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()})))}refreshLabelsWhileMoving(){this.movingLabelTimer||!this.seats.length||this.effScale()<=oe||(this.movingLabelTimer=setTimeout(()=>{this.movingLabelTimer=null,!(this.destroyed||this.exportMode)&&this.updateLabels()},Rr))}sizeLabel(e,i,o){e.fontSize(Math.max(1,i)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(o)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),we+.01,oe):this.effScale(),i=Math.max(e,1e-4);for(let[s,a]of this.primaryFocalLabels)Ic(s,a,i,(l,c)=>{this.sizeLabel(l,c,l.y())},this.fitScale);this.hasSections?(cl(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&this.viewMode==="flat"&&e>=Math.min(Z,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:Z),()=>this.sectionFrameScale(this.focusedSectionId),s=>{let a=s.outline.map(l=>this.worldToScreen(l));return Math.max(...a.map(l=>l.x))>=0&&Math.min(...a.map(l=>l.x))<=this.stage.width()&&Math.max(...a.map(l=>l.y))>=0&&Math.min(...a.map(l=>l.y))<=this.stage.height()},()=>this.zoomBounds().max),this.owned.sync(e,this.getRung()),this.syncBeacons()):(this.clusterLabels.syncForCamera(e)||this.primaryFocalLabels.size)&&this.bgLayer.batchDraw(),this.clusterLabels.syncCursor(this.hoveredId!=null),this.paintGAStateForView(),this.updateAccessGlyphs(e);let o=this.seatGlyphDetail;if(this.seatGlyphDetail=xs(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail),o!==this.seatGlyphDetail&&this.glyphMarkers.length&&this.moments.resyncMarkers(this.selectionMarkers,()=>this.breath.sync(this.selectionMarkers)),this.viewportSeats){let s=this.seatLayer.opacity()>0;this.seatLayer.listening(s),!s&&this.hoveredId&&this.seatLayer.fire("mouseout");return}let n=!this.exportMode&&!this.rowBandPreview?.active&&e<Z;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.viewMode==="perspective"&&this.hasSections&&this.seats.length>2500&&n){this.seatLayer.listening(!1);return}if(n&&!this.cached){if(this.mountCachePending){this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>{this.recacheTimer=null,this.cacheSeatLayer()},0);return}this.cacheSeatLayer()}else!n&&(this.cached||!this.seatLayer.listening())&&(this.cached&&this.releaseSeatLayerBitmap(),this.seatLayer.listening(!this.exportMode),this.cached=!1,this.seatLayer.batchDraw())}rebuildSeatCache(){if(this.viewportSeats||this.seatReveal||this.seatRevealPending||this.rowBandPreview?.active)return;this.updateSeatGroupVisibility();let e=Y(this.stage.scaleX()*this.dpr,.15,2);this.seatLayer.clearCache(),this.seatLayer.cache({pixelRatio:e}),this.seatLayer.listening(!1),this.cached=!0,this.mountCachePending=!1}cacheSeatLayer(){this.destroyed||typeof document>"u"||(this.recacheTimer=null,this.rebuildSeatCache(),this.seatLayer.batchDraw())}releaseSeatLayerBitmap(){Ec(Wi,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.zoomSettleRaf&&(this.cancelZoomSettle(),this.afterViewChange()),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<Z?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){this.cancelSeatReveal(!0);let e=this.assets.generation,i=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assets.pending(),...i?[i.ready.then(()=>{}),i.load("700 24px Inter").then(()=>{}),i.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assets.generation)throw new Error("The chart changed while its export assets were loading.");if(this.assets.failures.length)throw new Error(`Export stopped because ${this.assets.failures.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(s=>s.getClientRect({relativeTo:this.stage})).filter(s=>s.width>0&&s.height>0);if(!e.length)return this.bounds;let i=Math.min(...e.map(s=>s.x)),o=Math.min(...e.map(s=>s.y)),n=Math.max(...e.map(s=>s.x+s.width)),r=Math.max(...e.map(s=>s.y+s.height));return{x:i,y:o,width:Math.max(1,n-i),height:Math.max(1,r-o)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),i=this.stage.height(),o=Math.max(12,Math.min(36,Math.min(e,i)*.025)),n=()=>{let r=this.exportSceneBounds(),s=Math.max(1,e-o*2),a=Math.max(1,i-o*2),l=Math.min(s/r.width,a/r.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-r.width*l)/2-r.x*l,y:(i-r.height*l)/2-r.y*l}),this.afterViewChange()};n(),n()}captureCanvas(){if(!this.exportMode)throw new Error("captureCanvas() is available only on a renderer created with exportMode.");this.forceDraw();let e;try{e=this.stage.toCanvas({pixelRatio:1,imageSmoothingEnabled:!0})}catch(n){let r=n instanceof Error?n.message:String(n);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${r}`)}let i=document.createElement("canvas");i.width=this.stage.width(),i.height=this.stage.height();let o=i.getContext("2d");if(!o)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");o.fillStyle=this.canvasBackground,o.fillRect(0,0,i.width,i.height);try{o.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),oe):this.effScale();for(let{node:i,backdrop:o,kind:n,showAt:r}of this.freeTextById.values()){if(n==="ga-label"||n==="ga-capacity")continue;let s=n==="free-text"&&this.nodeBelongsToFocusedSection(i),a=n==="direct-landmark";if(a){let d=Number(i.getAttr("directLandmarkBaseFontSize"))||i.fontSize();i.setAttr("directLandmarkBaseFontSize",d),i.fontSize(Math.max(d,z/e))}let l=r==="detail"&&!this.exportMode&&e<ve,c=a||s||!l&&ye(i.fontSize(),e);if(i.visible(c),o?.visible(c),!this.exportMode&&n==="free-text"){let d=Math.min(1,rs/Math.max(i.fontSize()*e,1e-6));i.scale({x:d,y:d}),o?.scale({x:d,y:d})}}for(let{node:i,fontSize:o}of this.iconNodeById.values())i.visible(this.nodeBelongsToFocusedSection(i)||ye(o,e))}nodeBelongsToFocusedSection(e){let i=this.focusedSectionId;if(!i)return!1;this.focusMembershipKey!==i&&(this.focusMembership.clear(),this.focusMembershipKey=i);let o=this.focusMembership.get(e);if(o!==void 0)return o;let n=this.sections.filter(s=>s.id===i||s.logicalId===i||s.zone===i),r=!1;if(n.length){let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),a={x:s.x+s.width/2,y:s.y+s.height/2};r=n.some(l=>J(a,l.outline,l.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.rowLabelPlan=Rc(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,o=ie){return sn(e,i,o)}resolveAutomaticRowLabelPosition(e,i,o){return Ac(e,i,o,this.seatIndex)}objectFilteredOut(e){let i=e.categoryKey;return i?!!(this.categoryHighlight&&i!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(i)):!1}updateLabels(){Ha(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,labelLayers:()=>this.labelLayers,fitScale:()=>this.fitScale,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),otherSectionCount:()=>this.sections.filter(e=>e.id!==this.focusedSectionId&&e.logicalId!==this.focusedSectionId).length,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),labelGroup:this.labelGroup,rowLabelGroup:this.rowLabelGroup,seatLabelPool:this.seatLabelPool,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,setSeatLabelRungOpen:e=>{this.seatLabelRungOpen=e},visibleSeatCandidates:()=>this.visibleSeatCandidates(),worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,renderedSeatPoint:e=>this.renderedSeatPoint(e),viewMode:this.viewMode,perspectiveSeatScale:this.perspectiveSeatScale,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),hasSelectionMarker:e=>this.selection.has(e)||this.ownedHold.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,i,o)=>this.resolveAutomaticRowLabelPosition(e,i,o),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),isoT:this.isoT,applyUprightLabels:()=>this.applyUprightLabels(),overlayLayer:this.overlayLayer}}handleResize(){this.gestures.invalidateRect();let e=pc({width:this.container.clientWidth,height:this.container.clientHeight,stageWidth:this.stage.width(),stageHeight:this.stage.height()});if(e==="hidden"){this.hiddenPose??=this.getCameraPose();return}let i=this.hiddenPose;if(this.hiddenPose=null,e==="unchanged"){i&&this.setCameraPose(i);return}let o={width:this.stage.width(),height:this.stage.height()};this.stage.size(e),i&&this.setCameraPose(i);let r=!(this.fitPose===""||qe(this.stage)===this.fitPose)&&e.width===o.width;r&&this.stage.position({x:this.stage.x()+(e.width-o.width)/2,y:this.stage.y()+(e.height-o.height)/2}),this.refitCurrentView(r)}};Kt.ZOOM_STEP=1.4;var pn=Kt;function sd(t,e){return new pn(t,e)}function sm(t,e){return t*2*.6*e>=6}function am(t,e){t._sceneFunc(e)}function fn(t){let e=this,i=e.attrs;am(e,t);let o=i.organizerGlyphRadius||1,n=e.getStage(),r=Math.abs((n?n.scaleX():1)*(e.scaleX()||1))||1;if(!sm(o,r))return;let s=o*.6;t.save(),t.setAttr("strokeStyle",i.organizerGlyphInk||"#000000"),t.setAttr("lineWidth",Math.max(o*.2,.75)),t.setAttr("lineCap","round"),t.setAttr("lineJoin","round"),t.beginPath(),i.organizerGlyph==="cross"?(t.moveTo(-s,-s),t.lineTo(s,s),t.moveTo(s,-s),t.lineTo(-s,s)):(t.moveTo(0,-s),t.lineTo(0,0),t.lineTo(s*.72,0)),t.stroke(),t.restore()}function ad(t){return t.attrs.sceneFunc===fn}function ld(t){ad(t)&&t.setAttr("sceneFunc",void 0)}function lm(t,e,i,o){if(!e){ld(t);return}let n=t.attrs;n.organizerGlyph=e,n.organizerGlyphInk=i,n.organizerGlyphRadius=o>0?o:1,n.sceneFunc!==fn&&t.setAttr("sceneFunc",fn)}function cd(t,e){t.accessFilter=e===null?null:[...e],t.renderer?.setAccessibilityFilter?.(e);let i=t.renderer?.getFocusedSection?.()??null;i&&t.emitSectionFocus(t.sectionSummary(i))}function mn(t,e){let i=t.renderer;if(!i?.focusAccessibleSeats)return!1;let o=e===void 0?t.accessFilter:e;if(!o)return!1;let n=pd(t,o);n&&t.setFloor(n);let r=i.focusAccessibleSeats(o);return r&&t.emitSectionFocus(null),r}function dd(t,e){let i=t.renderer;if(!i?.accessibleSpread)return null;let o=e===void 0?t.accessFilter:e;return o?i.accessibleSpread(o):null}function hd(t,e,i,o){let n=t.renderer;n&&(t.accessFilter&&(i?.accessibleLeft??0)>0&&n.focusAccessibleSection?.(e,t.accessFilter)||(n.focusSection?n.focusSection(e,o?{anchor:o}:void 0):n.focusRegion?.(e)))}function ud(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let o=pd(t,i);o&&t.setFloor(o);let n=t.renderer,r=n?.accessibleSections?.(i)??[];if(!r.length)return null;let s=t.accessStepAt?r.findIndex(l=>l.id===t.accessStepAt):-1,a=r[(s+1)%r.length];return t.accessStepAt=a.id,n?.focusAccessibleSection?.(a.id,i)||n?.focusSection?.(a.id),t.emitSectionFocus(t.sectionSummary(a.id)),{...a,index:r.indexOf(a),total:r.length}}function pd(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let o=new Set(e),n=l=>o.size===0?!!l.accessible:!!l.accessibility?.some(c=>o.has(c)),r=l=>l.some(c=>c.type==="row"&&(c.overrides??[]).some(n)),s=t.getActiveFloorId(),a=i.floors.find(l=>l.id===s);return a&&r(a.objects)?null:i.floors.find(l=>r(l.objects))?.id??null}function fd(t,e){return t.accessFilter?Me(e,t.accessFilter)==="other":!1}function md(t,e){let i=t.renderer;if(!i)return;let o=i.getFocusedSection?.()??null;if(i.clearSectionFocus?.(),e?.length){t.emitSectionFocus(null),t.bandReturnPose||(t.bandReturnPose=i.getCameraPose?.()??null,t.bandReturnSection=t.bandReturnPose?o:null);let r=cm(t,e);r&&t.setFloor(r),i.focusCategories?i.focusCategories(e):i.zoomToFit();return}let n=t.bandReturnPose!=null;t.bandReturnPose=null,t.bandReturnSection=null,!(t.accessFilter&&mn(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),n&&i.zoomToFit())}function cm(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let o=new Set(e),n=a=>a.some(l=>l.type==="row"&&(o.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||l.type==="gaArea"&&o.has(l.categoryKey)),r=t.getActiveFloorId(),s=i.floors.find(a=>a.id===r);return s&&n(s.objects)?null:i.floors.find(a=>n(a.objects))?.id??null}function gd(t,e,i){let o=new Map,n=new Map,r=new Map,s=new Map,a=[],l=new Map(On(t).map(d=>[d.id,d])),c=$n(t);for(let d of e){o.set(d.label,d.id),n.set(d.label,d),r.set(d.id,d),a.push(d.id);let h=l.get(d.rowId),u=h&&"label"in h&&typeof h.label=="string"?h.label:void 0,m=h?.type==="row"?h.segmentedRow:void 0,f=m?.displayLabel??(h&&"displayLabel"in h&&typeof h.displayLabel=="string"&&h.displayLabel?h.displayLabel:u),b=i.get(d.rowId),p=h?.type==="table"?"table":h?.type==="booth"?"booth":"seat",g=f,y=m?.displayType?.trim()||(h&&"displayType"in h&&typeof h.displayType=="string"&&h.displayType.trim()?h.displayType.trim():void 0),S=d.displayLabel??d.label,x=S.split("-"),w=b||d.kind==="booth"?void 0:f&&S.startsWith(`${f}-`)?S.slice(f.length+1):x[x.length-1]??S;s.set(d.id,{objectId:d.rowId,objectType:p,sectionLabel:d.sectionId?c.get(d.sectionId):void 0,rowLabel:g,seatNumber:w,...y?{displayType:y,rowType:y}:{}})}return{labelToId:o,labelToSeat:n,seatById:r,seatContext:s,allIds:a}}function bd(t,e={}){let{baseMs:i=1e3,factor:o=2,maxMs:n=1/0,jitter:r=0,random:s=Math.random}=e,a=Math.min(i*o**Math.max(0,t),n);if(r<=0)return a;let l=Math.min(1,r);return a*(1-l+l*s())}function yd(t,e,i){return kt(t).map(o=>{let n=t.categories.find(r=>r.key===o.categoryKey);return{id:o.id,label:o.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},capacity:Math.max(0,Math.floor(o.capacity)),available:Zt(o).filter(r=>i(r)==="free").length,categoryKey:o.categoryKey,tiers:n?.tiers,price:n?.tiers?.[0]?.price??n?.price??0,currency:e}})}function Sd(t,e){let i={};for(let o of t)i[o.id]=e?{available:o.available,selected:e.get(o.id)??0}:{available:o.available};return i}function vd(t){let e={};for(let[i,o]of t.seatById)t.groupedTableBySeatId.has(i)||t.closedMembers.has(i)||(t.statusOf(i)??"free")==="free"&&(e[o.categoryKey]=(e[o.categoryKey]??0)+1);for(let i of t.groupedTablesByLabel.values()){if(i.chairs.some(n=>t.closedMembers.has(n.id)))continue;let o=i.chairs[0];o&&(t.statusOf(o.id)??"free")==="free"&&(e[i.categoryKey]=(e[i.categoryKey]??0)+i.maxOccupancy)}for(let i of t.gaAreas??[])e[i.categoryKey]=(e[i.categoryKey]??0)+i.available;return e}function dm(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function wd(t,e){let i=new Set,o=new Map;for(let n of t){let r=dm(n);if(!r.length)continue;let s=e(n.id)==="free";for(let a of r)i.add(a),s&&o.set(a,(o.get(a)??0)+1)}return i.size?Tn.filter(n=>i.has(n.key)).map(n=>({key:n.key,count:o.get(n.key)??0})):[]}var _x=5e3,Bx={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function hm(t){if(!t.holdActive||t.holdLabels.length===0)return!1;let e=t.now??Date.now();return t.holdExpiresAt!=null&&e>=t.holdExpiresAt+5e3||t.serverHoldActive===!1?!0:!t.holdLabels.some(i=>t.statusOf(i)==="held")}function kd(t){let e=new Set(t.holdLabels),i=t.selection.filter(n=>!e.has(n)&&t.statusOf(n)!=="free");if(!hm(t))return{lost:i,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let o=[...t.holdLabels];return{lost:i,holdLapsed:!0,lapsedLabels:o,recoverable:o.filter(n=>t.statusOf(n)==="free")}}function Ox(t){return t.lost.length>0||t.holdLapsed}function Dx(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function xd(t,e,i=Date.now()){return e&&i<t+5e3}function Ld(t){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let e=()=>{document.visibilityState==="visible"&&t()};return document.addEventListener("visibilitychange",e),()=>{typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",e)}}function Cd(t){if(!t?.zones?.length)return[];let e=new Set(qn(t).sections.filter(i=>i.seatCount>0&&!!i.zone).map(i=>i.zone));return t.zones.filter(i=>e.has(i.id)).map(i=>({id:i.id,label:i.label}))}function Pd(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},o=He(e).filter(s=>!t.groupedObjectIds.has(s.rowId)),n=new Set;for(let s of o)t.heldLabels.has(s.label)||t.tierApplies(s)&&(t.accessFilter&&!Ie(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&n.add(s.label));let r=Sr(o,n,{qty:t.qty,categoryKey:t.categoryKey,zoneId:t.zoneId,focal:i,preferPremium:!0});return r.labels.length!==t.qty?null:r.labels.every(s=>t.isPremium(s))?[...r.labels]:null}var gn=["background","rowLabelColor","textColor","selectionColor"];function Td(t,e){return!t||!e?!t&&!e:gn.every(i=>t[i]===e[i])}function bt(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function Vi(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function Id(t,e,i){let o=Kn(e,i);o==="all"?t.setFloorOverview?.(!0):o&&t.setActiveFloor?.(o)}var Ee=class extends Error{constructor(i){super(i.message);this.status=422;this.name="PickerSelectionError",this.reason=i.code,this.labels=i.labels}};function bn(t){return t==="setup"||t==="testable"||t==="live"||t==="paused"||t==="ended"?t:null}function Md(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var zi=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,i){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let o=this.ref;this.pending=e.eventConfiguration(i).then(n=>{if(n.reference.id!==o.id||n.reference.version!==o.version||n.configuration.id!==o.id||n.configuration.version!==o.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return n.configuration})}return this.pending}};async function Rd(t,e,i){if(!t.renderer)return null;let n=e??t.getSelection().map(l=>l.label),r=t.hold_?.items??[],s=[...new Set([...r.map(l=>l.label),...n])];if(!s.length)return null;let a=t.ticketIssue(s);if(a)throw new Ee(a);if(t.hold_&&t.holdCovers(s))return t.hold_;try{let l=s.map(d=>{let h=r.find(f=>f.label===d);if(h&&(h.objectType==="ga"||h.quantity!=null||h.tierId!=null))return{label:d,tierId:h.tierId,...h.quantity!=null?{quantity:h.quantity}:{}};let u=t.labelToSeat.get(d),m=u?t.toSeat(u):null;return{label:d,...m?.tierId?{tierId:m.tierId}:{},...t.tableQuantityRequest(m)}}),c=await t.api.hold(t.key,l,i,t.hold_?.holdId);return t.setHold({holdId:c.holdId,labels:s,expiresAt:c.expiresAt,items:c.items}),t.hold_}catch(l){throw t.handle409Conflicts(l),l}}async function Ad(t,e){if(t.closed||!e||!t.api.resume)return null;let i=await t.api.resume(t.key,e);if(t.closed)return null;let o=[...new Set(i.items.map(n=>n.label))];return o.length?(t.setHold({holdId:i.holdId,labels:o,expiresAt:i.expiresAt,items:i.items},"restored"),t.hold_):null}async function Ed(t,e){let i=t.hold_;if(!i||!t.api.extend)return null;try{let o=await t.api.extend(t.key,i.holdId,e);return t.hold_?.holdId!==i.holdId||t.setHold({holdId:i.holdId,labels:i.labels,expiresAt:o.expiresAt,items:i.items}),t.hold_}catch{return null}}async function Fd(t,e,i,o){let n=t.renderer;if(!n)return null;if(!t.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let r=i??t.getSelection().map(c=>c.label);if(!r.length)return null;let s=t.ticketIssue(r);if(s)throw new Ee(s);let a;try{if(t.hold_&&t.holdCovers(r))a=t.hold_.holdId;else{let c=t.hold_?.holdId,d=await t.api.hold(t.key,r.map(h=>{let u=t.labelToSeat.get(h),m=u?t.toSeat(u):null;return{label:h,...m?.tierId?{tierId:m.tierId}:{},...t.tableQuantityRequest(m)}}),o,c);a=d.holdId,t.setHold({holdId:a,labels:[...r],expiresAt:d.expiresAt,items:d.items})}await t.api.book(t.key,r,a,e)}catch(c){let{status:d,conflicts:h,reason:u}=bt(c);if(t.clearHold(),d===409&&u==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&h?.length){let m=new Set(h.map(p=>p.label)),f=t.idsForLabels(m);f.length&&(n.setStatus(f,"booked"),n.deselect(f),t.resetTableQuantitiesForLabels(m));let b=r.filter(p=>!m.has(p));b.length&&a&&t.api.release(t.key,b,a).catch(()=>{}),t.emitSelectionChange()}else a&&t.api.release(t.key,r,a).catch(()=>{});throw c}let l=t.idsForLabels(r);return l.length&&(n.setStatus(l,"booked"),n.deselect(l)),t.clearHold(),t.resetTableQuantitiesForLabels(r),t.emitSelectionChange(),t.opts.onBook?.(e),r}async function _d(t){let e=t.hold_;if(!e)return!0;try{let o=await t.api.release(t.key,e.labels,e.holdId);if(!t.releaseConfirmed(o,e.labels))return await t.resnapshot(),!1}catch(o){return t.emitError(o),!1}if(t.hold_?.holdId!==e.holdId)return!0;t.clearHold(),t.resetTableQuantitiesForLabels(e.labels);let i=t.idsForLabels(e.labels);return i.length&&(t.renderer?.deselect(i),t.renderer?.setStatus(i,"free")),!0}async function Bd(t,e){let i=t.hold_;if(!i)return!0;let o=e.filter(a=>i.labels.includes(a));if(!o.length)return!0;try{let a=await t.api.release(t.key,o,i.holdId);if(!t.releaseConfirmed(a,o))return await t.resnapshot(),!1}catch(a){return t.emitError(a),!1}if(t.hold_?.holdId!==i.holdId)return!0;let n=i.labels.filter(a=>!o.includes(a)),r=i.items?.filter(a=>!o.includes(a.label));n.length?t.setHold({...i,labels:n,items:r}):t.clearHold(),t.resetTableQuantitiesForLabels(o);let s=t.idsForLabels(o);return s.length&&(t.renderer?.deselect(s),t.renderer?.setStatus(s,"free")),!0}function Od(t,e){let i=t?.released;return!Array.isArray(i)||e.every(o=>i.includes(o))}function Dd(t,e){let i=t.hold_;if(!i||i.labels.length!==e.length||!e.every(r=>i.labels.includes(r)))return!1;let o=new Map((i.items??[]).map(r=>[r.label,r.tierId])),n=new Map((i.items??[]).map(r=>[r.label,r.quantity??1]));return e.every(r=>{let s=t.labelToSeat.get(r),a=s?t.toSeat(s):null,l=a?.tierId??null;return(a?.objectType!=="table"||(a.bookingMode!=="variable"||t.confirmedVariableTables.has(r))&&(!n.has(r)||n.get(r)===a.quantity))&&(!o.has(r)||o.get(r)===l)})}function Nd(t,e){let{status:i,conflicts:o}=bt(e);if(i!==409||!o?.length)return;let n=t.renderer;if(!n)return;let r=t.idsForLabels(o.map(s=>s.label));r.length&&(n.deselect(r),n.setStatus(r,"held"),t.resetTableQuantitiesForLabels(o.map(s=>s.label))),t.emitSelectionChange()}function Hd(t,e,i="created"){for(let r of e.items??[])t.groupedTablesByLabel.has(r.label)&&r.quantity!=null&&(t.tableQuantities.set(r.label,r.quantity),t.groupedTablesByLabel.get(r.label)?.mode==="variable"&&t.confirmedVariableTables.add(r.label));let o={...e,seats:t.seatsForLabels(e.labels)};t.hold_=o,t.renderer?.setOwnedHold?.(t.idsForLabels(o.labels)),t.expiryTimer&&clearTimeout(t.expiryTimer);let n=Math.max(0,o.expiresAt-Date.now());t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},n),i==="restored"?t.opts.onHoldRestored?.(o):t.opts.onHold?.(o)}function Gd(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function Wd(t){let e=t.hold_;if(e){try{let i=await t.api.objects(t.key);if(t.hold_?.holdId!==e.holdId)return;t.applySeatsMap(i.seats,i.default??"free")}catch{t.hold_?.holdId===e.holdId&&(t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},2e3));return}if(t.hold_?.holdId===e.holdId){if(xd(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function Vd(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function zd(t,e,i,o){if(i!=null&&!Array.isArray(i))throw new TypeError("picker: `selectionValidators` must be an array");let n=[],r=0,s=!1,a=!1;for(let c of i??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");r=Math.max(r,Number(c.minimum))}else if(c?.type==="consecutiveSeats")s=!0;else if(c?.type==="noOrphanSeats")a=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(r&&n.push({type:"minimumSelectedPlaces",minimum:r}),s&&n.push({type:"consecutiveSeats"}),a&&n.push({type:"noOrphanSeats"}),t!=null&&r>t)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let l=Math.max(0,Math.floor(e??t??Math.max(o,r)));if(t!=null&&l<t)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&l<r)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:n,maxSelection:t??l}}function pm(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function fm(t){if(t.length<=1)return!1;let e=t[0]?.objectId,i=t[0]?.categoryKey;if(!e||t.some(n=>n.objectId!==e||n.categoryKey!==i))return!0;let o=t.map(n=>pm(n.id)).sort((n,r)=>n-r);return o.some((n,r)=>n<0||r>0&&n!==o[r-1]+1)}function Kd(t,e,i,o,n){let r=o.find(l=>l.type==="minimumSelectedPlaces")?.minimum??0,s=i??r,a=[];return i!=null&&e!==i&&a.push("numberOfPlacesToSelect"),r&&e<r&&a.push("minimumSelectedPlaces"),o.some(l=>l.type==="consecutiveSeats")&&fm(t)&&a.push("consecutiveSeats"),o.some(l=>l.type==="noOrphanSeats")&&n()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:s,remaining:Math.max(0,s-e),seats:t,violations:a}}function Xd(t){let{id:e,doc:i,seatById:o,groupedTableBySeatId:n}=t,r=v=>v.type==="section"&&(v.id===e||v.logicalSectionId===e),s=i.floors?.find(v=>v.objects.some(r)),a=(s?.objects??i.objects).find(r);if(!a)return null;let l=t.sectionMembers(e),c=new Map,d=new Map,h=new Set,u=0,m=0;for(let v of l){let k=o.get(v);if(!k)continue;t.matchesAccessFilter&&t.statusOf(v)==="free"&&t.matchesAccessFilter(k)&&(m+=1);let P=n.get(v);if(P){if(h.has(P.label))continue;h.add(P.label),c.set(P.categoryKey,(c.get(P.categoryKey)??0)+P.maxOccupancy),t.statusOf(P.chairs[0]?.id??v)==="free"&&(u+=P.maxOccupancy,d.set(P.categoryKey,(d.get(P.categoryKey)??0)+P.maxOccupancy))}else c.set(k.categoryKey,(c.get(k.categoryKey)??0)+1),t.statusOf(v)==="free"&&(u++,d.set(k.categoryKey,(d.get(k.categoryKey)??0)+1))}let f=[...c.entries()].map(([v,k])=>{let P=i.categories.find(M=>M.key===v),C=P?.tiers?.map(M=>M.price).filter(Number.isFinite)??[],T=C.length?C:typeof P?.price=="number"&&Number.isFinite(P.price)?[P.price]:[],L=T.length?Math.min(...T):void 0,I=T.length?Math.max(...T):void 0;return{key:v,count:k,label:P?.label??v,color:P?.color??"#6e7bff",...L!==void 0?{price:L,priceMin:L,priceMax:I}:{}}}).sort((v,k)=>(v.priceMin??1/0)-(k.priceMin??1/0)||v.key.localeCompare(k.key)),b=f.flatMap(v=>v.priceMin===void 0?[]:[v.priceMin]),p=f.flatMap(v=>v.priceMax===void 0?[]:[v.priceMax]),g=a.zone?i.zones?.find(v=>v.id===a.zone):void 0,y=v=>{let k=null,P=0;for(let[C,T]of v)(T>P||T===P&&k!=null&&C<k)&&(k=C,P=T);return k},S=y(d)??y(c),w=(S?f.find(v=>v.key===S)?.color:void 0)??g?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:m}:{},label:a.displayLabel??a.label,zoneLabel:g?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:w,seatsLeft:u,...b.length?{priceMin:Math.min(...b),priceMax:Math.max(...p)}:{},categories:f}}var Ki=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,i=!1){if(!i){if(this.inFlight)return this.inFlight;if(this.now()-this.lastSettledAt<this.windowMs)return Promise.resolve()}let o=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===o&&(this.inFlight=null)});return this.inFlight=o,o}markSettled(){this.lastSettledAt=this.now()}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};function Yd(t,e){return t?.source==="socket"&&e.source==="http"?t:e}function Ud(t,e){return t?.source==="socket"?t:e?{seats:e.seats,default:e.default,source:"http",...e.fetchedAt===void 0?{}:{fetchedAt:e.fetchedAt}}:t}var ym=!0,Sm=!0,vm=10,wm=15e3,$d=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new zi;this.hidden=new Set;this.mapTheme=null;this.closedSections=new Set;this.labelToId=new Map;this.labelToSeat=new Map;this.expandedSeats=[];this.seatTiers=new Map;this.seatById=new Map;this.seatContext=new Map;this.allIds=[];this.groupedTablesByObject=new Map;this.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.connectFallback=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.detachVisibility=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.snapshots=new Ki;this.narrowLayout=!1;this.fitClearance=0;this.accessFilter=null;this.viewportInsets=null;this.accessStepAt=null;this.bandReturnPose=null;this.bandReturnSection=null;this.hintShown=!1;this.lastSnapshotAt=0;this.seatsBuilt=!1;this.pendingSnapshot=null;this.socketVersion=0;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=Vd(e.numberOfPlacesToSelect);let i=zd(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,vm);this.selectionValidators=i.validators,this.maxSelection=i.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(o=>typeof o=="string"&&!!o))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=Zn(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let o of gn){let n=this.mapTheme[o];n&&(i[o]=n)}return{...e,theme:i}}setMapTheme(e){return Td(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let i=e.getSelection().map(a=>a.id),o=this.getActiveFloorId(),n=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,s=e.getCameraPose?.();return e.setChart(this.visibleDoc(),o?{floorId:o}:void 0),this.applyRowBandPreview(e),n&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),i.length&&e.select?.(i),r&&e.focusSection?.(r),s&&e.setCameraPose&&e.setCameraPose(s),e.settleView?.(),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let i=e.filter(n=>typeof n=="string");if(i.length===this.hidden.size&&i.every(n=>this.hidden.has(n)))return!1;this.hidden=new Set(i);let o=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),this.renderer&&this.applyRowBandPreview(this.renderer),o&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let i=(e??[]).filter(o=>typeof o=="string");return i.length===this.closedSections.size&&i.every(o=>this.closedSections.has(o))?!1:(this.closedSections=new Set(i),this.renderer?.setClosedSections?.(i),!0)}isSectionClosed(e){return this.closedSections.has(e)}currentHold(){return this.hold_}getRenderer(){return this.renderer}seatByLabel(e){return this.labelToSeat.get(e)}getExpandedSeats(){return this.expandedSeats}loadEventConfiguration(){return this.eventConfiguration.load(this.api,this.key)}idForLabel(e){return this.labelToId.get(e)}idsForLabel(e){let i=this.groupedTablesByLabel.get(e);if(i)return i.chairs.map(n=>n.id);let o=this.labelToId.get(e);return o?[o]:[]}idsForLabels(e){return[...new Set([...e].flatMap(i=>this.idsForLabel(i)))]}tableSelection(e){let i=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return i?this.toTableSeat(i):null}lineItemDisplay(e){if(e.objectType==="ga"){let n=this.visibleDoc(),r=kt(n).find(s=>s.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}if(e.objectType==="table"){let n=this.groupedTablesByLabel.get(e.label);return{...n?.displayLabel&&n.displayLabel!==n.label?{displayLabel:n.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}let i=this.labelToSeat.get(e.label),o=i?this.seatContext.get(i.id):void 0;return{...i?.displayLabel?{displayLabel:i.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}async render(e){if(this.renderer)return null;let i=performance.now(),o={},n=L=>Math.round((performance.now()-L)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(L=>({ok:!0,res:L,elapsed:n(r)}),L=>({ok:!1,error:L,elapsed:n(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(L=>({ok:!0,objects:L,elapsed:n(a)}),()=>({ok:!1,elapsed:n(a)})),c=await s;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=Md(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let h=performance.now();try{let L=vr(d.doc,d.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(L.map(I=>[I.objectId,I])),this.groupedTablesByLabel=new Map(L.map(I=>[I.label,I])),this.groupedTableBySeatId=new Map(L.flatMap(I=>I.chairs.map(M=>[M.id,I]))),this.tableQuantities=new Map(L.map(I=>[I.label,I.mode==="whole"?I.capacity:I.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=L.reduce((I,M)=>I+Math.max(0,M.chairs.length-1),0)}catch(L){return this.emitError(L),null}this.expandedSeats=He(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let u=gd(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=u.labelToId,this.labelToSeat=u.labelToSeat,this.seatById=u.seatById,this.seatContext=u.seatContext,this.allIds=u.allIds;for(let L of this.groupedTablesByLabel.values()){let I=L.chairs[0];I&&(this.labelToId.set(L.label,I.id),this.labelToSeat.set(L.label,I))}o.normalizeBuyerModel=n(h);let m=d.event.currency??this.opts.currency;this.currency=m??"USD";let f=performance.now(),b=sd(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:m,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=n(i),this.opts.onSeatsRevealed?.()},onSelect:L=>{this.handleRendererSelect(L)},onDeselect:L=>{this.handleRendererDeselect(L)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(L,I)=>{this.opts.onHover?.(L),this.opts.onSeatHover&&this.opts.onSeatHover(L?this.describeSeat(L,I):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(L,I)=>this.previewSection(L,I),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:L=>this.opts.onSectionFocus?.(L==null||this.isSectionClosed(L)?null:this.sectionSummary(L)),onDeckTap:L=>this.handleDeckTap(L),onFps:this.opts.onFps});if(o.createRenderer=n(f),this.closed)return b.destroy(),null;this.renderer=b,this.viewportInsets&&b.setViewportInsets?.(this.viewportInsets),this.fitClearance>0&&b.setFitClearance?.(this.fitClearance);let p=null,g="free",y=[],S,x=await l;if(x.ok){let L=x.objects;this.hidden=new Set(L.hidden??[]),y=(L.closed??[]).filter(I=>typeof I=="string"),p=L.seats,g=L.default??"free",S=typeof L.fetchedAt=="number"?L.fetchedAt:void 0}if(o.loadStatuses=x.elapsed,this.closed)return b.destroy(),this.renderer=null,null;let w=performance.now();this.opts.categoryPriceRanges&&b.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),b.setChart(this.visibleDoc()),this.applyRowBandPreview(b),Id(b,d.doc,e.clientWidth),this.opts.colorblindSafe&&b.setColorblindSafe?.(!0),o.buildScene=n(w),this.closedSections=new Set(y);let v=performance.now();y.length&&b.setClosedSections?.(y),this.seatsBuilt=!0;let k=this.pendingSnapshot;this.pendingSnapshot=null;let P=Ud(k,p?{seats:p,default:g,fetchedAt:S}:null);P&&this.applySeatsMap(P.seats,P.default,P.source,P.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=n(v);let C=performance.now();b.forceDraw(),o.firstPaint=n(C);let T=performance.now();return x.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),o.startRealtime=n(T),o.controllerTotal=n(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,salesState:bn(d.event.status),eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:m,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],i=new Set;for(let o of this.renderer.getSelection()){let n=this.groupedTableBySeatId.get(o.id);n?i.has(n.label)||(i.add(n.label),e.push(this.toTableSeat(n))):e.push(this.toSeat(o))}return e}seatDetails(e){let i=this.seatById.get(e);return i?this.describeSeat(i):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let i=new Set;for(let o of e){let n=this.groupedTableBySeatId.get(o)??this.groupedTablesByLabel.get(o);if(n)n.chairs.forEach(r=>i.add(r.id)),this.hold_?.labels.includes(n.label)||(this.tableQuantities.set(n.label,n.mode==="whole"?n.capacity:n.minOccupancy),n.mode==="variable"&&this.confirmedVariableTables.delete(n.label));else{let r=this.seatById.has(o)?o:this.labelToId.get(o);r&&i.add(r)}}this.renderer?.deselect([...i]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let i=new Set(this.getSelection().map(s=>s.label)),o=new Set,n=[];for(let s of e){let a=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(a)this.tableTierResolution(a).kind==="invalid"?n.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let l=this.seatById.has(s)?s:this.labelToId.get(s);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?n.push(c.label):o.add(l)}}if(n.length&&this.emitError(new Ee(so(n))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let r=this.getSelection().filter(s=>!i.has(s.label));return r.length&&this.emitSelectionChange(),r}selectCategories(e){let i=new Set(e);return this.select([...this.seatById.values()].filter(o=>i.has(o.categoryKey)).map(o=>o.id))}deselectCategories(e){let i=new Set(e);this.deselect(this.getSelection().filter(o=>i.has(o.categoryKey)).map(o=>o.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(o=>typeof o=="string"&&!!o))],this.rebuildSelectableSeatIds();let i=this.renderer?.getSelection().filter(o=>!this.isSelectableByPolicy(o.id)).map(o=>o.id)??[];i.length&&this.deselect(i)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let i=this.getSelection(),o=e??i.reduce((n,r)=>n+(r.quantity??1),0);return Kd(i,o,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let i=new Set(e.getSelection().map(o=>o.id));return i.size>0&&ro(this.seatById.values(),o=>e.getStatus(o),i).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let i of this.selectableObjectRefs){let o=this.groupedTableBySeatId.get(i)??this.groupedTablesByLabel.get(i);if(o){o.chairs.forEach(r=>e.add(r.id));continue}let n=this.seatById.has(i)?i:this.labelToId.get(i);n&&e.add(n)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,i){let o=this.groupedTablesByLabel.get(e);if(!o)return!1;let n=o.mode==="whole"?o.capacity:Math.floor(i);if(!Number.isInteger(n)||n<o.minOccupancy||n>o.maxOccupancy)return!1;let r=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,n),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,i,o){let n=this.groupedTablesByLabel.get(e),r=this.hold_;if(!n||n.mode!=="variable"||!r?.labels.includes(e))return null;let s=Math.floor(i);if(!Number.isInteger(s)||s<n.minOccupancy||s>n.maxOccupancy)return null;if((r.items??[]).filter(d=>d.label!==e).reduce((d,h)=>d+(h.quantity??1),0)+s>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(r.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?s:d.quantity}));if(!l.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,l,o,r.holdId);return this.tableQuantities.set(e,s),this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}setNarrowLayout(e){this.narrowLayout!==e&&(this.narrowLayout=e,this.renderer&&this.applyRowBandPreview(this.renderer))}rowBandsWanted(){return ym&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(Sm||!this.narrowLayout)}applyRowBandPreview(e){if(!this.opts.sectionPreview)return;let i=this.rowBandsWanted();e.setRowBandPreview?.(i),i&&e.setSectionFocusDim?.(!1)}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,i)=>e+(i.quantity??1),0)}handleRendererSelect(e){let i=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(i?i.chairs.map(n=>n.id):[e.id]),this.emitSelectionChange();return}if((i?this.tableTierResolution(i):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(i?i.chairs.map(n=>n.id):[e.id]),this.emitError(new Ee(so([i?.label??e.label]))),this.emitSelectionChange();return}if(i){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(i.chairs.map(n=>n.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(i.chairs.map(n=>n.id)),this.opts.onSelect?.(i.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(i)),this.emitSelectionChange();return}if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect([e.id]),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.opts.onSelect?.(e),this.emitSelectionChange()}handleRendererDeselect(e){let i=this.groupedTableBySeatId.get(e.id),o=i?.label??e.label;if(this.opts.retapKeepsSelection&&!i&&(this.hold_?.labels.includes(o)||this.isSelectableByPolicy(e.id))){this.renderer?.select?.([e.id]),this.opts.onSeatRetap?.(this.toSeat(e));return}if(this.hold_?.labels.includes(o)){this.opts.onDeselect?.(i?{...e,label:o}:e);return}i?(this.renderer?.deselect(i.chairs.map(n=>n.id)),this.hold_?.labels.includes(i.label)||(this.tableQuantities.set(i.label,i.mode==="whole"?i.capacity:i.minOccupancy),i.mode==="variable"&&this.confirmedVariableTables.delete(i.label)),this.opts.onDeselect?.(i.chairs[0]??e)):this.opts.onDeselect?.(e),this.emitSelectionChange()}resetUnheldTableQuantities(){for(let e of this.groupedTablesByLabel.values())this.hold_?.labels.includes(e.label)||(this.tableQuantities.set(e.label,e.mode==="whole"?e.capacity:e.minOccupancy),e.mode==="variable"&&this.confirmedVariableTables.delete(e.label))}resetTableQuantitiesForLabels(e){for(let i of e){let o=this.groupedTablesByLabel.get(i);o&&(this.tableQuantities.set(i,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(i))}}tableQuantityRequest(e){if(e?.objectType!=="table")return{};if(e.bookingMode==="variable"&&!this.confirmedVariableTables.has(e.label))throw new Error("picker: confirm a variable table guest quantity before holding");return{quantity:e.quantity}}hold(e,i){return Rd(this,e,i)}resumeHold(e){return Ad(this,e)}extendHold(e){return Ed(this,e)}categoryAvailability(){return vd({seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,groupedTablesByLabel:this.groupedTablesByLabel,closedMembers:this.closedMemberIds(),statusOf:e=>this.getStatus(e),gaAreas:this.getGAAreas()})}closedMemberIds(){let e=new Set,i=this.renderer;if(!i||!this.closedSections.size)return e;for(let o of this.closedSections)for(let n of i.sectionMembers?.(o)??[])e.add(n);return e}getGAAreas(){let e=this.visibleDoc();return e?yd(e,this.currency,i=>this.statusOf(i)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Sd(this.getGAAreas(),this.gaSelected))}async holdGA(e,i,o={}){let n=this.visibleDoc();if(!n||!Number.isFinite(i)||i<1)return null;let r=kt(n).find(d=>d.id===e);if(!r)return null;let s=Zt(r).filter(d=>!this.hold_?.labels.includes(d)&&this.statusOf(d)==="free").slice(0,Math.floor(i));if(s.length!==Math.floor(i))return null;let a=new Map;for(let d of this.hold_?.items??[])a.set(d.label,{label:d.label,tierId:d.tierId,quantity:d.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let d of this.hold_.seats)a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{}});for(let d of this.getSelection())a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{},...this.tableQuantityRequest(d)});for(let d of s)a.set(d,{label:d,...o.tierId?{tierId:o.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,o.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}hasPremiumSeats(){for(let e of this.labelToSeat.values())if(e.commercial?.premium)return!0;return!1}getBestAvailableZones(){return Cd(this.visibleDoc())}pickPremiumBlock(e,i,o){return Pd({doc:this.visibleDoc(),qty:e,categoryKey:i,zoneId:o,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:n=>this.seatTierResolution(n).kind!=="invalid",statusOfLabel:n=>this.getStatus(this.labelToId.get(n)??"")??"free",isPremium:n=>!!this.labelToSeat.get(n)?.commercial?.premium})}async bestAvailable(e,i,o={}){let n=this.renderer;if(!n)return null;if(o.preferPremium){let r=this.pickPremiumBlock(e,i,o.zoneId);if(r){if(this.hold_&&!await this.release())return null;try{let s=r.map(d=>{let h=this.labelToSeat.get(d),u=h?this.toSeat(h):null;return{label:d,...u?.tierId?{tierId:u.tierId}:{}}}),a=await this.api.hold(this.key,s,o.ttlMs);n.clearSelection();let l=this.idsForLabels(r);l.length&&n.setStatus(l,"held"),this.setHold({holdId:a.holdId,labels:[...r],expiresAt:a.expiresAt,items:a.items});let c=r.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(s){let{status:a,reason:l}=bt(s);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),s}}}if(this.hold_&&!await this.release())return null;try{let r=await this.api.bestAvailable(this.key,e,i,o.zoneId,o.ttlMs);n.clearSelection();let s=this.idsForLabels(r.labels);s.length&&n.setStatus(s,"held"),this.setHold({holdId:r.holdId,labels:[...r.labels],expiresAt:r.expiresAt,items:r.items});let a=r.labels.map(l=>this.labelToSeat.get(l)).filter(l=>!!l).map(l=>this.toSeat(l));return this.opts.onSelectionChange?.(a),this.hold_}catch(r){let{status:s,reason:a}=bt(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,o){return Fd(this,e,i,o)}release(){return _d(this)}releaseLabels(e){return Bd(this,e)}releaseConfirmed(e,i){return Od(e,i)}setStatus(e,i){this.renderer?.setStatus(e,i)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let i=new Set(e.categories.filter(n=>n.notForSale).map(n=>n.key));if(!i.size)return[];let o=[];for(let[n,r]of this.seatById)i.has(r.categoryKey)&&o.push(n);return o}flashSeat(e,i){this.renderer?.flashSeat(e,i)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let i=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&i&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}setViewportInsets(e){this.viewportInsets=e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:null,this.renderer?.setViewportInsets?.(this.viewportInsets)}setFitClearance(e){this.fitClearance=Math.max(0,e||0),this.renderer?.setFitClearance?.(this.fitClearance)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}seatScreenRadius(){let e=this.renderer?.getCameraPose?.()?.scale??0;return li(this._doc?.theme?.seatScale)*te*e}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){cd(this.pickerFocusContext,e)}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}get pickerFocusContext(){let e=this;return{renderer:e.renderer,doc:e._doc,get accessFilter(){return e.accessFilter},set accessFilter(i){e.accessFilter=i},get accessStepAt(){return e.accessStepAt},set accessStepAt(i){e.accessStepAt=i},get bandReturnPose(){return e.bandReturnPose},set bandReturnPose(i){e.bandReturnPose=i},get bandReturnSection(){return e.bandReturnSection},set bandReturnSection(i){e.bandReturnSection=i},getActiveFloorId:()=>e.getActiveFloorId(),setFloor:i=>e.setFloor(i),sectionSummary:i=>e.sectionSummary(i),emitSectionFocus:i=>{e.opts.onSectionFocus?.(i)}}}focusAccessibilityFilter(e){return mn(this.pickerFocusContext,e)}accessibilitySpread(e){return dd(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return ud(this.pickerFocusContext,e)}accessibilityFilterDims(e){return fd(this.pickerFocusContext,e)}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let i=this.renderer;!i?.setActiveFloor||e===i.getActiveFloorId?.()&&!i.isFloorOverview?.()||(i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let i=this.renderer;!i?.setStacked||e===i.isStacked?.()||(i.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let i=this.renderer;!i?.setFloorOverview||e===i.isFloorOverview?.()||(i.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let i=this.renderer;i&&(i.setViewMode?.("flat"),i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor?.(e),this.resnapshot(),this.emitSelectionChange(),this.opts.onDeckTap?.(e))}setViewMode(e){this.renderer?.setViewMode?.(e)}getViewMode(){return this.renderer?.getViewMode?.()??"flat"}getRung(){return this.renderer?.getRung?.()??"seats"}getFocusedSection(){return this.renderer?.getFocusedSection?.()??null}seatsRevealed(){let e=this.renderer;return e?.seatsRevealed?e.seatsRevealed():this.getRung()==="seats"||!!this.getFocusedSection()}atVenueFit(){return this.renderer?.atVenueFit?.()}canZoomIn(){return this.renderer?.canZoomIn?.()}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){md(this.pickerFocusContext,e)}getViewport(){let e=this.renderer;return!e?.getVisibleWorldRect||!e.getWorldBounds?null:{visible:e.getVisibleWorldRect(),bounds:e.getWorldBounds()}}getMinimapSnapshot(){return this.renderer?.getMinimapSnapshot?.()??{sections:[],seats:[]}}panToWorld(e){this.renderer?.panToWorld?.(e)}clearSectionFocus(){this.renderer?.clearSectionFocus?.(),this.opts.onSectionFocus?.(null)}getRenderedQualityEvidence(){return this.renderer?.getRenderedQualityEvidence()??null}focusSection(e,i){this.handleSectionTap(e,i)}focusSeats(e,i){let o=this.renderer;if(!o?.focusSeats?.(e,i))return!1;let n=o.getFocusedSection?.()??null;return this.opts.onSectionFocus?.(n?this.sectionSummary(n):null),!0}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}previewSection(e,i){this.handleSectionTap(e,i)}handleSectionTap(e,i){if(!this.renderer)return;let o=this.isSectionClosed(e)?null:this.sectionSummary(e);hd(this.pickerFocusContext,e,o,i),this.opts.onSectionFocus?.(o)}sectionSummary(e){return!this.renderer||!this._doc?null:Xd({id:e,doc:this._doc,sectionMembers:i=>this.renderer?.sectionMembers?.(i)??[],statusOf:i=>this.renderer?.getStatus(i)??"free",seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,...this.accessFilter?{matchesAccessFilter:i=>Ie(i,this.accessFilter)}:{}})}clearConnectFallback(){this.connectFallback&&(clearTimeout(this.connectFallback),this.connectFallback=null)}destroy(){if(this.closed=!0,this.seatsBuilt=!1,this.pendingSnapshot=null,this.clearConnectFallback(),this.detachVisibility?.(),this.detachVisibility=null,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null),this.realtime){try{this.realtime.stop()}catch{}this.realtime=null}if(this.ws){try{this.ws.close()}catch{}this.ws=null}this.renderer?.destroy(),this.renderer=null}toSeat(e){let i=this.groupedTableBySeatId.get(e.id);if(i)return this.toTableSeat(i);let o=e.commercial?{commercial:e.commercial}:void 0,n=e.displayLabel?{displayLabel:e.displayLabel}:void 0,r=e.accessibility?.length?{accessibility:e.accessibility}:void 0,s=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,a=this.seatContext.get(e.id),l=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!l)return{id:e.id,label:e.label,...n,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...r,...s};let d=c.tier;return{id:e.id,label:e.label,...n,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...o,...r,...s}}toTableSeat(e){let i=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(s=>ci(this._doc,this.tableTierSeat(e),s.id).kind==="resolved"),n=this.tableTierResolution(e),r=n.kind==="resolved"?n.tier:void 0;return{id:i?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:i?this.seatContext.get(i.id)?.sectionLabel:void 0,rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:r?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:r?.id}:{},objectType:"table",bookingMode:e.mode,quantity:this.tableQuantities.get(e.label)??(e.mode==="whole"?e.capacity:e.minOccupancy),capacity:e.capacity,minOccupancy:e.minOccupancy,maxOccupancy:e.maxOccupancy,physicalSeatIds:e.chairs.map(s=>s.id)}}describeSeat(e,i){let o=this._doc?.categories.find(n=>n.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:o?.label??e.categoryKey,categoryColor:o?.color??"#6e7bff",status:this.renderer?.getStatus(e.id)??"free",mark:this.renderer?.getSeatMark?.(e.id)??null,...i?.interaction?{interaction:i.interaction}:{},...i?.unavailable?{unavailable:!0}:{},...i?.filteredOut?{filteredOut:!0}:{},currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(i=>i.key===e)?.price??0}tiersFor(e){let i=this._doc?.categories.find(o=>o.key===e)?.tiers;return i&&i.length?i:void 0}tiersForSeat(e){if(!this._doc)return;let i=br(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?ci(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(i=>i.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let i=e.chairs[0]?.id??"";return ci(this._doc,this.tableTierSeat(e),this.seatTiers.get(i))}setSeatTier(e,i){let o=this.seatById.get(e);if(!o)return;let n=this.tiersForSeat(o);if(n){if(i==null)this.seatTiers.delete(e);else if(n.some(r=>r.id===i))this.seatTiers.set(e,i);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let i=[];for(let o of e){let n=this.labelToSeat.get(o);n&&i.push(this.toSeat(n))}return i}emitSelectionChange(){let e=this.getSelection();this.opts.onSelectionChange?.(e),this.emitSelectionValidity(),this.emitOrphanHint()}emitSelectionValidity(){let e=this.getSelectionValidity();e&&(this.opts.onSelectionValidityChange?.(e),e.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(e.seats):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(e),this.lastSelectionValidity=e.isValid)}ticketIssue(e){if(!this._doc)return null;let i=e?this.seatsForLabels(e):this.getSelection();return yr(this._doc,i.map(o=>({label:o.label,...o.tierId?{tierId:o.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let i=this.ticketIssue();if(i){this.hintShown=!0,this.opts.onHint(i.code==="companion_pair_required"?B("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=this.selectionValidators.some(s=>s.type==="noOrphanSeats"),n=new Set(e.getSelection().map(s=>s.id));(o&&n.size?ro(this.seatById.values(),s=>e.getStatus(s),n):[]).length>0?(this.hintShown=!0,this.opts.onHint(B("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}setSectionFocusDim(e){this.renderer?.setSectionFocusDim?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){return Dd(this,e)}handle409Conflicts(e){Nd(this,e)}setHold(e,i="created"){Hd(this,e,i)}clearHold(){Gd(this)}expireActiveHold(){return Wd(this)}applySeatsMap(e,i="free",o="http",n){o==="socket"&&(this.socketVersion+=1);let r=this.renderer;if(!r||!this.seatsBuilt){this.pendingSnapshot=Yd(this.pendingSnapshot,{seats:e,default:i,source:o,...n===void 0?{}:{fetchedAt:n}});return}let s=this.seatsMapDiffers(e,i);this.lastSnapshotAt=n??Date.now(),this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=i;let a=Vi(i);this.allIds.length&&r.setStatus(this.allIds,a),r.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let l={free:[],held:[],booked:[],not_for_sale:[]};for(let[d,h]of Object.entries(e))l[Vi(h)].push(...this.idsForLabel(d));["free","held","booked","not_for_sale"].forEach(d=>{d!==a&&l[d].length&&r.setStatus(l[d],d)});let c=this.notForSaleCategorySeatIds();c.length&&r.setStatus(c,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:s})}snapshotIsFresh(e=5e3){return this.lastSnapshotAt>0&&Date.now()-this.lastSnapshotAt<e}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(i=>this.statusOf(i)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let i=this.socketVersion,o=await this.api.objects(this.key);this.socketVersion===i&&this.applySeatsMap(o.seats,o.default??"free","http",o.fetchedAt)},e)}resync(e){return e?.reason==="connect"&&this.snapshotIsFresh()?Promise.resolve():this.resnapshot()}applyProjection(e){this.applySeatsMap(e.exceptions,e.default,"socket")}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,i=kd({selection:this.getSelection().map(o=>o.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:o=>this.statusOf(o)});if(i.lost.length&&this.deselect(i.lost),i.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(i.lapsedLabels);let o=this.idsForLabels(i.lapsedLabels);o.length&&this.renderer?.deselect(o),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(i),i}getAccessNeeds(){return wd(this.seatById.values(),e=>this.getStatus(e)??"free")}attachVisibility(){this.detachVisibility||(this.detachVisibility=Ld(()=>{this.closed||this.refreshAvailability().then(()=>{this.closed||this.renderer?.forceDraw()})}))}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applyProjection(e),resync:e=>this.resync(e),onSections:(e,i)=>{let o=this.syncHidden(e),n=this.syncClosed(i);o&&this.resnapshot(),(o||n)&&this.opts.onStatusChange?.({changed:!0})}}}seatsMapDiffers(e,i){if(this.lastSnapshotAt===0||i!==this.liveDefault)return!0;let o=Object.entries(e);if(o.length!==this.liveStatuses.size)return!0;for(let[n,r]of o)if(this.liveStatuses.get(n)!==r)return!0;return!1}applyStatusChanges(e){this.socketVersion+=1;let i=this.renderer;if(!i)return;let o=e.some(s=>this.liveStatuses.get(s.label)!==s.status),n=new Map;for(let s of e){this.liveStatuses.set(s.label,s.status);let a=this.idsForLabel(s.label);if(!a.length)continue;let l=Vi(s.status);this.opts.flashOnLiveChange&&l!=="free"&&a.some(c=>(n.get(c)??i.getStatus(c))==="free")&&!this.hold_?.labels.includes(s.label)&&a.forEach(c=>i.flashSeat(c,l==="held"?"#f4b740":"#f43f5e"));for(let c of a)n.set(c,l)}let r=new Map;for(let[s,a]of n){let l=r.get(a);l||r.set(a,l=[]),l.push(s)}for(let[s,a]of r)i.setStatus(a,s);this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&i.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:o})}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let o=null;try{o=this.api.createRealtime(this.key,this.realtimeSink())}catch{o=null}if(o){this.realtime=o,o.start();return}}if(this.realtime)return;let i;try{let o=this.api.socketProtocols?.(this.key);i=o&&o.length?new WebSocket(e,o):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=i,i.onopen=()=>{if(this.attempt=0,!this.snapshotIsFresh()){this.resnapshot();return}this.clearConnectFallback(),this.connectFallback=setTimeout(()=>{this.connectFallback=null,this.resnapshot()},2500)},i.onmessage=o=>{this.clearConnectFallback();let n;try{n=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(!this.renderer||!n||typeof n!="object")return;let s=n;Array.isArray(s.hidden)&&this.syncHidden(s.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.({changed:!0})),Array.isArray(s.closed)&&this.syncClosed(s.closed)&&this.opts.onStatusChange?.({changed:!0}),s.type!=="hidden"&&(s.seats&&typeof s.seats=="object"?this.applySeatsMap(s.seats):Array.isArray(s.changes)&&this.applyStatusChanges(s.changes))},i.onclose=()=>{this.ws===i&&(this.ws=null),this.scheduleReconnect()},i.onerror=()=>{try{i.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),i=bd(e,{baseMs:1e3,maxMs:wm,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var km=5,xm=-1.1,yn=35;function Sn(t,e){let i=t-se,o=Math.atan2(km-i,e)*180/Math.PI,n=Math.atan2(xm-i,e)*180/Math.PI;return n<-yn&&(o+=-yn-n,n=-yn),{topPitch:o,basePitch:n}}var ne=2048,ke=1024,Yt=Rn,O=Math.PI*2,Lm=ke/180,St=t=>(t+180)/360*ne,$=t=>(90-t)/180*ke;function Jd(t){let e=2166136261;for(let i=0;i<t.length;i++)e^=t.charCodeAt(i),e=Math.imul(e,16777619);return e>>>0}function eh(t){let e=t>>>0;return()=>{e|=0,e=e+1831565813|0;let i=Math.imul(e^e>>>15,1|e);return i=i+Math.imul(i^i>>>7,61|i)^i,((i^i>>>14)>>>0)/4294967296}}var Xi=96,kn=360/Xi,Cm=.6,vn=[17,23,42];function wn(t,e,i=1){let o=Math.max(0,Math.min(.58,e)),n=Math.round(t[0]+(vn[0]-t[0])*o),r=Math.round(t[1]+(vn[1]-t[1])*o),s=Math.round(t[2]+(vn[2]-t[2])*o);return`rgba(${n},${r},${s},${i})`}function qd(t,e,i){return[Math.round(t[0]+(e[0]-t[0])*i),Math.round(t[1]+(e[1]-t[1])*i),Math.round(t[2]+(e[2]-t[2])*i)]}function ce(t,e,i){let o=(1-Math.abs(2*i-1))*e,n=(t%360+360)%360/60,r=o*(1-Math.abs(n%2-1)),s=0,a=0,l=0;n<1?[s,a,l]=[o,r,0]:n<2?[s,a,l]=[r,o,0]:n<3?[s,a,l]=[0,o,r]:n<4?[s,a,l]=[0,r,o]:n<5?[s,a,l]=[r,0,o]:[s,a,l]=[o,0,r];let c=i-o/2;return[Math.round((s+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var Zd=new Map;function jd(t){if(!t)return null;let e=Zd.get(t);if(e)return e;let i=2166136261;for(let r=0;r<t.length;r++)i^=t.charCodeAt(r),i=Math.imul(i,16777619);let o=(i>>>0)%360,n=ce(o,.3,.42);return Zd.set(t,n),n}function Pm(t,e,i,o){let n=new Array(Xi).fill(null),r=0,s=t.sectionId;for(let a of e){if(a.id===t.id)continue;let l=a.sectionId;if(!l||s&&l===s)continue;let c=a.x-t.x,d=a.y-t.y,h=Math.hypot(c,d)*Yt;if(h<1.5||h>95)continue;let u=a.eyeHeightM??se,m=u-o;Math.abs(m)>r&&(r=Math.abs(m));let f=Math.atan2(m,h)*180/Math.PI,b=Math.atan2(u-se-o,h)*180/Math.PI,g=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,y=Math.min(Xi-1,Math.max(0,Math.floor((g+180)/kn))),S=f>34&&h<16,x=n[y];x?(f>x.top&&(x.top=f),b<x.base&&(x.base=b),h<x.nearM&&(x.nearM=h,x.tint=jd(a.categoryKey)),x.overhead=x.overhead||S):n[y]={top:f,base:b,nearM:h,overhead:S,tint:jd(a.categoryKey)}}return{bins:n,maxDelta:r}}function Tm(t,e,i,o){for(let n=0;n<Xi;n++){let r=e[n];if(!r)continue;let s=-180+n*kn,a=i(s),l=i(s+kn);if(!(l>a))continue;let c=Math.min(72,r.top),d=Math.min(r.base,-4),h=o(c),u=o(d);if(u<=h)continue;let m=r.nearM/95,f=r.tint,b=f?qd([44,54,80],f,.34):[44,54,80],p=f?qd([24,30,48],f,.28):[24,30,48],g=t.createLinearGradient(0,h,0,u);g.addColorStop(0,wn(b,m)),g.addColorStop(.24,wn(p,m)),g.addColorStop(1,wn([10,13,22],m)),t.fillStyle=g,t.fillRect(a,h,l-a+1,u-h),t.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,t.fillRect(a,h,l-a+1,1.5);let S=Math.min(u,o(0))-h;if(S>8){let w=1-m*.4;for(let v=1;v<6;v++){let k=h+S*v/6;t.fillStyle=`rgba(0,0,0,${.16*w})`,t.fillRect(a,k,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*w})`,t.fillRect(a,k+1.5,l-a+1,1.2)}}if(r.overhead){let x=o(Math.min(86,c+12)),w=t.createLinearGradient(0,x,0,h);w.addColorStop(0,"rgba(3,4,8,0.9)"),w.addColorStop(1,"rgba(3,4,8,0)"),t.fillStyle=w,t.fillRect(a,x,l-a+1,h-x),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,h-1.5,l-a+1,1.5)}}}function Im(t,e,i){let n=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let g of i){a++,g.sectionId&&s.add(g.sectionId);let y=g.x-e.x,S=g.y-e.y,x=Math.hypot(y,S)*Yt;if(x<.5)continue;let w=Math.atan2(y,-S),v=Math.floor((w+Math.PI)/O*72);v<0?v=0:v>=72&&(v=71),n[v]=!0,x<r[v]&&(r[v]=x)}let l=0,c=[];for(let g=0;g<72;g++)n[g]&&(l++,c.push(r[g]));let d=l/72*360;c.sort((g,y)=>g-y);let h=c.length?c[c.length>>1]:0,u=c.length?c[Math.floor(c.length*.15)]??h:0,m=c.length?c[Math.floor(c.length*.85)]??h:0,f=u>.5?m/u:1,b=Jd(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return d>=300&&h>11&&f>1.35?p="sport":d>=285?p="arena":p="proscenium",{mode:p,seed:b,voidRadiusM:h,aspect:f}}var Mm=5;function Rm(t,e,i){switch(i){case 1:t.beginPath(),t.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,O),t.fill();break;case 2:t.beginPath(),t.ellipse(0,-e*1.02,e*.42,e*.42,0,0,O),t.fill(),t.beginPath(),t.ellipse(0,-e*.2,e*.98,e*1.02,0,0,O),t.fill();break;case 3:t.beginPath(),t.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,O),t.fill(),t.beginPath(),t.ellipse(0,-e*.52,e*1.22,e*.24,0,0,O),t.fill();break;case 4:t.beginPath(),t.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,O),t.fill(),t.beginPath(),t.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,O),t.fill(),t.beginPath(),t.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,O),t.fill();break;default:break}}function Am(t,e,i,o,n){let r=o*.44,s=o*n.shoulderK,a=o*.66,l=o*1.68,c=o*5.4,d=`rgba(${n.clothing[0]},${n.clothing[1]},${n.clothing[2]},${n.alpha})`,h=`rgba(${n.tone[0]},${n.tone[1]},${n.tone[2]},${n.alpha})`;t.save(),t.translate(e,i);let u=n.lean*o;t.fillStyle=d,t.beginPath(),t.moveTo(-r,a),t.quadraticCurveTo(-r*1.18,l-u-o*.6,-s,l-u),t.quadraticCurveTo(-s*1.05,l+o*1.2,-s*.94,c),t.lineTo(s*.94,c),t.quadraticCurveTo(s*1.05,l+o*1.2,s,l+u),t.quadraticCurveTo(r*1.18,l+u-o*.6,r,a),t.closePath(),t.fill(),t.fillStyle=h,t.fillRect(-r*.82,o*.5,r*1.64,o*.9),t.save(),t.rotate(n.tilt),t.translate(n.turn*o,0),t.fillStyle=h,o>=18?(t.beginPath(),t.moveTo(-o*.9,-o*.15),t.quadraticCurveTo(-o*.96,-o*1.12,0,-o*1.06),t.quadraticCurveTo(o*.96,-o*1.12,o*.9,-o*.15),t.quadraticCurveTo(o*.86,o*.55,o*.36,o*.98),t.quadraticCurveTo(0,o*1.14,-o*.36,o*.98),t.quadraticCurveTo(-o*.86,o*.55,-o*.9,-o*.15),t.closePath(),t.fill(),o>=22&&(t.beginPath(),t.ellipse(-o*.9,o*.18,o*.13,o*.22,0,0,O),t.ellipse(o*.9,o*.18,o*.13,o*.22,0,0,O),t.fill())):(t.beginPath(),t.ellipse(0,0,o*.9,o*1.06,0,0,O),t.fill()),Rm(t,o,n.hair),n.rim>.01&&(t.strokeStyle=`rgba(245,205,150,${(.5*n.rim).toFixed(3)})`,t.lineWidth=Math.max(1,o*.14),t.beginPath(),t.ellipse(0,-o*.06,o*.86,o*1,0,Math.PI*1.12,Math.PI*1.9),t.stroke()),t.restore(),n.rim>.01&&(t.strokeStyle=`rgba(240,200,150,${(.28*n.rim).toFixed(3)})`,t.lineWidth=Math.max(1,o*.12),t.beginPath(),t.moveTo(-s*.8,l-o*.05),t.quadraticCurveTo(-r,l-o*.75,0,l-o*.82),t.quadraticCurveTo(r,l-o*.75,s*.8,l-o*.05),t.stroke()),t.restore()}function Em(t,e,i,o,n,r,s){t.fillStyle=`rgba(${n[0]},${n[1]},${n[2]},${s})`,t.beginPath(),t.moveTo(e-o*1.72,i+o*4),t.quadraticCurveTo(e-o*1.78,i+o*1.55,e-o*.46,i+o*1.02),t.lineTo(e-o*.4,i+o*.62),t.lineTo(e+o*.4,i+o*.62),t.lineTo(e+o*.46,i+o*1.02),t.quadraticCurveTo(e+o*1.78,i+o*1.55,e+o*1.72,i+o*4),t.closePath(),t.fill(),t.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${s})`,t.beginPath(),t.ellipse(e,i,o*.9,o*1.05,0,0,O),t.fill()}function Ln(t,e,i,o,n){let r=o*.1,s=i-o*.9,a=i-o*.74,l=i-o*.46,c=o*.13,d=o*.09,h=`rgba(${n.tone[0]},${n.tone[1]},${n.tone[2]},${n.alpha})`,u=t.createRadialGradient(e,i,1,e,i,o*.24);u.addColorStop(0,"rgba(0,0,0,0.4)"),u.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.scale(1,.28),t.fillStyle=u,t.beginPath(),t.ellipse(e,i/.28,o*.24,o*.24,0,0,O),t.fill(),t.restore(),t.fillStyle=h,t.beginPath(),t.moveTo(e-d,l),t.lineTo(e-d*.7,i),t.lineTo(e-d*.1,i),t.lineTo(e-d*.1,l+o*.02),t.lineTo(e+d*.1,l+o*.02),t.lineTo(e+d*.1,i),t.lineTo(e+d*.7,i),t.lineTo(e+d,l),t.closePath(),t.fill(),t.beginPath(),t.moveTo(e-c,a),t.quadraticCurveTo(e-c*.9,l-o*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-o*.12,e+c,a),t.quadraticCurveTo(e,a-o*.05,e-c,a),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=h,t.lineWidth=o*.055;let m=a+o*.02;n.pose===1?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e-c*1.5,i-o*1.02),t.moveTo(e+c*.8,m),t.lineTo(e+c*1.5,i-o*1.02),t.stroke()):n.pose===2?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e+d*1.4,l-o*.02),t.moveTo(e+c*.8,m),t.lineTo(e-d*.4,l-o*.06),t.stroke(),t.fillStyle=h,t.beginPath(),t.ellipse(e+d*1.5,l-o*.04,o*.07,o*.09,-.5,0,O),t.fill()):n.pose===3?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,m),t.lineTo(e+c*1.1,l),t.stroke(),t.lineWidth=o*.02,t.beginPath(),t.moveTo(e-c*.2,s+r*.9),t.lineTo(e-c*.2,i-o*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,m),t.lineTo(e-c*.95,l+o*.02),t.moveTo(e+c*.85,m),t.lineTo(e+c*.95,l+o*.02),t.stroke()),t.fillStyle=h,t.fillRect(e-r*.34,s+r*.6,r*.68,r*.9),t.beginPath(),t.ellipse(e,s,r*.86,r*1.05,0,0,O),t.fill(),n.rimStrength>.01&&(t.strokeStyle=`rgba(${n.rim[0]},${n.rim[1]},${n.rim[2]},${(.6*n.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,o*.02),t.beginPath(),t.moveTo(e-c,a),t.lineTo(e-r*.6,s+r*.4),t.moveTo(e-r*.7,s),t.ellipse(e,s,r*.84,r*1.02,0,Math.PI*1.05,Math.PI*1.55),t.stroke())}function Yi(t,e,i,o,n,r,s,a,l){t.save(),t.globalCompositeOperation="lighter";let c=t.createLinearGradient(0,i,0,n);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),t.fillStyle=c,t.beginPath(),t.moveTo(e-r,i),t.lineTo(o-s,n),t.lineTo(o+s,n),t.lineTo(e+r,i),t.closePath(),t.fill(),t.restore()}function Cn(t,e,i,o,n){let r=t.createRadialGradient(e,i,0,e,i,o*3);r.addColorStop(0,`rgba(${n},0.9)`),r.addColorStop(.4,`rgba(${n},0.35)`),r.addColorStop(1,`rgba(${n},0)`),t.fillStyle=r,t.beginPath(),t.arc(e,i,o*3,0,O),t.fill(),t.fillStyle=`rgba(${n},1)`,t.beginPath(),t.arc(e,i,o,0,O),t.fill()}function _L(t,e,i){let o=document.createElement("canvas");o.width=ne,o.height=ke;let n=o.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.hypot(r,s),l=Math.max(2,a*Yt),c=t.eyeHeightM??se,d=Im(t,e,i),h=eh(d.seed),u=210+h()*150,m=ce(220+(h()-.5)*60,.55,.82),f=`${m[0]},${m[1]},${m[2]}`,b=n.createLinearGradient(0,0,0,ke);b.addColorStop(0,"#080b12"),b.addColorStop(.42,"#12182c"),b.addColorStop(.5,"#1c2440"),b.addColorStop(.56,"#151b2c"),b.addColorStop(.78,"#171e30"),b.addColorStop(1,"#131829"),n.fillStyle=b,n.fillRect(0,0,ne,ke);let p=n.createLinearGradient(0,$(-6),0,ke);p.addColorStop(0,"rgba(30, 37, 56, 0)"),p.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),p.addColorStop(1,"rgba(22, 28, 44, 0.12)"),n.fillStyle=p,n.fillRect(0,$(-6),ne,ke-$(-6));let g=Math.atan2(r,-s),y=Pm(t,i,g,c),S=y.maxDelta>=Cm;S&&Tm(n,y.bins,St,$);let x=Math.max(.3,Math.min(1,1-(l-6)/60)),w=Sn(c,l),v=Math.min(80,Math.atan2(4,l)*180/Math.PI),k=Math.min(45,w.topPitch),P=w.basePitch;d.mode==="sport"?Bm(n,l,c,d,x,u,f,h):d.mode==="arena"?_m(n,l,c,d,x,f,h):Fm(n,v,k,P,x,u,f,h);let C=d.mode==="sport"?34:24+Math.floor(h()*8);n.fillStyle=`rgba(${f},0.8)`;for(let L=0;L<C;L++){let I=(L+.5)/C*ne,M=$(d.mode==="sport"?58:54+L*7%3*6);n.beginPath(),n.arc(I,M,d.mode==="sport"?2.6:3.2,0,O),n.fill()}Om(n,t,i,e,g,c,r,s,S,d);let T=n.createLinearGradient(0,0,0,ke);return T.addColorStop(0,"rgba(0,0,0,0.85)"),T.addColorStop(.12,"rgba(0,0,0,0)"),T.addColorStop(.9,"rgba(0,0,0,0)"),T.addColorStop(1,"rgba(0,0,0,0.55)"),n.fillStyle=T,n.fillRect(0,0,ne,ke),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function Fm(t,e,i,o,n,r,s,a){let l=St(-e),c=St(e),d=$(i),h=$(o),u=c-l,m=h-d,f=$(Math.min(50,i+10)),b=u*(1.1+(1-n)*.5),p=t.createRadialGradient(ne/2,(d+h)/2,8,ne/2,(d+h)/2,b);p.addColorStop(0,"rgba(255, 214, 150, 0.34)"),p.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),p.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),p.addColorStop(1,"rgba(99, 102, 241, 0)"),t.fillStyle=p,t.fillRect(l-u*.6,d-m*1.2,u*2.2,m*3.4);let g=ce(r,.62,.55),y=ce(r+40,.7,.5),S=ce(r+70,.78,.52);t.save(),t.beginPath(),t.rect(l,d,u,m),t.clip();let x=t.createLinearGradient(0,d,0,h);x.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),x.addColorStop(.5,`rgb(${y[0]},${y[1]},${y[2]})`),x.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=x,t.fillRect(l,d,u,m),t.globalAlpha=1;let w=t.createRadialGradient(ne/2,(d+h)/2,u*.12,ne/2,(d+h)/2,u*.62);w.addColorStop(0,"rgba(6,8,14,0)"),w.addColorStop(.7,"rgba(6,8,14,0.15)"),w.addColorStop(1,"rgba(5,6,11,0.92)"),t.fillStyle=w,t.fillRect(l,d,u,m),t.restore();let v=3+Math.floor(a()*3),k=m*.46,P=h-m*.08;for(let E=0;E<v;E++){let F=(E+1)/(v+1),H=l+u*(.22+F*.56+(a()-.5)*.06);Ln(t,H,P,k*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:ce(r+20,.5,.7),rimStrength:.7})}t.fillStyle="#05070d",t.fillRect(l-u*.5,f,u*.5,h-f),t.fillRect(c,f,u*.5,h-f);let C=u*.055+3,T=C*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,h),t.lineTo(l-C,h),t.lineTo(l-T,f),t.lineTo(l+u*.012,f),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,h),t.lineTo(c+C,h),t.lineTo(c+T,f),t.lineTo(c-u*.012,f),t.closePath(),t.fill(),t.fillRect(l-T,f,u+T*2,(h-f)*.12);let L=m*.14,I=f+(h-f)*.12;t.fillStyle="rgba(4,6,12,0.96)";let M=7;t.beginPath(),t.moveTo(l-T,I);for(let E=0;E<=M;E++){let F=l-T+(u+T*2)*E/M;t.quadraticCurveTo(F-(u+T*2)/M/2,I+L,F,I)}t.lineTo(c+T,I),t.lineTo(c+T,f),t.lineTo(l-T,f),t.closePath(),t.fill(),t.fillStyle=`rgba(${s},0.12)`,t.fillRect(l-1.5,I,1.5,h-I),t.fillRect(c,I,1.5,h-I),t.fillStyle="#0b0f18",t.fillRect(l-C,h-m*.05,u+C*2,m*.05+3);let R=t.createLinearGradient(0,h-m*.05,0,h+m*.12);R.addColorStop(0,`rgba(255,206,140,${(.5*n).toFixed(3)})`),R.addColorStop(1,"rgba(255,206,140,0)"),t.fillStyle=R,t.fillRect(l-C,h-m*.05,u+C*2,m*.2);let A=3+Math.floor(a()*2);for(let E=0;E<A;E++){let F=(E+1)/(A+1),H=l+u*(F+(a()-.5)*.08),G=$(Math.min(62,i+26)),Q=(a()-.5)*u*.16;Yi(t,H,G,H+Q,h,4,u*.09,s,.16*(.7+n*.5)),Cn(t,H,G,2.4,s)}}function _m(t,e,i,o,n,r,s){let a=Math.min(e*.6,Math.max(3,o.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=ne/2,d=1.2,h=Math.max(e*.45,e-a),u=e+a,m=Math.atan2(d-i,h)*180/Math.PI,f=Math.atan2(d-i,u)*180/Math.PI,b=Math.atan2(-i,h)*180/Math.PI,p=$(m),g=$(f),y=$(b),S=St(l)-c,x=Math.max(6,(p-g)/2),w=(p+g)/2,v=t.createRadialGradient(c,y,4,c,y,S*2.6);v.addColorStop(0,`rgba(255,206,150,${(.2*n).toFixed(3)})`),v.addColorStop(.5,"rgba(150,140,190,0.08)"),v.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=v,t.fillRect(c-S*2.6,g-x,S*5.2,y-g+x+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,w),t.ellipse(c,w,S,x,0,Math.PI,0,!1),t.lineTo(c+S,y),t.ellipse(c,y,S,x,0,0,Math.PI,!1),t.closePath(),t.fill();let k=t.createLinearGradient(0,w,0,y);k.addColorStop(0,`rgba(${r},0.14)`),k.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=k,t.fillRect(c-S,w,S*2,y-w);let P=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],C=P[Math.floor(s()*P.length)],T=s()<.5?-1:1,L=X=>c+X.u*T*S*.84,I=X=>w+X.v*x*.8,M=C.find(X=>X.lead)??C[0],R=L(M),A=t.createLinearGradient(0,w-x,0,w+x);A.addColorStop(0,"#3d4a72"),A.addColorStop(1,"#232b47"),t.fillStyle=A,t.beginPath(),t.ellipse(c,w,S,x,0,0,O),t.fill();let E=t.createRadialGradient(R,w,2,R,w,S);E.addColorStop(0,`rgba(255,214,160,${(.5*n).toFixed(3)})`),E.addColorStop(1,"rgba(255,214,160,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=E,t.beginPath(),t.ellipse(c,w,S,x,0,0,O),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,w,S,x,0,0,O),t.stroke();let F=Math.max(24,(y-g)*1.3),H=C.length>=3?3:2;for(let X=0;X<H;X++){let xe=(-.62+X*.52+(s()-.5)*.12)*-T,Ne=c+xe*S*.7,vt=w-x*(.45+s()*.18),it=S*(.07+s()*.04),Qi=F*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Ne-it/2,vt-Qi,it,Qi),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Ne-it/2,vt-Qi,it,1.5)}if(C.length>=3){let X=c-M.u*T*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(X,w-x*.34,S*.08,x*.1,0,0,O),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let X of[...C].sort((xe,Ne)=>xe.v-Ne.v)){let xe=.82+(X.v+1)*.14;Ln(t,L(X),I(X),F*xe*(X.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:X.pose,rim:ce(40,.72,.8),rimStrength:X.lead?1.4:.9})}let G=$(Math.min(60,f+34)),Q=x*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,G,S*1.15,Q,0,0,O),t.stroke();let N=4+Math.floor(s()*3);for(let X=0;X<N;X++){let xe=X/N*O,Ne=c+Math.cos(xe)*S*1.15,vt=G+Math.sin(xe)*Q;if(Math.sin(xe)>-.2){let it=c+(s()-.5)*S*.8;Yi(t,Ne,vt,it,w,3,S*.32,r,.2*(.7+n*.4))}Cn(t,Ne,vt,3,r)}let _=$(Math.min(52,f+24)),W=Math.max(60,S*.4),re=Math.max(24,W*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-W*.3,_-re/2),t.lineTo(c-W*.16,_-re*2.2),t.moveTo(c+W*.3,_-re/2),t.lineTo(c+W*.16,_-re*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-W/2,_-re/2,W,re);let $i=t.createLinearGradient(0,_-re*.3,0,_+re*.42);$i.addColorStop(0,`rgba(${r},0.5)`),$i.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=$i,t.fillRect(c-W*.42,_-re*.3,W*.84,re*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-W/2,_+re/2-2,W,2);let qi=t.createRadialGradient(c,_,4,c,_,W*1.1);qi.addColorStop(0,`rgba(${r},0.2)`),qi.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=qi,t.fillRect(c-W*1.1,_-W*.8,W*2.2,W*1.6);let Zi=t.createRadialGradient(c,(G+w)/2,6,c,(G+w)/2,S*1.5);Zi.addColorStop(0,`rgba(${r},${(.1*(.6+n*.5)).toFixed(3)})`),Zi.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=Zi,t.fillRect(c-S*1.5,G-40,S*3,w-G+80),t.restore();let ih=c+Math.sign(R-c||1)*S*.5;Yi(t,ih,G-Q*.4,R,I(M),2.5,S*.16,"255,224,178",.42*(.7+n*.4));let ji=t.createRadialGradient(R,I(M),1,R,I(M),S*.2);ji.addColorStop(0,`rgba(255,228,185,${(.4*n).toFixed(3)})`),ji.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=ji,t.beginPath(),t.ellipse(R,I(M),S*.2,x*.24,0,0,O),t.fill(),t.restore()}function Bm(t,e,i,o,n,r,s,a){let l=ne/2,c=Math.max(10,o.voidRadiusM),d=Math.max(2,e-c),h=e+c,u=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),m=Math.atan2(-i,d)*180/Math.PI,f=Math.atan2(-i,h)*180/Math.PI,b=$(m),p=$(f),g=St(u)-l,y=(b+p)/2,S=Math.max(10,(b-p)/2),x=t.createRadialGradient(l,y,4,l,y,g);x.addColorStop(0,"#e8f0fb"),x.addColorStop(.7,"#b9c9e2"),x.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,y,g,S,0,0,O),t.clip(),t.fillStyle=x,t.fillRect(l-g,y-S,g*2,S*2),t.strokeStyle="rgba(90,120,170,0.5)",t.lineWidth=3,t.beginPath(),t.moveTo(l,y-S),t.lineTo(l,y+S),t.moveTo(l-g*.5,y-S),t.lineTo(l-g*.5,y+S),t.moveTo(l+g*.5,y-S),t.lineTo(l+g*.5,y+S),t.stroke(),t.strokeStyle="rgba(180,90,110,0.45)",t.beginPath(),t.ellipse(l,y,S*.9,S*.5,0,0,O),t.stroke(),t.restore(),t.strokeStyle="rgba(210,225,245,0.6)",t.lineWidth=2.5,t.beginPath(),t.ellipse(l,y,g,S,0,0,O),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let L=0;L<5;L++){let I=l+(a()-.5)*g*1.4,M=y+(a()-.5)*S*1.1,R=Math.max(2,S*.06);t.beginPath(),t.ellipse(I,M,R*.6,R,0,0,O),t.fill()}let w=t.createRadialGradient(l,y,4,l,y,g*1.4);w.addColorStop(0,"rgba(200,220,255,0.12)"),w.addColorStop(1,"rgba(200,220,255,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=w,t.fillRect(l-g*1.4,p-S,g*2.8,b-p+S*2),t.restore();let v=$(Math.min(66,f+60)),k=Math.max(80,g*.7),P=k*.5,C=t.createRadialGradient(l,v,4,l,v,k*1.6);C.addColorStop(0,`rgba(${s},0.3)`),C.addColorStop(1,`rgba(${s},0)`),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=C,t.fillRect(l-k*1.6,v-k*1.2,k*3.2,k*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-k/2,v-P/2),t.lineTo(l+k/2,v-P/2),t.lineTo(l+k*.6,v),t.lineTo(l+k/2,v+P/2),t.lineTo(l-k/2,v+P/2),t.lineTo(l-k*.6,v),t.closePath(),t.fill();let T=r;for(let L=0;L<3;L++){let I=ce(T+L*30,.5,.5);t.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},0.75)`;let M=k*.26;t.fillRect(l-k*.42+L*(M+k*.06),v-P*.32,M,P*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let L=0;L<8;L++){let I=l-k*.6+k*1.2*L/7;t.beginPath(),t.arc(I,v+P*.62,2.4,0,O),t.fill()}}function Om(t,e,i,o,n,r,s,a,l,c){let d=e.sectionId,h=!1,u=[];for(let b of i){if(b.id===e.id)continue;let p=b.x-e.x,g=b.y-e.y,y=Math.hypot(p,g)*Yt;if(d&&b.sectionId===d&&y<3&&p*s+g*a>0&&(h=!0),y<.3||y>32)continue;let x=((Math.atan2(p,-g)-n)*180/Math.PI+540)%360-180,w=l?(b.eyeHeightM??se)-r:0,v=Math.atan2(w-.28,y)*180/Math.PI;if(v>10&&y>5)continue;let k=0;for(let T=0;T<b.id.length;T++)k=k*31+b.id.charCodeAt(T)&65535;let P=.9+(k&15)/40,C=Math.min(78,Math.atan2(.16,y)*180/Math.PI*Lm*P);C<1.2||u.push({hx:St(x),hy:$(v),r:C,d:y,hash:k})}u.sort((b,p)=>p.d-b.d);let m=[];{let b=[...u].sort((y,S)=>y.hy-S.hy),p=[],g=()=>{if(!p.length)return;let y=p.reduce((w,v)=>w+v.d,0)/p.length,S=p.reduce((w,v)=>w+v.hy,0)/p.length,x=p.reduce((w,v)=>w+v.r,0)/p.length;m.push({figs:p.sort((w,v)=>v.d-w.d),d:y,hy:S,r:x}),p=[]};for(let y of b){let S=p[p.length-1];S&&Math.abs(y.hy-S.hy)>Math.max(5,(S.r+y.r)/2*1.7)&&g(),p.push(y)}g()}m.sort((b,p)=>p.d-b.d);let f=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let b of m){if(b.figs.length>=3&&b.r>=1.6&&b.r<26){let p=[],g=[...b.figs].sort((x,w)=>x.hx-w.hx),y=[];for(let x of g){let w=y[y.length-1];w&&x.hx-w.hx>Math.max(14,x.r*7)&&(y.length>=3&&p.push(y),y=[]),y.push(x)}y.length>=3&&p.push(y);let S=Math.min(.42,.5*(1-b.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let x of p){let w=x[0].hx-b.r*1.6,v=x[x.length-1].hx+b.r*1.6;t.beginPath(),t.roundRect(w,b.hy+b.r*.8,v-w,b.r*2.4,b.r*.8),t.fill()}}}for(let p of b.figs){let g=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),y=Math.round((1-Math.min(1,p.d/16))*10),S=[14+(p.hash>>4&6)+y,17+(p.hash>>4&6)+y,25+(p.hash>>4&6)+y],x=f[p.hash%f.length],w=[x[0]+y,x[1]+y,x[2]+y];if(p.r>=13){let v=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;Am(t,p.hx,p.hy,p.r,{tone:S,clothing:w,alpha:g,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%Mm,rim:v,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?Em(t,p.hx,p.hy,p.r,w,S,g):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,t.beginPath(),t.arc(p.hx,p.hy,p.r,0,O),t.fill(),t.beginPath(),t.ellipse(p.hx,p.hy+p.r*1.4,p.r*1.85,p.r*.95,0,Math.PI,0,!0),t.fill())}}if(h){let b=$(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,b,ne,ke-b),t.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let g=0;g<p;g++){let y=(g+.5)/p*ne;t.beginPath(),t.ellipse(y,b+6,ne/p*.42,22,0,Math.PI,0,!0),t.fill()}}}var he=480,yt=270,xn=50,tt=30,Qd=t=>(t+xn)/(2*xn)*he,Xt=t=>(tt-t)/(2*tt)*yt;function BL(t,e,i){let o=document.createElement("canvas");o.width=he,o.height=yt;let n=o.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*Yt),l=eh(Jd(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=ce(220+(l()-.5)*60,.55,.82),h=`${d[0]},${d[1]},${d[2]}`,u=n.createLinearGradient(0,0,0,yt);u.addColorStop(0,"#080b12"),u.addColorStop(.44,"#151c32"),u.addColorStop(.5,"#1d2644"),u.addColorStop(.58,"#161c2e"),u.addColorStop(1,"#131829"),n.fillStyle=u,n.fillRect(0,0,he,yt);let m=t.eyeHeightM??se,f=Sn(m,a),b=Math.min(xn-2,Math.atan2(4,a)*180/Math.PI),p=Math.min(tt-2,f.topPitch),g=Math.max(-tt+2,f.basePitch),y=Qd(-b),S=Qd(b),x=Xt(p),w=Xt(g),v=S-y,k=w-x,P=Math.max(.35,Math.min(1,1-(a-6)/60)),C=Xt(Math.min(tt-1,p+8)),T=n.createRadialGradient(he/2,(x+w)/2,4,he/2,(x+w)/2,v*1.15);T.addColorStop(0,"rgba(255,214,150,0.34)"),T.addColorStop(.28,"rgba(150,150,230,0.3)"),T.addColorStop(.6,"rgba(99,102,241,0.12)"),T.addColorStop(1,"rgba(99,102,241,0)"),n.fillStyle=T,n.fillRect(y-v*.6,x-k*1.2,v*2.2,k*3.4);let L=ce(c,.62,.55),I=ce(c+40,.7,.5),M=ce(c+70,.78,.52);n.save(),n.beginPath(),n.rect(y,x,v,k),n.clip();let R=n.createLinearGradient(0,x,0,w);R.addColorStop(0,`rgb(${L[0]},${L[1]},${L[2]})`),R.addColorStop(.5,`rgb(${I[0]},${I[1]},${I[2]})`),R.addColorStop(1,`rgb(${M[0]},${M[1]},${M[2]})`),n.globalAlpha=.8,n.fillStyle=R,n.fillRect(y,x,v,k),n.globalAlpha=1;let A=n.createRadialGradient(he/2,(x+w)/2,v*.12,he/2,(x+w)/2,v*.6);A.addColorStop(0,"rgba(6,8,14,0)"),A.addColorStop(.7,"rgba(6,8,14,0.15)"),A.addColorStop(1,"rgba(5,6,11,0.9)"),n.fillStyle=A,n.fillRect(y,x,v,k),n.restore();let E=3,F=w-k*.08;for(let N=0;N<E;N++){let _=(N+1)/(E+1);Ln(n,y+v*(.24+_*.52),F,k*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:ce(c+20,.5,.7),rimStrength:.7})}n.fillStyle="#05070d",n.fillRect(y-v*.5,C,v*.5,w-C),n.fillRect(S,C,v*.5,w-C);let H=v*.05+2,G=H*1.35;n.fillStyle="#03050a",n.beginPath(),n.moveTo(y,w),n.lineTo(y-H,w),n.lineTo(y-G,C),n.lineTo(y+v*.012,C),n.closePath(),n.fill(),n.beginPath(),n.moveTo(S,w),n.lineTo(S+H,w),n.lineTo(S+G,C),n.lineTo(S-v*.012,C),n.closePath(),n.fill(),n.fillRect(y-G,C,v+G*2,(w-C)*.13),n.fillStyle=`rgba(${h},0.12)`,n.fillRect(y-1.2,C,1.2,w-C),n.fillRect(S,C,1.2,w-C),n.fillStyle="#0b0f18",n.fillRect(y-H,w-k*.05,v+H*2,k*.05+2);let Q=n.createLinearGradient(0,w-k*.05,0,w+k*.14);Q.addColorStop(0,`rgba(255,206,140,${(.5*P).toFixed(3)})`),Q.addColorStop(1,"rgba(255,206,140,0)"),n.fillStyle=Q,n.fillRect(y-H,w-k*.05,v+H*2,k*.22);for(let N=0;N<3;N++){let _=(N+1)/4,W=y+v*_,re=Xt(Math.min(tt-1,p+20));Yi(n,W,re,W+(l()-.5)*v*.14,w,3,v*.09,h,.17*P),Cn(n,W,re,1.8,h)}n.fillStyle=`rgba(${h},0.75)`;for(let N=0;N<8;N++)n.beginPath(),n.arc((N+.5)/8*he,Xt(tt-4-N%2*3),2.2,0,O),n.fill();n.fillStyle="rgba(10,13,20,0.9)",n.fillRect(0,yt-26,he,26),n.fillStyle="rgba(30,37,54,0.9)";for(let N=0;N<9;N++){let _=N*(he/9)+he/18;n.beginPath(),n.ellipse(_,yt-22,he/9*.4,15,0,Math.PI,0,!0),n.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var th=new Set(["en"]),Ui=new Map;async function Dm(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(wr(`i18n/${t}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-GGAKX22E.js"),i=e[t];return i?await i():null}async function HL(t,e){let i=Ns(t,e);if(i==="en"||th.has(i))return lt(i),i;if(!Ds.includes(i))return lt("en"),"en";try{let o=Ui.get(i);o||(o=Dm(i),Ui.set(i,o));let n=await o;return Ui.delete(i),n?(lt(i,n),th.add(i),i):(lt("en"),"en")}catch{return Ui.delete(i),lt("en"),"en"}}export{Wm as ACCESSIBILITY_RING_COLOR,Tn as ACCESSIBILITY_TYPES,Ig as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,Tg as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,Hm as CHART_STORAGE_KEY,ub as CURRENCY_CHOICES,hb as DEFAULT_CURRENCY,Zm as DEFAULT_EVENT_INVENTORY_LIMIT,Bx as EMPTY_AVAILABILITY_REFRESH,eg as EVENT_CONFIGURATION_EXPORT_SCHEMA,Jm as EVENT_CONFIGURATION_SCHEMA,xg as FLOOR_STACK_GAP_RATIO,Pg as FLOOR_STACK_MIN_SURFACE_PX,Rg as GA_UNIT_LABEL_PREFIX,_x as HOLD_CLOCK_SKEW_MS,ao as LABEL_FADE_MS,Ym as LABEL_STYLE_MAX_SIZE,Xm as LABEL_STYLE_MIN_SIZE,jm as LARGE_VENUE_INVENTORY_MODULE,Ug as LEGIBILITY_HYSTERESIS_PX,vb as LOCALE_NAMES,qm as MAX_EVENT_INVENTORY,Eg as MAX_GA_CAPACITY,ni as MIN_POINTER_TARGET_PX,$d as PickerController,Ee as PickerSelectionError,Xg as RENDERED_QUALITY_REPORT_VERSION,zm as SEAT_COMMERCIAL_MARKS,Ng as SEAT_TYPE_ICON_BODY,Ji as SEAT_TYPE_ICON_VIEWBOX,Nm as STAGE_LABEL_STYLE_MAX_SIZE,Xh as SUPPORTED_LOCALES,Um as SURROUNDINGS_SHAPE_ROLES,pn as SeatmapRenderer,cg as TABLE_SEAT_OFFSET,lg as TIER_HEIGHT_M,Ds as TRANSLATED_LOCALES,Un as UNGROUPED_ID,wd as accessNeedsFor,Dg as accessibilityLabelKey,Gm as accessibilityMeta,Vm as accessibilityRingColor,On as allObjects,Zn as applyHidden,lm as applyOrganizerSeatGlyph,bn as asPickerSalesState,Ld as attachVisibilityCatchUp,Mg as automaticRoundTableRadius,rg as canTransitionEventConfiguration,og as canonicalEventConfigurationJson,Nn as chartBounds,ld as clearOrganizerSeatGlyph,Wn as combinedFloorZoneId,Lt as compactRowLabel,qn as computeSections,Vg as computeSectionsPerFloor,sd as createRenderer,kr as crossesThreshold,zh as currencyExponent,fb as currencySymbol,Qm as eventInventoryLimitFor,yg as expandBooth,He as expandChart,pg as expandRow,ug as expandRowSlots,bg as expandTable,mg as expandTableSlots,wg as floorObjects,Lg as floorStackPlacements,qt as floorsOf,Cb as formatDate,pb as formatMinor,Ue as formatMoney,Kh as fromMinorUnits,kt as gaAreasOf,Bg as gaInventorySegments,Fg as gaUnitLabel,Zt as gaUnitLabels,_L as generateSeatPanorama,BL as generateSeatThumb,wb as getLocale,Og as growJoinedGAInventory,Kg as hiddenObjectIds,hm as holdHasLapsed,Dx as holdRecoveryShape,co as hysteresisScale,Kn as initialFloorMode,ng as inspectEventConfigurationCompatibility,Yg as inspectRenderedQualityEvidence,Ag as isGaUnitLabel,xb as isLocaleLoaded,ad as isOrganizerGlyphPainted,zg as isSectionHidden,$m as layerOf,zn as layoutCombinedFloorPlan,Vn as layoutFloorStack,HL as loadLocale,kb as localeDirection,Cg as mainFloorId,ag as migrateLegacyEventConfigurations,Sg as objectCenter,vg as owningSectionForObject,ig as parseEventConfigurationExport,tg as parseEventConfigurationVersion,_n as pointInPolygon,J as pointInPolygonWithHoles,$t as polygonLabelPoint,kd as reconcileAvailability,Ox as refreshChangedSomething,lo as renderedPx,sg as resolveEventConfigurationRollback,Ns as resolveLocale,hg as rowInventoryCount,dg as rowSeatPositions,Km as seatCommercialMeta,Xn as seatNoteRowModel,Yn as seatTypeIconBody,Hg as seatTypeIconSvg,Ut as sectionGeometry,Gg as sectionIdentitiesById,$n as sectionLabelsById,Wg as sectionOwnersByObject,lt as setLocale,Os as setMoneyLocale,Lb as setStringOverrides,xd as shouldWaitForHoldExpiry,Dn as stackFloors,B as t,Gs as tCount,gg as tableInventoryCount,fg as tableSeatCountsBySide,kg as translateObject,Bn as usableHoles,_g as validGAInventorySegments,$g as zoomTowardPoint};
|
|
1
|
+
import{a as go,c as bo,e as Ir,f as mi,h as Mr,j as Rr,m as Ar}from"./chunk-ZS5YFXSE.js";import{a as Kg,b as Zn,c as Xg,d as jn,e as Qn,f as Yg,g as Ug,h as Jn,j as yr,m as ui,o as Sr,p as Pe,q as fe,r as vr,s as wr,t as pi,u as kr}from"./chunk-AFJWTB7L.js";import{a as fb,b as ci,c as mb}from"./chunk-GPZFVQXV.js";import{b as Er}from"./chunk-FOYQOIWG.js";import{a as co,b as lb,c as tr,d as cb}from"./chunk-YPVYZYMH.js";import{a as ab,b as er,c as Mt}from"./chunk-FUFRWRPM.js";import{b as br,e as mo,i as fi}from"./chunk-66T4EAUA.js";import{a as $g,b as qg,c as Zg,f as hi}from"./chunk-PHV2U54Y.js";import{A as ur,B as ze,C as fo,D as ai,E as q,F as pe,G as li,a as be,b as cr,c as Ge,e as ye,f as ni,g as ri,h as dr,i as Tt,j as We,k as Ve,l as z,n as hr,s as Se,t as he,w as st,x as It,y as si}from"./chunk-JRZHC75P.js";import{b as og,c as On,d as ng,e as Dn,f as rg,g as sg,h as ag,i as lg,j as cg,k as dg,l as hg,m as ug,n as pg,o as fg,p as mg}from"./chunk-UEDS3HJ3.js";import{b as di,f as pr,h as at,i as fr,j as mr,l as gr}from"./chunk-4N5CHKHD.js";import{a as xr,b as Lr,h as Cr,s as Pr,t as Tr}from"./chunk-TQN2VWQO.js";import{b as $n,c as qn,l as Lt}from"./chunk-FOIYJ5NT.js";import{a as jg,b as Qg,c as Jg,d as eb,e as tb,f as ib,g as ob,h as nb,i as ro,j as so,k as rb,l as ao,m as Ct,n as lo,o as sb,p as Pt,q as ir,r as db,s as rt,t as or,u as nr,v as rr,w as hb,x as ub,y as pb,z as sr}from"./chunk-COECA63Q.js";import{Ba as Rg,Ca as Ag,Da as Eg,Ea as Fg,Fa as _g,Ga as Bg,Ha as Og,I as Nn,Ia as Dg,Ja as Ng,K as Hn,Ka as Hg,La as Kn,M as Y,Ma as Xn,Na as J,Oa as ei,Pa as Gg,Qa as Wg,Ra as ti,Sa as Vg,Ta as ii,Ua as zg,Va as Yn,Wa as He,Xa as Un,ca as Gn,d as gg,da as nt,e as bg,ea as Mg,f as yg,g as Sg,h as vg,i as wg,j as kg,k as xg,l as Lg,m as Cg,ma as se,n as Pg,na as Wn,o as Tg,oa as Jt,p as Ig,xa as Vn,za as zn}from"./chunk-EIV3CAGV.js";import"./chunk-KTMZ3QAO.js";import{C as O,c as ho,h as uo,m as po,o as ar,t as V,u as de,v as Ce,w as ee,x as oi,z as lr}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var gb=1,yo=90;function So(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function Fr(t,e,i,o=1){if(!Number.isFinite(t))return i;let n=Math.max(0,o);return i?t>=e-n:t>=e+n}function vo(t,e,i,o=1){if(!Number.isFinite(t)||!(i>0))return t;let n=Math.max(0,o)/i;return e?t*(1+n):t*(1-n)}function bb(t){let{point:e,camera:i,scale:o,nextScale:n}=t;if(!Number.isFinite(o)||o<=0||!Number.isFinite(n))return{...i};let r=(e.x-i.x)/o,s=(e.y-i.y)/o;return{x:e.x-r*n,y:e.y-s*n}}import{Konva as Ui}from"konva/lib/Core";import{Stage as Sm}from"konva/lib/Stage";import{Layer as kn}from"konva/lib/Layer";import{Group as qt}from"konva/lib/Group";import{Circle as bd}from"konva/lib/shapes/Circle";import{Group as Bo}from"konva/lib/Group";import{Circle as De}from"konva/lib/shapes/Circle";import{Line as No}from"konva/lib/shapes/Line";import{Rect as Oo}from"konva/lib/shapes/Rect";import{Text as ia}from"konva/lib/shapes/Text";var te=9,ve=.9,Z=.55*ve,oe=z/be,lt=4,me=14,_r=10;var Br=14;var we=.45*ve,ke=.9*ve,ae=(we+ke)/2,Or=Math.max(ve*1.1,ke),_e=8,Dr=700,ie=2,Rt=z,gh=12,bh=12;function Nr(t){return t<j?bh:gh}var gi=.85,Hr=z,At=64,Ke=.55*we,Gr=700,Wr=120,Vr=2500,bi=-11.5,Et=.58,zr=320,Kr=420,Xr=420,Yr=1,Xe=1,Ur=2,ct=16,Be=12,wo=[.85,.72,.62],yh=10,Sh=9;function yi(t){return t<j?Sh:yh}var Si=13,vi=12,$r=0,qr="700",Zr="600",jr=8,Qr=5,Jr=10,es=6,ts=8,is=.6,os=.6,ns=.7,rs=[0,18,-18,36,-36,54,-54],Ye="600",ss="500",j=640,as=Ye,ls="400",Oe=0,cs=14,ds=.34,hs=.92,us=7,ps=3;function wi(t){return Math.min(1,Math.max(Be/ct,t/900))}function dt(t,e){return Math.max(Be,t*wi(e))}var vh=.5,wh=1.15,fs=2,ms=3,gs=22,kh=8,xh=6;function Ft(t){return t<j?xh:kh}var ko=.08;function xo(t,e,i,o,n=vh,r=Be){let s=t*wi(e),a=Math.max(r*(1+ko),s*n),l=o>0&&i>o?i/o:1,c=Math.max(a,s*wh);return Math.min(c,a*l)}var bs=.1,_t=1.02;var ki=1.25;function ys(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var Lh="#e5e7eb",Ch="#c7cbd1",Ph="#6b7280",Th=["#6b7280","#5b6470","#4b5563","#374151"],Ih=["#cbd5e1","#e2e8f0","#f8fafc"],Mh="#d1d5db",Rh="#b8bdc4",Ah="#273142",Eh="#526078",Fh="#f1f5f9",_h="#374151",Bh="#64748b",Oh="#111827",Ss="#6b7280",vs="#374151";var ws="#4b5563",ks=.4,Te=.16,xs="rgba(244,246,248,0.06)",xi=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Ls(t,e,i){let o=new Map;for(let s of t){let a=e(s);!a||i(a)||o.set(a,(o.get(a)??0)+1)}let n=null,r=0;for(let[s,a]of o)(a>r||a===r&&n!=null&&s<n)&&(n=s,r=a);return n}function le(t){return V(t)?{sectionFill:Lh,sectionStroke:Ch,sectionInk:Ph,focalFill:Mh,focalStroke:Rh}:{sectionFill:Ah,sectionStroke:Eh,sectionInk:Fh,focalFill:_h,focalStroke:Bh}}function Lo(t,e){let i=t.sectionFill,o=V(i),n=o?de(i,.6):lr(Ce(i,.2),.85);switch(e){case"closed":return o?de(i,.4):Ce(i,.12);case"sold-out":return n;case"nearly-gone":return ee(i,n,.4);default:return i}}var Cs=.28,Ps=.42,Dh=.55,Nh=.7;function Ts(t,e,i){let o=le(t),n=Lo(o,e);if(!i||e==="sold-out"||e==="closed")return{fill:n,stroke:o.sectionStroke};let r=V(t);return{fill:ee(n,i,r?Ps:Cs),stroke:O(i,r?Nh:Dh)}}var Hh=.03;function Is(t,e){let i=le(t);return!["normal","nearly-gone","sold-out","closed"].map(n=>Lo(i,n).toLowerCase()).includes(e.trim().toLowerCase())&&Co(t,e)}function Co(t,e){let i=ho(e);if(!i)return!1;let o=le(t),n=Math.max(Cs,Ps)+Hh;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=ho(Lo(o,r));return s?Math.max(Math.abs(s[0]-i[0]),Math.abs(s[1]-i[1]),Math.abs(s[2]-i[2]))/255<=n:!1})}var Gh="#f8fafc",Wh="#f4f6fb",Vh="#111827",zh=.72;function Ms(t){let e=V(t),i=e?Gh:Oh,o=e?Vh:Wh,n=ee(o,i,1-zh);return{plate:i,ink:o,subInk:po(n,i)>=ar?n:o}}function Rs(t,e,i,o){if(e)return e;let n=V(i)?Ih:Th;for(let r of[i,...n])if(po(r,t)>=o)return r;return pe(t,e,i,o)}import{Shape as Xh}from"konva/lib/Shape";import{Circle as Yh}from"konva/lib/shapes/Circle";import{Rect as Uh}from"konva/lib/shapes/Rect";var Kh={M:2,L:2,Q:4,C:6,Z:0},Po=new Map;function To(t){let e=Po.get(t);if(e)return e;let i=at(t);if(!i)return Po.set(t,[]),[];let o=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],n=[],r=0;for(;r<o.length;){let s=o[r++],a=Kh[s];if(a===void 0||r+a>o.length)throw new Error(`Invalid path data for seat glyph "${t}".`);let l=o.slice(r,r+a).map(Number);if(l.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${t}".`);r+=a,s==="M"||s==="L"?n.push({command:s,points:l}):s==="Q"?n.push({command:s,points:l}):s==="C"?n.push({command:s,points:l}):n.push({command:"Z",points:[]})}return Po.set(t,n),n}function As(t,e,i,o=0,n=0){let r=To(e),s=pr(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=fr(s,i);t.save(),t.translate(o,n),t.scale(a.scale,a.scale),t.translate(-a.centreX,-a.centreY);for(let l of r)l.command==="M"?t.moveTo(l.points[0],l.points[1]):l.command==="L"?t.lineTo(l.points[0],l.points[1]):l.command==="Q"?t.quadraticCurveTo(l.points[0],l.points[1],l.points[2],l.points[3]):l.command==="C"?t.bezierCurveTo(l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]):t.closePath();return t.restore(),!0}function Es(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var Ue=class extends Xh{_sceneFunc(e){let i=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,n=To(o),r=this.attrs.seatGlyphDetail,s;if(r===void 0){let a=this.getAbsoluteScale(),l=Math.max(Math.abs(a.x),Math.abs(a.y)),c=Number.isFinite(l)&&l>0?l:1;s=i*2*c>=16}else s=r;if(!n.length||!s){Es(e,i),e.fillStrokeShape(this);return}e.beginPath(),As(e,o,i),e.fillStrokeShape(this)}_hitFunc(e){Es(e,this.attrs.seatRadius||1),e.fillStrokeShape(this)}getSelfRect(){let e=this.attrs.seatRadius||1;return{x:-e,y:-e,width:e*2,height:e*2}}};function Io(t,e){return t==="circle"||!at(t)?null:new Ue({x:e.x,y:e.y,seatRadius:e.radius,seatGlyph:t,...e.detail===void 0?{}:{seatGlyphDetail:e.detail},...e.fill?{fill:e.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Fs(t){let{x:e,y:i,radius:o}=t;return t.wheelchairBay?new Uh({x:e,y:i,width:o*2,height:o*2,offsetX:o,offsetY:o,cornerRadius:2,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):Io(t.glyph,{x:e,y:i,radius:o,detail:t.detail,fill:t.fill})??new Yh({x:e,y:i,radius:o,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function $h(t,e){return t*2*e>=16}function _s(t,e,i,o){let n=$h(e,i);if(n===o||!t.length)return n;for(let r of t)r.setAttr("seatGlyphDetail",n);return n}function Li(t){return t?.35:.3}function Ds(t){if(t<=0||t>=1)return 1;let e=1.25-1;if(t<.45){let o=t/.45;return 1+e*(1-(1-o)**2)}let i=(t-.45)/(1-.45);return 1+e*Math.cos(i*Math.PI*1.5)*(1-i)**2}function Mo(t){let e=t<=0?0:t>=1?1:t,i=1-(1-e)**3;return{radiusScale:1+(2.5-1)*i,opacity:.55*(1-e)}}var Ns=700,qh=2400,Ro=12,Hs=30,Bs=1,Zh=1.16,Os=.5,jh=1;function Ao(t){return t*.61803398875%1}function Gs(t,e){let o=((t/qh+e)%1+1)%1,n=(1-Math.cos(o*2*Math.PI))/2;return{scale:Bs+(Zh-Bs)*n,opacity:Os+(jh-Os)*n}}var Vs;function zs(t){Vs=t}function Qh(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var Ws=new Map;function Jh(t,e){let i=t??Vs,o=`${i??""}|${JSON.stringify(e)}`,n=Ws.get(o);return n||(n=new Intl.DateTimeFormat(i,e),Ws.set(o,n)),n}var eu={dateStyle:"medium",timeStyle:"short"};function Ks(t,e={}){let{locale:i,...o}=e,n=Qh(t);if(!Number.isFinite(n))return"";let r=Object.keys(o).length?o:eu;return Jh(i,r).format(n)}var _b="USD",Bb=["USD","EUR","GBP","CAD","AUD","INR","AED","SAR","KWD","QAR","BHD","OMR","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL","ARS","CLP","COP","PEN","UYU","IDR","PHP","THB","VND","MYR","NGN","GHS","KES","UGX","TZS","RWF","XAF","XOF","EGP"],Ys;function Us(t){Ys=t}var Xs=new Map;function Eo(t,e,i,o){let n=o??Ys,r=`${n??""}|${t}|${e??"auto"}|${i??"auto"}`,s=Xs.get(r);return s||(s=new Intl.NumberFormat(n,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),Xs.set(r,s)),s}function $e(t,e="USD",i,o){if(typeof i=="object"){let r=i;try{return Eo(e,r.minimumFractionDigits,r.maximumFractionDigits,r.locale).format(t)}catch(s){if(r.fallback)return r.fallback(t,e);throw s}}let n=i??(Number.isInteger(t)?0:void 0);return Eo(e,n,n,o).format(t)}var tu={BIF:0,CLP:0,DJF:0,GNF:0,JPY:0,KMF:0,KRW:0,MGA:0,PYG:0,RWF:0,UGX:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,BHD:3,IQD:3,JOD:3,KWD:3,LYD:3,OMR:3,TND:3};function iu(t="USD"){return tu[t.toUpperCase()]??2}function ou(t,e="USD"){return t/10**iu(e)}function Ob(t,e="USD",i){return $e(ou(t,e),e,void 0,i)}function Db(t="USD"){return Eo(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Bt={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired and the seats were released. Pick again.","picker.holdExpiredTitle":"Your seats were released","picker.holdExpiredBody":"Your hold time ran out and the seats went back on sale.","picker.holdExpiredRestart":"Choose seats again","picker.holdExpiredPickAgain":"Pick your seats again to continue. They may already be taken.","picker.releasedPair":"{first} \xB7 {second}","picker.releasedSeatPlace":"Section {section}, Row {row}, Seat {seat}","picker.releasedSeatRange":"Section {section}, Row {row}, Seats {from}\u2013{to}","picker.releasedInSection":"{seats} in Section {section}","picker.releasedInSections":"{seats} in Sections {sections}","picker.releasedGa":"{quantity} \xD7 {area}","picker.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","picker.testModeExplained":"Bookings here are not real and no card is charged","picker.findClosestSeatsTogether":"Find the closest seats together","picker.findSeatsTogether":"Find seats together","picker.addSeat":"Add seat","picker.removeSeat":"Remove seat","picker.added":"Added","picker.findSeats":"Find seats","picker.findBestSeats":"Find best seats","picker.displayOptions":"Display options","picker.closeVenueNavigation":"Close venue navigation","picker.orphanHint":"This leaves a single seat stranded. Consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.beaconAria":"Go to your {seats} in {name}","map.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.noWheelchairSpace":"NO WHEELCHAIR SPACE","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview: groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks: sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats: blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.seatsLeftShort":"{count} left","picker.overview":"Venue","picker.entrance":"Entrance","picker.aisleSeat":"Aisle seat","picker.boothType.inline":"Inline booth \xB7 1 open side","picker.boothType.corner":"Corner booth \xB7 2 open sides","picker.boothType.peninsula":"Peninsula booth \xB7 3 open sides","picker.boothType.island":"Island booth \xB7 4 open sides","picker.gaBookWholeArea":"Book the whole area","picker.gaBook":"Book","picker.noWheelchairSpace":"No wheelchair space","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","picker.viewSeats":"View seats","picker.tapSeatHint":"Tap any seat to check its view","picker.ticketTierFor":"Ticket tier for {label}","picker.viewFromSeat":"View from seat {label}","picker.real360":"REAL 360\xB0","picker.preview":"PREVIEW","picker.sightline":"\u2248 {m} m to stage","picker.panorama360":"360\xB0 venue photo","picker.illustrationCaption":"illustration \xB7 \u2248 {m} m from stage","picker.restrictedView":"Restricted view","picker.obstructedView":"Obstructed view","picker.premiumSeat":"Premium seat","picker.access.wheelchair":"Wheelchair space","picker.access.companion":"Companion seat","picker.access.semi-ambulatory":"Semi-ambulatory (limited mobility)","picker.access.designated-aisle":"Designated aisle / transfer seat","picker.access.step-free":"Step-free accessible seat","picker.access.hearing":"Assistive listening","picker.access.cart":"CART live-caption view","picker.access.sign-language":"Sign-language view","picker.access.low-vision":"Blind / low-vision viewing","picker.access.sensory-friendly":"Quiet / sensory-friendly seating","picker.access.plus-size":"Plus-size seat","picker.access.lift-armrest":"Lift-up armrest","picker.accessShort.wheelchair":"Wheelchair space","picker.accessShort.companion":"Companion seat","picker.accessShort.semi-ambulatory":"Limited mobility","picker.accessShort.designated-aisle":"Aisle / transfer","picker.accessShort.step-free":"Step-free","picker.accessShort.hearing":"Assistive listening","picker.accessShort.cart":"Live captions","picker.accessShort.sign-language":"Sign language","picker.accessShort.low-vision":"Low vision","picker.accessShort.sensory-friendly":"Sensory-friendly","picker.accessShort.plus-size":"Plus-size","picker.accessShort.lift-armrest":"Lift-up armrest","picker.organizerNote":"Organizer note","picker.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count}. Showing best overall","picker.loading3d":"Building the 3D venue\u2026","picker.unavailable3d":"3D could not start. The seat map is still available.","picker.jumpToSection":"Jump to section","picker.salesClosedPill":"Sales are closed","picker.salesClosedCopy":"Ticket sales for this event have ended.","picker.salesNotOpenPill":"Sales haven\u2019t opened yet","picker.salesNotOpenCopy":"Tickets for this event aren\u2019t on sale yet.","picker.salesPausedPill":"Sales are paused","picker.salesPausedCopy":"Ticket sales are paused for now.","picker.salesClosedCta":"Sales closed","picker.salesClosedToast":"Sales are closed for this event.","picker.securingSeats":"Securing your seats\u2026","picker.openingCheckout":"Opening secure checkout\u2026","picker.peekSecured":"\u2713 {count} secured \xB7 {total}. You won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types. Tap one below to show just those seats.","picker.aboutTicketPrices":"About ticket prices","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now.","picker.accessExpiredTitle":"The seat map timed out","picker.accessInvalidBody":"You can still book anything shown as available. Contact whoever sent you here for access to the rest.","picker.accessInvalidTitle":"We couldn\u2019t verify your access","picker.accessPausedBody":"The organizer has paused this selection. Try again in a few minutes.","picker.accessPausedTitle":"These seats are on hold right now","picker.accessRefresh":"Refresh","picker.accessRetry":"Try again","picker.accessRevokedBody":"Ask whoever sent you here for a new link to keep booking these seats.","picker.accessRevokedTitle":"This access link is no longer active","picker.idlePausedBody":"Refresh to see what\u2019s available now.","picker.idlePausedTitle":"The seat map paused while you were away","picker.accessiblePhysicalSeat":"Accessible physical seat","picker.addMinutes":"+{count} min","picker.accessibilityOptions":"Accessibility and colour options","picker.addingEllipsis":"Adding\u2026","picker.allLevels":"All levels","picker.allPlacesBookedTogether":"All {count} places are booked together as one exclusive table.","picker.allPrices":"All prices","picker.allSeats":"All seats","picker.allSetTitle":"You\u2019re all set","picker.anyTicketType":"Any ticket type","picker.anyVenueZone":"Any venue zone","picker.areas":"Areas","picker.available":"Available","picker.backToMap":"Back to map","picker.backToVenue":"Back to venue","picker.bestSeatsStar":"\u2726 Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.chartDerivedModel":"Chart-derived model","picker.chartDerivedSeatEye":"Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed","picker.checkConnection":"Check your connection and try again.","picker.checkoutCouldNotBeOpened":"Checkout could not be opened. Your seats are still held. Please try again.","picker.chooseAnotherToCompare":"Choose another seat to compare.","picker.chooseGuestsCopy":"Choose how many guests will sit together. This table is held exclusively for your party.","picker.chooseMinMaxGuests":"Choose {min}\u2013{max} guests","picker.clearSavedSeatComparison":"Clear saved seat comparison","picker.close":"Close","picker.closeSeatStatus":"Close seat status","picker.closestGroupChosenInstantly":"Closest available group, chosen instantly.","picker.aboutBestSeats":"About finding seats together","picker.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","picker.accessFreeCount":"{count} free","picker.accessSpreadHint":"{count} accessible spaces in {sections} sections \xB7 tap a highlighted section","picker.holdLapsedStillFree.one":"Your hold ended while you were away. That seat is still free.","picker.holdLapsedStillFree.other":"Your hold ended while you were away. Those seats are still free.","picker.holdLapsedSomeTaken.one":"Your hold ended while you were away, and {count} of those seats has been taken. The rest are still free.","picker.holdLapsedSomeTaken.other":"Your hold ended while you were away, and {count} of those seats have been taken. The rest are still free.","picker.holdLapsedAllTaken.one":"Your hold ended while you were away, and that seat has been taken.","picker.holdLapsedAllTaken.other":"Your hold ended while you were away, and those seats have been taken.","picker.holdLapsedSelectAgain.one":"Select it again","picker.holdLapsedSelectAgain.other":"Select them again","picker.compareCount":"Compare {count}","picker.compareWithSaved":"Compare with saved","picker.confirmOrCancelSeat":"Confirm or cancel this seat","picker.confirmSeatLabel":"Confirm seat {label}","picker.confirmYourTable":"Confirm your table","picker.confirmedAndOnWay":"confirmed. A confirmation is on its way.","picker.continue":"Continue","picker.continueToCheckout":"Continue to checkout","picker.couldNotAddMoreTime":"Couldn\u2019t add more time. Please head to checkout now.","picker.savedSeatsNotRestored":"Your earlier seats could not be restored. Please choose again.","picker.couldNotFindSeatsTogether":"We couldn\u2019t find {count} seats together. Try fewer seats or another ticket type.","picker.couldNotReleaseTickets":"Couldn\u2019t release your tickets. Your hold is unchanged.","picker.couldNotRemoveLabel":"Couldn\u2019t remove {label}. Your hold is unchanged.","picker.currentOffer":"Current offer","picker.currentTicketOffer":"Current ticket offer","picker.dragToLookAround":"Drag to look around \xB7 scroll to zoom","picker.dragToLookTouch":"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close","picker.dragToLookMouse":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close","picker.emptyWheelchairSpace":"Empty wheelchair space","picker.exitFullScreen":"Exit full screen","picker.fewer":"Fewer","picker.fewerGuests":"Fewer guests","picker.fewerSeats":"Fewer seats","picker.filterAndFocusByPrice":"Filter and focus seats by price","picker.filters":"Filters","picker.findBestSeatsCount.one":"Find {count} best seat","picker.findBestSeatsCount.other":"Find {count} best seats","picker.findBestSeatsTogether":"Find the best seats together","picker.findNewSeats":"Find new seats","picker.findingBestSeats":"Finding the best seats\u2026","picker.findingEllipsis":"Finding\u2026","picker.flat2dMap":"Flat 2D map","picker.flexiblePartyTypeWord":"Flexible party \xB7 {typeWord}","picker.fullScreen":"Full screen","picker.generalAdmission":"General admission","picker.guestCountCouldNotBeSecured":"That guest count could not be secured. Your current table hold is unchanged.","picker.guestCountNoLongerAvailable":"That guest count is no longer available. Your current hold is unchanged.","picker.guests":"Guests","picker.guestsCount":"{count} guests","picker.guestsCountEdit":"{count} guests \xB7 Edit","picker.held":"Held","picker.heldByOther":"Held by another buyer, may become available","picker.heldForYou":"Held for you","picker.heldSeatExplanation":"Another buyer is holding this seat. It may become available again.","picker.hidePanel":"Hide panel","picker.hideTicketPanel":"Hide the ticket panel","picker.holdSeatsAndCheckout":"Hold seats & checkout","picker.howOfferWorks":"How the {name} offer works","picker.interactive3dVenueView":"Interactive 3D venue view","picker.keepMine":"Keep mine","picker.labelNoLongerAvailable":"{label} is no longer available.","picker.labelRemoved":"{label} removed.","picker.labelRemovedFromHold":"{label} removed from your hold.","picker.labelRestored":"{label} restored.","picker.labelsNoLongerAvailable.one":"{labels} is no longer available. Choose another seat.","picker.labelsNoLongerAvailable.other":"{labels} are no longer available. Choose another group.","picker.leftCount.one":"{count} left","picker.leftCount.other":"{count} left","picker.levelNumber":"Level {number}","picker.levels":"Levels","picker.loadingSeatMap":"Loading seat map\u2026","picker.lookAroundLive3d":"Look around in live 3D","picker.manualTicketsRemovedNote":"Your manually selected tickets will be removed only after a new group is secured.","picker.map":"Map","picker.mapDidNotLoad":"The seat map didn\u2019t load","picker.eventUnavailableTitle":"This event isn\u2019t available","picker.eventUnavailable":"Tickets can\u2019t be booked here right now.","picker.maxTicketsForOrder":"You can select up to {count} tickets for this order.","picker.selectExactMore":"Select {count} more","picker.selectExactCount":"Select exactly {count} tickets","picker.selectMinimumMore":"Select {count} more","picker.adjustSeatSelection":"Adjust seat selection","picker.selectSeatsTogether":"Choose seats together in the same row and ticket category.","picker.minToMaxGuests":"{min} to {max} guests","picker.more":"More","picker.moreCount":"+{count} more","picker.showLess":"Show less","picker.moreGuests":"More guests","picker.moreSeats":"More seats","picker.moreTimeAdded":"More time added. Your seats are still held.","picker.noAccessibilityMetadata":"No accessibility metadata supplied","picker.noAuthoredRestriction":"No organizer-authored restriction","picker.noSeatsSelected":"No seats selected","picker.notForSale":"Not for sale","picker.notAvailable":"Not available","picker.notForSaleExplanation":"This seat is not included in the current sale.","picker.numberOfGuests":"Number of guests","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.","picker.offerDetailUpcoming":"Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts.","picker.offerRemainingAvailable":"{count} available","picker.offerStarts":"starts {time}","picker.offerUntil":"until {time}","picker.oneSeatSaved":"1 seat saved","picker.oneSeatSavedChooseAnother":"One seat saved; choose another to compare","picker.openAuthored360":"Open venue 360\xB0","picker.openComparison":"Open comparison","picker.openComparisonOfSeats":"Open comparison of {count} seats","picker.openTicketPanel":"Open ticket panel","picker.peekFromPrice":"From {price}","picker.peekTicketsTotal.one":"{count} ticket \xB7 {total}","picker.peekTicketsTotal.other":"{count} tickets \xB7 {total}","picker.perGuestPrice":"{price} per guest","picker.pickYourSeats":"Pick your seats","picker.preferredTicketType":"Preferred ticket type","picker.preferredVenueZone":"Preferred venue zone","picker.priceNotSupplied":"Price not supplied","picker.removeHeldTicketLabel":"Remove held ticket {label}","picker.removeSeatLabel":"Remove {label}","picker.removeTicketsUntilOrFewer":"Remove tickets until your order has {count} or fewer.","picker.replaceCurrentChoices":"Replace your current choices?","picker.review":"Review","picker.row":"Row","picker.rowLabel":"Row {label}","picker.saveToCompare":"Save to compare","picker.savedForComparison":"Saved for comparison","picker.savedSeatComparison":"Saved seat comparison","picker.scheduledOffer":"Scheduled offer","picker.seat":"Seat","picker.seatCount.one":"{count} seat","picker.seatCount.other":"{count} seats","picker.seatJustTakenByAnother":"Seat {label} was just taken by another buyer.","picker.seatLabel":"Seat {label}","picker.seatNoLongerAvailable":"That seat is no longer available.","picker.seatNoLongerYours":"Some seats are no longer available to you. They have been removed from your order.","picker.seatNumberLower":"seat {label}","picker.seatSalesClosedForEvent":"Seat sales have closed for this event.","picker.maintenancePaused.one":"Booking is paused for maintenance. Please try again in about {count} minute.","picker.maintenancePaused.other":"Booking is paused for maintenance. Please try again in about {count} minutes.","picker.maintenancePausedShortly":"Booking is paused for a few minutes for maintenance. Please try again shortly.","picker.seatSelection":"Seat selection","picker.seatStatusLegend":"Seat status legend","picker.seatTaken":"Someone else took a seat you had picked. It has been removed from your order.","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.seeItIn3d":"See it in 3D","picker.select":"Select","picker.selectSeats":"Select seats","picker.selectTable":"Select table","picker.selectWholeTable":"Select whole table","picker.selected":"Selected","picker.selectingEllipsis":"Selecting\u2026","picker.showAllSeats":"Show all seats","picker.showAllTicketTypes":"Show all {count} ticket types","picker.showFewer":"Show fewer","picker.showLabelSeatsOnMap":"Show {label} seats on the map","picker.showTicketPanel":"Show the ticket panel","picker.sold":"Sold","picker.soldOutCopy":"No reserved seats are currently available for this event.","picker.soldOutEyebrow":"This event","picker.soldOutTitle":"Sold out","picker.soldSeatExplanation":"This seat has already been booked.","picker.statusAvailable":"available","picker.statusOnHold":"on hold","picker.statusTaken2":"taken","picker.table":"Table","picker.tableCapacity":"Table capacity","picker.tableUpdatedForGuests":"{label} updated for {count} guests.","picker.temporarilyHeld":"Temporarily held","picker.ticketPrices":"Ticket prices","picker.ticketTypeNotChanged":"That ticket type is not available for this seat. Your hold is unchanged.","picker.ticketTypeSoldOut":"That ticket type is sold out. Try another ticket type.","picker.tickets":"Tickets","picker.ticketsCount.one":"{count} ticket","picker.ticketsCount.other":"{count} tickets","picker.toggleColorblindColors":"Toggle colorblind-friendly colors","picker.total":"Total","picker.trayHintTapOrBest":"Tap a seat on the map, or let us pick the best available for you.","picker.aboutYourSeats":"How to choose seats","picker.trayHintTapOrStanding":"Tap a seat on the map or grab standing tickets below.","picker.undo":"Undo","picker.upcomingTicketOffer":"Upcoming ticket offer","picker.updateTable":"Update table","picker.updatingEllipsis":"Updating\u2026","picker.venueView":"Venue view","picker.recentreOnStage":"Recentre on the stage","picker.stopYourSeat":"Your seat","picker.stopYourRow":"Your row","picker.stopYourSection":"Your section","picker.stopWholeVenue":"Whole venue","picker.viewFromHere":"View from here","picker.viewFromYourSeat":"view from your seat","picker.fromYourSeat":"from your seat","picker.viewFromThisSeat":"View from this seat","picker.wholeTypeWord":"Whole {typeWord}","picker.willChooseClosestGroup":"We\u2019ll choose the closest available group for you.","picker.willFindSeatsTogether":"We\u2019ll find {count} seats together.","picker.yourSeats":"Your seats","picker.zoomIn":"Zoom in","picker.zoomOut":"Zoom out","picker.fitWholeVenue":"Show whole venue","picker.dragToRotateVenue":"Drag to rotate the venue","picker.dragToMoveVenue":"Drag to move the venue","picker.closeVenueNav":"Close","picker.levelsAndAreas":"Levels & areas","picker.gaChooseTickets":"How many tickets?","picker.gaAdd.one":"Add {count} ticket \xB7 {price}","picker.gaAdd.other":"Add {count} tickets \xB7 {price}","picker.gaUpdate.one":"Update \xB7 {count} ticket","picker.gaUpdate.other":"Update \xB7 {count} tickets","picker.gaRemove":"Remove","picker.gaAreasHeading":"Areas","picker.gaTrayHintTapArea":"Tap an area on the map to choose tickets.","picker.gaAdded.one":"{count} {area} ticket added, {price}","picker.gaAdded.other":"{count} {area} tickets added, {price}","picker.gaRemoved":"{area} tickets removed","picker.gaChooseForArea":"Choose tickets for {area}","picker.holdSeatsForAllPerformances":"Hold seats for all {count} performances","picker.completeAllPerformances":"Complete all performances ({complete}/{total})","picker.groupTrayHint":"Choose seats once \u2014 the same seats will be held for every performance.","picker.groupPerPerformanceTrayHint":"Choose seats for this performance, then complete every date above.","picker.group.sameSeatSummary":"Choose once. The same seats will be held for all {count} performances.","picker.group.perPerformanceSummary":"Choose seats for each performance. All {count} selections are held together.","picker.group.allDates":"All {count} dates included","picker.group.flexibleDatesInView":"All {count} dates in view","picker.group.flexibleDatesSelected":"{selected} of {total} dates selected","picker.group.performances":"Performances","picker.group.heldForEveryPerformance":"Held for every performance","picker.group.notStarted":"Not started","picker.group.inProgress":"In progress","picker.group.complete":"Complete","picker.group.needsAttention":"Needs attention","picker.group.previousPerformance":"Previous performance","picker.group.nextPerformance":"Next performance","picker.group.performanceOpened":"Now choosing seats for {performance}.","picker.group.checkingAvailability":"Checking seats available for every performance\u2026","picker.group.securing":"Securing these seats for every performance. Please wait.","picker.group.commitPending":"We\u2019re still securing these seats for every performance. SeatLayer will keep working; this page is checking the result.","picker.group.outcomeUnknown":"We\u2019re checking whether your seats were secured. Don\u2019t choose other seats yet.","picker.group.longRunning":"This is taking longer than usual. We\u2019re still checking the same request. Don\u2019t submit it again. Reference: {reference}.","picker.group.abortPending":"We couldn\u2019t secure every performance. We\u2019re checking that all seats are released before you try again.","picker.group.secured":"Seats secured for every performance. Continue when you are ready.","picker.group.notSecured":"We couldn\u2019t secure these seats for every performance. Nothing is held. Try again.","picker.group.retry":"Try again","picker.group.salesClosed":"Seats for this performance set are not available now. Return to the event page for other options.","picker.group.revisionChanged":"This performance set changed. Review the included performances before choosing seats again.","picker.group.legendTitle":"Seat availability","picker.group.legendUnavailable":"Unavailable","picker.group.partlyAvailableTitle":"Free on some nights only","picker.group.notAvailableOn":"Not available on {dates}","picker.group.nightFree":"Free","picker.group.nightBlocked":"Not available","picker.group.pickSeatFreeEveryNight":"Pick a seat that is free every night.","picker.group.chooseNightByNight":"Choose seats night by night","picker.group.nightByNightStarted":"Now choosing seats for each performance separately. Your selection was cleared.","picker.group.yourSeatsByNight":"Your seats by night","picker.group.noSeatsChosenYet":"No seats yet","picker.group.chosenOfTotal":"{chosen} of {total}","picker.group.needsMoreSeats":"Needs {count} more","picker.group.closeSeatDetails":"Close seat details","picker.group.seatPartlyAvailable":"{label}: free on {free} of {total} performances. Not available on {dates}.","picker.group.selectAvailableDates":"Select for {count} available dates","picker.group.selectedAvailableDates":"Selected for {count} available dates.","picker.group.clearBeforePartial":"Clear your current seats before choosing a different date set.","picker.group.legendAvailable":"Available","picker.group.legendSelected":"Selected","picker.group.legendNotEveryDate":"Not open on every date","picker.group.progressLabel":"Booking steps","picker.group.stepPerformances":"Performances","picker.group.stepSeats":"Seats","picker.group.stepReview":"Review","picker.group.stepDone":"Done","picker.group.stepCurrent":"Current step","picker.group.includedNote":"All {count} performances are included \xB7 dates cannot be removed here","picker.group.flexibleDatesNote":"Choose a partial seat to include only the dates where it is available.","picker.group.flexibleSelectedNote":"Only these {count} dates will be held for this seat.","picker.group.yourSelection":"Your selection","picker.group.pricesPerPerformance":"Prices shown per performance","picker.group.total":"Total","picker.group.heldTogether":"All {count} performance selections are held together \xB7 {time} remaining","picker.group.completeWithSeats":"Complete \xB7 {seats}","picker.group.stillNeedsSeat":"Still needs a seat","picker.group.sameSeatMapHelp":"One chart shows only seats available for every selected performance.","picker.group.perPerformanceMapHelp":"Switch dates above; the map position and each choice stay saved.","picker.group.bookedAll":"You\u2019re all set \u2014 seats booked for all {count} performances.","picker.group.seatsEveryPerformance.one":"{count} seat \xB7 every performance","picker.group.seatsEveryPerformance.other":"{count} seats \xB7 every performance","picker.group.seatsPerPerformance.one":"{count} seat \xB7 {per} per performance","picker.group.seatsPerPerformance.other":"{count} seats \xB7 {per} per performance","picker.group.performancesChosenOf.one":"{chosen} of {total} performances chosen \xB7 {count} seat","picker.group.performancesChosenOf.other":"{chosen} of {total} performances chosen \xB7 {count} seats","picker.group.ticketsConfirmedAcross.one":"{count} ticket confirmed across {performances} performances","picker.group.ticketsConfirmedAcross.other":"{count} tickets confirmed across {performances} performances","checkout.free":"Free","checkout.confirmBooking":"Confirm booking","checkout.price":"Price","checkout.freeNote":"This event is free. Nothing is charged.","checkout.confirmingBooking":"Confirming your booking\u2026","checkout.confirmingSeats":"Confirming your seats\u2026","checkout.busyRetryingBooking":"Busy right now. Still confirming your booking\u2026","checkout.busyRetryingPayment":"Busy right now. Still opening secure payment\u2026","checkout.busyFailedBooking":"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.busyFailedPayment":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.","checkout.seatsUnavailable":"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.","checkout.title":"Checkout","checkout.back":"Back to seats","checkout.heldFor":"Seats held for {time}","checkout.yourOrder":"Your order","checkout.row":"Row {row}","checkout.seat":"Seat {seat}","checkout.quantity":"{label} \xD7 {count}","checkout.showAll":"Show all {count} seats","checkout.yourDetails":"Your details","checkout.email":"Email","checkout.emailHint":"Your tickets are sent here.","checkout.name":"Name","checkout.namePlaceholder":"Your name","checkout.optional":"Optional","checkout.forSomeoneElse":"Ticket for someone else?","checkout.holderYou":"You \xB7 {name}","checkout.holderYouPlain":"You","checkout.change":"Change","checkout.changeHolder":"Change the holder of {ticket}","checkout.addNames":"Add names for each ticket","checkout.questions":"A few questions","checkout.payWith":"Pay with","checkout.continue":"Continue to payment","checkout.continueTest":"Continue to test payment","checkout.tryAgain":"Try again","checkout.trust":"Secure payment on the organizer\u2019s payment page. We never see your card.","checkout.freeTrust":"Free booking. Nothing is charged.","checkout.testStrip":"No real charge \xB7 tickets not valid for entry","checkout.testStripFree":"Test booking \xB7 tickets not valid for entry","checkout.privacy":"The organizer and SeatLayer use your details to issue and manage your tickets.","checkout.privacyLink":"Privacy Policy","checkout.expiringSoon":"Your seats are held for {time}. Finish soon to keep them.","checkout.opening":"Opening secure payment\u2026","checkout.redirectTitle":"Taking you to secure payment","checkout.redirectBody":"You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.","checkout.waitingPayment":"Waiting for payment\u2026","checkout.dontClose":"Don\u2019t close this tab.","checkout.confirmingTitle":"Confirming your seats","checkout.paymentReceived":"Payment received. This usually takes a few seconds.","checkout.noNeedPayAgain":"You don\u2019t need to pay again.","checkout.stillConfirmingTitle":"Still confirming","checkout.stillConfirming":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.","checkout.nothingCharged":"Nothing was charged.","checkout.expiredTitle":"Your seats were released","checkout.expiredBody":"The hold on {seats} ran out before payment started.","checkout.chooseAgain":"Choose seats again","checkout.takenTitle":"Those seats were just taken","checkout.takenBody":"Someone booked {seats} while you were filling this in.","checkout.chooseOther":"Choose other seats","checkout.networkTitle":"Couldn\u2019t reach checkout.","checkout.networkBody":"Check your connection and try again. Nothing was charged, and your seats are still held.","checkout.error.email":"Enter an email like name@example.com.","checkout.error.notTakingPayments":"This event is not taking online payments yet. Contact the organizer to buy these seats.","checkout.error.accessEnded":"Your access to this private sale has ended. Nothing was charged. Ask whoever sent you the link for a new one.","checkout.error.holdReleased":"Your seats were released before checkout started. Nothing was charged. Please pick again.","checkout.error.releasedBeforePayment":"Your seats were released before payment completed. Nothing was charged. Please pick again.","checkout.error.paymentFailed":"The payment did not complete. If you were charged, it has been refunded automatically.","checkout.error.alreadyStarted":"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.","checkout.error.eventClosed":"Sales for this event have closed.","checkout.error.salesPaused":"Ticket sales are paused for a moment while the organizer updates their account. Nothing was charged. Please try again later or contact the organizer.","checkout.error.pricing":"These seats can\u2019t be checked out right now because of a pricing setup problem. Nothing was charged. Please contact the organizer.","checkout.error.providerRefused":"The organizer\u2019s payment setup refused this payment. Nothing was charged. Please contact the organizer.","checkout.error.rateLimited":"Too many attempts. Wait a moment and try again.","checkout.error.generic":"We couldn\u2019t start the payment. Nothing was charged. Please try again.","checkout.goingTo":"You\u2019re going to {event}","checkout.confirmedTitle":"Your tickets are confirmed","checkout.sentTo":"Your tickets and QR codes are on their way to {email}, with a printable PDF attached. Show a QR at the door, no printing needed.","checkout.sentToYourEmail":"Your tickets and QR codes are on their way to your email, with a printable PDF attached. Show a QR at the door, no printing needed.","checkout.viewTickets":"View tickets & QR codes","checkout.paid":"Paid","checkout.order":"Order","checkout.keepLink":"Keep this link. It opens your tickets any time: no login, and it does not expire.","checkout.copy":"Copy","checkout.copied":"Copied","checkout.selectCopy":"Select & copy","checkout.linkCopied":"Link copied.","checkout.clipboardBlocked":"Your browser blocked the clipboard. The link is selected, press \u2318C / Ctrl+C.","bookingForm.ticketHolders":"Ticket holders","bookingForm.bookingQuestions":"About your booking","bookingForm.ticketNumber":"Ticket {number}","bookingForm.guestOf":"{area} \xB7 Guest {index} of {total}","bookingForm.useMyDetails":"Use my details","bookingForm.syncedHint":"Filled in from your details above.","bookingForm.name":"Name","bookingForm.email":"Email","bookingForm.phone":"Phone","bookingForm.optional":"(optional)","bookingForm.fixErrors":"Some details need attention before you continue.","bookingForm.error.required":"{field} is required.","bookingForm.error.tooLong":"{field} must be {max} characters or fewer.","bookingForm.error.email":"{field} must be a valid email address.","bookingForm.error.phone":"{field} must be 6\u201320 characters: digits, spaces, + - ( ).","bookingForm.error.number":"{field} must be a number.","bookingForm.error.date":"{field} must be a date.","bookingForm.error.choice":"Choose a valid option for {field}.","bookingForm.error.invalid":"Check {field}.","tickets.editNames":"Edit names","tickets.editNamesHint":"You can correct names until the event starts.","tickets.saveNames":"Save names","tickets.savingNames":"Saving\u2026","tickets.cancel":"Cancel","tickets.namesSaved":"Names updated.","tickets.editClosed":"Names can\u2019t be changed after the event starts.","tickets.editUnavailable":"Names can\u2019t be changed on this order.","tickets.saveFailed":"Couldn\u2019t save the names. Check your connection and try again.","picker.bookingForm.ticket":"Ticket {number}","picker.bookingForm.useMyDetails":"Use my details","picker.bookingForm.name":"Name","picker.bookingForm.email":"Email","picker.bookingForm.phone":"Phone","picker.bookingForm.optional":"{label} (optional)","picker.bookingForm.choose":"Choose\u2026","picker.bookingForm.required":"This is required.","picker.bookingForm.invalid":"Check this answer.","picker.bookingForm.invalidEmail":"Enter a valid email address.","picker.bookingForm.invalidPhone":"Enter a valid phone number.","picker.bookingForm.tooLong":"This is too long.","picker.bookingForm.fix":"Some details need attention.","picker.bookingForm.unsupported":"This event needs details for each ticket holder that this checkout can\u2019t collect. Your seats are still held and nothing was charged.","picker.bookingForm.continueOnEventPage":"Continue on the event page","picker.bookingForm.guestOfCount":"{label} \xB7 Guest {index} of {total}","buyer.testBookingStrip":"Test booking: no real charge, tickets not valid for entry","buyer.testTicketNotValid":"Test ticket: not valid for entry"};var nu=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hi","hr","hu","id","it","ja","ko","ku","lt","lv","ms","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-Hans","zh-Hant"],zb={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",be:"\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F",bg:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",cy:"Cymraeg",da:"Dansk",de:"Deutsch",el:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",en:"English",es:"Espa\xF1ol",et:"Eesti",fa:"\u0641\u0627\u0631\u0633\u06CC",fi:"Suomi",fr:"Fran\xE7ais",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",hi:"\u0939\u093F\u0928\u094D\u0926\u0940",hr:"Hrvatski",hu:"Magyar",id:"Bahasa Indonesia",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4",ku:"Kurd\xEE",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",ms:"Bahasa Melayu",nl:"Nederlands",no:"Norsk",pl:"Polski",pt:"Portugu\xEAs",ro:"Rom\xE2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",sk:"Sloven\u010Dina",sl:"Sloven\u0161\u010Dina",sr:"\u0421\u0440\u043F\u0441\u043A\u0438",sv:"Svenska",th:"\u0E44\u0E17\u0E22",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",vi:"Ti\u1EBFng Vi\u1EC7t","zh-Hans":"\u7B80\u4F53\u4E2D\u6587","zh-Hant":"\u7E41\u9AD4\u4E2D\u6587"},$s=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hi","hr","hu","id","it","ja","ko","ku","lt","lv","ms","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-Hans","zh-Hant"],ru=new Set(["ar","fa","he"]),Fo={li:"lt",iw:"he",mo:"ro",sh:"sr",nb:"no",nn:"no",kmr:"ku",in:"id",zsm:"ms",zh:"zh-Hans","zh-cn":"zh-Hans","zh-sg":"zh-Hans","zh-my":"zh-Hans","zh-tw":"zh-Hant","zh-hk":"zh-Hant","zh-mo":"zh-Hant"},_o=new Map(nu.map(t=>[t.toLowerCase(),t]));function su(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=_o.get(e)??Fo[e];if(i)return i;let o=e.split("-");if(o.length>=2){let n=`${o[0]}-${o[1]}`,r=_o.get(n)??Fo[n];if(r)return r}return _o.get(o[0])??Fo[o[0]]}var qe={en:Bt},Ci={},ge="en";function qs(t,e){let i=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let o of[t,e,...i]){if(!o)continue;let n=su(o);if(n)return n}return"en"}function Kb(){return ge}function Xb(t=ge){return ru.has(t)?"rtl":"ltr"}function Yb(t){return!!qe[t]}function ht(t,e){e&&(qe[t]={...qe[t],...e}),ge=qe[t]?t:"en",Us(ge),zs(ge),typeof document<"u"&&(document.documentElement.lang=ge)}function Ub(t){Ci=t}var Zs=/\{(\w+)\}/g;function B(t,e){let i=Ci[t]??qe[ge]?.[t]??Bt[t]??t;return e?i.replace(Zs,(o,n)=>String(e[n]??`{${n}}`)):i}function js(t,e,i){let o=new Intl.PluralRules(ge).select(e);return(Ci[`${t}.${o}`]??qe[ge]?.[`${t}.${o}`]??Bt[`${t}.${o}`]??Ci[`${t}.other`]??qe[ge]?.[`${t}.other`]??Bt[`${t}.other`]??t).replace(Zs,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function $b(t,e){return Ks(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:ge})}function Js(t,e,i,o=!1){let n=t.displayLabel?.trim()||t.label;return o?{title:n,detail:B("map.statusTaken"),sellable:!1}:e==="booked"?{title:n,detail:B("map.statusTaken"),sellable:!1}:e==="held"?{title:n,detail:B("map.statusHeld"),sellable:!1}:{title:n,detail:i()??"",sellable:!0}}var ut=32,Qs=70;function ea(t,e){let i=ut+6,o=t.y-Qs;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:o>=i?o:Math.min(t.y+Qs,e.height-i)}}var Do=.8,du=Math.hypot(.46,.36),hu=.26,uu=1.6,pu=2*(1-du),ra="#0b1220",oa="#ffffff";function na(t,e,i,o,n){let r=Math.min(Math.max(uu,i*hu),i*pu);return new No({x:t,y:e,points:[-i*.42,i*.02,-i*.1,i*.34,i*.46,-i*.36],stroke:o,strokeWidth:r,lineCap:"round",lineJoin:"round",...n?{shadowColor:ra,shadowBlur:1.5,shadowOpacity:.55}:{},listening:!1})}function fu(t){if(!(t instanceof Ue)||t.getAttr("seatGlyphDetail")===!1)return null;let e=t.getAttr("seatGlyph");return e&&at(e)?e:null}var mu=220,gu=.08,Pi=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,i,o){let n=o.get(e);if(o.delete(e),!i){this.retire(n);return}n?.destroy();let r=this.host,s=r.seat(e);if(!s)return;let a=r.seatShape(e)?.fill(),l=q(typeof a=="string"?a:"",r.selectionColor(),ze),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),u=d?null:fu(r.seatShape(e)),h=r.seatRadius(),m=r.seatPoint(s),f=new Bo({name:"selection-ring",x:m.x,y:m.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});if(r.viewMode()==="perspective"){let g=r.perspectiveSeatScale(e);f.scale({x:g,y:g})}f.setAttrs({seatId:e,ringColor:l});let b={name:"selection-halo",stroke:O(r.categoryColor(s.categoryKey),Li(V(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let g=h*1.2;f.add(new Oo({...b,width:d.width+g*2,height:d.height+g*2,offsetX:(d.width+g*2)/2,offsetY:(d.height+g*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else f.add(new De({...b,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let p={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(f.add(new Oo({...p,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)f.add(new Oo({...p,stroke:ai(r.canvasBackground()),width:d.width+10,height:d.height+10,offsetX:(d.width+10)/2,offsetY:(d.height+10)/2,cornerRadius:7,strokeWidth:2.5,opacity:Do}));else{let g=Math.max(0,d.width/2-14),y=-Math.max(0,d.height/2-14);f.add(new De({x:g,y,radius:10,fill:l,listening:!1})),f.add(new No({x:g,y,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:V(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else if(u)this.addGlyphMark(f,u,h,c,p);else{let g=Math.max(1,h-1.25),y=Math.min(2.5,Math.max(1.8,h*.22));if(f.add(new De({...p,radius:g,strokeWidth:y})),c)f.add(new De({...p,stroke:ai(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:Do}));else{let S=Math.max(0,g-y/2);f.add(na(0,0,S,oa,!0))}}o.set(e,f),this.host.overlayLayer.add(f)}addGlyphMark(e,i,o,n,r){let s=this.host,a=s.canvasBackground();if(n){e.add(new De({...r,stroke:ai(a),radius:o+2,strokeWidth:Math.max(2,o*.2),opacity:Do}));return}let l=q(a,s.selectionColor(),ze),c=Io(i,{x:0,y:0,radius:o,fill:l,detail:!0});if(!c)return;c.name("selection-body"),c.listening(!1),e.add(c);let d=mr(i,o);if(!d)return;let u=V(l)?ra:oa;e.add(na(d.x,d.y,d.radius,u,!1))}resyncMarkers(e,i){if(e.size){for(let o of[...e.keys()])this.syncMarker(o,!0,e);i()}}retire(e){let i=this.host;if(!e)return;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden){e.destroy();return}let o=performance.now(),n=r=>{if(i.isDestroyed()||!e.getLayer()){e.destroy();return}let s=Math.min(1,(r-o)/160);e.opacity(1-s),i.overlayLayer.batchDraw(),s<1?requestAnimationFrame(n):(e.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(n)}play(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden||!i.seat(e))return;this.emitPulse(e,!0);let o=this.echoTimers.get(e);o&&clearTimeout(o),this.echoTimers.set(e,setTimeout(()=>{this.echoTimers.delete(e),!(i.isDestroyed()||i.reducedMotion())&&(typeof document<"u"&&document.hidden||this.emitPulse(e,!1))},Ns))}emitPulse(e,i){let o=this.host,n=o.seat(e);if(!n)return;let r=o.seatRadius(),s=o.seatPoint(n);this.pulses.get(e)?.destroy();let a=new De({name:"selection-pulse",x:s.x,y:s.y,radius:r,stroke:o.categoryColor(n.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Mo(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,a),this.pulseHome().add(a);let l=i&&!o.isCached()?o.seatShape(e):void 0,c=performance.now(),d=()=>{l?.scale({x:1,y:1}),a.destroy(),this.pulses.get(e)===a&&this.pulses.delete(e),o.overlayLayer.batchDraw(),l&&!o.isCached()&&o.seatLayer.batchDraw()},u=h=>{if(o.isDestroyed()){d();return}a.getLayer()||this.pulseHome().add(a);let m=h-c,f=Mo(m/420);if(a.radius(r*f.radiusScale),a.opacity(f.opacity),l){let b=Ds(m/320);l.scale({x:b,y:b})}o.overlayLayer.batchDraw(),l&&!o.isCached()&&o.seatLayer.batchDraw(),m<420?requestAnimationFrame(u):d()};queueMicrotask(()=>{o.isDestroyed()||typeof requestAnimationFrame!="function"||requestAnimationFrame(u)})}nudge(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||i.isCached()||typeof document<"u"&&document.hidden)return;let o=i.seatShape(e);if(!o)return;let n=performance.now(),r=()=>{o.scale({x:1,y:1}),i.seatLayer.batchDraw()},s=a=>{if(i.isDestroyed()||i.isCached()||!o.getLayer()){r();return}let l=a-n,c=Math.min(1,l/mu),d=1+gu*Math.sin(Math.PI*c);o.scale({x:d,y:d}),i.seatLayer.batchDraw(),c<1?requestAnimationFrame(s):r()};requestAnimationFrame(s)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Bo({name:"seat-pulses",listening:!1})),this.pulseGroup.getLayer()||this.host.overlayLayer.add(this.pulseGroup),this.host.overlayLayer.isCached()&&this.host.overlayLayer.clearCache(),this.pulseGroup.moveToTop(),this.pulseGroup}showLoupe(e){let i=this.host;if(i.isExportMode()||i.isDestroyed())return;let o=i.nearestSeat(e,me),n=o?i.seat(o):void 0;if(!n){this.hideLoupe();return}let r=Js(n,i.seatStatus(n.id),()=>i.priceLabel(n),i.seatClosed(n.id)),s=ea(e,{width:i.stage.width(),height:i.stage.height()}),a=1/(i.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=n.id,l.group.position(i.screenToWorld(s)),l.group.scale({x:a,y:a}),l.group.opacity(r.sellable?1:.75),l.group.visible(!0),l.disc.fill(i.categoryColor(n.categoryKey)),l.title.text(r.title),l.title.offsetX(l.title.width()/2),l.detail.text(r.detail),l.detail.offsetX(l.detail.width()/2),i.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,i=e.canvasBackground(),o=q(i,le(i).sectionInk),n=new Bo({name:"touch-loupe",listening:!1,visible:!1});n.add(new No({points:[-7,ut-4,0,ut+12,7,ut-4],closed:!0,fill:i,stroke:O(o,.25),strokeWidth:1,listening:!1})),n.add(new De({radius:ut,fill:i,stroke:O(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new De({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new ia({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),a=new ia({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:O(o,.72),listening:!1,perfectDrawEnabled:!1});return n.add(r),n.add(s),n.add(a),e.overlayLayer.add(n),n.moveToTop(),this.loupe={group:n,title:s,detail:a,disc:r,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}destroy(){for(let e of this.echoTimers.values())clearTimeout(e);this.echoTimers.clear()}};import{Animation as bu}from"konva/lib/Animation";var yu=1e3/Hs;function sa(t){return t.findOne(".selection-halo")??null}var Ti=class{constructor(e){this.animation=null;this.targets=[];this.startedAt=0;this.lastFrameAt=0;this.visibilityBound=!1;this.onVisibilityChange=()=>{this.refresh()};this.markers=new Map;this.beaconRings=[];this.host=e}sync(e){this.markers=e,this.refresh()}syncBeacons(e){this.beaconRings=e,this.refresh()}refresh(){let e=this.host,i=this.markers.size>0||this.beaconRings.length>0;if(i&&!e.isDestroyed()&&!e.reducedMotion()&&this.bindVisibility(),e.isDestroyed()||e.reducedMotion()||!this.pageVisible()||!i){this.stop(),this.rest(),(!i||e.isDestroyed()||e.reducedMotion())&&this.unbindVisibility();return}let o=[],n=0;for(let[s,a]of this.markers){let l=sa(a);if(l){if(this.paintHalo(s,l),n>=Ro){l.scale({x:1,y:1}),l.opacity(1);continue}o.push({node:l,phase:Ao(n)}),n+=1}}let r=0;for(let s of this.beaconRings){if(r>=Ro){s.scale({x:1,y:1}),s.opacity(1);continue}o.push({node:s,phase:Ao(r)}),r+=1}if(this.targets=o,!o.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new bu(()=>this.frame(),e.overlayLayer),this.animation.start())}stop(){this.targets=[],this.animation&&(this.animation.stop(),this.animation=null)}destroy(){this.stop(),this.markers=new Map,this.beaconRings=[],this.unbindVisibility()}isRunning(){return!!this.animation?.isRunning()}paintHalo(e,i){let o=this.host,n=Li(V(o.canvasBackground())),r=o.seatCategoryKey(e),s=o.isOwnedHold(e)?ee(o.selectionColor(),o.canvasBackground(),.55):r?o.categoryColor(r):o.selectionColor();i.stroke(O(s,n))}rest(){let e=!1;for(let[i,o]of this.markers){let n=sa(o);n&&(this.paintHalo(i,n),n.scale({x:1,y:1}),n.opacity(1),e=!0)}for(let i of this.beaconRings)i.scale({x:1,y:1}),i.opacity(1),e=!0;e&&!this.host.isDestroyed()&&this.host.overlayLayer.batchDraw()}frame(){if(this.host.isDestroyed()||!this.targets.length)return this.stop(),!1;let i=performance.now();if(i-this.lastFrameAt<yu)return!1;this.lastFrameAt=i;let o=i-this.startedAt;for(let n of this.targets){let{scale:r,opacity:s}=Gs(o,n.phase);n.node.scale({x:r,y:r}),n.node.opacity(s)}return!0}pageVisible(){return typeof document>"u"?!0:document.visibilityState==="visible"}bindVisibility(){this.visibilityBound||typeof document>"u"||(document.addEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!0)}unbindVisibility(){!this.visibilityBound||typeof document>"u"||(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!1)}};import{Group as Su}from"konva/lib/Group";import{Circle as Ho}from"konva/lib/shapes/Circle";import{Text as vu}from"konva/lib/shapes/Text";var aa=28,wu=12,ku="800",xu=44,la=1.6,ca=1.95;function da(t){if(t.rung==="seats")return[];let e=new Map,i=new Map,o=new Map(t.zones.map(n=>[n.id,n.name]));for(let n of t.sections){let r=t.ownedSeatIds(n);if(!r.length)continue;let s=t.rung==="zones"&&n.zone!=null&&o.has(n.zone),a=s?n.zone:n.logicalId,l=e.get(a);if(l){l.count+=r.length,r.length>(i.get(a)??0)&&(i.set(a,r.length),l.seatId=r[0],l.anchor=t.sectionAnchor(n),l.toward=t.sectionCentre(n));continue}i.set(a,r.length),e.set(a,{id:a,kind:s?"zone":"section",name:s?o.get(n.zone):t.sectionName(n),count:r.length,seatId:r[0],anchor:t.sectionAnchor(n),toward:t.sectionCentre(n)})}return[...e.values()]}function Lu(t,e){return B("map.beaconAria",{seats:js("picker.seatCount",t),name:e})}function Cu(t,e){let i=e*ca,o=t.toward.x-t.anchor.x,n=t.toward.y-t.anchor.y,r=Math.hypot(o,n);return r<1e-6?{x:t.anchor.x,y:t.anchor.y-i}:{x:t.anchor.x+o/r*i,y:t.anchor.y+n/r*i}}var Pu="selection-beacon-ring",Ii=class{constructor(e){this.group=null;this.buttons=[];this.centres=[];this.rings=[];this.targets=[];this.signature="";this.host=e}breathingRings(){return this.rings}current(){return this.targets}sync(e){let i=Math.max(this.host.stageScale(),1e-4),o=`${i.toFixed(4)}|${e.map(c=>`${c.id}:${c.count}:${c.seatId}`).join(",")}`;if(o===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=o,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let n=aa/2/i,r=Math.max(xu,Math.ceil(2*(n*ca+n)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new Su({listening:!1,name:"selection-beacons"});for(let c of e){let d=Cu(c,n);l.add(new Ho({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:n*la,fill:O(s,.1),listening:!1,perfectDrawEnabled:!1}));let u=new Ho({name:Pu,x:c.anchor.x,y:c.anchor.y,radius:n*la,stroke:O(s,.55),strokeWidth:Math.max(1,n*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(u),l.add(new Ho({name:"selection-beacon-disc",x:d.x,y:d.y,radius:n,fill:s,stroke:O(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let h=new vu({x:d.x,y:d.y,text:String(c.count),fontSize:wu/i,fontStyle:ku,fontFamily:this.host.labelFont(),fill:a,listening:!1,perfectDrawEnabled:!1});h.offsetX(h.width()/2),h.offsetY(h.height()/2),l.add(h),this.rings.push(u),this.centres.push(c.anchor),this.buttons.push(this.buildButton(c,c.anchor,r))}this.host.overlayLayer.add(l),l.moveToTop(),this.group=l,this.host.overlayLayer.batchDraw()}raise(){this.group?.moveToTop()}clear(){this.group?.destroy(),this.group=null,this.rings=[],this.targets=[],this.centres=[],this.signature="";for(let e of this.buttons)e.remove();this.buttons=[]}repositionButtons(){for(let e=0;e<this.buttons.length;e+=1){let i=this.buttons[e],o=this.host.worldToScreen(this.centres[e]),n=i.offsetWidth||parseFloat(i.style.width)||aa;i.style.left=`${o.x-n/2}px`,i.style.top=`${o.y-n/2}px`}}buildButton(e,i,o){let n=this.host.worldToScreen(i),r=document.createElement("button");return r.type="button",r.className="sl-beacon",r.dataset.beacon=e.id,r.setAttribute("aria-label",Lu(e.count,e.name)),Object.assign(r.style,{position:"absolute",left:`${n.x-o/2}px`,top:`${n.y-o/2}px`,width:`${o}px`,height:`${o}px`,padding:"0",margin:"0",border:"none",borderRadius:"50%",background:"transparent",cursor:"pointer",touchAction:"manipulation",zIndex:"3"}),r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.host.activate(e)}),r.addEventListener("pointerdown",s=>s.stopPropagation()),this.host.container.appendChild(r),r}};function Ot(t,e,i){let o=t.width(),n=t.height(),r=1/0,s=1/0,a=-1/0,l=-1/0,c=o*2,d=n*2;for(let u of e){let h=u.getClientRect();if(!(!(h.width>1)||!(h.height>1))){if(h.x<-c||h.y<-d||h.x+h.width>o+c||h.y+h.height>n+d)return null;h.x<r&&(r=h.x),h.y<s&&(s=h.y),h.x+h.width>a&&(a=h.x+h.width),h.y+h.height>l&&(l=h.y+h.height)}}if(i&&i.width>=0&&i.height>=0){let u=t.scaleX(),h=i.x*u+t.x(),m=i.y*u+t.y();h<r&&(r=h),m<s&&(s=m),h+i.width*u>a&&(a=h+i.width*u),m+i.height*u>l&&(l=m+i.height*u)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var Mi=8,Tu=.02,ha=1,ua=.5;function pa(t,e,i,o,n){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=Ot(t,e,n);if(!s)return 0;Go(t,s,r);let a=Math.min((r.width-2*Mi)/s.width,(r.height-2*Mi)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>ua?a:Math.min(a,Iu(t.scaleX(),o));if(!(c>1+Tu)&&!(l>ua)||!(c>0)||c===1)return 1;let d=r.x+r.width/2,u=r.y+r.height/2;t.scale({x:t.scaleX()*c,y:t.scaleY()*c}),t.position({x:d+(t.x()-d)*c,y:u+(t.y()-u)*c});let h=Ot(t,e,n);return h&&Go(t,h,r),c}function Wo(t,e,i,o){let n=i??{x:0,y:0,width:t.width(),height:t.height()},r=Ot(t,e,o);return r?Go(t,r,n):!1}function Iu(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(ha,e):ha)/i}function Go(t,e,i){let o=i.x+i.width/2-(e.x+e.width/2),n=i.y+i.height/2-(e.y+e.height/2);return o===0&&n===0?!1:(t.position({x:t.x()+o,y:t.y()+n}),!0)}function Ze(t){return`${t.x()},${t.y()},${t.scaleX()}`}import{Group as Mu}from"konva/lib/Group";import{Circle as fa}from"konva/lib/shapes/Circle";import{Line as Ru}from"konva/lib/shapes/Line";import{Text as Au}from"konva/lib/shapes/Text";var Eu=6;function Dt(t){return V(t)?"#0b1220":"#ffffff"}function ma(t){let{points:e}=t;if(!e.length)return null;let i=t.categoryColor??"#6e7bff",o=0,n=0;for(let r of e)o+=r.x,n+=r.y;return{count:e.length,centroid:{x:o/e.length,y:n/e.length},fill:i,ink:Dt(i)}}var Ri=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let i of this.host.sections()){if(i.logicalId!==e&&i.id!==e)continue;let o=ma({points:this.host.ownedPoints(i),categoryColor:null});if(o)return o.centroid}return null}badgeAt(e){for(let i of this.badges)if(Math.hypot(e.x-i.centre.x,e.y-i.centre.y)<=i.radius)return i.id;return null}sync(e,i="seats"){if(this.group?.destroy(),this.group=null,this.badges=[],e>=ke){this.host.overlayLayer.batchDraw();return}let o=Math.max(this.host.stageScale(),1e-4),n=new Mu({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=ma({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(Eu/2/o,1);for(let b of a)n.add(new fa({name:"owned-seat-dot",x:b.x,y:b.y,radius:c,fill:l.fill,stroke:O("#ffffff",.55),strokeWidth:Math.max(.5,c*.28),shadowColor:l.fill,shadowBlur:c*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(i!=="seats"||r.has(s.logicalId))continue;r.add(s.logicalId);let d=this.host.sections().filter(b=>b.logicalId===s.logicalId).reduce((b,p)=>b+this.host.ownedPoints(p).length,0),u=this.host.labelAnchor(s),h=11/o,m={x:u.x,y:u.y-h*2.1};n.add(new fa({name:"owned-section-badge",x:m.x,y:m.y,radius:h,fill:l.fill,stroke:O(l.ink,.35),strokeWidth:1/o,listening:!1,perfectDrawEnabled:!1})),n.add(new Ru({x:m.x-h*.62,y:m.y,points:[-h*.22,0,-h*.02,h*.2,h*.34,-h*.26],stroke:l.ink,strokeWidth:Math.max(.6,h*.16),lineCap:"round",lineJoin:"round",listening:!1}));let f=new Au({x:m.x+h*.12,y:m.y-h*.5,text:String(d),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});n.add(f),this.badges.push({id:s.logicalId,centre:m,radius:h*1.8})}if(!n.hasChildren()){n.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(n),n.moveToTop(),this.group=n,this.host.overlayLayer.batchDraw()}};import{Text as Fu}from"konva/lib/shapes/Text";var _u=4;function Nt(t){return V(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function Bu(t,e,i,o){let n=Math.max(0,Math.min(o,e/2,i/2));t.beginPath(),t.moveTo(n,0),t.arcTo(e,0,e,i,n),t.arcTo(e,i,0,i,n),t.arcTo(0,i,0,0,n),t.arcTo(0,0,e,0,n),t.closePath()}function ga(t,e){t.padding(_u),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(o){let n=this.width(),r=this.height();o.save(),Bu(o,n,r,Math.min(r/2,8)),o.setAttr("fillStyle",e.plate),o.fill(),o.setAttr("strokeStyle",e.stroke),o.setAttr("lineWidth",1),o.stroke(),o.restore(),Fu.prototype._sceneFunc.call(this,o)})}function ba(t){return t?"seat":"section"}function ya(t){let e=new Set,i=0;for(let n of t.memberIds){let r=t.categoryKey(n);r&&t.categorySellable(r)&&e.add(r),t.seatSellable(n)&&(i+=1)}let o=[];for(let n of t.categoryOrder)e.has(n)&&o.push({key:n,name:t.categoryLabel(n)||n,price:t.categoryPrice(n),color:t.categoryColor(n)});return o.length?i?{mode:"section",title:t.name,fields:[],rows:o,notes:[],facts:[],note:null}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:B("map.soldOut")}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:B("picker.notForSale")}}function Sa(t){let e=t.place?.kind==="booth",i=e?"":Du(t.label,t.sectionLabel,t.rowLabel),o=t.place?{caption:t.place.typeWord?.trim()||B(e?"picker.booth":"picker.table"),value:t.place.name}:null,n=[t.sectionLabel,t.rowLabel?B("picker.rowLabel",{label:t.rowLabel}):null,o?o.value:null,i?B("picker.seatLabel",{label:i}):null].filter(Boolean).join(" \xB7 ")||t.label,r=[t.sectionLabel?{caption:B("picker.section"),value:t.sectionLabel}:null,t.rowLabel?{caption:B("picker.row"),value:t.rowLabel}:null,o,i?{caption:B("picker.seat"),value:i}:null].filter(c=>c!=null),s={key:t.categoryKey,name:t.categoryLabel||t.categoryKey,price:t.categoryPrice,color:t.categoryColor},a=er(t).map(c=>{let d=B(c.titleKey);return{icon:c.icon,title:d===c.titleKey?c.titleFallback:d,tone:c.tone,...c.note?{note:c.note}:{}}}),l=t.facts??[];return{mode:"seat",title:n,fields:r,rows:[s],notes:a,facts:l,note:l.length?null:Ou(t.status,t.closed)}}function Ou(t,e){return e||t==="not_for_sale"?B("picker.notForSale"):t==="booked"?B("map.statusTaken"):t==="held"?B("map.statusHeld"):null}function Du(t,e,i){let o=t;for(let n of[e,i])!n||!o.startsWith(n)||o.length<=n.length||(o=o.slice(n.length).replace(/^[\s·\-/_]+/,""));return o}var Nu=16,Hu=8;function va(t,e,i,o=Nu){let n=Hu,r=t.x+o;r+e.width>i.width-n&&(r=t.x-o-e.width);let s=t.y+o;return s+e.height>i.height-n&&(s=t.y-o-e.height),{x:Math.max(n,Math.min(r,Math.max(n,i.width-n-e.width))),y:Math.max(n,Math.min(s,Math.max(n,i.height-n-e.height)))}}var wa=16,Vo=14,ka=10.5,Gu=14,Wu=12.5,xa={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},Vu={warn:"#d8a425",premium:"#e8c15a"},zu=.1,Ku=.06,Ai=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.factsEl=null;this.noteEl=null;this.signature="";this.model=null;this.cursor=null;this.presented=null;this.mount=null;this.presentedView=null;this.viewEl=null;this.raf=0;this.attached=!1;this.lastUpdateMs=0;this.rowNames=new Map;this.rowNamesDoc=null;this.aisleIds=new Set;this.aisleDoc=null;this.placeFacts=new Map;this.sectionEntrances=new Map;this.placeDoc=null;this.onPointerMove=e=>{if(this.fromPresenter(e))return;if(this.presented=null,this.mount=null,this.presentedView=null,e.pointerType!=="mouse"){this.hide();return}let i=this.host.container.getBoundingClientRect();this.cursor={x:e.clientX-i.left,y:e.clientY-i.top},this.schedule()};this.onPointerLeave=e=>{this.fromPresenter(e)||this.hide()};this.onPointerDown=e=>{e.pointerType!=="mouse"&&!this.fromPresenter(e)&&this.hide()};this.onWheel=e=>{this.cursor&&!this.fromPresenter(e)&&this.schedule()};this.host=e}attach(){this.attached||(this.attached=!0,this.host.container.addEventListener("pointermove",this.onPointerMove),this.host.container.addEventListener("pointerleave",this.onPointerLeave),this.host.container.addEventListener("pointerdown",this.onPointerDown),this.host.container.addEventListener("wheel",this.onWheel,{passive:!0}))}destroy(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=0),this.host.container.removeEventListener("pointermove",this.onPointerMove),this.host.container.removeEventListener("pointerleave",this.onPointerLeave),this.host.container.removeEventListener("pointerdown",this.onPointerDown),this.host.container.removeEventListener("wheel",this.onWheel),this.attached=!1,this.cursor=null,this.root?.remove(),this.root=null,this.titleEl=null,this.rowsEl=null,this.notesEl=null,this.factsEl=null,this.noteEl=null,this.viewEl=null,this.signature=""}presentSeat(e,i,o,n){if(!e||!i){this.presented&&(this.presented=null,this.mount=null,this.presentedView=null,this.hide());return}e!==this.presented&&(this.presentedView=null),n!==void 0&&(this.presentedView=n),this.presented=e,this.mount=o,this.cursor=i,this.update()}hide(){this.cursor=null,this.signature="",this.model=null,this.root&&(this.root.style.display="none")}text(){let e=this.model;return!e||!this.root||this.root.style.display==="none"?"":[e.title,...e.rows.map(i=>[i.name,i.price].filter(Boolean).join(" ")),...e.notes.map(i=>[i.title,i.note].filter(Boolean).join(": ")),e.note].filter(Boolean).join(" | ")}fromPresenter(e){return!!this.mount&&e.target instanceof Node&&this.mount.contains(e.target)}schedule(){this.raf||(this.raf=requestAnimationFrame(()=>{this.raf=0,this.update()}))}update(){let e=performance.now(),i=this.cursor;if(!i)return;let o=this.host.hostCardOpen?.()?null:this.resolve(i);if(!o){this.hide(),this.lastUpdateMs=performance.now()-e;return}let n=this.ensureRoot(),r=`${o.mode}|${o.title}|${o.note??""}|${this.host.canvasBackground()}|`+o.rows.map(l=>`${l.key}:${l.price??""}:${l.color}`).join(",")+`|${o.notes.map(l=>`${l.icon}:${l.title}:${l.note??""}`).join(",")}|${o.facts.map(l=>`${l.caption}=${l.value}`).join(",")}`;r!==this.signature&&(this.signature=r,this.paint(o)),this.showView(this.presented?this.presentedView:null),this.model=o,n.style.display="block";let s=this.mount??this.host.container,a=va(i,{width:n.offsetWidth,height:n.offsetHeight},{width:s.clientWidth,height:s.clientHeight});n.style.left=`${a.x}px`,n.style.top=`${a.y}px`,this.lastUpdateMs=performance.now()-e}showView(e){let i=this.root;if(!i)return;if(!e){this.viewEl&&(this.viewEl.style.display="none");return}let o=this.viewEl;if(!o){o=document.createElement("div"),o.setAttribute("data-seat-view",""),Object.assign(o.style,{position:"relative",width:"100%",aspectRatio:"16 / 9",minWidth:"240px",backgroundSize:"cover",backgroundPosition:"center"});let r=document.createElement("span");r.textContent="View from this seat",Object.assign(r.style,{position:"absolute",left:"8px",bottom:"7px",padding:"2px 8px",borderRadius:"999px",font:"600 11px/1.4 inherit",color:"#ffffff",background:"rgba(8,12,24,0.62)"}),o.appendChild(r),this.viewEl=o}(o.parentElement!==i||i.firstChild!==o)&&i.insertBefore(o,i.firstChild);let n=`url("${e.replace(/"/g,"%22")}")`;o.style.backgroundImage!==n&&(o.style.backgroundImage=n),o.style.display="block"}resolve(e){if(this.presented)return this.seatModel(this.presented);if(ba(this.host.seatsPickable())==="seat"){let n=this.host.hoveredSeatId()??this.host.nearestSeat(e);return n?this.seatModel(n):null}let i=this.host.sectionAt(e),o=i?this.host.sectionLabel(i):null;return!i||o==null||this.host.sectionInteractive?.(i)===!1?null:ya({name:o||i,memberIds:this.host.sectionMembers(i),categoryOrder:this.host.categoryOrder(),categoryKey:n=>this.host.seat(n)?.categoryKey??null,categoryLabel:n=>this.host.categoryLabel(n),categoryPrice:n=>this.host.categoryPrice(n),categoryColor:n=>this.host.categoryColor(n),categorySellable:n=>this.host.categorySellable(n),seatSellable:n=>this.host.seatSellable(n)})}seatModel(e){let i=this.host.seat(e);if(!i)return null;let o=this.host.seatStatus(e),n=this.host.seatFacts?.(e)??null;if((o!=="free"&&!this.host.seatOwnedHold?.(e)||this.host.seatClosed(e))&&!n?.length)return null;let s=this.host.seatSectionLabel(e);return Sa({label:i.displayLabel?.trim()||i.label,rowLabel:this.rowName(i,s),sectionLabel:s,categoryKey:i.categoryKey,categoryLabel:this.host.categoryLabel(i.categoryKey),categoryPrice:this.host.categoryPrice(i.categoryKey),categoryColor:this.host.categoryColor(i.categoryKey),status:this.host.seatStatus(e),closed:this.host.seatClosed(e),...i.accessibility?.length?{accessibility:i.accessibility}:{},...i.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{},...i.commercial?{commercial:i.commercial}:{},...this.isAisleSeat(e)?{aisle:!0}:{},...this.placeOf(i),...n?.length?{facts:n}:{}})}placeOf(e){let i=this.host.chartDoc();if(!i)return{};if(this.placeDoc!==i){this.placeDoc=i,this.placeFacts.clear(),this.sectionEntrances=rt(i);for(let r of ii(i))r.type!=="table"&&r.type!=="booth"||this.placeFacts.set(r.id,{kind:r.type,name:r.displayLabel?.trim()||r.label,...r.displayType?.trim()?{typeWord:r.displayType.trim()}:{},...r.type==="booth"&&r.boothType?{boothType:r.boothType}:{},...r.entrance?.trim()?{entrance:r.entrance.trim()}:{}})}let o=this.placeFacts.get(e.rowId);if(!o)return{};let n=o.entrance??(e.sectionId?this.sectionEntrances.get(e.sectionId):void 0);return{place:{kind:o.kind,name:o.name,...o.typeWord?{typeWord:o.typeWord}:{}},...o.boothType?{boothType:o.boothType}:{},...n?{entrance:n}:{}}}isAisleSeat(e){let i=this.host.chartDoc();return i?(this.aisleDoc!==i&&(this.aisleDoc=i,this.aisleIds=hi(i)),this.aisleIds.has(e)):!1}rowName(e,i){let o=this.host.chartDoc();if(!o)return null;if(this.rowNamesDoc!==o){this.rowNamesDoc=o,this.rowNames.clear();for(let r of o.objects){if(r.type!=="row")continue;let s=r.segmentedRow?.displayLabel??r.displayLabel??r.label;s&&(this.rowNames.set(r.id,s),r.segmentedRow&&this.rowNames.set(r.segmentedRow.groupId,s))}}let n=this.rowNames.get(e.logicalRowId??e.rowId)??this.rowNames.get(e.rowId);return n?Mt(n,i??void 0)||n:null}ensureRoot(){let e=this.mount??this.host.container;if(this.root)return this.root.parentElement!==e&&e.appendChild(this.root),this.root;let i=Nt(this.host.canvasBackground()),o=document.createElement("div");o.className="sl-hover-card",o.setAttribute("aria-hidden","true"),Object.assign(o.style,{position:"absolute",left:"0",top:"0",display:"none",pointerEvents:"none",boxSizing:"border-box",minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",background:i.plate,border:`1px solid ${i.stroke}`,boxShadow:"0 6px 20px rgba(2,6,23,0.22)",fontFamily:this.host.labelFont(),lineHeight:"1.35",zIndex:"2"});let n=document.createElement("div");Object.assign(n.style,{fontSize:`${wa}px`,fontWeight:"700",padding:"10px 15px 9px",textAlign:"center",color:q(i.plate,"#0b1220")});let r=document.createElement("div");Object.assign(r.style,{display:"flex",flexDirection:"column",gap:"0"});let s=document.createElement("div");Object.assign(s.style,{display:"none",flexDirection:"column",gap:"0"});let a=document.createElement("div");Object.assign(a.style,{fontSize:`${Vo}px`,fontWeight:"600",padding:"0 15px 10px",textAlign:"center",opacity:"0.72",color:q(i.plate,"#0b1220")});let l=document.createElement("div");return Object.assign(l.style,{display:"none"}),o.append(n,r,s,l,a),e.appendChild(o),this.root=o,this.titleEl=n,this.rowsEl=r,this.notesEl=s,this.factsEl=l,this.noteEl=a,o}paint(e){let i=this.ensureRoot(),o=Nt(this.host.canvasBackground());i.style.background=o.plate,i.style.border=`1px solid ${o.stroke}`;let n=this.titleEl,r=this.rowsEl,s=this.notesEl,a=this.noteEl,l=q(o.plate,"#0b1220");if(n.replaceChildren(),n.style.color=l,n.style.paddingBottom=e.rows.length||e.note?"9px":"10px",e.fields.length){let c=e.fields[0]?.caption;n.style.display="flex",n.style.padding="0";for(let[d,u]of e.fields.entries()){let h=document.createElement("div");Object.assign(h.style,{flex:u.caption===c?"1 1 auto":"0 0 auto",minWidth:"0",padding:"9px 13px 10px",textAlign:"center",borderLeft:d?`1px solid ${o.stroke}`:"none"});let m=document.createElement("div");m.textContent=u.caption,Object.assign(m.style,{fontSize:`${ka}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let f=document.createElement("div");f.textContent=u.value,Object.assign(f.style,{marginTop:"2px",fontSize:`${wa}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),h.append(m,f),n.append(h)}}else n.style.display="block",n.style.padding="10px 15px 9px",n.textContent=e.title;r.replaceChildren();for(let c of e.rows){let d=document.createElement("div");Object.assign(d.style,{display:"flex",justifyContent:"space-between",gap:"16px",padding:"9px 15px",fontSize:`${Vo}px`,fontWeight:"700",background:c.color,color:fo(c.color)});let u=document.createElement("span");u.textContent=c.name;let h=document.createElement("span");h.textContent=c.price??"",d.append(u,h),r.appendChild(d)}this.paintNotes(s,e,o,l),this.paintFacts(this.factsEl,e,o,l),a.textContent=e.note??"",a.style.display=e.note?"block":"none",a.style.marginTop=e.note&&e.rows.length?"6px":"0",a.style.color=q(o.plate,"#0b1220")}paintFacts(e,i,o,n){if(e.replaceChildren(),!i.facts.length){e.style.display="none";return}Object.assign(e.style,{display:"flex",borderTop:`1px solid ${o.stroke}`,color:n});for(let[r,s]of i.facts.entries()){let a=document.createElement("div");Object.assign(a.style,{flex:"1 1 auto",padding:"8px 12px 9px",textAlign:"center",borderLeft:r?`1px solid ${o.stroke}`:"none"});let l=document.createElement("div");l.textContent=s.caption,Object.assign(l.style,{fontSize:`${ka}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let c=document.createElement("div");c.textContent=s.value,Object.assign(c.style,{marginTop:"2px",fontSize:`${Vo}px`,fontWeight:"700",whiteSpace:"nowrap"}),a.append(l,c),e.append(a)}}paintNotes(e,i,o,n){if(e.replaceChildren(),!i.notes.length){e.style.display="none";return}e.style.display="flex";for(let[r,s]of i.notes.entries()){let a=fo(o.plate)==="#ffffff"?xa.onDark:xa.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:n,c=s.tone==="warn"||s.tone==="premium"?ee(o.plate,Vu[s.tone],zu):ee(o.plate,n,Ku),d=document.createElement("div");Object.assign(d.style,{display:"flex",alignItems:"flex-start",gap:"9px",padding:"9px 15px",background:c,borderTop:r?`1px solid ${o.stroke}`:"none"});let u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("viewBox",`0 0 ${20} ${20}`),u.setAttribute("width","17"),u.setAttribute("height","17"),u.setAttribute("fill","none"),u.setAttribute("stroke",l),u.setAttribute("stroke-width","1.45"),u.setAttribute("stroke-linecap","round"),u.setAttribute("stroke-linejoin","round"),u.setAttribute("aria-hidden","true"),u.innerHTML=tr(s.icon),Object.assign(u.style,{flex:"none",marginTop:"1px"});let h=document.createElement("div");Object.assign(h.style,{display:"flex",flexDirection:"column",gap:"2px",minWidth:"0"});let m=document.createElement("div");if(m.textContent=s.title,Object.assign(m.style,{fontSize:`${Gu}px`,fontWeight:"750",color:s.tone==="access"?n:l}),h.appendChild(m),s.note){let f=document.createElement("div");f.textContent=s.note,Object.assign(f.style,{fontSize:`${Wu}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:n}),h.appendChild(f)}d.append(u,h),e.appendChild(d)}}};var La="#5b6db0";function Xu(t,e){if(t===e)return!0;if(!t||!e||t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0}function Ca(t,e){let i=e?new Set(e):null;Xu(i,t.seatHighlight())||(t.setSeatHighlightState(i),t.repaintSeats(),t.updateLabels(),t.draw())}function Pa(t,e){let i=t.labelLayers(),o={...i,...e};o.seatLabels===i.seatLabels&&o.rowLabels===i.rowLabels||(t.setLabelLayersState(o),t.updateLabels(),t.draw())}function Ta(t,e){e!==t.categoryColours()&&(t.setCategoryColoursState(e),t.repaintSectionsAndSeats(),t.updateLabels(),t.draw())}function K(t){let e=br(t);return e?{x:e.x,y:e.y,width:Math.max(1,e.width),height:Math.max(1,e.height)}:{x:0,y:0,width:1,height:1}}function pt(t,e,i,o){let n=o*Math.PI/180,r=Math.cos(n),s=Math.sin(n);return[{x:-e/2,y:-i/2},{x:e/2,y:-i/2},{x:e/2,y:i/2},{x:-e/2,y:i/2}].map(a=>({x:t.x+a.x*r-a.y*s,y:t.y+a.x*s+a.y*r}))}function ft(t,e,i,o,n,r){let s=o*Math.PI/180,a=Math.cos(s),l=Math.sin(s);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let u=e*(d/6-.5),h=i*(c/4-.5),m={x:t.x+u*a-h*l,y:t.y+u*l+h*a};if(!J(m,n,r))return!1}return!0}function Ia(t,e,i){let o=K(t),n={x:o.x+o.width/2,y:o.y+o.height/2},r=J(n,t,e)?[n,i]:[i],s=[];for(let l=1;l<12;l+=1)for(let c=1;c<12;c+=1){let d={x:o.x+o.width*c/12,y:o.y+o.height*l/12};J(d,t,e)&&s.push(d)}let a=[t,...e];return[...r,...s.map(l=>({point:l,room:Nn(l,a)})).sort((l,c)=>c.room-l.room).map(l=>l.point)].filter((l,c,d)=>c===d.findIndex(u=>Math.abs(u.x-l.x)<1e-6&&Math.abs(u.y-l.y)<1e-6))}function Ma(t,e){let{stageScale:i,stageX:o,stageY:n}=t;if(t.viewMode==="perspective"&&e.perspectiveAffine)return K(e.outline.map(s=>{let a=t.projectedSectionPoint(e,s);return{x:a.x*i+o,y:a.y*i+n}}));let r=e.liftWorld>0?t.isoLiftLocal(e.liftWorld):{x:0,y:0};return K(e.outline.map(s=>{let a={x:s.x+r.x,y:s.y+r.y},l=t.isoT===0?a:t.isoForward(a);return{x:l.x*i+o,y:l.y*i+n}}))}function Yu(t,e){let i=t.width*t.height;if(i<=0)return 0;let o=Math.max(0,Math.min(t.x+t.width,e.width)-Math.max(t.x,0)),n=Math.max(0,Math.min(t.y+t.height,e.height)-Math.max(t.y,0));return o*n/i}function Ra(t){let{current:e,viewport:i}=t,o=new Map;for(let a of t.sections){let l=Yu(a.bounds,i)*a.members;l<=0||o.set(a.logicalId,(o.get(a.logicalId)??0)+l)}if(!o.size)return e;let n=null,r=0;for(let[a,l]of o)l>r&&(r=l,n=a);if(!n||n===e)return e;let s=e!=null?o.get(e)??0:0;return r>s*1.35?n:e}import{Text as $u}from"konva/lib/shapes/Text";function Uu(t,e){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height}var Ie=class{constructor(){this.cells=new Map}insert(e){for(let i of this.keys(e)){let o=this.cells.get(i);o?o.push(e):this.cells.set(i,[e])}}collisionCount(e){let i=new Set,o=0;for(let n of this.keys(e))for(let r of this.cells.get(n)??[])i.has(r)||(i.add(r),Uu(e,r)&&o++);return o}keys(e){let i=Math.floor(e.x/At),o=Math.floor((e.x+Math.max(0,e.width))/At),n=Math.floor(e.y/At),r=Math.floor((e.y+Math.max(0,e.height))/At),s=[];for(let a=n;a<=r;a++)for(let l=i;l<=o;l++)s.push(`${l}:${a}`);return s}};var zo=new WeakMap;function je(){if(typeof document>"u"||!("fonts"in document))return 0;let t=document.fonts;if(!t)return 0;let e=zo.get(t);if(e)e.status!==t.status&&(e.generation+=1,e.status=t.status);else{e={generation:0,status:t.status},zo.set(t,e);let i=()=>{let o=zo.get(t);o&&(o.generation+=1,o.status=t.status)};t.addEventListener?.("loadingdone",i),t.addEventListener?.("loadingerror",i)}return e.generation}var Aa=new WeakMap,Ea=new WeakMap;function Fa(t){let e=new Map;return{get(i){let o=JSON.stringify([i.text,i.fontSize,i.rotation]),n=e.get(o);return n||(n=new $u({text:i.text,fontSize:i.fontSize,fontStyle:"700",fontFamily:t,rotation:i.rotation,listening:!1}),n.offsetX(n.width()/2),n.offsetY(n.height()/2),e.set(o,n)),n},destroy(){for(let i of e.values())i.destroy()}}}function qu(t){let e=t.labelFont(),i=je(),o=Ea.get(t.rowLabelPlan);if(o?.font===e&&o.fontGeneration===i)return o.index;let n=new Ie,r=Fa(e);for(let s of t.rowLabelPlan){let a=r.get(s),l=t.rowLabelBox(a,{x:s.x,y:s.y}),c=s.automaticAway,d=c?Math.max(7,Math.min(16,s.fontSize*.75))*4*(Math.abs(c.x)+Math.abs(c.y)):0;n.insert({x:l.x-d,y:l.y-d,width:l.width+d*2,height:l.height+d*2})}return r.destroy(),Ea.set(t.rowLabelPlan,{font:e,fontGeneration:i,index:n}),n}function Zu(t){let e=qu(t),i=[...t.freeTextById.values()].map(({node:l})=>{let c=l.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});return{x:c.x-ie,y:c.y-ie,width:c.width+ie*2,height:c.height+ie*2}}).filter(l=>e.collisionCount(l)>0),o=JSON.stringify([t.labelFont(),je(),t.seatR,i]),n=Aa.get(t.rowLabelPlan);if(n?.key===o&&n.seats===t.seatById)return n.boxes;let r=new Ie;for(let l of i)r.insert(l);let s=Fa(t.labelFont()),a=t.rowLabelPlan.map(l=>{let c=s.get(l),d=t.resolveAutomaticRowLabelPosition(c,l,r),u=t.rowLabelBox(c,d);return r.insert(u),u});return s.destroy(),Aa.set(t.rowLabelPlan,{key:o,seats:t.seatById,boxes:a}),a}function _a(t,e){let i=t.sections.filter(f=>f.id===e||f.logicalId===e),o=i.map(f=>{if(t.viewMode==="perspective"&&f.perspectiveAffine)return K(f.outline.map(g=>t.projectedSectionPoint(f,g)));let b=f.liftWorld>0?t.isoLiftLocal(f.liftWorld):{x:0,y:0},p=f.outline.map(g=>{let y={x:g.x+b.x,y:g.y+b.y};return t.isoT===0?y:t.isoForward(y)});return K(p)});if(!o.length)return null;let n=Math.min(...o.map(f=>f.x)),r=Math.min(...o.map(f=>f.y)),s=Math.max(...o.map(f=>f.x+f.width)),a=Math.max(...o.map(f=>f.y+f.height)),l=new Set(i.flatMap(f=>f.memberIds));for(let f of l){let b=t.seatById.get(f);if(!b)continue;let p=t.renderedSeatPoint(b);n=Math.min(n,p.x-t.seatR),r=Math.min(r,p.y-t.seatR),s=Math.max(s,p.x+t.seatR),a=Math.max(a,p.y+t.seatR)}let c=f=>{[f.x,f.y,f.width,f.height].every(Number.isFinite)&&(n=Math.min(n,f.x),r=Math.min(r,f.y),s=Math.max(s,f.x+f.width),a=Math.max(a,f.y+f.height))},d=f=>{let b={x:f.x+f.width/2,y:f.y+f.height/2};return i.some(p=>J(b,p.outline,p.holes))};for(let{node:f,backdrop:b}of t.freeTextById.values()){let p=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(p)&&(c(p),b&&c(b.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:f}of t.iconNodeById.values()){let b=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(b)&&c(b)}let u=Zu(t);t.rowLabelPlan.forEach((f,b)=>{(f.focusKeys??[]).some(g=>g===e||i.some(y=>g===y.id||g===y.logicalId))&&c(u[b])});let h=Math.max(s-n,a-r),m=Math.max(t.seatR*2,Math.min(24,h*.025));return{x:n-m,y:r-m,width:Math.max(1,s-n+m*2),height:Math.max(1,a-r+m*2)}}import{Rect as ju}from"konva/lib/shapes/Rect";import{Text as Ba}from"konva/lib/shapes/Text";var Ko="\0";function Qu(t){let e=0;for(let i=0;i<t.length;i++){let o=t[i],n=t[(i+1)%t.length];e+=o.x*n.y-n.x*o.y}return Math.abs(e)/2}function Ju(t,e){let i=t.filter(m=>Number.isFinite(m.centroid.x)&&Number.isFinite(m.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let o=i.map(m=>({member:m,weight:Math.max(1,Qu(m.outline))})),n=o.reduce((m,f)=>m+f.weight,0),r=o.reduce((m,f)=>({x:m.x+f.member.centroid.x*f.weight/n,y:m.y+f.member.centroid.y*f.weight/n}),{x:0,y:0}),s={x:r.x-e.x,y:r.y-e.y},a=Math.hypot(s.x,s.y);if(!(a>1e-6))return null;let l={x:s.x/a,y:s.y/a},c=i.map(m=>{let f={x:m.centroid.x-e.x,y:m.centroid.y-e.y},b={x:m.centroid.x-r.x,y:m.centroid.y-r.y};return{member:m,depth:f.x*l.x+f.y*l.y,lateral:Math.abs(b.x*-l.y+b.y*l.x)}}).sort((m,f)=>f.depth-m.depth||m.member.id.localeCompare(f.member.id)),d=c[0].depth-c[c.length-1].depth,u=c[0].depth-d/3,h=c.filter(m=>m.depth>=u);return h.sort((m,f)=>m.lateral-f.lateral||f.depth-m.depth||m.member.id.localeCompare(f.member.id)),h[0].member}function ep(t){let i=[...B("map.fromPrice",{price:Ko}).toLocaleLowerCase()],o=i.findIndex(n=>n!==Ko&&n.toLocaleUpperCase()!==n.toLocaleLowerCase());return o>=0&&(i[o]=i[o].toLocaleUpperCase()),i.join("").split(Ko).join(t)}function tp(t,e){let i=o=>o.trim().replace(/\s+/g," ").toLocaleLowerCase();return i(t)===i(e)}function ip(t,e){let i=t.trim();return!i||/^\d{1,3}$/.test(i)?!1:!e.some(o=>tp(o.label,i))}function Oa(t,e){if(!e.zones?.length||!t.sections.length)return;let i=Ms(t.canvasBackground),o=new Map;for(let n of t.sections)n.zone&&(o.get(n.zone)??o.set(n.zone,[]).get(n.zone)).push(n);for(let n of e.zones){let r=o.get(n.id);if(!r||!r.length||!t.derivedFloorGroups&&!ip(n.label,r))continue;let s=r[0];for(let p of r)p.centroid.y<s.centroid.y&&(s=p);t.derivedFloorGroups&&(s=Ju(r,n.focalPoint??e.focalPoint)??s);let a=s.centroid.x,l=s.centroid.y,c=1/0,d=-1/0;for(let p of r)for(let g of p.outline)g.x<c&&(c=g.x),g.x>d&&(d=g.x);let u=isFinite(c)&&d>c?d-c:0,h=1/0;for(let p of r)for(let g of p.memberIds){let y=t.seatById.get(g),S=y&&t.catPrice.get(y.categoryKey);typeof S=="number"&&S<h&&(h=S)}let m=new ju({x:a,y:l,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:i.plate,stroke:O(n.color??s.outlineTint,is),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(m);let f=new Ba({x:a,y:l,text:n.label,fontSize:Si,fontStyle:qr,letterSpacing:0,fontFamily:t.labelFont(),fill:i.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});f.offsetX(f.width()/2),f.offsetY(f.height()/2),t.bgLayer.add(f);let b=null;isFinite(h)&&(b=new Ba({x:a,y:l,text:ep($e(h,t.currency)),fontSize:vi,fontStyle:Zr,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),b.offsetX(b.width()/2),t.bgLayer.add(b)),t.zones.push({id:n.id,anchor:{x:a,y:l},back:m,background:i.plate,name:n.label,spanWorld:u,label:f,sub:b})}}function Da(t,e){let i=t.zones.find(({back:d})=>{if(!d.visible()||d.opacity()<.5)return!1;let u=d.getClientRect();return e.x>=u.x&&e.x<=u.x+u.width&&e.y>=u.y&&e.y<=u.y+u.height});if(!i)return!1;let o=t.doc,n=o?.floorOverview==="combined"&&!o.zones?.length?o.floors?.find(d=>Zn(d.id)===i.id):void 0;if(n)return t.enterFloor(n.id),!0;let r=t.sections.filter(d=>d.zone===i.id).flatMap(d=>d.outline);if(!r.length)return!1;let s=Math.min(...r.map(d=>d.x)),a=Math.max(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=Math.max(...r.map(d=>d.y));return t.frame({x:s,y:l,width:Math.max(1,a-s),height:Math.max(1,c-l)}),!0}var op=new Set,Na=16,np=5,Ei=class{constructor(e,i,o=8e3){this.chunks=e;this.host=i;this.warmSeats=o;this.wanted=new Set;this.built=new Map;this.loose=new Map;this.located=new Map;this.queue=[];this.pinQueue=[];this.frame=0;this.stepping=!1;this.stopped=!1}locate(e){let i=this.located.get(e);if(i===void 0){i=null;let o=this.host.sectionOf?[this.host.sectionOf(e)]:[...this.chunks.keys()];for(let n of o){let r=n===void 0?-1:this.chunks.get(n)?.findIndex(s=>s.id===e)??-1;if(r>=0){i={section:n,seat:this.chunks.get(n)[r],index:r};break}}this.located.set(e,i)}return i??void 0}isResident(e){let i=this.locate(e);return!!i&&(this.loose.has(e)||(this.built.get(i.section)??0)>i.index)}sync(e,i=op){if(this.stopped)return;this.wanted=new Set(e),this.queue=e.filter(r=>(this.built.get(r)??0)<(this.chunks.get(r)?.length??0));for(let r of e)if(this.built.has(r)){let s=this.built.get(r);this.built.delete(r),this.built.set(r,s)}let o=0;for(let[r,s]of[...this.built].reverse()){if(this.wanted.has(r)||(o+=s,o<=this.warmSeats))continue;let a=[];this.chunks.get(r).slice(0,s).forEach((l,c)=>{i.has(l.id)?this.loose.set(l.id,{section:r,seat:l,index:c}):a.push(l)}),a.length&&this.host.remove(a),this.built.delete(r)}let n=[];for(let[r,s]of this.loose)i.has(r)||this.wanted.has(s.section)||(n.push(s.seat),this.loose.delete(r));n.length&&this.host.remove(n),this.pinQueue=[];for(let r of i)this.locate(r)&&!this.isResident(r)&&this.pinQueue.push(r);!this.frame&&!this.stepping&&(this.queue.length||this.pinQueue.length)&&(this.frame=this.host.schedule(()=>this.step()))}step(){if(this.frame=0,this.stopped)return;this.stepping=!0;let e=this.host.now(),i=!1,o=()=>!i||this.host.now()-e<np;for(;this.pinQueue.length&&o();){let n=[];for(let r of this.pinQueue.splice(0,Na)){let s=this.locate(r);s&&!this.isResident(r)&&(n.push(s.seat),this.loose.set(r,s))}n.length&&this.host.build(n),i=!0}for(;this.queue.length&&o();){let n=this.queue[0],r=this.chunks.get(n);if(!r){this.queue.shift();continue}let s=this.built.get(n)??0,a=Math.min(s+Na,r.length),l=[];for(let c=s;c<a;c++)this.loose.delete(r[c].id)||l.push(r[c]);l.length&&this.host.build(l),this.built.set(n,a),a===r.length&&this.queue.shift(),i=!0}this.host.draw(),this.stepping=!1,!this.stopped&&!this.frame&&(this.queue.length||this.pinQueue.length)&&(this.frame=this.host.schedule(()=>this.step()))}finish(){this.cancel();for(let[e,i]of this.chunks){let o=i.slice(this.built.get(e)??0).filter(n=>!this.loose.has(n.id));o.length&&this.host.build(o),this.built.set(e,i.length)}this.loose.clear(),this.queue=[],this.pinQueue=[],this.host.draw()}cancel(){this.stopped=!0,this.frame&&this.host.cancel(this.frame),this.frame=0}get pending(){return(this.queue.length>0||this.pinQueue.length>0)&&!this.stopped}get nodeCount(){return[...this.built.values()].reduce((e,i)=>e+i,0)+this.loose.size}};function Ha(t,e,i,o=1e3){let n=new Set,r=s=>{for(let a of s){if(n.size>=o)return!1;a&&n.add(a)}return n.size<o};return r(t)&&r(e)&&r(i),n}import{Circle as fp}from"konva/lib/shapes/Circle";import{Line as mp}from"konva/lib/shapes/Line";import{Rect as gp}from"konva/lib/shapes/Rect";import{Text as bp}from"konva/lib/shapes/Text";function Me(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Re(t,e){return Me(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var Ga=.35,Wa=.7,Qe="#0b1220",mt="#ffffff",Va="#0b1220",Xo="#232c40",za="#8b93a7";function Yo(t,e,i="normal"){let o=t?"bold":i;return e?`italic ${o}`.trim():o}var Uo="#f7f8fb";import{Text as Xa}from"konva/lib/shapes/Text";var Ka="500",rp=2.5;function sp(t,e){return t>=oe||e&&t>=gi}function ap(t){return t.effectiveScale<gi?!1:t.focusActive||t.stageWidth<j}function lp(t,e,i){return i&&e>=gi?Math.max(t,Hr/Math.max(e,1e-4)):t}function cp(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:o,effectiveScale:n}=t;if(!(i>o)||!(i>0))return e;let r=z/Math.max(n,1e-4),s=e*o/i;return Math.max(Math.min(lt,r),s)}function $o(t,e){let i=(e?1:3)*Math.min(1,t/te);return Math.max(1,t*2-i)}function Ya(t){let e=new Map;for(let n of t){let r=e.get(n.rowId);r?r.push(n):e.set(n.rowId,[n])}let i=[];for(let n of e.values())if(!(n.length<2))for(let r=1;r<n.length;r+=1){let s=Math.hypot(n[r].x-n[r-1].x,n[r].y-n[r-1].y);s>0&&Number.isFinite(s)&&i.push(s)}if(!i.length)return 0;i.sort((n,r)=>n-r);let o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o])/2}function Ua(t,e){return e>0?Math.min(t,e/2):t}function $a(t){return Fi(qo(t))}function qo(t){let e=$o(t,!1),i=$o(te,!1),o=e>0?i/e:1;return be/Math.max(1,o)}function Fi(t){return z/Math.max(t,1e-4)/vo(1,!1,z)}function qa(t){return Fi(t)*ki}function dp(t,e,i){let o=t.seatLabelContainer(e);i.getParent()!==o&&o.add(i)}function Za(t){let e=t.exportMode?Math.max(t.effScale(),oe):t.effScale(),i=ap({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),o=t.exportMode?e:vo(e,t.labelsWereVisible(),z),n=t.labelLayers(),r=n.seatLabels&&sp(o,i);t.onLabelVisibilityChange(r),t.setSeatLabelRungOpen(r);let s=f=>{let b=t.worldToScreen({x:f.x(),y:f.y()}),p=f.width()*e,g=f.height()*e;return b.x-p/2>=0&&b.y-g/2>=0&&b.x+p/2<=t.stage.width()&&b.y+g/2<=t.stage.height()};for(let[f,b]of t.boothLabelById){let p=t.circleById.get(f);b.visible(Se(b.fontSize(),o)&&!!p?.isVisible()&&t.focusedSeatOpacity(f,p?.getAbsoluteOpacity()??1)>=.5&&s(b))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let a=new Set,l=0;if(r)for(let f of t.visibleSeatCandidates()){if(f.kind==="booth")continue;let b=t.worldToScreen(f);if(b.x<-20||b.x>t.stage.width()+20||b.y<-20||b.y>t.stage.height()+20||t.accessGlyphById.has(f.id)&&t.accessGlyphShouldShow(f.id))continue;let p=t.circleById.get(f.id);if(!p?.isVisible()){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}let g=t.statusById.get(f.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(f.id)&&(g==="booked"||g==="not_for_sale"||g==="held"&&!t.ownedHold.has(f.id))){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(f.id)){t.seatLabelDrops.set(f.id,"selection-tick");continue}if(t.focusedSeatOpacity(f.id,p.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}let x=t.renderedSeatPoint(f),w=t.viewMode==="perspective"?t.perspectiveSeatScale.get(f.id)??1:1,v=lp(be*t.seatLabelScale(f),e,i),k=si(f.displayLabel??f.label),P=p?t.seatLabelInk(f,p):t.seatPreferredLabelInk(f),C=t.seatLabelPool.get(f.id);C?(C.position(x),C.text(k),C.fontSize(v),C.fontFamily(t.labelFont()),C.fill(P),C.offset({x:0,y:0}),C.scale({x:1,y:1})):(C=new Xa({x:x.x,y:x.y,text:k,fontSize:v,fontStyle:Ka,fontFamily:t.labelFont(),fill:P,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(f.id,C));let T=$o(t.seatR,i);if(C.fontSize(cp({authoredFontSize:v,measuredWidth:C.width(),maxWidth:T,effectiveScale:e})),C.width()>T+.01){t.seatLabelDrops.set(f.id,"label-overflows-marker");continue}if(!Se(C.fontSize(),e)){t.seatLabelDrops.set(f.id,"below-minimum-size");continue}if(C.offsetX(C.width()/2),C.offsetY(C.height()/2),C.scale({x:w,y:w}),dp(t,f.id,C),!s(C)){t.seatLabelDrops.set(f.id,"outside-viewport");continue}if(a.add(f.id),t.seatLabelById.set(f.id,C),++l>=Gr)break}for(let[f,b]of t.seatLabelPool)a.has(f)||(b.destroy(),t.seatLabelPool.delete(f));let c=new Ie;for(let{node:f}of t.freeTextById.values()){if(!f.isVisible())continue;let b=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});c.insert({x:b.x-ie,y:b.y-ie,width:b.width+ie*2,height:b.height+ie*2})}let d=new Ie,u=null,h=()=>{if(u)return u;u=new Ie;for(let f of t.seatLabelById.values()){if(!f.isVisible())continue;let b=f.getClientRect({skipShadow:!0,skipStroke:!0});u.insert({x:b.x,y:b.y,width:b.width,height:b.height})}return u},m=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*rp;if(n.rowLabels)for(let f of hp(t.rowLabelPlan)){let b=t.rowLabelPlan[f],p=t.focusedSectionId!=null&&b.focusKeys?.includes(t.focusedSectionId),g=Math.max(e,1e-4),y=p?Math.max(b.fontSize,Rt/g):b.fontSize,S=Math.max(Math.min(y,Nr(t.stage.width())/g),p?Rt/g:0);if(!r&&(!p||!m)||!p&&!Se(S,o))continue;let x=t.worldToScreen({x:b.x,y:b.y});if(x.x<-40||x.x>t.stage.width()+40||x.y<-40||x.y>t.stage.height()+40)continue;let w=new Xa({x:b.x,y:b.y,text:b.text,fontSize:S,fontStyle:Ka,fontFamily:t.labelFont(),fill:b.ink,rotation:b.rotation,opacity:b.opacity,shadowColor:"#05070c",shadowBlur:b.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:b.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});b.pill&&ga(w,b.pill),w.offsetX(w.width()/2),w.offsetY(w.height()/2);let v=t.resolveAutomaticRowLabelPosition(w,b,c);w.position(v),w.setAttr("rowLabel",!0),b.rowKey&&w.setAttr("rowKey",b.rowKey),w.setAttr("focusKeys",b.focusKeys??[]),t.rowLabelGroup.add(w);let k=w.getClientRect({skipShadow:!0,skipStroke:!0}),P=6,C=k.x<P?P-k.x:k.x+k.width>t.stage.width()-P?t.stage.width()-P-k.x-k.width:0,T=k.y<P?P-k.y:k.y+k.height>t.stage.height()-P?t.stage.height()-P-k.y-k.height:0,L=v;if(C||T){let M=t.labelGroup.getAbsoluteTransform(),R=M.point(v);L=M.copy().invert().point({x:R.x+C,y:R.y+T}),w.position(L);let A=w.getClientRect({skipShadow:!0,skipStroke:!0});if(h().collisionCount({x:A.x,y:A.y,width:A.width,height:A.height})>0){w.destroy();continue}}let I=t.rowLabelBox(w,L);if(d.collisionCount(I)>0){w.destroy();continue}if(b.automaticAway&&c.collisionCount(I)>0){w.destroy();continue}c.insert(I),d.insert(I)}t.isoT>0&&t.viewMode!=="perspective"&&t.applyUprightLabels(),t.overlayLayer.batchDraw()}function hp(t){let e=n=>n.focusKeys?.length?n.focusKeys.join(" "):"",i=[],o=0;for(;o<t.length;){let n=e(t[o]),r=o;for(;r+1<t.length&&e(t[r+1])===n;)r++;if(n){i.push(o),r>o&&i.push(r);for(let s=o+1;s<r;s++)i.push(s)}else for(let s=o;s<=r;s++)i.push(s);o=r+1}return i}function Zo(t){let e=Math.max(t,1e-4);return{kind:"marker",diameter:e*2,labelFontSize:qo(e)}}function up(t){let e=gt(t),i=Math.min(e.width,e.height);return{kind:"block",diameter:i>0?i:te*2,labelFontSize:ye({width:e.width,height:e.height,text:t.label})}}function gt(t){let e=t.points;if(!e||e.length<3)return{width:Math.abs(t.width),height:Math.abs(t.height)};let i=1/0,o=1/0,n=-1/0,r=-1/0;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(i=Math.min(i,s.x),n=Math.max(n,s.x),o=Math.min(o,s.y),r=Math.max(r,s.y));return Number.isFinite(i)?{width:n-i,height:r-o}:{width:Math.abs(t.width),height:Math.abs(t.height)}}function ja(t,e){let i=Zo(e.markerRadius),o=null;for(let n of t){let r=n.kind==="booth"?up({...e.blockDims.get(n.rowId)??{width:te*2,height:te*2},label:n.displayLabel??n.label}):i;(!o||r.labelFontSize<o.labelFontSize||r.labelFontSize===o.labelFontSize&&r.diameter<o.diameter)&&(o=r)}return o??i}function pp(t){return qa(t.labelFontSize)}function Qa(t){return Fi(t.labelFontSize)}function _i(t){let e=Math.max(t.diameter,1e-4);return Math.max(ae,ci/e)}function Ja(t){return Math.max(pp(t),_i(t)*ki)}function el(t){let e=[...t.seats].sort((i,o)=>(t.perspectiveSeatDepth.get(o.id)??0)-(t.perspectiveSeatDepth.get(i.id)??0));for(let i of e){if(i.kind==="booth"){yp(t,i);continue}let o=t.seatContainer(i.id),n=Fs({x:i.x,y:i.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:gr(i.glyph,t.catByKey.get(i.categoryKey)),wheelchairBay:i.wheelchairSpaceType==="no-seat"});if(n instanceof Ue&&t.glyphMarkers.push(n),n.setAttr("seatId",i.id),t.circleById.set(i.id,n),t.paintSeat(n,i.id),o.add(n),i.accessible){if(i.wheelchairSpaceType!=="no-seat"){let r=new fp({x:i.x,y:i.y,radius:t.seatR+1.5,stroke:It(i.accessibility,{colorblind:t.colorblind,canvasBackground:t.canvasBackground}),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.accessRingById.set(i.id,r),o.add(r)}if(st(i.accessibility??[])){let r=t.buildAccessGlyph(i,typeof n.fill()=="string"?n.fill():"");t.accessGlyphById.set(i.id,r),o.add(r)}}}}function yp(t,e){let i=t.seatContainer(e.id),o=t.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},n=e.x,r=e.y,s;if(o.points&&o.points.length>=3?(s=new mp({x:e.x,y:e.y,points:o.points.flatMap(c=>[c.x,c.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),n=e.x+o.points.reduce((c,d)=>c+d.x,0)/o.points.length,r=e.y+o.points.reduce((c,d)=>c+d.y,0)/o.points.length):s=new gp({x:e.x,y:e.y,width:o.width,height:o.height,offsetX:o.width/2,offsetY:o.height/2,rotation:o.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s.setAttr("seatId",e.id),t.circleById.set(e.id,s),i.add(s),o.nameHidden){t.paintSeat(s,e.id);return}let a=e.displayLabel??e.label,l=new bp({x:n,y:r,text:a,fontSize:o.nameSize??ye({...gt(o),text:a}),fontStyle:"600",fontFamily:t.labelFont(),fill:t.theme.seatLabelColor??Qe,listening:!1,perfectDrawEnabled:!1});l.offsetX(l.width()/2),l.offsetY(l.height()/2),l.visible(!1),t.setHasBoothText(),t.boothLabelById.set(e.id,l),i.add(l),t.paintSeat(s,e.id)}function tl(t,e,i,o){let n=null,r=1/0,s=t.stage.scaleX()||1;for(let a of t.seats){if(!o?.includeUnavailable&&!t.selection.has(a.id)&&!t.isSelectable(a.id))continue;let l=t.worldToScreen(a),c=t.viewMode==="perspective"?t.perspectiveSeatScale.get(a.id)??1:1,d=t.seatR*s*c+i,u=Math.hypot(l.x-e.x,l.y-e.y);u<=d&&u<r&&(r=u,n=a.id)}return n}function il(t){if(!t.objectFloor.size)return null;let e=t.stage.getPointerPosition();if(!e)return null;let i=t.screenToWorld(e),o=null,n=1/0;for(let r of t.seats){let s=t.renderedSeatPoint(r),a=s.x-i.x,l=s.y-i.y,c=a*a+l*l;c<n&&(n=c,o=r.rowId)}return o?t.objectFloor.get(o)??null:null}import{Circle as Wp}from"konva/lib/shapes/Circle";import{Group as Ll}from"konva/lib/Group";import{Rect as Vp}from"konva/lib/shapes/Rect";import{Text as zp}from"konva/lib/shapes/Text";var Ae=1.12;function bt(t,e,i,o){if(e.width<=0||e.height<=0)return t.scaleX();let n=o??{x:0,y:0,width:t.width(),height:t.height()},r=Math.min(n.width/(e.width*Ae),n.height/(e.height*Ae));return Y(r,i.min,i.max)}var Ht=.55;function Gt(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function jo(t){let{stage:e,box:i,bounds:o,viewport:n,centreScreen:r}=t,s=t.ratio??_t,a=e.scaleX(),l=bt(e,i,o,n)/Math.max(a,1e-4);if(l>=s||l<=1/s)return!1;let c=r.x-(n.x+n.width/2),d=r.y-(n.y+n.height/2);return Math.hypot(c,d)<=Math.min(n.width,n.height)*.02}function ol(t,e,i,o){let n=Y(e,o.min,o.max),r=t.scaleX();if(n===r)return!1;let s=(i.x-t.x())/r,a=(i.y-t.y())/r;return t.scale({x:n,y:n}),t.position({x:i.x-s*n,y:i.y-a*n}),!0}function nl(t,e,i,o,n,r){let s=n??{x:0,y:0,width:t.width(),height:t.height()},a=Math.min(s.width/(e.width*Ae),s.height/(e.height*Ae)),l=o??i.min,c=Y(Math.max(a,l),i.min,Math.max(l,Gt(i,r)));t.scale({x:c,y:c}),t.position({x:s.x+s.width/2-(e.x+e.width/2)*c,y:s.y+s.height/2-(e.y+e.height/2)*c})}function rl(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function Qo(t,e){let i=null;for(let o of t){let n=e.get(o)?.logicalId;if(!n||i!=null&&i!==n)return null;i=n}return i}function sl(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var Sp=11;function vp(t){let e=dt(Sp,t),i=yi(t),o=[];for(let n=Math.round(e);n>=i;n-=1)o.push(n);return o.length?o:[i]}var wp=4,kp=2;function xp(t){let e=t.trim();if(!e)return null;if(/^[a-z]{1,3}\d{1,4}[a-z]?$/i.test(e))return e;let i=e.match(/\d+/g);if(i?.length){let o=i[0];for(let n of i)n.length>=o.length&&(o=n);return o}return e.length<=4?e:null}function al(t,e,i){let o=t.numberLabel,n=xp(t.label);if(!n)return o.visible(!1),!1;o.text()!==n&&o.text(n),o.visible(!0),o.rotation(0);let r=wp/e;for(let s of vp(i)){o.fontSize(s/e),o.offsetX(o.width()/2),o.offsetY(o.height()/2);for(let a of[t.centroid,...t.labelAnchors])if(o.position(a),ft(a,o.width()+r,o.height()+r,0,t.outline,t.holes))return!0}return o.position(t.centroid),!1}function Lp(t,e,i){let o=i({x:t.x(),y:t.y()}),n=t.width()*e,r=t.height()*e;return{x:o.x-n/2,y:o.y-r/2,w:n,h:r}}function Cp(t,e,i){return t.x<e.x+e.w+i&&e.x<t.x+t.w+i&&t.y<e.y+e.h+i&&e.y<t.y+t.h+i}function ll(t,e,i,o){let n=[];for(let r of e){if(r.label.opacity()<=.05)continue;let s=r.back.getAbsolutePosition(),a=r.back.width()*i,l=r.back.height()*i;n.push({x:s.x-a/2,y:s.y-l/2,w:a,h:l})}if(n.length)for(let r of t){if(r.numberLabel.opacity()<=.05)continue;let s=Lp(r.numberLabel,i,o);for(let a of n)if(Cp(s,a,kp)){r.numberLabel.opacity(0);break}}}function cl(t){let e=new Map;for(let i of t){if(i.numberLabel.opacity()<=.05)continue;let o=e.get(i.logicalId);o?o.push(i):e.set(i.logicalId,[i])}for(let i of e.values()){if(i.length<2)continue;let o=i[0];for(let n of i)n.labelArea>o.labelArea&&(o=n);for(let n of i)n!==o&&n.numberLabel.opacity(0)}}function pl(t,e){let i=t.sectionHeat.get(e.id)??t.sectionHeat.get(e.logicalId)??(e.zone?t.sectionHeat.get(e.zone):void 0);if(i==null||i<=0){e.outlinePoly.stroke(O(e.outlineTint,.5)),e.outlinePoly.fill(O(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=ee("#f4b740","#ef4444",i);e.outlinePoly.stroke(O(o,.72+i*.25)),e.outlinePoly.fill(O(o,.08+i*.13)),e.outlinePoly.strokeWidth(2+i*3.5),e.outlinePoly.shadowColor(o),e.outlinePoly.shadowBlur(4+i*12),e.outlinePoly.shadowOpacity(.25+i*.45)}function en(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function fl(t,e,i,o){if(!e)return 0;let n=0;for(let r of t){if(i(r)!=="free")continue;let s=o(r);s&&Me(s,e)&&(n+=1)}return n}function Pp(t,e){return en(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*bs?"nearly-gone":"normal"}function ml(t,e){let i=Pp(t,e),o=t.accessFilterActive&&t.sectionAccessibleFree(e)<=0,n=t.blockPaint?.({id:e.logicalId,label:e.label,free:e.free,total:e.total,state:i})??null;e.stateWord=n?.stateWord??null;let r=Ts(t.canvasBackground,i,o?null:n?n.tint??null:e.shellCategoryColor);e.shellFill=r.fill,e.shellStroke=r.stroke,e.blockPoly.fill(r.fill),e.blockPoly.stroke(r.stroke),e.subLabel.text(i==="sold-out"?B("map.soldOut"):B("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function gl(t,e){return ee(e,V(t)?"#ffffff":"#000000",ds)}function tn(t,e,i=0){let o=cs-i;return!e||t.length<=o?t:`${t.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function Tp(t,e){return bl(t,e)!=null}function bl(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function yl(t,e,i){let o=tn(t.label,e,i?i.length+1:0),n=t.stateWord?[`${o} \xB7 ${t.stateWord}`]:[];return i?[...n.map(r=>`${i} ${r}`),`${i} ${o}`,i]:[...n,o]}function Ip(t,e,i){let o=yl(t,e,i),n=(t.nameLabelBadgeOnly?o[1]:o[0])??o[0];t.nameLabel.text()!==n&&t.nameLabel.text(n),t.nameLabel.fontStyle(ls),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*Oe:0)}function Mp(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}var Rp=.05;function Sl(t){if(!t.seatCount)return!1;let e=0;for(let o of t.sections)e+=o.memberIds.length;return(t.seatCount-Math.min(e,t.seatCount))/t.seatCount<=Rp}function vl(t,e){let i,o;t.reducedMotion?(i=e<=we?1:0,o=e<=Ke?1:0):(i=Y((ke-e)/(ke-we),0,1),o=Y((we-e)/(we-Ke),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,o=0);let n=!t.floorOverview&&!t.focusedSectionId&&e<Z;n&&(i=1),t.zones.length||(o=0);let r=t.viewMode==="perspective"&&t.glideInProgress&&t.seatCount>2500;t.seatLayer.opacity(r?0:Sl(t)?n?0:1-i:1);let s=t.stageScaleX,a=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>ko);a&&t.setLodScale(e);let l=t.focusedSectionId,c=t.stageWidth<j,d=c&&n&&t.zones.length===0,u=le(t.canvasBackground),h=Y((i-.2)/.8,0,1),m=new Set(t.zones.map(p=>p.id)),f=new Set;for(let p of t.sections){let g=t.hasFocusDimOverlay?1:l&&p.id!==l&&p.logicalId!==l&&p.zone!==l?Te:1,y=bl(t,p);y&&p.zone&&f.add(p.zone);let S=Math.min(g,sl(p.memberCategoryKeys,t.categoryFilter)?Te:1,t.accessFilterActive&&!y?Te:1);p.outlinePoly.opacity(n?0:(1-i)*S),p.blockPoly.opacity(Yr*i*S);let x=t.sectionIsOwned(p);p.blockPoly.stroke(x?t.selectionColor:p.shellStroke||u.sectionStroke),p.blockPoly.strokeWidth((x?Ur:Xe)/Math.max(s,1e-4));let w=p.blockPoly.fill(),v=typeof w=="string"?w:p.baseFill,k=Rs(v,p.explicitInk,p.preferredInk,hr);p.nameLabel.fill(k),p.subLabel.fill(k),Ip(p,c,y);let P=p.zone!=null&&m.has(p.zone);a&&(h>.01||p.externalLabel)&&_p(t,p,s,yl(p,c,y),!P);let C=y||!P?1:1-o;p.nameLabel.opacity(p.nameLabelFits?(p.externalLabel?1:h)*C*S:0),p.subLabel.opacity(0);let T=d&&!p.nameLabelFits,L=P&&o>.01;a&&(p.numberLabelFits=(L||T)&&al(p,s,t.stageWidth)),p.numberLabelFits&&p.numberLabel.fill(pe(v,p.explicitInk,p.preferredInk)),p.numberLabel.opacity(p.numberLabelFits?(T?h:L?o:0)*S:0)}let b=o*(1-t.isoT);for(let p of t.zones){let g=t.accessFilterActive&&!f.has(p.id)?Te:1,y=p.label.visible()?b*g:0;p.back.opacity(y),p.label.opacity(y),p.sub&&p.sub.opacity(dl(t,p)?0:y),a&&Bp(t,p,s)}if(!t.glideInProgress&&(h>.01||b>.01)){Ep(t,s,d),Ap(t.sections);for(let p of t.zones){let g=p.label.opacity();p.back.opacity(g),p.sub&&p.sub.opacity(dl(t,p)?0:g)}}(b>.01||d)&&(b>.01&&ll(t.sections,t.zones,s,t.worldToScreen),cl(t.sections));for(let p of t.sections)Mp(p);t.bgLayer.batchDraw()}function dl(t,e){return t.stageWidth<j||!e.sub||!e.sub.visible()}function Ap(t){let e=new Map;for(let i of t)(e.get(i.logicalId)??e.set(i.logicalId,[]).get(i.logicalId)).push(i);for(let i of e.values()){if(i.length<2)continue;let o=i.filter(n=>n.nameLabel.opacity()>.05).sort((n,r)=>{let s=K(n.outline),a=K(r.outline);return a.width*a.height-s.width*s.height});for(let n of o.slice(1))n.nameLabel.opacity(0)}}function Ep(t,e,i=!1){let n=[],r=c=>{let d=t.worldToScreen({x:c.x(),y:c.y()}),u=K(pt({x:0,y:0},c.width()*e,c.height()*e,c.rotation()));return{x:d.x-u.width/2,y:d.y-u.height/2,w:u.width,h:u.height}};for(let c of t.zones){if(c.label.opacity()<=.05)continue;let d=c.back.getAbsolutePosition(),u=c.back.width()*e,h=c.back.height()*e;n.push({node:c.label,tier:0,section:!1,zone:c,box:{x:d.x-u/2,y:d.y-h/2,w:u,h}})}for(let c of t.sections){if(c.nameLabel.opacity()>.05){let d=Tp(t,c)?-1:1;n.push({node:c.nameLabel,tier:d,section:!0,area:c.labelArea,box:r(c.nameLabel)})}i&&c.numberLabel.opacity()>.05&&n.push({node:c.numberLabel,tier:1,section:!1,area:c.labelArea,box:r(c.numberLabel)})}let s=t.landmarks.map(c=>{let d=t.worldToScreen({x:c.x,y:c.y}),u=t.worldToScreen({x:c.x+c.width,y:c.y+c.height});return{x:Math.min(d.x,u.x),y:Math.min(d.y,u.y),w:Math.abs(u.x-d.x),h:Math.abs(u.y-d.y)}});if(n.length<2&&!s.length)return;n.sort((c,d)=>c.tier-d.tier||(d.area??0)-(c.area??0)||c.box.y-d.box.y||c.box.x-d.box.x);let a=[...s],l=c=>a.some(d=>c.x<d.x+d.w+4&&d.x<c.x+c.w+4&&c.y<d.y+d.h+4&&d.y<c.y+c.h+4);for(let c of n){if(!l(c.box)){a.push(c.box);continue}let d=!1;if(c.zone)for(let u of rs){if(u===0)continue;let h={...c.box,y:c.box.y+u};if(!l(h)){Jo(c.zone,0,u/e),a.push(h),d=!0;break}}if(c.section){let u=c.node.fontSize(),h=c.node.y(),m=c.node.letterSpacing()>0;for(let f of wo){let b=u*f;if(b*e<Ft(t.stageWidth))break;Ee(c.node,b,h),m&&(c.node.letterSpacing(c.node.fontSize()*Oe),c.node.offsetX(c.node.width()/2));let p=r(c.node);if(!l(p)){a.push(p),d=!0;break}}d||(Ee(c.node,u,h),m&&(c.node.letterSpacing(c.node.fontSize()*Oe),c.node.offsetX(c.node.width()/2)))}d||c.node.opacity(0)}}function Ee(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}function Fp(t,e,i){let o=K(t);return ye({width:o.width*i,height:o.height*i,text:e})}function _p(t,e,i,o,n=!1){e.subLabelFits=!1;let r=t.stageWidth<j,s=Ft(t.stageWidth),a=xo(ct*e.labelScale,t.stageWidth,i,t.fitScale,void 0,s),c=n&&!(t.fitScale>0&&i>t.fitScale)&&Sl(t)?Math.max(a,Fp(e.outline,o[0]??e.label,i)):a;if(e.externalLabel){e.nameLabel.text(o[0]),e.nameLabel.rotation(e.externalLabel.rotation),Ee(e.nameLabel,c/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[h,m]of o.entries()){e.nameLabel.text(m);let f=K(e.outline),b=e.authoredLabelRotation!=null?[e.authoredLabelRotation]:f.height>f.width*ms?[0,-90]:[0];for(let p of b)for(let g of e.labelAnchors)for(let y=c;y>=s;y-=1){e.nameLabel.rotation(p),Ee(e.nameLabel,y/i,e.nameLabel.y()),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Oe),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(g);let S=fs/i;if(ft(g,e.nameLabel.width()+S,e.nameLabel.height()+S,p,e.outline,e.holes)){e.nameLabelFits=!0,e.nameLabelBadgeOnly=h>0;return}}}e.nameLabel.text(o[0]),e.nameLabelBadgeOnly=!1;let d=e.labelAnchors[0]??e.centroid;e.nameLabel.position(d),e.nameLabel.rotation(e.authoredLabelRotation??0),Ee(e.nameLabel,s/i,d.y),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Oe),e.nameLabel.offsetX(e.nameLabel.width()/2));let u=K(e.outline);e.nameLabelFits=e.nameLabel.width()<=u.width&&e.nameLabel.height()<=u.height}function hl(t,e,i){let o=n=>(t.text(n),t.width());if(!(o(e)<=i)){for(let n=e.length-1;n>=1;n-=1)if(o(`${e.slice(0,n).trimEnd()}\u2026`)<=i)return;o("\u2026")}}function Bp(t,e,i){let o=wi(t.stageWidth),n=t.stageWidth<j,r=e.sub!=null&&!n,s=(n?jr:Jr)*o/i,a=(n?Qr:es)*o/i,l=xo(Si,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Ee(e.label,l/i,e.anchor.y),r&&(Ee(e.sub,dt(vi,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*$r),e.sub.offsetX(e.sub.width()/2));let c=n?t.stageWidth*os/i-s*2:1/0,d=!n&&e.spanWorld>0?e.spanWorld*ns-s*2:1/0,u=Math.min(c,d),h=()=>Math.max(e.label.width(),r?e.sub.width():0);if(r&&h()>u&&(r=!1),h()>u)for(let k of wo){let P=Math.max(Be,l*k);if(P>=e.label.fontSize()*i-.001||(Ee(e.label,P/i,e.anchor.y),e.label.width()<=u))break}if(e.label.width()>u&&(hl(e.label,e.name,Math.max(u,1)),Op(e.label.text())<Dp(e.name)&&hl(e.label,e.name,Math.max(c,1)),Ee(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){ul(e);return}e.label.visible(!0),e.back.visible(!0);let m=r?3*o/i:0;e.label.x(e.anchor.x),r?e.sub.x(e.anchor.x):e.sub&&e.sub.opacity(0);let f=Math.max(e.label.width(),r?e.sub.width():0)+s*2,b=e.label.height()+(r?m+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(m+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+m)/2),e.back.position(e.anchor),e.back.size({width:f,height:b}),e.back.offset({x:f/2,y:b/2}),e.back.cornerRadius(ts*o/i),e.back.strokeWidth(1/i);let p=e.back.getAbsolutePosition(),g=6,y=f*i;if(y>t.stageWidth-g*2){ul(e);return}let S=y/2,w=(Y(p.x,g+S,t.stageWidth-g-S)-p.x)/i;Math.abs(w)>.001&&Jo(e,w,0);let v=62+b*i/2;p.y<v&&Jo(e,0,(v-p.y)/i)}function Op(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function Dp(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function ul(t){t.label.visible(!1),t.label.opacity(0),t.back.visible(!1),t.back.opacity(0),t.sub&&(t.sub.visible(!1),t.sub.opacity(0))}function Jo(t,e,i){t.label.x(t.label.x()+e),t.label.y(t.label.y()+i),t.sub&&(t.sub.x(t.sub.x()+e),t.sub.y(t.sub.y()+i)),t.back.x(t.back.x()+e),t.back.y(t.back.y()+i)}function Np(t,e){if(!t.length)return null;let i=1/0,o=1/0,n=-1/0,r=-1/0;for(let s of t)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(s.x<i&&(i=s.x),s.y<o&&(o=s.y),s.x>n&&(n=s.x),s.y>r&&(r=s.y));return!Number.isFinite(i)||!Number.isFinite(o)?null:{x:i-e,y:o-e,width:n-i+e*2,height:r-o+e*2}}function rn(t,e=0){let i=new Map;for(let n of t){let r=`${n.rowId}|${n.categoryKey}`,s=i.get(r);s||(s={categoryKey:n.categoryKey,points:[]},i.set(r,s)),s.points.push({x:n.x,y:n.y})}let o=[];for(let[n,r]of i){let s=Np(r.points,e);s&&o.push({id:n,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return o}function on(t,e){let i=Math.max(0,Math.max(t.x-(e.x+e.width),e.x-(t.x+t.width))),o=Math.max(0,Math.max(t.y-(e.y+e.height),e.y-(t.y+t.height)));return Math.hypot(i,o)}function nn(t,e){let i=Math.min(t.x,e.x),o=Math.min(t.y,e.y);return{x:i,y:o,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-o}}function wl(t){if(!t.length)return 0;let e=[...t].sort((o,n)=>o-n),i=Math.floor(e.length/2);return e.length%2?e[i]:(e[i-1]+e[i])/2}function Hp(t){if(!t.length)return 0;let e=wl(t.map(o=>Math.min(o.bounds.width,o.bounds.height)));if(t.length<2)return e;let i=[];for(let o=0;o<t.length;o+=1){let n=1/0;for(let r=0;r<t.length;r+=1)o!==r&&(n=Math.min(n,on(t[o].bounds,t[r].bounds)));Number.isFinite(n)&&i.push(n)}return wl(i)+e}function sn(t,e){if(!t.length)return[];let i=Hp(t)*(e?.gapRows??2),o=e?.minRows??2,n=e?.minSeats??12,r=new Map;for(let a of t){let l=r.get(a.categoryKey);l?l.push(a):r.set(a.categoryKey,[a])}let s=[];for(let[a,l]of r){let c=[...l].sort((h,m)=>h.bounds.y-m.bounds.y||h.bounds.x-m.bounds.x||h.id.localeCompare(m.id)),d=[];for(let h of c){let m=d.find(f=>on(f.bounds,h.bounds)<=i);m?(m.bounds=nn(m.bounds,h.bounds),m.rowIds.push(h.id),m.seatCount+=h.seatCount):d.push({categoryKey:a,bounds:{...h.bounds},rowIds:[h.id],seatCount:h.seatCount})}let u=!0;for(;u&&d.length>1;){u=!1;e:for(let h=0;h<d.length;h+=1)for(let m=h+1;m<d.length;m+=1)if(!(on(d[h].bounds,d[m].bounds)>i)){d[h].bounds=nn(d[h].bounds,d[m].bounds),d[h].rowIds.push(...d[m].rowIds),d[h].seatCount+=d[m].seatCount,d.splice(m,1),u=!0;break e}}for(let h of d)h.rowIds.length<o&&h.seatCount<n||(h.rowIds.sort(),s.push(h))}return s.sort((a,l)=>a.bounds.y-l.bounds.y||a.bounds.x-l.bounds.x||a.categoryKey.localeCompare(l.categoryKey)),s}function kl(t){let e=null;for(let i of t)e=e?nn(e,i.bounds):{...i.bounds};return e}function xl(t,e){let i=null,o=1/0;for(let n of t){let{x:r,y:s,width:a,height:l}=n.bounds;if(e.x<r||e.x>r+a||e.y<s||e.y>s+l)continue;let c=a*l;c<o&&(i=n,o=c)}return i}function Pl(t){return t*.3}function Cl(t){return Pl(t)*2+t*.42}var Bi=class{constructor(e){this.host=e;this.group=null;this.labels=[];this.revealed=!1;this.visible=!1;this.fadeRaf=0;this.lastFontKey="";this.pressOnChart=!0}get all(){return this.labels.map(e=>e.cluster)}clear(){this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),this.group?.destroy(),this.group=null,this.labels=[],this.visible=!1,this.revealed=!1,this.lastFontKey=""}destroy(){this.clear()}rebuild(){if(this.clear(),this.pressOnChart=!0,this.syncCursor(!1),this.host.hasSections()||this.host.exportMode)return;let e=sn(rn(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),o=le(i),n=gl(i,i),r=q(n,o.sectionInk),s=new Ll({listening:!1,opacity:0,visible:!1});for(let a of e){let l=this.host.categoryLabel(a.categoryKey);if(!l)continue;let c={x:a.bounds.x+a.bounds.width/2,y:a.bounds.y+a.bounds.height/2},d=new Ll({listening:!1}),u=new Vp({...c,width:0,height:0,fill:n,stroke:o.sectionStroke,strokeWidth:Xe,opacity:hs,listening:!1,perfectDrawEnabled:!1}),h=new Wp({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),m=new zp({...c,text:l,fontSize:ct,fontStyle:Ye,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(u),d.add(h),d.add(m),s.add(d),this.labels.push({cluster:a,pill:d,plate:u,swatch:h,text:m,label:l})}if(!this.labels.length){s.destroy();return}this.group=s,this.host.labelLayer.add(s)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let i=this.host.seatR()*2,o=this.host.exportMode||this.host.viewMode()!=="flat"||this.host.seatsPickable()&&e<ae||e>=this.host.readableScale();return this.revealed=o||Fr(So(i,e),So(i,ae),this.revealed),!this.revealed&&this.size(this.host.stage.scaleX(),this.host.stage.width())&&this.host.labelLayer.batchDraw(),this.revealed||this.capOnePerCategory(),this.applyFilterDim(),this.applyVisibility(!this.revealed),!0}focusCluster(e){if(this.host.viewMode()!=="flat"||this.host.hasSections()||this.host.seatsPickable())return!1;let i=this.clusterAt(this.host.screenToWorld(e));if(!i)return!1;let o=this.host.seatR()*2,n={x:i.bounds.x-o,y:i.bounds.y-o,width:i.bounds.width+o*2,height:i.bounds.height+o*2},r=this.host.stage;if(bt(r,n,this.host.zoomBounds(),this.host.framingViewport())<=r.scaleX()*_t)return!1;let a=this.diveTarget(n);return a?(this.host.focusRegion(a,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,i){let o=this.host.stage,n=this.host.framingViewport(),r=this.host.zoomBounds(),s=bt(o,e,r,n),a=Math.min(Math.max(this.host.readableScale(),this.host.pickableScale()),r.max);if(s>=a)return e;let l=n.width/(a*Ae),c=n.height/(a*Ae);if(!(l>0)||!(c>0))return null;let d=i??{x:e.x+e.width/2,y:e.y+e.height/2};return{x:d.x-l/2,y:d.y-c/2,width:l,height:c}}glideTowardTap(e){if(this.host.viewMode()!=="flat")return!1;let i=this.host.stage.scaleX(),o=ys(i,this.host.pickableScale());if(o==null||o<=i*_t)return!1;let n=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(o*Ae),a=r.height/(o*Ae);return!(s>0)||!(a>0)?!1:(this.host.focusRegion({x:n.x-s/2,y:n.y-a/2,width:s,height:a}),!0)}setPressLandsOnChart(e){this.pressOnChart=e}syncCursor(e){if(this.host.exportMode)return;let i=this.host.viewMode()==="flat"&&!this.host.seatsPickable()?this.pressOnChart?"zoom-in":"default":e?"pointer":"default";for(let o of[this.host.stage.container(),this.host.stage.content])o&&o.style.cursor!==i&&(o.style.cursor=i)}clusterAt(e){let i=xl(this.all,e);if(i)return i;if(!this.visible)return null;for(let o of this.labels){if(!o.pill.visible())continue;let n=o.plate.width()/2,r=o.plate.height()/2;if(Math.abs(e.x-o.text.x())<=n&&Math.abs(e.y-o.text.y())<=r)return o.cluster}return null}size(e,i){let o=Math.max(e,1e-4),n=i<j,r=`${o.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=dt(ct,i),a=us/o,l=ps/o;for(let c of this.labels){let{text:d,plate:u,swatch:h,cluster:m}=c;d.text(tn(c.label,n)),d.fontStyle(n?as:Ye);let f=s,b=0;for(;d.fontSize(Math.max(1,f/o)),d.letterSpacing(d.fontSize()*Oe),b=Cl(d.fontSize())+d.width()+a*2,!(b<=m.bounds.width||f<=Be);)f=Math.max(Be,f-1);let p={x:m.bounds.x+m.bounds.width/2,y:m.bounds.y+m.bounds.height/2},g=d.height()+l*2,y=b-a*2,S=p.x-y/2;h.radius(Pl(d.fontSize())),h.position({x:S+h.radius(),y:p.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:S+Cl(d.fontSize()),y:p.y}),u.size({width:b,height:g}),u.offset({x:b/2,y:g/2}),u.cornerRadius(g/2),u.strokeWidth(Xe/o),u.position(p)}return!0}capOnePerCategory(){if(this.labels.length<2)return;let e=this.viewportWorldRect(),i={x:e.x+e.width/2,y:e.y+e.height/2},o=new Map;for(let r of this.labels){let s=r.cluster.bounds;if(s.x>e.x+e.width||s.x+s.width<e.x||s.y>e.y+e.height||s.y+s.height<e.y)continue;let a=Math.hypot(s.x+s.width/2-i.x,s.y+s.height/2-i.y),l=o.get(r.cluster.categoryKey);(!l||a<l.distance||a===l.distance&&r.cluster.seatCount>l.entry.cluster.seatCount)&&o.set(r.cluster.categoryKey,{entry:r,distance:a})}let n=!1;for(let r of this.labels){let s=o.get(r.cluster.categoryKey)?.entry===r;r.pill.visible()!==s&&(r.pill.visible(s),n=!0)}n&&this.host.labelLayer.batchDraw()}viewportWorldRect(){let e=this.host.framingViewport(),i=this.host.screenToWorld({x:e.x,y:e.y}),o=this.host.screenToWorld({x:e.x+e.width,y:e.y+e.height});return{x:i.x,y:i.y,width:o.x-i.x,height:o.y-i.y}}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),i=!1;for(let o of this.labels){let n=e&&!e.has(o.cluster.categoryKey)?.22:1;o.pill.opacity()!==n&&(o.pill.opacity(n),i=!0)}i&&this.host.labelLayer.batchDraw()}boundsForSeats(e,i){if(!e.length)return null;let o=rn(e,this.host.seatR()),n=sn(o);n.length||(n=o.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=kl(n);if(!r)return null;let s=n.reduce((a,l)=>l.seatCount>a.seatCount?l:a,n[0]);return{bounds:{x:r.x-i,y:r.y-i,width:r.width+i*2,height:r.height+i*2},anchor:{x:s.bounds.x+s.bounds.width/2,y:s.bounds.y+s.bounds.height/2},singleBlock:n.length===1&&e.every(a=>a.x>=r.x&&a.x<=r.x+r.width&&a.y>=r.y&&a.y<=r.y+r.height)}}applyVisibility(e){let i=this.group;if(!i||e===this.visible)return;if(this.visible=e,this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),i.visible(!0),this.host.reducedMotion()){i.opacity(e?1:0),i.visible(e),this.host.labelLayer.batchDraw();return}let o=i.opacity(),n=e?1:0,r=performance.now(),s=a=>{if(this.host.destroyed()||!this.group){this.fadeRaf=0;return}let l=Math.min(1,(a-r)/90);i.opacity(o+(n-o)*l),l>=1&&i.visible(n>0),this.host.labelLayer.batchDraw(),this.fadeRaf=l<1?requestAnimationFrame(s):0};this.fadeRaf=requestAnimationFrame(s)}};import{Circle as Kp}from"konva/lib/shapes/Circle";import{Line as Xp}from"konva/lib/shapes/Line";function Tl(t,e,i,o){let n=t.seatRadius(),r=new Kp({x:i.x,y:i.y,radius:n,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),s=t.viewMode()==="perspective"?t.perspectiveSeatScale(e):1;r.scale({x:s,y:s}),t.overlayLayer.add(r);let a=performance.now(),l=620,c=d=>{if(!r.getLayer())return;let u=Math.max(0,Math.min(1,(d-a)/l));r.radius(n*(1+u*1.8)),r.opacity(.9*(1-u)),t.overlayLayer.batchDraw(),u<1?requestAnimationFrame(c):(r.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(c)}function Il(t,e,i){for(let o of e){let n=t.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(u=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,u))):o.outline.map(u=>{let h=o.liftWorld>0?t.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:u.x+h.x,y:u.y+h.y}}),r=n.reduce((u,h)=>({x:u.x+h.x,y:u.y+h.y}),{x:0,y:0});r.x/=n.length,r.y/=n.length;let s=new Xp({x:r.x,y:r.y,points:n.flatMap(u=>[u.x-r.x,u.y-r.y]),closed:!0,stroke:i,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:i,shadowBlur:14,shadowOpacity:.7});t.overlayLayer.add(s),t.overlayLayer.batchDraw();let a=()=>{s.getLayer()&&(s.destroy(),t.overlayLayer.batchDraw())};if(t.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=u=>{if(t.isDestroyed()||!s.getLayer())return;let h=Math.max(0,Math.min(1,(u-l)/c)),f=1+(1-Math.pow(1-h,3))*.04;s.scale({x:f,y:f}),s.opacity(.92*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as jp}from"konva/lib/Group";import{Shape as Qp}from"konva/lib/Shape";import{Group as Yp}from"konva/lib/Group";import{Shape as Up}from"konva/lib/Shape";function $p(t,e,i){let o=e.length,n={x:(e[o-1].x+e[0].x)/2,y:(e[o-1].y+e[0].y)/2};t.moveTo(n.x,n.y);for(let r=0;r<o;r+=1){let s=e[r],a=e[(r+1)%o],l=e[(r-1+o)%o],c=Math.min(Math.hypot(s.x-l.x,s.y-l.y)/2,Math.hypot(a.x-s.x,a.y-s.y)/2);t.arcTo(s.x,s.y,a.x,a.y,Math.max(0,Math.min(i,c)))}t.closePath()}function qp(t,e){let i=1/0,o=1/0,n=-1/0,r=-1/0,s=(a,l)=>{!Number.isFinite(a)||!Number.isFinite(l)||(a<i&&(i=a),l<o&&(o=l),a>n&&(n=a),l>r&&(r=l))};for(let a of t)s(a.x,a.y);if(e){let a=e.start;s(a.x,a.y);for(let l of e.segments){if(s(l.end.x,l.end.y),l.kind==="arc")for(let c of Zp(l,a))s(c.x,c.y);else l.kind==="bezier"&&(s(l.control1.x,l.control1.y),s(l.control2.x,l.control2.y));a=l.end}}return!(n>=i)||!(r>=o)?{x:0,y:0,width:0,height:0}:{x:i,y:o,width:n-i,height:r-o}}function Zp(t,e){let{center:i,radius:o}=t;if(!(o>0))return[];let n=Math.PI*2,r=d=>(d%n+n)%n,s=Math.atan2(e.y-i.y,e.x-i.x),a=Math.atan2(t.end.y-i.y,t.end.x-i.x),l=r(t.clockwise?a-s:s-a)||n,c=[];for(let d=0;d<4;d+=1){let u=d*(Math.PI/2);r(t.clockwise?u-s:s-u)<=l&&c.push({x:i.x+o*Math.cos(u),y:i.y+o*Math.sin(u)})}return c}function Je(t,e,i,o){let n=mo(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0,s=new Up({...i,sceneFunc(l,c){l.beginPath();let d=h=>{if(h.length){if(r>0&&h.length>=3)return $p(l,h,r);l.moveTo(h[0].x,h[0].y);for(let m=1;m<h.length;m+=1)l.lineTo(h[m].x,h[m].y);l.closePath()}};o?(h=>{l.moveTo(h.start.x,h.start.y);let m=h.start;for(let f of h.segments)f.kind==="line"?l.lineTo(f.end.x,f.end.y):f.kind==="arc"?l.arc(f.center.x,f.center.y,f.radius,Math.atan2(m.y-f.center.y,m.x-f.center.x),Math.atan2(f.end.y-f.center.y,f.end.x-f.center.x),!f.clockwise):l.bezierCurveTo(f.control1.x,f.control1.y,f.control2.x,f.control2.y,f.end.x,f.end.y),m=f.end;l.closePath()})(o):d(t);for(let h of Xn(e)){let m=mo(h)>0;d(m===n?[...h].reverse():h)}l.fillStrokeShape(c)},perfectDrawEnabled:!1}),a=qp(t,o);return s.getSelfRect=()=>({...a}),s}var yt=class extends Yp{constructor(){super(...arguments);this.viewportCulled=!1}setViewportCulled(i){i!==this.viewportCulled&&(this.viewportCulled=i,i||super._clearSelfAndDescendantCache())}isViewportCulled(){return this.viewportCulled}drawScene(...i){return this.viewportCulled?this:super.drawScene(...i)}drawHit(...i){return this.viewportCulled?this:super.drawHit(...i)}_clearSelfAndDescendantCache(i){if(!this.viewportCulled){super._clearSelfAndDescendantCache(i);return}this._clearCache(i)}};function Ml(t,e){if(!e.length)return null;let i=new jp({listening:!1});for(let o of e){let n=t.viewMode==="perspective"&&o.perspectiveAffine,r=n?o.outline.map(a=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,a))):o.outline,s=n?o.holes.map(a=>a.map(l=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,l)))):o.holes;i.add(Je(r,s,{fill:xs,stroke:O("#ffffff",.1),strokeWidth:1,listening:!1},n?void 0:o.outlinePath))}return t.bgLayer.add(i),i.moveToTop(),i}function Rl(t,e){let{bounds:i}=t,n=Math.max(i.width,i.height,1)*4+1e3,r=[{x:i.x-n,y:i.y-n},{x:i.x+i.width+n,y:i.y-n},{x:i.x+i.width+n,y:i.y+i.height+n},{x:i.x-n,y:i.y+i.height+n}],s=new Qp({fill:t.canvasBackground,opacity:1-Te,listening:!1,perfectDrawEnabled:!1,sceneFunc:(a,l)=>{let c=u=>{if(u.length){a.moveTo(u[0].x,u[0].y);for(let h=1;h<u.length;h++)a.lineTo(u[h].x,u[h].y);a.closePath()}};a.beginPath(),c(r);let d=[];for(let u of e){let h=t.viewMode==="perspective"&&u.perspectiveAffine?u.outline.map(m=>t.perspectiveLocalPoint(t.projectedSectionPoint(u,m))):u.outline.map(m=>{let f=u.liftWorld>0?t.isoLiftLocal(u.liftWorld):{x:0,y:0};return{x:m.x+f.x,y:m.y+f.y}});d.push(h)}d.push(...t.focusedRowLabelCutouts?.()??[]),a.save();for(let u of d)u.length<3||(a.beginPath(),c(r),c(u),a.clip("evenodd"));a.beginPath(),c(r),a.fillStrokeShape(l),a.restore()}});return t.overlayLayer.add(s),s.moveToTop(),s}var Jp=.2;function Al(t,e){return t.startsWith("#")?ee(e,t,Jp):t}var Ol=.5,U=Math.SQRT1_2,ef="#f3f4f6",El=4;function tf(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?Ol:Math.min(1,Math.max(0,e))}function of(t){return t==="booked"||t==="not_for_sale"?vs:Ss}function Fl(t,e){return Number.parseInt(t.slice(e,e+2),16)}function _l(t){let e=t.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,i,o,n]=e.toLowerCase();return`#${i}${i}${o}${o}${n}${n}`}function nf(t,e,i){let o=_l(t),n=_l(e);if(!o||!n)return t;let r=Math.min(1,Math.max(0,i)),s="#";for(let a=1;a<7;a+=2){let l=Math.round(Fl(o,a)*(1-r)+Fl(n,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function Bl(t,e,i,o){let n=i*4,r=e*U,s=-e*U,a=o*U*2*n,l=o*-U*2*n,c=r+n*U,d=s+n*U,u=r-n*U,h=s-n*U;t.beginPath(),t.moveTo(c,d),t.lineTo(u,h),t.lineTo(u+a,h+l),t.lineTo(c+a,d+l),t.closePath(),t.clip()}function rf(t,e){let i=e*4,o=Math.max(e*.45,1);t.beginPath();for(let n=-El;n<=El;n++){let r=n*o*2,s=r+o,a=r*U,l=-r*U,c=s*U,d=-s*U;t.moveTo(a+i*U,l+i*U),t.lineTo(a-i*U,l-i*U),t.lineTo(c-i*U,d-i*U),t.lineTo(c+i*U,d+i*U),t.closePath()}t.clip()}function Oi(t,e){t._sceneFunc(e)}function Dl(t){let e=this,i=e.attrs,o=i.markRadius||1,n=i.fill,r=e.getStage(),s=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(o*2*s<16){i.fill=i.markMidtone??n,Oi(e,t),i.fill=n;return}let l=(1-2*(i.markFraction??Ol))*o;t.save(),Bl(t,l,o,1),i.fill=i.markBase??n,Oi(e,t),t.restore(),t.save(),Bl(t,l,o,-1),i.fill=i.markFill??n,Oi(e,t),i.markHatch&&(rf(t,o),i.fill=ef,Oi(e,t)),t.restore(),i.fill=n}function sf(t,e,i,o,n,r){let s=tf(e),a=of(i),l=t.attrs;l.markFraction=s,l.markBase=o,l.markFill=a,l.markMidtone=nf(o,a,1-s),l.markHatch=r,l.markRadius=n>0?n:1,t.fill(l.markMidtone),t.stroke(""),t.strokeWidth(0),t.dash([]),t.opacity(1),t.sceneFunc(Dl)}function af(t){t.setAttr("sceneFunc",void 0)}function Ni(t){return t.attrs.sceneFunc===Dl}var Di=class{constructor(){this.marks=new Map}get size(){return this.marks.size}get(e){return this.marks.get(e)??null}has(e){return this.marks.has(e)}clear(){this.marks.clear()}merge(e,i){let o=new Set;for(let[n,r]of Object.entries(e))i.has(n)&&(r&&r.kind==="partial"?(this.marks.set(n,r),o.add(n)):this.marks.delete(n)&&o.add(n));return o}paint(e,i,o,n,r,s,a){let l=a?void 0:this.marks.get(i);if(!l){Ni(e)&&af(e);return}sf(e,l,o,n,r,s)}};var Nl="#9ca3af";var lf="#f4b740",cf="#854d0e",df="#1a1200",hf="#f1f4f9",uf="#1a2234",pf="#475569",ff="#c3cbdc";function mf(t){return t==="held"||t==="booked"||t==="not_for_sale"}function Hl(t,e=!1,i=!1){if(!mf(t))return null;if(e){if(t==="not_for_sale"){let o=i?ff:pf;return{fill:i?uf:hf,stroke:o,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"cross",glyphInk:o}}return t==="booked"?{fill:Nl,stroke:"",strokeWidth:0,dash:[],opacity:.75,scale:1}:{fill:lf,stroke:cf,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"clock",glyphInk:df}}return{fill:Nl,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}}function Gl(t){let{focusedId:e}=t;if(!e)return null;let i=new Set([e]),o=t.sectionOf(e);if(o!=null){for(let c of t.seats){let d=t.seatId(c);t.sectionOf(d)===o&&i.add(d)}return i}let n=t.seats.find(c=>t.seatId(c)===e);if(!n)return i;let r=t.seatPoint(n),s=t.seatPitch>0?t.seatPitch:t.seatRadius*2,a=6*(s>0?s:1),l=a*a;for(let c of t.seats){let d=t.seatPoint(c),u=d.x-r.x,h=d.y-r.y;u*u+h*h<=l&&i.add(t.seatId(c))}return i}function Wl(t,e,i){let o=i(t);return o!=null&&o===i(e)}var Hi=Object.freeze([]),gf=.18;function Vl(t,e,i){let o=t.seat(i),n=t.seatStatus(i),r=t.isSelected(i),s=t.categoryColor(o.categoryKey),a=t.boothLabel(i),l=t.canvasBackground(),c=t.selectionColor();e.dash(Hi),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let d=n==="held"&&t.isOwnedHold(i),u=t.organizer?.()??!1,h=d?null:Hl(n,u,u&&!V(l));if(h?(e.fill(h.fill),e.stroke(h.stroke),e.strokeWidth(h.strokeWidth),e.dash(h.dash),e.opacity(h.opacity),h.scale!==1&&e.scale({x:h.scale,y:h.scale})):d?(e.fill(de(s,c===mt?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===mt?de(s,.28):s),t.seatMarks.paint(e,i,n,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),Ni(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&n==="free"&&(e.stroke(It(o.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),e.strokeWidth(r?3:2),e.dash([3,2])),a){a.text(h?"":o.displayLabel??o.label);let T=t.boothExtent(o.rowId);a.fontSize(T?.nameSize??(T?ye({...T,text:o.displayLabel??o.label}):Ge)),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??Qe),a.offsetX(a.width()/2),a.offsetY(a.height()/2)}let m=n==="free"||n==="held"&&!t.isOwnedHold(i),f=()=>{let T=e.fill();typeof T=="string"&&e.fill(Al(T,l))},b=t.accessFilter();if(b&&m&&!r){let T=Re(o,b);T==="other"?(f(),e.opacity(Math.min(e.opacity(),Ga))):T==="companion"&&e.opacity(Math.min(e.opacity(),Wa))}let p=t.categoryHighlight();p&&n==="free"&&!r&&o.categoryKey!==p&&e.opacity(.25);let g=t.seatHighlight();g&&!r&&!g.has(i)&&e.opacity(Math.min(e.opacity(),gf));let y=t.categoryFilter();y&&m&&!r&&!y.has(o.categoryKey)&&(f(),e.opacity(.22)),t.commercialLimitedFilter()&&n==="free"&&!r&&(o.commercial?.restrictedView||o.commercial?.obstructedView)&&e.opacity(.22);let S=t.dimmedSections();if(S.size){let T=t.seatSection(i);(T?S.has(T.id)||S.has(T.logicalId)||T.zone!=null&&S.has(T.zone):S.has(ir))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(ws),e.stroke(""),e.strokeWidth(0),e.dash(Hi),e.opacity(ks),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let x=t.boothLabel(i)??t.seatLabel(i);if(x){x.fill(t.seatLabelInk(o,e));let T=!a&&(r||d);x.visible(Se(x.fontSize(),t.effScale())&&e.opacity()>=.5&&!T)}let w=t.organizerGlyph,v=h?.glyph??null,k=Ni(e)||t.closedSections().size>0&&t.seatInClosedSection(i);if(w&&v&&!k){let T=a?t.boothExtent(o.rowId):void 0,L=T?Math.min(T.width,T.height)/2:t.seatRadius();w.apply(e,v,h.glyphInk??"",L)}else w?.isPainted(e)&&w.clear(e);let P=t.accessGlyph(i);if(P){let T=e.fill();P.fill(li(typeof T=="string"?T:"")),P.opacity(e.opacity()),P.visible(t.accessGlyphShouldShow(i))}let C=t.accessRing(i);C&&(C.stroke(It(o.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),C.opacity(e.opacity()),C.visible(t.accessRingShouldShow(i)))}function Gi(t,e){let i=null,o=1/0;for(let[n,r]of t){if(!r.getLayer())continue;let s=r.getClientRect(),a=s.x+s.width/2,l=s.y+s.height/2,c=Math.max(s.width/2,22),d=Math.max(s.height/2,22),u=Math.abs(e.x-a),h=Math.abs(e.y-l);if(u>c||h>d)continue;let m=u*u+h*h;m<o&&(o=m,i=n)}return i}function Wi(t){return t?.getAttr?.("seatId")??void 0}var an=.85,bf=.38,yf=Object.freeze([3,3]);function Sf(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function zl(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function vf(t){let e=null,i=0,o=()=>{i=0,!(!e||t.destroyed?.())&&(t.viewMode()!=="flat"||t.seatsPickable()||(t.clusterLabels.setPressLandsOnChart(!zl(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return n=>{e=n,i||(i=requestAnimationFrame(o))}}function Kl(t){t.attachHoverCard();let e=vf(t);t.seatLayer.on("click tap",i=>{if(t.moved()>_e||t.isGhostClick(i))return;let o=Wi(i.target);o&&t.seatsPickable()&&t.handleSeatTap(o)}),t.seatLayer.on("mouseover",i=>{let o=Wi(i.target);if(!o)return;let n=t.seat(o);if(!n)return;t.setHoveredId(o);let r=wf(t,o);t.hoverRing.position(t.renderedSeatPoint(n));let s=t.viewMode()==="perspective"?t.perspectiveSeatScale(o):1;t.hoverRing.scale({x:s,y:s}),t.hoverRing.opacity(r==="muted"?bf:an),t.hoverRing.dash(r==="muted"?yf:Hi),t.hoverRing.visible(r!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(r==="full"),t.onHover?.(n,{mark:t.seatMark(o),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let i=t.stage.getPointerPosition();i&&e(i)}),t.stage.on("wheel",i=>{i.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let o=t.container.getBoundingClientRect(),n={x:i.evt.clientX-o.left,y:i.evt.clientY-o.top},r=Math.exp(-i.evt.deltaY*.002);t.zoomAbout(t.stage.scaleX()*Y(r,.5,2),n,"frame"),e(n)}),t.stage.on("click tap",i=>{if(t.moved()>_e||t.isGhostClick(i))return;let o=t.stage.getPointerPosition();if(!o)return;if(t.sectionCount()){let r=t.ownedBadgeAt(t.screenToWorld(o));if(r&&t.focusOwnedSeats(r))return}if(!(Wi(i.target)&&t.seatsPickable())){let r=Gi(t.selectionMarkers(),o);if(r){t.focusSeats([r],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(o))return;if(t.rowLabelAt&&t.selectRow){let r=t.rowLabelAt(o);if(r){t.selectRow(r);return}}if(!t.cached()){if(Wi(i.target)&&t.seatsPickable())return;if(t.seatsPickable()){let r=t.focusedSectionId(),s=t.nearestSeatToScreen(o,me),a=s?t.seatSection(s):null;if(s&&(!r||a&&t.sectionMatchesFocus(a))){t.handleSeatTap(s);return}let l=s?null:t.nearestSeatToScreen(o,me,!0),c=l?t.seatSection(l):null;if(l&&(!r||c&&t.sectionMatchesFocus(c))){t.handleSeatTap(l);return}if(r&&t.onBackdropTap&&!t.floorOverview()){let u=t.sectionAt(o);if(u&&t.sectionInteractive?.(u)===!1)return;if(u&&u!==r){let h=t.sectionTapAnchor(u,t.screenToWorld(o));t.onSectionTap?t.onSectionTap(u,h):t.focusSection(u,{anchor:h})}else u||t.onBackdropTap();return}if(r)return;let d=t.sectionCount()?Sf(t,o):null;if(!d||t.effScale()>=oe||t.sectionFrameScale(d)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let r=t.floorOverview()?t.sectionAt(o):null,s=(r?t.objectFloor(r):null)??t.deckFloorAt();if(s){t.onDeckTap(s);return}}if(t.sectionCount()){let r=t.screenToWorld(o),s=t.ownedBadgeAt(r);if(s&&t.focusOwnedSeats(s)||!s&&zl(t,o))return;let a=s??t.sectionAt(o);if(a){let l=t.sectionTapAnchor(a,r);t.onSectionTap?t.onSectionTap(a,l):t.focusSection(a,{anchor:l});return}if(!t.pressLandsOnChart(o))return}if(!t.seatsPickable()){let r=t.tableAt?.(o);if(r?.length&&t.focusSeats(r,{animate:!t.reducedMotion()}))return}if(t.clusterLabels.focusCluster(o)||t.clusterLabels.glideTowardTap(o))return;let n=Math.max(ve*1.2,t.stage.scaleX()*2.5);t.zoomAbout(n,o)})}function Xl(t,e){if((t.stacked()||t.floorOverview())&&t.onDeckTap){let o=t.objectFloor(t.seat(e)?.rowId??"");if(o){t.onDeckTap(o);return}}if(t.effScale()<oe&&t.sectionCount()){let o=t.seatSection(e);if(o){let n=t.focusedSectionId()===o.logicalId,r=t.sectionFrameScale(o.logicalId)>t.stage.scaleX()*1.02;if(!n&&r){let s=t.seat(e),a=s?t.renderedSeatPoint(s):void 0;t.onSectionTap?t.onSectionTap(o.logicalId,a):t.focusSection(o.logicalId,{anchor:a});return}}}if(!(t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e))){let o=t.seat(e)??null,n=t.hiddenByAccessFilter(e);o&&(n||t.hasSeatMark(e))&&(t.onHover?.(o,{mark:t.seatMark(e)??null,interaction:"press",unavailable:!0,...n?{filteredOut:!0}:{}}),t.nudgeSeat(e));return}t.hasSeatMark(e)&&t.onHover?.(t.seat(e)??null,{mark:t.seatMark(e),interaction:"press"}),t.toggleSeat(e)}function wf(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function Yl(t,e){return!e.manageMode||!e.marqueeSelect||!e.atSeatRung||t.pointerType==="touch"||t.button!==0?!1:t.shiftKey||e.hitSeatAt(t.local)}function Ul(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<ae}import{Path as vm}from"konva/lib/shapes/Path";var kf=10;function xf(t){let e=t.framingViewport();if(t.stage.width()>=j||t.exportMode())return e;let i=kf;return{...e,x:e.x+i,y:e.y+i,width:Math.max(1,e.width-i*2),height:Math.max(1,e.height-i*2)}}function $l(t){let e=xf(t),i=t.revealWorldRect?.()??null,o=e.width,n=e.height,r=t.perspectiveBounds(),s=t.viewMode()==="perspective"&&r?r:t.bounds();if(t.setFitScale(Math.min(o/s.width,n/s.height)||1),t.portraitFitCrop()&&!t.exportMode()){let c=o/s.width<=n/s.height,d=s.height*t.fitScale();c&&d<.55*n&&t.setFitScale(Math.min(t.fitScale()*1.3,.62*n/s.height))}let a=Cf(t);a&&t.setFitScale(Lf);let l=t.fitScale();if(t.stage.scale({x:l,y:l}),t.stage.position({x:e.x+(o-s.width*l)/2-s.x*l,y:e.y+(n-s.height*l)/2-s.y*l}),t.settleView(),!t.exportMode()){let c=pa(t.stage,[t.bgLayer,t.seatLayer],e,a?t.stage.scaleX()*1.000001:t.effScale()<ae?ae*.999999*(t.stage.scaleX()/Math.max(t.effScale(),1e-9)):void 0,i);c>0&&c!==1&&t.setFitScale(t.fitScale()*c),c>0&&(t.afterViewChange(),Wo(t.stage,[t.bgLayer,t.seatLayer],e,i)),Pf(t,e),t.setFitPose(Ze(t.stage))}t.stage.batchDraw()}var Lf=Z*(1-1e-6);function Cf(t){if(!t.openAtSectionsWhenDense?.()||!t.hasSections?.()||t.exportMode())return!1;let e=t.fitScale();return e>=Z&&e<ve}function Pf(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let o=t.revealWorldRect?.()??null,n=Ot(t.stage,[t.bgLayer,t.seatLayer],o);if(!n)return;let r=t.fitClearanceWidth?.()??0;if(r>0&&n.x+n.width<=e.x+e.width-r)return;let s=e.height-i;if(n.height<=s){Wo(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:s},o);return}let a=e.y+Mi-n.y;a<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+a})}function Wt(t){let e=t.fitScale();t.zones().length&&(e=Math.min(e,Ke*.9));let i=(t.focusedFrameScale?.()??0)*2;return{min:e,max:Math.max(e,t.fitScale(),t.unitZoomCeiling(),i)}}function ql(t,e,i,o="now"){let n=t.stage.position();ol(t.stage,e,i,Wt(t))&&(t.stage.position(t.constrainPan(t.stage.position(),n)),o==="frame"?(t.updateSeatGroupVisibility(),Tf(t)):t.afterViewChange(),t.stage.batchDraw())}function Tf(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function Zl(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function If(t,e,i,o,n=0){nl(t.stage,e,Wt(t),i,Vt(t.framingViewport(),n),o),t.settleView(),t.stage.batchDraw()}function jl(t,e,i){let o=typeof e=="string"?t.sectionBounds(e):e;if(!o)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){If(t,o,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let n=Vt(t.framingViewport(),i?.focusPaddingPx??0),r=n.width,s=n.height,{min:a,max:l}=Wt(t),c=1.12,d=Math.min(r/(o.width*c),s/(o.height*c)),u=i?.minScale??a,h=Y(Math.max(d,u),a,Math.max(u,Gt({min:a,max:l},i?.maxScale))),m=n.x+r/2-(o.x+o.width/2)*h,f=n.y+s/2-(o.y+o.height/2)*h,b=t.stage.scaleX(),p=t.stage.x(),g=t.stage.y();if(Math.abs(h-b)<1e-4&&Math.abs(m-p)<.5&&Math.abs(f-g)<.5){t.settleView();return}let y=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let x=w=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let v=Math.min(1,(w-y)/S),k=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,P=b+(h-b)*k;t.stage.scale({x:P,y:P}),t.stage.position({x:p+(m-p)*k,y:g+(f-g)*k}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),v<1?t.setGlideRaf(requestAnimationFrame(x)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(x))}function Vt(t,e){let i=Math.max(0,Math.min(e,t.width/3,t.height/3));return i===0?t:{x:t.x+i,y:t.y+i,width:t.width-i*2,height:t.height-i*2}}import{Text as Mf}from"konva/lib/shapes/Text";function Ql(t){let e=new WeakMap;return()=>{let i=t(),o=i.labelFont(),n=je(),r=e.get(i.seats);if(r&&r.radius===i.seatR&&r.font===o&&r.generation===n)return r.value;let s=Rf(i);return e.set(i.seats,{radius:i.seatR,font:o,generation:n,value:s}),s}}function Rf(t){let e=1/0,i=new Mf({fontSize:be,fontStyle:"600",fontFamily:t.labelFont(),listening:!1}),o=t.seatR*2-3,n=new Map;for(let s of t.seats){if(s.kind==="booth"){let u=t.blockExtent?.(s);e=Math.min(e,u?ye({...u,text:s.displayLabel??s.label}):Ge);continue}let a=be*t.seatLabelScale(s),l=si(s.displayLabel??s.label),c=n.get(a);c||n.set(a,c=new Map);let d=c.get(l);if(d===void 0&&(i.fontSize(a),i.text(l),d=i.width()>o?Math.max(lt,a*o/i.width()):a,c.set(l,d)),e=Math.min(e,d),e<=lt)break}i.destroy();let r=Number.isFinite(e)?e:Ge;return z/Math.max(lt,r)}function ec(t,e,i,o,n,r=.35){return!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(e)||!(i.width>0)||!(i.height>0)?t:{x:Jl(t.x,e,i.x,i.width,o.x,o.width,r,n?.x),y:Jl(t.y,e,i.y,i.height,o.y,o.height,r,n?.y)}}function Jl(t,e,i,o,n,r,s,a){if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(n)||!Number.isFinite(r))return t;let l=o*e,c=Math.min(l,r*(1-s)),d=n+c-(i+o)*e,u=n+r-c-i*e;if(!(d<=u))return t;if(Number.isFinite(a)){let h=a;return Math.min(Math.max(t,Math.min(d,h)),Math.max(u,h))}return Math.min(Math.max(t,d),u)}var ln={top:0,right:0,bottom:0,left:0};function tc(t){let e=i=>typeof i=="number"&&Number.isFinite(i)&&i>0?i:0;return t?{top:e(t.top),right:e(t.right),bottom:e(t.bottom),left:e(t.left)}:{...ln}}var Af=.7;function ic(t,e,i){let{top:o,right:n,bottom:r,left:s}=i,a=(h,m,f)=>{let b=h+m,p=f*Af;if(b<=p||b<=0)return[h,m];let g=p/b;return[h*g,m*g]},[l,c]=a(s,n,t),[d,u]=a(o,r,e);return{x:l,y:d,width:Math.max(1,t-l-c),height:Math.max(1,e-d-u)}}function oc(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function nc(t,e){return!Number.isFinite(e.x)||!Number.isFinite(e.y)||!(e.scale>0)?!1:(t.scale({x:e.scale,y:e.scale}),t.position({x:e.x,y:e.y}),!0)}function zt(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function rc(t,e){let i=e({x:t.x,y:t.y}),o=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(i.x,o.x),y:Math.min(i.y,o.y),width:Math.abs(o.x-i.x),height:Math.abs(o.y-i.y)}}function sc(t){let e=[];for(let i of t)i.type==="table"&&e.push({id:i.id,centre:{x:i.center.x,y:i.center.y},radius:i.shape==="round"?i.radius??40:Math.max(Math.abs(i.width??80),Math.abs(i.height??50))/2});return e}function cn(t,e,i,o){let n=Ef(t,i,o);if(!n)return null;let r=e.filter(s=>s.rowId===n.id).map(s=>s.id);return r.length?r:null}function Ef(t,e,i){let o=Math.max(i,1e-9),n=null;for(let r of t){let s=Math.max(r.radius,ci/2/o),a=Math.hypot(e.x-r.centre.x,e.y-r.centre.y);a>s||(!n||a<n.distance)&&(n={table:r,distance:a})}return n?.table??null}function lc(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?Xr:Kr}function cc(t){return Math.max(t*1.05,Or,Z*1.3)}var Ff=42;function dc(t){return Ff/(2*Math.max(t,1e-4))}function et(t,e){let i=1/0,o=-1/0,n=1/0,r=-1/0;for(let s of t)i=Math.min(i,s.x),o=Math.max(o,s.x),n=Math.min(n,s.y),r=Math.max(r,s.y);return i-=e,o+=e,n-=e,r+=e,{x:i,y:n,width:Math.max(40,o-i),height:Math.max(40,r-n)}}function hc(t){let{stageWidth:e,stageHeight:i,fullBounds:o,visibleBounds:n,seatPoints:r,minScale:s}=t;if(!r.length)return null;let a=1.12;if(Math.min(e/(o.width*a),i/(o.height*a))>=s)return null;let c=t.tapAnchor??{x:n.x+n.width/2,y:n.y+n.height/2},d=r[0],u=1/0;for(let b of r){let p=(b.x-c.x)**2+(b.y-c.y)**2;p<u&&(d=b,u=p)}let h=e/(s*a),m=i/(s*a),f=et(r,0);return{bounds:{x:ac(d.x,h,f.x,f.width),y:ac(d.y,m,f.y,f.height),width:h,height:m},minScale:s}}function ac(t,e,i,o){return o<=e?i+o/2-e/2:Math.min(Math.max(t-e/2,i),i+o-e)}import{Shape as Bf}from"konva/lib/Shape";var uc=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},_f=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function pc(t,e){let i=new Map;for(let n of t){if(n.kind==="booth")continue;let r=e.get(n.rowId),s=uc(n);if(!(r&&r>0)||s==null)continue;let a=_f(n),l=i.get(a)??[];l.push({seat:n,index:s}),i.set(a,l)}let o=[];for(let n of i.values()){n.sort((a,l)=>a.index-l.index||a.seat.id.localeCompare(l.seat.id));let r=[],s=()=>{r.length&&(o.push({seats:r,points:r.map(({x:a,y:l})=>({x:a,y:l}))}),r=[])};for(let a of n){let l=r[r.length-1];if(l){let c=uc(l),d=Math.hypot(a.seat.x-l.x,a.seat.y-l.y),u=e.get(a.seat.rowId),h=Math.max(1e-6,u*1e-6);(c==null||a.index!==c+1||d<=h||d>u*1.5)&&s()}r.push(a.seat)}s()}return o}var Kt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15}get active(){return this.entries.length>0}clear(){for(let e of this.entries)e.section.liftGroupSeat.opacity(e.opacity),e.section.liftGroupSeat.listening(e.listening),e.shape.destroy();this.entries=[],this.key=""}sync(e,i,o,n,r,s,a,l,c=()=>1,d=()=>!1,u=()=>1/0){if(!l||!e||!o){this.clear(),this.focusKey=null;return}if(this.doc!==e){this.clear(),this.doc=e,this.spacing.clear(),this.focusKey=null;for(let f of[...e.objects,...(e.floors??[]).flatMap(b=>b.objects)])f.type==="row"&&this.spacing.set(f.id,f.seatSpacing)}if(this.focusKey!==o&&(this.focusKey=o,this.detailScale=Math.min(Math.max(1.15,c()*1.15),u()*.9)),n>=this.detailScale){this.clear();return}let h=i.filter(f=>f.id===o||f.logicalId===o||d(f)),m=h.map(f=>f.id).join("|");if(!(this.key===m&&this.active)){this.clear(),this.key=m;for(let f of h){if(f.memberIds.length>2e3||f.memberIds.some(g=>!a.has(g)||!this.spacing.has(s.get(g)?.rowId??"")))continue;let b=pc(f.memberIds.map(g=>s.get(g)).filter(Boolean),this.spacing);if(!b.length||b.reduce((g,y)=>g+y.seats.length,0)!==f.memberIds.length)continue;let p=new Bf({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:g=>{let y=g._context,S=p.getStage(),x=S&&S.width()<=j?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;y.save(),y.lineWidth=x*2,y.lineCap="round",y.lineJoin="round";let w=v=>{let k=a.get(v.id);return O(String(k.fill()),k.opacity())};for(let v of b){let k=v.points;if(k.length===1){y.fillStyle=w(v.seats[0]),y.beginPath(),y.arc(k[0].x,k[0].y,x,0,Math.PI*2),y.fill();continue}let P=v.seats.map(w),C=(M,R)=>{let A=Math.hypot(R.x-M.x,R.y-M.y);return{x:-(R.y-M.y)/A,y:(R.x-M.x)/A}},T=k.map((M,R)=>{let A=k[Math.max(0,R-1)],E=k[Math.min(k.length-1,R+1)];return Math.hypot(E.x-A.x,E.y-A.y)>.001?C(A,E):C(k[R],k[R+1]??k[R-1])}),L=(M,R,A)=>({x:M.x+R.x*x*A,y:M.y+R.y*x*A}),I=0;for(;I<k.length;){let M=I;for(;M+1<k.length&&P[M+1]===P[I];)M++;let R=I===0?k[0]:{x:(k[I-1].x+k[I].x)/2,y:(k[I-1].y+k[I].y)/2},A=M===k.length-1?k[M]:{x:(k[M].x+k[M+1].x)/2,y:(k[M].y+k[M+1].y)/2},E=I===0?T[0]:C(k[I-1],k[I]),F=M===k.length-1?T[M]:C(k[M],k[M+1]),H=[R,...k.slice(I,M+1),A],G=[E,...T.slice(I,M+1),F],Q=H.map((_,W)=>L(_,G[W],1)),N=H.map((_,W)=>L(_,G[W],-1));y.fillStyle=P[I],y.beginPath(),y.moveTo(Q[0].x,Q[0].y);for(let _ of Q.slice(1))y.lineTo(_.x,_.y);if(M===k.length-1){let _=Math.atan2(F.y,F.x);y.arc(A.x,A.y,x,_,_-Math.PI,!0)}else y.lineTo(N[N.length-1].x,N[N.length-1].y);for(let _ of N.slice(0,-1).reverse())y.lineTo(_.x,_.y);if(I===0){let _=Math.atan2(-E.y,-E.x);y.arc(R.x,R.y,x,_,_-Math.PI,!0)}y.closePath(),y.fill(),I=M+1}}y.restore()}});this.entries.push({section:f,shape:p,opacity:f.liftGroupSeat.opacity(),listening:f.liftGroupSeat.listening()}),f.liftGroupBg.add(p),f.liftGroupSeat.opacity(0),f.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};import{Text as Of}from"konva/lib/shapes/Text";var fc=new WeakMap,Df=(t,e)=>{let i=new Of({text:t,fontSize:Rt,fontStyle:"700",fontFamily:e}),o={width:i.width(),height:i.height()};return i.destroy(),o};function mc(t,e,i,o=Df){let n=fc.get(t);n||fc.set(t,n=new Map);let r=`${e}\0${je()}`,s=n.get(r);s||n.set(r,s=new Map);let a=s.get(i);if(a!==void 0)return a;let l=0;for(let d of t){if(!d.focusKeys?.includes(i))continue;let u=o(d.text,e);l=Math.max(l,u.width,u.height)}let c=l>0?Math.ceil(l+z+ie*2+6):0;return s.set(i,c),c}function gc(t){let e=t.getClientRect({skipTransform:!0,skipShadow:!0});!Number.isFinite(e.width)||!Number.isFinite(e.height)||(t.offsetX(e.x+e.width/2),t.offsetY(e.y+e.height/2))}var dn=1e6;function Nf(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function hn(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Vi=class{constructor(e,i=Nf()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.lastTapAt=0;this.rect=null;this.onLayoutChanged=()=>{this.rect=null};this.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||(this.rect=null,this.beginPointer(e.pointerId,this.toLocal(e.clientX,e.clientY),e.pointerType,e.button,e.shiftKey))};this.onPointerMove=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId))return;e.preventDefault();let i=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,i)&&this.applyPointerMove(i)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId)};this.onTouchStart=e=>{if(!hn(e)){e.preventDefault(),this.rect=null;for(let i=0;i<e.changedTouches.length;i+=1){let o=e.changedTouches.item(i);o&&this.beginPointer(dn+o.identifier,this.toLocal(o.clientX,o.clientY),"touch",0)}}};this.onTouchMove=e=>{if(hn(e))return;e.preventDefault();let i=null;for(let o=0;o<e.changedTouches.length;o+=1){let n=e.changedTouches.item(o);if(!n)continue;let r=this.toLocal(n.clientX,n.clientY);this.updatePointer(dn+n.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!hn(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let o=e.changedTouches.item(i);o&&this.endPointer(dn+o.identifier)}}};this.host=e,this.useWebKitTouchEvents=i}get moved(){return this.movedPx}attach(){let{container:e}=this.host;this.rect=null,typeof window<"u"&&(window.addEventListener("scroll",this.onLayoutChanged,{capture:!0,passive:!0}),window.addEventListener("resize",this.onLayoutChanged,{passive:!0}),window.visualViewport?.addEventListener("resize",this.onLayoutChanged),window.visualViewport?.addEventListener("scroll",this.onLayoutChanged)),e.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),e.addEventListener("pointermove",this.onPointerMove,{passive:!1}),e.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),e.addEventListener("pointercancel",this.onPointerEnd,{passive:!1}),this.useWebKitTouchEvents&&(e.addEventListener("touchstart",this.onTouchStart,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove,{passive:!1}),e.addEventListener("touchend",this.onTouchEnd,{passive:!1}),e.addEventListener("touchcancel",this.onTouchEnd,{passive:!1}))}detach(){let{container:e}=this.host;typeof window<"u"&&(window.removeEventListener("scroll",this.onLayoutChanged,{capture:!0}),window.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("scroll",this.onLayoutChanged)),e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerEnd),e.removeEventListener("pointercancel",this.onPointerEnd),this.useWebKitTouchEvents&&(e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("touchcancel",this.onTouchEnd))}resetPan(){this.panLast=null,this.panStart=null,this.panStarted=!1}isGhostClick(e){return e.type==="tap"?(this.lastTapAt=performance.now(),!1):this.lastTapAt>0&&performance.now()-this.lastTapAt<Dr}invalidateRect(){this.rect=null}toLocal(e,i){let o=this.rect;if(!o){let n=this.host.container.getBoundingClientRect();o={left:n.left,top:n.top},this.rect=o}return{x:e-o.left,y:i-o.top}}beginPointer(e,i,o,n,r=!1){if(this.host.cancelGlide(),this.host.dismissFocusRing?.(),this.pointers.set(e,i),this.pointers.size===1)this.movedPx=0,this.singleTouch=o==="touch",this.singleTouch&&this.host.touchProbeStart?.(i),this.pinch=null,this.panStart=i,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:o,button:n,local:i,shiftKey:r})?(this.host.beginMarquee(i),this.panLast=null):this.panLast=i;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[s,a]=[...this.pointers.values()],l={x:(s.x+a.x)/2,y:(s.y+a.y)/2},c=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(a.x-s.x,a.y-s.y),startScale:c,worldMid:{x:(l.x-this.host.stage.x())/c,y:(l.y-this.host.stage.y())/c}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=_e+1}}updatePointer(e,i){return this.pointers.has(e)?(this.pointers.set(e,i),this.pointers.size===1&&this.panStart?this.movedPx=Math.max(this.movedPx,Math.hypot(i.x-this.panStart.x,i.y-this.panStart.y)):this.pointers.size>=2&&(this.movedPx=_e+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>_e?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[i,o]=[...this.pointers.values()],n=Math.hypot(o.x-i.x,o.y-i.y);if(this.pinch.startDist<1)return;let r={x:(i.x+o.x)/2,y:(i.y+o.y)/2},{min:s,max:a}=this.host.zoomBounds(),l=Y(this.pinch.startScale*(n/this.pinch.startDist),s,a),c={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.scale({x:l,y:l}),this.host.stage.position(this.host.constrainPan({x:r.x-this.pinch.worldMid.x*l,y:r.y-this.pinch.worldMid.y*l},c)),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=_e)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}let i={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.position(this.host.constrainPan({x:i.x+(e.x-this.panLast.x),y:i.y+(e.y-this.panLast.y)},i)),this.panLast=e,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}}endPointer(e){if(this.pointers.has(e)){if(this.host.marqueeActive()){this.endTouchProbe(),this.host.finishMarquee(),this.pointers.delete(e),this.pointers.size===0&&(this.panLast=null);return}this.pointers.delete(e),this.pointers.size<2&&(this.pinch=null),this.pointers.size===1&&(this.panLast=[...this.pointers.values()][0],this.panStart=this.panLast,this.panStarted=!0),this.pointers.size===0&&(this.panLast=null,this.panStart=null,this.panStarted=!1,this.endTouchProbe(),this.host.afterViewChange())}}endTouchProbe(){this.singleTouch&&(this.singleTouch=!1,this.host.touchProbeEnd?.())}};import{Circle as Hf}from"konva/lib/shapes/Circle";import{Group as Gf}from"konva/lib/Group";import{Line as Wf}from"konva/lib/shapes/Line";import{Text as Vf}from"konva/lib/shapes/Text";var zf=11,Kf=.3,Xf=.08;function vc(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function Yf(t,e){return!e||t.available==null?`cap ${t.capacity}`:t.available<=0?B("map.soldOut"):t.wheelchairFree!=null?t.wheelchairFree<=0?B("map.noWheelchairSpace"):B("map.seatsLeft",{count:t.wheelchairFree}):B("map.seatsLeft",{count:t.available})}function wc(t,e){return e&&t.available!=null&&t.available<=0}function Uf(t,e){return wc(t,e)||e&&t.wheelchairFree!=null&&t.wheelchairFree<=0}function kc(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),o=t.overviewHidden(e),n=Uf(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:t.dimmed(e.categoryKey)?Ve*Xf:n?Ve*Kf:Ve),e.polygon.listening(!t.exportMode&&!o&&!i&&!wc(e,t.pickerMode)),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),$f(t,e,n,r,o,t.dimmed(e.categoryKey))}}function $f(t,e,i,o,n,r){if(e.capacityNode){let s=Yf(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}qf(t,e,n||r),o>0&&!n?em(t,e,o,Math.max(t.effScale(),1e-4)):e.chip&&e.chip.visible(!1)}var un=9,bc=.86;function qf(t,e,i){Zf(t,e,i),pn(e)}function pn(t){let e=t.wheelchairGlyph,i=t.capacityNode;if(!e)return;if(!i||!i.visible()||!i.text()){e.visible(!1);return}let o=i.fontSize(),n=o/he;e.scale({x:n,y:n}),e.offset({x:he/2,y:he/2}),e.position({x:i.x()-i.width()/2-o*.7,y:i.y()-i.offsetY()+i.height()/2}),e.visible(!0)}function Zf(t,e,i){let{labelNode:o,capacityNode:n}=e;if(!o&&!n)return;let r=Math.max(t.effScale(),1e-4);if(i){o?.visible(!1),n?.visible(!1);return}if(!t.pickerMode){o?.visible(t.labelLegible(o.fontSize())),n?.visible(t.labelLegible(n.fontSize()));return}let s=jf(e,r),a=yc(o,e.nameSize??ni,s.width*bc,r),l=yc(n,ri,s.width*bc,r),c=a!=null,d=l!=null&&(o?c&&a+l+un<=s.height:l<=s.height);Sc(o,c?a:null,e.labelPoint.y-un/r,r),Sc(n,d?l:null,o?e.labelPoint.y+un/r:e.labelPoint.y,r)}function jf(t,e){let i=1/0,o=-1/0,n=1/0,r=-1/0;for(let s of t.points)s.x<i&&(i=s.x),s.x>o&&(o=s.x),s.y<n&&(n=s.y),s.y>r&&(r=s.y);return Number.isFinite(i)?{width:(o-i)*e,height:(r-n)*e}:{width:0,height:0}}function yc(t,e,i,o){if(!t||!t.text())return null;t.fontSize(e/o);let n=t.width()*o;if(n<=i||n<=0)return e;let r=e*(i/n);return r>=z?r:null}function Sc(t,e,i,o){if(t){if(e==null){t.visible(!1);return}t.fontSize(e/o),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i),t.visible(!0)}}var Qf=.72;function Jf(t,e,i){let o=-1/0,n=1/0;for(let s of t)s.x>o&&(o=s.x),s.y<n&&(n=s.y);if(!Number.isFinite(o)||!Number.isFinite(n))return e;let r=i*Qf;return{x:o+r,y:n-r}}function em(t,e,i,o){let n=zf;if(!e.chip){let a=new Gf({listening:!1});a.add(new Hf({name:"ga-chip-disc",radius:n,strokeWidth:1,listening:!1,perfectDrawEnabled:!1})),a.add(new Wf({name:"ga-chip-tick",x:-n*.62,points:[-n*.22,0,-n*.02,n*.2,n*.34,-n*.26],strokeWidth:Math.max(.6,n*.16),lineCap:"round",lineJoin:"round",listening:!1}));let l=new Vf({x:n*.12,y:-n*.5,text:String(i),fontSize:n,fontStyle:"800",fontFamily:t.labelFont(),listening:!1,perfectDrawEnabled:!1});a.add(l),t.bgLayer.add(a),e.chip=a,e.chipText=l}let r=Dt(t.selectionColor),s=e.chip.findOne(".ga-chip-disc");s?.fill(t.selectionColor),s?.stroke(O(r,.35)),e.chip.findOne(".ga-chip-tick")?.stroke(r),e.chipText&&(e.chipText.text()!==String(i)&&e.chipText.text(String(i)),e.chipText.fill(r)),e.chip.position(Jf(e.points,e.labelPoint,n/o)),e.chip.scale({x:1/o,y:1/o}),e.chip.visible(!0),e.chip.moveToTop()}function xc(t,e){let i=!1;for(let[o,n]of Object.entries(e)){let r=t.get(o);r&&(n.available!==void 0&&r.available!==n.available&&(r.available=n.available,i=!0),n.wheelchairFree!==void 0&&(r.wheelchairFree??null)!==n.wheelchairFree&&(r.wheelchairFree=n.wheelchairFree,i=!0),n.selected!==void 0&&r.selected!==n.selected&&(r.selected=n.selected,i=!0))}return i}function Lc(t){let{width:e,height:i}=t;return!(e>0)||!(i>0)?"hidden":e===t.stageWidth&&i===t.stageHeight?"unchanged":{width:e,height:i}}function Cc(t){let{rung:e,viewCentre:i,target:o,width:n,height:r}=t,s=i.x,a=i.y;if(e==="sections"&&t.sections.length>0){let c=t.sections.map(m=>{let f=K(m.outline);return{x:f.x+f.width/2,y:f.y+f.height/2}}),d=n/(o*2),u=r/(o*2);if(!c.some(m=>Math.abs(m.x-i.x)<=d&&Math.abs(m.y-i.y)<=u)){let m=c.reduce((f,b)=>{let p=(b.x-i.x)**2+(b.y-i.y)**2;return p<f.distance?{point:b,distance:p}:f},{point:c[0],distance:1/0});s=m.point.x,a=m.point.y}}let l=e==="seats"?t.seats.filter(c=>c.kind!=="booth"):[];if(l.length>0){let c=l[0],d=1/0;for(let u of l){let h=u.x-i.x,m=u.y-i.y,f=h*h+m*m;f<d&&(c=u,d=f)}s=c.x,a=c.y}return{x:s,y:a}}function Pc(t,e,i,o){if(t.length<3)return[];let n=1/0,r=-1/0,s=1/0,a=-1/0;for(let d of t)d.x<n&&(n=d.x),d.x>r&&(r=d.x),d.y<s&&(s=d.y),d.y>a&&(a=d.y);if((r-n)*i<4&&(a-s)*i<4)return[];let l=t,c=[];for(let d of e){let u=o.rendered(d);u.x<n||u.x>r||u.y<s||u.y>a||Kn(u,l)&&o.selectable(d.id)&&c.push(d.id)}return c}function tm(t){return t.logicalRowId??t.rowId}function Tc(t,e,i){let o=[];for(let n of e)n.kind!=="booth"&&(tm(n)!==t||!i(n.id)||o.push(n.id));return o}function Ic(t,e,i=4){for(let o of e){let{box:n}=o;if(t.x>=n.x-i&&t.x<=n.x+n.width+i&&t.y>=n.y-i&&t.y<=n.y+n.height+i)return o.rowKey}return null}import{Line as im}from"konva/lib/shapes/Line";import{Rect as om}from"konva/lib/shapes/Rect";var zi=class{constructor(e){this.host=e;this.box=null;this.lasso=null}active(){return this.box!==null||this.lasso!==null}begin(e,i){let o=this.host.screenToWorld(e),n=this.host.stageScale()||1,r={stroke:this.host.selectionColor(),strokeWidth:1.5/n,dash:[5/n,4/n],fill:"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(i==="lasso"){let s=new im({...r,points:[o.x,o.y],closed:!0,lineJoin:"round"});this.host.overlayLayer().add(s),this.lasso={points:[o],line:s}}else{let s=new om({...r,x:o.x,y:o.y,width:0,height:0});this.host.overlayLayer().add(s),this.box={start:o,cur:o,rect:s}}this.host.overlayLayer().batchDraw()}update(e){let i=this.host.screenToWorld(e);if(this.lasso){let r=this.lasso.points[this.lasso.points.length-1];if(Math.hypot(i.x-r.x,i.y-r.y)*(this.host.stageScale()||1)<2)return;this.lasso.points.push(i),this.lasso.line.points(this.lasso.points.flatMap(s=>[s.x,s.y])),this.host.overlayLayer().batchDraw();return}if(!this.box)return;let{start:o,rect:n}=this.box;n.setAttrs({x:Math.min(o.x,i.x),y:Math.min(o.y,i.y),width:Math.abs(i.x-o.x),height:Math.abs(i.y-o.y)}),this.box.cur=i,this.host.overlayLayer().batchDraw()}cancel(){!this.box&&!this.lasso||(this.lasso?.line.destroy(),this.box?.rect.destroy(),this.lasso=null,this.box=null,this.host.overlayLayer().batchDraw())}finish(){let e=this.host.stageScale()||1;if(this.lasso){let{points:l,line:c}=this.lasso;this.lasso=null,c.destroy(),this.host.overlayLayer().batchDraw();let d=l.map(h=>h.x),u=l.map(h=>h.y);if(l.length<3||(Math.max(...d)-Math.min(...d))*e<4&&(Math.max(...u)-Math.min(...u))*e<4)return;this.host.selectMany(Pc(l,this.host.seats(),e,{rendered:h=>this.host.renderedSeatPoint(h),selectable:h=>this.host.isSelectable(h)})),this.host.selectionChanged();return}let i=this.box;if(this.box=null,!i)return;i.rect.destroy(),this.host.overlayLayer().batchDraw();let o=Math.min(i.start.x,i.cur.x),n=Math.max(i.start.x,i.cur.x),r=Math.min(i.start.y,i.cur.y),s=Math.max(i.start.y,i.cur.y);if((n-o)*e<4&&(s-r)*e<4)return;let a=[];for(let l of this.host.seats()){let c=this.host.renderedSeatPoint(l);c.x<o||c.x>n||c.y<r||c.y>s||this.host.isSelectable(l.id)&&a.push(l.id)}this.host.selectMany(a),this.host.selectionChanged()}};import{Rect as Mc}from"konva/lib/shapes/Rect";import{Text as nm}from"konva/lib/shapes/Text";function Rc(t){let e=t.effScale(),i=t.stage.scaleX(),o={width:t.stage.width(),height:t.stage.height()},n=p=>Math.round(p*100)/100,r=new Map(t.overlayLayer.find(".selection-ring").map(p=>[String(p.getAttr("seatId")??""),String(p.getAttr("ringColor")??t.effSelection)])),s=t.seats.map(p=>{let g=t.circleById.get(p.id),y=t.boothLabelById.get(p.id)??t.seatLabelById.get(p.id),S=t.viewMode==="perspective"?t.perspectiveSeatScale.get(p.id)??1:1,x=(t.viewMode==="perspective"?i:e)*S,w=p.kind==="booth"?Ge:be*t.seatLabelScale(p),v=t.viewMode==="perspective"&&p.kind!=="booth"?e*S:x,k=n((y?.fontSize()??w)*v),P=t.worldToScreen(p),C=y?y.width()*i*S:0,T=y?y.height()*(t.viewMode==="perspective"&&p.kind==="booth"?i:e)*S:0,L=P.x-C/2<0||P.x+C/2>o.width||P.y-T/2<0||P.y+T/2>o.height,I=t.focusedSeatOpacity(p.id,g?.getAbsoluteOpacity()??0),M=t.seatSection.get(p.id),R=!!y?.isVisible()&&I>=.5&&!L,A;R||(I<.5?A="dimmed-or-unavailable":k<z?A="below-minimum-size":L?A="outside-viewport":y?A="renderer-hidden":A=t.seatLabelDrops.get(p.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let E=g instanceof Mc?g.width()*i*S:t.seatR*2*x,F=g instanceof Mc?g.height()*(t.viewMode==="perspective"?i:e)*S:t.seatR*2*x,H=2*(t.seatR*x+me),G=g?.fill(),Q=y?.fill(),N=t.accessGlyphById.get(p.id),_=N?.getAbsoluteScale();return{seatId:p.id,label:p.label,kind:p.kind==="booth"?"booth":"seat",markerShape:p.kind==="booth"?"booth":p.wheelchairSpaceType==="no-seat"?"square":"circle",...p.wheelchairSpaceType?{wheelchairSpaceType:p.wheelchairSpaceType}:{},categoryKey:p.categoryKey,...M?{sectionId:M.id}:{},...M?.zone?{zoneId:M.zone}:{},status:t.statusById.get(p.id)??"free",selected:t.selection.has(p.id),visible:R,renderedFontPx:k,fill:typeof G=="string"?G:"",ink:typeof Q=="string"?Q:g?t.seatLabelInk(p,g):t.seatPreferredLabelInk(p),...r.has(p.id)?{selectionRingColor:r.get(p.id)}:{},opacity:n(I),...N?{accessibilityMarker:{glyphVisible:N.isVisible(),glyphWidthPx:n(he*Math.abs(_?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(p.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(p.id)&&!!g?.isVisible()&&!!g?.isListening()&&t.isSelectable(p.id),directWidthPx:n(E),directHeightPx:n(F),effectiveMinimumPx:n(Math.max(Math.min(E,F),H))},screenCenter:{x:n(P.x),y:n(P.y)},...R?{screenBox:{x:n(P.x-C/2),y:n(P.y-T/2),width:n(C),height:n(T)}}:{},...A?{hiddenReason:A}:{}}}),a=s.filter(p=>p.visible).length,l=(p,g,y,S,x,w,v)=>{let k=pt({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),P=w&&w.liftWorld>0?t.isoLiftLocal(w.liftWorld):{x:0,y:0},C=K(k.map(A=>t.worldToScreen({x:A.x+P.x,y:A.y+P.y}))),T=n(S.opacity()),L=S.fill(),I=C.x+C.width<0||C.x>o.width||C.y+C.height<0||C.y>o.height,M=S.isVisible()&&T>.05&&!I,R=w?ft({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),w.outline,w.holes):void 0;return{id:p,kind:g,role:y,label:S.text(),visible:M,renderedFontPx:n(S.fontSize()*i),...v==null?{}:{sizeFloorPx:v},opacity:T,fill:x,ink:typeof L=="string"?L:"",...R==null?{}:{fitsContainer:R},...M?{screenBox:{x:n(C.x),y:n(C.y),width:n(C.width),height:n(C.height)}}:{}}},c=p=>{let g=p.namePlate.fill();if(p.namePlate.opacity()>.05&&typeof g=="string"&&g)return g;let y=p.blockPoly.fill();return typeof y=="string"?y:p.baseFill},d=p=>{let g=p.blockPoly.fill();return typeof g=="string"?g:p.baseFill},u=[...t.sections.map(p=>l(p.id,"section","name",p.nameLabel,c(p),p,Ft(o.width))),...t.sections.map(p=>l(`${p.id}:availability`,"section","availability",p.subLabel,c(p),p)),...t.sections.map(p=>l(`${p.id}:number`,"section","number",p.numberLabel,d(p),p,yi(o.width))),...t.zones.flatMap(p=>[l(p.id,"zone","name",p.label,p.background),...p.sub?[l(`${p.id}:price`,"zone","price",p.sub,p.background)]:[]])],h=[...t.gaById].map(([p,g])=>{let y=g.points.map(L=>t.worldToScreen(L)),S=Math.min(...y.map(L=>L.x)),x=Math.min(...y.map(L=>L.y)),w=Math.max(...y.map(L=>L.x)),v=Math.max(...y.map(L=>L.y)),k=w<0||S>o.width||v<0||x>o.height,P=n(g.polygon.opacity()),C=P>=.1&&!k,T=g.polygon.fill();return{areaId:p,label:g.label,capacity:g.capacity,categoryKey:g.categoryKey,...g.sectionId?{sectionId:g.sectionId}:{},visible:C,interactive:g.polygon.listening(),opacity:P,fill:typeof T=="string"?T:"",effectiveBackground:g.effectiveBackground,...C?{screenBox:{x:n(S),y:n(x),width:n(w-S),height:n(v-x)}}:{}}}),m=[...t.freeTextById].map(([p,g])=>{let{node:y,kind:S}=g,x=g.plate&&g.plate.opacity()>.05?g.plate.fill():null,w=typeof x=="string"&&x?x:g.background,v=t.worldToScreen({x:y.x(),y:y.y()}),k=y.width()*i,P=y.height()*e,C=v.x-y.offsetX()*i,T=v.y-y.offsetY()*e,L=n(y.fontSize()*e),I=C+k<0||C>o.width||T+P<0||T>o.height,M=y.isVisible()&&!I,R=y.fill(),A=n(y.getAbsoluteOpacity()),E;return M||(L<z?E="below-minimum-size":I?E="outside-viewport":E="renderer-hidden"),{objectId:g.objectId??p,kind:S,text:y.text(),visible:M,renderedFontPx:L,ink:typeof R=="string"?R:"",background:w,opacity:A,...M?{screenBox:{x:n(C),y:n(T),width:n(k),height:n(P)}}:{},...E?{hiddenReason:E}:{}}}),f=t.labelGroup.find(p=>p.getAttr("rowLabel")===!0).filter(p=>p instanceof nm).map(p=>{let g=p.getClientRect({skipShadow:!0,skipStroke:!0}),y=g.x+g.width<0||g.x>o.width||g.y+g.height<0||g.y>o.height,S=p.fill();return{text:p.text(),visible:p.isVisible()&&!y,renderedFontPx:n(p.fontSize()*e),ink:typeof S=="string"?S:"",...y?{}:{screenBox:{x:n(g.x),y:n(g.y),width:n(g.width),height:n(g.height)}}}}),b=t.sections.filter(p=>p.blockPoly.opacity()>.05);return{viewport:o,projection:t.viewMode,...t.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:t.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:t.canvasBackground,effectiveScale:n(e),rung:t.getRung(),minimumVisibleLabelPx:z,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+h.reduce((p,g)=>p+g.capacity,0),selectionRingSeatIds:t.overlayLayer.find(".selection-ring").map(p=>String(p.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:t.effSelection,focusedSectionId:t.focusedSectionId,focusBackdropVisible:!!t.focusBackdrop?.isVisible(),categoryFilterKeys:t.categoryFilter?[...t.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:b.length,categoryPaintedSectionShells:b.filter(p=>{let g=p.blockPoly.fill();return typeof g!="string"||!Co(t.canvasBackground,g)}).length,tintedSectionShells:b.filter(p=>{let g=p.blockPoly.fill();return typeof g=="string"&&Is(t.canvasBackground,g)}).length,visibleCategoryDetailOutlines:t.sections.filter(p=>p.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:t.sections.filter(p=>p.subLabel.opacity()>.05).length,visibleSectionGADetails:[...t.gaById.values()].filter(p=>p.sectionId!=null&&p.polygon.opacity()>.05).length},labels:s,gaAreas:h,hierarchyLabels:u,freeTextLabels:m,rowLabels:f}}import{Circle as rm}from"konva/lib/shapes/Circle";import{Ellipse as sm}from"konva/lib/shapes/Ellipse";import{Line as Ac}from"konva/lib/shapes/Line";import{Arrow as am}from"konva/lib/shapes/Arrow";import{Path as Fc}from"konva/lib/shapes/Path";import{Rect as Xt}from"konva/lib/shapes/Rect";import{Text as mn}from"konva/lib/shapes/Text";import{Image as _c}from"konva/lib/shapes/Image";function Bc(t,e){if(!e.url||e.visible===!1)return;let i=new window.Image;t.trackAssetImage(i,e.url,"Buyer background image",()=>{let o=i.naturalWidth||4,n=i.naturalHeight||3,r=e.crop??{x:0,y:0,width:1,height:1},s=Math.max(0,Math.min(.99,r.x)),a=Math.max(0,Math.min(.99,r.y)),l={x:s,y:a,width:Math.max(.01,Math.min(1-s,r.width)),height:Math.max(.01,Math.min(1-a,r.height))},c=e.width,d=c*(n*l.height/(o*l.width)),u=new _c({image:i,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:d/2,width:c,height:d,rotation:e.rotation??0,crop:{x:l.x*o,y:l.y*n,width:l.width*o,height:l.height*n},opacity:e.opacity,listening:!1}),h=e.layer==="above"?t.fgDecorGroup:t.bgLayer;h.add(u),u.moveToBottom(),h.getLayer()?.batchDraw()})}function Oc(t,e){let i=new window.Image,o=new _c({image:i,x:e.x+e.width/2,y:e.y+e.height/2,offsetX:e.width/2,offsetY:e.height/2,width:e.width,height:e.height,rotation:e.rotation??0,opacity:Y(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?t.fgDecorGroup.add(o):t.bgLayer.add(o),e.role&&t.landmarkBoxes.push(K(pt({x:e.x+e.width/2,y:e.y+e.height/2},e.width,e.height,e.rotation??0))),t.trackAssetImage(i,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let n=o.getLayer();n&&n.batchDraw()})}function Dc(t,e){let i=e.fill??t.theme.decorFill??Xo,o=de(i,.12);if(e.shape==="round")t.bgLayer.add(new rm({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:i,stroke:o,strokeWidth:1.5,listening:!1}));else{let r=e.width??80,s=e.height??50;t.bgLayer.add(new Xt({x:e.center.x,y:e.center.y,width:r,height:s,offsetX:r/2,offsetY:s/2,rotation:e.rotation,fill:i,stroke:o,strokeWidth:1.5,cornerRadius:4,listening:!1}))}if(!Tt(e))return;let n=Yt(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,q(i,t.theme.textColor??"#cbd5e1"),We(e)??dr,!0);t.freeTextById.set(e.id,{node:n,background:i,kind:"table"})}var lm=8,cm=6;function dm(t,e){let i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),o=Math.max(lm,e*.35),n=Math.max(cm,e*.28);return{offsetX:-(i.x-o),offsetY:-(i.y-n),width:i.width+o*2,height:i.height+n*2}}function Nc(t,e){let i=e.background?.color??t.canvasBackground,o=e.color??q(i,t.theme.textColor??za),n=e.semanticKind==="icon"?Cr(e.iconKey):void 0;if(n){let d=e.fontSize/24,u=new Fc({x:e.position.x,y:e.position.y,data:n,rotation:e.rotation,scaleX:d,scaleY:d,stroke:o,strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});t.iconNodeById.set(e.id,{node:u,fontSize:e.fontSize}),t.bgLayer.add(u);return}let r=e.background?.padding??0,s=e.opacity??1,a=qn(e),l=new mn({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:Yo(e.bold,e.italic,"600"),fill:o,fontFamily:e.fontFamily??t.labelFont(),...e.width!=null?{width:e.width}:{},align:e.align??"left",lineHeight:e.lineHeight??1.2,letterSpacing:e.letterSpacing??0,textDecoration:e.underline?"underline":"",padding:r,opacity:s,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;e.background&&(c=new Xt({x:e.position.x,y:e.position.y,...dm(l,e.fontSize),rotation:e.rotation,fill:e.background.color,opacity:s*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),t.bgLayer.add(c)),t.freeTextById.set(e.id,{node:l,backdrop:c,background:i,kind:a?"direct-landmark":"free-text",...e.labelImportance==="detail"?{showAt:"detail"}:{}}),t.bgLayer.add(l)}function Hc(t,e){let i=e.fill??t.theme.decorFill??Xo,o=e.role==="stage",n=e.role==="reference-focal",r=!!e.role&&!o,s=$n(e),a=le(t.canvasBackground),l=n?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(o?de(l,.28):n?a.focalStroke:c?"#9aa3b5":void 0),u=e.stroke?.width??(o?1:n||c?2:0),h=e.opacity!=null?Y(e.opacity,.1,1):1,m=0,f=0,b=null;if(c&&e.points&&e.points.length>=2){m=e.points.reduce((S,x)=>S+x.x,0)/e.points.length,f=e.points.reduce((S,x)=>S+x.y,0)/e.points.length;let p=Pr(e),g=Tr(u),y=new am({points:e.points.flatMap(S=>[S.x,S.y]),closed:!1,x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,stroke:d,fill:d,strokeWidth:u,opacity:h,lineCap:p.lineCap,lineJoin:p.lineJoin,pointerAtBeginning:p.startEnding==="arrow",pointerAtEnding:p.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path"});y.setAttr("shapeObjectId",e.id),t.bgLayer.add(y)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let p=o?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,Ce(l,.3),1,de(l,.12)]}:{fill:l};m=e.x+e.width/2,f=e.y+e.height/2,b={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Xt({x:m,y:f,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:d,strokeWidth:u,cornerRadius:Y(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:h,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){m=e.x+e.width/2,f=e.y+e.height/2,b={x:e.x,y:e.y,width:e.width,height:e.height};let p=o?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,Ce(l,.3),1,de(l,.12)]}:{fill:l};t.bgLayer.add(new sm({x:m,y:f,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...p,stroke:d,strokeWidth:u,opacity:h,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let p=e.points.flatMap(S=>[S.x,S.y]),g=K(e.points);m=e.points.reduce((S,x)=>S+x.x,0)/e.points.length,f=e.points.reduce((S,x)=>S+x.y,0)/e.points.length,b=g;let y=o?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,Ce(l,.3),1,de(l,.12)]}:{fill:l};t.bgLayer.add(new Ac({points:p,closed:!0,x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,...y,stroke:d,strokeWidth:u,opacity:h,listening:!1}))}b&&e.role&&t.landmarkBoxes.push(b);for(let p of zn(e))t.bgLayer.add(new Ac({points:p.points.flatMap(g=>[g.x,g.y]),closed:p.closed,x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,stroke:p.ink??Vn,fill:p.fill,strokeWidth:2,opacity:h*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:p,spec:g}=um(t,m,f,e.label,l,b,e.labelStyle);t.primaryFocalLabels.set(p,g),t.freeTextById.set(e.id,{node:p,background:l,plate:g.plate,kind:"stage"})}else if(r){let p=n||s,g=Yt(t,t.bgLayer,e.label,m,f,p?q(l,"#e6e9f0"):"#9aa3b5",p?18:12,!1);p&&t.primaryFocalLabels.set(g,{targetPx:18,trackingRatio:0,ink:String(g.fill()??""),plateInk:String(g.fill()??""),plate:new Xt({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:g,background:l,kind:"decor"})}else{let p=Yt(t,t.bgLayer,e.label,m,f,"#cbd5e1",16,!0);t.freeTextById.set(e.id,{node:p,background:l,kind:"decor"})}}var fn=22,Ec=z,Ki=6,hm=.5;function um(t,e,i,o,n,r,s){let a=s?.size??fn,l=s?.color??t.theme.textColor??"#e6e9f0",c=s?.color??q(n,l),d=r?r.x+r.width/2:e,u=r?r.y+r.height/2:i,h=pm(t.canvasBackground,n),m=new Xt({x:d,y:u,width:0,height:0,cornerRadius:4,fill:h,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(m);let f=new mn({x:d,y:u,text:o,fontSize:a,fontStyle:Yo(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/fn),fontFamily:s?.fontFamily??t.labelFont(),fill:c,textDecoration:s?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return f.offsetX(f.width()/2),f.offsetY(f.height()/2),t.bgLayer.add(f),{node:f,spec:{targetPx:a,...r?{bounds:r}:{},trackingRatio:4/fn,...s?.direction?{direction:s.direction}:{},ink:c,plateInk:s?.color??q(h,l),plate:m}}}function pm(t,e){return ee(e,V(t)?"#ffffff":"#000000",.34)}function Gc(t,e,i,o,n=0){let r=Math.max(i,1e-4),s=n>0&&r>n?r/n:1,l=Math.min(e.targetPx,Math.max(Ec,e.targetPx*hm)*s)/r,c=g=>{t.letterSpacing(g*e.trackingRatio),o(t,g)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let u=On(e.direction,d);t.rotation(u?90:0);let h={width:(u?d.height:d.width)-Ki*2,height:(u?d.width:d.height)-Ki*2},m=Math.min(1,h.width/Math.max(t.width(),1e-6),h.height/Math.max(t.height(),1e-6));if(m<1&&(l=Math.max(Ec/r,l*m),c(l)),t.width()<=h.width&&t.height()<=h.height){e.plate.opacity(0),t.fill(e.ink);return}let b=(u?t.height():t.width())+Ki*2,p=(u?t.width():t.height())+Ki;e.plate.size({width:b,height:p}),e.plate.offset({x:b/2,y:p/2}),e.plate.opacity(1),t.fill(e.plateInk)}function Wc(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",o=t.canvasBackground,n=ur(i,o,Ve),r=t.theme.textColor??"#e6e9f0",s=q(n,r),a=Je(e.points,e.holes,{fill:i,opacity:Ve,stroke:i,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",b=>{t.isGhostClick(b)||t.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{t.container.style.cursor="pointer"}),a.on("mouseleave",()=>{t.container.style.cursor="default"}),t.bgLayer.add(a);let l=ei(e.points,e.holes),c=t.sections.find(b=>J(l,b.outline,b.holes)),d=We(e)??ni,u=Tt(e)?Yt(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-.5-d/2,s,d,!1):void 0,h=Yt(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,ri,!1);u&&t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:u,background:n,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:n,kind:"ga-capacity",categoryKey:e.categoryKey});let m=Ct(e)>0?new Fc({data:st(["wheelchair"])??"",fill:s,listening:!1,perfectDrawEnabled:!1}):void 0;m&&t.bgLayer.add(m);let f={label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:n,strokeColor:i,labelPoint:l,labelNode:u,...We(e)!==void 0?{nameSize:d}:{},capacityNode:h,...m?{wheelchairGlyph:m}:{},...c?{sectionId:c.logicalId}:{}};t.gaById.set(e.id,f),pn(f)}function Yt(t,e,i,o,n,r,s,a){let l=new mn({x:o,y:n,text:i,fontSize:s,fontStyle:a?"700":"500",fontFamily:t.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function Vc(t,e){let i=[],o=e.canvasBackground,n=new Map,r=(d,u)=>{let h=n.get(d)??[];h.push(u),n.set(d,h)};for(let d of e.seats){if(d.kind==="booth")continue;let u=d.logicalRowId??d.rowId;r(u,d),u!==d.rowId&&r(d.rowId,d)}let s=d=>d.logicalSeatIndex??Number(d.id.split(":").pop()??0);for(let d of t.objects){if(d.type!=="row")continue;let u=d.segmentedRow?.repeatLabelOnComponents===!0;if(d.segmentedRow&&!u&&d.segmentedRow.componentIndex!==0)continue;let h=u?d.labelPresentation:d.segmentedRow?.labelPresentation??d.labelPresentation;if(h?.visible===!1||h?.positionPreset==="none")continue;let m=d.segmentedRow&&!u?d.segmentedRow.groupId:d.id,f=(n.get(m)??[]).slice().sort((A,E)=>s(A)-s(E));if(!f.length)continue;let b=f[0],p=f[f.length-1],g=h?.labelStyle,y=h?.style==="pill"?Nt(o):null,S=y?y.plate:o,x=pe(S,g?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",ze),w=g?.size??cr,v=h?.rotation??0,k=e.objectFilteredOut(d)?.15:1,P=f.reduce((A,E)=>A??e.seatSection.get(E.id),void 0),T=d.segmentedRow?.displayLabel??d.displayLabel??Mt(d.label,P?.label);if(!T)continue;let L=P?[...new Set([P.id,P.logicalId,P.zone].filter(A=>!!A))]:void 0,I=(A,E,F)=>i.push({text:T,x:A,y:E,rotation:v,fontSize:w,ink:x,opacity:k,rowKey:m,...y?{pill:y}:{},...L?.length?{focusKeys:L}:{},...F?{automaticAway:F}:{}});if(h?.position){I(h.position.x,h.position.y);continue}let M=e.seatR+12,R=h?.positionPreset??"start";if(R==="start"||R==="both"){let A=d.rotation*Math.PI/180,E={x:-Math.cos(A),y:-Math.sin(A)};I(b.x+E.x*M,b.y+E.y*M,E)}if(R==="end"||R==="both"){let A=(d.rotation+d.curve)*Math.PI/180,E={x:Math.cos(A),y:Math.sin(A)};I(p.x+E.x*M,p.y+E.y*M,E)}}let a=(e.seatR+12)*2.2,l=[],c=new Map;for(let d of i){let u=c.get(d.text),h=u?.find(m=>Math.hypot(m.x-d.x,m.y-d.y)<=a);if(h){h.x=(h.x+d.x)/2,h.y=(h.y+d.y)/2;continue}l.push(d),u?u.push(d):c.set(d.text,[d])}return l}function gn(t,e,i=ie){let o=t.rotation()*Math.PI/180,n=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),s=(t.width()*n+t.height()*r)/2+i,a=(t.width()*r+t.height()*n)/2+i;return{x:e.x-s,y:e.y-a,width:s*2,height:a*2}}function zc(t,e,i,o){let n={x:e.x,y:e.y},r=e.automaticAway;if(!r)return n;let s={x:-r.y,y:r.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=[{x:0,y:0}];for(let h=1;h<=4;h++){let m=a*h;l.push({x:s.x*m,y:s.y*m},{x:-s.x*m,y:-s.y*m},{x:r.x*m,y:r.y*m},{x:(r.x+s.x)*m,y:(r.y+s.y)*m},{x:(r.x-s.x)*m,y:(r.y-s.y)*m})}let c=n,d=1/0,u=1/0;for(let h of l){let m={x:n.x+h.x,y:n.y+h.y},f=gn(t,m),p=(o?ui(o,f,{mode:"overlap"}).length:0)+i.collisionCount(f),g=Math.hypot(h.x,h.y);if((p<d||p===d&&g<u)&&(c=m,d=p,u=g),p===0)break}return c}var Xi=class{constructor(){this.generationCount=0;this.promises=[];this.errors=[];this.cancels=new Set}get generation(){return this.generationCount}get failures(){return this.errors}pending(){return this.promises.slice()}track(e,i,o,n,r){let s=this.generationCount;/^https?:\/\//i.test(i)&&(e.crossOrigin="anonymous");let a=new Promise(l=>{let c=!1,d=()=>{c||(c=!0,this.cancels.delete(u),l())},u=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}d()};this.cancels.add(u),e.onload=()=>{if(!r.exportMode){s===this.generationCount&&n(),d();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.generationCount&&n()}).catch(()=>{s===this.generationCount&&this.errors.push(`${o} could not be decoded.`)}).finally(d)},e.onerror=()=>{s===this.generationCount&&this.errors.push(`${o} could not be loaded.`),d()},e.src=i});this.promises.push(a)}cancelAll(){this.generationCount++;for(let e of[...this.cancels])e();this.cancels.clear(),this.promises=[],this.errors=[]}};function Kc(t,e){let i=e,o=i._cache instanceof Map?i._cache:null,n=i._canvasCache??o?.get("canvas");if(!n){e.isCached?.()&&e.clearCache();return}let r=[n.scene,n.filter,n.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&t.Util.releaseCanvas(...r),i._canvasCache&&(i._canvasCache=void 0),o?.delete("canvas")}function Xc(t,e){let i=0,o=0,n=r=>{i||(i=r),o+=1;let s=r-i;s>=1e3&&(t(Math.round(o*1e3/s)),o=0,i=r),e(requestAnimationFrame(n))};e(requestAnimationFrame(n))}function fm(t){return t<0?0:t>1?1:t}function Yc(t){let e=t.now??(()=>typeof performance<"u"?performance.now():Date.now()),i=t.budgetMs??8,o=t.reducedMotion===!0,n=t.chunks.length>1?Math.min(30,Math.max(0,840/(t.chunks.length-1))):0,r=0,s=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},u=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},h=p=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,p()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,p()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,p()},16)}},m=()=>{a||s||(a=!0,u(),t.done())},f=p=>{for(let g=c.length-1;g>=0;g--){let y=c[g],S=o?1:fm((p-y.startedAt)/160);t.fade(y.work,S),S>=1&&c.splice(g,1)}return c.length>0},b=()=>{if(s)return;let p=e(),g=p;for(;r<t.chunks.length&&(r===0||e()-g<i);){let S=t.chunks[r++];if(t.build(S.work),t.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:p+(r-1)*n}),e()-g>=i)break}let y=f(p);t.draw(),r<t.chunks.length||y?h(b):m()};return h(b),{cancel(){if(!a){s=!0,u();for(let p of c)t.fade(p.work,1);c.length=0}},finishNow(){if(!(s||a)){for(;r<t.chunks.length;){let p=t.chunks[r++];t.build(p.work)}for(let p of t.chunks)t.fade(p.work,1);c.length=0,t.draw(),m()}},get done(){return a}}}var mm={width:40,height:30,rotation:0};function Uc(t,e){let i=1/0,o=1/0,n=-1/0,r=-1/0;for(let s of t){if(s.kind==="booth"){let l=e.boothDims.get(s.rowId)??mm;if(l.points&&l.points.length>=3){for(let f of l.points)s.x+f.x<i&&(i=s.x+f.x),s.y+f.y<o&&(o=s.y+f.y),s.x+f.x>n&&(n=s.x+f.x),s.y+f.y>r&&(r=s.y+f.y);continue}let c=l.rotation*Math.PI/180,d=l.width/2,u=l.height/2,h=Math.abs(d*Math.cos(c))+Math.abs(u*Math.sin(c)),m=Math.abs(d*Math.sin(c))+Math.abs(u*Math.cos(c));s.x-h<i&&(i=s.x-h),s.y-m<o&&(o=s.y-m),s.x+h>n&&(n=s.x+h),s.y+m>r&&(r=s.y+m);continue}let a=e.seatR+(s.accessible&&s.wheelchairSpaceType!=="no-seat"?2.75:0);s.x-a<i&&(i=s.x-a),s.y-a<o&&(o=s.y-a),s.x+a>n&&(n=s.x+a),s.y+a>r&&(r=s.y+a)}return isFinite(i)?{x:i,y:o,width:n-i,height:r-o}:null}function $c(t){let e=new Map,i=[];for(let n of t.seats){let r=t.sectionIdOf(n.id);if(r==null){i.push(n);continue}let s=e.get(r);s?s.push(n):e.set(r,[n])}let o=[...e.entries()].flatMap(([n,r])=>{let s=t.sections.find(a=>a.id===n);return s?[{chunk:{id:n,work:{seats:r,group:s.liftGroupSeat}},distance:Math.hypot(s.centroid.x-t.viewportCentre.x,s.centroid.y-t.viewportCentre.y)}]:[]}).sort((n,r)=>n.distance-r.distance).map(n=>n.chunk);return i.length&&t.looseGroup&&o.push({id:"",work:{seats:i,group:t.looseGroup}}),o}function Ut(t){return{th:bi*Math.PI/180*t.isoT,sg:1-(1-Et)*t.isoT}}function qc(t,e){let{th:i,sg:o}=Ut(e),n=e.centre,r=t.x-n.x,s=t.y-n.y,a=r*Math.cos(i)-s*Math.sin(i),l=(r*Math.sin(i)+s*Math.cos(i))*o;return{x:n.x+a,y:n.y+l}}function Zc(t,e){let{th:i,sg:o}=Ut(e),n=e.centre,r=t.x-n.x,a=(t.y-n.y)/o,l=r*Math.cos(i)+a*Math.sin(i),c=-r*Math.sin(i)+a*Math.cos(i);return{x:n.x+l,y:n.y+c}}function jc(t,e){let{th:i,sg:o}=Ut(e),n=t*e.isoT;return{x:-(n/o)*Math.sin(i),y:-(n/o)*Math.cos(i)}}function bn(t,e,i){let o=kr(e);t.offset(i),t.position(fe(e,i)),t.rotation(o.rotationDeg),t.scale({x:o.scaleX,y:o.scaleY}),t.skewX(o.skewX),t.skewY(0)}function $t(t){t.position({x:0,y:0}),t.offset({x:0,y:0}),t.scale({x:1,y:1}),t.rotation(0),t.skewX(0),t.skewY(0)}function Qc(t,e){let i=Math.hypot(e.x-t.surfaceFocal.x,e.y-t.surfaceFocal.y),o=Math.max(0,i-t.frontDistanceWorld);return t.liftWorld+o*Math.tan(t.rakeDeg*Math.PI/180)}function Jc(t,e,i){return t.perspectiveAffine?fe(t.perspectiveAffine,e):fe(i,e)}function tt(t,e){return e?fe(e,t):t}function ed(t,e){let i=0;for(let u of t.seats){let h=Math.max(0,(u.eyeHeightM??se)-se);i=Math.max(i,h*nt)}for(let u of t.objects)u.type==="section"&&(i=Math.max(i,Jt(u,{floorBaseHeightM:t.floorBaseHeightMFor(u.id)}).height*nt));let o=Sr(t.bounds,i),n=pi(o,o.target),r=vr(n);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let s=1/0,a=1/0,l=-1/0,c=-1/0;for(let u of t.seats){let h=Math.max(0,(u.eyeHeightM??se)-se),m=Pe(o,u,h*nt),f={x:m.x,y:m.y};e.seatProjected.set(u.id,f),e.seatLocal.set(u.id,fe(r,f)),e.seatDepth.set(u.id,m.depth),e.seatScale.set(u.id,m.scale),s=Math.min(s,m.x),a=Math.min(a,m.y),l=Math.max(l,m.x),c=Math.max(c,m.y)}for(let u of[{x:t.bounds.x,y:t.bounds.y},{x:t.bounds.x+t.bounds.width,y:t.bounds.y},{x:t.bounds.x+t.bounds.width,y:t.bounds.y+t.bounds.height},{x:t.bounds.x,y:t.bounds.y+t.bounds.height}]){let h=Pe(o,u,0);s=Math.min(s,h.x),a=Math.min(a,h.y),l=Math.max(l,h.x),c=Math.max(c,h.y)}let d=Math.max(24,t.seatR*3);return{camera:o,baseAffine:n,baseInverse:r,bounds:Number.isFinite(s)?{x:s-d,y:a-d,width:Math.max(1,l-s+d*2),height:Math.max(1,c-a+d*2)}:null}}function td(t,e,i){let o=i?[...i].map(n=>t.seatById.get(n)).filter(n=>!!n):e?t.seats:[...t.perspectiveAppliedSeats].map(n=>t.seatById.get(n)).filter(n=>!!n);for(let n of o){if(e&&t.perspectiveAppliedSeats.has(n.id))continue;let r=e?t.perspectiveSeatProjected.get(n.id)??n:n,s=e?t.perspectiveSeatScale.get(n.id)??1:1,a=t.circleById.get(n.id);a?.position(r),a?.scale({x:s,y:s});let l=t.accessRingById.get(n.id);l?.position(r),l?.scale({x:s,y:s});let c=t.accessGlyphById.get(n.id);if(c){let u=t.seatR*1.5/he;c.position(r),c.scale({x:u*s,y:u*s})}let d=t.boothLabelById.get(n.id);d?.position(r),d?.scale({x:s,y:s}),e&&t.perspectiveAppliedSeats.add(n.id)}e||t.perspectiveAppliedSeats.clear()}function Yi(t,e=!0){let i=e?[t.bgLayer,t.seatLayer,t.overlayLayer]:[t.bgLayer,t.overlayLayer];for(let o of i)o.position({x:0,y:0}),o.offset({x:0,y:0}),o.scale({x:1,y:1}),o.rotation(0),o.skewX(0),o.skewY(0)}function id(t,e=!0){for(let i of t.sections()){$t(i.rootGroupBg),$t(i.liftGroupBg),e&&$t(i.liftGroupSeat),i.rootGroupBg.zIndex(i.bgZIndex),e&&i.liftGroupSeat.zIndex(i.seatZIndex);let o=t.labelLiftGroups.get(i.id);o&&e&&$t(o),i.perspectiveAffine=void 0,i.perspectiveCorrection=void 0,i.perspectiveDepth=void 0}}function od(t,e=!0){let i=t.perspectiveCamera(),o=t.perspectiveBaseAffine(),n=t.perspectiveBaseInverse();if(!i||!o||!n)return;let r=t.seats().length>2500&&t.sections().length>0;t.cached()&&!r&&(t.seatLayer.clearCache(),t.seatLayer.listening(!0),t.setCached(!1)),Yi(t,e),id(t,e);for(let a of[t.bgLayer,t.overlayLayer])bn(a,o,i.target);t.perspectiveAppliedSeats.clear(),r||t.applyExactSeatAnchors(!0);for(let a of t.sections()){let l=u=>Qc(a,u),c=pi(i,a.centroid,l),d=wr(n,c);a.perspectiveAffine=c,a.perspectiveCorrection=d,a.perspectiveDepth=Pe(i,a.centroid,l(a.centroid)).depth,bn(a.liftGroupBg,d,a.centroid);for(let u=0;u<a.sideFaces.length;u++){let h=a.outline[u],m=a.outline[(u+1)%a.outline.length],f=tt(Pe(i,h,0),n),b=tt(Pe(i,m,0),n),p=tt(Pe(i,m,l(m)),n),g=tt(Pe(i,h,l(h)),n);a.sideFaces[u].points([f.x,f.y,b.x,b.y,p.x,p.y,g.x,g.y]),a.sideFaces[u].opacity(.9)}}let s=[...t.sections()].sort((a,l)=>(l.perspectiveDepth??0)-(a.perspectiveDepth??0));for(let a of s)a.rootGroupBg.moveToTop(),a.liftGroupSeat.moveToTop();t.unsectionedSeatGroup()?.moveToTop(),t.syncSeatOverlayPositions(),r||t.updateSeatGroupVisibility(),t.bgLayer.batchDraw(),t.seatLayer.batchDraw(),t.overlayLayer.batchDraw()}function nd(t){if(id(t),t.applyExactSeatAnchors(!1),t.isoT()===0)Yi(t);else{let{th:i,sg:o}=Ut(t.isoState()),n=Math.cos(i),r=o*Math.sin(i),s=-Math.sin(i),a=o*Math.cos(i),l=Math.sqrt(n*n+r*r),c=n*a-r*s,d=Math.atan2(r,n)*180/Math.PI,u=l,h=c/l,m=(n*s+r*a)/c,f=t.isoCentre();for(let b of[t.bgLayer,t.seatLayer,t.overlayLayer])b.position({x:f.x,y:f.y}),b.offset({x:f.x,y:f.y}),b.rotation(d),b.scaleX(u),b.scaleY(h),b.skewX(m),b.skewY(0)}t.applyUprightLabels(),t.applyElevation(),t.updateSeatGroupVisibility(),t.bgLayer.batchDraw(),t.seatLayer.batchDraw(),t.overlayLayer.batchDraw()}var rd=(t,e)=>t.length===e.length&&t.every(i=>e.some(o=>Math.abs(i.x-o.x)<.001&&Math.abs(i.y-o.y)<.001));function sd(t,e){let o=(t?.floors?.length?t.floors.flatMap(c=>c.objects):t?.objects??[]).filter(c=>c.type==="section"),n=e.logicalSectionId??e.id,r=c=>(c.elevation??0)===(e.elevation??0)&&JSON.stringify(c.geometry??null)===JSON.stringify(e.geometry??null),s=o.find(c=>c.id===n),a=n!==e.id&&!!s&&r(s)&&(s.holes??[]).some(c=>rd(c,e.outline)),l=o.filter(c=>c.id!==e.id&&c.logicalSectionId===e.id&&r(c));return{hidden:a,holes:(e.holes??[]).filter(c=>!l.some(d=>rd(c,d.outline)))}}import{Group as ad}from"konva/lib/Group";import{Line as gm}from"konva/lib/shapes/Line";import{Rect as bm}from"konva/lib/shapes/Rect";import{Text as yn}from"konva/lib/shapes/Text";function ld(t,e){let i=ei(e.outline,e.holes),o=le(t.canvasBackground),n=[],r=new Map,s=0,a=K(e.outline),l=t.seatIndex?ui(t.seatIndex,a).map(F=>t.seatById.get(F)).filter(F=>!!F):t.seats;for(let F of l)t.seatSection.has(F.id)||J(F,e.outline,e.holes)&&(n.push(F.id),r.set(F.categoryKey,(r.get(F.categoryKey)??0)+1),(t.statusById.get(F.id)??"free")==="free"&&s++);let c=e.color??oi([...r].map(([F,H])=>({hex:t.catColor.get(F)??"#6e7bff",w:H})),"#3a4358"),d=Wn(e.elevation),u=Jt(e,{floorBaseHeightM:t.floorBaseHeightMFor(e.id)}),h=u.height*nt,m=new ad({listening:!1});t.bgLayer.add(m);let f=new ad({listening:!1});m.add(f);let b=new yt({listening:!0});t.seatLayer.add(b);let p=[];if(h>0){let F=Ce(t.zoneColor.get(e.zone??"")??c,.42);for(let H=0;H<e.outline.length;H++){let G=new gm({points:[],closed:!0,fill:F,stroke:O("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});p.push(G),m.add(G)}}f.moveToTop();let g=f,y=sd(t.chartDoc,e),S=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",x=Je(e.outline,y.holes,{visible:!y.hidden,stroke:O(S,.5),strokeWidth:1,fill:O(S,.08),listening:!1},e.outlinePath);g.add(x);let w=Je(e.outline,y.holes,{visible:!y.hidden,fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Xe,opacity:0,listening:!1},e.outlinePath);g.add(w);let v=e.labelPresentation?.labelStyle,k=v?.color,P=o.sectionInk,C=(v?.size??18)/18,T=new bm({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});g.add(T);let L=new yn({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*C,fontStyle:Ye,fontFamily:t.labelFont(),fill:pe(o.sectionFill,k,P),listening:!1,perfectDrawEnabled:!1});L.offsetX(L.width()/2),L.offsetY(L.height()/2),g.add(L);let I=new yn({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Ye,fontFamily:t.labelFont(),fill:pe(o.sectionFill,k,P),opacity:0,listening:!1,perfectDrawEnabled:!1});g.add(I);let M=new yn({x:i.x,y:i.y,text:B("map.seatsLeft",{count:s}),fontSize:12,fontStyle:ss,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});M.offsetX(M.width()/2),g.add(M);let R={id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:i,labelAnchors:[...e.labelPresentation?.position?[e.labelPresentation.position]:[],...Ia(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(n.map(F=>t.seatById.get(F)?.categoryKey).filter(Boolean)),shellCategoryColor:t.dominantSellableColor(n),shellFill:o.sectionFill,shellStroke:o.sectionStroke,stateWord:null,...e.labelPresentation?.position&&!J(e.labelPresentation.position,e.outline,e.holes)?{externalLabel:{position:e.labelPresentation.position,rotation:e.labelPresentation.rotation??0}}:{},...e.labelPresentation?.rotation?{authoredLabelRotation:e.labelPresentation.rotation}:{},labelArea:Hn(e.outline,e.holes),zone:e.zone,memberIds:n,total:n.length,free:s,baseFill:c,outlineTint:S,outlinePoly:x,blockPoly:w,namePlate:T,nameLabel:L,numberLabel:I,subLabel:M,preferredInk:P,...k?{explicitInk:k}:{},labelScale:C,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,elevation:d,liftWorld:h,rakeDeg:u.rake,surfaceFocal:n.length?{...t.seatById.get(n[0])?.focalPoint??t.isoCentre}:{...t.chartDoc?.focalPoint??t.isoCentre},frontDistanceWorld:0,rootGroupBg:m,bgZIndex:m.zIndex(),seatZIndex:b.zIndex(),liftGroupBg:f,liftGroupSeat:b,sideFaces:p},A=n.map(F=>t.seatById.get(F)).filter(F=>!!F),E=A.length?A:e.outline;return R.frontDistanceWorld=Math.min(...E.map(F=>Math.hypot(F.x-R.surfaceFocal.x,F.y-R.surfaceFocal.y))),R}function dd(t,e,i){if(!e?.length)return;let o=new Set(e),n=t.seats.filter(u=>!o.has(u.categoryKey)||t.seatInClosedSection(u.id)?!1:(t.statusById.get(u.id)??"free")==="free"||t.ownedHold.has(u.id));if(!n.length)return;let r=Qo(n.map(u=>u.id),t.seatSection);r&&t.focusSection(r);let s=Math.max(24,t.seatR*3),a=n.map(u=>t.renderedSeatPoint(u)),l=t.clusterLabels.boundsForSeats(n.map((u,h)=>({...u,...a[h]})),s),c=et(a,s);if(l?.singleBlock&&(!t.hasSections||r!=null)){let u=t.clusterLabels.diveTarget(l.bounds,l.anchor);if(u){t.focusRegion(u,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),maxScale:St(t)});return}}let d={x:c.x+c.width/2,y:c.y+c.height/2};jo({stage:t.stage,box:c,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(d)})||t.focusRegion(c,{animate:i?.animate,durationMs:t.cameraGlideMs})}function St(t){let e=dc(Math.max(t.seatR,t.markerR));return Math.max(e,$a(t.markerR))}var cd=.25;function ym(t,e){if(e.length===0)return 1/0;let i=et([...e],t.sellableUnit.diameter/2),o=t.framingViewport();return Math.min(o.width*cd/Math.max(i.width,1e-6),o.height*cd/Math.max(i.height,1e-6))}function hd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let o=ud(t,i);if(!o.length)return!1;t.clearSectionFocus();let n=Math.max(24,t.seatR*3),r=et(o.map(a=>t.renderedSeatPoint(a)),n),s={x:r.x+r.width/2,y:r.y+r.height/2};return jo({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:St(t)}),!0}function ud(t,e){return t.seats.filter(i=>t.seatInClosedSection(i.id)||Re(i,e)!=="match"?!1:(t.statusById.get(i.id)??"free")==="free"||t.ownedHold.has(i.id))}function pd(t,e,i){let o=i===void 0?t.accessFilter:i;if(!o||!t.sections.some(r=>r.id===e||r.logicalId===e))return!1;let n=t.sectionMembers(e).filter(r=>{if((t.statusById.get(r)??"free")!=="free")return!1;let s=t.seatById.get(r);return s!=null&&Re(s,o)==="match"});return n.length&&Sn(t,n)||t.focusSection(e),!0}function fd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let o=ud(t,i);if(!o.length)return null;let n=Math.max(24,t.seatR*3),r=et(o.map(l=>t.renderedSeatPoint(l)),n),s=t.getWorldBounds(),a=s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht;return{spaces:o.length,sections:wn(t,i),wholeVenue:a}}function Sn(t,e,i){let o=e.map(h=>t.seatById.get(h)).filter(h=>h!=null);if(!o.length)return!1;let n=t.seatPitch>0?t.seatPitch:t.seatR*2,r=et(o.map(h=>t.renderedSeatPoint(h)),Math.max(24,t.seatR*3,n*4)),s=t.getWorldBounds();if(s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht)return!1;let a=Qo(o.map(h=>h.id),t.seatSection);a&&t.markSectionFocus(a,{x:r.x+r.width/2,y:r.y+r.height/2});let l=t.rowBandDetailScale()*1.08,c=t.zoomBounds(),d=Math.min(Math.max(Math.min(t.seatLabelTargetScale(),c.max),l),c.max),u=ym(t,o.map(h=>t.renderedSeatPoint(h)));return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:d,maxScale:Math.max(Math.min(St(t),u),d)}),!0}function md(t,e,i=!0,o){let n=t.sectionBounds(e);if(!n)return;let r=t.sectionMembers(e).map(d=>t.seatById.get(d)).filter(d=>d!=null),s=r.filter(d=>(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id)),a=(s.length?s:r).map(d=>t.renderedSeatPoint(d)),l=t.focusedRowLabelGutter(e),c=t.narrowSeatDetailFocus(a,n,o,l);t.focusRegion(c?.bounds??n,{animate:i,minScale:c?.minScale,maxScale:St(t),focusPaddingPx:l})}function vn(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let o=gd(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,o),o}function gd(t,e,i){return fl(e.memberIds,i,o=>t.statusById.get(o)??"free",o=>t.seatById.get(o))}function wn(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return[];let o=i===t.accessFilter,n=new Map;for(let r of t.sections){if(t.isSectionClosed(r))continue;let s=o?vn(t,r):gd(t,r,i);if(s<=0)continue;let a=n.get(r.logicalId);a?a.free+=s:n.set(r.logicalId,{id:r.logicalId,label:r.label,free:s})}return[...n.values()]}var wm=1800,Zt=class Zt{constructor(e,i={}){this.seatLabelPool=new Map;this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;this.canonicalSeatIds=new Set;this.seatIndex=null;this.chartDoc=null;this.activeFloorId="";this.stacked=!1;this.floorOverview=!1;this.floorLabelStyle="number";this.circleById=new Map;this.glyphMarkers=[];this.seatGlyphDetail=!0;this.boothDims=new Map;this.boothLabelById=new Map;this.seatLabelById=new Map;this.seatLabelDrops=new Map;this.seatLabelRungOpen=!1;this.accessRingById=new Map;this.accessGlyphById=new Map;this.freeTextById=new Map;this.iconNodeById=new Map;this.primaryFocalLabels=new Map;this.gaById=new Map;this.statusById=new Map;this.catColor=new Map;this.catByKey=new Map;this.theme={};this.canvasBackground=Uo;this.effSelection=mt;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;this.catOrder=[];this.selection=new Set;this.selectedSeatById=new Map;this.selectionMarkers=new Map;this.momentsCache=null;this.breathCache=null;this.ownedCache=null;this.beaconsCache=null;this.hoverCardCache=null;this.ownedHold=new Set;this.seatMarks=new Di;this.seatPaintCache=null;this.selectionFocusId=null;this.selectionFocusKeep=null;this.hiddenPose=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;this.accessFreeBySection=new Map;this.categoryHighlight=null;this.seatHighlight=null;this.labelLayers={seatLabels:!0,rowLabels:!0};this.categoryColours=!0;this.categoryFilter=null;this.commercialLimitedFilter=!1;this.sections=[];this.zones=[];this.landmarkBoxes=[];this.seatSection=new Map;this.unsectionedSeatGroup=null;this.catPrice=new Map;this.dimmedSections=new Set;this.sectionHeat=new Map;this.closedSections=new Set;this.focusedSectionId=null;this.focusMembership=new Map;this.focusMembershipKey=null;this.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.sectionFocusDim=null;this.cameraGestures=0;this.objectFloor=new Map;this.unsectionedSeatIds=null;this.tableFootprints=[];this.zoneColor=new Map;this.hasSections=!1;this.hasBoothText=!1;this.isoT=0;this.isoTarget=0;this.isoRaf=0;this.viewMode="flat";this.perspectiveCamera=null;this.perspectiveBaseAffine=null;this.perspectiveBaseInverse=null;this.perspectiveSeatLocal=new Map;this.perspectiveSeatProjected=new Map;this.perspectiveSeatDepth=new Map;this.perspectiveSeatScale=new Map;this.perspectiveAppliedSeats=new Set;this.perspectiveBounds=null;this.isoCentre={x:0,y:0};this.glideRaf=0;this.labelsVisible=!1;this.labelFadeRaf=0;this.glideInProgress=!1;this.destroyed=!1;this.lodScale=0;this.reducedMotion=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.cameraGlideMs=lc();this.fitScale=1;this.fitPose="";this.viewportInsets={...ln};this.fitClearance={bottom:0,width:0};this.seatR=te;this.markerR=te;this.seatPitch=0;this.sellableUnit=Zo(te);this.bounds={x:0,y:0,width:1,height:1};this.cached=!1;this.dpr=Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);this.assets=new Xi;this.seatReveal=null;this.seatRevealPending=!1;this.revealWorldRect=null;this.progressiveSeatFloor=800;this.viewportSeats=null;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.zoomSettleRaf=0;this.readingFocusedFrame=!1;this.marquee=new zi({overlayLayer:()=>this.overlayLayer,stageScale:()=>this.stage.scaleX(),screenToWorld:e=>this.screenToWorld(e),selectionColor:()=>this.effSelection,seats:()=>this.seats,renderedSeatPoint:e=>this.renderedSeatPoint(e),isSelectable:e=>this.isSelectable(e),selectMany:e=>{this.selectMany(e)},selectionChanged:()=>{this.opts.onMarquee?.(this.getSelection())}});this.organizerStatus=!0;this.onKeyDown=e=>{if(this.opts.manageMode){if((e.metaKey||e.ctrlKey)&&(e.key==="a"||e.key==="A")){e.preventDefault(),this.opts.onMarquee?.(this.selectAllSelectable());return}if(e.key==="Escape"&&this.selection.size){e.preventDefault(),this.clearSelection(),this.opts.onMarquee?.([]);return}}let i=e.key==="ArrowLeft"?{x:-1,y:0}:e.key==="ArrowRight"?{x:1,y:0}:e.key==="ArrowUp"?{x:0,y:-1}:e.key==="ArrowDown"?{x:0,y:1}:null;if(i){e.preventDefault();let o=this.focusedId?this.nearestSeat(this.focusedId,i):this.seats[0]?.id??null;o&&this.focusSeat(o);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let o=this.seatById.get(this.focusedId);o&&this.opts.onFocusSeat?.(o)}};this.focusRingLinger=null;this.cameraHostCache=null;this.projectionHostCache=null;this.seatAnchorContextCache=null;this.viewportWanted=[];this.viewportPinSync=!1;this.interactionHostCache=null;this.seatLabelTargetScale=Ql(()=>({seats:this.seats,seatR:this.seatR,labelFont:()=>this.labelFont(),seatLabelScale:e=>this.seatLabelScale(e),blockExtent:e=>{let i=this.boothDims.get(e.rowId);return i?gt(i):void 0}}));this.movingLabelTimer=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...i},this.exportMode=i.exportMode===!0,this.loadingReveal=i.loadingReveal??"progressive",this.onSeatsRevealed=i.onSeatsRevealed,this.currency=i.currency;let o=Ui.pixelRatio;if(this.exportMode&&(this.dpr=1),Ui.pixelRatio=this.dpr,this.stage=new Sm({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Vi(this.pointerHost),this.exportMode||(e.style.touchAction="none",this.gestures.attach(),e.tabIndex<0&&(e.tabIndex=0),e.setAttribute("role","application"),e.getAttribute("aria-label")||e.setAttribute("aria-label",B("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new kn({listening:!this.exportMode}),this.seatLayer=new kn({listening:!this.exportMode}),this.overlayLayer=new kn({listening:!1}),this.labelGroup=new qt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new qt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new qt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new Bi({labelLayer:this.overlayLayer,stage:this.stage,exportMode:this.exportMode,canvasBackground:()=>this.canvasBackground,labelFont:()=>this.labelFont(),reducedMotion:()=>this.reducedMotion,destroyed:()=>this.destroyed,hasSections:()=>this.hasSections,seats:()=>this.seats,seatR:()=>this.seatR,readableScale:()=>Qa(this.sellableUnit),pickableScale:()=>_i(this.sellableUnit),categoryLabel:n=>this.catByKey.get(n)?.label??"",categoryColor:n=>this.categoryDisplayColor(n),categoryFilter:()=>this.categoryFilter,viewMode:()=>this.viewMode,seatsPickable:()=>this.seatsPickable(),screenToWorld:n=>this.screenToWorld(n),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(n,r)=>this.focusRegion(n,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new bd({radius:te+2,stroke:"#ffffff",strokeWidth:2,opacity:an,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new bd({radius:te+3,stroke:"#38bdf8",strokeWidth:2.5,dash:[4,3],opacity:.95,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.focusRing),this.stage.add(this.bgLayer,this.seatLayer,this.overlayLayer),this.exportMode&&(Ui.pixelRatio=o),!this.exportMode){this.wireInteraction();let n=this.opts.onFps;n&&Xc(n,r=>{this.rafId=r})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}setRowBandPreview(e){this.rowBandPreview?.clear(),this.rowBandPreview=e?new Kt:null,this.rowBandZoomAnchor=null,this.hoverRing.visible(!1),this.updateLOD(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw()}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get moments(){return this.momentsCache||(this.momentsCache=new Pi({overlayLayer:this.overlayLayer,seatLayer:this.seatLayer,stage:this.stage,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,isCached:()=>this.cached,isExportMode:()=>this.exportMode,labelFont:()=>this.labelFont(),viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),seatPoint:e=>this.renderedSeatPoint(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,selectionFocusDims:e=>this.selectionFocusDims(e),categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.categoryPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,i)=>this.nearestSeatToScreen(e,i)})),this.momentsCache}get breath(){return this.breathCache||(this.breathCache=new Ti({overlayLayer:this.overlayLayer,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,categoryColor:e=>this.categoryDisplayColor(e),seatCategoryKey:e=>this.seatById.get(e)?.categoryKey??null,isOwnedHold:e=>this.ownedHold.has(e),reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed})),this.breathCache}presentSeatHover(e,i,o,n){this.hoverCard.presentSeat(e,i,o,n)}get hoverCard(){return this.hoverCardCache||(this.hoverCardCache=new Ai({container:this.container,labelFont:()=>this.labelFont(),canvasBackground:()=>this.canvasBackground,seatsPickable:()=>this.seatsPickable(),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionLabel:e=>this.sections.find(i=>i.logicalId===e)?.label??null,sectionMembers:e=>this.sectionMembers(e),hoveredSeatId:()=>this.hoveredId,hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,nearestSeat:e=>this.nearestSeatToScreen(e,me,!0),seat:e=>this.seatById.get(e),seatSectionLabel:e=>this.seatSection.get(e)?.label??null,seatStatus:e=>this.statusById.get(e)??"free",seatOwnedHold:e=>this.ownedHold.has(e),seatClosed:e=>this.seatInClosedSection(e),seatSellable:e=>this.opts.manageMode?!this.seatInClosedSection(e)&&(this.statusById.get(e)??"free")==="free":this.isSelectable(e),categoryOrder:()=>this.catOrder,categoryLabel:e=>this.catByKey.get(e)?.label??"",categoryPrice:e=>this.categoryPriceLabel(e),categoryColor:e=>this.categoryDisplayColor(e),categorySellable:e=>this.catByKey.get(e)?.notForSale!==!0,chartDoc:()=>this.chartDoc,seatFacts:e=>this.opts.hoverFacts?.(e)??null})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new Ii({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>Dt(this.effSelection),labelFont:()=>this.labelFont(),stageScale:()=>this.stage.scaleX(),worldToScreen:e=>this.worldToScreen(e),activate:e=>this.activateBeacon(e)})),this.beaconsCache}activateBeacon(e){let i=e.kind==="section"?e.id:this.seatSection.get(e.seatId)?.logicalId??null;if(i&&this.focusOwnedSeatsIn(i)){this.focusSeat(e.seatId,{move:!1,transient:!0});return}if(i){let o=this.sectionTapAnchor(i,this.renderedSeatPoint(this.seatById.get(e.seatId)??{x:0,y:0}));this.opts.onSectionTap?this.opts.onSectionTap(i,o):this.focusSection(i,{anchor:o})}this.focusSeat(e.seatId,{move:!i,transient:!0})}focusedFrameScaleForBounds(){if(this.readingFocusedFrame||!this.focusedSectionId)return 0;this.readingFocusedFrame=!0;try{return this.sectionBounds(this.focusedSectionId)?this.sectionFrameScale(this.focusedSectionId):0}finally{this.readingFocusedFrame=!1}}focusOwnedSeatsIn(e){let i=this.getSelection().map(o=>o.id).filter(o=>{let n=this.seatSection.get(o);return!!n&&(n.logicalId===e||n.id===e)});return i.length>0&&this.focusSeats(i)}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(da({rung:this.getRung(),sections:this.sections,zones:this.zones,ownedSeatIds:i=>this.ownedSeatIds(i),sectionName:i=>i.nameLabel.text()||i.logicalId,sectionAnchor:i=>this.ownedAnchor(i),sectionCentre:i=>i.centroid})),this.breath.syncBeacons(e.breathingRings())}ownedSeatIds(e){return e.memberIds.filter(i=>this.selection.has(i)||this.ownedHold.has(i))}ownedAnchor(e){let i=this.ownedSeatIds(e).map(r=>this.seatById.get(r)).filter(r=>r!=null).map(r=>this.renderedSeatPoint(r));if(!i.length)return{x:e.nameLabel.x(),y:e.nameLabel.y()};let o=0,n=0;for(let r of i)o+=r.x,n+=r.y;return{x:o/i.length,y:n/i.length}}get owned(){return this.ownedCache||(this.ownedCache=new Ri({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>this.ownedAnchor(e),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,i){return this.owned.anchorFor(e)??i}ownedSeatPoints(e){let i=[];for(let o of e.memberIds){if(!this.selection.has(o)&&!this.ownedHold.has(o))continue;let n=this.seatById.get(o);n&&i.push(this.renderedSeatPoint(n))}return i}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),dismissFocusRing:()=>this.dismissFocusRing(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),constrainPan:(e,i)=>this.constrainPan(e,i),marqueeActive:()=>this.marquee.active(),marqueeShouldStart:e=>Yl(e,{manageMode:this.opts.manageMode===!0,atSeatRung:this.getRung()==="seats",marqueeSelect:this.opts.marqueeSelect===!0,hitSeatAt:i=>this.sectionAt(i)!==null||this.nearestSeatToScreen(i,me,!0)!==null}),beginMarquee:e=>this.marquee.begin(e,this.opts.marqueeShape==="lasso"?"lasso":"box"),updateMarquee:e=>this.marquee.update(e),finishMarquee:()=>this.marquee.finish(),cancelMarquee:()=>this.marquee.cancel(),touchProbeStart:e=>this.showTouchLoupe(e),touchProbeMove:e=>this.showTouchLoupe(e),touchProbeEnd:()=>this.hideTouchLoupe()}}setChart(e,i){this.rowBandPreview?.clear(),this.rowBandPreview=e.theme?.sectionDetail==="rows"?new Kt:null,this.rowBandZoomAnchor=null;let o=e===this.chartDoc;if(o||(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??ti(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let a of e.floors)for(let l of a.objects)this.objectFloor.set(l.id,a.id),l.type==="section"&&l.logicalSectionId&&this.objectFloor.set(l.logicalSectionId,a.id);let n=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.seatLabelPool.clear(),this.rowLabelGroup=new qt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup.destroyChildren(),this.circleById.clear(),this.glyphMarkers=[],this.boothDims.clear(),this.boothLabelById.clear(),this.seatLabelById.clear(),this.accessRingById.clear(),this.accessGlyphById.clear(),this.freeTextById.clear(),this.iconNodeById.clear(),this.focusMembership.clear(),this.focusMembershipKey=null,this.unsectionedSeatIds=null,this.primaryFocalLabels.clear(),this.gaById.clear();for(let a of this.selectionMarkers.values())a.destroy();this.selectionMarkers.clear(),this.beaconsCache?.clear(),this.breathCache?.syncBeacons([]),this.breathCache?.sync(this.selectionMarkers),o||this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.selectionFocusKeep=null,o||this.statusById.clear(),this.accessFreeBySection.clear(),this.seatAnchorContextCache=null,o||(this.selection.clear(),this.selectedSeatById.clear()),this.seatById.clear(),this.seatIndex=null,this.cached=!1,o||(this.accessFilter=null,this.categoryFilter=null,this.categoryHighlight=null,this.seatHighlight=null,this.commercialLimitedFilter=!1),this.sections=[],this.zones=[],this.landmarkBoxes=[],this.seatSection.clear(),this.focusedSectionId=null,this.focusBackdrop=null,this.catPrice.clear(),this.zoneColor.clear(),this.lodScale=0,this.hasBoothText=!1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.isoT=0,this.isoTarget=0,this.viewMode="flat",this.perspectiveCamera=null,this.perspectiveBaseAffine=null,this.perspectiveBaseInverse=null,this.perspectiveSeatLocal.clear(),this.perspectiveSeatProjected.clear(),this.perspectiveSeatDepth.clear(),this.perspectiveSeatScale.clear(),this.perspectiveAppliedSeats.clear(),this.perspectiveBounds=null,this.resetLayerTransforms(),this.hasSections=n.objects.some(a=>a.type==="section");for(let a of e.zones??[])a.color&&this.zoneColor.set(a.id,a.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=fi(this.theme.seatScale)*te,this.container.style.background="",this.canvasBackground=this.resolveCanvasBackground(),this.container.style.background=this.canvasBackground,this.effSelection=this.resolveSelectionColor(),this.hoverRing.stroke(this.effSelection),this.hoverRing.radius(this.seatR+2),this.catColor.clear(),this.catByKey.clear(),this.catPrice.clear(),this.catOrder=e.categories.map(a=>a.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((a,l)=>{this.cbHueByKey.set(a,xi[l%xi.length])});for(let a of e.categories){this.catColor.set(a.key,a.color),this.catByKey.set(a.key,a);let l=this.categoryPriceRanges===null?void 0:this.categoryPriceRanges?.[a.key]?.min??a.price;typeof l=="number"&&this.catPrice.set(a.key,l)}this.tableFootprints=sc(n.objects);for(let a of n.objects)a.type==="booth"&&this.boothDims.set(a.id,{width:a.width,height:a.height,rotation:a.rotation,...a.points&&a.points.length>=3?{points:a.points.map(l=>({x:l.x,y:l.y}))}:{},...Tt(a)?{}:{nameHidden:!0},...We(a)?{nameSize:We(a)}:{}});if(this.seats=He(n,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!o){let a=n===e?this.seats:He(e);this.canonicalSeatIds=new Set(a.map(l=>l.id))}for(let a of this.seats)this.seatById.set(a.id,a),this.statusById.has(a.id)||this.statusById.set(a.id,"free");this.seatIndex=yr(this.seats,{seatRadius:this.seatR}),this.seatPitch=Ya(this.seats),this.markerR=Ua(this.seatR,this.seatPitch),this.sellableUnit=ja(this.seats,{markerRadius:this.markerR,blockDims:this.boothDims}),this.clusterLabels.rebuild(),this.bounds=Un(n,{freeText:"exclude"}),this.isoCentre={x:this.bounds.x+this.bounds.width/2,y:this.bounds.y+this.bounds.height/2},this.buildPerspectiveProjection(n),this.renderBackground(n),this.unsectionedSeatGroup=new qt({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.loadingReveal==="viewport"&&!this.exportMode&&this.viewMode==="flat"&&this.sections.length>1;r&&this.startViewportSeats();let s=this.seatRevealWanted();this.seatRevealPending=s,this.revealWorldRect=s||r?Uc(this.seats,{seatR:this.seatR,boothDims:this.boothDims}):null,!s&&!r&&this.renderSeats(),this.buildRowLabelPlan(n),this.overlayLayer.add(this.labelGroup),this.overlayLayer.add(this.fgDecorGroup),this.overlayLayer.add(this.hoverRing),this.overlayLayer.add(this.focusRing),this.mountCachePending=!s&&!r,this.zoomToFit(),s&&this.startSeatReveal()}seatRevealWanted(){return this.loadingReveal==="progressive"&&!this.exportMode&&this.sections.length>1&&this.seats.length>=this.progressiveSeatFloor}startSeatReveal(){this.cancelSeatReveal();let e=$c({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=Yc({chunks:e,build:i=>this.renderSeats(i.seats),fade:(i,o)=>i.group.opacity(o),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.afterViewChange(),this.fitPose&&Ze(this.stage)===this.fitPose&&this.zoomToFit(),this.seatLayer.batchDraw(),this.onSeatsRevealed?.()}})}viewportCentreInChartSpace(){let e=this.stage.scaleX()||1;return{x:(this.stage.width()/2-this.stage.x())/e,y:(this.stage.height()/2-this.stage.y())/e}}cancelSeatReveal(e=!1){if(this.viewportSeats){let o=this.viewportSeats;this.viewportSeats=null,e?o.finish():o.cancel()}let i=this.seatReveal;this.seatRevealPending=!1,i&&(this.seatReveal=null,e?i.finishNow():i.cancel(),this.seats.length&&!this.destroyed&&this.updateLabels())}floorView(e){if(!e.floors?.length)return{...e,referenceImage:void 0,backgroundImage:Lt(e)};if(this.floorOverview&&e.floors.length>=2)return e.floorOverview==="combined"?Qn(e):jn(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...Yn(e),referenceImage:void 0,backgroundImage:Lt(e)};let i=e.floors.find(o=>o.id===this.activeFloorId)??e.floors[0];return{...e,objects:i.objects,focalPoint:i.focalPoint,referenceImage:void 0,backgroundImage:Lt(i),floors:void 0}}floorBaseHeightMFor(e){let i=this.chartDoc?.floors;if(!i?.length)return 0;let o=this.stacked&&e?this.objectFloor.get(e)??this.activeFloorId:this.activeFloorId;return i.find(n=>n.id===o)?.baseHeightM??0}setStacked(e){!this.chartDoc||e===this.stacked||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.stacked=e,e&&(this.floorOverview=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isStacked(){return this.stacked}setFloorOverview(e){!this.chartDoc||e===this.floorOverview||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.floorOverview=e,e&&(this.stacked=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isFloorOverview(){return this.floorOverview}get separatedFloorOverview(){return this.floorOverview&&this.chartDoc?.floorOverview!=="combined"}setFloorLabelStyle(e){e===this.floorLabelStyle||!this.chartDoc||(this.floorLabelStyle=e,this.floorOverview&&this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}getFloorLabelStyle(){return this.floorLabelStyle}setActiveFloor(e){!this.chartDoc||e===this.activeFloorId&&!this.floorOverview&&!this.stacked||(this.floorOverview=!1,this.stacked=!1,this.setChart(this.chartDoc,{floorId:e}))}getFloors(){return this.chartDoc?ti(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let o=!1,n=this.hasSections?new Set:null;for(let r of e){if(!this.canonicalSeatIds.has(r))continue;let s=this.statusById.get(r);if(s===i)continue;this.statusById.set(r,i);let a=this.circleById.get(r);if(a&&(this.paintSeat(a,r),o=!0),n){let l=this.seatSection.get(r);l&&(this.accessFreeBySection.delete(l.id),s==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),n.add(l))}}if(n&&n.size){for(let r of n)this.refreshSectionFill(r);this.bgLayer.batchDraw()}o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>oe&&this.updateLabels())}setSeatCategories(e){let i=!1,o=!1,n=new Set;for(let[s,a]of Object.entries(e)){let l=this.seatById.get(s);if(!l||!this.catColor.has(a)||l.categoryKey===a)continue;l.categoryKey=a,i=!0;let c=this.circleById.get(s);c&&(this.paintSeat(c,s),o=!0);let d=this.seatSection.get(s);d&&n.add(d)}if(!i)return;let r=new Map((this.chartDoc?ti(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of n){if(!r.get(s.id)?.color){let l=new Map;for(let c of s.memberIds){let d=this.seatById.get(c)?.categoryKey;d&&l.set(d,(l.get(d)??0)+1)}s.baseFill=oi([...l].map(([c,d])=>({hex:this.catColor.get(c)??"#6e7bff",w:d})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}n.size&&this.bgLayer.batchDraw(),o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>oe&&this.updateLabels())}setOwnedHold(e){let i=new Set((e??[]).filter(n=>this.statusById.has(n))),o=new Set([...this.ownedHold,...i]);this.ownedHold=i;for(let n of o){let r=this.circleById.get(n);r&&this.paintSeat(r,n),this.syncSelectionMarker(n)}o.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>oe&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;let o=this.selectionFocusId;this.selectionFocusId=i,this.selectionFocusKeep=Gl({focusedId:i,seats:this.seats,seatId:s=>s.id,seatPoint:s=>this.renderedSeatPoint(s),sectionOf:s=>this.seatSection.get(s)?.logicalId??null,seatPitch:this.seatPitch,seatRadius:this.seatR});let r=o!=null&&i!=null&&Wl(o,i,s=>this.seatSection.get(s)?.logicalId??null)?[o,i]:this.seats.map(s=>s.id);for(let s of r){let a=this.circleById.get(s);a&&this.paintSeat(a,s)}o&&this.syncSelectionMarker(o),i&&this.syncSelectionMarker(i);for(let[s,a]of this.selectionMarkers)a.opacity(this.selectionFocusDims(s)?.2:1);this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.updateLabels(),this.overlayLayer.batchDraw()}setSeatMarks(e){let i=this.seatMarks.merge(e,this.statusById);for(let o of i){let n=this.circleById.get(o);n&&this.paintSeat(n,o)}i.size&&(this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}getSeatMark(e){return this.seatMarks.get(e)}getStatus(e){return this.statusById.get(e)??"free"}getSelection(){let e=[];for(let i of this.selection){let o=this.seatById.get(i)??this.selectedSeatById.get(i);o&&e.push(o)}return e}clearSelection(){let e=[...this.selection];for(let i of e)this.setSelected(i,!1,!0);this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let i=[];for(let o of e){if(this.selection.has(o)||!this.isSelectable(o))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(o,!0,!0);let n=this.seatById.get(o);n&&i.push(n)}return i.length&&this.overlayLayer.batchDraw(),i}setManageInteraction(e){this.marquee.cancel(),this.gestures.resetPan();let i=e.organizerStatus!==!1,o=i!==this.organizerStatus;this.organizerStatus=i,this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.marqueeShape=e.marqueeShape??"box",this.opts.rowLabelSelect=e.rowLabelSelect===!0,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let n=[...this.selection].filter(r=>!this.isSelectable(r));n.length&&this.deselect(n),!e.manageMode&&this.selection.size&&this.clearSelection(),this.clusterLabels.syncCursor(!1),o&&this.repaintSectionsAndSeats(),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[i,o]of Object.entries(e??{}))Number.isFinite(o)&&this.sectionHeat.set(i,Math.max(0,Math.min(1,o)));for(let i of this.sections)this.refreshSectionHeat(i);this.bgLayer.batchDraw()}deselect(e){let i=!1;for(let o of e)this.selection.has(o)&&(this.setSelected(o,!1,!0),i=!0);i&&(this.overlayLayer.batchDraw(),this.effScale()>oe&&this.updateLabels())}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let i of this.seats)this.isSelectable(i.id)&&e.push(i.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let i=new Set(e),o=[];for(let n of this.seats)i.has(n.label)&&this.isSelectable(n.id)&&o.push(n.id);return this.selectMany(o)}setEvidenceSelection(e){return!this.seatById.has(e)||!this.isSelectable(e)?!1:(this.selection.size&&this.clearSelection(),this.setSelected(e,!0),this.overlayLayer.batchDraw(),this.selection.has(e))}getSelectableInSection(e){let i=[],o=new Set;for(let n of this.sections)if(!(n.id!==e&&n.logicalId!==e&&n.zone!==e))for(let r of n.memberIds){if(o.has(r)||(o.add(r),!this.isSelectable(r)))continue;let s=this.seatById.get(r);s&&i.push(s)}return i}selectMany(e){let i=e.filter(n=>!this.selection.has(n));if(!i.length)return this.getSelection();let o=this.selection.size+i.length<=Vr;for(let n of i)if(o)this.setSelected(n,!0,!0);else{this.selection.add(n);let r=this.circleById.get(n);r&&this.paintSeat(r,n)}return this.queueViewportPinSync(),this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}rowLabelAtScreen(e){if(!this.opts.manageMode||!this.opts.rowLabelSelect)return null;let i=[],o=this.rowLabelGroup.find(n=>n.getAttr("rowLabel")===!0);for(let n of o){let r=n.getAttr("rowKey");!r||!n.isVisible()||i.push({rowKey:r,box:n.getClientRect({skipShadow:!0,skipStroke:!0})})}return Ic(e,i)}selectRow(e){let i=Tc(e,this.seats,o=>this.isSelectable(o));return i.length&&(this.selectMany(i),this.opts.onMarquee?.(this.getSelection())),this.getSelection()}flashSeat(e,i="#f43f5e"){let o=this.seatById.get(e);o&&Tl(this.flashHost,e,this.renderedSeatPoint(o),i)}flashSection(e,i="#22a06b"){Il(this.flashHost,this.sections.filter(o=>o.id===e||o.zone===e),i)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,i)=>this.projectedSectionPoint(e,i),isoLiftLocal:e=>this.isoLiftLocal(e)}}nearestSeat(e,i){let o=this.seatById.get(e);if(!o)return null;let n=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(o.id)??o:o,r=null,s=1/0;for(let a of this.seats){if(a.id===e)continue;let l=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(a.id)??a:a,c=l.x-n.x,d=l.y-n.y,u=c*i.x+d*i.y;if(u<=.5)continue;let h=Math.abs(c*i.y-d*i.x),m=u+h*2.5;m<s&&(s=m,r=a.id)}return r}focusSeat(e,i){let o=this.seatById.get(e);if(!o)return;this.focusedId=e,this.queueViewportPinSync(),this.focusRing.radius(this.seatR+3),this.focusRing.position(this.renderedSeatPoint(o));let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;this.focusRing.scale({x:n,y:n}),this.focusRing.visible(!0),this.clearFocusRingLinger(),i?.transient&&(this.focusRingLinger=setTimeout(()=>{this.focusRingLinger=null,this.dismissFocusRing()},wm)),i?.move!==!1&&this.ensureVisible(o),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(o)}clearFocusRingLinger(){this.focusRingLinger&&clearTimeout(this.focusRingLinger),this.focusRingLinger=null}dismissFocusRing(){this.clearFocusRingLinger(),this.focusRing.visible()&&(this.focusRing.visible(!1),this.queueViewportPinSync(),this.overlayLayer.batchDraw())}ensureVisible(e){let i=this.stage.width(),o=this.stage.height(),n=Math.max(this.stage.scaleX(),ve*1.2),r=this.worldToScreen(e),s=70,a=r.x<s||r.x>i-s||r.y<s||r.y>o-s;if(this.stage.scaleX()<n||a){let l=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?fe(this.perspectiveBaseAffine,l):this.isoT===0?l:this.isoForward(l);this.stage.scale({x:n,y:n}),this.stage.position({x:i/2-c.x*n,y:o/2-c.y*n}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=tc(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}setFitClearance(e,i=0){let o={bottom:Math.max(0,e||0),width:Math.max(0,i||0)};o.bottom===this.fitClearance.bottom&&o.width===this.fitClearance.width||(this.fitClearance=o,this.fitPose&&Ze(this.stage)===this.fitPose&&this.zoomToFit())}framingViewport(){return ic(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){let o=this.viewMode==="perspective"?this.perspectiveBounds:null;return ec(e,this.stage.scaleX(),o??this.bounds,this.framingViewport(),i)}framingWorldRect(){return rc(this.framingViewport(),e=>this.screenToWorld(e))}overview(){this.clearSectionFocus(),this.zoomToFit()}zoomToFit(){$l(this.cameraHost)}isSeatRevealPending(){return this.seatRevealPending||this.seatReveal!==null||!!this.viewportSeats?.pending}get cameraHost(){return this.cameraHostCache??={stage:this.stage,bgLayer:this.bgLayer,seatLayer:this.seatLayer,exportMode:()=>this.exportMode,destroyed:()=>this.destroyed,reducedMotion:()=>this.reducedMotion,cameraGlideMs:()=>this.cameraGlideMs,portraitFitCrop:()=>this.opts.portraitFitCrop,openAtSectionsWhenDense:()=>this.opts.openAtSectionsWhenDense===!0,hasSections:()=>this.hasSections,fitClearanceBottom:()=>this.fitClearance.bottom,fitClearanceWidth:()=>this.fitClearance.width,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),viewMode:()=>this.viewMode,zones:()=>this.zones,markerR:()=>this.markerR,unitZoomCeiling:()=>Math.max(Ja(this.sellableUnit),this.hasSections?ke:0),bounds:()=>this.bounds,perspectiveBounds:()=>this.perspectiveBounds,fitScale:()=>this.fitScale,setFitScale:e=>{this.fitScale=e},setFitPose:e=>{this.fitPose=e},revealWorldRect:()=>this.viewportSeats||this.isSeatRevealPending()?this.revealWorldRect:null,glideRaf:()=>this.glideRaf,setGlideRaf:e=>{this.glideRaf=e},setGlideInProgress:e=>{this.glideInProgress=e},zoomSettleRaf:()=>this.zoomSettleRaf,setZoomSettleRaf:e=>{this.zoomSettleRaf=e},framingViewport:()=>this.framingViewport(),constrainPan:(e,i)=>this.constrainPan(e,i),sectionBounds:e=>this.sectionBounds(e),effScale:()=>this.effScale(),settleView:()=>this.settleView(),afterViewChange:()=>this.afterViewChange(),scheduleViewChange:()=>this.scheduleViewChange(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),updateLOD:()=>this.updateLOD(),cancelGlide:()=>this.cancelGlide()}}refitCurrentView(e=!1){if(e){this.settleView();return}if(this.focusedSectionId&&this.sectionBounds(this.focusedSectionId)){this.focusSectionCamera(this.focusedSectionId,!1,this.focusAnchor);return}if(this.categoryFilter?.size){this.focusCategories([...this.categoryFilter],{animate:!1});return}this.zoomToFit()}getCameraPose(){return oc(this.stage)}setCameraPose(e){this.cancelGlide(),nc(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()*Zt.ZOOM_STEP,zt(this.framingViewport()))}zoomOut(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()/Zt.ZOOM_STEP,zt(this.framingViewport()))}zoomOutLevel(){this.dismissFocusRing();let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e,{maxScale:this.diveCeiling(),focusPaddingPx:this.focusedRowLabelGutter(e)}),"section"):"venue":this.getRung()==="seats"&&(this.setRung("sections"),this.getRung()!=="seats")?"sections":(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let i of this.gaById.values())e+=i.capacity;return e}worldToScreen(e){let i=this.stage.scaleX(),o=e.id,n=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let a=n?this.perspectiveSeatProjected.get(n.id)??fe(this.perspectiveBaseAffine,e):fe(this.perspectiveBaseAffine,e);return{x:a.x*i+this.stage.x(),y:a.y*i+this.stage.y()}}let r=n?this.renderedSeatPoint(n):e,s=this.isoT===0?r:this.isoForward(r);return{x:s.x*i+this.stage.x(),y:s.y*i+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let i=e===null?null:[...e];if(!this.sameAccessFilter(i)){this.accessFilter=i,this.accessFreeBySection.clear();for(let o of this.sections)this.refreshSectionFill(o);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale()),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let i=this.accessFilter;return i===null||e===null?i===e:i.length===e.length&&i.every((o,n)=>o===e[n])}setCommercialLimitedFilter(e){this.commercialLimitedFilter!==e&&(this.commercialLimitedFilter=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setCategoryFilter(e){let i=e===null?null:new Set(e);rl(i,this.categoryFilter)||(this.categoryFilter=i,this.lodScale=0,this.updateLOD(),this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}applyGAFilterState(){this.clusterLabels.applyFilterDim(),this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){kc({gaById:this.gaById,bgLayer:this.bgLayer,exportMode:this.exportMode,pickerMode:!!this.opts.gaPickerMode,selectionColor:this.effSelection,labelFont:()=>this.labelFont(),filteredOut:e=>!!(this.categoryFilter&&!this.categoryFilter.has(e)),dimmed:e=>vc(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<Z,effScale:()=>this.effScale(),labelLegible:e=>Se(e,this.effScale())})}setGAStates(e){xc(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,i){this.setGAStates({[e]:i})}get focusFramingContext(){return{stage:this.stage,seats:this.seats,sections:this.sections,hasSections:this.hasSections,seatById:this.seatById,seatSection:this.seatSection,statusById:this.statusById,ownedHold:this.ownedHold,accessFilter:this.accessFilter,accessFreeBySection:this.accessFreeBySection,clusterLabels:this.clusterLabels,seatR:this.seatR,markerR:this.markerR,sellableUnit:this.sellableUnit,seatPitch:this.seatPitch,cameraGlideMs:this.cameraGlideMs,seatInClosedSection:e=>this.seatInClosedSection(e),isSectionClosed:e=>this.isSectionClosed(e),renderedSeatPoint:e=>this.renderedSeatPoint(e),sectionMembers:e=>this.sectionMembers(e),sectionBounds:e=>this.sectionBounds(e),focusedRowLabelGutter:e=>this.focusedRowLabelGutter(e),seatLabelTargetScale:()=>this.seatLabelTargetScale(),zoomBounds:()=>this.zoomBounds(),rowBandDetailScale:()=>this.rowBandPreview?.active&&this.viewMode==="flat"?this.rowBandPreview.detailScale:0,framingViewport:()=>this.framingViewport(),worldToScreen:e=>this.worldToScreen(e),getWorldBounds:()=>this.getWorldBounds(),narrowSeatDetailFocus:(e,i,o,n)=>this.narrowSeatDetailFocus(e,i,o,n),focusSection:(e,i)=>this.focusSection(e,i),markSectionFocus:(e,i)=>this.markSectionFocus(e,i),clearSectionFocus:()=>this.clearSectionFocus(),focusRegion:(e,i)=>this.focusRegion(e,i)}}focusCategories(e,i){dd(this.focusFramingContext,e,i)}diveCeiling(){return St(this.focusFramingContext)}focusAccessibleSeats(e){return hd(this.focusFramingContext,e)}focusAccessibleSection(e,i){return pd(this.focusFramingContext,e,i)}accessibleSpread(e){return fd(this.focusFramingContext,e)}setViewMode(e){if(e!=="flat"&&this.viewportSeats&&this.cancelSeatReveal(!0),e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let a=this.viewMode==="isometric"&&this.isoT>0;this.viewMode=e,this.isoTarget=1,this.isoT=1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.applyPerspective(a),this.zoomToFit();return}let i=e==="isometric"?1:0,o=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=i,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),o){this.isoT=i,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=i,this.applyIso(),this.afterViewChange();return}let n=this.isoT;if(n===i){this.applyIso(),this.afterViewChange();return}let r=performance.now(),s=a=>{if(this.destroyed)return;let l=Math.min(1,(a-r)/zr),c=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2;this.isoT=n+(this.isoTarget-n)*c,this.applyIso(),this.scheduleViewChange(),l<1?this.isoRaf=requestAnimationFrame(s):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(s)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),i=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,i)}return this.stage.scaleX()*(1-(1-Et)*this.isoT)}isoForward(e){return qc(e,this.isoState)}isoInverse(e){return Zc(e,this.isoState)}buildPerspectiveProjection(e){let i=ed({seats:this.seats,objects:e.objects,bounds:this.bounds,seatR:this.seatR,floorBaseHeightMFor:o=>this.floorBaseHeightMFor(o)},{seatLocal:this.perspectiveSeatLocal,seatProjected:this.perspectiveSeatProjected,seatDepth:this.perspectiveSeatDepth,seatScale:this.perspectiveSeatScale});this.perspectiveCamera=i.camera,this.perspectiveBaseAffine=i.baseAffine,this.perspectiveBaseInverse=i.baseInverse,this.perspectiveBounds=i.bounds}projectedSectionPoint(e,i){return Jc(e,i,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return tt(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return jc(e,this.isoState)}get projectionHost(){return this.projectionHostCache??={bgLayer:this.bgLayer,seatLayer:this.seatLayer,overlayLayer:this.overlayLayer,labelLiftGroups:this.labelLiftGroups,perspectiveAppliedSeats:this.perspectiveAppliedSeats,seats:()=>this.seats,sections:()=>this.sections,unsectionedSeatGroup:()=>this.unsectionedSeatGroup,cached:()=>this.cached,setCached:e=>{this.cached=e},isoT:()=>this.isoT,isoState:()=>this.isoState,isoCentre:()=>this.isoCentre,perspectiveCamera:()=>this.perspectiveCamera,perspectiveBaseAffine:()=>this.perspectiveBaseAffine,perspectiveBaseInverse:()=>this.perspectiveBaseInverse,applyExactSeatAnchors:(e,i)=>this.applyExactSeatAnchors(e,i),applyUprightLabels:()=>this.applyUprightLabels(),applyElevation:()=>this.applyElevation(),syncSeatOverlayPositions:()=>this.syncSeatOverlayPositions(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility()}}resetLayerTransforms(e=!0){Yi(this.projectionHost,e)}get seatAnchorContext(){return this.seatAnchorContextCache??={seats:this.seats,seatById:this.seatById,seatR:this.seatR,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,perspectiveAppliedSeats:this.perspectiveAppliedSeats,circleById:this.circleById,accessRingById:this.accessRingById,accessGlyphById:this.accessGlyphById,boothLabelById:this.boothLabelById}}applyExactSeatAnchors(e,i){td(this.seatAnchorContext,e,i)}applyPerspective(e=!0){od(this.projectionHost,e)}applyIso(){nd(this.projectionHost)}applyUprightLabels(){let e=bi*this.isoT,i=1/(1-(1-Et)*this.isoT),o=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let n of o){let r=n.find("Text");for(let s of r){let a=s.getAttr("uprightBase");a==null&&(a=s.rotation(),s.setAttr("uprightBase",a)),s.rotation(a-e),s.scaleX(1),s.scaleY(i),s.skewX(0)}}}applyElevation(){let e=this.isoT;for(let i of this.sections){if(i.liftWorld<=0)continue;let o=this.isoLiftLocal(i.liftWorld);i.liftGroupBg?.position(o),i.liftGroupSeat.position(o),this.labelLiftGroups.get(i.id)?.position(o);let n=.9*e;for(let r=0;r<i.sideFaces.length;r++){let s=i.sideFaces[r],a=i.outline[r],l=i.outline[(r+1)%i.outline.length];s.points([a.x,a.y,l.x,l.y,l.x+o.x,l.y+o.y,a.x+o.x,a.y+o.y]),s.opacity(n)}}this.syncSeatOverlayPositions()}destroy(){this.movingLabelTimer&&(clearTimeout(this.movingLabelTimer),this.movingLabelTimer=null),this.rowBandPreview?.clear(),this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.rafId&&cancelAnimationFrame(this.rafId),this.isoRaf&&cancelAnimationFrame(this.isoRaf),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.zoomSettleRaf&&cancelAnimationFrame(this.zoomSettleRaf),this.breathCache?.destroy(),this.momentsCache?.destroy(),this.beaconsCache?.clear(),this.hoverCardCache?.destroy(),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),this.clusterLabels.destroy(),this.container.removeEventListener("keydown",this.onKeyDown),this.stage.destroy()}labelFont(){return this.exportMode?this.theme.fontFamily?.toLowerCase().includes("jetbrains")?"JetBrains Mono, monospace":"Inter, sans-serif":this.theme.fontFamily||"Inter, sans-serif"}seatContainer(e){return this.seatSection.get(e)?.liftGroupSeat??this.unsectionedSeatGroup??this.seatLayer}sectionMatchesFocus(e){let i=this.focusedSectionId;return i==null||e.id===i||e.logicalId===i||e.zone===i}selectionFocusDims(e){return this.selectionFocusId?!(this.selectionFocusKeep?.has(e)??e===this.selectionFocusId):!1}focusedSeatOpacity(e,i){if(!this.focusedSectionId||!this.focusDimOverlay)return i;let o=this.seatSection.get(e);return i*(o&&this.sectionMatchesFocus(o)?1:Te)}sectionScreenBounds(e){return Ma({viewMode:this.viewMode,isoT:this.isoT,stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y(),projectedSectionPoint:(i,o)=>this.projectedSectionPoint(i,o),isoLiftLocal:i=>this.isoLiftLocal(i),isoForward:i=>this.isoForward(i)},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=Z,i=[],o=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,n=96,r=this.stage.width(),s=this.stage.height();for(let a of this.sections){let l=!0;if(e){let d=this.sectionScreenBounds(a);l=d.x+d.width>=-n&&d.y+d.height>=-n&&d.x<=r+n&&d.y<=s+n,l&&this.viewMode==="perspective"&&!o&&this.applyExactSeatAnchors(!0,a.memberIds)}this.viewportSeats&&l&&(e||a.id===this.focusedSectionId||a.logicalId===this.focusedSectionId)&&i.push(a.id),a.liftGroupSeat.setViewportCulled(!l),this.labelLiftGroups.get(a.id)?.setViewportCulled(!l)}this.viewportSeats&&this.viewportSeats.sync(this.viewportWanted=[...i,"__loose"],this.viewportPins()),this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!o&&(this.unsectionedSeatIds||(this.unsectionedSeatIds=this.seats.filter(a=>!this.seatSection.has(a.id)).map(a=>a.id)),this.applyExactSeatAnchors(!0,this.unsectionedSeatIds))}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(let o of i.memberIds){let n=this.seatById.get(o);n&&e.push(n)}this.unsectionedSeatIds??=this.seats.filter(i=>!this.seatSection.has(i.id)).map(i=>i.id);for(let i of this.unsectionedSeatIds){let o=this.seatById.get(i);o&&e.push(o)}return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}renderedSeatPoint(e){if(this.viewMode==="perspective")return this.perspectiveSeatLocal.get(e.id)??e;let i=this.seatSection.get(e.id);if(!i||i.liftWorld<=0||this.isoT===0)return e;let o=this.isoLiftLocal(i.liftWorld);return{x:e.x+o.x,y:e.y+o.y}}seatLabelContainer(e){let i=this.seatSection.get(e);if(!i)return this.labelGroup;let o=this.labelLiftGroups.get(i.id);return o||(o=new yt({listening:!1}),o.setViewportCulled(i.liftGroupSeat.isViewportCulled()),o.position(this.viewMode==="perspective"?{x:0,y:0}:this.isoLiftLocal(i.liftWorld)),this.labelGroup.add(o),this.labelLiftGroups.set(i.id,o)),o}syncSeatOverlayPositions(){if(this.hoveredId){let e=this.seatById.get(this.hoveredId);if(e){this.hoverRing.position(this.renderedSeatPoint(e));let i=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.hoverRing.scale({x:i,y:i})}}if(this.focusedId){let e=this.seatById.get(this.focusedId);if(e){this.focusRing.position(this.renderedSeatPoint(e));let i=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.focusRing.scale({x:i,y:i})}}for(let[e,i]of this.selectionMarkers){let o=this.seatById.get(e);if(o){i.position(this.renderedSeatPoint(o));let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(o.id)??1:1;i.scale({x:n,y:n})}}}viewportPins(){return Ha([this.focusRing.visible()?this.focusedId:null,this.hoveredId],this.ownedHold,this.selection)}queueViewportPinSync(){!this.viewportSeats||this.viewportPinSync||(this.viewportPinSync=!0,queueMicrotask(()=>{this.viewportPinSync=!1,this.viewportSeats?.sync(this.viewportWanted,this.viewportPins())}))}startViewportSeats(){let e=new Map;this.viewportWanted=["__loose"];for(let i of this.seats){let o=this.seatSection.get(i.id)?.id??"__loose",n=e.get(o);n||e.set(o,n=[]),n.push(i)}this.viewportSeats=new Ei(e,{build:i=>this.renderSeats(i),remove:i=>{for(let o of i)for(let n of[this.circleById,this.accessGlyphById,this.accessRingById,this.boothLabelById])n.get(o.id)?.destroy(),n.delete(o.id);this.glyphMarkers=this.glyphMarkers.filter(o=>!!o.getParent())},draw:()=>{this.updateLOD(),this.updateLabels(),this.seatLayer.batchDraw()},schedule:i=>requestAnimationFrame(i),cancel:i=>cancelAnimationFrame(i),now:()=>performance.now(),sectionOf:i=>this.seatById.has(i)?this.seatSection.get(i)?.id??"__loose":void 0})}renderSeats(e=this.seats){el({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,colorblind:this.colorblind,canvasBackground:this.canvasBackground,setHasBoothText:()=>{this.hasBoothText=!0},circleById:this.circleById,glyphMarkers:this.glyphMarkers,boothDims:this.boothDims,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,accessRingById:this.accessRingById,catByKey:this.catByKey,perspectiveSeatDepth:this.perspectiveSeatDepth,seatContainer:i=>this.seatContainer(i),buildAccessGlyph:(i,o)=>this.buildAccessGlyph(i,o),paintSeat:(i,o)=>this.paintSeat(i,o),labelFont:()=>this.labelFont()});for(let i of e)this.selection.has(i.id)&&this.syncSelectionMarker(i.id)}buildAccessGlyph(e,i){let o=this.seatR*1.5/he,n=new vm({x:e.x,y:e.y,data:st(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:li(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return gc(n),n}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[i,o]of this.accessGlyphById){let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(i)??1:1,r=this.seatR*1.5/he*n,a=this.accessGlyphFilterEmphasized(i)?Br:_r,l=Math.max(r,a/(he*Math.max(e,.001)));o.scale({x:l,y:l}),o.visible(this.accessGlyphShouldShow(i))}}accessGlyphFilterEmphasized(e){let i=this.seatById.get(e),o=this.accessFilter;return!!i&&o!==null&&!!i.accessibility?.length&&Me(i,o)}accessGlyphShouldShow(e){return!this.accessGlyphById.has(e)||!this.accessMarkerEligible(e)?!1:!(this.selection.has(e)||this.ownedHold.has(e))}accessRingShouldShow(e){return this.accessRingById.has(e)&&this.accessMarkerEligible(e)}accessMarkerEligible(e){let i=this.statusById.get(e)??"free";return!(i==="booked"||i==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryPriceLabel(e){if(this.categoryPriceRanges===null)return null;let i=this.categoryPriceRanges?.[e];if(i&&i.max>i.min)return`${$e(i.min,this.currency)}\u2013${$e(i.max,this.currency)}`;let o=this.catPrice.get(e);return typeof o=="number"?$e(o,this.currency):null}setCategoryPriceRanges(e){if(JSON.stringify(e)!==JSON.stringify(this.categoryPriceRanges)&&(this.categoryPriceRanges=e==null?e:Object.fromEntries(Object.entries(e).filter(([,i])=>Number.isFinite(i.min)&&Number.isFinite(i.max)&&i.min>=0&&i.max>=i.min).map(([i,o])=>[i,{min:o.min,max:o.max}])),!!this.chartDoc)){if(this.catPrice.clear(),this.categoryPriceRanges!==null)for(let i of this.chartDoc.categories){let o=this.categoryPriceRanges?.[i.key]?.min??i.price;typeof o=="number"&&this.catPrice.set(i.key,o)}this.hoverCardCache?.hide(),this.clusterLabels.rebuild();for(let i of this.zones)i.back.destroy(),i.label.destroy(),i.sub?.destroy();this.zones.length=0,this.renderZones(this.chartDoc),this.updateLOD(),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw()}}categoryDisplayColor(e){return this.categoryColours?this.colorblind?this.cbHueByKey.get(e)??xi[0]:this.catColor.get(e)??"#6e7bff":La}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??Qe}seatLabelInk(e,i){let o=i.fill();return pe(typeof o=="string"?o:"",e.labelStyle?.color,this.theme.seatLabelColor??Qe,ze)}get seatPaintContext(){return this.seatPaintCache||(this.seatPaintCache={organizer:()=>this.opts.manageMode===!0&&this.organizerStatus,organizerGlyph:this.opts.organizerGlyph,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",isSelected:e=>this.selection.has(e),isOwnedHold:e=>this.ownedHold.has(e),categoryColor:e=>this.categoryDisplayColor(e),boothLabel:e=>this.boothLabelById.get(e),boothExtent:e=>{let i=this.boothDims.get(e);return i?{...gt(i),...i.nameSize?{nameSize:i.nameSize}:{}}:void 0},seatLabel:e=>this.seatLabelById.get(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatMarks:this.seatMarks,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,colorblind:()=>this.colorblind,selectionColor:()=>this.effSelection,theme:()=>this.theme,effScale:()=>this.effScale(),seatInClosedSection:e=>this.seatInClosedSection(e),selectionFocusDims:e=>this.selectionFocusDims(e),accessFilter:()=>this.accessFilter,categoryHighlight:()=>this.categoryHighlight,seatHighlight:()=>this.seatHighlight,categoryFilter:()=>this.categoryFilter,commercialLimitedFilter:()=>this.commercialLimitedFilter,dimmedSections:()=>this.dimmedSections,closedSections:()=>this.closedSections,seatSection:e=>this.seatSection.get(e),accessGlyph:e=>this.accessGlyphById.get(e),accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),accessRing:e=>this.accessRingById.get(e),accessRingShouldShow:e=>this.accessRingShouldShow(e)}),this.seatPaintCache}paintSeat(e,i){Vl(this.seatPaintContext,e,i),this.rowBandPreview?.repaint()}repaintSeats(){for(let e of this.seats){let i=this.circleById.get(e.id);i&&this.paintSeat(i,e.id)}}seatInClosedSection(e){if(!this.closedSections.size)return!1;let i=this.seatSection.get(e);return!!i&&(this.closedSections.has(i.id)||this.closedSections.has(i.logicalId)||i.zone!=null&&this.closedSections.has(i.zone))}setColorblindSafe(e){if(e!==this.colorblind){this.colorblind=e,this.repaintSeats();for(let i of this.sections)i.shellCategoryColor=this.dominantSellableColor(i.memberIds),this.refreshSectionFill(i);this.bgLayer.batchDraw(),this.updateLabels(),this.clusterLabels.rebuild(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setDimmedSections(e){let i=new Set(e??[]);i.size===this.dimmedSections.size&&[...i].every(o=>this.dimmedSections.has(o))||(this.dimmedSections=i,this.repaintSeats(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}setClosedSections(e){let i=new Set(e??[]);i.size===this.closedSections.size&&[...i].every(o=>this.closedSections.has(o))||(this.closedSections=i,this.repaintSectionsAndSeats())}focusSection(e,i){this.markSectionFocus(e,i?.anchor??null)&&this.focusSectionCamera(e,!0,i?.anchor)}markSectionFocus(e,i){return this.sections.some(o=>o.id===e||o.logicalId===e)?(this.focusedSectionId=e,this.focusAnchor=i,this.focusRoams=!1,this.sectionDimEnabled()&&this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),!0):!1}focusSeats(e,i){return Sn(this.focusFramingContext,e,i)}focusSectionCamera(e,i=!0,o){if(this.rowBandPreview&&this.viewMode==="flat"&&!this.exportMode){let n=this.sectionBounds(e);if(n){let r=Math.min(this.sectionFrameScale(e),this.zoomBounds().max*.85);this.focusRegion(n,{animate:i,maxScale:r});return}}md(this.focusFramingContext,e,i,o)}releaseSectionFocusDim(){this.cameraGestures+=1,this.focusRoams=!0,this.dropFocusDim()}dropFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}sectionDimEnabled(){return this.sectionFocusDim??this.stage.width()>=j}setSectionFocusDim(e){let i=this.sectionDimEnabled();this.sectionFocusDim=e,i!==e&&(e||this.dropFocusDim())}clearSectionFocus(){this.focusedSectionId&&(this.focusedSectionId=null,this.focusAnchor=null,this.focusRoams=!1,this.focusBackdrop&&(this.focusBackdrop.destroy(),this.focusBackdrop=null),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD())}getFocusedSection(){return this.focusedSectionId}seatsRevealed(){return this.rowBandPreview?.active?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=ae}atVenueFit(){return this.fitPose!==""&&Ze(this.stage)===this.fitPose}canZoomIn(){return this.stage.scaleX()<this.zoomBounds().max*(1-1e-6)}seatsPickable(){return this.rowBandPreview?.active||this.viewportSeats&&this.seatLayer.opacity()===0?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=_i(this.sellableUnit)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let i=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=Ml(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=Rl(this.focusBackdropHost,i);for(let o of this.selectionMarkers.values())o.moveToTop();this.beaconsCache?.raise(),this.hoverRing.moveToTop(),this.focusRing.moveToTop()}}get focusBackdropHost(){return{bgLayer:this.bgLayer,overlayLayer:this.overlayLayer,bounds:this.bounds,canvasBackground:this.canvasBackground,viewMode:this.viewMode,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,i)=>this.projectedSectionPoint(e,i),isoLiftLocal:e=>this.isoLiftLocal(e),focusedRowLabelCutouts:()=>{let e=this.focusedSectionId;return e?this.rowLabelGroup.find(i=>i.getAttr("rowLabel")===!0).filter(i=>i.getAttr("focusKeys")?.includes(e)).map(i=>{let o=i.getClientRect({relativeTo:this.overlayLayer,skipShadow:!0,skipStroke:!0}),n=2;return[{x:o.x-n,y:o.y-n},{x:o.x+o.width+n,y:o.y-n},{x:o.x+o.width+n,y:o.y+o.height+n},{x:o.x-n,y:o.y+o.height+n}]}):[]}}}repaintSectionsAndSeats(){this.repaintSeats();for(let e of this.sections)this.refreshSectionFill(e);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){let e=this.screenToWorld({x:0,y:0}),i=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,i.x),y:Math.min(e.y,i.y),width:Math.abs(i.x-e.x),height:Math.abs(i.y-e.y)}}getWorldBounds(){let e=1/0,i=1/0,o=-1/0,n=-1/0,r=(s,a)=>{s<e&&(e=s),a<i&&(i=a),s>o&&(o=s),a>n&&(n=a)};for(let s of this.seats)r(s.x,s.y);for(let s of this.sections)for(let a of s.outline)r(a.x,a.y);for(let s of this.gaById.values())for(let a of s.points)r(a.x,a.y);return Number.isFinite(e)?{x:e,y:i,width:Math.max(1,o-e),height:Math.max(1,n-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(i=>{let o=this.isSectionClosed(i)||i.free<=0,n=i.memberIds.some(a=>this.selection.has(a)),r=n||i.memberIds.some(a=>this.ownedHold.has(a)),s=this.focusedSectionId===i.id||this.focusedSectionId===i.logicalId;return{id:i.logicalId,label:i.label,outline:i.outline.map(a=>({...a})),...this.objectFloor.get(i.id)?{floorId:this.objectFloor.get(i.id)}:{},state:n?"selected":o?"inactive":"available",active:s,paint:{fill:i.shellFill,stroke:i.shellStroke},owned:r,free:i.free,total:i.memberIds.length}});return{sections:e,seats:e.length?[]:this.seats.map(i=>({x:i.x,y:i.y,categoryKey:i.categoryKey,state:this.selection.has(i.id)?"selected":this.statusById.get(i.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let i=this.worldToScreen(e),o={x:this.stage.x(),y:this.stage.y()};this.stage.position(this.constrainPan({x:o.x+this.stage.width()/2-i.x,y:o.y+this.stage.height()/2-i.y},o)),this.afterViewChange(),this.stage.batchDraw()}panScreenBy(e,i){if(Math.abs(e.x)<.5&&Math.abs(e.y)<.5)return;this.cancelGlide();let o=this.stage.x(),n=this.stage.y(),r=this.constrainPan({x:o+e.x,y:n+e.y},{x:o,y:n}),s=r.x-o,a=r.y-n;if(Math.abs(s)<.5&&Math.abs(a)<.5)return;if(i?.animate===!1||this.reducedMotion||typeof requestAnimationFrame!="function"){this.stage.position({x:r.x,y:r.y}),this.afterViewChange(),this.stage.batchDraw();return}let l=performance.now(),c=Math.max(180,Math.min(1200,this.cameraGlideMs));this.glideInProgress=!0;let d=u=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let h=Math.min(1,(u-l)/c),m=h<.5?4*h*h*h:1-Math.pow(-2*h+2,3)/2;if(this.stage.position({x:o+s*m,y:n+a*m}),this.scheduleViewChange(),this.stage.batchDraw(),h<1){this.glideRaf=requestAnimationFrame(d);return}this.glideRaf=0,this.glideInProgress=!1,this.settleView()};this.glideRaf=requestAnimationFrame(d)}getCameraGestureCount(){return this.cameraGestures}setSeatHighlight(e){Ca(this.readingAidsHost,e)}setLabelLayers(e){Pa(this.readingAidsHost,e)}getLabelLayers(){return{...this.labelLayers}}setCategoryColours(e){Ta(this.readingAidsHost,e)}refreshBlockPaint(){this.repaintSectionsAndSeats(),this.updateLOD()}getCategoryColours(){return this.categoryColours}get readingAidsHost(){return{seatHighlight:()=>this.seatHighlight,setSeatHighlightState:e=>{this.seatHighlight=e},labelLayers:()=>this.labelLayers,setLabelLayersState:e=>{this.labelLayers=e},repaintSeats:()=>this.repaintSeats(),updateLabels:()=>this.updateLabels(),draw:()=>{this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()},categoryColours:()=>this.categoryColours,setCategoryColoursState:e=>{this.categoryColours=e},repaintSectionsAndSeats:()=>this.repaintSectionsAndSeats()}}setCategoryHighlight(e){this.categoryHighlight!==e&&(this.categoryHighlight=e,this.repaintSeats(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState())}renderBackground(e){let i=Lt(e);i&&this.renderBackgroundImage(i);for(let o of e.objects)o.type==="decorImage"&&this.renderDecorImage(o);for(let o of e.objects)o.type==="section"&&this.renderSection(o);for(let o of e.objects)o.type==="shape"?this.renderShape(o):o.type==="gaArea"?this.renderGA(o):o.type==="table"?this.renderTable(o):o.type==="text"&&this.renderText(o);this.renderZones(e)}trackAssetImage(e,i,o,n){this.assets.track(e,i,o,n,{exportMode:this.exportMode})}cancelAssetLoads(){this.assets.cancelAll()}renderBackgroundImage(e){Bc(this.objectDrawContext,e)}get objectDrawContext(){return{bgLayer:this.bgLayer,fgDecorGroup:this.fgDecorGroup,container:this.container,opts:this.opts,theme:this.theme,canvasBackground:this.canvasBackground,catColor:this.catColor,sections:this.sections,freeTextById:this.freeTextById,gaById:this.gaById,iconNodeById:this.iconNodeById,primaryFocalLabels:this.primaryFocalLabels,landmarkBoxes:this.landmarkBoxes,labelFont:()=>this.labelFont(),trackAssetImage:(e,i,o,n)=>this.trackAssetImage(e,i,o,n),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){Oc(this.objectDrawContext,e)}renderTable(e){Dc(this.objectDrawContext,e)}renderText(e){Nc(this.objectDrawContext,e)}renderShape(e){Hc(this.objectDrawContext,e)}renderGA(e){Wc(this.objectDrawContext,e)}renderSection(e){let i=ld(this.sectionBuildContext,e);for(let o of i.memberIds)this.seatSection.set(o,i);this.unsectionedSeatIds=null,this.refreshSectionFill(i),this.refreshSectionHeat(i),this.sections.push(i)}get sectionBuildContext(){return{bgLayer:this.bgLayer,seatLayer:this.seatLayer,canvasBackground:this.canvasBackground,seats:this.seats,seatById:this.seatById,seatSection:this.seatSection,seatIndex:this.seatIndex,statusById:this.statusById,catColor:this.catColor,zoneColor:this.zoneColor,chartDoc:this.chartDoc,isoCentre:this.isoCentre,labelFont:()=>this.labelFont(),floorBaseHeightMFor:e=>this.floorBaseHeightMFor(e),dominantSellableColor:e=>this.dominantSellableColor(e)}}refreshSectionHeat(e){pl(this.sectionLodPaintContext,e)}refreshSectionFill(e){ml(this.sectionLodPaintContext,e)}isSectionClosed(e){return en(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=Ls(e,o=>this.seatById.get(o)?.categoryKey,o=>this.catByKey.get(o)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return vn(this.focusFramingContext,e)}accessibleSections(e){return wn(this.focusFramingContext,e)}get sectionLodPaintContext(){let e=new Set([...this.selection,...this.ownedHold].map(i=>this.seatSection.get(i)));return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:i=>e.has(i),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:i=>this.sectionAccessibleFree(i),blockPaint:this.opts.blockPaint,selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.separatedFloorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,viewMode:this.viewMode,glideInProgress:this.glideInProgress,reducedMotion:this.reducedMotion,isoT:this.isoT,seatCount:this.seats.length,lodScale:this.lodScale,fitScale:this.fitScale,setLodScale:i=>{this.lodScale=i},worldToScreen:i=>this.worldToScreen(i)}}renderZones(e){Oa({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,derivedFloorGroups:this.chartDoc?.floorOverview==="combined"&&!this.chartDoc.zones?.length,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let i=this.stage.scaleX(),o={x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i};return this.viewMode==="perspective"&&this.perspectiveBaseInverse?fe(this.perspectiveBaseInverse,o):this.isoT===0?o:this.isoInverse(o)}sectionAt(e){if(!this.sections.length)return null;let i=this.screenToWorld(e),o=this.sections.find(n=>{if(this.viewMode==="perspective"&&n.perspectiveAffine)return J(i,n.outline.map(s=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,s))),n.holes.map(s=>s.map(a=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,a)))));let r=n.liftWorld>0?this.isoLiftLocal(n.liftWorld):{x:0,y:0};return J({x:i.x-r.x,y:i.y-r.y},n.outline,n.holes)});return o?o.logicalId:null}pressLandsOnChart(e){if(this.sectionAt(e)||Gi(this.selectionMarkers,e))return!0;let i=this.screenToWorld(e);for(let o of this.gaById.values())if(J(i,o.points,[]))return!0;return this.owned.badgeAt(i)||this.clusterLabels.clusterAt(i)||cn(this.tableFootprints,this.seats,i,this.effScale())||this.nearestSeatToScreen(e,me,!0)?!0:(this.stacked||this.floorOverview)&&this.deckFloorAt()!==null}sectionInteractive(e){let i=this.sections.filter(o=>o.id===e||o.logicalId===e||o.zone===e);return i.length?i.some(o=>!this.isSectionClosed(o)&&o.free>0?!0:o.memberIds.some(n=>this.selection.has(n)||this.ownedHold.has(n))):!0}sectionMembers(e){return[...new Set(this.sections.filter(i=>i.id===e||i.logicalId===e||i.zone===e).flatMap(i=>i.memberIds))]}isSelectable(e){return this.seatInClosedSection(e)||!(this.opts.selectableStatuses??["free"]).includes(this.statusById.get(e)??"free")?!1:!this.hiddenByAccessFilter(e)}hiddenByAccessFilter(e){if(!this.accessFilter||this.selection.has(e))return!1;let i=this.seatById.get(e);return i?Re(i,this.accessFilter)==="other":!1}toggleSeat(e){if(this.ownedHold.has(e)){let i=this.seatById.get(e);i&&this.opts.onDeselect?.(i);return}if(this.selection.has(e)){this.setSelected(e,!1),this.effScale()>oe&&this.updateLabels();let i=this.seatById.get(e);i&&this.opts.onDeselect?.(i)}else{if(!this.isSelectable(e))return;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);return}this.setSelected(e,!0),this.playSeatPickMoment(e);let i=this.seatById.get(e);i&&this.opts.onSelect?.(i)}this.overlayLayer.batchDraw()}resolveCanvasBackground(){let e=this.theme.background?uo(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let o=uo(getComputedStyle(i).backgroundColor);if(o)return o;i=i.parentElement}}return Uo}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:V(this.canvasBackground)?Va:mt}setSelected(e,i,o=!1){let n=this.circleById.get(e);if(i){this.selection.add(e);let r=this.seatById.get(e);r&&this.selectedSeatById.set(e,r)}else this.selection.delete(e),this.selectedSeatById.delete(e),this.selectionFocusId===e&&this.setSelectionFocus(null),this.focusedId===e&&(this.focusedId=null,this.focusRing.visible(!1),this.overlayLayer.batchDraw());n&&(this.paintSeat(n,e),!o&&!this.cached&&this.seatLayer.batchDraw()),this.syncSelectionMarker(e)}syncSelectionMarker(e){this.moments.syncMarker(e,this.selection.has(e)||this.ownedHold.has(e),this.selectionMarkers),this.queueViewportPinSync(),this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){return _a({sections:this.sections,viewMode:this.viewMode,isoT:this.isoT,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,projectedSectionPoint:(i,o)=>this.projectedSectionPoint(i,o),isoLiftLocal:i=>this.isoLiftLocal(i),isoForward:i=>this.isoForward(i),renderedSeatPoint:i=>this.renderedSeatPoint(i),labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(i,o,n)=>this.resolveAutomaticRowLabelPosition(i,o,n),rowLabelBox:(i,o)=>this.rowLabelBox(i,o)},e)}sectionFrameScale(e){let i=this.sectionBounds(e);return i?Math.min(bt(this.stage,i,this.zoomBounds(),Vt(this.framingViewport(),this.focusedRowLabelGutter(e))),Gt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){return mc(this.rowLabelPlan,this.labelFont(),e)}deckFloorAt(){return il(this.screenPickingHost)}nearestSeatToScreen(e,i,o=!1){return tl(this.screenPickingHost,e,i,{includeUnavailable:o})}get screenPickingHost(){return{seats:this.seats,stage:this.stage,seatR:this.seatR,viewMode:this.viewMode,selection:this.selection,objectFloor:this.objectFloor,perspectiveSeatScale:this.perspectiveSeatScale,renderedSeatPoint:e=>this.renderedSeatPoint(e),screenToWorld:e=>this.screenToWorld(e),worldToScreen:e=>this.worldToScreen(e),isSelectable:e=>this.isSelectable(e)}}wireInteraction(){Kl(this.interactionHost)}handleSeatTap(e){Xl(this.interactionHost,e)}get interactionHost(){return this.interactionHostCache??={stage:this.stage,seatLayer:this.seatLayer,overlayLayer:this.overlayLayer,hoverRing:this.hoverRing,clusterLabels:this.clusterLabels,container:this.container,attachHoverCard:()=>this.hoverCard.attach(),moved:()=>this.moved,isGhostClick:e=>this.isGhostClick(e),cached:()=>this.cached,reducedMotion:()=>this.reducedMotion,stacked:()=>this.stacked,floorOverview:()=>this.separatedFloorOverview,viewMode:()=>this.viewMode,focusedSectionId:()=>this.focusedSectionId,sectionCount:()=>this.sections.length,selectionMarkers:()=>this.selectionMarkers,dismissFocusRing:()=>this.dismissFocusRing(),seat:e=>this.seatById.get(e),seatMark:e=>this.seatMarks.get(e),seatSection:e=>this.seatSection.get(e),objectFloor:e=>this.objectFloor.get(e),perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,setHoveredId:e=>{this.hoveredId!==e&&(this.hoveredId=e,this.queueViewportPinSync())},seatsPickable:()=>this.seatsPickable(),handleSeatTap:e=>this.handleSeatTap(e),seatStatus:e=>this.statusById.get(e)??"free",hasSeatMark:e=>this.seatMarks.has(e),isOwnedHold:e=>this.ownedHold.has(e),isSelected:e=>this.selection.has(e),isSelectable:e=>this.isSelectable(e),hiddenByAccessFilter:e=>this.hiddenByAccessFilter(e),seatInClosedSection:e=>this.seatInClosedSection(e),toggleSeat:e=>this.toggleSeat(e),nudgeSeat:e=>this.moments.nudge(e),renderedSeatPoint:e=>this.renderedSeatPoint(e),nearestSeatToScreen:(e,i,o)=>this.nearestSeatToScreen(e,i,o),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionMatchesFocus:e=>this.sectionMatchesFocus(e),navigateGroupAt:e=>Da({doc:this.chartDoc,zones:this.zones,sections:this.sections,enterFloor:i=>this.opts.onDeckTap?this.opts.onDeckTap(i):this.setActiveFloor(i),frame:i=>this.focusRegion(i)},e),sectionFrameScale:e=>this.sectionFrameScale(e),sectionTapAnchor:(e,i)=>this.sectionTapAnchor(e,i),rowLabelAt:e=>this.rowLabelAtScreen(e),selectRow:e=>{this.selectRow(e)},ownedBadgeAt:e=>this.owned.badgeAt(e),focusOwnedSeats:e=>this.focusOwnedSeatsIn(e),pressLandsOnChart:e=>this.pressLandsOnChart(e),tableAt:e=>cn(this.tableFootprints,this.seats,this.screenToWorld(e),this.effScale()),destroyed:()=>this.destroyed,deckFloorAt:()=>this.deckFloorAt(),screenToWorld:e=>this.screenToWorld(e),effScale:()=>this.effScale(),focusSeats:(e,i)=>this.focusSeats(e,i),focusSection:(e,i)=>this.focusSection(e,i),zoomAbout:(e,i,o)=>this.zoomAbout(e,i,o),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let o=i?this.worldToScreen(i):zt(this.framingViewport());this.zoomAbout(Math.max(this.rowBandPreview.detailScale*1.08,this.stage.scaleX()*1.5),o)}else this.opts.onSectionTap?this.opts.onSectionTap(e,i):this.focusSection(e,{anchor:i})},onBackdropTap:this.opts.onBackdropTap,onDeckTap:this.opts.onDeckTap}}zoomBounds(){return Wt(this.cameraHost)}zoomAbout(e,i,o="now"){this.rowBandPreview&&this.focusRoams&&this.viewMode==="flat"&&(this.rowBandZoomAnchor=i),ql(this.cameraHost,e,i,o)}cancelZoomSettle(){Zl(this.cameraHost)}focusRegion(e,i){jl(this.cameraHost,e,i)}applyLabelVisibility(e){let i=e!==this.labelsVisible;if(this.labelsVisible=e,!i||!e)return;if(this.labelFadeRaf&&(cancelAnimationFrame(this.labelFadeRaf),this.labelFadeRaf=0),this.reducedMotion){this.labelGroup.opacity(1);return}let o=performance.now();this.labelGroup.opacity(0);let n=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let s=Math.min(1,(r-o)/90);this.labelGroup.opacity(s),this.stage.batchDraw(),this.labelFadeRaf=s<1?requestAnimationFrame(n):0};this.labelFadeRaf=requestAnimationFrame(n)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=Z?"seats":this.zones.length&&e<Ke?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,viewMode:this.viewMode,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(e),isoLiftLocal:e=>this.isoLiftLocal(e),seats:this.seats,sections:this.sections,zones:this.zones,seatSection:this.seatSection,statusById:this.statusById,selection:this.selection,circleById:this.circleById,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,seatLabelRungOpen:()=>this.seatLabelRungOpen,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,freeTextById:this.freeTextById,gaById:this.gaById,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,seatR:this.seatR,canvasBackground:this.canvasBackground,effSelection:this.effSelection,categoryFilter:this.categoryFilter,focusedSectionId:this.focusedSectionId,focusBackdrop:this.focusBackdrop,isSelectable:e=>this.isSelectable(e),seatViewportCulled:e=>this.seatViewportCulled(e),focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),Rc(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let i=e==="sections"?(we+Z)/2:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),o=this.framingViewport(),n=o.width,r=o.height,s=zt(this.framingWorldRect()),{x:a,y:l}=Cc({rung:e,sections:this.sections,seats:this.seats,viewCentre:s,target:i,width:n,height:r}),c=n/(i*1.12),d=r/(i*1.12);this.focusRegion({x:a-c/2,y:l-d/2,width:c,height:d})}seatRungScale(){return cc(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,o,n=0){let r=Vt(this.framingViewport(),n);return hc({stageWidth:r.width,stageHeight:r.height,fullBounds:i,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}releaseFocusOnPullBack(){this.rowBandPreview&&this.viewMode==="flat"&&this.focusedSectionId&&this.effScale()>=Math.min(Z,this.sectionFrameScale(this.focusedSectionId)*.85)||Ul({focusedSectionId:this.focusedSectionId,roaming:this.focusRoams,floorOverview:this.separatedFloorOverview,effScale:this.effScale()})&&(this.clearSectionFocus(),this.opts.onFocusedSectionChange?.(null))}afterViewChange(){this.releaseFocusOnPullBack(),this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.cancelZoomSettle(),this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){let e=this.rowBandZoomAnchor;if(this.rowBandZoomAnchor=null,!this.focusRoams||this.separatedFloorOverview)return;let i=!!this.rowBandPreview&&this.viewMode==="flat"&&!this.exportMode;if(!this.focusedSectionId&&(!i||this.effScale()<Z))return;let n=(i&&e?this.sectionAt(e):null)??Ra({sections:this.sections.map(r=>({logicalId:r.logicalId,members:r.memberIds.length,bounds:this.sectionScreenBounds(r)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!n||n===this.focusedSectionId||(this.focusedSectionId=n,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(n))}scheduleViewChange(){this.exportMode||(this.refreshLabelsWhileMoving(),!this.viewChangeRaf&&(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()})))}refreshLabelsWhileMoving(){this.movingLabelTimer||!this.seats.length||this.effScale()<=oe||(this.movingLabelTimer=setTimeout(()=>{this.movingLabelTimer=null,!(this.destroyed||this.exportMode)&&this.updateLabels()},Wr))}sizeLabel(e,i,o){e.fontSize(Math.max(1,i)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(o)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),ke+.01,oe):this.effScale(),i=Math.max(e,1e-4);for(let[s,a]of this.primaryFocalLabels)Gc(s,a,i,(l,c)=>{this.sizeLabel(l,c,l.y())},this.fitScale);this.hasSections?(vl(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&this.viewMode==="flat"&&e>=Math.min(Z,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:Z),()=>this.sectionFrameScale(this.focusedSectionId),s=>{let a=s.outline.map(l=>this.worldToScreen(l));return Math.max(...a.map(l=>l.x))>=0&&Math.min(...a.map(l=>l.x))<=this.stage.width()&&Math.max(...a.map(l=>l.y))>=0&&Math.min(...a.map(l=>l.y))<=this.stage.height()},()=>this.zoomBounds().max),this.owned.sync(e,this.getRung()),this.syncBeacons()):(this.clusterLabels.syncForCamera(e)||this.primaryFocalLabels.size)&&this.bgLayer.batchDraw(),this.clusterLabels.syncCursor(this.hoveredId!=null),this.paintGAStateForView(),this.updateAccessGlyphs(e);let o=this.seatGlyphDetail;if(this.seatGlyphDetail=_s(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail),o!==this.seatGlyphDetail&&this.glyphMarkers.length&&this.moments.resyncMarkers(this.selectionMarkers,()=>this.breath.sync(this.selectionMarkers)),this.viewportSeats){let s=this.seatLayer.opacity()>0;this.seatLayer.listening(s),!s&&this.hoveredId&&this.seatLayer.fire("mouseout");return}let n=!this.exportMode&&!this.rowBandPreview?.active&&e<Z;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.viewMode==="perspective"&&this.hasSections&&this.seats.length>2500&&n){this.seatLayer.listening(!1);return}if(n&&!this.cached){if(this.mountCachePending){this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>{this.recacheTimer=null,this.cacheSeatLayer()},0);return}this.cacheSeatLayer()}else!n&&(this.cached||!this.seatLayer.listening())&&(this.cached&&this.releaseSeatLayerBitmap(),this.seatLayer.listening(!this.exportMode),this.cached=!1,this.seatLayer.batchDraw())}rebuildSeatCache(){if(this.viewportSeats||this.seatReveal||this.seatRevealPending||this.rowBandPreview?.active)return;this.updateSeatGroupVisibility();let e=Y(this.stage.scaleX()*this.dpr,.15,2);this.seatLayer.clearCache(),this.seatLayer.cache({pixelRatio:e}),this.seatLayer.listening(!1),this.cached=!0,this.mountCachePending=!1}cacheSeatLayer(){this.destroyed||typeof document>"u"||(this.recacheTimer=null,this.rebuildSeatCache(),this.seatLayer.batchDraw())}releaseSeatLayerBitmap(){Kc(Ui,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.zoomSettleRaf&&(this.cancelZoomSettle(),this.afterViewChange()),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<Z?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){this.cancelSeatReveal(!0);let e=this.assets.generation,i=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assets.pending(),...i?[i.ready.then(()=>{}),i.load("700 24px Inter").then(()=>{}),i.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assets.generation)throw new Error("The chart changed while its export assets were loading.");if(this.assets.failures.length)throw new Error(`Export stopped because ${this.assets.failures.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(s=>s.getClientRect({relativeTo:this.stage})).filter(s=>s.width>0&&s.height>0);if(!e.length)return this.bounds;let i=Math.min(...e.map(s=>s.x)),o=Math.min(...e.map(s=>s.y)),n=Math.max(...e.map(s=>s.x+s.width)),r=Math.max(...e.map(s=>s.y+s.height));return{x:i,y:o,width:Math.max(1,n-i),height:Math.max(1,r-o)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),i=this.stage.height(),o=Math.max(12,Math.min(36,Math.min(e,i)*.025)),n=()=>{let r=this.exportSceneBounds(),s=Math.max(1,e-o*2),a=Math.max(1,i-o*2),l=Math.min(s/r.width,a/r.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-r.width*l)/2-r.x*l,y:(i-r.height*l)/2-r.y*l}),this.afterViewChange()};n(),n()}captureCanvas(){if(!this.exportMode)throw new Error("captureCanvas() is available only on a renderer created with exportMode.");this.forceDraw();let e;try{e=this.stage.toCanvas({pixelRatio:1,imageSmoothingEnabled:!0})}catch(n){let r=n instanceof Error?n.message:String(n);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${r}`)}let i=document.createElement("canvas");i.width=this.stage.width(),i.height=this.stage.height();let o=i.getContext("2d");if(!o)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");o.fillStyle=this.canvasBackground,o.fillRect(0,0,i.width,i.height);try{o.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),oe):this.effScale();for(let{node:i,backdrop:o,kind:n,showAt:r}of this.freeTextById.values()){if(n==="ga-label"||n==="ga-capacity")continue;let s=n==="free-text"&&this.nodeBelongsToFocusedSection(i),a=n==="direct-landmark";if(a){let d=Number(i.getAttr("directLandmarkBaseFontSize"))||i.fontSize();i.setAttr("directLandmarkBaseFontSize",d),i.fontSize(Math.max(d,z/e))}let l=r==="detail"&&!this.exportMode&&e<we,c=a||s||!l&&Se(i.fontSize(),e);if(i.visible(c),o?.visible(c),!this.exportMode&&n==="free-text"){let d=Math.min(1,gs/Math.max(i.fontSize()*e,1e-6));i.scale({x:d,y:d}),o?.scale({x:d,y:d})}}for(let{node:i,fontSize:o}of this.iconNodeById.values())i.visible(this.nodeBelongsToFocusedSection(i)||Se(o,e))}nodeBelongsToFocusedSection(e){let i=this.focusedSectionId;if(!i)return!1;this.focusMembershipKey!==i&&(this.focusMembership.clear(),this.focusMembershipKey=i);let o=this.focusMembership.get(e);if(o!==void 0)return o;let n=this.sections.filter(s=>s.id===i||s.logicalId===i||s.zone===i),r=!1;if(n.length){let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),a={x:s.x+s.width/2,y:s.y+s.height/2};r=n.some(l=>J(a,l.outline,l.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.rowLabelPlan=Vc(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,o=ie){return gn(e,i,o)}resolveAutomaticRowLabelPosition(e,i,o){return zc(e,i,o,this.seatIndex)}objectFilteredOut(e){let i=e.categoryKey;return i?!!(this.categoryHighlight&&i!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(i)):!1}updateLabels(){Za(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,labelLayers:()=>this.labelLayers,fitScale:()=>this.fitScale,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),otherSectionCount:()=>this.sections.filter(e=>e.id!==this.focusedSectionId&&e.logicalId!==this.focusedSectionId).length,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),labelGroup:this.labelGroup,rowLabelGroup:this.rowLabelGroup,seatLabelPool:this.seatLabelPool,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,setSeatLabelRungOpen:e=>{this.seatLabelRungOpen=e},visibleSeatCandidates:()=>this.visibleSeatCandidates(),worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,renderedSeatPoint:e=>this.renderedSeatPoint(e),viewMode:this.viewMode,perspectiveSeatScale:this.perspectiveSeatScale,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),hasSelectionMarker:e=>this.selection.has(e)||this.ownedHold.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,i,o)=>this.resolveAutomaticRowLabelPosition(e,i,o),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),isoT:this.isoT,applyUprightLabels:()=>this.applyUprightLabels(),overlayLayer:this.overlayLayer}}handleResize(){this.gestures.invalidateRect();let e=Lc({width:this.container.clientWidth,height:this.container.clientHeight,stageWidth:this.stage.width(),stageHeight:this.stage.height()});if(e==="hidden"){this.hiddenPose??=this.getCameraPose();return}let i=this.hiddenPose;if(this.hiddenPose=null,e==="unchanged"){i&&this.setCameraPose(i);return}let o={width:this.stage.width(),height:this.stage.height()};this.stage.size(e),i&&this.setCameraPose(i);let r=!(this.fitPose===""||Ze(this.stage)===this.fitPose)&&e.width===o.width;r&&this.stage.position({x:this.stage.x()+(e.width-o.width)/2,y:this.stage.y()+(e.height-o.height)/2}),this.refitCurrentView(r)}};Zt.ZOOM_STEP=1.4;var xn=Zt;function yd(t,e){return new xn(t,e)}function km(t,e){return t*2*.6*e>=6}function xm(t,e){t._sceneFunc(e)}function Ln(t){let e=this,i=e.attrs;xm(e,t);let o=i.organizerGlyphRadius||1,n=e.getStage(),r=Math.abs((n?n.scaleX():1)*(e.scaleX()||1))||1;if(!km(o,r))return;let s=o*.6;t.save(),t.setAttr("strokeStyle",i.organizerGlyphInk||"#000000"),t.setAttr("lineWidth",Math.max(o*.2,.75)),t.setAttr("lineCap","round"),t.setAttr("lineJoin","round"),t.beginPath(),i.organizerGlyph==="cross"?(t.moveTo(-s,-s),t.lineTo(s,s),t.moveTo(s,-s),t.lineTo(-s,s)):(t.moveTo(0,-s),t.lineTo(0,0),t.lineTo(s*.72,0)),t.stroke(),t.restore()}function Sd(t){return t.attrs.sceneFunc===Ln}function vd(t){Sd(t)&&t.setAttr("sceneFunc",void 0)}function Lm(t,e,i,o){if(!e){vd(t);return}let n=t.attrs;n.organizerGlyph=e,n.organizerGlyphInk=i,n.organizerGlyphRadius=o>0?o:1,n.sceneFunc!==Ln&&t.setAttr("sceneFunc",Ln)}function wd(t,e){t.accessFilter=e===null?null:[...e],t.renderer?.setAccessibilityFilter?.(e);let i=t.renderer?.getFocusedSection?.()??null;i&&t.emitSectionFocus(t.sectionSummary(i))}function Cn(t,e){let i=t.renderer;if(!i?.focusAccessibleSeats)return!1;let o=e===void 0?t.accessFilter:e;if(!o)return!1;let n=Cd(t,o);n&&t.setFloor(n);let r=i.focusAccessibleSeats(o);return r&&t.emitSectionFocus(null),r}function kd(t,e){let i=t.renderer;if(!i?.accessibleSpread)return null;let o=e===void 0?t.accessFilter:e;return o?i.accessibleSpread(o):null}function xd(t,e,i,o){let n=t.renderer;n&&(t.accessFilter&&(i?.accessibleLeft??0)>0&&n.focusAccessibleSection?.(e,t.accessFilter)||(n.focusSection?n.focusSection(e,o?{anchor:o}:void 0):n.focusRegion?.(e)))}function Ld(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let o=Cd(t,i);o&&t.setFloor(o);let n=t.renderer,r=n?.accessibleSections?.(i)??[];if(!r.length)return null;let s=t.accessStepAt?r.findIndex(l=>l.id===t.accessStepAt):-1,a=r[(s+1)%r.length];return t.accessStepAt=a.id,n?.focusAccessibleSection?.(a.id,i)||n?.focusSection?.(a.id),t.emitSectionFocus(t.sectionSummary(a.id)),{...a,index:r.indexOf(a),total:r.length}}function Cd(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let o=new Set(e),n=l=>o.size===0?!!l.accessible:!!l.accessibility?.some(c=>o.has(c)),r=l=>l.some(c=>c.type==="row"&&(c.overrides??[]).some(n)),s=t.getActiveFloorId(),a=i.floors.find(l=>l.id===s);return a&&r(a.objects)?null:i.floors.find(l=>r(l.objects))?.id??null}function Pd(t,e){return t.accessFilter?Re(e,t.accessFilter)==="other":!1}function Td(t,e){let i=t.renderer;if(!i)return;let o=i.getFocusedSection?.()??null;if(i.clearSectionFocus?.(),e?.length){t.emitSectionFocus(null),t.bandReturnPose||(t.bandReturnPose=i.getCameraPose?.()??null,t.bandReturnSection=t.bandReturnPose?o:null);let r=Cm(t,e);r&&t.setFloor(r),i.focusCategories?i.focusCategories(e):i.zoomToFit();return}let n=t.bandReturnPose!=null;t.bandReturnPose=null,t.bandReturnSection=null,!(t.accessFilter&&Cn(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),n&&i.zoomToFit())}function Cm(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let o=new Set(e),n=a=>a.some(l=>l.type==="row"&&(o.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||l.type==="gaArea"&&o.has(l.categoryKey)),r=t.getActiveFloorId(),s=i.floors.find(a=>a.id===r);return s&&n(s.objects)?null:i.floors.find(a=>n(a.objects))?.id??null}function Id(t,e,i){let o=new Map,n=new Map,r=new Map,s=new Map,a=[],l=new Map(ii(t).map(h=>[h.id,h])),c=or(t),d=rt(t),u=hi(t);for(let h of e){o.set(h.label,h.id),n.set(h.label,h),r.set(h.id,h),a.push(h.id);let m=l.get(h.rowId),f=m&&"label"in m&&typeof m.label=="string"?m.label:void 0,b=m?.type==="row"?m.segmentedRow:void 0,p=b?.displayLabel??(m&&"displayLabel"in m&&typeof m.displayLabel=="string"&&m.displayLabel?m.displayLabel:f),g=i.get(h.rowId),y=m?.type==="table"?"table":m?.type==="booth"?"booth":"seat",S=p,x=b?.displayType?.trim()||(m&&"displayType"in m&&typeof m.displayType=="string"&&m.displayType.trim()?m.displayType.trim():void 0),w=h.displayLabel??h.label,v=w.split("-"),k=g||h.kind==="booth"?void 0:p&&w.startsWith(`${p}-`)?w.slice(p.length+1):v[v.length-1]??w;s.set(h.id,{objectId:h.rowId,objectType:y,sectionLabel:h.sectionId?c.get(h.sectionId):void 0,rowLabel:S,seatNumber:k,...x?{displayType:x,rowType:x}:{},...Pm(m,h.sectionId?d.get(h.sectionId):void 0),...m?.type==="row"&&u.has(h.id)?{aisle:!0}:{}})}return{labelToId:o,labelToSeat:n,seatById:r,seatContext:s,allIds:a}}function Pm(t,e){if(t?.type!=="table"&&t?.type!=="booth")return{};let i=t.entrance?.trim()||e;return{...i?{entrance:i}:{},...t.type==="booth"&&t.boothType?{boothType:t.boothType}:{}}}function Md(t,e={}){let{baseMs:i=1e3,factor:o=2,maxMs:n=1/0,jitter:r=0,random:s=Math.random}=e,a=Math.min(i*o**Math.max(0,t),n);if(r<=0)return a;let l=Math.min(1,r);return a*(1-l+l*s())}function Rd(t,e,i,o=1){let n=nr(t),r=rt(t);return Pt(t).map(s=>{let a=t.categories.find(d=>d.key===s.categoryKey),l=n.get(s.id),c=s.entrance?.trim()||(l?r.get(l):void 0);return{id:s.id,label:s.label,...s.displayLabel?{displayLabel:s.displayLabel}:{},...s.displayType?{displayType:s.displayType}:{},capacity:Math.max(0,Math.floor(s.capacity)),...Tm(s,i,o),categoryKey:s.categoryKey,tiers:a?.tiers,price:a?.tiers?.[0]?.price??a?.price??0,currency:e,...c?{entrance:c}:{}}})}function Tm(t,e,i){let o=ao(t,i),n=lo(t,i),r=Ct(t),s=i===2&&o.length===1&&o[0]===t.label?ro(t):null;if(s){let{min:l,max:c}=so(t),d=e(t.label)==="free";return{available:d?c:0,bookingMode:s,minOccupancy:l,maxOccupancy:c,...r?{wheelchairPlaces:r,wheelchairAvailable:d?r:0}:{}}}let a=o.filter(l=>e(l)==="free");return{available:a.length,...r?{wheelchairPlaces:r,wheelchairAvailable:a.filter(l=>n.has(l)).length}:{}}}function Ad(t,e,i){let o=Math.floor(e),n=ao(t,i.modelVersion),r=i.modelVersion===2&&n.length===1&&n[0]===t.label?ro(t):null;if(r){let{min:d,max:u}=so(t);return i.alreadyHeld.has(t.label)||i.statusOf(t.label)!=="free"||i.wheelchairOnly&&!Ct(t)?null:r==="whole"?o===u?[{label:t.label}]:null:o>=d&&o<=u?[{label:t.label,quantity:o}]:null}let s=lo(t,i.modelVersion),a=n.filter(d=>!i.alreadyHeld.has(d)&&i.statusOf(d)==="free"),c=(i.wheelchairOnly?a.filter(d=>s.has(d)):[...a.filter(d=>!s.has(d)),...a.filter(d=>s.has(d))]).slice(0,o);return c.length===o?c.map(d=>({label:d})):null}function Im(t){return t.available<=0?0:t.bookingMode==="whole"||t.bookingMode==="variable"?t.wheelchairPlaces?t.wheelchairAvailable??t.wheelchairPlaces:0:Math.min(t.available,t.wheelchairAvailable??0)}function Ed(t,e,i={}){let o={};for(let n of t){let r=i.wheelchairOnly===!0?Im(n):null;o[n.id]=e?{available:n.available,selected:e.get(n.id)??0,wheelchairFree:r}:{available:n.available,wheelchairFree:r}}return o}function Fd(t){let e={};for(let[i,o]of t.seatById)t.groupedTableBySeatId.has(i)||t.closedMembers.has(i)||(t.statusOf(i)??"free")==="free"&&(e[o.categoryKey]=(e[o.categoryKey]??0)+1);for(let i of t.groupedTablesByLabel.values()){if(i.chairs.some(n=>t.closedMembers.has(n.id)))continue;let o=i.chairs[0];o&&(t.statusOf(o.id)??"free")==="free"&&(e[i.categoryKey]=(e[i.categoryKey]??0)+i.maxOccupancy)}for(let i of t.gaAreas??[])e[i.categoryKey]=(e[i.categoryKey]??0)+i.available;return e}function Mm(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function _d(t,e,i=[]){let o=new Set,n=new Map;for(let r of i)o.add(r.need),n.set(r.need,(n.get(r.need)??0)+r.free);for(let r of t){let s=Mm(r);if(!s.length)continue;let a=e(r.id)==="free";for(let l of s)o.add(l),a&&n.set(l,(n.get(l)??0)+1)}return o.size?Dn.filter(r=>o.has(r.key)).map(r=>({key:r.key,count:n.get(r.key)??0})):[]}var pL=5e3,fL={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function Rm(t){if(!t.holdActive||t.holdLabels.length===0)return!1;let e=t.now??Date.now();return t.holdExpiresAt!=null&&e>=t.holdExpiresAt+5e3||t.serverHoldActive===!1?!0:!t.holdLabels.some(i=>t.statusOf(i)==="held")}function Bd(t){let e=new Set(t.holdLabels),i=t.selection.filter(n=>!e.has(n)&&t.statusOf(n)!=="free");if(!Rm(t))return{lost:i,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let o=[...t.holdLabels];return{lost:i,holdLapsed:!0,lapsedLabels:o,recoverable:o.filter(n=>t.statusOf(n)==="free")}}function mL(t){return t.lost.length>0||t.holdLapsed}function gL(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function Od(t,e,i=Date.now()){return e&&i<t+5e3}function Dd(t){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let e=()=>{document.visibilityState==="visible"&&t()};return document.addEventListener("visibilitychange",e),()=>{typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",e)}}function Nd(t){if(!t?.zones?.length)return[];let e=new Set(rr(t).sections.filter(i=>i.seatCount>0&&!!i.zone).map(i=>i.zone));return t.zones.filter(i=>e.has(i.id)).map(i=>({id:i.id,label:i.label}))}function Hd(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},o=He(e).filter(s=>!t.groupedObjectIds.has(s.rowId)),n=new Set;for(let s of o)t.heldLabels.has(s.label)||t.tierApplies(s)&&(t.accessFilter&&!Me(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&n.add(s.label));let r=Rr(o,n,{qty:t.qty,categoryKey:t.categoryKey,zoneId:t.zoneId,focal:i,preferPremium:!0});return r.labels.length!==t.qty?null:r.labels.every(s=>t.isPremium(s))?[...r.labels]:null}var Pn=["background","rowLabelColor","textColor","selectionColor"];function Gd(t,e){return!t||!e?!t&&!e:Pn.every(i=>t[i]===e[i])}function vt(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function $i(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function Wd(t,e,i){let o=Jn(e,i);o==="all"?t.setFloorOverview?.(!0):o&&t.setActiveFloor?.(o)}var Fe=class extends Error{constructor(i){super(i.message);this.status=422;this.name="PickerSelectionError",this.reason=i.code,this.labels=i.labels}};function Tn(t){return t==="setup"||t==="testable"||t==="live"||t==="paused"||t==="ended"?t:null}function Vd(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var qi=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,i){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let o=this.ref;this.pending=e.eventConfiguration(i).then(n=>{if(n.reference.id!==o.id||n.reference.version!==o.version||n.configuration.id!==o.id||n.configuration.version!==o.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return n.configuration})}return this.pending}};async function zd(t,e,i){if(!t.renderer)return null;let n=e??t.getSelection().map(l=>l.label),r=t.hold_?.items??[],s=[...new Set([...r.map(l=>l.label),...n])];if(!s.length)return null;let a=t.ticketIssue(s);if(a)throw new Fe(a);if(t.hold_&&t.holdCovers(s))return t.hold_;try{let l=s.map(d=>{let u=r.find(f=>f.label===d);if(u&&(u.objectType==="ga"||u.quantity!=null||u.tierId!=null))return{label:d,tierId:u.tierId,...u.quantity!=null?{quantity:u.quantity}:{}};let h=t.labelToSeat.get(d),m=h?t.toSeat(h):null;return{label:d,...m?.tierId?{tierId:m.tierId}:{},...t.tableQuantityRequest(m)}}),c=await t.api.hold(t.key,l,i,t.hold_?.holdId);return t.setHold({holdId:c.holdId,labels:s,expiresAt:c.expiresAt,items:c.items}),t.hold_}catch(l){throw t.handle409Conflicts(l),l}}async function Kd(t,e){if(t.closed||!e||!t.api.resume)return null;let i=await t.api.resume(t.key,e);if(t.closed)return null;let o=[...new Set(i.items.map(n=>n.label))];return o.length?(t.setHold({holdId:i.holdId,labels:o,expiresAt:i.expiresAt,items:i.items},"restored"),t.hold_):null}async function Xd(t,e){let i=t.hold_;if(!i||!t.api.extend)return null;try{let o=await t.api.extend(t.key,i.holdId,e);return t.hold_?.holdId!==i.holdId||t.setHold({holdId:i.holdId,labels:i.labels,expiresAt:o.expiresAt,items:i.items}),t.hold_}catch{return null}}async function Yd(t,e,i,o){let n=t.renderer;if(!n)return null;if(!t.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let r=i??t.getSelection().map(c=>c.label);if(!r.length)return null;let s=t.ticketIssue(r);if(s)throw new Fe(s);let a;try{if(t.hold_&&t.holdCovers(r))a=t.hold_.holdId;else{let c=t.hold_?.holdId,d=await t.api.hold(t.key,r.map(u=>{let h=t.labelToSeat.get(u),m=h?t.toSeat(h):null;return{label:u,...m?.tierId?{tierId:m.tierId}:{},...t.tableQuantityRequest(m)}}),o,c);a=d.holdId,t.setHold({holdId:a,labels:[...r],expiresAt:d.expiresAt,items:d.items})}await t.api.book(t.key,r,a,e)}catch(c){let{status:d,conflicts:u,reason:h}=vt(c);if(t.clearHold(),d===409&&h==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&u?.length){let m=new Set(u.map(p=>p.label)),f=t.idsForLabels(m);f.length&&(n.setStatus(f,"booked"),n.deselect(f),t.resetTableQuantitiesForLabels(m));let b=r.filter(p=>!m.has(p));b.length&&a&&t.api.release(t.key,b,a).catch(()=>{}),t.emitSelectionChange()}else a&&t.api.release(t.key,r,a).catch(()=>{});throw c}let l=t.idsForLabels(r);return l.length&&(n.setStatus(l,"booked"),n.deselect(l)),t.clearHold(),t.resetTableQuantitiesForLabels(r),t.emitSelectionChange(),t.opts.onBook?.(e),r}async function Ud(t){let e=t.hold_;if(!e)return!0;try{let o=await t.api.release(t.key,e.labels,e.holdId);if(!t.releaseConfirmed(o,e.labels))return await t.resnapshot(),!1}catch(o){return t.emitError(o),!1}if(t.hold_?.holdId!==e.holdId)return!0;t.clearHold(),t.resetTableQuantitiesForLabels(e.labels);let i=t.idsForLabels(e.labels);return i.length&&(t.renderer?.deselect(i),t.renderer?.setStatus(i,"free")),!0}async function $d(t,e){let i=t.hold_;if(!i)return!0;let o=e.filter(a=>i.labels.includes(a));if(!o.length)return!0;try{let a=await t.api.release(t.key,o,i.holdId);if(!t.releaseConfirmed(a,o))return await t.resnapshot(),!1}catch(a){return t.emitError(a),!1}if(t.hold_?.holdId!==i.holdId)return!0;let n=i.labels.filter(a=>!o.includes(a)),r=i.items?.filter(a=>!o.includes(a.label));n.length?t.setHold({...i,labels:n,items:r}):t.clearHold(),t.resetTableQuantitiesForLabels(o);let s=t.idsForLabels(o);return s.length&&(t.renderer?.deselect(s),t.renderer?.setStatus(s,"free")),!0}function qd(t,e){let i=t?.released;return!Array.isArray(i)||e.every(o=>i.includes(o))}function Zd(t,e){let i=t.hold_;if(!i||i.labels.length!==e.length||!e.every(r=>i.labels.includes(r)))return!1;let o=new Map((i.items??[]).map(r=>[r.label,r.tierId])),n=new Map((i.items??[]).map(r=>[r.label,r.quantity??1]));return e.every(r=>{let s=t.labelToSeat.get(r),a=s?t.toSeat(s):null,l=a?.tierId??null;return(a?.objectType!=="table"||(a.bookingMode!=="variable"||t.confirmedVariableTables.has(r))&&(!n.has(r)||n.get(r)===a.quantity))&&(!o.has(r)||o.get(r)===l)})}function jd(t,e){let{status:i,conflicts:o}=vt(e);if(i!==409||!o?.length)return;let n=t.renderer;if(!n)return;let r=t.idsForLabels(o.map(s=>s.label));r.length&&(n.deselect(r),n.setStatus(r,"held"),t.resetTableQuantitiesForLabels(o.map(s=>s.label))),t.emitSelectionChange()}function Qd(t,e,i="created"){for(let r of e.items??[])t.groupedTablesByLabel.has(r.label)&&r.quantity!=null&&(t.tableQuantities.set(r.label,r.quantity),t.groupedTablesByLabel.get(r.label)?.mode==="variable"&&t.confirmedVariableTables.add(r.label));let o={...e,seats:t.seatsForLabels(e.labels)};t.hold_=o,t.renderer?.setOwnedHold?.(t.idsForLabels(o.labels)),t.expiryTimer&&clearTimeout(t.expiryTimer);let n=Math.max(0,o.expiresAt-Date.now());t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},n),i==="restored"?t.opts.onHoldRestored?.(o):t.opts.onHold?.(o)}function Jd(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function eh(t){let e=t.hold_;if(e){try{let i=await t.api.objects(t.key);if(t.hold_?.holdId!==e.holdId)return;t.applySeatsMap(i.seats,i.default??"free")}catch{t.hold_?.holdId===e.holdId&&(t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},2e3));return}if(t.hold_?.holdId===e.holdId){if(Od(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function th(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function ih(t,e,i,o){if(i!=null&&!Array.isArray(i))throw new TypeError("picker: `selectionValidators` must be an array");let n=[],r=0,s=!1,a=!1;for(let c of i??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");r=Math.max(r,Number(c.minimum))}else if(c?.type==="consecutiveSeats")s=!0;else if(c?.type==="noOrphanSeats")a=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(r&&n.push({type:"minimumSelectedPlaces",minimum:r}),s&&n.push({type:"consecutiveSeats"}),a&&n.push({type:"noOrphanSeats"}),t!=null&&r>t)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let l=Math.max(0,Math.floor(e??t??Math.max(o,r)));if(t!=null&&l<t)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&l<r)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:n,maxSelection:t??l}}function Em(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Fm(t){if(t.length<=1)return!1;let e=t[0]?.objectId,i=t[0]?.categoryKey;if(!e||t.some(n=>n.objectId!==e||n.categoryKey!==i))return!0;let o=t.map(n=>Em(n.id)).sort((n,r)=>n-r);return o.some((n,r)=>n<0||r>0&&n!==o[r-1]+1)}function oh(t,e,i,o,n){let r=o.find(l=>l.type==="minimumSelectedPlaces")?.minimum??0,s=i??r,a=[];return i!=null&&e!==i&&a.push("numberOfPlacesToSelect"),r&&e<r&&a.push("minimumSelectedPlaces"),o.some(l=>l.type==="consecutiveSeats")&&Fm(t)&&a.push("consecutiveSeats"),o.some(l=>l.type==="noOrphanSeats")&&n()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:s,remaining:Math.max(0,s-e),seats:t,violations:a}}function nh(t){let{id:e,doc:i,seatById:o,groupedTableBySeatId:n}=t,r=v=>v.type==="section"&&(v.id===e||v.logicalSectionId===e),s=i.floors?.find(v=>v.objects.some(r)),a=(s?.objects??i.objects).find(r);if(!a)return null;let l=t.sectionMembers(e),c=new Map,d=new Map,u=new Set,h=0,m=0;for(let v of l){let k=o.get(v);if(!k)continue;t.matchesAccessFilter&&t.statusOf(v)==="free"&&t.matchesAccessFilter(k)&&(m+=1);let P=n.get(v);if(P){if(u.has(P.label))continue;u.add(P.label),c.set(P.categoryKey,(c.get(P.categoryKey)??0)+P.maxOccupancy),t.statusOf(P.chairs[0]?.id??v)==="free"&&(h+=P.maxOccupancy,d.set(P.categoryKey,(d.get(P.categoryKey)??0)+P.maxOccupancy))}else c.set(k.categoryKey,(c.get(k.categoryKey)??0)+1),t.statusOf(v)==="free"&&(h++,d.set(k.categoryKey,(d.get(k.categoryKey)??0)+1))}let f=[...c.entries()].map(([v,k])=>{let P=i.categories.find(M=>M.key===v),C=P?.tiers?.map(M=>M.price).filter(Number.isFinite)??[],T=C.length?C:typeof P?.price=="number"&&Number.isFinite(P.price)?[P.price]:[],L=T.length?Math.min(...T):void 0,I=T.length?Math.max(...T):void 0;return{key:v,count:k,label:P?.label??v,color:P?.color??"#6e7bff",...L!==void 0?{price:L,priceMin:L,priceMax:I}:{}}}).sort((v,k)=>(v.priceMin??1/0)-(k.priceMin??1/0)||v.key.localeCompare(k.key)),b=f.flatMap(v=>v.priceMin===void 0?[]:[v.priceMin]),p=f.flatMap(v=>v.priceMax===void 0?[]:[v.priceMax]),g=a.zone?i.zones?.find(v=>v.id===a.zone):void 0,y=v=>{let k=null,P=0;for(let[C,T]of v)(T>P||T===P&&k!=null&&C<k)&&(k=C,P=T);return k},S=y(d)??y(c),w=(S?f.find(v=>v.key===S)?.color:void 0)??g?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:m}:{},label:a.displayLabel??a.label,zoneLabel:g?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:w,seatsLeft:h,...b.length?{priceMin:Math.min(...b),priceMax:Math.max(...p)}:{},categories:f}}var Zi=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,i=!1){if(!i){if(this.inFlight)return this.inFlight;if(this.now()-this.lastSettledAt<this.windowMs)return Promise.resolve()}let o=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===o&&(this.inFlight=null)});return this.inFlight=o,o}markSettled(){this.lastSettledAt=this.now()}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};function rh(t,e){return t?.source==="socket"&&e.source==="http"?t:e}function sh(t,e){return t?.source==="socket"?t:e?{seats:e.seats,default:e.default,source:"http",...e.fetchedAt===void 0?{}:{fetchedAt:e.fetchedAt}}:t}var Dm=!0,Nm=!0,Hm=10,Gm=15e3,ah=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new qi;this.hidden=new Set;this.mapTheme=null;this.closedSections=new Set;this.labelToId=new Map;this.labelToSeat=new Map;this.expandedSeats=[];this.seatTiers=new Map;this.seatById=new Map;this.seatContext=new Map;this.allIds=[];this.groupedTablesByObject=new Map;this.inventoryModelVersion=1;this.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.connectFallback=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.detachVisibility=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.snapshots=new Zi;this.narrowLayout=!1;this.fitClearance=0;this.accessFilter=null;this.viewportInsets=null;this.accessStepAt=null;this.bandReturnPose=null;this.bandReturnSection=null;this.hintShown=!1;this.lastSnapshotAt=0;this.seatsBuilt=!1;this.pendingSnapshot=null;this.socketVersion=0;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=th(e.numberOfPlacesToSelect);let i=ih(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Hm);this.selectionValidators=i.validators,this.maxSelection=i.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(o=>typeof o=="string"&&!!o))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=sr(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let o of Pn){let n=this.mapTheme[o];n&&(i[o]=n)}return{...e,theme:i}}setMapTheme(e){return Gd(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let i=e.getSelection().map(a=>a.id),o=this.getActiveFloorId(),n=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,s=e.getCameraPose?.();return e.setChart(this.visibleDoc(),o?{floorId:o}:void 0),this.applyRowBandPreview(e),n&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),i.length&&e.select?.(i),r&&e.focusSection?.(r),s&&e.setCameraPose&&e.setCameraPose(s),e.settleView?.(),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let i=e.filter(n=>typeof n=="string");if(i.length===this.hidden.size&&i.every(n=>this.hidden.has(n)))return!1;this.hidden=new Set(i);let o=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),this.renderer&&this.applyRowBandPreview(this.renderer),o&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let i=(e??[]).filter(o=>typeof o=="string");return i.length===this.closedSections.size&&i.every(o=>this.closedSections.has(o))?!1:(this.closedSections=new Set(i),this.renderer?.setClosedSections?.(i),!0)}isSectionClosed(e){return this.closedSections.has(e)}currentHold(){return this.hold_}getRenderer(){return this.renderer}seatByLabel(e){return this.labelToSeat.get(e)}getExpandedSeats(){return this.expandedSeats}loadEventConfiguration(){return this.eventConfiguration.load(this.api,this.key)}idForLabel(e){return this.labelToId.get(e)}idsForLabel(e){let i=this.groupedTablesByLabel.get(e);if(i)return i.chairs.map(n=>n.id);let o=this.labelToId.get(e);return o?[o]:[]}idsForLabels(e){return[...new Set([...e].flatMap(i=>this.idsForLabel(i)))]}tableSelection(e){let i=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return i?this.toTableSeat(i):null}lineItemDisplay(e){if(e.objectType==="ga"){let n=this.visibleDoc(),r=Pt(n).find(s=>s.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}if(e.objectType==="table"){let n=this.groupedTablesByLabel.get(e.label);return{...n?.displayLabel&&n.displayLabel!==n.label?{displayLabel:n.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}let i=this.labelToSeat.get(e.label),o=i?this.seatContext.get(i.id):void 0;return{...i?.displayLabel?{displayLabel:i.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}async render(e){if(this.renderer)return null;let i=performance.now(),o={},n=L=>Math.round((performance.now()-L)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(L=>({ok:!0,res:L,elapsed:n(r)}),L=>({ok:!1,error:L,elapsed:n(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(L=>({ok:!0,objects:L,elapsed:n(a)}),()=>({ok:!1,elapsed:n(a)})),c=await s;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=Vd(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let u=performance.now();try{this.inventoryModelVersion=d.event.inventoryModelVersion===2?2:1;let L=Ar(d.doc,this.inventoryModelVersion);this.groupedTablesByObject=new Map(L.map(I=>[I.objectId,I])),this.groupedTablesByLabel=new Map(L.map(I=>[I.label,I])),this.groupedTableBySeatId=new Map(L.flatMap(I=>I.chairs.map(M=>[M.id,I]))),this.tableQuantities=new Map(L.map(I=>[I.label,I.mode==="whole"?I.capacity:I.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=L.reduce((I,M)=>I+Math.max(0,M.chairs.length-1),0)}catch(L){return this.emitError(L),null}this.expandedSeats=He(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let h=Id(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=h.labelToId,this.labelToSeat=h.labelToSeat,this.seatById=h.seatById,this.seatContext=h.seatContext,this.allIds=h.allIds;for(let L of this.groupedTablesByLabel.values()){let I=L.chairs[0];I&&(this.labelToId.set(L.label,I.id),this.labelToSeat.set(L.label,I))}o.normalizeBuyerModel=n(u);let m=d.event.currency??this.opts.currency;this.currency=m??"USD";let f=performance.now(),b=yd(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:m,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=n(i),this.opts.onSeatsRevealed?.()},onSelect:L=>{this.handleRendererSelect(L)},onDeselect:L=>{this.handleRendererDeselect(L)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(L,I)=>{this.opts.onHover?.(L),this.opts.onSeatHover&&this.opts.onSeatHover(L?this.describeSeat(L,I):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(L,I)=>this.previewSection(L,I),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:L=>this.opts.onSectionFocus?.(L==null||this.isSectionClosed(L)?null:this.sectionSummary(L)),onDeckTap:L=>this.handleDeckTap(L),onFps:this.opts.onFps});if(o.createRenderer=n(f),this.closed)return b.destroy(),null;this.renderer=b,this.viewportInsets&&b.setViewportInsets?.(this.viewportInsets),this.fitClearance>0&&b.setFitClearance?.(this.fitClearance);let p=null,g="free",y=[],S,x=await l;if(x.ok){let L=x.objects;this.hidden=new Set(L.hidden??[]),y=(L.closed??[]).filter(I=>typeof I=="string"),p=L.seats,g=L.default??"free",S=typeof L.fetchedAt=="number"?L.fetchedAt:void 0}if(o.loadStatuses=x.elapsed,this.closed)return b.destroy(),this.renderer=null,null;let w=performance.now();this.opts.categoryPriceRanges&&b.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),b.setChart(this.visibleDoc()),this.applyRowBandPreview(b),Wd(b,d.doc,e.clientWidth),this.opts.colorblindSafe&&b.setColorblindSafe?.(!0),o.buildScene=n(w),this.closedSections=new Set(y);let v=performance.now();y.length&&b.setClosedSections?.(y),this.seatsBuilt=!0;let k=this.pendingSnapshot;this.pendingSnapshot=null;let P=sh(k,p?{seats:p,default:g,fetchedAt:S}:null);P&&this.applySeatsMap(P.seats,P.default,P.source,P.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=n(v);let C=performance.now();b.forceDraw(),o.firstPaint=n(C);let T=performance.now();return x.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),o.startRealtime=n(T),o.controllerTotal=n(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,salesState:Tn(d.event.status),eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:m,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],i=new Set;for(let o of this.renderer.getSelection()){let n=this.groupedTableBySeatId.get(o.id);n?i.has(n.label)||(i.add(n.label),e.push(this.toTableSeat(n))):e.push(this.toSeat(o))}return e}seatDetails(e){let i=this.seatById.get(e);return i?this.describeSeat(i):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let i=new Set;for(let o of e){let n=this.groupedTableBySeatId.get(o)??this.groupedTablesByLabel.get(o);if(n)n.chairs.forEach(r=>i.add(r.id)),this.hold_?.labels.includes(n.label)||(this.tableQuantities.set(n.label,n.mode==="whole"?n.capacity:n.minOccupancy),n.mode==="variable"&&this.confirmedVariableTables.delete(n.label));else{let r=this.seatById.has(o)?o:this.labelToId.get(o);r&&i.add(r)}}this.renderer?.deselect([...i]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let i=new Set(this.getSelection().map(s=>s.label)),o=new Set,n=[];for(let s of e){let a=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(a)this.tableTierResolution(a).kind==="invalid"?n.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let l=this.seatById.has(s)?s:this.labelToId.get(s);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?n.push(c.label):o.add(l)}}if(n.length&&this.emitError(new Fe(bo(n))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let r=this.getSelection().filter(s=>!i.has(s.label));return r.length&&this.emitSelectionChange(),r}selectCategories(e){let i=new Set(e);return this.select([...this.seatById.values()].filter(o=>i.has(o.categoryKey)).map(o=>o.id))}deselectCategories(e){let i=new Set(e);this.deselect(this.getSelection().filter(o=>i.has(o.categoryKey)).map(o=>o.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(o=>typeof o=="string"&&!!o))],this.rebuildSelectableSeatIds();let i=this.renderer?.getSelection().filter(o=>!this.isSelectableByPolicy(o.id)).map(o=>o.id)??[];i.length&&this.deselect(i)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let i=this.getSelection(),o=e??i.reduce((n,r)=>n+(r.quantity??1),0);return oh(i,o,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let i=new Set(e.getSelection().map(o=>o.id));return i.size>0&&go(this.seatById.values(),o=>e.getStatus(o),i).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let i of this.selectableObjectRefs){let o=this.groupedTableBySeatId.get(i)??this.groupedTablesByLabel.get(i);if(o){o.chairs.forEach(r=>e.add(r.id));continue}let n=this.seatById.has(i)?i:this.labelToId.get(i);n&&e.add(n)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,i){let o=this.groupedTablesByLabel.get(e);if(!o)return!1;let n=o.mode==="whole"?o.capacity:Math.floor(i);if(!Number.isInteger(n)||n<o.minOccupancy||n>o.maxOccupancy)return!1;let r=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,n),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,i,o){let n=this.groupedTablesByLabel.get(e),r=this.hold_;if(!n||n.mode!=="variable"||!r?.labels.includes(e))return null;let s=Math.floor(i);if(!Number.isInteger(s)||s<n.minOccupancy||s>n.maxOccupancy)return null;if((r.items??[]).filter(d=>d.label!==e).reduce((d,u)=>d+(u.quantity??1),0)+s>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(r.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?s:d.quantity}));if(!l.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,l,o,r.holdId);return this.tableQuantities.set(e,s),this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}setNarrowLayout(e){this.narrowLayout!==e&&(this.narrowLayout=e,this.renderer&&this.applyRowBandPreview(this.renderer))}rowBandsWanted(){return Dm&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(Nm||!this.narrowLayout)}applyRowBandPreview(e){if(!this.opts.sectionPreview)return;let i=this.rowBandsWanted();e.setRowBandPreview?.(i),i&&e.setSectionFocusDim?.(!1)}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,i)=>e+(i.quantity??1),0)}handleRendererSelect(e){let i=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(i?i.chairs.map(n=>n.id):[e.id]),this.emitSelectionChange();return}if((i?this.tableTierResolution(i):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(i?i.chairs.map(n=>n.id):[e.id]),this.emitError(new Fe(bo([i?.label??e.label]))),this.emitSelectionChange();return}if(i){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(i.chairs.map(n=>n.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(i.chairs.map(n=>n.id)),this.opts.onSelect?.(i.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(i)),this.emitSelectionChange();return}if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect([e.id]),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.opts.onSelect?.(e),this.emitSelectionChange()}handleRendererDeselect(e){let i=this.groupedTableBySeatId.get(e.id),o=i?.label??e.label;if(this.opts.retapKeepsSelection&&!i&&(this.hold_?.labels.includes(o)||this.isSelectableByPolicy(e.id))){this.renderer?.select?.([e.id]),this.opts.onSeatRetap?.(this.toSeat(e));return}if(this.hold_?.labels.includes(o)){this.opts.onDeselect?.(i?{...e,label:o}:e);return}i?(this.renderer?.deselect(i.chairs.map(n=>n.id)),this.hold_?.labels.includes(i.label)||(this.tableQuantities.set(i.label,i.mode==="whole"?i.capacity:i.minOccupancy),i.mode==="variable"&&this.confirmedVariableTables.delete(i.label)),this.opts.onDeselect?.(i.chairs[0]??e)):this.opts.onDeselect?.(e),this.emitSelectionChange()}resetUnheldTableQuantities(){for(let e of this.groupedTablesByLabel.values())this.hold_?.labels.includes(e.label)||(this.tableQuantities.set(e.label,e.mode==="whole"?e.capacity:e.minOccupancy),e.mode==="variable"&&this.confirmedVariableTables.delete(e.label))}resetTableQuantitiesForLabels(e){for(let i of e){let o=this.groupedTablesByLabel.get(i);o&&(this.tableQuantities.set(i,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(i))}}tableQuantityRequest(e){if(e?.objectType!=="table")return{};if(e.bookingMode==="variable"&&!this.confirmedVariableTables.has(e.label))throw new Error("picker: confirm a variable table guest quantity before holding");return{quantity:e.quantity}}hold(e,i){return zd(this,e,i)}resumeHold(e){return Kd(this,e)}extendHold(e){return Xd(this,e)}categoryAvailability(){return Fd({seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,groupedTablesByLabel:this.groupedTablesByLabel,closedMembers:this.closedMemberIds(),statusOf:e=>this.getStatus(e),gaAreas:this.getGAAreas()})}closedMemberIds(){let e=new Set,i=this.renderer;if(!i||!this.closedSections.size)return e;for(let o of this.closedSections)for(let n of i.sectionMembers?.(o)??[])e.add(n);return e}getGAAreas(){let e=this.visibleDoc();return e?Rd(e,this.currency,i=>this.statusOf(i),this.inventoryModelVersion):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Ed(this.getGAAreas(),this.gaSelected,{wheelchairOnly:this.accessFilter?.includes("wheelchair")===!0}))}async holdGA(e,i,o={}){let n=this.visibleDoc();if(!n||!Number.isFinite(i)||i<1)return null;let r=Pt(n).find(d=>d.id===e);if(!r)return null;let s=Ad(r,i,{modelVersion:this.inventoryModelVersion,statusOf:d=>this.statusOf(d),alreadyHeld:new Set(this.hold_?.labels??[]),wheelchairOnly:this.accessFilter?.includes("wheelchair")===!0});if(!s)return null;let a=new Map;for(let d of this.hold_?.items??[])a.set(d.label,{label:d.label,tierId:d.tierId,quantity:d.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let d of this.hold_.seats)a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{}});for(let d of this.getSelection())a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{},...this.tableQuantityRequest(d)});for(let d of s)a.set(d.label,{...d,...o.tierId?{tierId:o.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,o.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}hasPremiumSeats(){for(let e of this.labelToSeat.values())if(e.commercial?.premium)return!0;return!1}getBestAvailableZones(){return Nd(this.visibleDoc())}pickPremiumBlock(e,i,o){return Hd({doc:this.visibleDoc(),qty:e,categoryKey:i,zoneId:o,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:n=>this.seatTierResolution(n).kind!=="invalid",statusOfLabel:n=>this.getStatus(this.labelToId.get(n)??"")??"free",isPremium:n=>!!this.labelToSeat.get(n)?.commercial?.premium})}async bestAvailable(e,i,o={}){let n=this.renderer;if(!n)return null;if(o.preferPremium){let r=this.pickPremiumBlock(e,i,o.zoneId);if(r){if(this.hold_&&!await this.release())return null;try{let s=r.map(d=>{let u=this.labelToSeat.get(d),h=u?this.toSeat(u):null;return{label:d,...h?.tierId?{tierId:h.tierId}:{}}}),a=await this.api.hold(this.key,s,o.ttlMs);n.clearSelection();let l=this.idsForLabels(r);l.length&&n.setStatus(l,"held"),this.setHold({holdId:a.holdId,labels:[...r],expiresAt:a.expiresAt,items:a.items});let c=r.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(s){let{status:a,reason:l}=vt(s);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),s}}}if(this.hold_&&!await this.release())return null;try{let r=await this.api.bestAvailable(this.key,e,i,o.zoneId,o.ttlMs);n.clearSelection();let s=this.idsForLabels(r.labels);s.length&&n.setStatus(s,"held"),this.setHold({holdId:r.holdId,labels:[...r.labels],expiresAt:r.expiresAt,items:r.items});let a=r.labels.map(l=>this.labelToSeat.get(l)).filter(l=>!!l).map(l=>this.toSeat(l));return this.opts.onSelectionChange?.(a),this.hold_}catch(r){let{status:s,reason:a}=vt(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,o){return Yd(this,e,i,o)}release(){return Ud(this)}releaseLabels(e){return $d(this,e)}releaseConfirmed(e,i){return qd(e,i)}setStatus(e,i){this.renderer?.setStatus(e,i)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let i=new Set(e.categories.filter(n=>n.notForSale).map(n=>n.key));if(!i.size)return[];let o=[];for(let[n,r]of this.seatById)i.has(r.categoryKey)&&o.push(n);return o}flashSeat(e,i){this.renderer?.flashSeat(e,i)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let i=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&i&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}setViewportInsets(e){this.viewportInsets=e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:null,this.renderer?.setViewportInsets?.(this.viewportInsets)}setFitClearance(e){this.fitClearance=Math.max(0,e||0),this.renderer?.setFitClearance?.(this.fitClearance)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}seatScreenRadius(){let e=this.renderer?.getCameraPose?.()?.scale??0;return fi(this._doc?.theme?.seatScale)*te*e}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){wd(this.pickerFocusContext,e),this.pushGAState()}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}get pickerFocusContext(){let e=this;return{renderer:e.renderer,doc:e._doc,get accessFilter(){return e.accessFilter},set accessFilter(i){e.accessFilter=i},get accessStepAt(){return e.accessStepAt},set accessStepAt(i){e.accessStepAt=i},get bandReturnPose(){return e.bandReturnPose},set bandReturnPose(i){e.bandReturnPose=i},get bandReturnSection(){return e.bandReturnSection},set bandReturnSection(i){e.bandReturnSection=i},getActiveFloorId:()=>e.getActiveFloorId(),setFloor:i=>e.setFloor(i),sectionSummary:i=>e.sectionSummary(i),emitSectionFocus:i=>{e.opts.onSectionFocus?.(i)}}}focusAccessibilityFilter(e){return Cn(this.pickerFocusContext,e)}accessibilitySpread(e){return kd(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return Ld(this.pickerFocusContext,e)}accessibilityFilterDims(e){return Pd(this.pickerFocusContext,e)}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let i=this.renderer;!i?.setActiveFloor||e===i.getActiveFloorId?.()&&!i.isFloorOverview?.()||(i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let i=this.renderer;!i?.setStacked||e===i.isStacked?.()||(i.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let i=this.renderer;!i?.setFloorOverview||e===i.isFloorOverview?.()||(i.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let i=this.renderer;i&&(i.setViewMode?.("flat"),i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor?.(e),this.resnapshot(),this.emitSelectionChange(),this.opts.onDeckTap?.(e))}setViewMode(e){this.renderer?.setViewMode?.(e)}getViewMode(){return this.renderer?.getViewMode?.()??"flat"}getRung(){return this.renderer?.getRung?.()??"seats"}getFocusedSection(){return this.renderer?.getFocusedSection?.()??null}seatsRevealed(){let e=this.renderer;return e?.seatsRevealed?e.seatsRevealed():this.getRung()==="seats"||!!this.getFocusedSection()}atVenueFit(){return this.renderer?.atVenueFit?.()}canZoomIn(){return this.renderer?.canZoomIn?.()}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){Td(this.pickerFocusContext,e)}getViewport(){let e=this.renderer;return!e?.getVisibleWorldRect||!e.getWorldBounds?null:{visible:e.getVisibleWorldRect(),bounds:e.getWorldBounds()}}getMinimapSnapshot(){return this.renderer?.getMinimapSnapshot?.()??{sections:[],seats:[]}}panToWorld(e){this.renderer?.panToWorld?.(e)}clearSectionFocus(){this.renderer?.clearSectionFocus?.(),this.opts.onSectionFocus?.(null)}getRenderedQualityEvidence(){return this.renderer?.getRenderedQualityEvidence()??null}focusSection(e,i){this.handleSectionTap(e,i)}focusSeats(e,i){let o=this.renderer;if(!o?.focusSeats?.(e,i))return!1;let n=o.getFocusedSection?.()??null;return this.opts.onSectionFocus?.(n?this.sectionSummary(n):null),!0}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}previewSection(e,i){this.handleSectionTap(e,i)}handleSectionTap(e,i){if(!this.renderer)return;let o=this.isSectionClosed(e)?null:this.sectionSummary(e);xd(this.pickerFocusContext,e,o,i),this.opts.onSectionFocus?.(o)}sectionSummary(e){return!this.renderer||!this._doc?null:nh({id:e,doc:this._doc,sectionMembers:i=>this.renderer?.sectionMembers?.(i)??[],statusOf:i=>this.renderer?.getStatus(i)??"free",seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,...this.accessFilter?{matchesAccessFilter:i=>Me(i,this.accessFilter)}:{}})}clearConnectFallback(){this.connectFallback&&(clearTimeout(this.connectFallback),this.connectFallback=null)}destroy(){if(this.closed=!0,this.seatsBuilt=!1,this.pendingSnapshot=null,this.clearConnectFallback(),this.detachVisibility?.(),this.detachVisibility=null,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null),this.realtime){try{this.realtime.stop()}catch{}this.realtime=null}if(this.ws){try{this.ws.close()}catch{}this.ws=null}this.renderer?.destroy(),this.renderer=null}toSeat(e){let i=this.groupedTableBySeatId.get(e.id);if(i)return this.toTableSeat(i);let o=e.commercial?{commercial:e.commercial}:void 0,n=e.displayLabel?{displayLabel:e.displayLabel}:void 0,r=e.accessibility?.length?{accessibility:e.accessibility}:void 0,s=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,a=this.seatContext.get(e.id),l=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!l)return{id:e.id,label:e.label,...n,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...r,...s};let d=c.tier;return{id:e.id,label:e.label,...n,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...o,...r,...s}}toTableSeat(e){let i=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(s=>mi(this._doc,this.tableTierSeat(e),s.id).kind==="resolved"),n=this.tableTierResolution(e),r=n.kind==="resolved"?n.tier:void 0;return{id:i?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:i?this.seatContext.get(i.id)?.sectionLabel:void 0,...i&&this.seatContext.get(i.id)?.entrance?{entrance:this.seatContext.get(i.id).entrance}:{},rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:r?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:r?.id}:{},objectType:"table",bookingMode:e.mode,quantity:this.tableQuantities.get(e.label)??(e.mode==="whole"?e.capacity:e.minOccupancy),capacity:e.capacity,minOccupancy:e.minOccupancy,maxOccupancy:e.maxOccupancy,physicalSeatIds:e.chairs.map(s=>s.id)}}describeSeat(e,i){let o=this._doc?.categories.find(n=>n.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:o?.label??e.categoryKey,categoryColor:o?.color??"#6e7bff",status:this.renderer?.getStatus(e.id)??"free",mark:this.renderer?.getSeatMark?.(e.id)??null,...i?.interaction?{interaction:i.interaction}:{},...i?.unavailable?{unavailable:!0}:{},...i?.filteredOut?{filteredOut:!0}:{},currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(i=>i.key===e)?.price??0}tiersFor(e){let i=this._doc?.categories.find(o=>o.key===e)?.tiers;return i&&i.length?i:void 0}tiersForSeat(e){if(!this._doc)return;let i=Ir(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?mi(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(i=>i.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let i=e.chairs[0]?.id??"";return mi(this._doc,this.tableTierSeat(e),this.seatTiers.get(i))}setSeatTier(e,i){let o=this.seatById.get(e);if(!o)return;let n=this.tiersForSeat(o);if(n){if(i==null)this.seatTiers.delete(e);else if(n.some(r=>r.id===i))this.seatTiers.set(e,i);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let i=[];for(let o of e){let n=this.labelToSeat.get(o);n&&i.push(this.toSeat(n))}return i}emitSelectionChange(){let e=this.getSelection();this.opts.onSelectionChange?.(e),this.emitSelectionValidity(),this.emitOrphanHint()}emitSelectionValidity(){let e=this.getSelectionValidity();e&&(this.opts.onSelectionValidityChange?.(e),e.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(e.seats):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(e),this.lastSelectionValidity=e.isValid)}ticketIssue(e){if(!this._doc)return null;let i=e?this.seatsForLabels(e):this.getSelection();return Mr(this._doc,i.map(o=>({label:o.label,...o.tierId?{tierId:o.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let i=this.ticketIssue();if(i){this.hintShown=!0,this.opts.onHint(i.code==="companion_pair_required"?B("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=this.selectionValidators.some(s=>s.type==="noOrphanSeats"),n=new Set(e.getSelection().map(s=>s.id));(o&&n.size?go(this.seatById.values(),s=>e.getStatus(s),n):[]).length>0?(this.hintShown=!0,this.opts.onHint(B("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}setSectionFocusDim(e){this.renderer?.setSectionFocusDim?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){return Zd(this,e)}handle409Conflicts(e){jd(this,e)}setHold(e,i="created"){Qd(this,e,i)}clearHold(){Jd(this)}expireActiveHold(){return eh(this)}applySeatsMap(e,i="free",o="http",n){o==="socket"&&(this.socketVersion+=1);let r=this.renderer;if(!r||!this.seatsBuilt){this.pendingSnapshot=rh(this.pendingSnapshot,{seats:e,default:i,source:o,...n===void 0?{}:{fetchedAt:n}});return}let s=this.seatsMapDiffers(e,i);this.lastSnapshotAt=n??Date.now(),this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=i;let a=$i(i);this.allIds.length&&r.setStatus(this.allIds,a),r.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let l={free:[],held:[],booked:[],not_for_sale:[]};for(let[d,u]of Object.entries(e))l[$i(u)].push(...this.idsForLabel(d));["free","held","booked","not_for_sale"].forEach(d=>{d!==a&&l[d].length&&r.setStatus(l[d],d)});let c=this.notForSaleCategorySeatIds();c.length&&r.setStatus(c,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:s})}snapshotIsFresh(e=5e3){return this.lastSnapshotAt>0&&Date.now()-this.lastSnapshotAt<e}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(i=>this.statusOf(i)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let i=this.socketVersion,o=await this.api.objects(this.key);this.socketVersion===i&&this.applySeatsMap(o.seats,o.default??"free","http",o.fetchedAt)},e)}resync(e){return e?.reason==="connect"&&this.snapshotIsFresh()?Promise.resolve():this.resnapshot()}applyProjection(e){this.applySeatsMap(e.exceptions,e.default,"socket")}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,i=Bd({selection:this.getSelection().map(o=>o.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:o=>this.statusOf(o)});if(i.lost.length&&this.deselect(i.lost),i.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(i.lapsedLabels);let o=this.idsForLabels(i.lapsedLabels);o.length&&this.renderer?.deselect(o),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(i),i}getAccessNeeds(){return _d(this.seatById.values(),e=>this.getStatus(e)??"free",this.getGAAreas().filter(e=>e.wheelchairPlaces).map(e=>({need:"wheelchair",free:e.wheelchairAvailable??0})))}attachVisibility(){this.detachVisibility||(this.detachVisibility=Dd(()=>{this.closed||this.refreshAvailability().then(()=>{this.closed||this.renderer?.forceDraw()})}))}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applyProjection(e),resync:e=>this.resync(e),onSections:(e,i)=>{let o=this.syncHidden(e),n=this.syncClosed(i);o&&this.resnapshot(),(o||n)&&this.opts.onStatusChange?.({changed:!0})}}}seatsMapDiffers(e,i){if(this.lastSnapshotAt===0||i!==this.liveDefault)return!0;let o=Object.entries(e);if(o.length!==this.liveStatuses.size)return!0;for(let[n,r]of o)if(this.liveStatuses.get(n)!==r)return!0;return!1}applyStatusChanges(e){this.socketVersion+=1;let i=this.renderer;if(!i)return;let o=e.some(s=>this.liveStatuses.get(s.label)!==s.status),n=new Map;for(let s of e){this.liveStatuses.set(s.label,s.status);let a=this.idsForLabel(s.label);if(!a.length)continue;let l=$i(s.status);this.opts.flashOnLiveChange&&l!=="free"&&a.some(c=>(n.get(c)??i.getStatus(c))==="free")&&!this.hold_?.labels.includes(s.label)&&a.forEach(c=>i.flashSeat(c,l==="held"?"#f4b740":"#f43f5e"));for(let c of a)n.set(c,l)}let r=new Map;for(let[s,a]of n){let l=r.get(a);l||r.set(a,l=[]),l.push(s)}for(let[s,a]of r)i.setStatus(a,s);this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&i.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:o})}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let o=null;try{o=this.api.createRealtime(this.key,this.realtimeSink())}catch{o=null}if(o){this.realtime=o,o.start();return}}if(this.realtime)return;let i;try{let o=this.api.socketProtocols?.(this.key);i=o&&o.length?new WebSocket(e,o):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=i,i.onopen=()=>{if(this.attempt=0,!this.snapshotIsFresh()){this.resnapshot();return}this.clearConnectFallback(),this.connectFallback=setTimeout(()=>{this.connectFallback=null,this.resnapshot()},2500)},i.onmessage=o=>{this.clearConnectFallback();let n;try{n=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(!this.renderer||!n||typeof n!="object")return;let s=n;Array.isArray(s.hidden)&&this.syncHidden(s.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.({changed:!0})),Array.isArray(s.closed)&&this.syncClosed(s.closed)&&this.opts.onStatusChange?.({changed:!0}),s.type!=="hidden"&&(s.seats&&typeof s.seats=="object"?this.applySeatsMap(s.seats):Array.isArray(s.changes)&&this.applyStatusChanges(s.changes))},i.onclose=()=>{this.ws===i&&(this.ws=null),this.scheduleReconnect()},i.onerror=()=>{try{i.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),i=Md(e,{baseMs:1e3,maxMs:Gm,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var Wm=5,Vm=-1.1,In=35;function Mn(t,e){let i=t-se,o=Math.atan2(Wm-i,e)*180/Math.PI,n=Math.atan2(Vm-i,e)*180/Math.PI;return n<-In&&(o+=-In-n,n=-In),{topPitch:o,basePitch:n}}var ne=2048,xe=1024,Qt=Gn,D=Math.PI*2,zm=xe/180,kt=t=>(t+180)/360*ne,$=t=>(90-t)/180*xe;function uh(t){let e=2166136261;for(let i=0;i<t.length;i++)e^=t.charCodeAt(i),e=Math.imul(e,16777619);return e>>>0}function ph(t){let e=t>>>0;return()=>{e|=0,e=e+1831565813|0;let i=Math.imul(e^e>>>15,1|e);return i=i+Math.imul(i^i>>>7,61|i)^i,((i^i>>>14)>>>0)/4294967296}}var ji=96,En=360/ji,Km=.6,Rn=[17,23,42];function An(t,e,i=1){let o=Math.max(0,Math.min(.58,e)),n=Math.round(t[0]+(Rn[0]-t[0])*o),r=Math.round(t[1]+(Rn[1]-t[1])*o),s=Math.round(t[2]+(Rn[2]-t[2])*o);return`rgba(${n},${r},${s},${i})`}function lh(t,e,i){return[Math.round(t[0]+(e[0]-t[0])*i),Math.round(t[1]+(e[1]-t[1])*i),Math.round(t[2]+(e[2]-t[2])*i)]}function ce(t,e,i){let o=(1-Math.abs(2*i-1))*e,n=(t%360+360)%360/60,r=o*(1-Math.abs(n%2-1)),s=0,a=0,l=0;n<1?[s,a,l]=[o,r,0]:n<2?[s,a,l]=[r,o,0]:n<3?[s,a,l]=[0,o,r]:n<4?[s,a,l]=[0,r,o]:n<5?[s,a,l]=[r,0,o]:[s,a,l]=[o,0,r];let c=i-o/2;return[Math.round((s+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var ch=new Map;function dh(t){if(!t)return null;let e=ch.get(t);if(e)return e;let i=2166136261;for(let r=0;r<t.length;r++)i^=t.charCodeAt(r),i=Math.imul(i,16777619);let o=(i>>>0)%360,n=ce(o,.3,.42);return ch.set(t,n),n}function Xm(t,e,i,o){let n=new Array(ji).fill(null),r=0,s=t.sectionId;for(let a of e){if(a.id===t.id)continue;let l=a.sectionId;if(!l||s&&l===s)continue;let c=a.x-t.x,d=a.y-t.y,u=Math.hypot(c,d)*Qt;if(u<1.5||u>95)continue;let h=a.eyeHeightM??se,m=h-o;Math.abs(m)>r&&(r=Math.abs(m));let f=Math.atan2(m,u)*180/Math.PI,b=Math.atan2(h-se-o,u)*180/Math.PI,g=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,y=Math.min(ji-1,Math.max(0,Math.floor((g+180)/En))),S=f>34&&u<16,x=n[y];x?(f>x.top&&(x.top=f),b<x.base&&(x.base=b),u<x.nearM&&(x.nearM=u,x.tint=dh(a.categoryKey)),x.overhead=x.overhead||S):n[y]={top:f,base:b,nearM:u,overhead:S,tint:dh(a.categoryKey)}}return{bins:n,maxDelta:r}}function Ym(t,e,i,o){for(let n=0;n<ji;n++){let r=e[n];if(!r)continue;let s=-180+n*En,a=i(s),l=i(s+En);if(!(l>a))continue;let c=Math.min(72,r.top),d=Math.min(r.base,-4),u=o(c),h=o(d);if(h<=u)continue;let m=r.nearM/95,f=r.tint,b=f?lh([44,54,80],f,.34):[44,54,80],p=f?lh([24,30,48],f,.28):[24,30,48],g=t.createLinearGradient(0,u,0,h);g.addColorStop(0,An(b,m)),g.addColorStop(.24,An(p,m)),g.addColorStop(1,An([10,13,22],m)),t.fillStyle=g,t.fillRect(a,u,l-a+1,h-u),t.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,t.fillRect(a,u,l-a+1,1.5);let S=Math.min(h,o(0))-u;if(S>8){let w=1-m*.4;for(let v=1;v<6;v++){let k=u+S*v/6;t.fillStyle=`rgba(0,0,0,${.16*w})`,t.fillRect(a,k,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*w})`,t.fillRect(a,k+1.5,l-a+1,1.2)}}if(r.overhead){let x=o(Math.min(86,c+12)),w=t.createLinearGradient(0,x,0,u);w.addColorStop(0,"rgba(3,4,8,0.9)"),w.addColorStop(1,"rgba(3,4,8,0)"),t.fillStyle=w,t.fillRect(a,x,l-a+1,u-x),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,u-1.5,l-a+1,1.5)}}}function Um(t,e,i){let n=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let g of i){a++,g.sectionId&&s.add(g.sectionId);let y=g.x-e.x,S=g.y-e.y,x=Math.hypot(y,S)*Qt;if(x<.5)continue;let w=Math.atan2(y,-S),v=Math.floor((w+Math.PI)/D*72);v<0?v=0:v>=72&&(v=71),n[v]=!0,x<r[v]&&(r[v]=x)}let l=0,c=[];for(let g=0;g<72;g++)n[g]&&(l++,c.push(r[g]));let d=l/72*360;c.sort((g,y)=>g-y);let u=c.length?c[c.length>>1]:0,h=c.length?c[Math.floor(c.length*.15)]??u:0,m=c.length?c[Math.floor(c.length*.85)]??u:0,f=h>.5?m/h:1,b=uh(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return d>=300&&u>11&&f>1.35?p="sport":d>=285?p="arena":p="proscenium",{mode:p,seed:b,voidRadiusM:u,aspect:f}}var $m=5;function qm(t,e,i){switch(i){case 1:t.beginPath(),t.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,D),t.fill();break;case 2:t.beginPath(),t.ellipse(0,-e*1.02,e*.42,e*.42,0,0,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.2,e*.98,e*1.02,0,0,D),t.fill();break;case 3:t.beginPath(),t.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.52,e*1.22,e*.24,0,0,D),t.fill();break;case 4:t.beginPath(),t.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,D),t.fill(),t.beginPath(),t.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,D),t.fill(),t.beginPath(),t.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,D),t.fill();break;default:break}}function Zm(t,e,i,o,n){let r=o*.44,s=o*n.shoulderK,a=o*.66,l=o*1.68,c=o*5.4,d=`rgba(${n.clothing[0]},${n.clothing[1]},${n.clothing[2]},${n.alpha})`,u=`rgba(${n.tone[0]},${n.tone[1]},${n.tone[2]},${n.alpha})`;t.save(),t.translate(e,i);let h=n.lean*o;t.fillStyle=d,t.beginPath(),t.moveTo(-r,a),t.quadraticCurveTo(-r*1.18,l-h-o*.6,-s,l-h),t.quadraticCurveTo(-s*1.05,l+o*1.2,-s*.94,c),t.lineTo(s*.94,c),t.quadraticCurveTo(s*1.05,l+o*1.2,s,l+h),t.quadraticCurveTo(r*1.18,l+h-o*.6,r,a),t.closePath(),t.fill(),t.fillStyle=u,t.fillRect(-r*.82,o*.5,r*1.64,o*.9),t.save(),t.rotate(n.tilt),t.translate(n.turn*o,0),t.fillStyle=u,o>=18?(t.beginPath(),t.moveTo(-o*.9,-o*.15),t.quadraticCurveTo(-o*.96,-o*1.12,0,-o*1.06),t.quadraticCurveTo(o*.96,-o*1.12,o*.9,-o*.15),t.quadraticCurveTo(o*.86,o*.55,o*.36,o*.98),t.quadraticCurveTo(0,o*1.14,-o*.36,o*.98),t.quadraticCurveTo(-o*.86,o*.55,-o*.9,-o*.15),t.closePath(),t.fill(),o>=22&&(t.beginPath(),t.ellipse(-o*.9,o*.18,o*.13,o*.22,0,0,D),t.ellipse(o*.9,o*.18,o*.13,o*.22,0,0,D),t.fill())):(t.beginPath(),t.ellipse(0,0,o*.9,o*1.06,0,0,D),t.fill()),qm(t,o,n.hair),n.rim>.01&&(t.strokeStyle=`rgba(245,205,150,${(.5*n.rim).toFixed(3)})`,t.lineWidth=Math.max(1,o*.14),t.beginPath(),t.ellipse(0,-o*.06,o*.86,o*1,0,Math.PI*1.12,Math.PI*1.9),t.stroke()),t.restore(),n.rim>.01&&(t.strokeStyle=`rgba(240,200,150,${(.28*n.rim).toFixed(3)})`,t.lineWidth=Math.max(1,o*.12),t.beginPath(),t.moveTo(-s*.8,l-o*.05),t.quadraticCurveTo(-r,l-o*.75,0,l-o*.82),t.quadraticCurveTo(r,l-o*.75,s*.8,l-o*.05),t.stroke()),t.restore()}function jm(t,e,i,o,n,r,s){t.fillStyle=`rgba(${n[0]},${n[1]},${n[2]},${s})`,t.beginPath(),t.moveTo(e-o*1.72,i+o*4),t.quadraticCurveTo(e-o*1.78,i+o*1.55,e-o*.46,i+o*1.02),t.lineTo(e-o*.4,i+o*.62),t.lineTo(e+o*.4,i+o*.62),t.lineTo(e+o*.46,i+o*1.02),t.quadraticCurveTo(e+o*1.78,i+o*1.55,e+o*1.72,i+o*4),t.closePath(),t.fill(),t.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${s})`,t.beginPath(),t.ellipse(e,i,o*.9,o*1.05,0,0,D),t.fill()}function _n(t,e,i,o,n){let r=o*.1,s=i-o*.9,a=i-o*.74,l=i-o*.46,c=o*.13,d=o*.09,u=`rgba(${n.tone[0]},${n.tone[1]},${n.tone[2]},${n.alpha})`,h=t.createRadialGradient(e,i,1,e,i,o*.24);h.addColorStop(0,"rgba(0,0,0,0.4)"),h.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.scale(1,.28),t.fillStyle=h,t.beginPath(),t.ellipse(e,i/.28,o*.24,o*.24,0,0,D),t.fill(),t.restore(),t.fillStyle=u,t.beginPath(),t.moveTo(e-d,l),t.lineTo(e-d*.7,i),t.lineTo(e-d*.1,i),t.lineTo(e-d*.1,l+o*.02),t.lineTo(e+d*.1,l+o*.02),t.lineTo(e+d*.1,i),t.lineTo(e+d*.7,i),t.lineTo(e+d,l),t.closePath(),t.fill(),t.beginPath(),t.moveTo(e-c,a),t.quadraticCurveTo(e-c*.9,l-o*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-o*.12,e+c,a),t.quadraticCurveTo(e,a-o*.05,e-c,a),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=u,t.lineWidth=o*.055;let m=a+o*.02;n.pose===1?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e-c*1.5,i-o*1.02),t.moveTo(e+c*.8,m),t.lineTo(e+c*1.5,i-o*1.02),t.stroke()):n.pose===2?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e+d*1.4,l-o*.02),t.moveTo(e+c*.8,m),t.lineTo(e-d*.4,l-o*.06),t.stroke(),t.fillStyle=u,t.beginPath(),t.ellipse(e+d*1.5,l-o*.04,o*.07,o*.09,-.5,0,D),t.fill()):n.pose===3?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,m),t.lineTo(e+c*1.1,l),t.stroke(),t.lineWidth=o*.02,t.beginPath(),t.moveTo(e-c*.2,s+r*.9),t.lineTo(e-c*.2,i-o*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,m),t.lineTo(e-c*.95,l+o*.02),t.moveTo(e+c*.85,m),t.lineTo(e+c*.95,l+o*.02),t.stroke()),t.fillStyle=u,t.fillRect(e-r*.34,s+r*.6,r*.68,r*.9),t.beginPath(),t.ellipse(e,s,r*.86,r*1.05,0,0,D),t.fill(),n.rimStrength>.01&&(t.strokeStyle=`rgba(${n.rim[0]},${n.rim[1]},${n.rim[2]},${(.6*n.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,o*.02),t.beginPath(),t.moveTo(e-c,a),t.lineTo(e-r*.6,s+r*.4),t.moveTo(e-r*.7,s),t.ellipse(e,s,r*.84,r*1.02,0,Math.PI*1.05,Math.PI*1.55),t.stroke())}function Qi(t,e,i,o,n,r,s,a,l){t.save(),t.globalCompositeOperation="lighter";let c=t.createLinearGradient(0,i,0,n);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),t.fillStyle=c,t.beginPath(),t.moveTo(e-r,i),t.lineTo(o-s,n),t.lineTo(o+s,n),t.lineTo(e+r,i),t.closePath(),t.fill(),t.restore()}function Bn(t,e,i,o,n){let r=t.createRadialGradient(e,i,0,e,i,o*3);r.addColorStop(0,`rgba(${n},0.9)`),r.addColorStop(.4,`rgba(${n},0.35)`),r.addColorStop(1,`rgba(${n},0)`),t.fillStyle=r,t.beginPath(),t.arc(e,i,o*3,0,D),t.fill(),t.fillStyle=`rgba(${n},1)`,t.beginPath(),t.arc(e,i,o,0,D),t.fill()}function pC(t,e,i){let o=document.createElement("canvas");o.width=ne,o.height=xe;let n=o.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.hypot(r,s),l=Math.max(2,a*Qt),c=t.eyeHeightM??se,d=Um(t,e,i),u=ph(d.seed),h=210+u()*150,m=ce(220+(u()-.5)*60,.55,.82),f=`${m[0]},${m[1]},${m[2]}`,b=n.createLinearGradient(0,0,0,xe);b.addColorStop(0,"#080b12"),b.addColorStop(.42,"#12182c"),b.addColorStop(.5,"#1c2440"),b.addColorStop(.56,"#151b2c"),b.addColorStop(.78,"#171e30"),b.addColorStop(1,"#131829"),n.fillStyle=b,n.fillRect(0,0,ne,xe);let p=n.createLinearGradient(0,$(-6),0,xe);p.addColorStop(0,"rgba(30, 37, 56, 0)"),p.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),p.addColorStop(1,"rgba(22, 28, 44, 0.12)"),n.fillStyle=p,n.fillRect(0,$(-6),ne,xe-$(-6));let g=Math.atan2(r,-s),y=Xm(t,i,g,c),S=y.maxDelta>=Km;S&&Ym(n,y.bins,kt,$);let x=Math.max(.3,Math.min(1,1-(l-6)/60)),w=Mn(c,l),v=Math.min(80,Math.atan2(4,l)*180/Math.PI),k=Math.min(45,w.topPitch),P=w.basePitch;d.mode==="sport"?eg(n,l,c,d,x,h,f,u):d.mode==="arena"?Jm(n,l,c,d,x,f,u):Qm(n,v,k,P,x,h,f,u);let C=d.mode==="sport"?34:24+Math.floor(u()*8);n.fillStyle=`rgba(${f},0.8)`;for(let L=0;L<C;L++){let I=(L+.5)/C*ne,M=$(d.mode==="sport"?58:54+L*7%3*6);n.beginPath(),n.arc(I,M,d.mode==="sport"?2.6:3.2,0,D),n.fill()}tg(n,t,i,e,g,c,r,s,S,d);let T=n.createLinearGradient(0,0,0,xe);return T.addColorStop(0,"rgba(0,0,0,0.85)"),T.addColorStop(.12,"rgba(0,0,0,0)"),T.addColorStop(.9,"rgba(0,0,0,0)"),T.addColorStop(1,"rgba(0,0,0,0.55)"),n.fillStyle=T,n.fillRect(0,0,ne,xe),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function Qm(t,e,i,o,n,r,s,a){let l=kt(-e),c=kt(e),d=$(i),u=$(o),h=c-l,m=u-d,f=$(Math.min(50,i+10)),b=h*(1.1+(1-n)*.5),p=t.createRadialGradient(ne/2,(d+u)/2,8,ne/2,(d+u)/2,b);p.addColorStop(0,"rgba(255, 214, 150, 0.34)"),p.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),p.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),p.addColorStop(1,"rgba(99, 102, 241, 0)"),t.fillStyle=p,t.fillRect(l-h*.6,d-m*1.2,h*2.2,m*3.4);let g=ce(r,.62,.55),y=ce(r+40,.7,.5),S=ce(r+70,.78,.52);t.save(),t.beginPath(),t.rect(l,d,h,m),t.clip();let x=t.createLinearGradient(0,d,0,u);x.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),x.addColorStop(.5,`rgb(${y[0]},${y[1]},${y[2]})`),x.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=x,t.fillRect(l,d,h,m),t.globalAlpha=1;let w=t.createRadialGradient(ne/2,(d+u)/2,h*.12,ne/2,(d+u)/2,h*.62);w.addColorStop(0,"rgba(6,8,14,0)"),w.addColorStop(.7,"rgba(6,8,14,0.15)"),w.addColorStop(1,"rgba(5,6,11,0.92)"),t.fillStyle=w,t.fillRect(l,d,h,m),t.restore();let v=3+Math.floor(a()*3),k=m*.46,P=u-m*.08;for(let E=0;E<v;E++){let F=(E+1)/(v+1),H=l+h*(.22+F*.56+(a()-.5)*.06);_n(t,H,P,k*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:ce(r+20,.5,.7),rimStrength:.7})}t.fillStyle="#05070d",t.fillRect(l-h*.5,f,h*.5,u-f),t.fillRect(c,f,h*.5,u-f);let C=h*.055+3,T=C*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,u),t.lineTo(l-C,u),t.lineTo(l-T,f),t.lineTo(l+h*.012,f),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,u),t.lineTo(c+C,u),t.lineTo(c+T,f),t.lineTo(c-h*.012,f),t.closePath(),t.fill(),t.fillRect(l-T,f,h+T*2,(u-f)*.12);let L=m*.14,I=f+(u-f)*.12;t.fillStyle="rgba(4,6,12,0.96)";let M=7;t.beginPath(),t.moveTo(l-T,I);for(let E=0;E<=M;E++){let F=l-T+(h+T*2)*E/M;t.quadraticCurveTo(F-(h+T*2)/M/2,I+L,F,I)}t.lineTo(c+T,I),t.lineTo(c+T,f),t.lineTo(l-T,f),t.closePath(),t.fill(),t.fillStyle=`rgba(${s},0.12)`,t.fillRect(l-1.5,I,1.5,u-I),t.fillRect(c,I,1.5,u-I),t.fillStyle="#0b0f18",t.fillRect(l-C,u-m*.05,h+C*2,m*.05+3);let R=t.createLinearGradient(0,u-m*.05,0,u+m*.12);R.addColorStop(0,`rgba(255,206,140,${(.5*n).toFixed(3)})`),R.addColorStop(1,"rgba(255,206,140,0)"),t.fillStyle=R,t.fillRect(l-C,u-m*.05,h+C*2,m*.2);let A=3+Math.floor(a()*2);for(let E=0;E<A;E++){let F=(E+1)/(A+1),H=l+h*(F+(a()-.5)*.08),G=$(Math.min(62,i+26)),Q=(a()-.5)*h*.16;Qi(t,H,G,H+Q,u,4,h*.09,s,.16*(.7+n*.5)),Bn(t,H,G,2.4,s)}}function Jm(t,e,i,o,n,r,s){let a=Math.min(e*.6,Math.max(3,o.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=ne/2,d=1.2,u=Math.max(e*.45,e-a),h=e+a,m=Math.atan2(d-i,u)*180/Math.PI,f=Math.atan2(d-i,h)*180/Math.PI,b=Math.atan2(-i,u)*180/Math.PI,p=$(m),g=$(f),y=$(b),S=kt(l)-c,x=Math.max(6,(p-g)/2),w=(p+g)/2,v=t.createRadialGradient(c,y,4,c,y,S*2.6);v.addColorStop(0,`rgba(255,206,150,${(.2*n).toFixed(3)})`),v.addColorStop(.5,"rgba(150,140,190,0.08)"),v.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=v,t.fillRect(c-S*2.6,g-x,S*5.2,y-g+x+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,w),t.ellipse(c,w,S,x,0,Math.PI,0,!1),t.lineTo(c+S,y),t.ellipse(c,y,S,x,0,0,Math.PI,!1),t.closePath(),t.fill();let k=t.createLinearGradient(0,w,0,y);k.addColorStop(0,`rgba(${r},0.14)`),k.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=k,t.fillRect(c-S,w,S*2,y-w);let P=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],C=P[Math.floor(s()*P.length)],T=s()<.5?-1:1,L=X=>c+X.u*T*S*.84,I=X=>w+X.v*x*.8,M=C.find(X=>X.lead)??C[0],R=L(M),A=t.createLinearGradient(0,w-x,0,w+x);A.addColorStop(0,"#3d4a72"),A.addColorStop(1,"#232b47"),t.fillStyle=A,t.beginPath(),t.ellipse(c,w,S,x,0,0,D),t.fill();let E=t.createRadialGradient(R,w,2,R,w,S);E.addColorStop(0,`rgba(255,214,160,${(.5*n).toFixed(3)})`),E.addColorStop(1,"rgba(255,214,160,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=E,t.beginPath(),t.ellipse(c,w,S,x,0,0,D),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,w,S,x,0,0,D),t.stroke();let F=Math.max(24,(y-g)*1.3),H=C.length>=3?3:2;for(let X=0;X<H;X++){let Le=(-.62+X*.52+(s()-.5)*.12)*-T,Ne=c+Le*S*.7,xt=w-x*(.45+s()*.18),ot=S*(.07+s()*.04),no=F*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Ne-ot/2,xt-no,ot,no),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Ne-ot/2,xt-no,ot,1.5)}if(C.length>=3){let X=c-M.u*T*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(X,w-x*.34,S*.08,x*.1,0,0,D),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let X of[...C].sort((Le,Ne)=>Le.v-Ne.v)){let Le=.82+(X.v+1)*.14;_n(t,L(X),I(X),F*Le*(X.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:X.pose,rim:ce(40,.72,.8),rimStrength:X.lead?1.4:.9})}let G=$(Math.min(60,f+34)),Q=x*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,G,S*1.15,Q,0,0,D),t.stroke();let N=4+Math.floor(s()*3);for(let X=0;X<N;X++){let Le=X/N*D,Ne=c+Math.cos(Le)*S*1.15,xt=G+Math.sin(Le)*Q;if(Math.sin(Le)>-.2){let ot=c+(s()-.5)*S*.8;Qi(t,Ne,xt,ot,w,3,S*.32,r,.2*(.7+n*.4))}Bn(t,Ne,xt,3,r)}let _=$(Math.min(52,f+24)),W=Math.max(60,S*.4),re=Math.max(24,W*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-W*.3,_-re/2),t.lineTo(c-W*.16,_-re*2.2),t.moveTo(c+W*.3,_-re/2),t.lineTo(c+W*.16,_-re*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-W/2,_-re/2,W,re);let eo=t.createLinearGradient(0,_-re*.3,0,_+re*.42);eo.addColorStop(0,`rgba(${r},0.5)`),eo.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=eo,t.fillRect(c-W*.42,_-re*.3,W*.84,re*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-W/2,_+re/2-2,W,2);let to=t.createRadialGradient(c,_,4,c,_,W*1.1);to.addColorStop(0,`rgba(${r},0.2)`),to.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=to,t.fillRect(c-W*1.1,_-W*.8,W*2.2,W*1.6);let io=t.createRadialGradient(c,(G+w)/2,6,c,(G+w)/2,S*1.5);io.addColorStop(0,`rgba(${r},${(.1*(.6+n*.5)).toFixed(3)})`),io.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=io,t.fillRect(c-S*1.5,G-40,S*3,w-G+80),t.restore();let mh=c+Math.sign(R-c||1)*S*.5;Qi(t,mh,G-Q*.4,R,I(M),2.5,S*.16,"255,224,178",.42*(.7+n*.4));let oo=t.createRadialGradient(R,I(M),1,R,I(M),S*.2);oo.addColorStop(0,`rgba(255,228,185,${(.4*n).toFixed(3)})`),oo.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=oo,t.beginPath(),t.ellipse(R,I(M),S*.2,x*.24,0,0,D),t.fill(),t.restore()}function eg(t,e,i,o,n,r,s,a){let l=ne/2,c=Math.max(10,o.voidRadiusM),d=Math.max(2,e-c),u=e+c,h=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),m=Math.atan2(-i,d)*180/Math.PI,f=Math.atan2(-i,u)*180/Math.PI,b=$(m),p=$(f),g=kt(h)-l,y=(b+p)/2,S=Math.max(10,(b-p)/2),x=t.createRadialGradient(l,y,4,l,y,g);x.addColorStop(0,"#e8f0fb"),x.addColorStop(.7,"#b9c9e2"),x.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,y,g,S,0,0,D),t.clip(),t.fillStyle=x,t.fillRect(l-g,y-S,g*2,S*2),t.strokeStyle="rgba(90,120,170,0.5)",t.lineWidth=3,t.beginPath(),t.moveTo(l,y-S),t.lineTo(l,y+S),t.moveTo(l-g*.5,y-S),t.lineTo(l-g*.5,y+S),t.moveTo(l+g*.5,y-S),t.lineTo(l+g*.5,y+S),t.stroke(),t.strokeStyle="rgba(180,90,110,0.45)",t.beginPath(),t.ellipse(l,y,S*.9,S*.5,0,0,D),t.stroke(),t.restore(),t.strokeStyle="rgba(210,225,245,0.6)",t.lineWidth=2.5,t.beginPath(),t.ellipse(l,y,g,S,0,0,D),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let L=0;L<5;L++){let I=l+(a()-.5)*g*1.4,M=y+(a()-.5)*S*1.1,R=Math.max(2,S*.06);t.beginPath(),t.ellipse(I,M,R*.6,R,0,0,D),t.fill()}let w=t.createRadialGradient(l,y,4,l,y,g*1.4);w.addColorStop(0,"rgba(200,220,255,0.12)"),w.addColorStop(1,"rgba(200,220,255,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=w,t.fillRect(l-g*1.4,p-S,g*2.8,b-p+S*2),t.restore();let v=$(Math.min(66,f+60)),k=Math.max(80,g*.7),P=k*.5,C=t.createRadialGradient(l,v,4,l,v,k*1.6);C.addColorStop(0,`rgba(${s},0.3)`),C.addColorStop(1,`rgba(${s},0)`),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=C,t.fillRect(l-k*1.6,v-k*1.2,k*3.2,k*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-k/2,v-P/2),t.lineTo(l+k/2,v-P/2),t.lineTo(l+k*.6,v),t.lineTo(l+k/2,v+P/2),t.lineTo(l-k/2,v+P/2),t.lineTo(l-k*.6,v),t.closePath(),t.fill();let T=r;for(let L=0;L<3;L++){let I=ce(T+L*30,.5,.5);t.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},0.75)`;let M=k*.26;t.fillRect(l-k*.42+L*(M+k*.06),v-P*.32,M,P*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let L=0;L<8;L++){let I=l-k*.6+k*1.2*L/7;t.beginPath(),t.arc(I,v+P*.62,2.4,0,D),t.fill()}}function tg(t,e,i,o,n,r,s,a,l,c){let d=e.sectionId,u=!1,h=[];for(let b of i){if(b.id===e.id)continue;let p=b.x-e.x,g=b.y-e.y,y=Math.hypot(p,g)*Qt;if(d&&b.sectionId===d&&y<3&&p*s+g*a>0&&(u=!0),y<.3||y>32)continue;let x=((Math.atan2(p,-g)-n)*180/Math.PI+540)%360-180,w=l?(b.eyeHeightM??se)-r:0,v=Math.atan2(w-.28,y)*180/Math.PI;if(v>10&&y>5)continue;let k=0;for(let T=0;T<b.id.length;T++)k=k*31+b.id.charCodeAt(T)&65535;let P=.9+(k&15)/40,C=Math.min(78,Math.atan2(.16,y)*180/Math.PI*zm*P);C<1.2||h.push({hx:kt(x),hy:$(v),r:C,d:y,hash:k})}h.sort((b,p)=>p.d-b.d);let m=[];{let b=[...h].sort((y,S)=>y.hy-S.hy),p=[],g=()=>{if(!p.length)return;let y=p.reduce((w,v)=>w+v.d,0)/p.length,S=p.reduce((w,v)=>w+v.hy,0)/p.length,x=p.reduce((w,v)=>w+v.r,0)/p.length;m.push({figs:p.sort((w,v)=>v.d-w.d),d:y,hy:S,r:x}),p=[]};for(let y of b){let S=p[p.length-1];S&&Math.abs(y.hy-S.hy)>Math.max(5,(S.r+y.r)/2*1.7)&&g(),p.push(y)}g()}m.sort((b,p)=>p.d-b.d);let f=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let b of m){if(b.figs.length>=3&&b.r>=1.6&&b.r<26){let p=[],g=[...b.figs].sort((x,w)=>x.hx-w.hx),y=[];for(let x of g){let w=y[y.length-1];w&&x.hx-w.hx>Math.max(14,x.r*7)&&(y.length>=3&&p.push(y),y=[]),y.push(x)}y.length>=3&&p.push(y);let S=Math.min(.42,.5*(1-b.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let x of p){let w=x[0].hx-b.r*1.6,v=x[x.length-1].hx+b.r*1.6;t.beginPath(),t.roundRect(w,b.hy+b.r*.8,v-w,b.r*2.4,b.r*.8),t.fill()}}}for(let p of b.figs){let g=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),y=Math.round((1-Math.min(1,p.d/16))*10),S=[14+(p.hash>>4&6)+y,17+(p.hash>>4&6)+y,25+(p.hash>>4&6)+y],x=f[p.hash%f.length],w=[x[0]+y,x[1]+y,x[2]+y];if(p.r>=13){let v=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;Zm(t,p.hx,p.hy,p.r,{tone:S,clothing:w,alpha:g,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%$m,rim:v,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?jm(t,p.hx,p.hy,p.r,w,S,g):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,t.beginPath(),t.arc(p.hx,p.hy,p.r,0,D),t.fill(),t.beginPath(),t.ellipse(p.hx,p.hy+p.r*1.4,p.r*1.85,p.r*.95,0,Math.PI,0,!0),t.fill())}}if(u){let b=$(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,b,ne,xe-b),t.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let g=0;g<p;g++){let y=(g+.5)/p*ne;t.beginPath(),t.ellipse(y,b+6,ne/p*.42,22,0,Math.PI,0,!0),t.fill()}}}var ue=480,wt=270,Fn=50,it=30,hh=t=>(t+Fn)/(2*Fn)*ue,jt=t=>(it-t)/(2*it)*wt;function fC(t,e,i){let o=document.createElement("canvas");o.width=ue,o.height=wt;let n=o.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*Qt),l=ph(uh(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=ce(220+(l()-.5)*60,.55,.82),u=`${d[0]},${d[1]},${d[2]}`,h=n.createLinearGradient(0,0,0,wt);h.addColorStop(0,"#080b12"),h.addColorStop(.44,"#151c32"),h.addColorStop(.5,"#1d2644"),h.addColorStop(.58,"#161c2e"),h.addColorStop(1,"#131829"),n.fillStyle=h,n.fillRect(0,0,ue,wt);let m=t.eyeHeightM??se,f=Mn(m,a),b=Math.min(Fn-2,Math.atan2(4,a)*180/Math.PI),p=Math.min(it-2,f.topPitch),g=Math.max(-it+2,f.basePitch),y=hh(-b),S=hh(b),x=jt(p),w=jt(g),v=S-y,k=w-x,P=Math.max(.35,Math.min(1,1-(a-6)/60)),C=jt(Math.min(it-1,p+8)),T=n.createRadialGradient(ue/2,(x+w)/2,4,ue/2,(x+w)/2,v*1.15);T.addColorStop(0,"rgba(255,214,150,0.34)"),T.addColorStop(.28,"rgba(150,150,230,0.3)"),T.addColorStop(.6,"rgba(99,102,241,0.12)"),T.addColorStop(1,"rgba(99,102,241,0)"),n.fillStyle=T,n.fillRect(y-v*.6,x-k*1.2,v*2.2,k*3.4);let L=ce(c,.62,.55),I=ce(c+40,.7,.5),M=ce(c+70,.78,.52);n.save(),n.beginPath(),n.rect(y,x,v,k),n.clip();let R=n.createLinearGradient(0,x,0,w);R.addColorStop(0,`rgb(${L[0]},${L[1]},${L[2]})`),R.addColorStop(.5,`rgb(${I[0]},${I[1]},${I[2]})`),R.addColorStop(1,`rgb(${M[0]},${M[1]},${M[2]})`),n.globalAlpha=.8,n.fillStyle=R,n.fillRect(y,x,v,k),n.globalAlpha=1;let A=n.createRadialGradient(ue/2,(x+w)/2,v*.12,ue/2,(x+w)/2,v*.6);A.addColorStop(0,"rgba(6,8,14,0)"),A.addColorStop(.7,"rgba(6,8,14,0.15)"),A.addColorStop(1,"rgba(5,6,11,0.9)"),n.fillStyle=A,n.fillRect(y,x,v,k),n.restore();let E=3,F=w-k*.08;for(let N=0;N<E;N++){let _=(N+1)/(E+1);_n(n,y+v*(.24+_*.52),F,k*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:ce(c+20,.5,.7),rimStrength:.7})}n.fillStyle="#05070d",n.fillRect(y-v*.5,C,v*.5,w-C),n.fillRect(S,C,v*.5,w-C);let H=v*.05+2,G=H*1.35;n.fillStyle="#03050a",n.beginPath(),n.moveTo(y,w),n.lineTo(y-H,w),n.lineTo(y-G,C),n.lineTo(y+v*.012,C),n.closePath(),n.fill(),n.beginPath(),n.moveTo(S,w),n.lineTo(S+H,w),n.lineTo(S+G,C),n.lineTo(S-v*.012,C),n.closePath(),n.fill(),n.fillRect(y-G,C,v+G*2,(w-C)*.13),n.fillStyle=`rgba(${u},0.12)`,n.fillRect(y-1.2,C,1.2,w-C),n.fillRect(S,C,1.2,w-C),n.fillStyle="#0b0f18",n.fillRect(y-H,w-k*.05,v+H*2,k*.05+2);let Q=n.createLinearGradient(0,w-k*.05,0,w+k*.14);Q.addColorStop(0,`rgba(255,206,140,${(.5*P).toFixed(3)})`),Q.addColorStop(1,"rgba(255,206,140,0)"),n.fillStyle=Q,n.fillRect(y-H,w-k*.05,v+H*2,k*.22);for(let N=0;N<3;N++){let _=(N+1)/4,W=y+v*_,re=jt(Math.min(it-1,p+20));Qi(n,W,re,W+(l()-.5)*v*.14,w,3,v*.09,u,.17*P),Bn(n,W,re,1.8,u)}n.fillStyle=`rgba(${u},0.75)`;for(let N=0;N<8;N++)n.beginPath(),n.arc((N+.5)/8*ue,jt(it-4-N%2*3),2.2,0,D),n.fill();n.fillStyle="rgba(10,13,20,0.9)",n.fillRect(0,wt-26,ue,26),n.fillStyle="rgba(30,37,54,0.9)";for(let N=0;N<9;N++){let _=N*(ue/9)+ue/18;n.beginPath(),n.ellipse(_,wt-22,ue/9*.4,15,0,Math.PI,0,!0),n.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var fh=new Set(["en"]),Ji=new Map;async function ig(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(Er(`i18n/${t}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-4YMC7FIZ.js"),i=e[t];return i?await i():null}async function yC(t,e){let i=qs(t,e);if(i==="en"||fh.has(i))return ht(i),i;if(!$s.includes(i))return ht("en"),"en";try{let o=Ji.get(i);o||(o=ig(i),Ji.set(i,o));let n=await o;return Ji.delete(i),n?(ht(i,n),fh.add(i),i):(ht("en"),"en")}catch{return Ji.delete(i),ht("en"),"en"}}export{sg as ACCESSIBILITY_RING_COLOR,Dn as ACCESSIBILITY_TYPES,qg as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,$g as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,pg as BOOTH_TYPES,ng as CHART_STORAGE_KEY,Bb as CURRENCY_CHOICES,_b as DEFAULT_CURRENCY,bg as DEFAULT_EVENT_INVENTORY_LIMIT,fL as EMPTY_AVAILABILITY_REFRESH,wg as EVENT_CONFIGURATION_EXPORT_SCHEMA,vg as EVENT_CONFIGURATION_SCHEMA,Kg as FLOOR_STACK_GAP_RATIO,Ug as FLOOR_STACK_MIN_SURFACE_PX,jg as GA_UNIT_LABEL_PREFIX,pL as HOLD_CLOCK_SKEW_MS,yo as LABEL_FADE_MS,hg as LABEL_STYLE_MAX_SIZE,dg as LABEL_STYLE_MIN_SIZE,yg as LARGE_VENUE_INVENTORY_MODULE,gb as LEGIBILITY_HYSTERESIS_PX,zb as LOCALE_NAMES,gg as MAX_EVENT_INVENTORY,Jg as MAX_GA_CAPACITY,ob as MAX_ONE_PARTY_GUESTS,ci as MIN_POINTER_TARGET_PX,nb as ONE_PARTY_LIMIT_MESSAGE,ah as PickerController,Fe as PickerSelectionError,fb as RENDERED_QUALITY_REPORT_VERSION,ug as ROW_AISLE_SEATS,lg as SEAT_COMMERCIAL_MARKS,lb as SEAT_TYPE_ICON_BODY,co as SEAT_TYPE_ICON_VIEWBOX,og as STAGE_LABEL_STYLE_MAX_SIZE,nu as SUPPORTED_LOCALES,fg as SURROUNDINGS_SHAPE_ROLES,xn as SeatmapRenderer,Rg as TABLE_SEAT_OFFSET,Mg as TIER_HEIGHT_M,$s as TRANSLATED_LOCALES,ir as UNGROUPED_ID,_d as accessNeedsFor,ab as accessibilityLabelKey,rg as accessibilityMeta,ag as accessibilityRingColor,ii as allObjects,sr as applyHidden,Lm as applyOrganizerSeatGlyph,Tn as asPickerSalesState,Dd as attachVisibilityCatchUp,Zg as automaticRoundTableRadius,Pg as canTransitionEventConfiguration,Lg as canonicalEventConfigurationJson,Un as chartBounds,vd as clearOrganizerSeatGlyph,Zn as combinedFloorZoneId,Mt as compactRowLabel,rr as computeSections,hb as computeSectionsPerFloor,yd as createRenderer,Fr as crossesThreshold,iu as currencyExponent,Db as currencySymbol,Sg as eventInventoryLimitFor,Hg as expandBooth,He as expandChart,_g as expandRow,Fg as expandRowSlots,Ng as expandTable,Og as expandTableSlots,Vg as floorObjects,Xg as floorStackPlacements,ti as floorsOf,$b as formatDate,Ob as formatMinor,$e as formatMoney,ou as fromMinorUnits,Pt as gaAreasOf,so as gaBoxBounds,ro as gaBoxMode,ib as gaInventorySegments,eb as gaUnitLabel,rb as gaUnitLabels,ao as gaUnitLabelsForModel,Ct as gaWheelchairPlaceCount,lo as gaWheelchairUnitLabels,pC as generateSeatPanorama,fC as generateSeatThumb,Kb as getLocale,sb as growJoinedGAInventory,pb as hiddenObjectIds,Rm as holdHasLapsed,gL as holdRecoveryShape,vo as hysteresisScale,Jn as initialFloorMode,Cg as inspectEventConfigurationCompatibility,mb as inspectRenderedQualityEvidence,Qg as isGaUnitLabel,Yb as isLocaleLoaded,Sd as isOrganizerGlyphPainted,ub as isSectionHidden,mg as layerOf,Qn as layoutCombinedFloorPlan,jn as layoutFloorStack,yC as loadLocale,Xb as localeDirection,Yg as mainFloorId,Ig as migrateLegacyEventConfigurations,Gg as objectCenter,Wg as owningSectionForObject,xg as parseEventConfigurationExport,kg as parseEventConfigurationVersion,Kn as pointInPolygon,J as pointInPolygonWithHoles,ei as polygonLabelPoint,Bd as reconcileAvailability,mL as refreshChangedSomething,So as renderedPx,Tg as resolveEventConfigurationRollback,qs as resolveLocale,Eg as rowInventoryCount,Ag as rowSeatPositions,cg as seatCommercialMeta,er as seatNoteRowModel,tr as seatTypeIconBody,cb as seatTypeIconSvg,rt as sectionEntrancesById,Jt as sectionGeometry,db as sectionIdentitiesById,or as sectionLabelsById,nr as sectionOwnersByObject,ht as setLocale,Us as setMoneyLocale,Ub as setStringOverrides,Od as shouldWaitForHoldExpiry,Yn as stackFloors,B as t,js as tCount,Dg as tableInventoryCount,Bg as tableSeatCountsBySide,zg as translateObject,Xn as usableHoles,tb as validGAInventorySegments,bb as zoomTowardPoint};
|