@seatlayer/core 0.106.1 → 0.106.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-C5GKFG36.js → chunk-45W3GKPP.js} +1 -1
- package/dist/{chunk-UGMXII72.js → chunk-6DZ2EVH2.js} +1 -1
- package/dist/{chunk-TAKLS47V.js → chunk-IFQFHR6Q.js} +1 -1
- package/dist/chunk-J33DNOMI.js +1 -0
- package/dist/{chunk-MLPJTJFE.js → chunk-N562FZPD.js} +1 -1
- package/dist/{chunk-3YNO3XCY.js → chunk-NXZ2GLII.js} +1 -1
- package/dist/{chunk-M4J7U2E2.js → chunk-QXJEN5LV.js} +1 -1
- package/dist/{chunk-V65VJE6F.js → chunk-RI4LNRP4.js} +1 -1
- package/dist/{chunk-FQTSVDD4.js → chunk-T7DQX3MB.js} +1 -1
- package/dist/chunk-WGRLTDLW.js +1 -0
- package/dist/{chunk-INCPWAWP.js → chunk-YGRBCSUI.js} +1 -1
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.js +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -1
- package/dist/view3d/index.cjs +44 -44
- package/dist/view3d/index.js +1 -1
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3DHQYZ47.js +0 -1
- package/dist/chunk-5R6I2XL7.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as gn,c as bn,e as Br,f as ui,h as Or,j as Dr,m as Nr}from"./chunk-INCPWAWP.js";import{a as vb,b as Jo,c as wb,d as er,e as tr,f as tt,g as kb,h as xb,i as Lb,j as ir,k as Cb,l as Tb,m as nr,o as Lr,r as rt}from"./chunk-V65VJE6F.js";import{a as Yb,b as si,c as $b}from"./chunk-WR6VXY5U.js";import{a as Gb,b as or,c as It,d as Pr,e as Rr,f as Mr,g as Er}from"./chunk-LWBTU56C.js";import{b as xr,e as pn,i as ci,k as _r}from"./chunk-FQTSVDD4.js";import{a as Ib,b as Pb,c as Rb,f as li}from"./chunk-TAKLS47V.js";import{a as ln,b as Wb,c as rr,d as Vb}from"./chunk-YPVYZYMH.js";import{b as ai,f as Sr,h as ot,i as vr,j as wr,l as kr}from"./chunk-4N5CHKHD.js";import{A as Fr,b as Pt,c as di,d as fn,e as Cr,f as Tr,g as mn,l as Ir,n as hi,z as Ar}from"./chunk-JXIX3PNI.js";import{b as Qo,c as jo,l as kt}from"./chunk-M4NGX5NM.js";import{A as yr,B as Ve,C as un,D as oi,E as X,F as he,G as ri,a as me,b as pr,c as He,e as ge,f as ti,g as ii,h as fr,i as Ct,j as Ge,k as We,l as H,n as mr,p as gr,q as br,s as be,t as ye,w as nt,x as Tt,y as ni}from"./chunk-MADX5HYP.js";import{b as Eg,c as No,d as Ag,e as Ho,f as Fg,g as _g,h as Bg,i as Og,j as Dg,k as Ng,l as Hg,m as Gg,n as Wg,o as Vg,p as zg}from"./chunk-R6BN4HDQ.js";import{a as Mb,b as Eb,c as Ab,d as Fb,e as _b,f as Bb,g as Ob,h as Db,i as on,j as rn,k as Nb,l as sn,m as xt,n as an,o as Hb,p as Lt,q as sr,r as zb,s as it,t as ar,u as lr,v as cr,w as Kb,x as Xb,y as Ub,z as dr}from"./chunk-MLPJTJFE.js";import{$a as jt,Ga as Uo,Ia as Yo,J as Go,Ka as rb,L as Wo,La as sb,Ma as ab,N as K,Na as lb,Oa as cb,Pa as db,Qa as hb,Ra as ub,Sa as pb,Ta as fb,Ua as Zt,Va as mb,Wa as $o,Xa as te,Ya as Qt,Za as gb,_a as bb,ab as yb,ba as Vo,bb as Jt,ca as zo,cb as Sb,d as Kg,da as Ko,db as qo,e as Xg,eb as De,f as Ug,fb as Zo,g as Yg,h as $g,i as qg,j as Zg,k as Qg,ka as Xo,l as jg,m as Jg,ma as nb,n as eb,o as tb,p as ib,ua as Ee,va as ob}from"./chunk-5R6I2XL7.js";import"./chunk-S3VH7IDA.js";import{d as Hr}from"./chunk-TGHNVDWA.js";import{C as O,c as cn,h as dn,m as hn,o as hr,t as D,u as ce,v as Ne,w as j,x as ei,z as ur}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var qb=1,yn=90;function Sn(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function Gr(t,e,i,n=1){if(!Number.isFinite(t))return i;let o=Math.max(0,n);return i?t>=e-o:t>=e+o}function vn(t,e,i,n=1){if(!Number.isFinite(t)||!(i>0))return t;let o=Math.max(0,n)/i;return e?t*(1+o):t*(1-o)}function Zb(t){let{point:e,camera:i,scale:n,nextScale:o}=t;if(!Number.isFinite(n)||n<=0||!Number.isFinite(o))return{...i};let r=(e.x-i.x)/n,s=(e.y-i.y)/n;return{x:e.x-r*o,y:e.y-s*o}}import{Konva as Xi}from"konva/lib/Core";import{Stage as Ym}from"konva/lib/Stage";import{Layer as Lo}from"konva/lib/Layer";import{Group as Ut}from"konva/lib/Group";import{Circle as kd}from"konva/lib/shapes/Circle";import{Group as Dn}from"konva/lib/Group";import{Circle as _e}from"konva/lib/shapes/Circle";import{Line as Gn}from"konva/lib/shapes/Line";import{Rect as Nn}from"konva/lib/shapes/Rect";import{Text as aa}from"konva/lib/shapes/Text";var J=9,Se=.9,Z=.55*Se,ie=H/me,st=4,ue=14,Wr=10;var Vr=14;var ve=.45*Se,we=.9*Se,se=(ve+we)/2,zr=Math.max(Se*1.1,we),ke=8,Kr=700,ee=2,Rt=H,wh=12,kh=12;function Xr(t){return t<Q?kh:wh}var pi=.85,Ur=H,Mt=64,ze=.55*ve,Yr=700,$r=120,qr=2500,Zr=420,Qr=420,jr=1,Ke=1,Jr=2,at=16,Ae=12,wn=[.85,.72,.62],xh=10,Lh=9;function fi(t){return t<Q?Lh:xh}var mi=13,gi=12,es=0,ts="700",is="600",ns=8,os=5,rs=10,ss=6,as=8,ls=.6,cs=.6,ds=.7,hs=[0,18,-18,36,-36,54,-54],Xe="600",us="500",Q=640,ps=Xe,fs="400",Fe=0,ms=14,gs=.34,bs=.92,ys=7,Ss=3;function bi(t){return Math.min(1,Math.max(Ae/at,t/900))}function lt(t,e){return Math.max(Ae,t*bi(e))}var Ch=.5,Th=1.15,vs=2,ws=3,ks=22,Ih=8,Ph=6;function Et(t){return t<Q?Ph:Ih}var kn=.08;function xn(t,e,i,n,o=Ch,r=Ae){let s=t*bi(e),a=Math.max(r*(1+kn),s*o),l=n>0&&i>n?i/n:1,c=Math.max(a,s*Th);return Math.min(c,a*l)}var xs=.1,At=1.02;var yi=1.25;function Ls(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var Rh="#e5e7eb",Mh="#c7cbd1",Eh="#6b7280",Ah=["#6b7280","#5b6470","#4b5563","#374151"],Fh=["#cbd5e1","#e2e8f0","#f8fafc"],_h="#d1d5db",Bh="#b8bdc4",Oh="#273142",Dh="#526078",Nh="#f1f5f9",Hh="#374151",Gh="#64748b",Wh="#111827",Cs="#6b7280",Ts="#374151";var Is="#4b5563",Ps=.4,Ce=.16,Rs="rgba(244,246,248,0.06)",Si=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Ms(t,e,i){let n=new Map;for(let s of t){let a=e(s);!a||i(a)||n.set(a,(n.get(a)??0)+1)}let o=null,r=0;for(let[s,a]of n)(a>r||a===r&&o!=null&&s<o)&&(o=s,r=a);return o}function ae(t){return D(t)?{sectionFill:Rh,sectionStroke:Mh,sectionInk:Eh,focalFill:_h,focalStroke:Bh}:{sectionFill:Oh,sectionStroke:Dh,sectionInk:Nh,focalFill:Hh,focalStroke:Gh}}function Ln(t,e){let i=t.sectionFill,n=D(i),o=n?ce(i,.6):ur(Ne(i,.2),.85);switch(e){case"closed":return n?ce(i,.4):Ne(i,.12);case"sold-out":return o;case"nearly-gone":return j(i,o,.4);default:return i}}var Es=.28,As=.42,Vh=.55,zh=.7;function Fs(t,e,i){let n=ae(t),o=Ln(n,e);if(!i||e==="sold-out"||e==="closed")return{fill:o,stroke:n.sectionStroke};let r=D(t);return{fill:j(o,i,r?As:Es),stroke:O(i,r?zh:Vh)}}var Kh=.03;function _s(t,e){let i=ae(t);return!["normal","nearly-gone","sold-out","closed"].map(o=>Ln(i,o).toLowerCase()).includes(e.trim().toLowerCase())&&Cn(t,e)}function Cn(t,e){let i=cn(e);if(!i)return!1;let n=ae(t),o=Math.max(Es,As)+Kh;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=cn(Ln(n,r));return s?Math.max(Math.abs(s[0]-i[0]),Math.abs(s[1]-i[1]),Math.abs(s[2]-i[2]))/255<=o:!1})}var Xh="#f8fafc",Uh="#f4f6fb",Yh="#111827",$h=.72;function Bs(t){let e=D(t),i=e?Xh:Wh,n=e?Yh:Uh,o=j(n,i,1-$h);return{plate:i,ink:n,subInk:hn(o,i)>=hr?o:n}}function Os(t,e,i,n){if(e)return e;let o=D(i)?Fh:Ah;for(let r of[i,...o])if(hn(r,t)>=n)return r;return he(t,e,i,n)}import{Shape as Zh}from"konva/lib/Shape";import{Circle as Qh}from"konva/lib/shapes/Circle";import{Rect as jh}from"konva/lib/shapes/Rect";var qh={M:2,L:2,Q:4,C:6,Z:0},Tn=new Map;function In(t){let e=Tn.get(t);if(e)return e;let i=ot(t);if(!i)return Tn.set(t,[]),[];let n=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<n.length;){let s=n[r++],a=qh[s];if(a===void 0||r+a>n.length)throw new Error(`Invalid path data for seat glyph "${t}".`);let l=n.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"?o.push({command:s,points:l}):s==="Q"?o.push({command:s,points:l}):s==="C"?o.push({command:s,points:l}):o.push({command:"Z",points:[]})}return Tn.set(t,o),o}function Ds(t,e,i,n=0,o=0){let r=In(e),s=Sr(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=vr(s,i);t.save(),t.translate(n,o),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 Ns(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var Ue=class extends Zh{_sceneFunc(e){let i=this.attrs.seatRadius||1,n=this.attrs.seatGlyph,o=In(n),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(!o.length||!s){Ns(e,i),e.fillStrokeShape(this);return}e.beginPath(),Ds(e,n,i),e.fillStrokeShape(this)}_hitFunc(e){Ns(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 Pn(t,e){return t==="circle"||!ot(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 Hs(t){let{x:e,y:i,radius:n}=t;return t.wheelchairBay?new jh({x:e,y:i,width:n*2,height:n*2,offsetX:n,offsetY:n,cornerRadius:2,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):Pn(t.glyph,{x:e,y:i,radius:n,detail:t.detail,fill:t.fill})??new Qh({x:e,y:i,radius:n,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Jh(t,e){return t*2*e>=16}function Gs(t,e,i,n){let o=Jh(e,i);if(o===n||!t.length)return o;for(let r of t)r.setAttr("seatGlyphDetail",o);return o}function vi(t){return t?.35:.3}function zs(t){if(t<=0||t>=1)return 1;let e=1.25-1;if(t<.45){let n=t/.45;return 1+e*(1-(1-n)**2)}let i=(t-.45)/(1-.45);return 1+e*Math.cos(i*Math.PI*1.5)*(1-i)**2}function Rn(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 Ks=700,eu=2400,Mn=12,Xs=30,Ws=1,tu=1.16,Vs=.5,iu=1;function En(t){return t*.61803398875%1}function Us(t,e){let n=((t/eu+e)%1+1)%1,o=(1-Math.cos(n*2*Math.PI))/2;return{scale:Ws+(tu-Ws)*o,opacity:Vs+(iu-Vs)*o}}var $s;function qs(t){$s=t}function nu(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var Ys=new Map;function ou(t,e){let i=t??$s,n=`${i??""}|${JSON.stringify(e)}`,o=Ys.get(n);return o||(o=new Intl.DateTimeFormat(i,e),Ys.set(n,o)),o}var ru={dateStyle:"medium",timeStyle:"short"};function Zs(t,e={}){let{locale:i,...n}=e,o=nu(t);if(!Number.isFinite(o))return"";let r=Object.keys(n).length?n:ru;return ou(i,r).format(o)}var py="USD";function fy(t,e){return t?.trim()||e?.trim()||"USD"}var my=["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"],Fn;function js(t){Fn=t}function gy(){return Fn??"en"}var Qs=new Map;function An(t,e,i,n){let o=n??Fn,r=`${o??""}|${t}|${e??"auto"}|${i??"auto"}`,s=Qs.get(r);return s||(s=new Intl.NumberFormat(o,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),Qs.set(r,s)),s}function Ye(t,e="USD",i,n){if(typeof i=="object"){let r=i;try{return An(e,r.minimumFractionDigits,r.maximumFractionDigits,r.locale).format(t)}catch(s){if(r.fallback)return r.fallback(t,e);throw s}}let o=i??(Number.isInteger(t)?0:void 0);return An(e,o,o,n).format(t)}var su={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 au(t="USD"){return su[t.toUpperCase()]??2}function lu(t,e="USD"){return t/10**au(e)}function by(t,e="USD",i){return Ye(lu(t,e),e,void 0,i)}function yy(t="USD"){return An(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Ft={"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":"You were away for a while. Refresh to see which seats are free now.","picker.idlePausedTitle":"Your session expired","picker.idleRefresh":"Show latest seats","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 cu=["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"],Ly={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"},Js=["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"],du=new Set(["ar","fa","he"]),_n={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"},Bn=new Map(cu.map(t=>[t.toLowerCase(),t]));function hu(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=Bn.get(e)??_n[e];if(i)return i;let n=e.split("-");if(n.length>=2){let o=`${n[0]}-${n[1]}`,r=Bn.get(o)??_n[o];if(r)return r}return Bn.get(n[0])??_n[n[0]]}var $e={en:Ft},wi={},pe="en";function ea(t,e){let i=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let n of[t,e,...i]){if(!n)continue;let o=hu(n);if(o)return o}return"en"}function Cy(){return pe}function Ty(t=pe){return du.has(t)?"rtl":"ltr"}function Iy(t){return!!$e[t]}var On=new Set;function Py(t){return On.add(t),()=>{On.delete(t)}}function ct(t,e){e&&($e[t]={...$e[t],...e}),pe=$e[t]?t:"en",js(pe),qs(pe),typeof document<"u"&&(document.documentElement.lang=pe);for(let i of On)i()}function Ry(t){wi=t}var ta=/\{(\w+)\}/g;function F(t,e){let i=wi[t]??$e[pe]?.[t]??Ft[t]??t;return e?i.replace(ta,(n,o)=>String(e[o]??`{${o}}`)):i}function ia(t,e,i){let n=new Intl.PluralRules(pe).select(e);return(wi[`${t}.${n}`]??$e[pe]?.[`${t}.${n}`]??Ft[`${t}.${n}`]??wi[`${t}.other`]??$e[pe]?.[`${t}.other`]??Ft[`${t}.other`]??t).replace(ta,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function My(t,e){return Zs(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:pe})}function oa(t,e,i,n=!1){let o=t.displayLabel?.trim()||t.label;return n?{title:o,detail:F("map.statusTaken"),sellable:!1}:e==="booked"?{title:o,detail:F("map.statusTaken"),sellable:!1}:e==="held"?{title:o,detail:F("map.statusHeld"),sellable:!1}:{title:o,detail:i()??"",sellable:!0}}var dt=32,na=70;function ra(t,e){let i=dt+6,n=t.y-na;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:n>=i?n:Math.min(t.y+na,e.height-i)}}var Hn=.8,mu=Math.hypot(.46,.36),gu=.26,bu=1.6,yu=2*(1-mu),da="#0b1220",la="#ffffff";function ca(t,e,i,n,o){let r=Math.min(Math.max(bu,i*gu),i*yu);return new Gn({x:t,y:e,points:[-i*.42,i*.02,-i*.1,i*.34,i*.46,-i*.36],stroke:n,strokeWidth:r,lineCap:"round",lineJoin:"round",...o?{shadowColor:da,shadowBlur:1.5,shadowOpacity:.55}:{},listening:!1})}function Su(t){if(!(t instanceof Ue)||t.getAttr("seatGlyphDetail")===!1)return null;let e=t.getAttr("seatGlyph");return e&&ot(e)?e:null}var vu=220,wu=.08,ki=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,i,n){let o=n.get(e);if(n.delete(e),!i){this.retire(o);return}o?.destroy();let r=this.host,s=r.seat(e);if(!s)return;let a=r.seatShape(e)?.fill(),l=X(typeof a=="string"?a:"",r.selectionColor(),Ve),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),u=d?null:Su(r.seatShape(e)),h=r.seatRadius(),m=new Dn({name:"selection-ring",x:s.x,y:s.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});m.setAttrs({seatId:e,ringColor:l});let f={name:"selection-halo",stroke:O(r.categoryColor(s.categoryKey),vi(D(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let p=h*1.2;m.add(new Nn({...f,width:d.width+p*2,height:d.height+p*2,offsetX:(d.width+p*2)/2,offsetY:(d.height+p*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else m.add(new _e({...f,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let g={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(m.add(new Nn({...g,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)m.add(new Nn({...g,stroke:oi(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:Hn}));else{let p=Math.max(0,d.width/2-14),b=-Math.max(0,d.height/2-14);m.add(new _e({x:p,y:b,radius:10,fill:l,listening:!1})),m.add(new Gn({x:p,y:b,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:D(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else if(u)this.addGlyphMark(m,u,h,c,g);else{let p=Math.max(1,h-1.25),b=Math.min(2.5,Math.max(1.8,h*.22));if(m.add(new _e({...g,radius:p,strokeWidth:b})),c)m.add(new _e({...g,stroke:oi(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:Hn}));else{let y=Math.max(0,p-b/2);m.add(ca(0,0,y,la,!0))}}n.set(e,m),this.host.overlayLayer.add(m)}addGlyphMark(e,i,n,o,r){let s=this.host,a=s.canvasBackground();if(o){e.add(new _e({...r,stroke:oi(a),radius:n+2,strokeWidth:Math.max(2,n*.2),opacity:Hn}));return}let l=X(a,s.selectionColor(),Ve),c=Pn(i,{x:0,y:0,radius:n,fill:l,detail:!0});if(!c)return;c.name("selection-body"),c.listening(!1),e.add(c);let d=wr(i,n);if(!d)return;let u=D(l)?da:la;e.add(ca(d.x,d.y,d.radius,u,!1))}resyncMarkers(e,i){if(e.size){for(let n of[...e.keys()])this.syncMarker(n,!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 n=performance.now(),o=r=>{if(i.isDestroyed()||!e.getLayer()){e.destroy();return}let s=Math.min(1,(r-n)/160);e.opacity(1-s),i.overlayLayer.batchDraw(),s<1?requestAnimationFrame(o):(e.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(o)}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 n=this.echoTimers.get(e);n&&clearTimeout(n),this.echoTimers.set(e,setTimeout(()=>{this.echoTimers.delete(e),!(i.isDestroyed()||i.reducedMotion())&&(typeof document<"u"&&document.hidden||this.emitPulse(e,!1))},Ks))}emitPulse(e,i){let n=this.host,o=n.seat(e);if(!o)return;let r=n.seatRadius();this.pulses.get(e)?.destroy();let s=new _e({name:"selection-pulse",x:o.x,y:o.y,radius:r,stroke:n.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Rn(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,s),this.pulseHome().add(s);let a=i&&!n.isCached()?n.seatShape(e):void 0,l=performance.now(),c=()=>{a?.scale({x:1,y:1}),s.destroy(),this.pulses.get(e)===s&&this.pulses.delete(e),n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw()},d=u=>{if(n.isDestroyed()){c();return}s.getLayer()||this.pulseHome().add(s);let h=u-l,m=Rn(h/420);if(s.radius(r*m.radiusScale),s.opacity(m.opacity),a){let f=zs(h/320);a.scale({x:f,y:f})}n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw(),h<420?requestAnimationFrame(d):c()};queueMicrotask(()=>{n.isDestroyed()||typeof requestAnimationFrame!="function"||requestAnimationFrame(d)})}nudge(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||i.isCached()||typeof document<"u"&&document.hidden)return;let n=i.seatShape(e);if(!n)return;let o=performance.now(),r=()=>{n.scale({x:1,y:1}),i.seatLayer.batchDraw()},s=a=>{if(i.isDestroyed()||i.isCached()||!n.getLayer()){r();return}let l=a-o,c=Math.min(1,l/vu),d=1+wu*Math.sin(Math.PI*c);n.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 Dn({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 n=i.nearestSeat(e,ue),o=n?i.seat(n):void 0;if(!o){this.hideLoupe();return}let r=oa(o,i.seatStatus(o.id),()=>i.priceLabel(o),i.seatClosed(o.id)),s=ra(e,{width:i.stage.width(),height:i.stage.height()}),a=1/(i.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=o.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(o.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(),n=X(i,ae(i).sectionInk),o=new Dn({name:"touch-loupe",listening:!1,visible:!1});o.add(new Gn({points:[-7,dt-4,0,dt+12,7,dt-4],closed:!0,fill:i,stroke:O(n,.25),strokeWidth:1,listening:!1})),o.add(new _e({radius:dt,fill:i,stroke:O(n,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new _e({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new aa({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1}),a=new aa({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:O(n,.72),listening:!1,perfectDrawEnabled:!1});return o.add(r),o.add(s),o.add(a),e.overlayLayer.add(o),o.moveToTop(),this.loupe={group:o,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 ku}from"konva/lib/Animation";var xu=1e3/Xs;function ha(t){return t.findOne(".selection-halo")??null}var xi=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 n=[],o=0;for(let[s,a]of this.markers){let l=ha(a);if(l){if(this.paintHalo(s,l),o>=Mn){l.scale({x:1,y:1}),l.opacity(1);continue}n.push({node:l,phase:En(o)}),o+=1}}let r=0;for(let s of this.beaconRings){if(r>=Mn){s.scale({x:1,y:1}),s.opacity(1);continue}n.push({node:s,phase:En(r)}),r+=1}if(this.targets=n,!n.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new ku(()=>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 n=this.host,o=vi(D(n.canvasBackground())),r=n.seatCategoryKey(e),s=n.isOwnedHold(e)?j(n.selectionColor(),n.canvasBackground(),.55):r?n.categoryColor(r):n.selectionColor();i.stroke(O(s,o))}rest(){let e=!1;for(let[i,n]of this.markers){let o=ha(n);o&&(this.paintHalo(i,o),o.scale({x:1,y:1}),o.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<xu)return!1;this.lastFrameAt=i;let n=i-this.startedAt;for(let o of this.targets){let{scale:r,opacity:s}=Us(n,o.phase);o.node.scale({x:r,y:r}),o.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 Lu}from"konva/lib/Group";import{Circle as Wn}from"konva/lib/shapes/Circle";import{Text as Cu}from"konva/lib/shapes/Text";var ua=28,Tu=12,Iu="800",Pu=44,pa=1.6,fa=1.95;function ma(t){if(t.rung==="seats")return[];let e=new Map,i=new Map,n=new Map(t.zones.map(o=>[o.id,o.name]));for(let o of t.sections){let r=t.ownedSeatIds(o);if(!r.length)continue;let s=t.rung==="zones"&&o.zone!=null&&n.has(o.zone),a=s?o.zone:o.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(o),l.toward=t.sectionCentre(o));continue}i.set(a,r.length),e.set(a,{id:a,kind:s?"zone":"section",name:s?n.get(o.zone):t.sectionName(o),count:r.length,seatId:r[0],anchor:t.sectionAnchor(o),toward:t.sectionCentre(o)})}return[...e.values()]}function Ru(t,e){return F("map.beaconAria",{seats:ia("picker.seatCount",t),name:e})}function Mu(t,e){let i=e*fa,n=t.toward.x-t.anchor.x,o=t.toward.y-t.anchor.y,r=Math.hypot(n,o);return r<1e-6?{x:t.anchor.x,y:t.anchor.y-i}:{x:t.anchor.x+n/r*i,y:t.anchor.y+o/r*i}}var Eu="selection-beacon-ring",Li=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),n=`${i.toFixed(4)}|${e.map(c=>`${c.id}:${c.count}:${c.seatId}`).join(",")}`;if(n===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=n,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let o=ua/2/i,r=Math.max(Pu,Math.ceil(2*(o*fa+o)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new Lu({listening:!1,name:"selection-beacons"});for(let c of e){let d=Mu(c,o);l.add(new Wn({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:o*pa,fill:O(s,.1),listening:!1,perfectDrawEnabled:!1}));let u=new Wn({name:Eu,x:c.anchor.x,y:c.anchor.y,radius:o*pa,stroke:O(s,.55),strokeWidth:Math.max(1,o*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(u),l.add(new Wn({name:"selection-beacon-disc",x:d.x,y:d.y,radius:o,fill:s,stroke:O(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let h=new Cu({x:d.x,y:d.y,text:String(c.count),fontSize:Tu/i,fontStyle:Iu,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],n=this.host.worldToScreen(this.centres[e]),o=i.offsetWidth||parseFloat(i.style.width)||ua;i.style.left=`${n.x-o/2}px`,i.style.top=`${n.y-o/2}px`}}buildButton(e,i,n){let o=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",Ru(e.count,e.name)),Object.assign(r.style,{position:"absolute",left:`${o.x-n/2}px`,top:`${o.y-n/2}px`,width:`${n}px`,height:`${n}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 _t(t,e,i){let n=t.width(),o=t.height(),r=1/0,s=1/0,a=-1/0,l=-1/0,c=n*2,d=o*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>n+c||h.y+h.height>o+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 Ci=8,Au=.02,ga=1,ba=.5;function ya(t,e,i,n,o){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=_t(t,e,o);if(!s)return 0;Vn(t,s,r);let a=Math.min((r.width-2*Ci)/s.width,(r.height-2*Ci)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>ba?a:Math.min(a,Fu(t.scaleX(),n));if(!(c>1+Au)&&!(l>ba)||!(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=_t(t,e,o);return h&&Vn(t,h,r),c}function zn(t,e,i,n){let o=i??{x:0,y:0,width:t.width(),height:t.height()},r=_t(t,e,n);return r?Vn(t,r,o):!1}function Fu(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(ga,e):ga)/i}function Vn(t,e,i){let n=i.x+i.width/2-(e.x+e.width/2),o=i.y+i.height/2-(e.y+e.height/2);return n===0&&o===0?!1:(t.position({x:t.x()+n,y:t.y()+o}),!0)}function qe(t){return`${t.x()},${t.y()},${t.scaleX()}`}import{Group as _u}from"konva/lib/Group";import{Circle as Sa}from"konva/lib/shapes/Circle";import{Line as Bu}from"konva/lib/shapes/Line";import{Text as Ou}from"konva/lib/shapes/Text";var Du=6;function Bt(t){return D(t)?"#0b1220":"#ffffff"}function va(t){let{points:e}=t;if(!e.length)return null;let i=t.categoryColor??"#6e7bff",n=0,o=0;for(let r of e)n+=r.x,o+=r.y;return{count:e.length,centroid:{x:n/e.length,y:o/e.length},fill:i,ink:Bt(i)}}var Ti=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 n=va({points:this.host.ownedPoints(i),categoryColor:null});if(n)return n.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 n=Math.max(this.host.stageScale(),1e-4),o=new _u({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=va({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(Du/2/n,1);for(let g of a)o.add(new Sa({name:"owned-seat-dot",x:g.x,y:g.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(g=>g.logicalId===s.logicalId).reduce((g,p)=>g+this.host.ownedPoints(p).length,0),u=this.host.labelAnchor(s),h=11/n,m={x:u.x,y:u.y-h*2.1};o.add(new Sa({name:"owned-section-badge",x:m.x,y:m.y,radius:h,fill:l.fill,stroke:O(l.ink,.35),strokeWidth:1/n,listening:!1,perfectDrawEnabled:!1})),o.add(new Bu({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 Ou({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});o.add(f),this.badges.push({id:s.logicalId,centre:m,radius:h*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};import{Text as Nu}from"konva/lib/shapes/Text";var Hu=4;function Ot(t){return D(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function Gu(t,e,i,n){let o=Math.max(0,Math.min(n,e/2,i/2));t.beginPath(),t.moveTo(o,0),t.arcTo(e,0,e,i,o),t.arcTo(e,i,0,i,o),t.arcTo(0,i,0,0,o),t.arcTo(0,0,e,0,o),t.closePath()}function wa(t,e){t.padding(Hu),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(n){let o=this.width(),r=this.height();n.save(),Gu(n,o,r,Math.min(r/2,8)),n.setAttr("fillStyle",e.plate),n.fill(),n.setAttr("strokeStyle",e.stroke),n.setAttr("lineWidth",1),n.stroke(),n.restore(),Nu.prototype._sceneFunc.call(this,n)})}function ka(t){return t?"seat":"section"}function xa(t){let e=new Set,i=0;for(let o of t.memberIds){let r=t.categoryKey(o);r&&t.categorySellable(r)&&e.add(r),t.seatSellable(o)&&(i+=1)}let n=[];for(let o of t.categoryOrder)e.has(o)&&n.push({key:o,name:t.categoryLabel(o)||o,price:t.categoryPrice(o),color:t.categoryColor(o)});return n.length?i?{mode:"section",title:t.name,fields:[],rows:n,notes:[],facts:[],note:null}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:F("map.soldOut")}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:F("picker.notForSale")}}function La(t){let e=t.place?.kind==="booth",i=e?"":Vu(t.label,t.sectionLabel,t.rowLabel),n=t.place?{caption:t.place.typeWord?.trim()||F(e?"picker.booth":"picker.table"),value:t.place.name}:null,o=[t.sectionLabel,t.rowLabel?F("picker.rowLabel",{label:t.rowLabel}):null,n?n.value:null,i?F("picker.seatLabel",{label:i}):null].filter(Boolean).join(" \xB7 ")||t.label,r=[t.sectionLabel?{caption:F("picker.section"),value:t.sectionLabel}:null,t.rowLabel?{caption:F("picker.row"),value:t.rowLabel}:null,n,i?{caption:F("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=or(t).map(c=>{let d=F(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:o,fields:r,rows:[s],notes:a,facts:l,...l.length&&t.head?{head:t.head}:{},note:l.length?null:Wu(t.status,t.closed)}}function Wu(t,e){return e||t==="not_for_sale"?F("picker.notForSale"):t==="booked"?F("map.statusTaken"):t==="held"?F("map.statusHeld"):null}function Vu(t,e,i){let n=t;for(let o of[e,i])!o||!n.startsWith(o)||n.length<=o.length||(n=n.slice(o.length).replace(/^[\s·\-/_]+/,""));return n}var zu=16,Ku=8;function Ca(t,e,i,n=zu){let o=Ku,r=t.x+n;r+e.width>i.width-o&&(r=t.x-n-e.width);let s=t.y+n;return s+e.height>i.height-o&&(s=t.y-n-e.height),{x:Math.max(o,Math.min(r,Math.max(o,i.width-o-e.width))),y:Math.max(o,Math.min(s,Math.max(o,i.height-o-e.height)))}}var Ta=16,Kn=14,Ia=10.5,Xu=14,Uu=12.5,Pa={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},Yu={warn:"#d8a425",premium:"#e8c15a"},$u=.1,qu=.06,Ra={minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",boxShadow:"0 6px 20px rgba(2,6,23,0.22)",lineHeight:"1.35"},Zu={minWidth:"",maxWidth:"",padding:"",overflow:"",borderRadius:"",boxShadow:"",lineHeight:"",background:"",backgroundColor:"",border:"",fontFamily:""},Ii=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.factsEl=null;this.roomEl=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,n,o){if(!e||!i){this.presented&&(this.presented=null,this.mount=null,this.presentedView=null,this.hide());return}e!==this.presented&&(this.presentedView=null),o!==void 0&&(this.presentedView=o),this.presented=e,this.mount=n,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.head?[e.head.title,e.head.sub,...e.facts.map(i=>`${i.caption} ${i.value}`)].filter(Boolean).join(" | "):[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 n=this.host.hostCardOpen?.()?null:this.resolve(i);if(!n){this.hide(),this.lastUpdateMs=performance.now()-e;return}let o=this.ensureRoot(),r=`${n.mode}|${n.title}|${n.note??""}|${this.host.canvasBackground()}|`+n.rows.map(l=>`${l.key}:${l.price??""}:${l.color}`).join(",")+`|${n.notes.map(l=>`${l.icon}:${l.title}:${l.note??""}`).join(",")}|${n.facts.map(l=>`${l.caption}=${l.value}`).join(",")}`+(n.head?`|${n.head.title}|${n.head.sub??""}|${n.head.tone??""}|${n.head.plate??""}`:"");r!==this.signature&&(this.signature=r,this.paint(n)),this.showView(this.presented?this.presentedView:null),this.model=n,o.style.display="block";let s=this.mount??this.host.container,a=Ca(i,{width:o.offsetWidth,height:o.offsetHeight},{width:s.clientWidth,height:s.clientHeight});o.style.left=`${a.x}px`,o.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 n=this.viewEl;if(!n){n=document.createElement("div"),n.setAttribute("data-seat-view",""),Object.assign(n.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)"}),n.appendChild(r),this.viewEl=n}(n.parentElement!==i||i.firstChild!==n)&&i.insertBefore(n,i.firstChild);let o=`url("${e.replace(/"/g,"%22")}")`;n.style.backgroundImage!==o&&(n.style.backgroundImage=o),n.style.display="block"}resolve(e){if(this.presented)return this.seatModel(this.presented);if(ka(this.host.seatsPickable())==="seat"){let a=this.host.hoveredSeatId()??this.host.nearestSeat(e);return a?this.seatModel(a):null}let i=this.host.sectionAt(e),n=i?this.host.sectionLabel(i):null;if(!i||n==null||this.host.sectionInteractive?.(i)===!1)return null;let o=this.host.sectionMembers(i),r=this.host.sectionCardHead?.(i,o)??null,s=xa({name:n||i,memberIds:o,categoryOrder:this.host.categoryOrder(),categoryKey:a=>this.host.seat(a)?.categoryKey??null,categoryLabel:a=>this.host.categoryLabel(a),categoryPrice:a=>this.host.categoryPrice(a),categoryColor:a=>this.host.categoryColor(a),categorySellable:a=>this.host.categorySellable(a),seatSellable:a=>this.host.seatSellable(a)});return r?{...s,head:r,facts:s.rows.map(a=>({caption:a.name,value:a.price??""}))}:s}seatModel(e){let i=this.host.seat(e);if(!i)return null;let n=this.host.seatStatus(e),o=this.host.seatFacts?.(e)??null;if((n!=="free"&&!this.host.seatOwnedHold?.(e)||this.host.seatClosed(e))&&!o?.length)return null;let s=this.host.seatSectionLabel(e),a=o?.length?this.host.seatCardHead?.(e)??null:null;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}:{},...this.isAisleSeat(e)?{aisle:!0}:{},...this.placeOf(i),...o?.length?{facts:o}:{},...a?{head:a}:{}})}placeOf(e){let i=this.host.chartDoc();if(!i)return{};if(this.placeDoc!==i){this.placeDoc=i,this.placeFacts.clear(),this.sectionEntrances=it(i);for(let r of Jt(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 n=this.placeFacts.get(e.rowId);if(!n)return{};let o=n.entrance??(e.sectionId?this.sectionEntrances.get(e.sectionId):void 0);return{place:{kind:n.kind,name:n.name,...n.typeWord?{typeWord:n.typeWord}:{}},...n.boothType?{boothType:n.boothType}:{},...o?{entrance:o}:{}}}isAisleSeat(e){let i=this.host.chartDoc();return i?(this.aisleDoc!==i&&(this.aisleDoc=i,this.aisleIds=li(i)),this.aisleIds.has(e)):!1}rowName(e,i){let n=this.host.chartDoc();if(!n)return null;if(this.rowNamesDoc!==n){this.rowNamesDoc=n,this.rowNames.clear();for(let r of n.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 o=this.rowNames.get(e.logicalRowId??e.rowId)??this.rowNames.get(e.rowId);return o?It(o,i??void 0)||o: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=Ot(this.host.canvasBackground()),n=document.createElement("div");n.className="sl-hover-card",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",left:"0",top:"0",display:"none",pointerEvents:"none",boxSizing:"border-box",...Ra,background:i.plate,border:`1px solid ${i.stroke}`,fontFamily:this.host.labelFont(),zIndex:"2"});let o=document.createElement("div");Object.assign(o.style,{fontSize:`${Ta}px`,fontWeight:"700",padding:"10px 15px 9px",textAlign:"center",color:X(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:`${Kn}px`,fontWeight:"600",padding:"0 15px 10px",textAlign:"center",opacity:"0.72",color:X(i.plate,"#0b1220")});let l=document.createElement("div");return Object.assign(l.style,{display:"none"}),n.append(o,r,s,l,a),e.appendChild(n),this.root=n,this.titleEl=o,this.rowsEl=r,this.notesEl=s,this.factsEl=l,this.noteEl=a,n}paint(e){let i=this.ensureRoot();if(e.head)return this.paintRoomCard(i,e,e.head);this.roomEl&&this.leaveRoomCard(i);let n=Ot(this.host.canvasBackground());i.style.background=n.plate,i.style.border=`1px solid ${n.stroke}`;let o=this.titleEl,r=this.rowsEl,s=this.notesEl,a=this.noteEl,l=X(n.plate,"#0b1220");if(o.replaceChildren(),o.style.color=l,o.style.paddingBottom=e.rows.length||e.note?"9px":"10px",e.fields.length){let c=e.fields[0]?.caption;o.style.display="flex",o.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 ${n.stroke}`:"none"});let m=document.createElement("div");m.textContent=u.caption,Object.assign(m.style,{fontSize:`${Ia}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:`${Ta}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),h.append(m,f),o.append(h)}}else o.style.display="block",o.style.padding="10px 15px 9px",o.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:`${Kn}px`,fontWeight:"700",background:c.color,color:un(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,n,l),this.paintFacts(this.factsEl,e,n,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=X(n.plate,"#0b1220")}paintRoomCard(e,i,n){e.classList.add("room"),Object.assign(e.style,Zu);for(let c of[this.titleEl,this.rowsEl,this.notesEl,this.factsEl,this.noteEl])c&&(c.style.display="none");let o=this.roomEl;o||(o=document.createElement("div"),e.appendChild(o),this.roomEl=o),o.style.display="block";let r=document.createElement("div");if(r.className="slhc-head",n.plate){let c=document.createElement("span");c.className="slhc-plate",c.innerHTML=n.plate,r.appendChild(c)}let s=document.createElement("div"),a=document.createElement("b");if(a.className="slhc-title",a.textContent=n.title,s.appendChild(a),n.sub){let c=document.createElement("span");c.className="slhc-sub",c.textContent=n.sub,n.tone&&(c.style.color=n.tone),s.appendChild(c)}r.appendChild(s);let l=i.facts.map(c=>{let d=document.createElement("div");d.className="slhc-row";let u=document.createElement("span");u.textContent=c.caption;let h=document.createElement("b");return h.textContent=c.value,d.append(u,h),d});o.replaceChildren(r,...l)}leaveRoomCard(e){e.classList.remove("room"),this.roomEl?.remove(),this.roomEl=null,this.rowsEl&&(this.rowsEl.style.display="flex"),Object.assign(e.style,{...Ra,fontFamily:this.host.labelFont()})}paintFacts(e,i,n,o){if(e.replaceChildren(),!i.facts.length){e.style.display="none";return}Object.assign(e.style,{display:"flex",borderTop:`1px solid ${n.stroke}`,color:o});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 ${n.stroke}`:"none"});let l=document.createElement("div");l.textContent=s.caption,Object.assign(l.style,{fontSize:`${Ia}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:`${Kn}px`,fontWeight:"700",whiteSpace:"nowrap"}),a.append(l,c),e.append(a)}}paintNotes(e,i,n,o){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=un(n.plate)==="#ffffff"?Pa.onDark:Pa.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:o,c=s.tone==="warn"||s.tone==="premium"?j(n.plate,Yu[s.tone],$u):j(n.plate,o,qu),d=document.createElement("div");Object.assign(d.style,{display:"flex",alignItems:"flex-start",gap:"9px",padding:"9px 15px",background:c,borderTop:r?`1px solid ${n.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=rr(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:`${Xu}px`,fontWeight:"750",color:s.tone==="access"?o:l}),h.appendChild(m),s.note){let f=document.createElement("div");f.textContent=s.note,Object.assign(f.style,{fontSize:`${Uu}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:o}),h.appendChild(f)}d.append(u,h),e.appendChild(d)}}};var Ma="#1f9d6b";function Qu(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 Ea(t,e){let i=e?new Set(e):null;Qu(i,t.seatHighlight())||(t.setSeatHighlightState(i),t.repaintSeats(),t.updateLabels(),t.draw())}function Aa(t,e){let i=t.labelLayers(),n={...i,...e};n.seatLabels===i.seatLabels&&n.rowLabels===i.rowLabels||(t.setLabelLayersState(n),t.updateLabels(),t.draw())}function Fa(t,e){e!==t.categoryColours()&&(t.setCategoryColoursState(e),t.repaintSectionsAndSeats(),t.updateLabels(),t.draw())}function U(t){let e=xr(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 ht(t,e,i,n){let o=n*Math.PI/180,r=Math.cos(o),s=Math.sin(o);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 ut(t,e,i,n,o,r){let s=n*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(!te(m,o,r))return!1}return!0}function _a(t,e,i){let n=U(t),o={x:n.x+n.width/2,y:n.y+n.height/2},r=te(o,t,e)?[o,i]:[i],s=[];for(let l=1;l<12;l+=1)for(let c=1;c<12;c+=1){let d={x:n.x+n.width*c/12,y:n.y+n.height*l/12};te(d,t,e)&&s.push(d)}let a=[t,...e];return[...r,...s.map(l=>({point:l,room:Go(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 Ba(t,e){let{stageScale:i,stageX:n,stageY:o}=t;return U(e.outline.map(r=>({x:r.x*i+n,y:r.y*i+o})))}function ju(t,e){let i=t.width*t.height;if(i<=0)return 0;let n=Math.max(0,Math.min(t.x+t.width,e.width)-Math.max(t.x,0)),o=Math.max(0,Math.min(t.y+t.height,e.height)-Math.max(t.y,0));return n*o/i}function Oa(t){let{current:e,viewport:i}=t,n=new Map;for(let a of t.sections){let l=ju(a.bounds,i)*a.members;l<=0||n.set(a.logicalId,(n.get(a.logicalId)??0)+l)}if(!n.size)return e;let o=null,r=0;for(let[a,l]of n)l>r&&(r=l,o=a);if(!o||o===e)return e;let s=e!=null?n.get(e)??0:0;return r>s*1.35?o:e}import{Text as ep}from"konva/lib/shapes/Text";function Ju(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 fe=class{constructor(){this.cells=new Map}insert(e){for(let i of this.keys(e)){let n=this.cells.get(i);n?n.push(e):this.cells.set(i,[e])}}collisionCount(e){let i=new Set,n=0;for(let o of this.keys(e))for(let r of this.cells.get(o)??[])i.has(r)||(i.add(r),Ju(e,r)&&n++);return n}keys(e){let i=Math.floor(e.x/Mt),n=Math.floor((e.x+Math.max(0,e.width))/Mt),o=Math.floor(e.y/Mt),r=Math.floor((e.y+Math.max(0,e.height))/Mt),s=[];for(let a=o;a<=r;a++)for(let l=i;l<=n;l++)s.push(`${l}:${a}`);return s}};var Xn=new WeakMap;function Ze(){if(typeof document>"u"||!("fonts"in document))return 0;let t=document.fonts;if(!t)return 0;let e=Xn.get(t);if(e)e.status!==t.status&&(e.generation+=1,e.status=t.status);else{e={generation:0,status:t.status},Xn.set(t,e);let i=()=>{let n=Xn.get(t);n&&(n.generation+=1,n.status=t.status)};t.addEventListener?.("loadingdone",i),t.addEventListener?.("loadingerror",i)}return e.generation}var Da=new WeakMap,Na=new WeakMap;function Ha(t){let e=new Map;return{get(i){let n=JSON.stringify([i.text,i.fontSize,i.rotation]),o=e.get(n);return o||(o=new ep({text:i.text,fontSize:i.fontSize,fontStyle:"700",fontFamily:t,rotation:i.rotation,listening:!1}),o.offsetX(o.width()/2),o.offsetY(o.height()/2),e.set(n,o)),o},destroy(){for(let i of e.values())i.destroy()}}}function tp(t){let e=t.labelFont(),i=Ze(),n=Na.get(t.rowLabelPlan);if(n?.font===e&&n.fontGeneration===i)return n.index;let o=new fe,r=Ha(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;o.insert({x:l.x-d,y:l.y-d,width:l.width+d*2,height:l.height+d*2})}return r.destroy(),Na.set(t.rowLabelPlan,{font:e,fontGeneration:i,index:o}),o}function ip(t){let e=tp(t),i=[...t.freeTextById.values()].map(({node:l})=>{let c=l.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});return{x:c.x-ee,y:c.y-ee,width:c.width+ee*2,height:c.height+ee*2}}).filter(l=>e.collisionCount(l)>0),n=JSON.stringify([t.labelFont(),Ze(),t.seatR,i]),o=Da.get(t.rowLabelPlan);if(o?.key===n&&o.seats===t.seatById)return o.boxes;let r=new fe;for(let l of i)r.insert(l);let s=Ha(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(),Da.set(t.rowLabelPlan,{key:n,seats:t.seatById,boxes:a}),a}function Ga(t,e){let i=t.sections.filter(f=>f.id===e||f.logicalId===e),n=i.map(f=>U(f.outline));if(!n.length)return null;let o=Math.min(...n.map(f=>f.x)),r=Math.min(...n.map(f=>f.y)),s=Math.max(...n.map(f=>f.x+f.width)),a=Math.max(...n.map(f=>f.y+f.height)),l=new Set(i.flatMap(f=>f.memberIds));for(let f of l){let g=t.seatById.get(f);g&&(o=Math.min(o,g.x-t.seatR),r=Math.min(r,g.y-t.seatR),s=Math.max(s,g.x+t.seatR),a=Math.max(a,g.y+t.seatR))}let c=f=>{[f.x,f.y,f.width,f.height].every(Number.isFinite)&&(o=Math.min(o,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 g={x:f.x+f.width/2,y:f.y+f.height/2};return i.some(p=>te(g,p.outline,p.holes))};for(let{node:f,backdrop:g}of t.freeTextById.values()){let p=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(p)&&(c(p),g&&c(g.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:f}of t.iconNodeById.values()){let g=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(g)&&c(g)}let u=ip(t);t.rowLabelPlan.forEach((f,g)=>{(f.focusKeys??[]).some(b=>b===e||i.some(y=>b===y.id||b===y.logicalId))&&c(u[g])});let h=Math.max(s-o,a-r),m=Math.max(t.seatR*2,Math.min(24,h*.025));return{x:o-m,y:r-m,width:Math.max(1,s-o+m*2),height:Math.max(1,a-r+m*2)}}import{Rect as np}from"konva/lib/shapes/Rect";import{Text as Wa}from"konva/lib/shapes/Text";var Un="\0";function op(t){let e=0;for(let i=0;i<t.length;i++){let n=t[i],o=t[(i+1)%t.length];e+=n.x*o.y-o.x*n.y}return Math.abs(e)/2}function rp(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 n=i.map(m=>({member:m,weight:Math.max(1,op(m.outline))})),o=n.reduce((m,f)=>m+f.weight,0),r=n.reduce((m,f)=>({x:m.x+f.member.centroid.x*f.weight/o,y:m.y+f.member.centroid.y*f.weight/o}),{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},g={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(g.x*-l.y+g.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 sp(t){let i=[...F("map.fromPrice",{price:Un}).toLocaleLowerCase()],n=i.findIndex(o=>o!==Un&&o.toLocaleUpperCase()!==o.toLocaleLowerCase());return n>=0&&(i[n]=i[n].toLocaleUpperCase()),i.join("").split(Un).join(t)}function ap(t,e){let i=n=>n.trim().replace(/\s+/g," ").toLocaleLowerCase();return i(t)===i(e)}function lp(t,e){let i=t.trim();return!i||/^\d{1,3}$/.test(i)?!1:!e.some(n=>ap(n.label,i))}function Va(t,e){if(!e.zones?.length||!t.sections.length)return;let i=Bs(t.canvasBackground),n=new Map;for(let o of t.sections)o.zone&&(n.get(o.zone)??n.set(o.zone,[]).get(o.zone)).push(o);for(let o of e.zones){let r=n.get(o.id);if(!r||!r.length||!t.derivedFloorGroups&&!lp(o.label,r))continue;let s=r[0];for(let p of r)p.centroid.y<s.centroid.y&&(s=p);t.derivedFloorGroups&&(s=rp(r,o.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 b of p.outline)b.x<c&&(c=b.x),b.x>d&&(d=b.x);let u=isFinite(c)&&d>c?d-c:0,h=1/0;for(let p of r)for(let b of p.memberIds){let y=t.seatById.get(b),S=y&&t.catPrice.get(y.categoryKey);typeof S=="number"&&S<h&&(h=S)}let m=new np({x:a,y:l,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:i.plate,stroke:O(o.color??s.outlineTint,ls),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(m);let f=new Wa({x:a,y:l,text:o.label,fontSize:mi,fontStyle:ts,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 g=null;isFinite(h)&&(g=new Wa({x:a,y:l,text:sp(Ye(h,t.currency)),fontSize:gi,fontStyle:is,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),g.offsetX(g.width()/2),t.bgLayer.add(g)),t.zones.push({id:o.id,anchor:{x:a,y:l},back:m,background:i.plate,name:o.label,spanWorld:u,label:f,sub:g})}}function za(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 n=t.doc,o=n&&tt(n)==="combined"&&!n.zones?.length?n.floors?.find(d=>Jo(d.id)===i.id):void 0;if(o)return t.enterFloor(o.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 cp=new Set,Ka=16,dp=5,Pi=class{constructor(e,i,n=8e3){this.chunks=e;this.host=i;this.warmSeats=n;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 n=this.host.sectionOf?[this.host.sectionOf(e)]:[...this.chunks.keys()];for(let o of n){let r=o===void 0?-1:this.chunks.get(o)?.findIndex(s=>s.id===e)??-1;if(r>=0){i={section:o,seat:this.chunks.get(o)[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=cp){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 n=0;for(let[r,s]of[...this.built].reverse()){if(this.wanted.has(r)||(n+=s,n<=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 o=[];for(let[r,s]of this.loose)i.has(r)||this.wanted.has(s.section)||(o.push(s.seat),this.loose.delete(r));o.length&&this.host.remove(o),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,n=()=>!i||this.host.now()-e<dp;for(;this.pinQueue.length&&n();){let o=[];for(let r of this.pinQueue.splice(0,Ka)){let s=this.locate(r);s&&!this.isResident(r)&&(o.push(s.seat),this.loose.set(r,s))}o.length&&this.host.build(o),i=!0}for(;this.queue.length&&n();){let o=this.queue[0],r=this.chunks.get(o);if(!r){this.queue.shift();continue}let s=this.built.get(o)??0,a=Math.min(s+Ka,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(o,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 n=i.slice(this.built.get(e)??0).filter(o=>!this.loose.has(o.id));n.length&&this.host.build(n),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 Xa(t,e,i,n=1e3){let o=new Set,r=s=>{for(let a of s){if(o.size>=n)return!1;a&&o.add(a)}return o.size<n};return r(t)&&r(e)&&r(i),o}import{Circle as vp}from"konva/lib/shapes/Circle";import{Line as wp}from"konva/lib/shapes/Line";import{Rect as kp}from"konva/lib/shapes/Rect";import{Text as xp}from"konva/lib/shapes/Text";function Te(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Ie(t,e){return Te(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var Ua=.35,Ya=.7,Qe="#0b1220",pt="#ffffff",$a="#0b1220",Yn="#232c40",qa="#8b93a7";function $n(t,e,i="normal"){let n=t?"bold":i;return e?`italic ${n}`.trim():n}var qn="#f7f8fb";import{Text as Qa}from"konva/lib/shapes/Text";var Za="500",hp=2.5;function up(t,e){return t>=ie||e&&t>=pi}function pp(t){return t.effectiveScale<pi?!1:t.focusActive||t.stageWidth<Q}function fp(t,e,i){return i&&e>=pi?Math.max(t,Ur/Math.max(e,1e-4)):t}function mp(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:n,effectiveScale:o}=t;if(!(i>n)||!(i>0))return e;let r=H/Math.max(o,1e-4),s=e*n/i;return Math.max(Math.min(st,r),s)}function Zn(t,e){let i=(e?1:3)*Math.min(1,t/J);return Math.max(1,t*2-i)}function ja(t){let e=new Map;for(let o of t){let r=e.get(o.rowId);r?r.push(o):e.set(o.rowId,[o])}let i=[];for(let o of e.values())if(!(o.length<2))for(let r=1;r<o.length;r+=1){let s=Math.hypot(o[r].x-o[r-1].x,o[r].y-o[r-1].y);s>0&&Number.isFinite(s)&&i.push(s)}if(!i.length)return 0;i.sort((o,r)=>o-r);let n=Math.floor(i.length/2);return i.length%2?i[n]:(i[n-1]+i[n])/2}function Ja(t,e){return e>0?Math.min(t,e/2):t}function el(t){return Ri(Qn(t))}function Qn(t){let e=Zn(t,!1),i=Zn(J,!1),n=e>0?i/e:1;return me/Math.max(1,n)}function Ri(t){return H/Math.max(t,1e-4)/vn(1,!1,H)}function tl(t){return Ri(t)*yi}function gp(t,e,i){let n=t.seatLabelContainer(e);i.getParent()!==n&&n.add(i)}function il(t){let e=t.exportMode?Math.max(t.effScale(),ie):t.effScale(),i=pp({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),n=t.exportMode?e:vn(e,t.labelsWereVisible(),H),o=t.labelLayers(),r=o.seatLabels&&up(n,i);t.onLabelVisibilityChange(r),t.setSeatLabelRungOpen(r);let s=f=>{let g=t.worldToScreen({x:f.x(),y:f.y()}),p=f.width()*e,b=f.height()*e;return g.x-p/2>=0&&g.y-b/2>=0&&g.x+p/2<=t.stage.width()&&g.y+b/2<=t.stage.height()};for(let[f,g]of t.boothLabelById){let p=t.circleById.get(f);g.visible(be(g.fontSize(),n)&&!!p?.isVisible()&&t.focusedSeatOpacity(f,p?.getAbsoluteOpacity()??1)>=.5&&s(g))}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 g=t.worldToScreen(f);if(g.x<-20||g.x>t.stage.width()+20||g.y<-20||g.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 b=t.statusById.get(f.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(f.id)&&(b==="booked"||b==="not_for_sale"||b==="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(p&&t.opts.organizerGlyph?.isPainted(p)){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}if(t.focusedSeatOpacity(f.id,p.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(f.id,"dimmed-or-unavailable");continue}let x=fp(me*t.seatLabelScale(f),e,i),w=ni(f.displayLabel??f.label),k=p?t.seatLabelInk(f,p):t.seatPreferredLabelInk(f),v=t.seatLabelPool.get(f.id);v?(v.position({x:f.x,y:f.y}),v.text(w),v.fontSize(x),v.fontFamily(t.labelFont()),v.fill(k),v.offset({x:0,y:0}),v.scale({x:1,y:1})):(v=new Qa({x:f.x,y:f.y,text:w,fontSize:x,fontStyle:Za,fontFamily:t.labelFont(),fill:k,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(f.id,v));let C=Zn(t.seatR,i);if(v.fontSize(mp({authoredFontSize:x,measuredWidth:v.width(),maxWidth:C,effectiveScale:e})),v.width()>C+.01){t.seatLabelDrops.set(f.id,"label-overflows-marker");continue}if(!be(v.fontSize(),e)){t.seatLabelDrops.set(f.id,"below-minimum-size");continue}if(v.offsetX(v.width()/2),v.offsetY(v.height()/2),gp(t,f.id,v),!s(v)){t.seatLabelDrops.set(f.id,"outside-viewport");continue}if(a.add(f.id),t.seatLabelById.set(f.id,v),++l>=Yr)break}for(let[f,g]of t.seatLabelPool)a.has(f)||(g.destroy(),t.seatLabelPool.delete(f));let c=new fe;for(let{node:f}of t.freeTextById.values()){if(!f.isVisible())continue;let g=f.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});c.insert({x:g.x-ee,y:g.y-ee,width:g.width+ee*2,height:g.height+ee*2})}let d=new fe,u=null,h=()=>{if(u)return u;u=new fe;for(let f of t.seatLabelById.values()){if(!f.isVisible())continue;let g=f.getClientRect({skipShadow:!0,skipStroke:!0});u.insert({x:g.x,y:g.y,width:g.width,height:g.height})}return u},m=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*hp;if(o.rowLabels)for(let f of bp(t.rowLabelPlan)){let g=t.rowLabelPlan[f],p=t.focusedSectionId!=null&&g.focusKeys?.includes(t.focusedSectionId),b=Math.max(e,1e-4),y=p?Math.max(g.fontSize,Rt/b):g.fontSize,S=Math.max(Math.min(y,Xr(t.stage.width())/b),p?Rt/b:0);if(!r&&(!p||!m)||!p&&!be(S,n))continue;let x=t.worldToScreen({x:g.x,y:g.y});if(x.x<-40||x.x>t.stage.width()+40||x.y<-40||x.y>t.stage.height()+40)continue;let w=new Qa({x:g.x,y:g.y,text:g.text,fontSize:S,fontStyle:Za,fontFamily:t.labelFont(),fill:g.ink,rotation:g.rotation,opacity:g.opacity,shadowColor:"#05070c",shadowBlur:g.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:g.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});g.pill&&wa(w,g.pill),w.offsetX(w.width()/2),w.offsetY(w.height()/2);let k=t.resolveAutomaticRowLabelPosition(w,g,c);w.position(k),w.setAttr("rowLabel",!0),g.rowKey&&w.setAttr("rowKey",g.rowKey),w.setAttr("focusKeys",g.focusKeys??[]),t.rowLabelGroup.add(w);let v=w.getClientRect({skipShadow:!0,skipStroke:!0}),C=6,P=v.x<C?C-v.x:v.x+v.width>t.stage.width()-C?t.stage.width()-C-v.x-v.width:0,T=v.y<C?C-v.y:v.y+v.height>t.stage.height()-C?t.stage.height()-C-v.y-v.height:0,L=k;if(P||T){let R=t.labelGroup.getAbsoluteTransform(),M=R.point(k);L=R.copy().invert().point({x:M.x+P,y:M.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(g.automaticAway&&c.collisionCount(I)>0){w.destroy();continue}c.insert(I),d.insert(I)}t.overlayLayer.batchDraw()}function bp(t){let e=o=>o.focusKeys?.length?o.focusKeys.join(" "):"",i=[],n=0;for(;n<t.length;){let o=e(t[n]),r=n;for(;r+1<t.length&&e(t[r+1])===o;)r++;if(o){i.push(n),r>n&&i.push(r);for(let s=n+1;s<r;s++)i.push(s)}else for(let s=n;s<=r;s++)i.push(s);n=r+1}return i}function jn(t){let e=Math.max(t,1e-4);return{kind:"marker",diameter:e*2,labelFontSize:Qn(e)}}function yp(t){let e=ft(t),i=Math.min(e.width,e.height);return{kind:"block",diameter:i>0?i:J*2,labelFontSize:ge({width:e.width,height:e.height,text:t.label})}}function ft(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,n=1/0,o=-1/0,r=-1/0;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(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 Number.isFinite(i)?{width:o-i,height:r-n}:{width:Math.abs(t.width),height:Math.abs(t.height)}}function nl(t,e){let i=jn(e.markerRadius),n=null;for(let o of t){let r=o.kind==="booth"?yp({...e.blockDims.get(o.rowId)??{width:J*2,height:J*2},label:o.displayLabel??o.label}):i;(!n||r.labelFontSize<n.labelFontSize||r.labelFontSize===n.labelFontSize&&r.diameter<n.diameter)&&(n=r)}return n??i}function Sp(t){return tl(t.labelFontSize)}function ol(t){return Ri(t.labelFontSize)}function Mi(t){let e=Math.max(t.diameter,1e-4);return Math.max(se,si/e)}function rl(t){return Math.max(Sp(t),Mi(t)*yi)}function sl(t){for(let e of t.seats){if(e.kind==="booth"){Lp(t,e);continue}let i=t.seatContainer(e.id),n=Hs({x:e.x,y:e.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:kr(e.glyph,t.catByKey.get(e.categoryKey)),wheelchairBay:e.wheelchairSpaceType==="no-seat"});if(n instanceof Ue&&t.glyphMarkers.push(n),n.setAttr("seatId",e.id),t.circleById.set(e.id,n),t.paintSeat(n,e.id),i.add(n),e.accessible){if(e.wheelchairSpaceType!=="no-seat"){let o=new vp({x:e.x,y:e.y,radius:t.seatR+1.5,stroke:Tt(e.accessibility,{colorblind:t.colorblind,canvasBackground:t.canvasBackground}),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.accessRingById.set(e.id,o),i.add(o)}if(nt(e.accessibility??[])){let o=t.buildAccessGlyph(e,typeof n.fill()=="string"?n.fill():"");t.accessGlyphById.set(e.id,o),i.add(o)}}}}function Lp(t,e){let i=t.seatContainer(e.id),n=t.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},o=e.x,r=e.y,s;if(n.points&&n.points.length>=3?(s=new wp({x:e.x,y:e.y,points:n.points.flatMap(c=>[c.x,c.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),o=e.x+n.points.reduce((c,d)=>c+d.x,0)/n.points.length,r=e.y+n.points.reduce((c,d)=>c+d.y,0)/n.points.length):s=new kp({x:e.x,y:e.y,width:n.width,height:n.height,offsetX:n.width/2,offsetY:n.height/2,rotation:n.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s.setAttr("seatId",e.id),t.circleById.set(e.id,s),i.add(s),n.nameHidden){t.paintSeat(s,e.id);return}let a=e.displayLabel??e.label,l=new xp({x:o,y:r,text:a,fontSize:n.nameSize??ge({...ft(n),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.boothLabelById.set(e.id,l),i.add(l),t.paintSeat(s,e.id)}function al(t,e,i,n){let o=null,r=1/0,s=t.stage.scaleX()||1;for(let a of t.seats){if(!n?.includeUnavailable&&!t.selection.has(a.id)&&!t.isSelectable(a.id))continue;let l=t.worldToScreen(a),c=t.seatR*s+i,d=Math.hypot(l.x-e.x,l.y-e.y);d<=c&&d<r&&(r=d,o=a.id)}return o}function ll(t){if(!t.objectFloor.size)return null;let e=t.stage.getPointerPosition();if(!e)return null;let i=t.screenToWorld(e),n=null,o=1/0;for(let r of t.seats){let s=r.x-i.x,a=r.y-i.y,l=s*s+a*a;l<o&&(o=l,n=r.rowId)}return n?t.objectFloor.get(n)??null:null}import{Circle as Yp}from"konva/lib/shapes/Circle";import{Group as Ml}from"konva/lib/Group";import{Rect as $p}from"konva/lib/shapes/Rect";import{Text as qp}from"konva/lib/shapes/Text";var Pe=1.12;function mt(t,e,i,n){if(e.width<=0||e.height<=0)return t.scaleX();let o=n??{x:0,y:0,width:t.width(),height:t.height()},r=Math.min(o.width/(e.width*Pe),o.height/(e.height*Pe));return K(r,i.min,i.max)}var Dt=.55;function Nt(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function Jn(t){let{stage:e,box:i,bounds:n,viewport:o,centreScreen:r}=t,s=t.ratio??At,a=e.scaleX(),l=mt(e,i,n,o)/Math.max(a,1e-4);if(l>=s||l<=1/s)return!1;let c=r.x-(o.x+o.width/2),d=r.y-(o.y+o.height/2);return Math.hypot(c,d)<=Math.min(o.width,o.height)*.02}function cl(t,e,i,n){let o=K(e,n.min,n.max),r=t.scaleX();if(o===r)return!1;let s=(i.x-t.x())/r,a=(i.y-t.y())/r;return t.scale({x:o,y:o}),t.position({x:i.x-s*o,y:i.y-a*o}),!0}function dl(t,e,i,n,o,r){let s=o??{x:0,y:0,width:t.width(),height:t.height()},a=Math.min(s.width/(e.width*Pe),s.height/(e.height*Pe)),l=n??i.min,c=K(Math.max(a,l),i.min,Math.max(l,Nt(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 hl(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function eo(t,e){let i=null;for(let n of t){let o=e.get(n)?.logicalId;if(!o||i!=null&&i!==o)return null;i=o}return i}function ul(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var Cp=11;function Tp(t){let e=lt(Cp,t),i=fi(t),n=[];for(let o=Math.round(e);o>=i;o-=1)n.push(o);return n.length?n:[i]}var Ip=4,Pp=2;function Rp(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 n=i[0];for(let o of i)o.length>=n.length&&(n=o);return n}return e.length<=4?e:null}function pl(t,e,i){let n=t.numberLabel,o=Rp(t.label);if(!o)return n.visible(!1),!1;n.text()!==o&&n.text(o),n.visible(!0),n.rotation(0);let r=Ip/e;for(let s of Tp(i)){n.fontSize(s/e),n.offsetX(n.width()/2),n.offsetY(n.height()/2);for(let a of[t.centroid,...t.labelAnchors])if(n.position(a),ut(a,n.width()+r,n.height()+r,0,t.outline,t.holes))return!0}return n.position(t.centroid),!1}function Mp(t,e,i){let n=i({x:t.x(),y:t.y()}),o=t.width()*e,r=t.height()*e;return{x:n.x-o/2,y:n.y-r/2,w:o,h:r}}function Ep(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 fl(t,e,i,n){let o=[];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;o.push({x:s.x-a/2,y:s.y-l/2,w:a,h:l})}if(o.length)for(let r of t){if(r.numberLabel.opacity()<=.05)continue;let s=Mp(r.numberLabel,i,n);for(let a of o)if(Ep(s,a,Pp)){r.numberLabel.opacity(0);break}}}function ml(t){let e=new Map;for(let i of t){if(i.numberLabel.opacity()<=.05)continue;let n=e.get(i.logicalId);n?n.push(i):e.set(i.logicalId,[i])}for(let i of e.values()){if(i.length<2)continue;let n=i[0];for(let o of i)o.labelArea>n.labelArea&&(n=o);for(let o of i)o!==n&&o.numberLabel.opacity(0)}}function Sl(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 n=j("#f4b740","#ef4444",i);e.outlinePoly.stroke(O(n,.72+i*.25)),e.outlinePoly.fill(O(n,.08+i*.13)),e.outlinePoly.strokeWidth(2+i*3.5),e.outlinePoly.shadowColor(n),e.outlinePoly.shadowBlur(4+i*12),e.outlinePoly.shadowOpacity(.25+i*.45)}function io(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function vl(t,e,i,n){if(!e)return 0;let o=0;for(let r of t){if(i(r)!=="free")continue;let s=n(r);s&&Te(s,e)&&(o+=1)}return o}function Ap(t,e){return io(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*xs?"nearly-gone":"normal"}function wl(t,e){let i=Ap(t,e),n=t.accessFilterActive&&t.sectionAccessibleFree(e)<=0,o=t.blockPaint?.({id:e.logicalId,label:e.label,free:e.free,total:e.total,state:i})??null;e.stateWord=o?.stateWord??null;let r=Fs(t.canvasBackground,i,n?null:o?o.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"?F("map.soldOut"):F("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function kl(t,e){return j(e,D(t)?"#ffffff":"#000000",gs)}function no(t,e,i=0){let n=ms-i;return!e||t.length<=n?t:`${t.slice(0,Math.max(1,n-1)).trimEnd()}\u2026`}function Fp(t,e){return xl(t,e)!=null}function xl(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function Ll(t,e,i){let n=no(t.label,e,i?i.length+1:0),o=t.stateWord?[`${n} \xB7 ${t.stateWord}`]:[];return i?[...o.map(r=>`${i} ${r}`),`${i} ${n}`,i]:[...o,n]}function _p(t,e,i){let n=Ll(t,e,i),o=(t.nameLabelBadgeOnly?n[1]:n[0])??n[0];t.nameLabel.text()!==o&&t.nameLabel.text(o),t.nameLabel.fontStyle(fs),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*Fe:0)}function Bp(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}var Op=.05;function Cl(t){if(!t.seatCount)return!1;let e=0;for(let n of t.sections)e+=n.memberIds.length;return(t.seatCount-Math.min(e,t.seatCount))/t.seatCount<=Op}function Tl(t,e){let i,n;t.reducedMotion?(i=e<=ve?1:0,n=e<=ze?1:0):(i=K((we-e)/(we-ve),0,1),n=K((ve-e)/(ve-ze),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,n=0);let o=!t.floorOverview&&!t.focusedSectionId&&e<Z;o&&(i=1),t.zones.length||(n=0),t.seatLayer.opacity(Cl(t)?o?0:1-i:1);let r=t.stageScaleX,s=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>kn);s&&t.setLodScale(e);let a=t.focusedSectionId,l=t.stageWidth<Q,c=l&&o&&t.zones.length===0,d=ae(t.canvasBackground),u=K((i-.2)/.8,0,1),h=new Set(t.zones.map(g=>g.id)),m=new Set;for(let g of t.sections){let p=t.hasFocusDimOverlay?1:a&&g.id!==a&&g.logicalId!==a&&g.zone!==a?Ce:1,b=xl(t,g);b&&g.zone&&m.add(g.zone);let y=Math.min(p,ul(g.memberCategoryKeys,t.categoryFilter)?Ce:1,t.accessFilterActive&&!b?Ce:1);g.outlinePoly.opacity(o?0:(1-i)*y),g.blockPoly.opacity(jr*i*y);let S=t.sectionIsOwned(g);g.blockPoly.stroke(S?t.selectionColor:g.shellStroke||d.sectionStroke),g.blockPoly.strokeWidth((S?Jr:Ke)/Math.max(r,1e-4));let x=g.blockPoly.fill(),w=typeof x=="string"?x:g.baseFill,k=Os(w,g.explicitInk,g.preferredInk,mr);g.nameLabel.fill(k),g.subLabel.fill(k),_p(g,l,b);let v=g.zone!=null&&h.has(g.zone);s&&(u>.01||g.externalLabel)&&Gp(t,g,r,Ll(g,l,b),!v);let C=b||!v?1:1-n;g.nameLabel.opacity(g.nameLabelFits?(g.externalLabel?1:u)*C*y:0),g.subLabel.opacity(0);let P=c&&!g.nameLabelFits,T=v&&n>.01;s&&(g.numberLabelFits=(T||P)&&pl(g,r,t.stageWidth)),g.numberLabelFits&&g.numberLabel.fill(he(w,g.explicitInk,g.preferredInk)),g.numberLabel.opacity(g.numberLabelFits?(P?u:T?n:0)*y:0)}let f=n;for(let g of t.zones){let p=t.accessFilterActive&&!m.has(g.id)?Ce:1,b=g.label.visible()?f*p:0;g.back.opacity(b),g.label.opacity(b),g.sub&&g.sub.opacity(gl(t,g)?0:b),s&&Wp(t,g,r)}if(!t.glideInProgress&&(u>.01||f>.01)){Np(t,r,c),Dp(t.sections);for(let g of t.zones){let p=g.label.opacity();g.back.opacity(p),g.sub&&g.sub.opacity(gl(t,g)?0:p)}}(f>.01||c)&&(f>.01&&fl(t.sections,t.zones,r,t.worldToScreen),ml(t.sections));for(let g of t.sections)Bp(g);t.bgLayer.batchDraw()}function gl(t,e){return t.stageWidth<Q||!e.sub||!e.sub.visible()}function Dp(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 n=i.filter(o=>o.nameLabel.opacity()>.05).sort((o,r)=>{let s=U(o.outline),a=U(r.outline);return a.width*a.height-s.width*s.height});for(let o of n.slice(1))o.nameLabel.opacity(0)}}function Np(t,e,i=!1){let o=[],r=c=>{let d=t.worldToScreen({x:c.x(),y:c.y()}),u=U(ht({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;o.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=Fp(t,c)?-1:1;o.push({node:c.nameLabel,tier:d,section:!0,area:c.labelArea,box:r(c.nameLabel)})}i&&c.numberLabel.opacity()>.05&&o.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(o.length<2&&!s.length)return;o.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 o){if(!l(c.box)){a.push(c.box);continue}let d=!1;if(c.zone)for(let u of hs){if(u===0)continue;let h={...c.box,y:c.box.y+u};if(!l(h)){to(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 wn){let g=u*f;if(g*e<Et(t.stageWidth))break;Re(c.node,g,h),m&&(c.node.letterSpacing(c.node.fontSize()*Fe),c.node.offsetX(c.node.width()/2));let p=r(c.node);if(!l(p)){a.push(p),d=!0;break}}d||(Re(c.node,u,h),m&&(c.node.letterSpacing(c.node.fontSize()*Fe),c.node.offsetX(c.node.width()/2)))}d||c.node.opacity(0)}}function Re(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}function Hp(t,e,i){let n=U(t);return ge({width:n.width*i,height:n.height*i,text:e})}function Gp(t,e,i,n,o=!1){e.subLabelFits=!1;let r=t.stageWidth<Q,s=Et(t.stageWidth),a=xn(at*e.labelScale,t.stageWidth,i,t.fitScale,void 0,s),c=o&&!e.authoredLabelSize&&!(t.fitScale>0&&i>t.fitScale)&&Cl(t)?Math.max(a,Hp(e.outline,n[0]??e.label,i)):a;if(e.externalLabel){e.nameLabel.text(n[0]),e.nameLabel.rotation(e.externalLabel.rotation),Re(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 n.entries()){e.nameLabel.text(m);let f=U(e.outline),g=e.authoredLabelRotation!=null?[e.authoredLabelRotation]:f.height>f.width*ws?[0,-90]:[0];for(let p of g)for(let b of e.labelAnchors)for(let y=c;y>=s;y-=1){e.nameLabel.rotation(p),Re(e.nameLabel,y/i,e.nameLabel.y()),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Fe),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(b);let S=vs/i;if(ut(b,e.nameLabel.width()+S,e.nameLabel.height()+S,p,e.outline,e.holes)){e.nameLabelFits=!0,e.nameLabelBadgeOnly=h>0;return}}}e.nameLabel.text(n[0]),e.nameLabelBadgeOnly=!1;let d=e.labelAnchors[0]??e.centroid;e.nameLabel.position(d),e.nameLabel.rotation(e.authoredLabelRotation??0),Re(e.nameLabel,s/i,d.y),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Fe),e.nameLabel.offsetX(e.nameLabel.width()/2));let u=U(e.outline);e.nameLabelFits=e.nameLabel.width()<=u.width&&e.nameLabel.height()<=u.height}function bl(t,e,i){let n=o=>(t.text(o),t.width());if(!(n(e)<=i)){for(let o=e.length-1;o>=1;o-=1)if(n(`${e.slice(0,o).trimEnd()}\u2026`)<=i)return;n("\u2026")}}function Wp(t,e,i){let n=bi(t.stageWidth),o=t.stageWidth<Q,r=e.sub!=null&&!o,s=(o?ns:rs)*n/i,a=(o?os:ss)*n/i,l=xn(mi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Re(e.label,l/i,e.anchor.y),r&&(Re(e.sub,lt(gi,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*es),e.sub.offsetX(e.sub.width()/2));let c=o?t.stageWidth*cs/i-s*2:1/0,d=!o&&e.spanWorld>0?e.spanWorld*ds-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 v of wn){let C=Math.max(Ae,l*v);if(C>=e.label.fontSize()*i-.001||(Re(e.label,C/i,e.anchor.y),e.label.width()<=u))break}if(e.label.width()>u&&(bl(e.label,e.name,Math.max(u,1)),Vp(e.label.text())<zp(e.name)&&bl(e.label,e.name,Math.max(c,1)),Re(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){yl(e);return}e.label.visible(!0),e.back.visible(!0);let m=r?3*n/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,g=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:g}),e.back.offset({x:f/2,y:g/2}),e.back.cornerRadius(as*n/i),e.back.strokeWidth(1/i);let p=e.back.getAbsolutePosition(),b=6,y=f*i;if(y>t.stageWidth-b*2){yl(e);return}let S=y/2,w=(K(p.x,b+S,t.stageWidth-b-S)-p.x)/i;Math.abs(w)>.001&&to(e,w,0);let k=62+g*i/2;p.y<k&&to(e,0,(k-p.y)/i)}function Vp(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function zp(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function yl(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 to(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 Kp(t,e){if(!t.length)return null;let i=1/0,n=1/0,o=-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<n&&(n=s.y),s.x>o&&(o=s.x),s.y>r&&(r=s.y));return!Number.isFinite(i)||!Number.isFinite(n)?null:{x:i-e,y:n-e,width:o-i+e*2,height:r-n+e*2}}function so(t,e=0){let i=new Map;for(let o of t){let r=`${o.rowId}|${o.categoryKey}`,s=i.get(r);s||(s={categoryKey:o.categoryKey,points:[]},i.set(r,s)),s.points.push({x:o.x,y:o.y})}let n=[];for(let[o,r]of i){let s=Kp(r.points,e);s&&n.push({id:o,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return n}function oo(t,e){let i=Math.max(0,Math.max(t.x-(e.x+e.width),e.x-(t.x+t.width))),n=Math.max(0,Math.max(t.y-(e.y+e.height),e.y-(t.y+t.height)));return Math.hypot(i,n)}function ro(t,e){let i=Math.min(t.x,e.x),n=Math.min(t.y,e.y);return{x:i,y:n,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-n}}function Il(t){if(!t.length)return 0;let e=[...t].sort((n,o)=>n-o),i=Math.floor(e.length/2);return e.length%2?e[i]:(e[i-1]+e[i])/2}function Xp(t){if(!t.length)return 0;let e=Il(t.map(n=>Math.min(n.bounds.width,n.bounds.height)));if(t.length<2)return e;let i=[];for(let n=0;n<t.length;n+=1){let o=1/0;for(let r=0;r<t.length;r+=1)n!==r&&(o=Math.min(o,oo(t[n].bounds,t[r].bounds)));Number.isFinite(o)&&i.push(o)}return Il(i)+e}function ao(t,e){if(!t.length)return[];let i=Xp(t)*(e?.gapRows??2),n=e?.minRows??2,o=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=>oo(f.bounds,h.bounds)<=i);m?(m.bounds=ro(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(!(oo(d[h].bounds,d[m].bounds)>i)){d[h].bounds=ro(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<n&&h.seatCount<o||(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 Pl(t){let e=null;for(let i of t)e=e?ro(e,i.bounds):{...i.bounds};return e}function Rl(t,e){let i=null,n=1/0;for(let o of t){let{x:r,y:s,width:a,height:l}=o.bounds;if(e.x<r||e.x>r+a||e.y<s||e.y>s+l)continue;let c=a*l;c<n&&(i=o,n=c)}return i}function Al(t){return t*.3}function El(t){return Al(t)*2+t*.42}var Ei=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=ao(so(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),n=ae(i),o=kl(i,i),r=X(o,n.sectionInk),s=new Ml({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 Ml({listening:!1}),u=new $p({...c,width:0,height:0,fill:o,stroke:n.sectionStroke,strokeWidth:Ke,opacity:bs,listening:!1,perfectDrawEnabled:!1}),h=new Yp({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),m=new qp({...c,text:l,fontSize:at,fontStyle:Xe,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,n=this.host.exportMode||this.host.seatsPickable()&&e<se||e>=this.host.readableScale();return this.revealed=n||Gr(Sn(i,e),Sn(i,se),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.hasSections()||this.host.seatsPickable())return!1;let i=this.host.screenToWorld(e),n=this.clusterAt(i);if(!n)return!1;let o=this.host.seatR()*2,r={x:n.bounds.x-o,y:n.bounds.y-o,width:n.bounds.width+o*2,height:n.bounds.height+o*2},s=this.host.stage;if(mt(s,r,this.host.zoomBounds(),this.host.framingViewport())<=s.scaleX()*At)return!1;let l=this.diveTarget(r,null,i);return l?(this.host.focusRegion(l,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,i,n){let o=this.host.stage,r=this.host.framingViewport(),s=this.host.zoomBounds(),a=mt(o,e,s,r),l=Math.min(Math.max(this.host.readableScale(),this.host.pickableScale()),s.max);if(a>=l)return e;let c=r.width/(l*Pe),d=r.height/(l*Pe);if(!(c>0)||!(d>0))return null;let u=i??{x:e.x+e.width/2,y:e.y+e.height/2},h={x:u.x-c/2,y:u.y-d/2,width:c,height:d};return n?Qp(h,n):h}glideTowardTap(e){let i=this.host.stage.scaleX(),n=Ls(i,this.host.pickableScale());if(n==null||n<=i*At)return!1;let o=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(n*Pe),a=r.height/(n*Pe);return!(s>0)||!(a>0)?!1:(this.host.focusRegion({x:o.x-s/2,y:o.y-a/2,width:s,height:a}),!0)}setPressLandsOnChart(e){this.pressOnChart=e}syncCursor(e){if(this.host.exportMode)return;let i=this.host.seatsPickable()?e?"pointer":"default":this.pressOnChart?"zoom-in":"default";for(let n of[this.host.stage.container(),this.host.stage.content])n&&n.style.cursor!==i&&(n.style.cursor=i)}clusterAt(e){let i=Rl(this.all,e);if(i)return i;if(!this.visible)return null;for(let n of this.labels){if(!n.pill.visible())continue;let o=n.plate.width()/2,r=n.plate.height()/2;if(Math.abs(e.x-n.text.x())<=o&&Math.abs(e.y-n.text.y())<=r)return n.cluster}return null}size(e,i){let n=Math.max(e,1e-4),o=i<Q,r=`${n.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=lt(at,i),a=ys/n,l=Ss/n;for(let c of this.labels){let{text:d,plate:u,swatch:h,cluster:m}=c;d.text(no(c.label,o)),d.fontStyle(o?ps:Xe);let f=s,g=0;for(;d.fontSize(Math.max(1,f/n)),d.letterSpacing(d.fontSize()*Fe),g=El(d.fontSize())+d.width()+a*2,!(g<=m.bounds.width||f<=Ae);)f=Math.max(Ae,f-1);let p={x:m.bounds.x+m.bounds.width/2,y:m.bounds.y+m.bounds.height/2},b=d.height()+l*2,y=g-a*2,S=p.x-y/2;h.radius(Al(d.fontSize())),h.position({x:S+h.radius(),y:p.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:S+El(d.fontSize()),y:p.y}),u.size({width:g,height:b}),u.offset({x:g/2,y:b/2}),u.cornerRadius(b/2),u.strokeWidth(Ke/n),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},n=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=n.get(r.cluster.categoryKey);(!l||a<l.distance||a===l.distance&&r.cluster.seatCount>l.entry.cluster.seatCount)&&n.set(r.cluster.categoryKey,{entry:r,distance:a})}let o=!1;for(let r of this.labels){let s=n.get(r.cluster.categoryKey)?.entry===r;r.pill.visible()!==s&&(r.pill.visible(s),o=!0)}o&&this.host.labelLayer.batchDraw()}viewportWorldRect(){let e=this.host.framingViewport(),i=this.host.screenToWorld({x:e.x,y:e.y}),n=this.host.screenToWorld({x:e.x+e.width,y:e.y+e.height});return{x:i.x,y:i.y,width:n.x-i.x,height:n.y-i.y}}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),i=!1;for(let n of this.labels){let o=e&&!e.has(n.cluster.categoryKey)?.22:1;n.pill.opacity()!==o&&(n.pill.opacity(o),i=!0)}i&&this.host.labelLayer.batchDraw()}boundsForSeats(e,i){if(!e.length)return null;let n=so(e,this.host.seatR()),o=ao(n);o.length||(o=n.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=Pl(o);if(!r)return null;let s=o.reduce((a,l)=>l.seatCount>a.seatCount?l:a,o[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:o.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 n=i.opacity(),o=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(n+(o-n)*l),l>=1&&i.visible(o>0),this.host.labelLayer.batchDraw(),this.fadeRaf=l<1?requestAnimationFrame(s):0};this.fadeRaf=requestAnimationFrame(s)}},Zp=.18;function Qp(t,e){let i=(n,o,r)=>{let s=o*Zp;return r<n+s?r-s:r>n+o-s?r+s-o:n};return{...t,x:i(t.x,t.width,e.x),y:i(t.y,t.height,e.y)}}import{Circle as jp}from"konva/lib/shapes/Circle";import{Line as Jp}from"konva/lib/shapes/Line";function Fl(t,e,i){let n=t.seatRadius(),o=new jp({x:e.x,y:e.y,radius:n,stroke:i,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.overlayLayer.add(o);let r=performance.now(),s=620,a=l=>{if(!o.getLayer())return;let c=Math.max(0,Math.min(1,(l-r)/s));o.radius(n*(1+c*1.8)),o.opacity(.9*(1-c)),t.overlayLayer.batchDraw(),c<1?requestAnimationFrame(a):(o.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(a)}function _l(t,e,i){for(let n of e){let o=n.outline,r=o.reduce((u,h)=>({x:u.x+h.x,y:u.y+h.y}),{x:0,y:0});r.x/=o.length,r.y/=o.length;let s=new Jp({x:r.x,y:r.y,points:o.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 sf}from"konva/lib/Group";import{Shape as af}from"konva/lib/Shape";import{Group as ef}from"konva/lib/Group";import{Shape as tf}from"konva/lib/Shape";function nf(t,e,i){let n=e.length,o={x:(e[n-1].x+e[0].x)/2,y:(e[n-1].y+e[0].y)/2};t.moveTo(o.x,o.y);for(let r=0;r<n;r+=1){let s=e[r],a=e[(r+1)%n],l=e[(r-1+n)%n],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 of(t,e){let i=1/0,n=1/0,o=-1/0,r=-1/0,s=(a,l)=>{!Number.isFinite(a)||!Number.isFinite(l)||(a<i&&(i=a),l<n&&(n=l),a>o&&(o=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 rf(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!(o>=i)||!(r>=n)?{x:0,y:0,width:0,height:0}:{x:i,y:n,width:o-i,height:r-n}}function rf(t,e){let{center:i,radius:n}=t;if(!(n>0))return[];let o=Math.PI*2,r=d=>(d%o+o)%o,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)||o,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+n*Math.cos(u),y:i.y+n*Math.sin(u)})}return c}function Be(t,e,i,n){let o=pn(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0,s=new tf({...i,sceneFunc(l,c){l.beginPath();let d=h=>{if(h.length){if(r>0&&h.length>=3)return nf(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()}};n?(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()})(n):d(t);for(let h of $o(e)){let m=pn(h)>0;d(m===o?[...h].reverse():h)}l.fillStrokeShape(c)},perfectDrawEnabled:!1}),a=of(t,n);return s.getSelfRect=()=>({...a}),s}var gt=class extends ef{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 Bl(t,e){if(!e.length)return null;let i=new sf({listening:!1});for(let n of e)i.add(Be(n.outline,n.holes,{fill:Rs,stroke:O("#ffffff",.1),strokeWidth:1,listening:!1},n.outlinePath));return t.bgLayer.add(i),i.moveToTop(),i}function Ol(t,e){let{bounds:i}=t,o=Math.max(i.width,i.height,1)*4+1e3,r=[{x:i.x-o,y:i.y-o},{x:i.x+i.width+o,y:i.y-o},{x:i.x+i.width+o,y:i.y+i.height+o},{x:i.x-o,y:i.y+i.height+o}],s=new af({fill:t.canvasBackground,opacity:1-Ce,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)d.push(u.outline);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 lf=.2;function Dl(t,e){return t.startsWith("#")?j(e,t,lf):t}var Vl=.5,$=Math.SQRT1_2,cf="#f3f4f6",Nl=4;function df(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?Vl:Math.min(1,Math.max(0,e))}function hf(t){return t==="booked"||t==="not_for_sale"?Ts:Cs}function Hl(t,e){return Number.parseInt(t.slice(e,e+2),16)}function Gl(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,n,o]=e.toLowerCase();return`#${i}${i}${n}${n}${o}${o}`}function uf(t,e,i){let n=Gl(t),o=Gl(e);if(!n||!o)return t;let r=Math.min(1,Math.max(0,i)),s="#";for(let a=1;a<7;a+=2){let l=Math.round(Hl(n,a)*(1-r)+Hl(o,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function Wl(t,e,i,n){let o=i*4,r=e*$,s=-e*$,a=n*$*2*o,l=n*-$*2*o,c=r+o*$,d=s+o*$,u=r-o*$,h=s-o*$;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 pf(t,e){let i=e*4,n=Math.max(e*.45,1);t.beginPath();for(let o=-Nl;o<=Nl;o++){let r=o*n*2,s=r+n,a=r*$,l=-r*$,c=s*$,d=-s*$;t.moveTo(a+i*$,l+i*$),t.lineTo(a-i*$,l-i*$),t.lineTo(c-i*$,d-i*$),t.lineTo(c+i*$,d+i*$),t.closePath()}t.clip()}function Ai(t,e){t._sceneFunc(e)}function zl(t){let e=this,i=e.attrs,n=i.markRadius||1,o=i.fill,r=e.getStage(),s=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(n*2*s<16){i.fill=i.markMidtone??o,Ai(e,t),i.fill=o;return}let l=(1-2*(i.markFraction??Vl))*n;t.save(),Wl(t,l,n,1),i.fill=i.markBase??o,Ai(e,t),t.restore(),t.save(),Wl(t,l,n,-1),i.fill=i.markFill??o,Ai(e,t),i.markHatch&&(pf(t,n),i.fill=cf,Ai(e,t)),t.restore(),i.fill=o}function ff(t,e,i,n,o,r){let s=df(e),a=hf(i),l=t.attrs;l.markFraction=s,l.markBase=n,l.markFill=a,l.markMidtone=uf(n,a,1-s),l.markHatch=r,l.markRadius=o>0?o:1,t.fill(l.markMidtone),t.stroke(""),t.strokeWidth(0),t.dash([]),t.opacity(1),t.sceneFunc(zl)}function mf(t){t.setAttr("sceneFunc",void 0)}function _i(t){return t.attrs.sceneFunc===zl}var Fi=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 n=new Set;for(let[o,r]of Object.entries(e))i.has(o)&&(r&&r.kind==="partial"?(this.marks.set(o,r),n.add(o)):this.marks.delete(o)&&n.add(o));return n}paint(e,i,n,o,r,s,a){let l=a?void 0:this.marks.get(i);if(!l){_i(e)&&mf(e);return}ff(e,l,n,o,r,s)}};var Kl="#9ca3af";var gf="#f4b740",bf="#854d0e",yf="#1a1200",Sf="#f1f4f9",vf="#1a2234",wf="#475569",kf="#c3cbdc";function xf(t){return t==="held"||t==="booked"||t==="not_for_sale"}function Xl(t,e=!1,i=!1){if(!xf(t))return null;if(e){if(t==="not_for_sale"){let n=i?kf:wf;return{fill:i?vf:Sf,stroke:n,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"cross",glyphInk:n}}return t==="booked"?{fill:Kl,stroke:"",strokeWidth:0,dash:[],opacity:.75,scale:1}:{fill:gf,stroke:bf,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"clock",glyphInk:yf}}return{fill:Kl,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}}function Ul(t){let{focusedId:e}=t;if(!e)return null;let i=new Set([e]),n=t.sectionOf(e);if(n!=null){for(let c of t.seats){let d=t.seatId(c);t.sectionOf(d)===n&&i.add(d)}return i}let o=t.seats.find(c=>t.seatId(c)===e);if(!o)return i;let r=t.seatPoint(o),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 Yl(t,e,i){let n=i(t);return n!=null&&n===i(e)}var Bi=Object.freeze([]),Lf=.18;function $l(t,e,i){let n=t.seat(i),o=t.seatStatus(i),r=t.isSelected(i),s=t.categoryColor(n.categoryKey),a=t.boothLabel(i),l=t.canvasBackground(),c=t.selectionColor();e.dash(Bi),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let d=o==="held"&&t.isOwnedHold(i),u=t.organizer?.()??!1,h=d?null:Xl(o,u,u&&!D(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(ce(s,c===pt?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===pt?ce(s,.28):s),t.seatMarks.paint(e,i,o,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),_i(e)&&e.scale({x:1,y:1}),n.wheelchairSpaceType==="no-seat"&&o==="free"&&(e.stroke(Tt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),e.strokeWidth(r?3:2),e.dash([3,2])),a){a.text(h?"":n.displayLabel??n.label);let T=t.boothExtent(n.rowId);a.fontSize(T?.nameSize??(T?ge({...T,text:n.displayLabel??n.label}):He)),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??Qe),a.offsetX(a.width()/2),a.offsetY(a.height()/2)}let m=o==="free"||o==="held"&&!t.isOwnedHold(i),f=()=>{let T=e.fill();typeof T=="string"&&e.fill(Dl(T,l))},g=t.accessFilter();if(g&&m&&!r){let T=Ie(n,g);T==="other"?(f(),e.opacity(Math.min(e.opacity(),Ua))):T==="companion"&&e.opacity(Math.min(e.opacity(),Ya))}let p=t.categoryHighlight();p&&o==="free"&&!r&&n.categoryKey!==p&&e.opacity(.25);let b=t.seatHighlight();b&&!r&&!b.has(i)&&e.opacity(Math.min(e.opacity(),Lf));let y=t.categoryFilter();y&&m&&!r&&!y.has(n.categoryKey)&&(f(),e.opacity(.22)),t.commercialLimitedFilter()&&o==="free"&&!r&&(n.commercial?.restrictedView||n.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(sr))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(Is),e.stroke(""),e.strokeWidth(0),e.dash(Bi),e.opacity(Ps),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(n,e));let T=!a&&(r||d);x.visible(be(x.fontSize(),t.effScale())&&e.opacity()>=.5&&!T)}let w=t.organizerGlyph,k=h?.glyph??null,v=_i(e)||t.closedSections().size>0&&t.seatInClosedSection(i);if(w&&k&&!v){let T=a?t.boothExtent(n.rowId):void 0,L=T?Math.min(T.width,T.height)/2:t.seatRadius();w.apply(e,k,h.glyphInk??"",L),a||x?.visible(!1)}else w?.isPainted(e)&&w.clear(e);let C=t.accessGlyph(i);if(C){let T=e.fill();C.fill(ri(typeof T=="string"?T:"")),C.opacity(e.opacity()),C.visible(t.accessGlyphShouldShow(i))}let P=t.accessRing(i);P&&(P.stroke(Tt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),P.opacity(e.opacity()),P.visible(t.accessRingShouldShow(i)))}function Oi(t,e){let i=null,n=1/0;for(let[o,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<n&&(n=m,i=o)}return i}function Di(t){return t?.getAttr?.("seatId")??void 0}var Ni=.85,Cf=.38,Tf=Object.freeze([3,3]);function If(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function ql(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function Pf(t){let e=null,i=0,n=()=>{i=0,!(!e||t.destroyed?.())&&(Ht(t)||(t.clusterLabels.setPressLandsOnChart(!ql(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return o=>{e=o,i||(i=requestAnimationFrame(n))}}var Rf=Object.freeze([2,2]);function Mf(t){let e=null,i=0,n=!1,o=null,r=()=>{o&&(o=null,t.hoverRing.visible(!1),t.overlayLayer.batchDraw())},s=()=>{if(i=0,!e||n||t.destroyed?.())return;if(!t.manageSeatHits()||t.cached()){r();return}let a=t.nearestSeatToScreen(e,ue),l=a?t.seat(a):void 0;if(!a||!l){r();return}a!==o&&(o=a,t.hoverRing.position(l),t.hoverRing.opacity(Ni),t.hoverRing.dash(Rf),t.hoverRing.visible(!0),t.overlayLayer.batchDraw())};return{move(a){e=a,i||(i=requestAnimationFrame(s))},hide(){e=null,r()},onSeat(a){n=a,a&&(o=null)}}}var Ht=t=>t.seatsPickable()||t.manageSeatHits();function Zl(t){t.attachHoverCard();let e=Pf(t),i=Mf(t);t.seatLayer.on("click tap",n=>{if(t.moved()>ke||t.isGhostClick(n))return;let o=Di(n.target);o&&Ht(t)&&t.handleSeatTap(o)}),t.seatLayer.on("mouseover",n=>{let o=Di(n.target);if(!o)return;let r=t.seat(o);if(!r)return;i.onSeat(!0),t.setHoveredId(o);let s=Ef(t,o);t.hoverRing.position(r),t.hoverRing.opacity(s==="muted"?Cf:Ni),t.hoverRing.dash(s==="muted"?Tf:Bi),t.hoverRing.visible(s!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(s==="full"),t.onHover?.(r,{mark:t.seatMark(o),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{i.onSeat(!1),t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let n=t.stage.getPointerPosition();n&&(e(n),i.move(n))}),t.stage.on("mouseleave",()=>i.hide()),t.stage.on("wheel",n=>{n.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let o=t.container.getBoundingClientRect(),r={x:n.evt.clientX-o.left,y:n.evt.clientY-o.top},s=Math.exp(-n.evt.deltaY*.002);t.zoomAbout(t.stage.scaleX()*K(s,.5,2),r,"frame"),e(r)}),t.stage.on("click tap",n=>{if(t.moved()>ke||t.isGhostClick(n))return;let o=t.stage.getPointerPosition();if(!o)return;if(t.sectionCount()){let s=t.ownedBadgeAt(t.screenToWorld(o));if(s&&t.focusOwnedSeats(s))return}if(!(Di(n.target)&&Ht(t))){let s=Oi(t.selectionMarkers(),o);if(s){t.focusSeats([s],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(o))return;if(t.rowLabelAt&&t.selectRow){let s=t.rowLabelAt(o);if(s){t.selectRow(s);return}}if(!t.cached()){if(Di(n.target)&&Ht(t))return;if(Ht(t)){let s=t.focusedSectionId(),a=t.manageSeatHits(),l=t.nearestSeatToScreen(o,ue),c=l?t.seatSection(l):null;if(l&&(!s||a||c&&t.sectionMatchesFocus(c))){t.handleSeatTap(l);return}let d=l?null:t.nearestSeatToScreen(o,ue,!0),u=d?t.seatSection(d):null;if(d&&(!s||a||u&&t.sectionMatchesFocus(u))){t.handleSeatTap(d);return}if(s&&t.onBackdropTap&&!t.floorOverview()){let m=t.sectionAt(o);if(m&&t.sectionInteractive?.(m)===!1)return;if(m&&m!==s){let f=t.sectionTapAnchor(m,t.screenToWorld(o));t.onSectionTap?t.onSectionTap(m,f):t.focusSection(m,{anchor:f})}else m||t.onBackdropTap();return}if(s||a)return;let h=t.sectionCount()?If(t,o):null;if(!h||t.effScale()>=ie||t.sectionFrameScale(h)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let s=t.floorOverview()?t.sectionAt(o):null,a=(s?t.objectFloor(s):null)??t.deckFloorAt();if(a){t.onDeckTap(a);return}}if(t.sectionCount()){let s=t.screenToWorld(o),a=t.ownedBadgeAt(s);if(a&&t.focusOwnedSeats(a)||!a&&ql(t,o))return;let l=a??t.sectionAt(o);if(l){let c=t.sectionTapAnchor(l,s);t.onSectionTap?t.onSectionTap(l,c):t.focusSection(l,{anchor:c});return}if(!t.pressLandsOnChart(o))return}if(!t.seatsPickable()){let s=t.tableAt?.(o);if(s?.length&&t.focusSeats(s,{animate:!t.reducedMotion()}))return}if(t.clusterLabels.focusCluster(o)||t.clusterLabels.glideTowardTap(o))return;let r=Math.max(Se*1.2,t.stage.scaleX()*2.5);t.zoomAbout(r,o)})}function Ql(t,e){if((t.stacked()||t.floorOverview())&&t.onDeckTap){let n=t.objectFloor(t.seat(e)?.rowId??"");if(n){t.onDeckTap(n);return}}if(t.effScale()<ie&&t.sectionCount()&&!t.manageSeatHits()){let n=t.seatSection(e);if(n){let o=t.focusedSectionId()===n.logicalId,r=t.sectionFrameScale(n.logicalId)>t.stage.scaleX()*1.02;if(!o&&r){let s=t.seat(e),a=s?{x:s.x,y:s.y}:void 0;t.onSectionTap?t.onSectionTap(n.logicalId,a):t.focusSection(n.logicalId,{anchor:a});return}}}if(!(t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e))){let n=t.seat(e)??null,o=t.hiddenByAccessFilter(e);n&&(o||t.hasSeatMark(e))&&(t.onHover?.(n,{mark:t.seatMark(e)??null,interaction:"press",unavailable:!0,...o?{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 Ef(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function jl(t,e){return!e.manageMode||!e.marqueeSelect?!1:t.pointerType!=="touch"&&t.button===0}var Jl=450;function ec(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<se}import{Path as $m}from"konva/lib/shapes/Path";import{Group as Af}from"konva/lib/Group";import{Line as Ff}from"konva/lib/shapes/Line";import{Text as _f}from"konva/lib/shapes/Text";function tc(t,e,i,n){if(!e||!n)return;let o=ir(e,i);if(!o.length)return;let r=new Af({name:"level-context",listening:!1});for(let s of o)if(s.type==="shape"&&s.points)r.add(new Ff({points:s.points.flatMap(a=>[a.x,a.y]),closed:!0,stroke:s.stroke?.color??"#8a93a6",strokeWidth:1.5,strokeScaleEnabled:!1,opacity:s.opacity??.35,listening:!1,perfectDrawEnabled:!1}));else if(s.type==="text"){let a=new _f({x:s.position.x,y:s.position.y,text:s.text,fontSize:s.fontSize,fontFamily:"Inter, system-ui, sans-serif",fontStyle:"600",fill:s.color??"#8a93a6",opacity:s.opacity??.6,listening:!1});a.offset({x:a.width()/2,y:a.height()/2}),r.add(a)}t.add(r),r.moveToBottom()}var Bf=10;function Of(t){let e=t.framingViewport();if(t.stage.width()>=Q||t.exportMode())return e;let i=Bf;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 ic(t){let e=Of(t),i=t.revealWorldRect?.()??null,n=e.width,o=e.height,r=t.bounds();if(t.setFitScale(Math.min(n/r.width,o/r.height)||1),t.portraitFitCrop()&&!t.exportMode()){let l=n/r.width<=o/r.height,c=r.height*t.fitScale();l&&c<.55*o&&t.setFitScale(Math.min(t.fitScale()*1.3,.62*o/r.height))}let s=Nf(t);s&&t.setFitScale(Df);let a=t.fitScale();if(t.stage.scale({x:a,y:a}),t.stage.position({x:e.x+(n-r.width*a)/2-r.x*a,y:e.y+(o-r.height*a)/2-r.y*a}),t.settleView(),!t.exportMode()){let l=ya(t.stage,[t.bgLayer,t.seatLayer],e,s?t.stage.scaleX()*1.000001:t.effScale()<se?se*.999999*(t.stage.scaleX()/Math.max(t.effScale(),1e-9)):void 0,i);l>0&&l!==1&&t.setFitScale(t.fitScale()*l),l>0&&(t.afterViewChange(),zn(t.stage,[t.bgLayer,t.seatLayer],e,i)),Hf(t,e),t.setFitPose(qe(t.stage))}t.stage.batchDraw()}var Df=Z*(1-1e-6);function Nf(t){if(!t.openAtSectionsWhenDense?.()||!t.hasSections?.()||t.exportMode())return!1;let e=t.fitScale();return e>=Z&&e<Se}function Hf(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let n=t.revealWorldRect?.()??null,o=_t(t.stage,[t.bgLayer,t.seatLayer],n);if(!o)return;let r=t.fitClearanceWidth?.()??0;if(r>0&&o.x+o.width<=e.x+e.width-r)return;let s=e.height-i;if(o.height<=s){zn(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:s},n);return}let a=e.y+Ci-o.y;a<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+a})}function Gt(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 nc(t,e,i,n="now"){let o=t.stage.position();cl(t.stage,e,i,Gt(t))&&(t.stage.position(t.constrainPan(t.stage.position(),o)),n==="frame"?(t.updateSeatGroupVisibility(),Gf(t)):t.afterViewChange(),t.stage.batchDraw())}function Gf(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function oc(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function Wf(t,e,i,n,o=0){dl(t.stage,e,Gt(t),i,Wt(t.framingViewport(),o),n),t.settleView(),t.stage.batchDraw()}function rc(t,e,i){let n=typeof e=="string"?t.sectionBounds(e):e;if(!n)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){Wf(t,n,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let o=Wt(t.framingViewport(),i?.focusPaddingPx??0),r=o.width,s=o.height,{min:a,max:l}=Gt(t),c=1.12,d=Math.min(r/(n.width*c),s/(n.height*c)),u=i?.minScale??a,h=K(Math.max(d,u),a,Math.max(u,Nt({min:a,max:l},i?.maxScale))),m=o.x+r/2-(n.x+n.width/2)*h,f=o.y+s/2-(n.y+n.height/2)*h,g=t.stage.scaleX(),p=t.stage.x(),b=t.stage.y();if(Math.abs(h-g)<1e-4&&Math.abs(m-p)<.5&&Math.abs(f-b)<.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 k=Math.min(1,(w-y)/S),v=k<.5?4*k*k*k:1-Math.pow(-2*k+2,3)/2,C=g+(h-g)*v;t.stage.scale({x:C,y:C}),t.stage.position({x:p+(m-p)*v,y:b+(f-b)*v}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),k<1?t.setGlideRaf(requestAnimationFrame(x)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(x))}function Wt(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 Vf}from"konva/lib/shapes/Text";function sc(t){let e=new WeakMap;return()=>{let i=t(),n=i.labelFont(),o=Ze(),r=e.get(i.seats);if(r&&r.radius===i.seatR&&r.font===n&&r.generation===o)return r.value;let s=zf(i);return e.set(i.seats,{radius:i.seatR,font:n,generation:o,value:s}),s}}function zf(t){let e=1/0,i=new Vf({fontSize:me,fontStyle:"600",fontFamily:t.labelFont(),listening:!1}),n=t.seatR*2-3,o=new Map;for(let s of t.seats){if(s.kind==="booth"){let u=t.blockExtent?.(s);e=Math.min(e,u?ge({...u,text:s.displayLabel??s.label}):He);continue}let a=me*t.seatLabelScale(s),l=ni(s.displayLabel??s.label),c=o.get(a);c||o.set(a,c=new Map);let d=c.get(l);if(d===void 0&&(i.fontSize(a),i.text(l),d=i.width()>n?Math.max(st,a*n/i.width()):a,c.set(l,d)),e=Math.min(e,d),e<=st)break}i.destroy();let r=Number.isFinite(e)?e:He;return H/Math.max(st,r)}function lc(t,e,i,n,o,r=.35){return!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(e)||!(i.width>0)||!(i.height>0)?t:{x:ac(t.x,e,i.x,i.width,n.x,n.width,r,o?.x),y:ac(t.y,e,i.y,i.height,n.y,n.height,r,o?.y)}}function ac(t,e,i,n,o,r,s,a){if(!Number.isFinite(i)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(r))return t;let l=n*e,c=Math.min(l,r*(1-s)),d=o+c-(i+n)*e,u=o+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 lo={top:0,right:0,bottom:0,left:0};function cc(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)}:{...lo}}var Kf=.7;function dc(t,e,i){let{top:n,right:o,bottom:r,left:s}=i,a=(h,m,f)=>{let g=h+m,p=f*Kf;if(g<=p||g<=0)return[h,m];let b=p/g;return[h*b,m*b]},[l,c]=a(s,o,t),[d,u]=a(n,r,e);return{x:l,y:d,width:Math.max(1,t-l-c),height:Math.max(1,e-d-u)}}function hc(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function uc(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 Vt(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function pc(t,e){let i=e({x:t.x,y:t.y}),n=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(i.x,n.x),y:Math.min(i.y,n.y),width:Math.abs(n.x-i.x),height:Math.abs(n.y-i.y)}}function co(t,e,i,n,o,r,s){if(!e)return{box:{x:i,y:n,width:0,height:0},fitWidth:0,fitHeight:0,x:i,y:n,baseFontSize:o,insideInk:r,fill:s};let a=((t??0)%180+180)%180,l=a*Math.PI/180,c=Math.abs(Math.cos(l)),d=Math.abs(Math.sin(l)),u=e.x+e.width/2,h=e.y+e.height/2,m=e.width*c+e.height*d,f=e.width*d+e.height*c,g={x:u-m/2,y:h-f/2,width:m,height:f},p=a===0?[e.width,e.height]:a===90?[e.height,e.width]:[Math.min(e.width,e.height),Math.min(e.width,e.height)];return{box:g,fitWidth:p[0],fitHeight:p[1],x:i,y:n,baseFontSize:o,insideInk:r,fill:s}}var fc=H,Xf=3,Uf=.5;function Yf(t){return X(t,D(t)?"#475569":"#cbd5e1")}function mc(t,e,i){return{x:t-i.width/2,y:e-i.height/2,width:i.width,height:i.height}}function $f(t,e,i){let{spec:n}=t,o=Math.max(e,1e-6);if(n.baseFontSize*o>=fc){let u=t.measure(n.baseFontSize);return i.occupied.insert(mc(n.x,n.y,u)),{visible:!0,where:"inside",fontSize:n.baseFontSize,x:n.x,y:n.y}}let r=fc/o,s=t.measure(r);if(Math.max(n.box.width,n.box.height)<s.width*Uf)return{visible:!1,reason:"shape-too-small"};let a=Xf/o,l=s.width+a*2<=n.fitWidth&&s.height+a*2<=n.fitHeight,c=n.box.x+n.box.width/2,d=l?[{where:"inside",x:n.x,y:n.y}]:[{where:"below",x:c,y:n.box.y+n.box.height+a+s.height/2},{where:"above",x:c,y:n.box.y-a-s.height/2}];for(let u of d){let h=mc(u.x,u.y,s);if(!(i.coversSeat(h)||i.occupied.collisionCount(h)>0))return i.occupied.insert(h),{visible:!0,where:u.where,fontSize:r,x:u.x,y:u.y}}return{visible:!1,reason:"no-clear-place"}}function gc(t){let e=[],i=new fe,n=a=>{if(!a.isVisible())return;let l=a.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});i.insert(l)};for(let a of t.freeTextById.values())a.area?e.push({record:a,spec:a.area}):n(a.node);if(!e.length)return;for(let a of t.focalLabels)n(a);let o=t.seatIndex,r={coversSeat:a=>!!o&&rt(o,a,{mode:"overlap"}).length>0,occupied:i},s=Yf(t.canvasBackground);e.sort((a,l)=>l.spec.box.width*l.spec.box.height-a.spec.box.width*a.spec.box.height);for(let{record:a,spec:l}of e){let{node:c}=a,d=$f({spec:l,measure:u=>(c.fontSize(u),{width:c.width(),height:c.height()})},t.scale,r);qf(c,l,d,s),d.visible&&(a.background=d.where==="inside"?l.fill:t.canvasBackground)}}function qf(t,e,i,n){if(!i.visible){t.fontSize(e.baseFontSize),t.visible(!1);return}t.fontSize(i.fontSize),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.position({x:i.x,y:i.y}),t.fill(i.where==="inside"?e.insideInk:n),t.visible(!0)}function bc(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 ho(t,e,i,n){let o=Zf(t,i,n);if(!o)return null;let r=e.filter(s=>s.rowId===o.id).map(s=>s.id);return r.length?r:null}function Zf(t,e,i){let n=Math.max(i,1e-9),o=null;for(let r of t){let s=Math.max(r.radius,si/2/n),a=Math.hypot(e.x-r.centre.x,e.y-r.centre.y);a>s||(!o||a<o.distance)&&(o={table:r,distance:a})}return o?.table??null}function Sc(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?Qr:Zr}function vc(t){return Math.max(t*1.05,zr,Z*1.3)}var Qf=42;function wc(t){return Qf/(2*Math.max(t,1e-4))}function je(t,e){let i=1/0,n=-1/0,o=1/0,r=-1/0;for(let s of t)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 i-=e,n+=e,o-=e,r+=e,{x:i,y:o,width:Math.max(40,n-i),height:Math.max(40,r-o)}}function kc(t){let{stageWidth:e,stageHeight:i,fullBounds:n,visibleBounds:o,seatPoints:r,minScale:s}=t;if(!r.length)return null;let a=1.12;if(Math.min(e/(n.width*a),i/(n.height*a))>=s)return null;let c=t.tapAnchor??{x:o.x+o.width/2,y:o.y+o.height/2},d=r[0],u=1/0;for(let g of r){let p=(g.x-c.x)**2+(g.y-c.y)**2;p<u&&(d=g,u=p)}let h=e/(s*a),m=i/(s*a),f=je(r,0);return{bounds:{x:yc(d.x,h,f.x,f.width),y:yc(d.y,m,f.y,f.height),width:h,height:m},minScale:s}}function yc(t,e,i,n){return n<=e?i+n/2-e/2:Math.min(Math.max(t-e/2,i),i+n-e)}import{Shape as Jf}from"konva/lib/Shape";var xc=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},jf=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function Lc(t,e){let i=new Map;for(let o of t){if(o.kind==="booth")continue;let r=e.get(o.rowId),s=xc(o);if(!(r&&r>0)||s==null)continue;let a=jf(o),l=i.get(a)??[];l.push({seat:o,index:s}),i.set(a,l)}let n=[];for(let o of i.values()){o.sort((a,l)=>a.index-l.index||a.seat.id.localeCompare(l.seat.id));let r=[],s=()=>{r.length&&(n.push({seats:r,points:r.map(({x:a,y:l})=>({x:a,y:l}))}),r=[])};for(let a of o){let l=r[r.length-1];if(l){let c=xc(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 n}var zt=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,n,o,r,s,a,l,c=()=>1,d=()=>!1,u=()=>1/0){if(!l||!e||!n){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(g=>g.objects)])f.type==="row"&&this.spacing.set(f.id,f.seatSpacing)}if(this.focusKey!==n&&(this.focusKey=n,this.detailScale=Math.min(Math.max(1.15,c()*1.15),u()*.9)),o>=this.detailScale){this.clear();return}let h=i.filter(f=>f.id===n||f.logicalId===n||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(b=>!a.has(b)||!this.spacing.has(s.get(b)?.rowId??"")))continue;let g=Lc(f.memberIds.map(b=>s.get(b)).filter(Boolean),this.spacing);if(!g.length||g.reduce((b,y)=>b+y.seats.length,0)!==f.memberIds.length)continue;let p=new Jf({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:b=>{let y=b._context,S=p.getStage(),x=S&&S.width()<=Q?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=k=>{let v=a.get(k.id);return O(String(v.fill()),v.opacity())};for(let k of g){let v=k.points;if(v.length===1){y.fillStyle=w(k.seats[0]),y.beginPath(),y.arc(v[0].x,v[0].y,x,0,Math.PI*2),y.fill();continue}let C=k.seats.map(w),P=(R,M)=>{let A=Math.hypot(M.x-R.x,M.y-R.y);return{x:-(M.y-R.y)/A,y:(M.x-R.x)/A}},T=v.map((R,M)=>{let A=v[Math.max(0,M-1)],E=v[Math.min(v.length-1,M+1)];return Math.hypot(E.x-A.x,E.y-A.y)>.001?P(A,E):P(v[M],v[M+1]??v[M-1])}),L=(R,M,A)=>({x:R.x+M.x*x*A,y:R.y+M.y*x*A}),I=0;for(;I<v.length;){let R=I;for(;R+1<v.length&&C[R+1]===C[I];)R++;let M=I===0?v[0]:{x:(v[I-1].x+v[I].x)/2,y:(v[I-1].y+v[I].y)/2},A=R===v.length-1?v[R]:{x:(v[R].x+v[R+1].x)/2,y:(v[R].y+v[R+1].y)/2},E=I===0?T[0]:P(v[I-1],v[I]),z=R===v.length-1?T[R]:P(v[R],v[R+1]),W=[M,...v.slice(I,R+1),A],Y=[E,...T.slice(I,R+1),z],re=W.map((_,G)=>L(_,Y[G],1)),N=W.map((_,G)=>L(_,Y[G],-1));y.fillStyle=C[I],y.beginPath(),y.moveTo(re[0].x,re[0].y);for(let _ of re.slice(1))y.lineTo(_.x,_.y);if(R===v.length-1){let _=Math.atan2(z.y,z.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(M.x,M.y,x,_,_-Math.PI,!0)}y.closePath(),y.fill(),I=R+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 em}from"konva/lib/shapes/Text";var Cc=new WeakMap,tm=(t,e)=>{let i=new em({text:t,fontSize:Rt,fontStyle:"700",fontFamily:e}),n={width:i.width(),height:i.height()};return i.destroy(),n};function Tc(t,e,i,n=tm){let o=Cc.get(t);o||Cc.set(t,o=new Map);let r=`${e}\0${Ze()}`,s=o.get(r);s||o.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=n(d.text,e);l=Math.max(l,u.width,u.height)}let c=l>0?Math.ceil(l+H+ee*2+6):0;return s.set(i,c),c}function Ic(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 uo=1e6;function im(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function po(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Hi=class{constructor(e,i=im()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.holdTimer=null;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,e.altKey))};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,e.type==="pointercancel")};this.onReleaseElsewhere=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId)||e.composedPath().includes(this.host.container))return;let i=e.type==="pointercancel";!i&&this.host.marqueeActive()&&this.host.updateMarquee(this.toLocal(e.clientX,e.clientY)),this.endPointer(e.pointerId,i)};this.onWindowBlur=()=>{this.abandonGesture()};this.onEscape=e=>{e.key!=="Escape"||this.pointers.size===0||!this.host.marqueeActive()||(e.preventDefault(),e.stopPropagation(),this.abandonGesture())};this.onTouchStart=e=>{if(!po(e)){e.preventDefault(),this.rect=null;for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.beginPointer(uo+n.identifier,this.toLocal(n.clientX,n.clientY),"touch",0)}}};this.onTouchMove=e=>{if(po(e))return;e.preventDefault();let i=null;for(let n=0;n<e.changedTouches.length;n+=1){let o=e.changedTouches.item(n);if(!o)continue;let r=this.toLocal(o.clientX,o.clientY);this.updatePointer(uo+o.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!po(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.endPointer(uo+n.identifier,e.type==="touchcancel")}}};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),window.addEventListener("pointerup",this.onReleaseElsewhere,{capture:!0}),window.addEventListener("pointercancel",this.onReleaseElsewhere,{capture:!0}),window.addEventListener("blur",this.onWindowBlur),window.addEventListener("keydown",this.onEscape,{capture:!0})),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(){this.clearHold();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),window.removeEventListener("pointerup",this.onReleaseElsewhere,{capture:!0}),window.removeEventListener("pointercancel",this.onReleaseElsewhere,{capture:!0}),window.removeEventListener("blur",this.onWindowBlur),window.removeEventListener("keydown",this.onEscape,{capture:!0})),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<Kr}invalidateRect(){this.rect=null}toLocal(e,i){let n=this.rect;if(!n){let o=this.host.container.getBoundingClientRect();n={left:o.left,top:o.top},this.rect=n}return{x:e-n.left,y:i-n.top}}beginPointer(e,i,n,o,r=!1,s=!1){if(this.host.cancelGlide(),this.host.dismissFocusRing?.(),this.pointers.set(e,i),this.pointers.size===1)this.movedPx=0,this.singleTouch=n==="touch",this.singleTouch&&this.host.touchProbeStart?.(i),this.pinch=null,this.panStart=i,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:n,button:o,local:i,shiftKey:r,altKey:s})?(this.host.beginMarquee(i,s),this.panLast=null):(this.panLast=i,n==="touch"&&this.host.marqueeShouldStart({pointerType:"touch-hold",button:o,local:i,shiftKey:r,altKey:s})&&(this.holdTimer=setTimeout(()=>{this.holdTimer=null,!(this.pointers.size!==1||this.panStarted||this.movedPx>ke)&&(this.endTouchProbe(),this.panLast=null,this.host.beginMarquee(i,!1))},Jl)));else if(this.pointers.size===2){this.clearHold(),this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[a,l]=[...this.pointers.values()],c={x:(a.x+l.x)/2,y:(a.y+l.y)/2},d=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(l.x-a.x,l.y-a.y),startScale:d,worldMid:{x:(c.x-this.host.stage.x())/d,y:(c.y-this.host.stage.y())/d}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=ke+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.movedPx>ke&&this.clearHold()):this.pointers.size>=2&&(this.movedPx=ke+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>ke?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,n]=[...this.pointers.values()],o=Math.hypot(n.x-i.x,n.y-i.y);if(this.pinch.startDist<1)return;let r={x:(i.x+n.x)/2,y:(i.y+n.y)/2},{min:s,max:a}=this.host.zoomBounds(),l=K(this.pinch.startScale*(o/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<=ke)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()}}abandonGesture(){if(this.pointers.size===0)return;let e=this.host.marqueeActive();e&&this.host.cancelMarquee(),this.pointers.clear(),this.pinch=null,this.resetPan(),this.endTouchProbe(),e||this.host.afterViewChange()}clearHold(){this.holdTimer&&clearTimeout(this.holdTimer),this.holdTimer=null}endPointer(e,i=!1){if(this.pointers.has(e)){if(this.clearHold(),this.host.marqueeActive()){this.endTouchProbe(),i?this.host.cancelMarquee():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 nm}from"konva/lib/shapes/Circle";import{Group as om}from"konva/lib/Group";import{Line as rm}from"konva/lib/shapes/Line";import{Text as sm}from"konva/lib/shapes/Text";var am=11,lm=.3,cm=.08;function Ec(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function dm(t,e){return!e||t.available==null?`cap ${t.capacity}`:t.available<=0?F("map.soldOut"):t.wheelchairFree!=null?t.wheelchairFree<=0?F("map.noWheelchairSpace"):F("map.seatsLeft",{count:t.wheelchairFree}):F("map.seatsLeft",{count:t.available})}function Ac(t,e){return e&&t.available!=null&&t.available<=0}function hm(t,e){return Ac(t,e)||e&&t.wheelchairFree!=null&&t.wheelchairFree<=0}function Fc(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),n=t.overviewHidden(e),o=hm(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(n?0:t.dimmed(e.categoryKey)?We*cm:o?We*lm:We),e.polygon.listening(!t.exportMode&&!n&&!i&&!Ac(e,t.pickerMode)),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),um(t,e,o,r,n,t.dimmed(e.categoryKey))}}function um(t,e,i,n,o,r){if(e.capacityNode){let s=dm(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}pm(t,e,o||r),n>0&&!o?ym(t,e,n,Math.max(t.effScale(),1e-4)):e.chip&&e.chip.visible(!1)}var fo=9,Pc=.86;function pm(t,e,i){fm(t,e,i),mo(e)}function mo(t){let e=t.wheelchairGlyph,i=t.capacityNode;if(!e)return;if(!i||!i.visible()||!i.text()){e.visible(!1);return}let n=i.fontSize(),o=n/ye;e.scale({x:o,y:o}),e.offset({x:ye/2,y:ye/2}),e.position({x:i.x()-i.width()/2-n*.7,y:i.y()-i.offsetY()+i.height()/2}),e.visible(!0)}function fm(t,e,i){let{labelNode:n,capacityNode:o}=e;if(!n&&!o)return;let r=Math.max(t.effScale(),1e-4);if(i){n?.visible(!1),o?.visible(!1);return}if(!t.pickerMode){n?.visible(t.labelLegible(n.fontSize())),o?.visible(t.labelLegible(o.fontSize()));return}let s=mm(e,r),a=Rc(n,e.nameSize??ti,s.width*Pc,r),l=Rc(o,ii,s.width*Pc,r),c=a!=null,d=l!=null&&(n?c&&a+l+fo<=s.height:l<=s.height);Mc(n,c?a:null,e.labelPoint.y-fo/r,r),Mc(o,d?l:null,n?e.labelPoint.y+fo/r:e.labelPoint.y,r)}function mm(t,e){let i=1/0,n=-1/0,o=1/0,r=-1/0;for(let s of t.points)s.x<i&&(i=s.x),s.x>n&&(n=s.x),s.y<o&&(o=s.y),s.y>r&&(r=s.y);return Number.isFinite(i)?{width:(n-i)*e,height:(r-o)*e}:{width:0,height:0}}function Rc(t,e,i,n){if(!t||!t.text())return null;t.fontSize(e/n);let o=t.width()*n;if(o<=i||o<=0)return e;let r=e*(i/o);return r>=H?r:null}function Mc(t,e,i,n){if(t){if(e==null){t.visible(!1);return}t.fontSize(e/n),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i),t.visible(!0)}}var gm=.72;function bm(t,e,i){let n=-1/0,o=1/0;for(let s of t)s.x>n&&(n=s.x),s.y<o&&(o=s.y);if(!Number.isFinite(n)||!Number.isFinite(o))return e;let r=i*gm;return{x:n+r,y:o-r}}function ym(t,e,i,n){let o=am;if(!e.chip){let a=new om({listening:!1});a.add(new nm({name:"ga-chip-disc",radius:o,strokeWidth:1,listening:!1,perfectDrawEnabled:!1})),a.add(new rm({name:"ga-chip-tick",x:-o*.62,points:[-o*.22,0,-o*.02,o*.2,o*.34,-o*.26],strokeWidth:Math.max(.6,o*.16),lineCap:"round",lineJoin:"round",listening:!1}));let l=new sm({x:o*.12,y:-o*.5,text:String(i),fontSize:o,fontStyle:"800",fontFamily:t.labelFont(),listening:!1,perfectDrawEnabled:!1});a.add(l),t.bgLayer.add(a),e.chip=a,e.chipText=l}let r=Bt(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(bm(e.points,e.labelPoint,o/n)),e.chip.scale({x:1/n,y:1/n}),e.chip.visible(!0),e.chip.moveToTop()}function _c(t,e){let i=!1;for(let[n,o]of Object.entries(e)){let r=t.get(n);r&&(o.available!==void 0&&r.available!==o.available&&(r.available=o.available,i=!0),o.wheelchairFree!==void 0&&(r.wheelchairFree??null)!==o.wheelchairFree&&(r.wheelchairFree=o.wheelchairFree,i=!0),o.selected!==void 0&&r.selected!==o.selected&&(r.selected=o.selected,i=!0))}return i}function Bc(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 Oc(t){let{rung:e,viewCentre:i,target:n,width:o,height:r}=t,s=i.x,a=i.y;if(e==="sections"&&t.sections.length>0){let c=t.sections.map(m=>{let f=U(m.outline);return{x:f.x+f.width/2,y:f.y+f.height/2}}),d=o/(n*2),u=r/(n*2);if(!c.some(m=>Math.abs(m.x-i.x)<=d&&Math.abs(m.y-i.y)<=u)){let m=c.reduce((f,g)=>{let p=(g.x-i.x)**2+(g.y-i.y)**2;return p<f.distance?{point:g,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 Dc(t,e,i,n){if(t.length<3)return[];let o=1/0,r=-1/0,s=1/0,a=-1/0;for(let d of t)d.x<o&&(o=d.x),d.x>r&&(r=d.x),d.y<s&&(s=d.y),d.y>a&&(a=d.y);if((r-o)*i<4&&(a-s)*i<4)return[];let l=t,c=[];for(let d of e)d.x<o||d.x>r||d.y<s||d.y>a||Zt(d,l)&&n.selectable(d.id)&&c.push(d.id);return c}function Sm(t){return t.logicalRowId??t.rowId}function Nc(t,e,i){let n=[];for(let o of e)o.kind!=="booth"&&(Sm(o)!==t||!i(o.id)||n.push(o.id));return n}function Hc(t,e,i=4){for(let n of e){let{box:o}=n;if(t.x>=o.x-i&&t.x<=o.x+o.width+i&&t.y>=o.y-i&&t.y<=o.y+o.height+i)return n.rowKey}return null}import{Line as vm}from"konva/lib/shapes/Line";import{Rect as wm}from"konva/lib/shapes/Rect";var Gi=class{constructor(e){this.host=e;this.box=null;this.lasso=null;this.remove=!1}active(){return this.box!==null||this.lasso!==null}begin(e,i,n=!1){this.cancel(),this.remove=n;let o=this.host.screenToWorld(e),r=this.host.stageScale()||1,s={stroke:n?"#d64545":this.host.selectionColor(),strokeWidth:1.5/r,dash:[5/r,4/r],fill:n?"rgba(214,69,69,0.10)":"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(i==="lasso"){let a=new vm({...s,points:[o.x,o.y],closed:!0,lineJoin:"round"});this.host.overlayLayer().add(a),this.lasso={points:[o],line:a}}else{let a=new wm({...s,x:o.x,y:o.y,width:0,height:0});this.host.overlayLayer().add(a),this.box={start:o,cur:o,rect:a}}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:n,rect:o}=this.box;o.setAttrs({x:Math.min(n.x,i.x),y:Math.min(n.y,i.y),width:Math.abs(i.x-n.x),height:Math.abs(i.y-n.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.apply(Dc(l,this.host.seats(),e,{selectable:h=>this.host.isSelectable(h)}),h=>Zt(h,l));return}let i=this.box;if(this.box=null,!i)return;i.rect.destroy(),this.host.overlayLayer().batchDraw();let n=Math.min(i.start.x,i.cur.x),o=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((o-n)*e<4&&(s-r)*e<4)return;let a=[];for(let l of this.host.seats())l.x<n||l.x>o||l.y<r||l.y>s||this.host.isSelectable(l.id)&&a.push(l.id);this.apply(a,l=>l.x>=n&&l.x<=o&&l.y>=r&&l.y<=s)}apply(e,i){this.host.applyBand(e,i,this.remove),this.host.selectionChanged()}};var Wi=class{constructor(e){this.sync=e;this.depth=0;this.pending=!1}request(){if(this.depth>0){this.pending=!0;return}this.sync()}batch(e){this.depth+=1;try{return e()}finally{this.depth-=1,this.depth===0&&this.pending&&(this.pending=!1,this.sync())}}};import{Rect as Gc}from"konva/lib/shapes/Rect";import{Text as km}from"konva/lib/shapes/Text";function Wc(t){let e=t.effScale(),i=t.stage.scaleX(),n={width:t.stage.width(),height:t.stage.height()},o=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 b=t.circleById.get(p.id),y=t.boothLabelById.get(p.id)??t.seatLabelById.get(p.id),S=p.kind==="booth"?He:me*t.seatLabelScale(p),x=o((y?.fontSize()??S)*e),w=t.worldToScreen(p),k=y?y.width()*i:0,v=y?y.height()*e:0,C=w.x-k/2<0||w.x+k/2>n.width||w.y-v/2<0||w.y+v/2>n.height,P=t.focusedSeatOpacity(p.id,b?.getAbsoluteOpacity()??0),T=t.seatSection.get(p.id),L=!!y?.isVisible()&&P>=.5&&!C,I;L||(P<.5?I="dimmed-or-unavailable":x<H?I="below-minimum-size":C?I="outside-viewport":y?I="renderer-hidden":I=t.seatLabelDrops.get(p.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let R=b instanceof Gc?b.width()*i:t.seatR*2*e,M=b instanceof Gc?b.height()*e:t.seatR*2*e,A=2*(t.seatR*e+ue),E=b?.fill(),z=y?.fill(),W=t.accessGlyphById.get(p.id),Y=W?.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,...T?{sectionId:T.id}:{},...T?.zone?{zoneId:T.zone}:{},status:t.statusById.get(p.id)??"free",selected:t.selection.has(p.id),visible:L,renderedFontPx:x,fill:typeof E=="string"?E:"",ink:typeof z=="string"?z:b?t.seatLabelInk(p,b):t.seatPreferredLabelInk(p),...r.has(p.id)?{selectionRingColor:r.get(p.id)}:{},opacity:o(P),...W?{accessibilityMarker:{glyphVisible:W.isVisible(),glyphWidthPx:o(ye*Math.abs(Y?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(p.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(p.id)&&!!b?.isVisible()&&!!b?.isListening()&&t.isSelectable(p.id),directWidthPx:o(R),directHeightPx:o(M),effectiveMinimumPx:o(Math.max(Math.min(R,M),A))},screenCenter:{x:o(w.x),y:o(w.y)},...L?{screenBox:{x:o(w.x-k/2),y:o(w.y-v/2),width:o(k),height:o(v)}}:{},...I?{hiddenReason:I}:{}}}),a=s.filter(p=>p.visible).length,l=(p,b,y,S,x,w,k)=>{let v=ht({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),C=U(v.map(M=>t.worldToScreen(M))),P=o(S.opacity()),T=S.fill(),L=C.x+C.width<0||C.x>n.width||C.y+C.height<0||C.y>n.height,I=S.isVisible()&&P>.05&&!L,R=w?ut({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),w.outline,w.holes):void 0;return{id:p,kind:b,role:y,label:S.text(),visible:I,renderedFontPx:o(S.fontSize()*i),...k==null?{}:{sizeFloorPx:k},opacity:P,fill:x,ink:typeof T=="string"?T:"",...R==null?{}:{fitsContainer:R},...I?{screenBox:{x:o(C.x),y:o(C.y),width:o(C.width),height:o(C.height)}}:{}}},c=p=>{let b=p.namePlate.fill();if(p.namePlate.opacity()>.05&&typeof b=="string"&&b)return b;let y=p.blockPoly.fill();return typeof y=="string"?y:p.baseFill},d=p=>{let b=p.blockPoly.fill();return typeof b=="string"?b:p.baseFill},u=[...t.sections.map(p=>l(p.id,"section","name",p.nameLabel,c(p),p,Et(n.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,fi(n.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,b])=>{let y=b.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)),k=Math.max(...y.map(L=>L.y)),v=w<0||S>n.width||k<0||x>n.height,C=o(b.polygon.opacity()),P=C>=.1&&!v,T=b.polygon.fill();return{areaId:p,label:b.label,capacity:b.capacity,categoryKey:b.categoryKey,...b.sectionId?{sectionId:b.sectionId}:{},visible:P,interactive:b.polygon.listening(),opacity:C,fill:typeof T=="string"?T:"",effectiveBackground:b.effectiveBackground,...P?{screenBox:{x:o(S),y:o(x),width:o(w-S),height:o(k-x)}}:{}}}),m=[...t.freeTextById].map(([p,b])=>{let{node:y,kind:S}=b,x=b.plate&&b.plate.opacity()>.05?b.plate.fill():null,w=typeof x=="string"&&x?x:b.background,k=t.worldToScreen({x:y.x(),y:y.y()}),v=y.width()*i,C=y.height()*e,P=k.x-y.offsetX()*i,T=k.y-y.offsetY()*e,L=o(y.fontSize()*e),I=P+v<0||P>n.width||T+C<0||T>n.height,R=y.isVisible()&&!I,M=y.fill(),A=o(y.getAbsoluteOpacity()),E;return R||(L<H?E="below-minimum-size":I?E="outside-viewport":E="renderer-hidden"),{objectId:b.objectId??p,kind:S,text:y.text(),visible:R,renderedFontPx:L,ink:typeof M=="string"?M:"",background:w,opacity:A,...R?{screenBox:{x:o(P),y:o(T),width:o(v),height:o(C)}}:{},...E?{hiddenReason:E}:{}}}),f=t.labelGroup.find(p=>p.getAttr("rowLabel")===!0).filter(p=>p instanceof km).map(p=>{let b=p.getClientRect({skipShadow:!0,skipStroke:!0}),y=b.x+b.width<0||b.x>n.width||b.y+b.height<0||b.y>n.height,S=p.fill();return{text:p.text(),visible:p.isVisible()&&!y,renderedFontPx:o(p.fontSize()*e),ink:typeof S=="string"?S:"",...y?{}:{screenBox:{x:o(b.x),y:o(b.y),width:o(b.width),height:o(b.height)}}}}),g=t.sections.filter(p=>p.blockPoly.opacity()>.05);return{viewport:n,projection:"flat",canvasBackground:t.canvasBackground,effectiveScale:o(e),rung:t.getRung(),minimumVisibleLabelPx:H,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+h.reduce((p,b)=>p+b.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:g.length,categoryPaintedSectionShells:g.filter(p=>{let b=p.blockPoly.fill();return typeof b!="string"||!Cn(t.canvasBackground,b)}).length,tintedSectionShells:g.filter(p=>{let b=p.blockPoly.fill();return typeof b=="string"&&_s(t.canvasBackground,b)}).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 Am}from"konva/lib/shapes/Circle";import{Ellipse as Fm}from"konva/lib/shapes/Ellipse";import{Line as _m}from"konva/lib/shapes/Line";import{Arrow as Bm}from"konva/lib/shapes/Arrow";import{Path as Om}from"konva/lib/shapes/Path";import{Rect as Kt}from"konva/lib/shapes/Rect";import{Text as yo}from"konva/lib/shapes/Text";import{Image as Yc}from"konva/lib/shapes/Image";import{Group as Vc}from"konva/lib/Group";import{Circle as xm}from"konva/lib/shapes/Circle";import{Path as Lm}from"konva/lib/shapes/Path";function Cm(t,e){let i=e?.trim();return i&&i.toLowerCase()!==Ir?i:Pt[t.group]}var zc=new WeakMap;function Vi(t){let{icon:e,size:i}=t,n=Cm(e,t.color),o=D(n)&&n!==Pt[e.group]?gr:di,r=D(t.background)?0:i*fn.ringRatio,s=t.listening??!1,a=new Vc({x:t.x,y:t.y,rotation:t.rotation??0,listening:s,name:"venue-icon-badge"});a.setAttr("venueIconKey",e.key),a.add(new xm({x:i/2,y:i/2,radius:i/2-r/2,fill:n,...r>0?{stroke:br,strokeWidth:r}:{strokeEnabled:!1},listening:s,perfectDrawEnabled:!1}));let l=i*fn.glyphScale,c=new Lm({x:(i-l)/2,y:(i-l)/2,data:e.solid,scaleX:l/mn,scaleY:l/mn,fill:o,strokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});return a.add(c),zc.set(a,{glyph:c,icon:e}),a}function go(t,e,i){let n=t instanceof Vc?zc.get(t):void 0;if(n?.icon.solidLarge){let o=Cr(n.icon,e*i);n.glyph.data()!==o&&n.glyph.data(o)}return e}function Kc(t,e,i){let n=hi("wheelchair"),o=Er(t);if(!n||!o)return null;let r=Mr(e),s=Vi({icon:n,x:o.x-r/2,y:o.y-r/2,size:r,background:i,listening:!1});return s.name("step-free-route-mark"),s}import{Group as Tm}from"konva/lib/Group";import{Path as Im}from"konva/lib/shapes/Path";import{Rect as Pm}from"konva/lib/shapes/Rect";import{Text as Rm}from"konva/lib/shapes/Text";function Mm(t){let e=(t%360+360)%360;return e>90&&e<270?e-180:e}function Em(t,e,i={}){let n=t.height??40,o=t.width??n*3,r=(t.x??0)+o/2,s=(t.y??0)+n/2,a=n*.46,l=di,c=new Rm({name:"gate-sign-name",text:t.label??"",fontSize:a,fontFamily:e,fontStyle:"600",fill:l,listening:!1,perfectDrawEnabled:!1}),d=t.gate.stepFree?Tr("wheelchair")?.solid:void 0,u=d?a*1.15:0,h=d?a*.3:0,m=u+h+c.width(),f=Math.max(o,m+n),g=new Tm({name:"gate-sign",x:r,y:s,rotation:Mm(t.rotation??0),listening:i.hitTarget===!0});g.add(new Pm({name:"gate-sign-pill",x:-f/2,y:-n/2,width:f,height:n,cornerRadius:n/2,fill:t.fill??Pt.navigation,stroke:l,strokeWidth:Math.max(1,n*.05),opacity:i.organizerOnly?.55:1,dash:i.organizerOnly?[n*.2,n*.12]:void 0,listening:i.hitTarget===!0,perfectDrawEnabled:!1}));let p=-m/2;return d&&(g.add(new Im({name:"gate-sign-step-free",data:d,x:p,y:-u/2,scaleX:u/24,scaleY:u/24,fill:l,listening:!1,perfectDrawEnabled:!1})),p+=u+h),c.position({x:p,y:-c.height()/2}),g.add(c),g.setAttr("gateSignHeight",n),{group:g,fontSize:a,bounds:{x:r-f/2,y:s-n/2,width:f,height:n}}}function Xc(t,e){if(e.gate.hideFromBuyers)return;let i=Em(e,t.labelFont());i.group.setAttr("shapeObjectId",e.id),e.opacity!=null&&i.group.opacity(Math.min(1,Math.max(.1,e.opacity))),t.bgLayer.add(i.group),t.iconNodeById.set(e.id,{node:i.group,fontSize:i.fontSize}),t.landmarkBoxes.push(i.bounds)}function $c(t,e){if(!e.url||e.visible===!1)return;let i=new window.Image;t.trackAssetImage(i,e.url,"Buyer background image",()=>{let n=i.naturalWidth||4,o=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*(o*l.height/(n*l.width)),u=new Yc({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*n,y:l.y*o,width:l.width*n,height:l.height*o},opacity:e.opacity,listening:!1}),h=e.layer==="above"?t.fgDecorGroup:t.bgLayer;h.add(u),u.moveToBottom(),h.getLayer()?.batchDraw()})}function qc(t,e){let i=new window.Image,n=new Yc({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:K(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?t.fgDecorGroup.add(n):t.bgLayer.add(n),e.role&&t.landmarkBoxes.push(U(ht({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 o=n.getLayer();o&&o.batchDraw()})}function Zc(t,e){let i=e.fill??t.theme.decorFill??Yn,n=ce(i,.12);if(e.shape==="round")t.bgLayer.add(new Am({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:i,stroke:n,strokeWidth:1.5,listening:!1}));else{let r=e.width??80,s=e.height??50;t.bgLayer.add(new Kt({x:e.center.x,y:e.center.y,width:r,height:s,offsetX:r/2,offsetY:s/2,rotation:e.rotation,fill:i,stroke:n,strokeWidth:1.5,cornerRadius:4,listening:!1}))}if(!Ct(e))return;let o=Xt(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,X(i,t.theme.textColor??"#cbd5e1"),Ge(e)??fr,!0);t.freeTextById.set(e.id,{node:o,background:i,kind:"table"})}var Dm=8,Nm=6;function Hm(t,e){let i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),n=Math.max(Dm,e*.35),o=Math.max(Nm,e*.28);return{offsetX:-(i.x-n),offsetY:-(i.y-o),width:i.width+n*2,height:i.height+o*2}}function Qc(t,e){let i=e.background?.color??t.canvasBackground,n=e.color??X(i,t.theme.textColor??qa),o=e.semanticKind==="icon"?hi(e.iconKey):void 0;if(o){let d=Vi({icon:o,x:e.position.x,y:e.position.y,size:e.fontSize,rotation:e.rotation,color:e.color,background:t.canvasBackground});t.iconNodeById.set(e.id,{node:d,fontSize:e.fontSize}),t.bgLayer.add(d);return}let r=e.background?.padding??0,s=e.opacity??1,a=jo(e),l=new yo({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:$n(e.bold,e.italic,"600"),fill:n,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 Kt({x:e.position.x,y:e.position.y,...Hm(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 jc(t,e){if(_r(e)){Xc(t,e);return}let i=e.fill??t.theme.decorFill??Yn,n=e.role==="stage",o=e.role==="reference-focal",r=!!e.role&&!n,s=Qo(e),a=ae(t.canvasBackground),l=o?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(n?ce(l,.28):o?a.focalStroke:c?"#9aa3b5":void 0),u=e.stroke?.width??(n?1:o||c?2:0),h=e.opacity!=null?K(e.opacity,.1,1):1,m=0,f=0,g=null;if(c&&e.points&&e.points.length>=2){m=e.points.reduce((w,k)=>w+k.x,0)/e.points.length,f=e.points.reduce((w,k)=>w+k.y,0)/e.points.length;let p=Ar(e),b=Fr(u),y=Pr(e),S=new Bm({points:e.points.flatMap(w=>[w.x,w.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",...b,listening:!1,name:"buyer-shape-open-path",...y?{dash:Rr(u)}:{}});S.setAttr("shapeObjectId",e.id),t.bgLayer.add(S);let x=y?Kc(e,u,t.canvasBackground):null;x&&t.bgLayer.add(x)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let p=n?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,Ne(l,.3),1,ce(l,.12)]}:{fill:l};m=e.x+e.width/2,f=e.y+e.height/2,g={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Kt({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:K(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,g={x:e.x,y:e.y,width:e.width,height:e.height};let p=n?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,Ne(l,.3),1,ce(l,.12)]}:{fill:l};t.bgLayer.add(new Fm({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=zo(e),b=U(p);m=e.points.reduce((x,w)=>x+w.x,0)/e.points.length,f=e.points.reduce((x,w)=>x+w.y,0)/e.points.length,g=b;let y=n?{fillLinearGradientStartPoint:{x:0,y:b.y},fillLinearGradientEndPoint:{x:0,y:b.y+b.height},fillLinearGradientColorStops:[0,Ne(l,.3),1,ce(l,.12)]}:{fill:l},S=Be(p,Ko(e),{stroke:d,strokeWidth:u,opacity:h,listening:!1},Vo(e)??void 0);S.setAttrs({x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,...y}),t.bgLayer.add(S)}g&&e.role&&t.landmarkBoxes.push(g);for(let p of Yo(e))t.bgLayer.add(new _m({points:p.points.flatMap(b=>[b.x,b.y]),closed:p.closed,x:m,y:f,offsetX:m,offsetY:f,rotation:e.rotation??0,stroke:p.ink??Uo,fill:p.fill,strokeWidth:2,opacity:h*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(n){let{node:p,spec:b}=Wm(t,m,f,e.label,l,g,e.labelStyle);t.primaryFocalLabels.set(p,b),t.freeTextById.set(e.id,{node:p,background:l,plate:b.plate,kind:"stage"})}else if(r){let p=o||s,b=X(l,p?"#e6e9f0":"#9aa3b5"),y=Xt(t,t.bgLayer,e.label,m,f,b,p?18:12,!1);p&&t.primaryFocalLabels.set(y,{targetPx:18,trackingRatio:0,ink:String(y.fill()??""),plateInk:String(y.fill()??""),plate:new Kt({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:y,background:l,kind:"decor",...p?{}:{area:co(e.rotation,g,m,f,12,b,l)}})}else{let p=X(l,"#cbd5e1"),b=Xt(t,t.bgLayer,e.label,m,f,p,16,!0);t.freeTextById.set(e.id,{node:b,background:l,kind:"decor",area:co(e.rotation,g,m,f,16,p,l)})}}var bo=22,Uc=H,zi=6,Gm=.5;function Wm(t,e,i,n,o,r,s){let a=s?.size??bo,l=s?.color??t.theme.textColor??"#e6e9f0",c=s?.color??X(o,l),d=r?r.x+r.width/2:e,u=r?r.y+r.height/2:i,h=Vm(t.canvasBackground,o),m=new Kt({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 yo({x:d,y:u,text:n,fontSize:a,fontStyle:$n(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/bo),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/bo,...s?.direction?{direction:s.direction}:{},ink:c,plateInk:s?.color??X(h,l),plate:m}}}function Vm(t,e){return j(e,D(t)?"#ffffff":"#000000",.34)}function Jc(t,e,i,n,o=0){let r=Math.max(i,1e-4),s=o>0&&r>o?r/o:1,l=Math.min(e.targetPx,Math.max(Uc,e.targetPx*Gm)*s)/r,c=b=>{t.letterSpacing(b*e.trackingRatio),n(t,b)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let u=No(e.direction,d);t.rotation(u?90:0);let h={width:(u?d.height:d.width)-zi*2,height:(u?d.width:d.height)-zi*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(Uc/r,l*m),c(l)),t.width()<=h.width&&t.height()<=h.height){e.plate.opacity(0),t.fill(e.ink);return}let g=(u?t.height():t.width())+zi*2,p=(u?t.width():t.height())+zi;e.plate.size({width:g,height:p}),e.plate.offset({x:g/2,y:p/2}),e.plate.opacity(1),t.fill(e.plateInk)}function ed(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",n=t.canvasBackground,o=yr(i,n,We),r=t.theme.textColor??"#e6e9f0",s=X(o,r),a=Be(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",g=>{t.isGhostClick(g)||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=Qt(e.points,e.holes),c=t.sections.find(g=>te(l,g.outline,g.holes)),d=Ge(e)??ti,u=Ct(e)?Xt(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-.5-d/2,s,d,!1):void 0,h=Xt(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,ii,!1);u&&t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:u,background:o,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:o,kind:"ga-capacity",categoryKey:e.categoryKey});let m=xt(e)>0?new Om({data:nt(["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:o,strokeColor:i,labelPoint:l,labelNode:u,...Ge(e)!==void 0?{nameSize:d}:{},capacityNode:h,...m?{wheelchairGlyph:m}:{},...c?{sectionId:c.logicalId}:{}};t.gaById.set(e.id,f),mo(f)}function Xt(t,e,i,n,o,r,s,a){let l=new yo({x:n,y:o,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 td(t,e){let i=[],n=e.canvasBackground,o=new Map,r=(d,u)=>{let h=o.get(d)??[];h.push(u),o.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=(o.get(m)??[]).slice().sort((A,E)=>s(A)-s(E));if(!f.length)continue;let g=f[0],p=f[f.length-1],b=h?.labelStyle,y=h?.style==="pill"?Ot(n):null,S=y?y.plate:n,x=he(S,b?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Ve),w=b?.size??pr,k=h?.rotation??0,v=e.objectFilteredOut(d)?.15:1,C=f.reduce((A,E)=>A??e.seatSection.get(E.id),void 0),T=d.segmentedRow?.displayLabel??d.displayLabel??It(d.label,C?.label);if(!T)continue;let L=C?[...new Set([C.id,C.logicalId,C.zone].filter(A=>!!A))]:void 0,I=(A,E,z)=>i.push({text:T,x:A,y:E,rotation:k,fontSize:w,ink:x,opacity:v,rowKey:m,...y?{pill:y}:{},...L?.length?{focusKeys:L}:{},...z?{automaticAway:z}:{}});if(h?.position){I(h.position.x,h.position.y);continue}let R=e.seatR+12,M=h?.positionPreset??"start";if(M==="start"||M==="both"){let A=d.rotation*Math.PI/180,E={x:-Math.cos(A),y:-Math.sin(A)};I(g.x+E.x*R,g.y+E.y*R,E)}if(M==="end"||M==="both"){let A=(d.rotation+d.curve)*Math.PI/180,E={x:Math.cos(A),y:Math.sin(A)};I(p.x+E.x*R,p.y+E.y*R,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 So(t,e,i=ee){let n=t.rotation()*Math.PI/180,o=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=(t.width()*o+t.height()*r)/2+i,a=(t.width()*r+t.height()*o)/2+i;return{x:e.x-s,y:e.y-a,width:s*2,height:a*2}}function id(t,e,i,n){let o={x:e.x,y:e.y},r=e.automaticAway;if(!r)return o;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=o,d=1/0,u=1/0;for(let h of l){let m={x:o.x+h.x,y:o.y+h.y},f=So(t,m),p=(n?rt(n,f,{mode:"overlap"}).length:0)+i.collisionCount(f),b=Math.hypot(h.x,h.y);if((p<d||p===d&&b<u)&&(c=m,d=p,u=b),p===0)break}return c}var Ki=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,n,o,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&&o(),d();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.generationCount&&o()}).catch(()=>{s===this.generationCount&&this.errors.push(`${n} could not be decoded.`)}).finally(d)},e.onerror=()=>{s===this.generationCount&&this.errors.push(`${n} 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 nd(t,e){let i=e,n=i._cache instanceof Map?i._cache:null,o=i._canvasCache??n?.get("canvas");if(!o){e.isCached?.()&&e.clearCache();return}let r=[o.scene,o.filter,o.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&t.Util.releaseCanvas(...r),i._canvasCache&&(i._canvasCache=void 0),n?.delete("canvas")}function od(t,e){let i=0,n=0,o=r=>{i||(i=r),n+=1;let s=r-i;s>=1e3&&(t(Math.round(n*1e3/s)),n=0,i=r),e(requestAnimationFrame(o))};e(requestAnimationFrame(o))}function zm(t){return t<0?0:t>1?1:t}function rd(t){let e=t.now??(()=>typeof performance<"u"?performance.now():Date.now()),i=t.budgetMs??8,n=t.reducedMotion===!0,o=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 b=c.length-1;b>=0;b--){let y=c[b],S=n?1:zm((p-y.startedAt)/160);t.fade(y.work,S),S>=1&&c.splice(b,1)}return c.length>0},g=()=>{if(s)return;let p=e(),b=p;for(;r<t.chunks.length&&(r===0||e()-b<i);){let S=t.chunks[r++];if(t.build(S.work),t.fade(S.work,n?1:0),n||c.push({work:S.work,startedAt:p+(r-1)*o}),e()-b>=i)break}let y=f(p);t.draw(),r<t.chunks.length||y?h(g):m()};return h(g),{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 Km={width:40,height:30,rotation:0};function sd(t,e){let i=1/0,n=1/0,o=-1/0,r=-1/0;for(let s of t){if(s.kind==="booth"){let l=e.boothDims.get(s.rowId)??Km;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<n&&(n=s.y+f.y),s.x+f.x>o&&(o=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<n&&(n=s.y-m),s.x+h>o&&(o=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<n&&(n=s.y-a),s.x+a>o&&(o=s.x+a),s.y+a>r&&(r=s.y+a)}return isFinite(i)?{x:i,y:n,width:o-i,height:r-n}:null}function ad(t){let e=new Map,i=[];for(let o of t.seats){let r=t.sectionIdOf(o.id);if(r==null){i.push(o);continue}let s=e.get(r);s?s.push(o):e.set(r,[o])}let n=[...e.entries()].flatMap(([o,r])=>{let s=t.sections.find(a=>a.id===o);return s?[{chunk:{id:o,work:{seats:r,group:s.liftGroupSeat}},distance:Math.hypot(s.centroid.x-t.viewportCentre.x,s.centroid.y-t.viewportCentre.y)}]:[]}).sort((o,r)=>o.distance-r.distance).map(o=>o.chunk);return i.length&&t.looseGroup&&n.push({id:"",work:{seats:i,group:t.looseGroup}}),n}var ld=!1;function cd(t){return t&&t!=="flat"&&!ld&&(ld=!0,console.warn(`[seatlayer] view mode '${t}' was removed; the map shows the flat view. Pass 'flat', or use the Map | 3D control for the immersive venue view.`)),"flat"}var dd=(t,e)=>t.length===e.length&&t.every(i=>e.some(n=>Math.abs(i.x-n.x)<.001&&Math.abs(i.y-n.y)<.001));function hd(t,e){let n=(t?.floors?.length?t.floors.flatMap(c=>c.objects):t?.objects??[]).filter(c=>c.type==="section"),o=e.logicalSectionId??e.id,r=c=>(c.elevation??0)===(e.elevation??0)&&JSON.stringify(c.geometry??null)===JSON.stringify(e.geometry??null),s=n.find(c=>c.id===o),a=o!==e.id&&!!s&&r(s)&&(s.holes??[]).some(c=>dd(c,e.outline)),l=n.filter(c=>c.id!==e.id&&c.logicalSectionId===e.id&&r(c));return{hidden:a,holes:(e.holes??[]).filter(c=>!l.some(d=>dd(c,d.outline)))}}import{Group as ud}from"konva/lib/Group";import{Rect as Xm}from"konva/lib/shapes/Rect";import{Text as vo}from"konva/lib/shapes/Text";function pd(t,e){let i=Qt(e.outline,e.holes),n=ae(t.canvasBackground),o=[],r=new Map,s=0,a=U(e.outline),l=t.seatIndex?rt(t.seatIndex,a).map(L=>t.seatById.get(L)).filter(L=>!!L):t.seats;for(let L of l)t.seatSection.has(L.id)||te(L,e.outline,e.holes)&&(o.push(L.id),r.set(L.categoryKey,(r.get(L.categoryKey)??0)+1),(t.statusById.get(L.id)??"free")==="free"&&s++);let c=e.color??ei([...r].map(([L,I])=>({hex:t.catColor.get(L)??"#6e7bff",w:I})),"#3a4358"),d=new ud({listening:!1});t.bgLayer.add(d);let u=new ud({listening:!1});d.add(u);let h=new gt({listening:!0});t.seatLayer.add(h);let m=u,f=hd(t.chartDoc,e),g=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",p=Be(e.outline,f.holes,{visible:!f.hidden,stroke:O(g,.5),strokeWidth:1,fill:O(g,.08),listening:!1},e.outlinePath);m.add(p);let b=Be(e.outline,f.holes,{visible:!f.hidden,fill:n.sectionFill,stroke:n.sectionStroke,strokeWidth:Ke,opacity:0,listening:!1},e.outlinePath);m.add(b);let y=e.labelPresentation?.labelStyle,S=y?.color,x=n.sectionInk,w=(y?.size??18)/18,k=new Xm({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});m.add(k);let v=new vo({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*w,fontStyle:Xe,fontFamily:t.labelFont(),fill:he(n.sectionFill,S,x),listening:!1,perfectDrawEnabled:!1});v.offsetX(v.width()/2),v.offsetY(v.height()/2),m.add(v);let C=new vo({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Xe,fontFamily:t.labelFont(),fill:he(n.sectionFill,S,x),opacity:0,listening:!1,perfectDrawEnabled:!1});m.add(C);let P=new vo({x:i.x,y:i.y,text:F("map.seatsLeft",{count:s}),fontSize:12,fontStyle:us,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:n.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});return P.offsetX(P.width()/2),m.add(P),{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]:[],..._a(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(o.map(L=>t.seatById.get(L)?.categoryKey).filter(Boolean)),shellCategoryColor:t.dominantSellableColor(o),shellFill:n.sectionFill,shellStroke:n.sectionStroke,stateWord:null,...e.labelPresentation?.position&&!te(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:Wo(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:s,baseFill:c,outlineTint:g,outlinePoly:p,blockPoly:b,namePlate:k,nameLabel:v,numberLabel:C,subLabel:P,preferredInk:x,...S?{explicitInk:S}:{},labelScale:w,authoredLabelSize:y?.size!=null,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,rootGroupBg:d,liftGroupBg:u,liftGroupSeat:h}}function md(t,e,i){if(!e?.length)return;let n=new Set(e),o=t.seats.filter(d=>!n.has(d.categoryKey)||t.seatInClosedSection(d.id)?!1:(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id));if(!o.length)return;let r=eo(o.map(d=>d.id),t.seatSection);r&&t.focusSection(r);let s=Math.max(24,t.seatR*3),a=t.clusterLabels.boundsForSeats(o,s),l=je(o,s);if(a?.singleBlock&&(!t.hasSections||r!=null)){let d=t.clusterLabels.diveTarget(a.bounds,a.anchor);if(d){t.focusRegion(d,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),maxScale:bt(t)});return}}let c={x:l.x+l.width/2,y:l.y+l.height/2};Jn({stage:t.stage,box:l,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(c)})||t.focusRegion(l,{animate:i?.animate,durationMs:t.cameraGlideMs})}function bt(t){let e=wc(Math.max(t.seatR,t.markerR));return Math.max(e,el(t.markerR))}var fd=.25;function Um(t,e){if(e.length===0)return 1/0;let i=je([...e],t.sellableUnit.diameter/2),n=t.framingViewport();return Math.min(n.width*fd/Math.max(i.width,1e-6),n.height*fd/Math.max(i.height,1e-6))}function gd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let n=bd(t,i);if(!n.length)return!1;t.clearSectionFocus();let o=Math.max(24,t.seatR*3),r=je(n,o),s={x:r.x+r.width/2,y:r.y+r.height/2};return Jn({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:bt(t)}),!0}function bd(t,e){return t.seats.filter(i=>t.seatInClosedSection(i.id)||Ie(i,e)!=="match"?!1:(t.statusById.get(i.id)??"free")==="free"||t.ownedHold.has(i.id))}function yd(t,e,i){let n=i===void 0?t.accessFilter:i;if(!n||!t.sections.some(r=>r.id===e||r.logicalId===e))return!1;let o=t.sectionMembers(e).filter(r=>{if((t.statusById.get(r)??"free")!=="free")return!1;let s=t.seatById.get(r);return s!=null&&Ie(s,n)==="match"});return o.length&&wo(t,o)||t.focusSection(e),!0}function Sd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=bd(t,i);if(!n.length)return null;let o=Math.max(24,t.seatR*3),r=je(n,o),s=t.getWorldBounds(),a=s.width>0&&s.height>0&&r.width>=s.width*Dt&&r.height>=s.height*Dt;return{spaces:n.length,sections:xo(t,i),wholeVenue:a}}function wo(t,e,i){let n=e.map(h=>t.seatById.get(h)).filter(h=>h!=null);if(!n.length)return!1;let o=t.seatPitch>0?t.seatPitch:t.seatR*2,r=je(n,Math.max(24,t.seatR*3,o*4)),s=t.getWorldBounds();if(s.width>0&&s.height>0&&r.width>=s.width*Dt&&r.height>=s.height*Dt)return!1;let a=eo(n.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=Um(t,n);return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:d,maxScale:Math.max(Math.min(bt(t),u),d)}),!0}function vd(t,e,i=!0,n){let o=t.sectionBounds(e);if(!o)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,l=t.focusedRowLabelGutter(e),c=t.narrowSeatDetailFocus(a,o,n,l);t.focusRegion(c?.bounds??o,{animate:i,minScale:c?.minScale,maxScale:bt(t),focusPaddingPx:l})}function ko(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let n=wd(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,n),n}function wd(t,e,i){return vl(e.memberIds,i,n=>t.statusById.get(n)??"free",n=>t.seatById.get(n))}function xo(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return[];let n=i===t.accessFilter,o=new Map;for(let r of t.sections){if(t.isSectionClosed(r))continue;let s=n?ko(t,r):wd(t,r,i);if(s<=0)continue;let a=o.get(r.logicalId);a?a.free+=s:o.set(r.logicalId,{id:r.logicalId,label:r.label,free:s})}return[...o.values()]}var qm=1800,Yt=class Yt{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=qn;this.effSelection=pt;this.colorblind=!1;this.cbHueByKey=new Map;this.colourOverride=null;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 Fi;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.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=Sc();this.fitScale=1;this.fitPose="";this.viewportInsets={...lo};this.fitClearance={bottom:0,width:0};this.seatR=J;this.markerR=J;this.seatPitch=0;this.sellableUnit=jn(J);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 Ki;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 Gi({overlayLayer:()=>this.overlayLayer,stageScale:()=>this.stage.scaleX(),screenToWorld:e=>this.screenToWorld(e),selectionColor:()=>this.effSelection,seats:()=>this.seats,isSelectable:e=>this.isSelectable(e),applyBand:(e,i,n)=>{this.opts.onBand?.(e,i,n)||(n?this.deselect(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 n=this.focusedId?this.nearestSeat(this.focusedId,i):this.seats[0]?.id??null;n&&this.focusSeat(n);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let n=this.seatById.get(this.focusedId);n&&this.opts.onFocusSeat?.(n)}};this.focusRingLinger=null;this.cameraHostCache=null;this.viewportWanted=[];this.viewportPinSync=!1;this.selectionFollowUps=new Wi(()=>{this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)});this.interactionHostCache=null;this.seatLabelTargetScale=sc(()=>({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?ft(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 n=Xi.pixelRatio;if(this.exportMode&&(this.dpr=1),Xi.pixelRatio=this.dpr,this.stage=new Ym({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Hi(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",F("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Lo({listening:!this.exportMode}),this.seatLayer=new Lo({listening:!this.exportMode}),this.overlayLayer=new Lo({listening:!1}),this.labelGroup=new Ut({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new Ut({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new Ut({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new Ei({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:()=>ol(this.sellableUnit),pickableScale:()=>Mi(this.sellableUnit),categoryLabel:o=>this.catByKey.get(o)?.label??"",categoryColor:o=>this.categoryDisplayColor(o),categoryFilter:()=>this.categoryFilter,seatsPickable:()=>this.seatsPickable(),screenToWorld:o=>this.screenToWorld(o),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(o,r)=>this.focusRegion(o,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new kd({radius:J+2,stroke:"#ffffff",strokeWidth:2,opacity:Ni,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new kd({radius:J+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&&(Xi.pixelRatio=n),!this.exportMode){this.wireInteraction();let o=this.opts.onFps;o&&od(o,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 zt: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 ki({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(),seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(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 xi({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,n,o){this.hoverCard.presentSeat(e,i,n,o)}get hoverCard(){return this.hoverCardCache||(this.hoverCardCache=new Ii({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,ue,!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,seatCardHead:e=>this.opts.hoverCardHead?.(e)??null,sectionCardHead:(e,i)=>this.opts.hoverSectionHead?.(e,i)??null})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new Li({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>Bt(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 n=this.sectionTapAnchor(i,this.seatById.get(e.seatId)??{x:0,y:0});this.opts.onSectionTap?this.opts.onSectionTap(i,n):this.focusSection(i,{anchor:n})}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(n=>n.id).filter(n=>{let o=this.seatSection.get(n);return!!o&&(o.logicalId===e||o.id===e)});return i.length>0&&this.focusSeats(i)}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(ma({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);if(!i.length)return{x:e.nameLabel.x(),y:e.nameLabel.y()};let n=0,o=0;for(let r of i)n+=r.x,o+=r.y;return{x:n/i.length,y:o/i.length}}get owned(){return this.ownedCache||(this.ownedCache=new Ti({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 n of e.memberIds){if(!this.selection.has(n)&&!this.ownedHold.has(n))continue;let o=this.seatById.get(n);o&&i.push(o)}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=>jl(e,{manageMode:this.opts.manageMode===!0,marqueeSelect:this.opts.marqueeSelect===!0}),beginMarquee:(e,i)=>this.marquee.begin(e,this.opts.marqueeShape==="lasso"?"lasso":"box",i),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 zt:null,this.rowBandZoomAnchor=null;let n=e===this.chartDoc;if(n||(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??jt(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 o=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 Ut({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),n||this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.selectionFocusKeep=null,n||this.statusById.clear(),this.accessFreeBySection.clear(),n||(this.selection.clear(),this.selectedSeatById.clear()),this.seatById.clear(),this.seatIndex=null,this.cached=!1,n||(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.hasSections=o.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=ci(this.theme.seatScale)*J,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,Si[l%Si.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=bc(o.objects);for(let a of o.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}))}:{},...Ct(a)?{}:{nameHidden:!0},...Ge(a)?{nameSize:Ge(a)}:{}});if(this.seats=De(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!n){let a=o===e?this.seats:De(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=Lr(this.seats,{seatRadius:this.seatR}),this.seatPitch=ja(this.seats),this.markerR=Ja(this.seatR,this.seatPitch),this.sellableUnit=nl(this.seats,{markerRadius:this.markerR,blockDims:this.boothDims}),this.clusterLabels.rebuild(),this.bounds=Zo(o,{freeText:"exclude"}),this.renderBackground(o),this.unsectionedSeatGroup=new Ut({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.loadingReveal==="viewport"&&!this.exportMode&&this.sections.length>1;r&&this.startViewportSeats();let s=this.seatRevealWanted();this.seatRevealPending=s,this.revealWorldRect=s||r?sd(this.seats,{seatR:this.seatR,boothDims:this.boothDims}):null,!s&&!r&&this.renderSeats(),this.buildRowLabelPlan(o),this.overlayLayer.add(this.labelGroup,this.fgDecorGroup),this.overlayLayer.add(this.hoverRing,this.focusRing),tc(this.overlayLayer,this.chartDoc,this.activeFloorId,!this.floorOverview&&!this.stacked&&!this.exportMode),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=ad({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=rd({chunks:e,build:i=>this.renderSeats(i.seats),fade:(i,n)=>i.group.opacity(n),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 n=this.viewportSeats;this.viewportSeats=null,e?n.finish():n.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:kt(e)};if(this.floorOverview&&e.floors.length>=2)return tt(e)==="combined"?tr(e):er(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...qo(e),referenceImage:void 0,backgroundImage:kt(e)};let i=e.floors.find(n=>n.id===this.activeFloorId)??e.floors[0];return{...e,objects:i.objects,focalPoint:i.focalPoint,referenceImage:void 0,backgroundImage:kt(i),floors:void 0}}floorBaseHeightMFor(){let e=this.chartDoc?.floors;return e?.length?e.find(i=>i.id===this.activeFloorId)?.baseHeightM??0: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&&tt(this.chartDoc)!=="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?jt(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let n=!1,o=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),n=!0),o){let l=this.seatSection.get(r);l&&(this.accessFreeBySection.delete(l.id),s==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),o.add(l))}}if(o&&o.size){for(let r of o)this.refreshSectionFill(r);this.bgLayer.batchDraw()}n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setSeatCategories(e){let i=!1,n=!1,o=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),n=!0);let d=this.seatSection.get(s);d&&o.add(d)}if(!i)return;let r=new Map((this.chartDoc?jt(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of o){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=ei([...l].map(([c,d])=>({hex:this.catColor.get(c)??"#6e7bff",w:d})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}o.size&&this.bgLayer.batchDraw(),n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setOwnedHold(e){let i=new Set((e??[]).filter(o=>this.statusById.has(o))),n=new Set([...this.ownedHold,...i]);this.ownedHold=i,this.selectionFollowUps.batch(()=>{for(let o of n){let r=this.circleById.get(o);r&&this.paintSeat(r,o),this.syncSelectionMarker(o)}}),n.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;let n=this.selectionFocusId;this.selectionFocusId=i,this.selectionFocusKeep=Ul({focusedId:i,seats:this.seats,seatId:s=>s.id,seatPoint:s=>s,sectionOf:s=>this.seatSection.get(s)?.logicalId??null,seatPitch:this.seatPitch,seatRadius:this.seatR});let r=n!=null&&i!=null&&Yl(n,i,s=>this.seatSection.get(s)?.logicalId??null)?[n,i]:this.seats.map(s=>s.id);for(let s of r){let a=this.circleById.get(s);a&&this.paintSeat(a,s)}n&&this.syncSelectionMarker(n),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 n of i){let o=this.circleById.get(n);o&&this.paintSeat(o,n)}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 n=this.seatById.get(i)??this.selectedSeatById.get(i);n&&e.push(n)}return e}clearSelection(){let e=[...this.selection];this.selectionFollowUps.batch(()=>{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=[];return this.selectionFollowUps.batch(()=>{for(let n of e){if(this.selection.has(n)||!this.isSelectable(n))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(n,!0,!0);let o=this.seatById.get(n);o&&i.push(o)}}),i.length&&this.overlayLayer.batchDraw(),i}setManageInteraction(e){this.marquee.cancel(),this.gestures.resetPan();let i=e.organizerStatus!==!1,n=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 o=[...this.selection].filter(r=>!this.isSelectable(r));o.length&&this.deselect(o),!e.manageMode&&this.selection.size&&this.clearSelection(),this.clusterLabels.syncCursor(!1),n&&this.repaintSectionsAndSeats(),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[i,n]of Object.entries(e??{}))Number.isFinite(n)&&this.sectionHeat.set(i,Math.max(0,Math.min(1,n)));for(let i of this.sections)this.refreshSectionHeat(i);this.bgLayer.batchDraw()}deselect(e){let i=!1;this.selectionFollowUps.batch(()=>{for(let n of e)this.selection.has(n)&&(this.setSelected(n,!1,!0),i=!0)}),i&&(this.overlayLayer.batchDraw(),this.effScale()>ie&&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),n=[];for(let o of this.seats)i.has(o.label)&&this.isSelectable(o.id)&&n.push(o.id);return this.selectMany(n)}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=[],n=new Set;for(let o of this.sections)if(!(o.id!==e&&o.logicalId!==e&&o.zone!==e))for(let r of o.memberIds){if(n.has(r)||(n.add(r),!this.isSelectable(r)))continue;let s=this.seatById.get(r);s&&i.push(s)}return i}selectMany(e){let i=e.filter(o=>!this.selection.has(o));if(!i.length)return this.getSelection();let n=this.selection.size+i.length<=qr;return this.selectionFollowUps.batch(()=>{for(let o of i)if(n)this.setSelected(o,!0,!0);else{this.selection.add(o);let r=this.circleById.get(o);r&&this.paintSeat(r,o)}}),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=[],n=this.rowLabelGroup.find(o=>o.getAttr("rowLabel")===!0);for(let o of n){let r=o.getAttr("rowKey");!r||!o.isVisible()||i.push({rowKey:r,box:o.getClientRect({skipShadow:!0,skipStroke:!0})})}return Hc(e,i)}selectRow(e){let i=Nc(e,this.seats,n=>this.isSelectable(n));return i.length&&(this.selectMany(i),this.opts.onMarquee?.(this.getSelection())),this.getSelection()}flashSeat(e,i="#f43f5e"){let n=this.seatById.get(e);n&&Fl(this.flashHost,n,i)}flashSection(e,i="#22a06b"){_l(this.flashHost,this.sections.filter(n=>n.id===e||n.zone===e),i)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed}}nearestSeat(e,i){let n=this.seatById.get(e);if(!n)return null;let o=n,r=null,s=1/0;for(let a of this.seats){if(a.id===e)continue;let l=a,c=l.x-o.x,d=l.y-o.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 n=this.seatById.get(e);n&&(this.focusedId=e,this.queueViewportPinSync(),this.focusRing.radius(this.seatR+3),this.focusRing.position(n),this.focusRing.scale({x:1,y:1}),this.focusRing.visible(!0),this.clearFocusRingLinger(),i?.transient&&(this.focusRingLinger=setTimeout(()=>{this.focusRingLinger=null,this.dismissFocusRing()},qm)),i?.move!==!1&&this.ensureVisible(n),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(n))}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(),n=this.stage.height(),o=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>n-s;if(this.stage.scaleX()<o||a){let l=e;this.stage.scale({x:o,y:o}),this.stage.position({x:i/2-l.x*o,y:n/2-l.y*o}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=cc(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}setFitClearance(e,i=0){let n={bottom:Math.max(0,e||0),width:Math.max(0,i||0)};n.bottom===this.fitClearance.bottom&&n.width===this.fitClearance.width||(this.fitClearance=n,this.fitPose&&qe(this.stage)===this.fitPose&&this.zoomToFit())}framingViewport(){return dc(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){return lc(e,this.stage.scaleX(),this.bounds,this.framingViewport(),i)}framingWorldRect(){return pc(this.framingViewport(),e=>this.screenToWorld(e))}overview(){this.clearSectionFocus(),this.zoomToFit()}zoomToFit(){ic(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(),zones:()=>this.zones,markerR:()=>this.markerR,unitZoomCeiling:()=>Math.max(rl(this.sellableUnit),this.hasSections?we:0),bounds:()=>this.bounds,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 hc(this.stage)}setCameraPose(e){this.cancelGlide(),uc(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()*Yt.ZOOM_STEP,Vt(this.framingViewport()))}zoomOut(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()/Yt.ZOOM_STEP,Vt(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();return{x:e.x*i+this.stage.x(),y:e.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 n of this.sections)this.refreshSectionFill(n);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((n,o)=>n===e[o])}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);hl(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(){Fc({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=>Ec(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<Z,effScale:()=>this.effScale(),labelLegible:e=>be(e,this.effScale())})}setGAStates(e){_c(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),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.rowBandPreview.detailScale:0,framingViewport:()=>this.framingViewport(),worldToScreen:e=>this.worldToScreen(e),getWorldBounds:()=>this.getWorldBounds(),narrowSeatDetailFocus:(e,i,n,o)=>this.narrowSeatDetailFocus(e,i,n,o),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){md(this.focusFramingContext,e,i)}diveCeiling(){return bt(this.focusFramingContext)}focusAccessibleSeats(e){return gd(this.focusFramingContext,e)}focusAccessibleSection(e,i){return yd(this.focusFramingContext,e,i)}accessibleSpread(e){return Sd(this.focusFramingContext,e)}setViewMode(e){cd(e),this.afterViewChange()}getViewMode(){return"flat"}effScale(){return this.stage.scaleX()}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.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 n=this.seatSection.get(e);return i*(n&&this.sectionMatchesFocus(n)?1:Ce)}sectionScreenBounds(e){return Ba({stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y()},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=Z,i=[],n=96,o=this.stage.width(),r=this.stage.height();for(let s of this.sections){let a=!0;if(e){let c=this.sectionScreenBounds(s);a=c.x+c.width>=-n&&c.y+c.height>=-n&&c.x<=o+n&&c.y<=r+n}this.viewportSeats&&a&&(e||s.id===this.focusedSectionId||s.logicalId===this.focusedSectionId)&&i.push(s.id),s.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(s.id)?.setViewportCulled(!a)}this.viewportSeats&&this.viewportSeats.sync(this.viewportWanted=[...i,"__loose"],this.viewportPins()),this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0)}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(let n of i.memberIds){let o=this.seatById.get(n);o&&e.push(o)}this.unsectionedSeatIds??=this.seats.filter(i=>!this.seatSection.has(i.id)).map(i=>i.id);for(let i of this.unsectionedSeatIds){let n=this.seatById.get(i);n&&e.push(n)}return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}seatLabelContainer(e){let i=this.seatSection.get(e);if(!i)return this.labelGroup;let n=this.labelLiftGroups.get(i.id);return n||(n=new gt({listening:!1}),n.setViewportCulled(i.liftGroupSeat.isViewportCulled()),this.labelGroup.add(n),this.labelLiftGroups.set(i.id,n)),n}viewportPins(){return Xa([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 n=this.seatSection.get(i.id)?.id??"__loose",o=e.get(n);o||e.set(n,o=[]),o.push(i)}this.viewportSeats=new Pi(e,{build:i=>this.renderSeats(i),remove:i=>{for(let n of i)for(let o of[this.circleById,this.accessGlyphById,this.accessRingById,this.boothLabelById])o.get(n.id)?.destroy(),o.delete(n.id);this.glyphMarkers=this.glyphMarkers.filter(n=>!!n.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){sl({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,colorblind:this.colorblind,canvasBackground:this.canvasBackground,circleById:this.circleById,glyphMarkers:this.glyphMarkers,boothDims:this.boothDims,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,accessRingById:this.accessRingById,catByKey:this.catByKey,seatContainer:i=>this.seatContainer(i),buildAccessGlyph:(i,n)=>this.buildAccessGlyph(i,n),paintSeat:(i,n)=>this.paintSeat(i,n),labelFont:()=>this.labelFont()}),this.selectionFollowUps.batch(()=>{for(let i of e)this.selection.has(i.id)&&this.syncSelectionMarker(i.id)})}buildAccessGlyph(e,i){let n=this.seatR*1.5/ye,o=new $m({x:e.x,y:e.y,data:nt(e.accessibility??[])??"",scaleX:n,scaleY:n,fill:ri(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Ic(o),o}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[i,n]of this.accessGlyphById){let o=this.seatR*1.5/ye,s=this.accessGlyphFilterEmphasized(i)?Vr:Wr,a=Math.max(o,s/(ye*Math.max(e,.001)));n.scale({x:a,y:a}),n.visible(this.accessGlyphShouldShow(i))}}accessGlyphFilterEmphasized(e){let i=this.seatById.get(e),n=this.accessFilter;return!!i&&n!==null&&!!i.accessibility?.length&&Te(i,n)}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`${Ye(i.min,this.currency)}\u2013${Ye(i.max,this.currency)}`;let n=this.catPrice.get(e);return typeof n=="number"?Ye(n,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,n])=>[i,{min:n.min,max:n.max}])),!!this.chartDoc)){if(this.catPrice.clear(),this.categoryPriceRanges!==null)for(let i of this.chartDoc.categories){let n=this.categoryPriceRanges?.[i.key]?.min??i.price;typeof n=="number"&&this.catPrice.set(i.key,n)}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.colourOverride?.[e]?this.colourOverride[e]:this.colorblind?this.cbHueByKey.get(e)??Si[0]:this.catColor.get(e)??"#6e7bff":Ma}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??Qe}seatLabelInk(e,i){let n=i.fill();return he(typeof n=="string"?n:"",e.labelStyle?.color,this.theme.seatLabelColor??Qe,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?{...ft(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){$l(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){e!==this.colorblind&&(this.colorblind=e,this.recolourCategories())}setCategoryColourOverride(e){this.colourOverride=e,this.recolourCategories()}recolourCategories(){this.repaintSeats();for(let e of this.sections)e.shellCategoryColor=this.dominantSellableColor(e.memberIds),this.refreshSectionFill(e);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(n=>this.dimmedSections.has(n))||(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(n=>this.closedSections.has(n))||(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(n=>n.id===e||n.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 wo(this.focusFramingContext,e,i)}focusSectionCamera(e,i=!0,n){if(this.rowBandPreview&&!this.exportMode){let o=this.sectionBounds(e);if(o){let r=Math.min(this.sectionFrameScale(e),this.zoomBounds().max*.85);this.focusRegion(o,{animate:i,maxScale:r});return}}vd(this.focusFramingContext,e,i,n)}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()>=Q}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()>=se}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()>=Mi(this.sellableUnit)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let i=this.sections.filter(n=>n.id===e||n.logicalId===e);if(this.focusBackdrop=Bl(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=Ol(this.focusBackdropHost,i);for(let n of this.selectionMarkers.values())n.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,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 n=i.getClientRect({relativeTo:this.overlayLayer,skipShadow:!0,skipStroke:!0}),o=2;return[{x:n.x-o,y:n.y-o},{x:n.x+n.width+o,y:n.y-o},{x:n.x+n.width+o,y:n.y+n.height+o},{x:n.x-o,y:n.y+n.height+o}]}):[]}}}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,n=-1/0,o=-1/0,r=(s,a)=>{s<e&&(e=s),a<i&&(i=a),s>n&&(n=s),a>o&&(o=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,n-e),height:Math.max(1,o-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(i=>{let n=this.isSectionClosed(i)||i.free<=0,o=i.memberIds.some(a=>this.selection.has(a)),r=o||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:o?"selected":n?"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),n={x:this.stage.x(),y:this.stage.y()};this.stage.position(this.constrainPan({x:n.x+this.stage.width()/2-i.x,y:n.y+this.stage.height()/2-i.y},n)),this.afterViewChange(),this.stage.batchDraw()}panScreenBy(e,i){if(Math.abs(e.x)<.5&&Math.abs(e.y)<.5)return;this.cancelGlide();let n=this.stage.x(),o=this.stage.y(),r=this.constrainPan({x:n+e.x,y:o+e.y},{x:n,y:o}),s=r.x-n,a=r.y-o;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:n+s*m,y:o+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){Ea(this.readingAidsHost,e)}setLabelLayers(e){Aa(this.readingAidsHost,e)}getLabelLayers(){return{...this.labelLayers}}setCategoryColours(e){Fa(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=kt(e);i&&this.renderBackgroundImage(i);for(let n of e.objects)n.type==="decorImage"&&this.renderDecorImage(n);for(let n of e.objects)n.type==="section"&&this.renderSection(n);for(let n of e.objects)n.type==="shape"?this.renderShape(n):n.type==="gaArea"?this.renderGA(n):n.type==="table"?this.renderTable(n):n.type==="text"&&this.renderText(n);this.renderZones(e)}trackAssetImage(e,i,n,o){this.assets.track(e,i,n,o,{exportMode:this.exportMode})}cancelAssetLoads(){this.assets.cancelAll()}renderBackgroundImage(e){$c(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,n,o)=>this.trackAssetImage(e,i,n,o),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){qc(this.objectDrawContext,e)}renderTable(e){Zc(this.objectDrawContext,e)}renderText(e){Qc(this.objectDrawContext,e)}renderShape(e){jc(this.objectDrawContext,e)}renderGA(e){ed(this.objectDrawContext,e)}renderSection(e){let i=pd(this.sectionBuildContext,e);for(let n of i.memberIds)this.seatSection.set(n,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,labelFont:()=>this.labelFont(),dominantSellableColor:e=>this.dominantSellableColor(e)}}refreshSectionHeat(e){Sl(this.sectionLodPaintContext,e)}refreshSectionFill(e){wl(this.sectionLodPaintContext,e)}isSectionClosed(e){return io(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=Ms(e,n=>this.seatById.get(n)?.categoryKey,n=>this.catByKey.get(n)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return ko(this.focusFramingContext,e)}accessibleSections(e){return xo(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,glideInProgress:this.glideInProgress,reducedMotion:this.reducedMotion,seatCount:this.seats.length,lodScale:this.lodScale,fitScale:this.fitScale,setLodScale:i=>{this.lodScale=i},worldToScreen:i=>this.worldToScreen(i)}}renderZones(e){this.opts.manageMode||Va({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,derivedFloorGroups:!!this.chartDoc&&tt(this.chartDoc)==="combined"&&!this.chartDoc.zones?.length,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let i=this.stage.scaleX();return{x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i}}sectionAt(e){if(!this.sections.length)return null;let i=this.screenToWorld(e),n=this.sections.find(o=>te(i,o.outline,o.holes));return n?n.logicalId:null}pressLandsOnChart(e){if(this.sectionAt(e)||Oi(this.selectionMarkers,e))return!0;let i=this.screenToWorld(e);for(let n of this.gaById.values())if(te(i,n.points,[]))return!0;return this.owned.badgeAt(i)||this.clusterLabels.clusterAt(i)||ho(this.tableFootprints,this.seats,i,this.effScale())||this.nearestSeatToScreen(e,ue,!0)?!0:(this.stacked||this.floorOverview)&&this.deckFloorAt()!==null}sectionInteractive(e){let i=this.sections.filter(n=>n.id===e||n.logicalId===e||n.zone===e);return!i.length||this.opts.manageMode?!0:i.some(n=>!this.isSectionClosed(n)&&n.free>0?!0:n.memberIds.some(o=>this.selection.has(o)||this.ownedHold.has(o)))}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?Ie(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()>ie&&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?dn(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let n=dn(getComputedStyle(i).backgroundColor);if(n)return n;i=i.parentElement}}return qn}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:D(this.canvasBackground)?$a:pt}setSelected(e,i,n=!1){let o=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());o&&(this.paintSeat(o,e),!n&&!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.selectionFollowUps.request()}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){return Ga({sections:this.sections,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(i,n,o)=>this.resolveAutomaticRowLabelPosition(i,n,o),rowLabelBox:(i,n)=>this.rowLabelBox(i,n)},e)}sectionFrameScale(e){let i=this.sectionBounds(e);return i?Math.min(mt(this.stage,i,this.zoomBounds(),Wt(this.framingViewport(),this.focusedRowLabelGutter(e))),Nt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){return Tc(this.rowLabelPlan,this.labelFont(),e)}deckFloorAt(){return ll(this.screenPickingHost)}nearestSeatToScreen(e,i,n=!1){return al(this.screenPickingHost,e,i,{includeUnavailable:n})}get screenPickingHost(){return{seats:this.seats,stage:this.stage,seatR:this.seatR,selection:this.selection,objectFloor:this.objectFloor,screenToWorld:e=>this.screenToWorld(e),worldToScreen:e=>this.worldToScreen(e),isSelectable:e=>this.isSelectable(e)}}wireInteraction(){Zl(this.interactionHost)}handleSeatTap(e){Ql(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,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),setHoveredId:e=>{this.hoveredId!==e&&(this.hoveredId=e,this.queueViewportPinSync())},seatsPickable:()=>this.seatsPickable(),manageSeatHits:()=>this.opts.manageMode===!0&&this.getRung()==="seats",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),nearestSeatToScreen:(e,i,n)=>this.nearestSeatToScreen(e,i,n),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionMatchesFocus:e=>this.sectionMatchesFocus(e),navigateGroupAt:e=>za({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=>ho(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,n)=>this.zoomAbout(e,i,n),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let n=i?this.worldToScreen(i):Vt(this.framingViewport());this.zoomAbout(Math.max(this.rowBandPreview.detailScale*1.08,this.stage.scaleX()*1.5),n)}else this.opts.onSectionTap?this.opts.onSectionTap(e,i):this.focusSection(e,{anchor:i})},onBackdropTap:this.opts.onBackdropTap??(this.opts.manageMode?()=>this.overview():void 0),onDeckTap:this.opts.onDeckTap}}zoomBounds(){return Gt(this.cameraHost)}zoomAbout(e,i,n="now"){this.rowBandPreview&&this.focusRoams&&(this.rowBandZoomAnchor=i),nc(this.cameraHost,e,i,n)}cancelZoomSettle(){oc(this.cameraHost)}focusRegion(e,i){rc(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 n=performance.now();this.labelGroup.opacity(0);let o=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let s=Math.min(1,(r-n)/90);this.labelGroup.opacity(s),this.stage.batchDraw(),this.labelFadeRaf=s<1?requestAnimationFrame(o):0};this.labelFadeRaf=requestAnimationFrame(o)}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,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(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,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),Wc(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()),n=this.framingViewport(),o=n.width,r=n.height,s=Vt(this.framingWorldRect()),{x:a,y:l}=Oc({rung:e,sections:this.sections,seats:this.seats,viewCentre:s,target:i,width:o,height:r}),c=o/(i*1.12),d=r/(i*1.12);this.focusRegion({x:a-c/2,y:l-d/2,width:c,height:d})}seatRungScale(){return vc(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,n,o=0){let r=Wt(this.framingViewport(),o);return kc({stageWidth:r.width,stageHeight:r.height,fullBounds:i,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:n})}releaseFocusOnPullBack(){this.rowBandPreview&&this.focusedSectionId&&this.effScale()>=Math.min(Z,this.sectionFrameScale(this.focusedSectionId)*.85)||ec({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.exportMode;if(!this.focusedSectionId&&(!i||this.effScale()<Z))return;let o=(i&&e?this.sectionAt(e):null)??Oa({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});!o||o===this.focusedSectionId||(this.focusedSectionId=o,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(o))}scheduleViewChange(){this.exportMode||(this.refreshLabelsWhileMoving(),!this.viewChangeRaf&&(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()})))}refreshLabelsWhileMoving(){this.movingLabelTimer||!this.seats.length||this.effScale()<=ie||(this.movingLabelTimer=setTimeout(()=>{this.movingLabelTimer=null,!(this.destroyed||this.exportMode)&&this.updateLabels()},$r))}sizeLabel(e,i,n){e.fontSize(Math.max(1,i)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(n)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),we+.01,ie):this.effScale(),i=Math.max(e,1e-4);for(let[r,s]of this.primaryFocalLabels)Jc(r,s,i,(a,l)=>{this.sizeLabel(a,l,a.y())},this.fitScale);this.hasSections?(Tl(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&e>=Math.min(Z,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:Z),()=>this.sectionFrameScale(this.focusedSectionId),r=>{let s=r.outline.map(a=>this.worldToScreen(a));return Math.max(...s.map(a=>a.x))>=0&&Math.min(...s.map(a=>a.x))<=this.stage.width()&&Math.max(...s.map(a=>a.y))>=0&&Math.min(...s.map(a=>a.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 n=this.seatGlyphDetail;if(this.seatGlyphDetail=Gs(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail),n!==this.seatGlyphDetail&&this.glyphMarkers.length&&this.moments.resyncMarkers(this.selectionMarkers,()=>this.breath.sync(this.selectionMarkers)),this.viewportSeats){let r=this.seatLayer.opacity()>0;this.seatLayer.listening(r),!r&&this.hoveredId&&this.seatLayer.fire("mouseout");return}let o=!this.exportMode&&!this.rowBandPreview?.active&&e<Z;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),o&&!this.cached){if(this.mountCachePending){this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>{this.recacheTimer=null,this.cacheSeatLayer()},0);return}this.cacheSeatLayer()}else!o&&(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=K(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(){nd(Xi,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)),n=Math.min(...e.map(s=>s.y)),o=Math.max(...e.map(s=>s.x+s.width)),r=Math.max(...e.map(s=>s.y+s.height));return{x:i,y:n,width:Math.max(1,o-i),height:Math.max(1,r-n)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),i=this.stage.height(),n=Math.max(12,Math.min(36,Math.min(e,i)*.025)),o=()=>{let r=this.exportSceneBounds(),s=Math.max(1,e-n*2),a=Math.max(1,i-n*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()};o(),o()}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(o){let r=o instanceof Error?o.message:String(o);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 n=i.getContext("2d");if(!n)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");n.fillStyle=this.canvasBackground,n.fillRect(0,0,i.width,i.height);try{n.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ie):this.effScale();for(let{node:i,backdrop:n,kind:o,showAt:r,area:s}of this.freeTextById.values()){if(o==="ga-label"||o==="ga-capacity"||s)continue;let a=o==="free-text"&&this.nodeBelongsToFocusedSection(i),l=o==="direct-landmark";if(l){let u=Number(i.getAttr("directLandmarkBaseFontSize"))||i.fontSize();i.setAttr("directLandmarkBaseFontSize",u),i.fontSize(Math.max(u,H/e))}let c=r==="detail"&&!this.exportMode&&e<ve,d=l||a||!c&&be(i.fontSize(),e);if(i.visible(d),n?.visible(d),!this.exportMode&&o==="free-text"){let u=Math.min(1,ks/Math.max(i.fontSize()*e,1e-6));i.scale({x:u,y:u}),n?.scale({x:u,y:u})}}gc({freeTextById:this.freeTextById,focalLabels:this.primaryFocalLabels.keys(),seatIndex:this.seatIndex,bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,scale:e});for(let{node:i,fontSize:n}of this.iconNodeById.values())i.visible(this.nodeBelongsToFocusedSection(i)||be(go(i,n,e),e))}nodeBelongsToFocusedSection(e){let i=this.focusedSectionId;if(!i)return!1;this.focusMembershipKey!==i&&(this.focusMembership.clear(),this.focusMembershipKey=i);let n=this.focusMembership.get(e);if(n!==void 0)return n;let o=this.sections.filter(s=>s.id===i||s.logicalId===i||s.zone===i),r=!1;if(o.length){let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),a={x:s.x+s.width/2,y:s.y+s.height/2};r=o.some(l=>te(a,l.outline,l.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.rowLabelPlan=td(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,n=ee){return So(e,i,n)}resolveAutomaticRowLabelPosition(e,i,n){return id(e,i,n,this.seatIndex)}objectFilteredOut(e){let i=e.categoryKey;return i?!!(this.categoryHighlight&&i!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(i)):!1}updateLabels(){il(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,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,n)=>this.resolveAutomaticRowLabelPosition(e,i,n),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),overlayLayer:this.overlayLayer}}handleResize(){this.gestures.invalidateRect();let e=Bc({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 n={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===n.width;r&&this.stage.position({x:this.stage.x()+(e.width-n.width)/2,y:this.stage.y()+(e.height-n.height)/2}),this.refitCurrentView(r)}};Yt.ZOOM_STEP=1.4;var Co=Yt;function xd(t,e){return new Co(t,e)}function Zm(t,e){return t*2*.6*e>=6}function Qm(t,e){t._sceneFunc(e)}function To(t){let e=this,i=e.attrs;Qm(e,t);let n=i.organizerGlyphRadius||1,o=e.getStage(),r=Math.abs((o?o.scaleX():1)*(e.scaleX()||1))||1;if(!Zm(n,r))return;let s=n*.6;t.save(),t.setAttr("strokeStyle",i.organizerGlyphInk||"#000000"),t.setAttr("lineWidth",Math.max(n*.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 Ld(t){return t.attrs.sceneFunc===To}function Cd(t){Ld(t)&&t.setAttr("sceneFunc",void 0)}function jm(t,e,i,n){if(!e){Cd(t);return}let o=t.attrs;o.organizerGlyph=e,o.organizerGlyphInk=i,o.organizerGlyphRadius=n>0?n:1,o.sceneFunc!==To&&t.setAttr("sceneFunc",To)}function Td(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 Io(t,e){let i=t.renderer;if(!i?.focusAccessibleSeats)return!1;let n=e===void 0?t.accessFilter:e;if(!n)return!1;let o=Md(t,n);o&&t.setFloor(o);let r=i.focusAccessibleSeats(n);return r&&t.emitSectionFocus(null),r}function Id(t,e){let i=t.renderer;if(!i?.accessibleSpread)return null;let n=e===void 0?t.accessFilter:e;return n?i.accessibleSpread(n):null}function Pd(t,e,i,n){let o=t.renderer;o&&(t.accessFilter&&(i?.accessibleLeft??0)>0&&o.focusAccessibleSection?.(e,t.accessFilter)||(o.focusSection?o.focusSection(e,n?{anchor:n}:void 0):o.focusRegion?.(e)))}function Rd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=Md(t,i);n&&t.setFloor(n);let o=t.renderer,r=o?.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,o?.focusAccessibleSection?.(a.id,i)||o?.focusSection?.(a.id),t.emitSectionFocus(t.sectionSummary(a.id)),{...a,index:r.indexOf(a),total:r.length}}function Md(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let n=new Set(e),o=l=>n.size===0?!!l.accessible:!!l.accessibility?.some(c=>n.has(c)),r=l=>l.some(c=>c.type==="row"&&(c.overrides??[]).some(o)),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 Ed(t,e){return t.accessFilter?Ie(e,t.accessFilter)==="other":!1}function Ad(t,e){let i=t.renderer;if(!i)return;let n=i.getFocusedSection?.()??null;if(i.clearSectionFocus?.(),e?.length){t.emitSectionFocus(null),t.bandReturnPose||(t.bandReturnPose=i.getCameraPose?.()??null,t.bandReturnSection=t.bandReturnPose?n:null);let r=Jm(t,e);r&&t.setFloor(r),i.focusCategories?i.focusCategories(e):i.zoomToFit();return}let o=t.bandReturnPose!=null;t.bandReturnPose=null,t.bandReturnSection=null,!(t.accessFilter&&Io(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),o&&i.zoomToFit())}function Jm(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let n=new Set(e),o=a=>a.some(l=>l.type==="row"&&(n.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&n.has(c.categoryKey)))||l.type==="gaArea"&&n.has(l.categoryKey)),r=t.getActiveFloorId(),s=i.floors.find(a=>a.id===r);return s&&o(s.objects)?null:i.floors.find(a=>o(a.objects))?.id??null}function Fd(t,e,i){let n=new Map,o=new Map,r=new Map,s=new Map,a=[],l=new Map(Jt(t).map(h=>[h.id,h])),c=ar(t),d=it(t),u=li(t);for(let h of e){n.set(h.label,h.id),o.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,g=m?.type==="row"?m.segmentedRow:void 0,p=g?.displayLabel??(m&&"displayLabel"in m&&typeof m.displayLabel=="string"&&m.displayLabel?m.displayLabel:f),b=i.get(h.rowId),y=m?.type==="table"?"table":m?.type==="booth"?"booth":"seat",S=p,x=g?.displayType?.trim()||(m&&"displayType"in m&&typeof m.displayType=="string"&&m.displayType.trim()?m.displayType.trim():void 0),w=h.displayLabel??h.label,k=w.split("-"),v=b||h.kind==="booth"?void 0:p&&w.startsWith(`${p}-`)?w.slice(p.length+1):k[k.length-1]??w;s.set(h.id,{objectId:h.rowId,objectType:y,sectionLabel:h.sectionId?c.get(h.sectionId):void 0,rowLabel:S,seatNumber:v,...x?{displayType:x,rowType:x}:{},...eg(m,h.sectionId?d.get(h.sectionId):void 0),...m?.type==="row"&&u.has(h.id)?{aisle:!0}:{}})}return{labelToId:n,labelToSeat:o,seatById:r,seatContext:s,allIds:a}}function eg(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 _d(t,e={}){let{baseMs:i=1e3,factor:n=2,maxMs:o=1/0,jitter:r=0,random:s=Math.random}=e,a=Math.min(i*n**Math.max(0,t),o);if(r<=0)return a;let l=Math.min(1,r);return a*(1-l+l*s())}function Bd(t,e,i,n=1){let o=lr(t),r=it(t);return Lt(t).map(s=>{let a=t.categories.find(d=>d.key===s.categoryKey),l=o.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)),...tg(s,i,n),categoryKey:s.categoryKey,tiers:a?.tiers,price:a?.tiers?.[0]?.price??a?.price??0,currency:e,...c?{entrance:c}:{}}})}function tg(t,e,i){let n=sn(t,i),o=an(t,i),r=xt(t),s=i===2&&n.length===1&&n[0]===t.label?on(t):null;if(s){let{min:l,max:c}=rn(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=n.filter(l=>e(l)==="free");return{available:a.length,...r?{wheelchairPlaces:r,wheelchairAvailable:a.filter(l=>o.has(l)).length}:{}}}function Od(t,e,i){let n=Math.floor(e),o=sn(t,i.modelVersion),r=i.modelVersion===2&&o.length===1&&o[0]===t.label?on(t):null;if(r){let{min:d,max:u}=rn(t);return i.alreadyHeld.has(t.label)||i.statusOf(t.label)!=="free"||i.wheelchairOnly&&!xt(t)?null:r==="whole"?n===u?[{label:t.label}]:null:n>=d&&n<=u?[{label:t.label,quantity:n}]:null}let s=an(t,i.modelVersion),a=o.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,n);return c.length===n?c.map(d=>({label:d})):null}function ig(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 Dd(t,e,i={}){let n={};for(let o of t){let r=i.wheelchairOnly===!0?ig(o):null;n[o.id]=e?{available:o.available,selected:e.get(o.id)??0,wheelchairFree:r}:{available:o.available,wheelchairFree:r}}return n}function Nd(t){let e={};for(let[i,n]of t.seatById)t.groupedTableBySeatId.has(i)||t.closedMembers.has(i)||(t.statusOf(i)??"free")==="free"&&(e[n.categoryKey]=(e[n.categoryKey]??0)+1);for(let i of t.groupedTablesByLabel.values()){if(i.chairs.some(o=>t.closedMembers.has(o.id)))continue;let n=i.chairs[0];n&&(t.statusOf(n.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 ng(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function Hd(t,e,i=[]){let n=new Set,o=new Map;for(let r of i)n.add(r.need),o.set(r.need,(o.get(r.need)??0)+r.free);for(let r of t){let s=ng(r);if(!s.length)continue;let a=e(r.id)==="free";for(let l of s)n.add(l),a&&o.set(l,(o.get(l)??0)+1)}return n.size?Ho.filter(r=>n.has(r.key)).map(r=>({key:r.key,count:o.get(r.key)??0})):[]}var CC=5e3,TC={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function og(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 Gd(t){let e=new Set(t.holdLabels),i=t.selection.filter(o=>!e.has(o)&&t.statusOf(o)!=="free");if(!og(t))return{lost:i,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let n=[...t.holdLabels];return{lost:i,holdLapsed:!0,lapsedLabels:n,recoverable:n.filter(o=>t.statusOf(o)==="free")}}function IC(t){return t.lost.length>0||t.holdLapsed}function PC(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function Wd(t,e,i=Date.now()){return e&&i<t+5e3}function Vd(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 zd(t){if(!t?.zones?.length)return[];let e=new Set(cr(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 Kd(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},n=De(e).filter(s=>!t.groupedObjectIds.has(s.rowId)),o=new Set;for(let s of n)t.heldLabels.has(s.label)||t.tierApplies(s)&&(t.accessFilter&&!Te(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&o.add(s.label));let r=Dr(n,o,{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 Po=["background","rowLabelColor","textColor","selectionColor"];function Xd(t,e){return!t||!e?!t&&!e:Po.every(i=>t[i]===e[i])}function yt(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function Ui(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function Ud(t,e,i){let n=nr(e,i);n==="all"?t.setFloorOverview?.(!0):n&&t.setActiveFloor?.(n)}var Me=class extends Error{constructor(i){super(i.message);this.status=422;this.name="PickerSelectionError",this.reason=i.code,this.labels=i.labels}};function Ro(t){return t==="setup"||t==="testable"||t==="live"||t==="paused"||t==="ended"?t:null}function Yd(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var Yi=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 n=this.ref;this.pending=e.eventConfiguration(i).then(o=>{if(o.reference.id!==n.id||o.reference.version!==n.version||o.configuration.id!==n.id||o.configuration.version!==n.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return o.configuration})}return this.pending}};async function $d(t,e,i){if(!t.renderer)return null;let o=e??t.getSelection().map(l=>l.label),r=t.hold_?.items??[],s=[...new Set([...r.map(l=>l.label),...o])];if(!s.length)return null;let a=t.ticketIssue(s);if(a)throw new Me(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 qd(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 n=[...new Set(i.items.map(o=>o.label))];return n.length?(t.setHold({holdId:i.holdId,labels:n,expiresAt:i.expiresAt,items:i.items},"restored"),t.hold_):null}async function Zd(t,e){let i=t.hold_;if(!i||!t.api.extend)return null;try{let n=await t.api.extend(t.key,i.holdId,e);return t.hold_?.holdId!==i.holdId||t.setHold({holdId:i.holdId,labels:i.labels,expiresAt:n.expiresAt,items:i.items}),t.hold_}catch{return null}}async function Qd(t,e,i,n){let o=t.renderer;if(!o)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 Me(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)}}),n,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}=yt(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&&(o.setStatus(f,"booked"),o.deselect(f),t.resetTableQuantitiesForLabels(m));let g=r.filter(p=>!m.has(p));g.length&&a&&t.api.release(t.key,g,a).catch(()=>{}),t.emitSelectionChange()}else a&&t.api.release(t.key,r,a).catch(()=>{});throw c}let l=t.idsForLabels(r);return l.length&&(o.setStatus(l,"booked"),o.deselect(l)),t.clearHold(),t.resetTableQuantitiesForLabels(r),t.emitSelectionChange(),t.opts.onBook?.(e),r}async function jd(t){let e=t.hold_;if(!e)return!0;try{let n=await t.api.release(t.key,e.labels,e.holdId);if(!t.releaseConfirmed(n,e.labels))return await t.resnapshot(),!1}catch(n){return t.emitError(n),!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 Jd(t,e){let i=t.hold_;if(!i)return!0;let n=e.filter(a=>i.labels.includes(a));if(!n.length)return!0;try{let a=await t.api.release(t.key,n,i.holdId);if(!t.releaseConfirmed(a,n))return await t.resnapshot(),!1}catch(a){return t.emitError(a),!1}if(t.hold_?.holdId!==i.holdId)return!0;let o=i.labels.filter(a=>!n.includes(a)),r=i.items?.filter(a=>!n.includes(a.label));o.length?t.setHold({...i,labels:o,items:r}):t.clearHold(),t.resetTableQuantitiesForLabels(n);let s=t.idsForLabels(n);return s.length&&(t.renderer?.deselect(s),t.renderer?.setStatus(s,"free")),!0}function eh(t,e){let i=t?.released;return!Array.isArray(i)||e.every(n=>i.includes(n))}function th(t,e){let i=t.hold_;if(!i||i.labels.length!==e.length||!e.every(r=>i.labels.includes(r)))return!1;let n=new Map((i.items??[]).map(r=>[r.label,r.tierId])),o=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))&&(!o.has(r)||o.get(r)===a.quantity))&&(!n.has(r)||n.get(r)===l)})}function ih(t,e){let{status:i,conflicts:n}=yt(e);if(i!==409||!n?.length)return;let o=t.renderer;if(!o)return;let r=t.idsForLabels(n.map(s=>s.label));r.length&&(o.deselect(r),o.setStatus(r,"held"),t.resetTableQuantitiesForLabels(n.map(s=>s.label))),t.emitSelectionChange()}function nh(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 n={...e,seats:t.seatsForLabels(e.labels)};t.hold_=n,t.renderer?.setOwnedHold?.(t.idsForLabels(n.labels)),t.expiryTimer&&clearTimeout(t.expiryTimer);let o=Math.max(0,n.expiresAt-Date.now());t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},o),i==="restored"?t.opts.onHoldRestored?.(n):t.opts.onHold?.(n)}function oh(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function rh(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(Wd(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function sh(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function ah(t,e,i,n){if(i!=null&&!Array.isArray(i))throw new TypeError("picker: `selectionValidators` must be an array");let o=[],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&&o.push({type:"minimumSelectedPlaces",minimum:r}),s&&o.push({type:"consecutiveSeats"}),a&&o.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(n,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:o,maxSelection:t??l}}function sg(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function ag(t){if(t.length<=1)return!1;let e=t[0]?.objectId,i=t[0]?.categoryKey;if(!e||t.some(o=>o.objectId!==e||o.categoryKey!==i))return!0;let n=t.map(o=>sg(o.id)).sort((o,r)=>o-r);return n.some((o,r)=>o<0||r>0&&o!==n[r-1]+1)}function lh(t,e,i,n,o){let r=n.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"),n.some(l=>l.type==="consecutiveSeats")&&ag(t)&&a.push("consecutiveSeats"),n.some(l=>l.type==="noOrphanSeats")&&o()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:s,remaining:Math.max(0,s-e),seats:t,violations:a}}function ch(t){let{id:e,doc:i,seatById:n,groupedTableBySeatId:o}=t,r=k=>k.type==="section"&&(k.id===e||k.logicalSectionId===e),s=i.floors?.find(k=>k.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 k of l){let v=n.get(k);if(!v)continue;t.matchesAccessFilter&&t.statusOf(k)==="free"&&t.matchesAccessFilter(v)&&(m+=1);let C=o.get(k);if(C){if(u.has(C.label))continue;u.add(C.label),c.set(C.categoryKey,(c.get(C.categoryKey)??0)+C.maxOccupancy),t.statusOf(C.chairs[0]?.id??k)==="free"&&(h+=C.maxOccupancy,d.set(C.categoryKey,(d.get(C.categoryKey)??0)+C.maxOccupancy))}else c.set(v.categoryKey,(c.get(v.categoryKey)??0)+1),t.statusOf(k)==="free"&&(h++,d.set(v.categoryKey,(d.get(v.categoryKey)??0)+1))}let f=[...c.entries()].map(([k,v])=>{let C=i.categories.find(R=>R.key===k),P=C?.tiers?.map(R=>R.price).filter(Number.isFinite)??[],T=P.length?P:typeof C?.price=="number"&&Number.isFinite(C.price)?[C.price]:[],L=T.length?Math.min(...T):void 0,I=T.length?Math.max(...T):void 0;return{key:k,count:v,label:C?.label??k,color:C?.color??"#6e7bff",...L!==void 0?{price:L,priceMin:L,priceMax:I}:{}}}).sort((k,v)=>(k.priceMin??1/0)-(v.priceMin??1/0)||k.key.localeCompare(v.key)),g=f.flatMap(k=>k.priceMin===void 0?[]:[k.priceMin]),p=f.flatMap(k=>k.priceMax===void 0?[]:[k.priceMax]),b=a.zone?i.zones?.find(k=>k.id===a.zone):void 0,y=k=>{let v=null,C=0;for(let[P,T]of k)(T>C||T===C&&v!=null&&P<v)&&(v=P,C=T);return v},S=y(d)??y(c),w=(S?f.find(k=>k.key===S)?.color:void 0)??b?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:m}:{},label:a.displayLabel??a.label,zoneLabel:b?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:w,seatsLeft:h,...g.length?{priceMin:Math.min(...g),priceMax:Math.max(...p)}:{},categories:f}}var $i=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 n=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===n&&(this.inFlight=null)});return this.inFlight=n,n}markSettled(){this.lastSettledAt=this.now()}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};function dh(t,e){return t?.source==="socket"&&e.source==="http"?t:e}function hh(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 hg=!0,ug=!0,pg=10,fg=15e3,uh=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new Yi;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 $i;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=sh(e.numberOfPlacesToSelect);let i=ah(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,pg);this.selectionValidators=i.validators,this.maxSelection=i.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(n=>typeof n=="string"&&!!n))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=dr(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let n of Po){let o=this.mapTheme[n];o&&(i[n]=o)}return{...e,theme:i}}setMapTheme(e){return Xd(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),n=this.getActiveFloorId(),o=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,s=e.getCameraPose?.();return e.setChart(this.visibleDoc(),n?{floorId:n}:void 0),this.applyRowBandPreview(e),o&&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(o=>typeof o=="string");if(i.length===this.hidden.size&&i.every(o=>this.hidden.has(o)))return!1;this.hidden=new Set(i);let n=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),this.renderer&&this.applyRowBandPreview(this.renderer),n&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let i=(e??[]).filter(n=>typeof n=="string");return i.length===this.closedSections.size&&i.every(n=>this.closedSections.has(n))?!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(o=>o.id);let n=this.labelToId.get(e);return n?[n]:[]}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 o=this.visibleDoc(),r=Lt(o).find(s=>s.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}if(e.objectType==="table"){let o=this.groupedTablesByLabel.get(e.label);return{...o?.displayLabel&&o.displayLabel!==o.label?{displayLabel:o.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}let i=this.labelToSeat.get(e.label),n=i?this.seatContext.get(i.id):void 0;return{...i?.displayLabel?{displayLabel:i.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}async render(e){if(this.renderer)return null;let i=performance.now(),n={},o=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:o(r)}),L=>({ok:!1,error:L,elapsed:o(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(L=>({ok:!0,objects:L,elapsed:o(a)}),()=>({ok:!1,elapsed:o(a)})),c=await s;if(n.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=Yd(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=Nr(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(R=>[R.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,R)=>I+Math.max(0,R.chairs.length-1),0)}catch(L){return this.emitError(L),null}this.expandedSeats=De(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let h=Fd(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))}n.normalizeBuyerModel=o(u);let m=d.event.currency??this.opts.currency;this.currency=m??"USD";let f=performance.now(),g=xd(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:m,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{n.seatsComplete=o(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(n.createRenderer=o(f),this.closed)return g.destroy(),null;this.renderer=g,this.viewportInsets&&g.setViewportInsets?.(this.viewportInsets),this.fitClearance>0&&g.setFitClearance?.(this.fitClearance);let p=null,b="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,b=L.default??"free",S=typeof L.fetchedAt=="number"?L.fetchedAt:void 0}if(n.loadStatuses=x.elapsed,this.closed)return g.destroy(),this.renderer=null,null;let w=performance.now();this.opts.categoryPriceRanges&&g.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),g.setChart(this.visibleDoc()),this.applyRowBandPreview(g),Ud(g,d.doc,e.clientWidth),this.opts.colorblindSafe&&g.setColorblindSafe?.(!0),n.buildScene=o(w),this.closedSections=new Set(y);let k=performance.now();y.length&&g.setClosedSections?.(y),this.seatsBuilt=!0;let v=this.pendingSnapshot;this.pendingSnapshot=null;let C=hh(v,p?{seats:p,default:b,fetchedAt:S}:null);C&&this.applySeatsMap(C.seats,C.default,C.source,C.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),n.applyInitialState=o(k);let P=performance.now();g.forceDraw(),n.firstPaint=o(P);let T=performance.now();return x.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),n.startRealtime=o(T),n.controllerTotal=o(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,salesState:Ro(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:n}}getSelection(){if(!this.renderer)return[];let e=[],i=new Set;for(let n of this.renderer.getSelection()){let o=this.groupedTableBySeatId.get(n.id);o?i.has(o.label)||(i.add(o.label),e.push(this.toTableSeat(o))):e.push(this.toSeat(n))}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 n of e){let o=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(o)o.chairs.forEach(r=>i.add(r.id)),this.hold_?.labels.includes(o.label)||(this.tableQuantities.set(o.label,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(o.label));else{let r=this.seatById.has(n)?n:this.labelToId.get(n);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)),n=new Set,o=[];for(let s of e){let a=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(a)this.tableTierResolution(a).kind==="invalid"?o.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&n.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"?o.push(c.label):n.add(l)}}if(o.length&&this.emitError(new Me(bn(o))),!n.size)return[];if(this.renderer?.select?.([...n]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...n]),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(n=>i.has(n.categoryKey)).map(n=>n.id))}deselectCategories(e){let i=new Set(e);this.deselect(this.getSelection().filter(n=>i.has(n.categoryKey)).map(n=>n.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(n=>typeof n=="string"&&!!n))],this.rebuildSelectableSeatIds();let i=this.renderer?.getSelection().filter(n=>!this.isSelectableByPolicy(n.id)).map(n=>n.id)??[];i.length&&this.deselect(i)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let i=this.getSelection(),n=e??i.reduce((o,r)=>o+(r.quantity??1),0);return lh(i,n,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let i=new Set(e.getSelection().map(n=>n.id));return i.size>0&&gn(this.seatById.values(),n=>e.getStatus(n),i).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let i of this.selectableObjectRefs){let n=this.groupedTableBySeatId.get(i)??this.groupedTablesByLabel.get(i);if(n){n.chairs.forEach(r=>e.add(r.id));continue}let o=this.seatById.has(i)?i:this.labelToId.get(i);o&&e.add(o)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,i){let n=this.groupedTablesByLabel.get(e);if(!n)return!1;let o=n.mode==="whole"?n.capacity:Math.floor(i);if(!Number.isInteger(o)||o<n.minOccupancy||o>n.maxOccupancy)return!1;let r=this.tableQuantities.get(e)??n.minOccupancy;return this.tableQuantities.set(e,o),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(n.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,i,n){let o=this.groupedTablesByLabel.get(e),r=this.hold_;if(!o||o.mode!=="variable"||!r?.labels.includes(e))return null;let s=Math.floor(i);if(!Number.isInteger(s)||s<o.minOccupancy||s>o.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,n,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 hg&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(ug||!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(o=>o.id):[e.id]),this.emitSelectionChange();return}if((i?this.tableTierResolution(i):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(i?i.chairs.map(o=>o.id):[e.id]),this.emitError(new Me(bn([i?.label??e.label]))),this.emitSelectionChange();return}if(i){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(i.chairs.map(o=>o.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(i.chairs.map(o=>o.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),n=i?.label??e.label;if(this.opts.retapKeepsSelection&&!i&&(this.hold_?.labels.includes(n)||this.isSelectableByPolicy(e.id))){this.renderer?.select?.([e.id]),this.opts.onSeatRetap?.(this.toSeat(e));return}if(this.hold_?.labels.includes(n)){this.opts.onDeselect?.(i?{...e,label:n}:e);return}i?(this.renderer?.deselect(i.chairs.map(o=>o.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 n=this.groupedTablesByLabel.get(i);n&&(this.tableQuantities.set(i,n.mode==="whole"?n.capacity:n.minOccupancy),n.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 $d(this,e,i)}resumeHold(e){return qd(this,e)}extendHold(e){return Zd(this,e)}categoryAvailability(){return Nd({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 n of this.closedSections)for(let o of i.sectionMembers?.(n)??[])e.add(o);return e}getGAAreas(){let e=this.visibleDoc();return e?Bd(e,this.currency,i=>this.statusOf(i),this.inventoryModelVersion):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Dd(this.getGAAreas(),this.gaSelected,{wheelchairOnly:this.accessFilter?.includes("wheelchair")===!0}))}async holdGA(e,i,n={}){let o=this.visibleDoc();if(!o||!Number.isFinite(i)||i<1)return null;let r=Lt(o).find(d=>d.id===e);if(!r)return null;let s=Od(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,...n.tierId?{tierId:n.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,n.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 zd(this.visibleDoc())}pickPremiumBlock(e,i,n){return Kd({doc:this.visibleDoc(),qty:e,categoryKey:i,zoneId:n,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:o=>this.seatTierResolution(o).kind!=="invalid",statusOfLabel:o=>this.getStatus(this.labelToId.get(o)??"")??"free",isPremium:o=>!!this.labelToSeat.get(o)?.commercial?.premium})}async bestAvailable(e,i,n={}){let o=this.renderer;if(!o)return null;if(n.preferPremium){let r=this.pickPremiumBlock(e,i,n.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,n.ttlMs);o.clearSelection();let l=this.idsForLabels(r);l.length&&o.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}=yt(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,n.zoneId,n.ttlMs);o.clearSelection();let s=this.idsForLabels(r.labels);s.length&&o.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}=yt(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,n){return Qd(this,e,i,n)}release(){return jd(this)}releaseLabels(e){return Jd(this,e)}releaseConfirmed(e,i){return eh(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(o=>o.notForSale).map(o=>o.key));if(!i.size)return[];let n=[];for(let[o,r]of this.seatById)i.has(r.categoryKey)&&n.push(o);return n}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 ci(this._doc?.theme?.seatScale)*J*e}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){Td(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 Io(this.pickerFocusContext,e)}accessibilitySpread(e){return Id(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return Rd(this.pickerFocusContext,e)}accessibilityFilterDims(e){return Ed(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.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){Ad(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 n=this.renderer;if(!n?.focusSeats?.(e,i))return!1;let o=n.getFocusedSection?.()??null;return this.opts.onSectionFocus?.(o?this.sectionSummary(o):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 n=this.isSectionClosed(e)?null:this.sectionSummary(e);Pd(this.pickerFocusContext,e,n,i),this.opts.onSectionFocus?.(n)}sectionSummary(e){return!this.renderer||!this._doc?null:ch({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=>Te(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 n=e.commercial?{commercial:e.commercial}:void 0,o=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,...o,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...n,...r,...s};let d=c.tier;return{id:e.id,label:e.label,...o,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...n,...r,...s}}toTableSeat(e){let i=e.chairs[0],n=this.tiersFor(e.categoryKey)?.filter(s=>ui(this._doc,this.tableTierSeat(e),s.id).kind==="resolved"),o=this.tableTierResolution(e),r=o.kind==="resolved"?o.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,...n?{tiers:n,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 n=this._doc?.categories.find(o=>o.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:n?.label??e.categoryKey,categoryColor:n?.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(n=>n.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?ui(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 ui(this._doc,this.tableTierSeat(e),this.seatTiers.get(i))}setSeatTier(e,i){let n=this.seatById.get(e);if(!n)return;let o=this.tiersForSeat(n);if(o){if(i==null)this.seatTiers.delete(e);else if(o.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 n of e){let o=this.labelToSeat.get(n);o&&i.push(this.toSeat(o))}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 Or(this._doc,i.map(n=>({label:n.label,...n.tierId?{tierId:n.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"?F("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let n=this.selectionValidators.some(s=>s.type==="noOrphanSeats"),o=new Set(e.getSelection().map(s=>s.id));(n&&o.size?gn(this.seatById.values(),s=>e.getStatus(s),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(F("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 th(this,e)}handle409Conflicts(e){ih(this,e)}setHold(e,i="created"){nh(this,e,i)}clearHold(){oh(this)}expireActiveHold(){return rh(this)}applySeatsMap(e,i="free",n="http",o){n==="socket"&&(this.socketVersion+=1);let r=this.renderer;if(!r||!this.seatsBuilt){this.pendingSnapshot=dh(this.pendingSnapshot,{seats:e,default:i,source:n,...o===void 0?{}:{fetchedAt:o}});return}let s=this.seatsMapDiffers(e,i);this.lastSnapshotAt=o??Date.now(),this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=i;let a=Ui(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[Ui(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,n=await this.api.objects(this.key);this.socketVersion===i&&this.applySeatsMap(n.seats,n.default??"free","http",n.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=Gd({selection:this.getSelection().map(n=>n.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:n=>this.statusOf(n)});if(i.lost.length&&this.deselect(i.lost),i.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(i.lapsedLabels);let n=this.idsForLabels(i.lapsedLabels);n.length&&this.renderer?.deselect(n),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(i),i}getAccessNeeds(){return Hd(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=Vd(()=>{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 n=this.syncHidden(e),o=this.syncClosed(i);n&&this.resnapshot(),(n||o)&&this.opts.onStatusChange?.({changed:!0})}}}seatsMapDiffers(e,i){if(this.lastSnapshotAt===0||i!==this.liveDefault)return!0;let n=Object.entries(e);if(n.length!==this.liveStatuses.size)return!0;for(let[o,r]of n)if(this.liveStatuses.get(o)!==r)return!0;return!1}applyStatusChanges(e){this.socketVersion+=1;let i=this.renderer;if(!i)return;let n=e.some(s=>this.liveStatuses.get(s.label)!==s.status),o=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=Ui(s.status);this.opts.flashOnLiveChange&&l!=="free"&&a.some(c=>(o.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)o.set(c,l)}let r=new Map;for(let[s,a]of o){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:n})}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let n=null;try{n=this.api.createRealtime(this.key,this.realtimeSink())}catch{n=null}if(n){this.realtime=n,n.start();return}}if(this.realtime)return;let i;try{let n=this.api.socketProtocols?.(this.key);i=n&&n.length?new WebSocket(e,n):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=n=>{this.clearConnectFallback();let o;try{o=JSON.parse(typeof n.data=="string"?n.data:"")}catch{return}if(!this.renderer||!o||typeof o!="object")return;let s=o;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=_d(e,{baseMs:1e3,maxMs:fg,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var mg=5,gg=-1.1,Mo=35;function Eo(t,e){let i=t-Ee,n=Math.atan2(mg-i,e)*180/Math.PI,o=Math.atan2(gg-i,e)*180/Math.PI;return o<-Mo&&(n+=-Mo-o,o=-Mo),{topPitch:n,basePitch:o}}var ne=2048,xe=1024,qt=Xo,B=Math.PI*2,bg=xe/180,vt=t=>(t+180)/360*ne,q=t=>(90-t)/180*xe;function bh(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 yh(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 qi=96,_o=360/qi,yg=.6,Ao=[17,23,42];function Fo(t,e,i=1){let n=Math.max(0,Math.min(.58,e)),o=Math.round(t[0]+(Ao[0]-t[0])*n),r=Math.round(t[1]+(Ao[1]-t[1])*n),s=Math.round(t[2]+(Ao[2]-t[2])*n);return`rgba(${o},${r},${s},${i})`}function ph(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 le(t,e,i){let n=(1-Math.abs(2*i-1))*e,o=(t%360+360)%360/60,r=n*(1-Math.abs(o%2-1)),s=0,a=0,l=0;o<1?[s,a,l]=[n,r,0]:o<2?[s,a,l]=[r,n,0]:o<3?[s,a,l]=[0,n,r]:o<4?[s,a,l]=[0,r,n]:o<5?[s,a,l]=[r,0,n]:[s,a,l]=[n,0,r];let c=i-n/2;return[Math.round((s+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var fh=new Map;function mh(t){if(!t)return null;let e=fh.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 n=(i>>>0)%360,o=le(n,.3,.42);return fh.set(t,o),o}function Sg(t,e,i,n){let o=new Array(qi).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??Ee,m=h-n;Math.abs(m)>r&&(r=Math.abs(m));let f=Math.atan2(m,u)*180/Math.PI,g=Math.atan2(h-Ee-n,u)*180/Math.PI,b=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,y=Math.min(qi-1,Math.max(0,Math.floor((b+180)/_o))),S=f>34&&u<16,x=o[y];x?(f>x.top&&(x.top=f),g<x.base&&(x.base=g),u<x.nearM&&(x.nearM=u,x.tint=mh(a.categoryKey)),x.overhead=x.overhead||S):o[y]={top:f,base:g,nearM:u,overhead:S,tint:mh(a.categoryKey)}}return{bins:o,maxDelta:r}}function vg(t,e,i,n){for(let o=0;o<qi;o++){let r=e[o];if(!r)continue;let s=-180+o*_o,a=i(s),l=i(s+_o);if(!(l>a))continue;let c=Math.min(72,r.top),d=Math.min(r.base,-4),u=n(c),h=n(d);if(h<=u)continue;let m=r.nearM/95,f=r.tint,g=f?ph([44,54,80],f,.34):[44,54,80],p=f?ph([24,30,48],f,.28):[24,30,48],b=t.createLinearGradient(0,u,0,h);b.addColorStop(0,Fo(g,m)),b.addColorStop(.24,Fo(p,m)),b.addColorStop(1,Fo([10,13,22],m)),t.fillStyle=b,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,n(0))-u;if(S>8){let w=1-m*.4;for(let k=1;k<6;k++){let v=u+S*k/6;t.fillStyle=`rgba(0,0,0,${.16*w})`,t.fillRect(a,v,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*w})`,t.fillRect(a,v+1.5,l-a+1,1.2)}}if(r.overhead){let x=n(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 wg(t,e,i){let o=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let b of i){a++,b.sectionId&&s.add(b.sectionId);let y=b.x-e.x,S=b.y-e.y,x=Math.hypot(y,S)*qt;if(x<.5)continue;let w=Math.atan2(y,-S),k=Math.floor((w+Math.PI)/B*72);k<0?k=0:k>=72&&(k=71),o[k]=!0,x<r[k]&&(r[k]=x)}let l=0,c=[];for(let b=0;b<72;b++)o[b]&&(l++,c.push(r[b]));let d=l/72*360;c.sort((b,y)=>b-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,g=bh(`${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:g,voidRadiusM:u,aspect:f}}var kg=5;function xg(t,e,i){switch(i){case 1:t.beginPath(),t.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,B),t.fill();break;case 2:t.beginPath(),t.ellipse(0,-e*1.02,e*.42,e*.42,0,0,B),t.fill(),t.beginPath(),t.ellipse(0,-e*.2,e*.98,e*1.02,0,0,B),t.fill();break;case 3:t.beginPath(),t.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,B),t.fill(),t.beginPath(),t.ellipse(0,-e*.52,e*1.22,e*.24,0,0,B),t.fill();break;case 4:t.beginPath(),t.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,B),t.fill(),t.beginPath(),t.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,B),t.fill(),t.beginPath(),t.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,B),t.fill();break;default:break}}function Lg(t,e,i,n,o){let r=n*.44,s=n*o.shoulderK,a=n*.66,l=n*1.68,c=n*5.4,d=`rgba(${o.clothing[0]},${o.clothing[1]},${o.clothing[2]},${o.alpha})`,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`;t.save(),t.translate(e,i);let h=o.lean*n;t.fillStyle=d,t.beginPath(),t.moveTo(-r,a),t.quadraticCurveTo(-r*1.18,l-h-n*.6,-s,l-h),t.quadraticCurveTo(-s*1.05,l+n*1.2,-s*.94,c),t.lineTo(s*.94,c),t.quadraticCurveTo(s*1.05,l+n*1.2,s,l+h),t.quadraticCurveTo(r*1.18,l+h-n*.6,r,a),t.closePath(),t.fill(),t.fillStyle=u,t.fillRect(-r*.82,n*.5,r*1.64,n*.9),t.save(),t.rotate(o.tilt),t.translate(o.turn*n,0),t.fillStyle=u,n>=18?(t.beginPath(),t.moveTo(-n*.9,-n*.15),t.quadraticCurveTo(-n*.96,-n*1.12,0,-n*1.06),t.quadraticCurveTo(n*.96,-n*1.12,n*.9,-n*.15),t.quadraticCurveTo(n*.86,n*.55,n*.36,n*.98),t.quadraticCurveTo(0,n*1.14,-n*.36,n*.98),t.quadraticCurveTo(-n*.86,n*.55,-n*.9,-n*.15),t.closePath(),t.fill(),n>=22&&(t.beginPath(),t.ellipse(-n*.9,n*.18,n*.13,n*.22,0,0,B),t.ellipse(n*.9,n*.18,n*.13,n*.22,0,0,B),t.fill())):(t.beginPath(),t.ellipse(0,0,n*.9,n*1.06,0,0,B),t.fill()),xg(t,n,o.hair),o.rim>.01&&(t.strokeStyle=`rgba(245,205,150,${(.5*o.rim).toFixed(3)})`,t.lineWidth=Math.max(1,n*.14),t.beginPath(),t.ellipse(0,-n*.06,n*.86,n*1,0,Math.PI*1.12,Math.PI*1.9),t.stroke()),t.restore(),o.rim>.01&&(t.strokeStyle=`rgba(240,200,150,${(.28*o.rim).toFixed(3)})`,t.lineWidth=Math.max(1,n*.12),t.beginPath(),t.moveTo(-s*.8,l-n*.05),t.quadraticCurveTo(-r,l-n*.75,0,l-n*.82),t.quadraticCurveTo(r,l-n*.75,s*.8,l-n*.05),t.stroke()),t.restore()}function Cg(t,e,i,n,o,r,s){t.fillStyle=`rgba(${o[0]},${o[1]},${o[2]},${s})`,t.beginPath(),t.moveTo(e-n*1.72,i+n*4),t.quadraticCurveTo(e-n*1.78,i+n*1.55,e-n*.46,i+n*1.02),t.lineTo(e-n*.4,i+n*.62),t.lineTo(e+n*.4,i+n*.62),t.lineTo(e+n*.46,i+n*1.02),t.quadraticCurveTo(e+n*1.78,i+n*1.55,e+n*1.72,i+n*4),t.closePath(),t.fill(),t.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${s})`,t.beginPath(),t.ellipse(e,i,n*.9,n*1.05,0,0,B),t.fill()}function Oo(t,e,i,n,o){let r=n*.1,s=i-n*.9,a=i-n*.74,l=i-n*.46,c=n*.13,d=n*.09,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`,h=t.createRadialGradient(e,i,1,e,i,n*.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,n*.24,n*.24,0,0,B),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+n*.02),t.lineTo(e+d*.1,l+n*.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-n*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-n*.12,e+c,a),t.quadraticCurveTo(e,a-n*.05,e-c,a),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=u,t.lineWidth=n*.055;let m=a+n*.02;o.pose===1?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e-c*1.5,i-n*1.02),t.moveTo(e+c*.8,m),t.lineTo(e+c*1.5,i-n*1.02),t.stroke()):o.pose===2?(t.beginPath(),t.moveTo(e-c*.8,m),t.lineTo(e+d*1.4,l-n*.02),t.moveTo(e+c*.8,m),t.lineTo(e-d*.4,l-n*.06),t.stroke(),t.fillStyle=u,t.beginPath(),t.ellipse(e+d*1.5,l-n*.04,n*.07,n*.09,-.5,0,B),t.fill()):o.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=n*.02,t.beginPath(),t.moveTo(e-c*.2,s+r*.9),t.lineTo(e-c*.2,i-n*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,m),t.lineTo(e-c*.95,l+n*.02),t.moveTo(e+c*.85,m),t.lineTo(e+c*.95,l+n*.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,B),t.fill(),o.rimStrength>.01&&(t.strokeStyle=`rgba(${o.rim[0]},${o.rim[1]},${o.rim[2]},${(.6*o.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,n*.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 Zi(t,e,i,n,o,r,s,a,l){t.save(),t.globalCompositeOperation="lighter";let c=t.createLinearGradient(0,i,0,o);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(n-s,o),t.lineTo(n+s,o),t.lineTo(e+r,i),t.closePath(),t.fill(),t.restore()}function Do(t,e,i,n,o){let r=t.createRadialGradient(e,i,0,e,i,n*3);r.addColorStop(0,`rgba(${o},0.9)`),r.addColorStop(.4,`rgba(${o},0.35)`),r.addColorStop(1,`rgba(${o},0)`),t.fillStyle=r,t.beginPath(),t.arc(e,i,n*3,0,B),t.fill(),t.fillStyle=`rgba(${o},1)`,t.beginPath(),t.arc(e,i,n,0,B),t.fill()}function CT(t,e,i){let n=document.createElement("canvas");n.width=ne,n.height=xe;let o=n.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??Ee,d=wg(t,e,i),u=yh(d.seed),h=210+u()*150,m=le(220+(u()-.5)*60,.55,.82),f=`${m[0]},${m[1]},${m[2]}`,g=o.createLinearGradient(0,0,0,xe);g.addColorStop(0,"#080b12"),g.addColorStop(.42,"#12182c"),g.addColorStop(.5,"#1c2440"),g.addColorStop(.56,"#151b2c"),g.addColorStop(.78,"#171e30"),g.addColorStop(1,"#131829"),o.fillStyle=g,o.fillRect(0,0,ne,xe);let p=o.createLinearGradient(0,q(-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)"),o.fillStyle=p,o.fillRect(0,q(-6),ne,xe-q(-6));let b=Math.atan2(r,-s),y=Sg(t,i,b,c),S=y.maxDelta>=yg;S&&vg(o,y.bins,vt,q);let x=Math.max(.3,Math.min(1,1-(l-6)/60)),w=Eo(c,l),k=Math.min(80,Math.atan2(4,l)*180/Math.PI),v=Math.min(45,w.topPitch),C=w.basePitch;d.mode==="sport"?Pg(o,l,c,d,x,h,f,u):d.mode==="arena"?Ig(o,l,c,d,x,f,u):Tg(o,k,v,C,x,h,f,u);let P=d.mode==="sport"?34:24+Math.floor(u()*8);o.fillStyle=`rgba(${f},0.8)`;for(let L=0;L<P;L++){let I=(L+.5)/P*ne,R=q(d.mode==="sport"?58:54+L*7%3*6);o.beginPath(),o.arc(I,R,d.mode==="sport"?2.6:3.2,0,B),o.fill()}Rg(o,t,i,e,b,c,r,s,S,d);let T=o.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)"),o.fillStyle=T,o.fillRect(0,0,ne,xe),{url:n.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function Tg(t,e,i,n,o,r,s,a){let l=vt(-e),c=vt(e),d=q(i),u=q(n),h=c-l,m=u-d,f=q(Math.min(50,i+10)),g=h*(1.1+(1-o)*.5),p=t.createRadialGradient(ne/2,(d+u)/2,8,ne/2,(d+u)/2,g);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 b=le(r,.62,.55),y=le(r+40,.7,.5),S=le(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(${b[0]},${b[1]},${b[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 k=3+Math.floor(a()*3),v=m*.46,C=u-m*.08;for(let E=0;E<k;E++){let z=(E+1)/(k+1),W=l+h*(.22+z*.56+(a()-.5)*.06);Oo(t,W,C,v*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:le(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 P=h*.055+3,T=P*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,u),t.lineTo(l-P,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+P,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 R=7;t.beginPath(),t.moveTo(l-T,I);for(let E=0;E<=R;E++){let z=l-T+(h+T*2)*E/R;t.quadraticCurveTo(z-(h+T*2)/R/2,I+L,z,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-P,u-m*.05,h+P*2,m*.05+3);let M=t.createLinearGradient(0,u-m*.05,0,u+m*.12);M.addColorStop(0,`rgba(255,206,140,${(.5*o).toFixed(3)})`),M.addColorStop(1,"rgba(255,206,140,0)"),t.fillStyle=M,t.fillRect(l-P,u-m*.05,h+P*2,m*.2);let A=3+Math.floor(a()*2);for(let E=0;E<A;E++){let z=(E+1)/(A+1),W=l+h*(z+(a()-.5)*.08),Y=q(Math.min(62,i+26)),re=(a()-.5)*h*.16;Zi(t,W,Y,W+re,u,4,h*.09,s,.16*(.7+o*.5)),Do(t,W,Y,2.4,s)}}function Ig(t,e,i,n,o,r,s){let a=Math.min(e*.6,Math.max(3,n.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,g=Math.atan2(-i,u)*180/Math.PI,p=q(m),b=q(f),y=q(g),S=vt(l)-c,x=Math.max(6,(p-b)/2),w=(p+b)/2,k=t.createRadialGradient(c,y,4,c,y,S*2.6);k.addColorStop(0,`rgba(255,206,150,${(.2*o).toFixed(3)})`),k.addColorStop(.5,"rgba(150,140,190,0.08)"),k.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=k,t.fillRect(c-S*2.6,b-x,S*5.2,y-b+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 v=t.createLinearGradient(0,w,0,y);v.addColorStop(0,`rgba(${r},0.14)`),v.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=v,t.fillRect(c-S,w,S*2,y-w);let C=[[{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}]],P=C[Math.floor(s()*C.length)],T=s()<.5?-1:1,L=V=>c+V.u*T*S*.84,I=V=>w+V.v*x*.8,R=P.find(V=>V.lead)??P[0],M=L(R),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,B),t.fill();let E=t.createRadialGradient(M,w,2,M,w,S);E.addColorStop(0,`rgba(255,214,160,${(.5*o).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,B),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,w,S,x,0,0,B),t.stroke();let z=Math.max(24,(y-b)*1.3),W=P.length>=3?3:2;for(let V=0;V<W;V++){let Le=(-.62+V*.52+(s()-.5)*.12)*-T,Oe=c+Le*S*.7,wt=w-x*(.45+s()*.18),et=S*(.07+s()*.04),nn=z*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Oe-et/2,wt-nn,et,nn),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Oe-et/2,wt-nn,et,1.5)}if(P.length>=3){let V=c-R.u*T*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(V,w-x*.34,S*.08,x*.1,0,0,B),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let V of[...P].sort((Le,Oe)=>Le.v-Oe.v)){let Le=.82+(V.v+1)*.14;Oo(t,L(V),I(V),z*Le*(V.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:V.pose,rim:le(40,.72,.8),rimStrength:V.lead?1.4:.9})}let Y=q(Math.min(60,f+34)),re=x*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,Y,S*1.15,re,0,0,B),t.stroke();let N=4+Math.floor(s()*3);for(let V=0;V<N;V++){let Le=V/N*B,Oe=c+Math.cos(Le)*S*1.15,wt=Y+Math.sin(Le)*re;if(Math.sin(Le)>-.2){let et=c+(s()-.5)*S*.8;Zi(t,Oe,wt,et,w,3,S*.32,r,.2*(.7+o*.4))}Do(t,Oe,wt,3,r)}let _=q(Math.min(52,f+24)),G=Math.max(60,S*.4),oe=Math.max(24,G*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-G*.3,_-oe/2),t.lineTo(c-G*.16,_-oe*2.2),t.moveTo(c+G*.3,_-oe/2),t.lineTo(c+G*.16,_-oe*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-G/2,_-oe/2,G,oe);let ji=t.createLinearGradient(0,_-oe*.3,0,_+oe*.42);ji.addColorStop(0,`rgba(${r},0.5)`),ji.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=ji,t.fillRect(c-G*.42,_-oe*.3,G*.84,oe*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-G/2,_+oe/2-2,G,2);let Ji=t.createRadialGradient(c,_,4,c,_,G*1.1);Ji.addColorStop(0,`rgba(${r},0.2)`),Ji.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=Ji,t.fillRect(c-G*1.1,_-G*.8,G*2.2,G*1.6);let en=t.createRadialGradient(c,(Y+w)/2,6,c,(Y+w)/2,S*1.5);en.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),en.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=en,t.fillRect(c-S*1.5,Y-40,S*3,w-Y+80),t.restore();let vh=c+Math.sign(M-c||1)*S*.5;Zi(t,vh,Y-re*.4,M,I(R),2.5,S*.16,"255,224,178",.42*(.7+o*.4));let tn=t.createRadialGradient(M,I(R),1,M,I(R),S*.2);tn.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),tn.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=tn,t.beginPath(),t.ellipse(M,I(R),S*.2,x*.24,0,0,B),t.fill(),t.restore()}function Pg(t,e,i,n,o,r,s,a){let l=ne/2,c=Math.max(10,n.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,g=q(m),p=q(f),b=vt(h)-l,y=(g+p)/2,S=Math.max(10,(g-p)/2),x=t.createRadialGradient(l,y,4,l,y,b);x.addColorStop(0,"#e8f0fb"),x.addColorStop(.7,"#b9c9e2"),x.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,y,b,S,0,0,B),t.clip(),t.fillStyle=x,t.fillRect(l-b,y-S,b*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-b*.5,y-S),t.lineTo(l-b*.5,y+S),t.moveTo(l+b*.5,y-S),t.lineTo(l+b*.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,B),t.stroke(),t.restore(),t.strokeStyle="rgba(210,225,245,0.6)",t.lineWidth=2.5,t.beginPath(),t.ellipse(l,y,b,S,0,0,B),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let L=0;L<5;L++){let I=l+(a()-.5)*b*1.4,R=y+(a()-.5)*S*1.1,M=Math.max(2,S*.06);t.beginPath(),t.ellipse(I,R,M*.6,M,0,0,B),t.fill()}let w=t.createRadialGradient(l,y,4,l,y,b*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-b*1.4,p-S,b*2.8,g-p+S*2),t.restore();let k=q(Math.min(66,f+60)),v=Math.max(80,b*.7),C=v*.5,P=t.createRadialGradient(l,k,4,l,k,v*1.6);P.addColorStop(0,`rgba(${s},0.3)`),P.addColorStop(1,`rgba(${s},0)`),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=P,t.fillRect(l-v*1.6,k-v*1.2,v*3.2,v*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-v/2,k-C/2),t.lineTo(l+v/2,k-C/2),t.lineTo(l+v*.6,k),t.lineTo(l+v/2,k+C/2),t.lineTo(l-v/2,k+C/2),t.lineTo(l-v*.6,k),t.closePath(),t.fill();let T=r;for(let L=0;L<3;L++){let I=le(T+L*30,.5,.5);t.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},0.75)`;let R=v*.26;t.fillRect(l-v*.42+L*(R+v*.06),k-C*.32,R,C*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let L=0;L<8;L++){let I=l-v*.6+v*1.2*L/7;t.beginPath(),t.arc(I,k+C*.62,2.4,0,B),t.fill()}}function Rg(t,e,i,n,o,r,s,a,l,c){let d=e.sectionId,u=!1,h=[];for(let g of i){if(g.id===e.id)continue;let p=g.x-e.x,b=g.y-e.y,y=Math.hypot(p,b)*qt;if(d&&g.sectionId===d&&y<3&&p*s+b*a>0&&(u=!0),y<.3||y>32)continue;let x=((Math.atan2(p,-b)-o)*180/Math.PI+540)%360-180,w=l?(g.eyeHeightM??Ee)-r:0,k=Math.atan2(w-.28,y)*180/Math.PI;if(k>10&&y>5)continue;let v=0;for(let T=0;T<g.id.length;T++)v=v*31+g.id.charCodeAt(T)&65535;let C=.9+(v&15)/40,P=Math.min(78,Math.atan2(.16,y)*180/Math.PI*bg*C);P<1.2||h.push({hx:vt(x),hy:q(k),r:P,d:y,hash:v})}h.sort((g,p)=>p.d-g.d);let m=[];{let g=[...h].sort((y,S)=>y.hy-S.hy),p=[],b=()=>{if(!p.length)return;let y=p.reduce((w,k)=>w+k.d,0)/p.length,S=p.reduce((w,k)=>w+k.hy,0)/p.length,x=p.reduce((w,k)=>w+k.r,0)/p.length;m.push({figs:p.sort((w,k)=>k.d-w.d),d:y,hy:S,r:x}),p=[]};for(let y of g){let S=p[p.length-1];S&&Math.abs(y.hy-S.hy)>Math.max(5,(S.r+y.r)/2*1.7)&&b(),p.push(y)}b()}m.sort((g,p)=>p.d-g.d);let f=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let g of m){if(g.figs.length>=3&&g.r>=1.6&&g.r<26){let p=[],b=[...g.figs].sort((x,w)=>x.hx-w.hx),y=[];for(let x of b){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-g.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let x of p){let w=x[0].hx-g.r*1.6,k=x[x.length-1].hx+g.r*1.6;t.beginPath(),t.roundRect(w,g.hy+g.r*.8,k-w,g.r*2.4,g.r*.8),t.fill()}}}for(let p of g.figs){let b=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 k=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;Lg(t,p.hx,p.hy,p.r,{tone:S,clothing:w,alpha:b,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%kg,rim:k,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?Cg(t,p.hx,p.hy,p.r,w,S,b):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${b.toFixed(3)})`,t.beginPath(),t.arc(p.hx,p.hy,p.r,0,B),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 g=q(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,g,ne,xe-g),t.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let b=0;b<p;b++){let y=(b+.5)/p*ne;t.beginPath(),t.ellipse(y,g+6,ne/p*.42,22,0,Math.PI,0,!0),t.fill()}}}var de=480,St=270,Bo=50,Je=30,gh=t=>(t+Bo)/(2*Bo)*de,$t=t=>(Je-t)/(2*Je)*St;function TT(t,e,i){let n=document.createElement("canvas");n.width=de,n.height=St;let o=n.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*qt),l=yh(bh(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=le(220+(l()-.5)*60,.55,.82),u=`${d[0]},${d[1]},${d[2]}`,h=o.createLinearGradient(0,0,0,St);h.addColorStop(0,"#080b12"),h.addColorStop(.44,"#151c32"),h.addColorStop(.5,"#1d2644"),h.addColorStop(.58,"#161c2e"),h.addColorStop(1,"#131829"),o.fillStyle=h,o.fillRect(0,0,de,St);let m=t.eyeHeightM??Ee,f=Eo(m,a),g=Math.min(Bo-2,Math.atan2(4,a)*180/Math.PI),p=Math.min(Je-2,f.topPitch),b=Math.max(-Je+2,f.basePitch),y=gh(-g),S=gh(g),x=$t(p),w=$t(b),k=S-y,v=w-x,C=Math.max(.35,Math.min(1,1-(a-6)/60)),P=$t(Math.min(Je-1,p+8)),T=o.createRadialGradient(de/2,(x+w)/2,4,de/2,(x+w)/2,k*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)"),o.fillStyle=T,o.fillRect(y-k*.6,x-v*1.2,k*2.2,v*3.4);let L=le(c,.62,.55),I=le(c+40,.7,.5),R=le(c+70,.78,.52);o.save(),o.beginPath(),o.rect(y,x,k,v),o.clip();let M=o.createLinearGradient(0,x,0,w);M.addColorStop(0,`rgb(${L[0]},${L[1]},${L[2]})`),M.addColorStop(.5,`rgb(${I[0]},${I[1]},${I[2]})`),M.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),o.globalAlpha=.8,o.fillStyle=M,o.fillRect(y,x,k,v),o.globalAlpha=1;let A=o.createRadialGradient(de/2,(x+w)/2,k*.12,de/2,(x+w)/2,k*.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)"),o.fillStyle=A,o.fillRect(y,x,k,v),o.restore();let E=3,z=w-v*.08;for(let N=0;N<E;N++){let _=(N+1)/(E+1);Oo(o,y+k*(.24+_*.52),z,v*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:le(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(y-k*.5,P,k*.5,w-P),o.fillRect(S,P,k*.5,w-P);let W=k*.05+2,Y=W*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(y,w),o.lineTo(y-W,w),o.lineTo(y-Y,P),o.lineTo(y+k*.012,P),o.closePath(),o.fill(),o.beginPath(),o.moveTo(S,w),o.lineTo(S+W,w),o.lineTo(S+Y,P),o.lineTo(S-k*.012,P),o.closePath(),o.fill(),o.fillRect(y-Y,P,k+Y*2,(w-P)*.13),o.fillStyle=`rgba(${u},0.12)`,o.fillRect(y-1.2,P,1.2,w-P),o.fillRect(S,P,1.2,w-P),o.fillStyle="#0b0f18",o.fillRect(y-W,w-v*.05,k+W*2,v*.05+2);let re=o.createLinearGradient(0,w-v*.05,0,w+v*.14);re.addColorStop(0,`rgba(255,206,140,${(.5*C).toFixed(3)})`),re.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=re,o.fillRect(y-W,w-v*.05,k+W*2,v*.22);for(let N=0;N<3;N++){let _=(N+1)/4,G=y+k*_,oe=$t(Math.min(Je-1,p+20));Zi(o,G,oe,G+(l()-.5)*k*.14,w,3,k*.09,u,.17*C),Do(o,G,oe,1.8,u)}o.fillStyle=`rgba(${u},0.75)`;for(let N=0;N<8;N++)o.beginPath(),o.arc((N+.5)/8*de,$t(Je-4-N%2*3),2.2,0,B),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,St-26,de,26),o.fillStyle="rgba(30,37,54,0.9)";for(let N=0;N<9;N++){let _=N*(de/9)+de/18;o.beginPath(),o.ellipse(_,St-22,de/9*.4,15,0,Math.PI,0,!0),o.fill()}return{url:n.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var Sh=new Set(["en"]),Qi=new Map;async function Mg(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await Hr(`i18n/${t}.mjs`)).default??null;let{LOADERS:e}=await import("./localeLoaders-STMEO2AW.js"),i=e[t];return i?await i():null}async function MT(t,e){let i=ea(t,e);if(i==="en"||Sh.has(i))return ct(i),i;if(!Js.includes(i))return ct("en"),"en";try{let n=Qi.get(i);n||(n=Mg(i),Qi.set(i,n));let o=await n;return Qi.delete(i),o?(ct(i,o),Sh.add(i),i):(ct("en"),"en")}catch{return Qi.delete(i),ct("en"),"en"}}export{_g as ACCESSIBILITY_RING_COLOR,Ho as ACCESSIBILITY_TYPES,Pb as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,Ib as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,Wg as BOOTH_TYPES,Ag as CHART_STORAGE_KEY,my as CURRENCY_CHOICES,py as DEFAULT_CURRENCY,Xg as DEFAULT_EVENT_INVENTORY_LIMIT,TC as EMPTY_AVAILABILITY_REFRESH,qg as EVENT_CONFIGURATION_EXPORT_SCHEMA,$g as EVENT_CONFIGURATION_SCHEMA,xb as FLOOR_COVER_LIMIT,vb as FLOOR_STACK_GAP_RATIO,Tb as FLOOR_STACK_MIN_SURFACE_PX,Mb as GA_UNIT_LABEL_PREFIX,CC as HOLD_CLOCK_SKEW_MS,yn as LABEL_FADE_MS,Hg as LABEL_STYLE_MAX_SIZE,Ng as LABEL_STYLE_MIN_SIZE,Ug as LARGE_VENUE_INVENTORY_MODULE,qb as LEGIBILITY_HYSTERESIS_PX,Lb as LEVEL_CONTEXT_PREFIX,Ly as LOCALE_NAMES,Kg as MAX_EVENT_INVENTORY,Ab as MAX_GA_CAPACITY,Ob as MAX_ONE_PARTY_GUESTS,si as MIN_POINTER_TARGET_PX,Db as ONE_PARTY_LIMIT_MESSAGE,uh as PickerController,Me as PickerSelectionError,Yb as RENDERED_QUALITY_REPORT_VERSION,Gg as ROW_AISLE_SEATS,Og as SEAT_COMMERCIAL_MARKS,Wb as SEAT_TYPE_ICON_BODY,ln as SEAT_TYPE_ICON_VIEWBOX,Eg as STAGE_LABEL_STYLE_MAX_SIZE,cu as SUPPORTED_LOCALES,Vg as SURROUNDINGS_SHAPE_ROLES,Co as SeatmapRenderer,rb as TABLE_SEAT_OFFSET,nb as TIER_HEIGHT_M,Js as TRANSLATED_LOCALES,sr as UNGROUPED_ID,Hd as accessNeedsFor,Gb as accessibilityLabelKey,Fg as accessibilityMeta,Bg as accessibilityRingColor,Jt as allObjects,dr as applyHidden,jm as applyOrganizerSeatGlyph,Ro as asPickerSalesState,Vd as attachVisibilityCatchUp,Rb as automaticRoundTableRadius,eb as canTransitionEventConfiguration,jg as canonicalEventConfigurationJson,Zo as chartBounds,Cd as clearOrganizerSeatGlyph,Jo as combinedFloorZoneId,It as compactRowLabel,cr as computeSections,Kb as computeSectionsPerFloor,xd as createRenderer,Gr as crossesThreshold,au as currencyExponent,yy as currencySymbol,tt as effectiveFloorOverview,Yg as eventInventoryLimitFor,fb as expandBooth,De as expandChart,cb as expandRow,lb as expandRowSlots,pb as expandTable,hb as expandTableSlots,yb as floorObjects,wb as floorStackPlacements,jt as floorsOf,My as formatDate,by as formatMinor,Ye as formatMoney,lu as fromMinorUnits,Lt as gaAreasOf,rn as gaBoxBounds,on as gaBoxMode,Bb as gaInventorySegments,Fb as gaUnitLabel,Nb as gaUnitLabels,sn as gaUnitLabelsForModel,xt as gaWheelchairPlaceCount,an as gaWheelchairUnitLabels,CT as generateSeatPanorama,TT as generateSeatThumb,Cy as getLocale,Hb as growJoinedGAInventory,Ub as hiddenObjectIds,og as holdHasLapsed,PC as holdRecoveryShape,vn as hysteresisScale,nr as initialFloorMode,Jg as inspectEventConfigurationCompatibility,$b as inspectRenderedQualityEvidence,Eb as isGaUnitLabel,Iy as isLocaleLoaded,Ld as isOrganizerGlyphPainted,Xb as isSectionHidden,zg as layerOf,tr as layoutCombinedFloorPlan,er as layoutFloorStack,ir as levelContextOutlines,MT as loadLocale,Ty as localeDirection,Cb as mainFloorId,ib as migrateLegacyEventConfigurations,gy as numberLocale,gb as objectCenter,Py as onLocaleChange,bb as owningSectionForObject,Qg as parseEventConfigurationExport,Zg as parseEventConfigurationVersion,Zt as pointInPolygon,te as pointInPolygonWithHoles,mb as pointOnPolygonBoundary,Qt as polygonLabelPoint,Gd as reconcileAvailability,IC as refreshChangedSomething,Sn as renderedPx,fy as resolveCurrency,tb as resolveEventConfigurationRollback,ea as resolveLocale,ab as rowInventoryCount,sb as rowSeatPositions,Dg as seatCommercialMeta,or as seatNoteRowModel,rr as seatTypeIconBody,Vb as seatTypeIconSvg,it as sectionEntrancesById,ob as sectionGeometry,zb as sectionIdentitiesById,ar as sectionLabelsById,lr as sectionOwnersByObject,ct as setLocale,js as setMoneyLocale,Ry as setStringOverrides,Wd as shouldWaitForHoldExpiry,qo as stackFloors,kb as suggestedFloorOverview,F as t,ia as tCount,ub as tableInventoryCount,db as tableSeatCountsBySide,Sb as translateObject,$o as usableHoles,_b as validGAInventorySegments,Zb as zoomTowardPoint};
|
|
1
|
+
import{a as zb,b as rr,c as Kb,d as sr,e as ar,f as tt,g as Xb,h as Yb,i as Ub,j as lr,k as $b,l as qb,m as cr,o as Rr,r as rt}from"./chunk-RI4LNRP4.js";import{a as xn,c as Ln,e as Gr,f as fi,h as Wr,j as Vr,m as zr}from"./chunk-YGRBCSUI.js";import{a as gy,b as li,c as by}from"./chunk-WR6VXY5U.js";import{d as Kr}from"./chunk-TGHNVDWA.js";import{a as mn,b as dy,c as hr,d as hy}from"./chunk-YPVYZYMH.js";import{a as cy,b as dr,c as Rt,d as Fr,e as _r,f as Br,g as Or}from"./chunk-LWBTU56C.js";import{b as Pr,e as vn,i as hi,k as Hr}from"./chunk-T7DQX3MB.js";import{a as Zb,b as Qb,c as jb,f as di}from"./chunk-IFQFHR6Q.js";import{b as ci,f as Lr,h as ot,i as Cr,j as Tr,l as Ir}from"./chunk-4N5CHKHD.js";import{A as Nr,b as Mt,c as ui,d as wn,e as Mr,f as Er,g as kn,l as Ar,n as pi,z as Dr}from"./chunk-JXIX3PNI.js";import{b as nr,c as or,l as xt}from"./chunk-M4NGX5NM.js";import{A as xr,B as ze,C as Sn,D as si,E as X,F as de,G as ai,a as me,b as yr,c as Ge,e as ge,f as ni,g as oi,h as Sr,i as It,j as We,k as Ve,l as G,n as vr,p as wr,q as kr,s as be,t as ye,w as nt,x as Pt,y as ri}from"./chunk-MADX5HYP.js";import{b as eb,c as Ko,d as tb,e as Xo,f as ib,g as nb,h as ob,i as rb,j as sb,k as ab,l as lb,m as cb,n as db,o as hb,p as ub}from"./chunk-R6BN4HDQ.js";import{a as Jb,b as ey,c as ty,d as iy,e as ny,f as oy,g as ry,h as sy,i as hn,j as un,k as ay,l as pn,m as Lt,n as fn,o as ly,p as Ct,q as ur,r as uy,s as it,t as pr,u as fr,v as mr,w as py,x as fy,y as my,z as gr}from"./chunk-N562FZPD.js";import{$a as ei,Ga as jo,Ia as Jo,J as Yo,Ka as Pb,L as Uo,La as Rb,Ma as Mb,N as q,Na as Eb,Oa as Ab,Pa as Fb,Qa as _b,Ra as Bb,Sa as Ob,Ta as Db,Ua as jt,Va as Nb,Wa as er,Xa as te,Ya as Jt,Za as Hb,_a as Gb,ab as Wb,ba as $o,bb as ti,ca as qo,cb as Vb,d as pb,da as Zo,db as tr,e as fb,eb as He,f as mb,fb as ir,g as gb,h as bb,i as yb,j as Sb,k as vb,ka as Qo,l as wb,m as kb,ma as Tb,n as xb,o as Lb,p as Cb,ua as Ae,va as Ib}from"./chunk-J33DNOMI.js";import"./chunk-S3VH7IDA.js";import{C as D,c as gn,h as bn,m as Tt,o as br,t as O,u as se,v as Fe,w as j,x as ii,z as yn}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var yy=1,Cn=90;function Tn(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function Xr(t,e,i,n=1){if(!Number.isFinite(t))return i;let o=Math.max(0,n);return i?t>=e-o:t>=e+o}function In(t,e,i,n=1){if(!Number.isFinite(t)||!(i>0))return t;let o=Math.max(0,n)/i;return e?t*(1+o):t*(1-o)}function Sy(t){let{point:e,camera:i,scale:n,nextScale:o}=t;if(!Number.isFinite(n)||n<=0||!Number.isFinite(o))return{...i};let r=(e.x-i.x)/n,s=(e.y-i.y)/n;return{x:e.x-r*o,y:e.y-s*o}}import{Konva as ji}from"konva/lib/Core";import{Stage as gg}from"konva/lib/Stage";import{Layer as Mo}from"konva/lib/Layer";import{Group as $t}from"konva/lib/Group";import{Circle as Od}from"konva/lib/shapes/Circle";import{Group as Kn}from"konva/lib/Group";import{Circle as Oe}from"konva/lib/shapes/Circle";import{Line as Un}from"konva/lib/shapes/Line";import{Rect as Xn}from"konva/lib/shapes/Rect";import{Text as ua}from"konva/lib/shapes/Text";var J=9,Se=.9,Q=.55*Se,ie=G/me,st=4,ue=14,Yr=10;var Ur=14;var Le=.45*Se,ve=.9*Se,ae=(Le+ve)/2,$r=Math.max(Se*1.1,ve),we=8,qr=700,ee=2,Et=G,Bh=12,Oh=12;function Zr(t){return t<U?Oh:Bh}var mi=.85,Qr=G,At=64,Ke=.55*Le,jr=700,Jr=120,es=2500,ts=420,is=420,ns=1,Xe=1,os=2,at=16,_e=12,Pn=[.85,.72,.62],Dh=10,Nh=9;function gi(t){return t<U?Nh:Dh}var bi=13,yi=12,rs=0,ss="600",as="500",ls=8,cs=5,ds=10,hs=6,us=8,ps=.6,fs=.7,ms=[0,18,-18,36,-36,54,-54],Ce="600",gs="500",U=640,bs=Ce,ys="400",Be=0,Ss=14,vs=.34,ws=.92,ks=7,xs=3;function Si(t){return Math.min(1,Math.max(_e/at,t/900))}function lt(t,e){return Math.max(_e,t*Si(e))}var Hh=.5,Gh=1.15,Ls=2,Cs=3,Ts=22,Wh=8,Vh=6;function Ft(t){return t<U?Vh:Wh}var Rn=.08;function Mn(t,e,i,n,o=Hh,r=_e){let s=t*Si(e),a=Math.max(r*(1+Rn),s*o),l=n>0&&i>n?i/n:1,c=Math.max(a,s*Gh);return Math.min(c,a*l)}var Is=.1,_t=1.02;var vi=1.25;function Ps(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var zh="#e5e7eb",Kh="#c7cbd1",Xh="#6b7280",Yh=["#6b7280","#5b6470","#4b5563","#374151"],Uh=["#cbd5e1","#e2e8f0","#f8fafc"],$h="#d1d5db",qh="#b8bdc4",Zh="#273142",Qh="#526078",jh="#f1f5f9",Jh="#374151",eu="#64748b",tu="#111827",Rs="#6b7280",Ms="#374151";var Es="#4b5563",As=.4,Te=.16,Fs="rgba(244,246,248,0.06)",wi=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function _s(t,e,i){let n=new Map;for(let s of t){let a=e(s);!a||i(a)||n.set(a,(n.get(a)??0)+1)}let o=null,r=0;for(let[s,a]of n)(a>r||a===r&&o!=null&&s<o)&&(o=s,r=a);return o}function le(t){return O(t)?{sectionFill:zh,sectionStroke:Kh,sectionInk:Xh,focalFill:$h,focalStroke:qh}:{sectionFill:Zh,sectionStroke:Qh,sectionInk:jh,focalFill:Jh,focalStroke:eu}}function En(t,e){let i=t.sectionFill,n=O(i),o=n?se(i,.6):yn(Fe(i,.2),.85);switch(e){case"closed":return n?se(i,.4):Fe(i,.12);case"sold-out":return o;case"nearly-gone":return j(i,o,.4);default:return i}}var Bs=.28,Os=.42,iu=.55,nu=.7;function Ds(t,e,i){let n=le(t),o=En(n,e);if(!i||e==="sold-out"||e==="closed")return{fill:o,stroke:n.sectionStroke};let r=O(t);return{fill:j(o,i,r?Os:Bs),stroke:D(i,r?nu:iu)}}var ou=.03;function Ns(t,e){let i=le(t);return!["normal","nearly-gone","sold-out","closed"].map(o=>En(i,o).toLowerCase()).includes(e.trim().toLowerCase())&&An(t,e)}function An(t,e){let i=gn(e);if(!i)return!1;let n=le(t),o=Math.max(Bs,Os)+ou;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=gn(En(n,r));return s?Math.max(Math.abs(s[0]-i[0]),Math.abs(s[1]-i[1]),Math.abs(s[2]-i[2]))/255<=o:!1})}var ru="#f8fafc",su="#f4f6fb",au="#111827",lu=.72;function Hs(t){let e=O(t),i=e?ru:tu,n=e?au:su,o=j(n,i,1-lu);return{plate:i,ink:n,subInk:Tt(o,i)>=br?o:n}}function Gs(t,e,i,n){if(e)return e;let o=O(i)?Uh:Yh;for(let r of[i,...o])if(Tt(r,t)>=n)return r;return de(t,e,i,n)}var cu=.45,du=.3,hu=.1,uu=5;function Ws(t,e,i){let n=O(e)?Fe:se,o=yn(n(t,cu),du);for(let r=0;r<uu;r+=1){if(Tt(o,e)>=i)return o;o=n(o,hu)}return Tt(o,e)>=i?o:de(e,null,o,i)}import{Shape as fu}from"konva/lib/Shape";import{Circle as mu}from"konva/lib/shapes/Circle";import{Rect as gu}from"konva/lib/shapes/Rect";var pu={M:2,L:2,Q:4,C:6,Z:0},Fn=new Map;function _n(t){let e=Fn.get(t);if(e)return e;let i=ot(t);if(!i)return Fn.set(t,[]),[];let n=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],o=[],r=0;for(;r<n.length;){let s=n[r++],a=pu[s];if(a===void 0||r+a>n.length)throw new Error(`Invalid path data for seat glyph "${t}".`);let l=n.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"?o.push({command:s,points:l}):s==="Q"?o.push({command:s,points:l}):s==="C"?o.push({command:s,points:l}):o.push({command:"Z",points:[]})}return Fn.set(t,o),o}function Vs(t,e,i,n=0,o=0){let r=_n(e),s=Lr(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=Cr(s,i);t.save(),t.translate(n,o),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 zs(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var Ye=class extends fu{_sceneFunc(e){let i=this.attrs.seatRadius||1,n=this.attrs.seatGlyph,o=_n(n),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(!o.length||!s){zs(e,i),e.fillStrokeShape(this);return}e.beginPath(),Vs(e,n,i),e.fillStrokeShape(this)}_hitFunc(e){zs(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 Bn(t,e){return t==="circle"||!ot(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:n}=t;return t.wheelchairBay?new gu({x:e,y:i,width:n*2,height:n*2,offsetX:n,offsetY:n,cornerRadius:2,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):Bn(t.glyph,{x:e,y:i,radius:n,detail:t.detail,fill:t.fill})??new mu({x:e,y:i,radius:n,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function bu(t,e){return t*2*e>=16}function Xs(t,e,i,n){let o=bu(e,i);if(o===n||!t.length)return o;for(let r of t)r.setAttr("seatGlyphDetail",o);return o}function ki(t){return t?.35:.3}function $s(t){if(t<=0||t>=1)return 1;let e=1.25-1;if(t<.45){let n=t/.45;return 1+e*(1-(1-n)**2)}let i=(t-.45)/(1-.45);return 1+e*Math.cos(i*Math.PI*1.5)*(1-i)**2}function On(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 qs=700,yu=2400,Dn=12,Zs=30,Ys=1,Su=1.16,Us=.5,vu=1;function Nn(t){return t*.61803398875%1}function Qs(t,e){let n=((t/yu+e)%1+1)%1,o=(1-Math.cos(n*2*Math.PI))/2;return{scale:Ys+(Su-Ys)*o,opacity:Us+(vu-Us)*o}}var Js;function ea(t){Js=t}function wu(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var js=new Map;function ku(t,e){let i=t??Js,n=`${i??""}|${JSON.stringify(e)}`,o=js.get(n);return o||(o=new Intl.DateTimeFormat(i,e),js.set(n,o)),o}var xu={dateStyle:"medium",timeStyle:"short"};function ta(t,e={}){let{locale:i,...n}=e,o=wu(t);if(!Number.isFinite(o))return"";let r=Object.keys(n).length?n:xu;return ku(i,r).format(o)}var Oy="USD";function Dy(t,e){return t?.trim()||e?.trim()||"USD"}var Ny=["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"],Gn;function na(t){Gn=t}function Hy(){return Gn??"en"}var ia=new Map;function Hn(t,e,i,n){let o=n??Gn,r=`${o??""}|${t}|${e??"auto"}|${i??"auto"}`,s=ia.get(r);return s||(s=new Intl.NumberFormat(o,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),ia.set(r,s)),s}function Ue(t,e="USD",i,n){if(typeof i=="object"){let r=i;try{return Hn(e,r.minimumFractionDigits,r.maximumFractionDigits,r.locale).format(t)}catch(s){if(r.fallback)return r.fallback(t,e);throw s}}let o=i??(Number.isInteger(t)?0:void 0);return Hn(e,o,o,n).format(t)}var Lu={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 Cu(t="USD"){return Lu[t.toUpperCase()]??2}function Tu(t,e="USD"){return t/10**Cu(e)}function Gy(t,e="USD",i){return Ue(Tu(t,e),e,void 0,i)}function Wy(t="USD"){return Hn(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":"You were away for a while. Refresh to see which seats are free now.","picker.idlePausedTitle":"Your session expired","picker.idleRefresh":"Show latest seats","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 Iu=["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"],Uy={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"},oa=["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"],Pu=new Set(["ar","fa","he"]),Wn={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"},Vn=new Map(Iu.map(t=>[t.toLowerCase(),t]));function Ru(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=Vn.get(e)??Wn[e];if(i)return i;let n=e.split("-");if(n.length>=2){let o=`${n[0]}-${n[1]}`,r=Vn.get(o)??Wn[o];if(r)return r}return Vn.get(n[0])??Wn[n[0]]}var $e={en:Bt},xi={},pe="en";function ra(t,e){let i=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let n of[t,e,...i]){if(!n)continue;let o=Ru(n);if(o)return o}return"en"}function $y(){return pe}function qy(t=pe){return Pu.has(t)?"rtl":"ltr"}function Zy(t){return!!$e[t]}var zn=new Set;function Qy(t){return zn.add(t),()=>{zn.delete(t)}}function ct(t,e){e&&($e[t]={...$e[t],...e}),pe=$e[t]?t:"en",na(pe),ea(pe),typeof document<"u"&&(document.documentElement.lang=pe);for(let i of zn)i()}function jy(t){xi=t}var sa=/\{(\w+)\}/g;function F(t,e){let i=xi[t]??$e[pe]?.[t]??Bt[t]??t;return e?i.replace(sa,(n,o)=>String(e[o]??`{${o}}`)):i}function aa(t,e,i){let n=new Intl.PluralRules(pe).select(e);return(xi[`${t}.${n}`]??$e[pe]?.[`${t}.${n}`]??Bt[`${t}.${n}`]??xi[`${t}.other`]??$e[pe]?.[`${t}.other`]??Bt[`${t}.other`]??t).replace(sa,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function Jy(t,e){return ta(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:pe})}function ca(t,e,i,n=!1){let o=t.displayLabel?.trim()||t.label;return n?{title:o,detail:F("map.statusTaken"),sellable:!1}:e==="booked"?{title:o,detail:F("map.statusTaken"),sellable:!1}:e==="held"?{title:o,detail:F("map.statusHeld"),sellable:!1}:{title:o,detail:i()??"",sellable:!0}}var dt=32,la=70;function da(t,e){let i=dt+6,n=t.y-la;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:n>=i?n:Math.min(t.y+la,e.height-i)}}var Yn=.8,Fu=Math.hypot(.46,.36),_u=.26,Bu=1.6,Ou=2*(1-Fu),ma="#0b1220",pa="#ffffff";function fa(t,e,i,n,o){let r=Math.min(Math.max(Bu,i*_u),i*Ou);return new Un({x:t,y:e,points:[-i*.42,i*.02,-i*.1,i*.34,i*.46,-i*.36],stroke:n,strokeWidth:r,lineCap:"round",lineJoin:"round",...o?{shadowColor:ma,shadowBlur:1.5,shadowOpacity:.55}:{},listening:!1})}function Du(t){if(!(t instanceof Ye)||t.getAttr("seatGlyphDetail")===!1)return null;let e=t.getAttr("seatGlyph");return e&&ot(e)?e:null}var Nu=220,Hu=.08,Li=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,i,n){let o=n.get(e);if(n.delete(e),!i){this.retire(o);return}o?.destroy();let r=this.host,s=r.seat(e);if(!s)return;let a=r.seatShape(e)?.fill(),l=X(typeof a=="string"?a:"",r.selectionColor(),ze),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),u=d?null:Du(r.seatShape(e)),h=r.seatRadius(),p=new Kn({name:"selection-ring",x:s.x,y:s.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});p.setAttrs({seatId:e,ringColor:l});let m={name:"selection-halo",stroke:D(r.categoryColor(s.categoryKey),ki(O(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let f=h*1.2;p.add(new Xn({...m,width:d.width+f*2,height:d.height+f*2,offsetX:(d.width+f*2)/2,offsetY:(d.height+f*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else p.add(new Oe({...m,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let b={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(p.add(new Xn({...b,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)p.add(new Xn({...b,stroke:si(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:Yn}));else{let f=Math.max(0,d.width/2-14),g=-Math.max(0,d.height/2-14);p.add(new Oe({x:f,y:g,radius:10,fill:l,listening:!1})),p.add(new Un({x:f,y:g,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:O(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else if(u)this.addGlyphMark(p,u,h,c,b);else{let f=Math.max(1,h-1.25),g=Math.min(2.5,Math.max(1.8,h*.22));if(p.add(new Oe({...b,radius:f,strokeWidth:g})),c)p.add(new Oe({...b,stroke:si(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:Yn}));else{let y=Math.max(0,f-g/2);p.add(fa(0,0,y,pa,!0))}}n.set(e,p),this.host.overlayLayer.add(p)}addGlyphMark(e,i,n,o,r){let s=this.host,a=s.canvasBackground();if(o){e.add(new Oe({...r,stroke:si(a),radius:n+2,strokeWidth:Math.max(2,n*.2),opacity:Yn}));return}let l=X(a,s.selectionColor(),ze),c=Bn(i,{x:0,y:0,radius:n,fill:l,detail:!0});if(!c)return;c.name("selection-body"),c.listening(!1),e.add(c);let d=Tr(i,n);if(!d)return;let u=O(l)?ma:pa;e.add(fa(d.x,d.y,d.radius,u,!1))}resyncMarkers(e,i){if(e.size){for(let n of[...e.keys()])this.syncMarker(n,!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 n=performance.now(),o=r=>{if(i.isDestroyed()||!e.getLayer()){e.destroy();return}let s=Math.min(1,(r-n)/160);e.opacity(1-s),i.overlayLayer.batchDraw(),s<1?requestAnimationFrame(o):(e.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(o)}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 n=this.echoTimers.get(e);n&&clearTimeout(n),this.echoTimers.set(e,setTimeout(()=>{this.echoTimers.delete(e),!(i.isDestroyed()||i.reducedMotion())&&(typeof document<"u"&&document.hidden||this.emitPulse(e,!1))},qs))}emitPulse(e,i){let n=this.host,o=n.seat(e);if(!o)return;let r=n.seatRadius();this.pulses.get(e)?.destroy();let s=new Oe({name:"selection-pulse",x:o.x,y:o.y,radius:r,stroke:n.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:On(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,s),this.pulseHome().add(s);let a=i&&!n.isCached()?n.seatShape(e):void 0,l=performance.now(),c=()=>{a?.scale({x:1,y:1}),s.destroy(),this.pulses.get(e)===s&&this.pulses.delete(e),n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw()},d=u=>{if(n.isDestroyed()){c();return}s.getLayer()||this.pulseHome().add(s);let h=u-l,p=On(h/420);if(s.radius(r*p.radiusScale),s.opacity(p.opacity),a){let m=$s(h/320);a.scale({x:m,y:m})}n.overlayLayer.batchDraw(),a&&!n.isCached()&&n.seatLayer.batchDraw(),h<420?requestAnimationFrame(d):c()};queueMicrotask(()=>{n.isDestroyed()||typeof requestAnimationFrame!="function"||requestAnimationFrame(d)})}nudge(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||i.isCached()||typeof document<"u"&&document.hidden)return;let n=i.seatShape(e);if(!n)return;let o=performance.now(),r=()=>{n.scale({x:1,y:1}),i.seatLayer.batchDraw()},s=a=>{if(i.isDestroyed()||i.isCached()||!n.getLayer()){r();return}let l=a-o,c=Math.min(1,l/Nu),d=1+Hu*Math.sin(Math.PI*c);n.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 Kn({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 n=i.nearestSeat(e,ue),o=n?i.seat(n):void 0;if(!o){this.hideLoupe();return}let r=ca(o,i.seatStatus(o.id),()=>i.priceLabel(o),i.seatClosed(o.id)),s=da(e,{width:i.stage.width(),height:i.stage.height()}),a=1/(i.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=o.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(o.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(),n=X(i,le(i).sectionInk),o=new Kn({name:"touch-loupe",listening:!1,visible:!1});o.add(new Un({points:[-7,dt-4,0,dt+12,7,dt-4],closed:!0,fill:i,stroke:D(n,.25),strokeWidth:1,listening:!1})),o.add(new Oe({radius:dt,fill:i,stroke:D(n,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new Oe({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new ua({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1}),a=new ua({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:D(n,.72),listening:!1,perfectDrawEnabled:!1});return o.add(r),o.add(s),o.add(a),e.overlayLayer.add(o),o.moveToTop(),this.loupe={group:o,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 Gu}from"konva/lib/Animation";var Wu=1e3/Zs;function ga(t){return t.findOne(".selection-halo")??null}var Ci=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 n=[],o=0;for(let[s,a]of this.markers){let l=ga(a);if(l){if(this.paintHalo(s,l),o>=Dn){l.scale({x:1,y:1}),l.opacity(1);continue}n.push({node:l,phase:Nn(o)}),o+=1}}let r=0;for(let s of this.beaconRings){if(r>=Dn){s.scale({x:1,y:1}),s.opacity(1);continue}n.push({node:s,phase:Nn(r)}),r+=1}if(this.targets=n,!n.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new Gu(()=>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 n=this.host,o=ki(O(n.canvasBackground())),r=n.seatCategoryKey(e),s=n.isOwnedHold(e)?j(n.selectionColor(),n.canvasBackground(),.55):r?n.categoryColor(r):n.selectionColor();i.stroke(D(s,o))}rest(){let e=!1;for(let[i,n]of this.markers){let o=ga(n);o&&(this.paintHalo(i,o),o.scale({x:1,y:1}),o.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<Wu)return!1;this.lastFrameAt=i;let n=i-this.startedAt;for(let o of this.targets){let{scale:r,opacity:s}=Qs(n,o.phase);o.node.scale({x:r,y:r}),o.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 Vu}from"konva/lib/Group";import{Circle as $n}from"konva/lib/shapes/Circle";import{Text as zu}from"konva/lib/shapes/Text";var ba=28,Ku=12,Xu="800",Yu=44,ya=1.6,Sa=1.95;function va(t){if(t.rung==="seats")return[];let e=new Map,i=new Map,n=new Map(t.zones.map(o=>[o.id,o.name]));for(let o of t.sections){let r=t.ownedSeatIds(o);if(!r.length)continue;let s=t.rung==="zones"&&o.zone!=null&&n.has(o.zone),a=s?o.zone:o.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(o),l.toward=t.sectionCentre(o));continue}i.set(a,r.length),e.set(a,{id:a,kind:s?"zone":"section",name:s?n.get(o.zone):t.sectionName(o),count:r.length,seatId:r[0],anchor:t.sectionAnchor(o),toward:t.sectionCentre(o)})}return[...e.values()]}function Uu(t,e){return F("map.beaconAria",{seats:aa("picker.seatCount",t),name:e})}function $u(t,e){let i=e*Sa,n=t.toward.x-t.anchor.x,o=t.toward.y-t.anchor.y,r=Math.hypot(n,o);return r<1e-6?{x:t.anchor.x,y:t.anchor.y-i}:{x:t.anchor.x+n/r*i,y:t.anchor.y+o/r*i}}var qu="selection-beacon-ring",Ti=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),n=`${i.toFixed(4)}|${e.map(c=>`${c.id}:${c.count}:${c.seatId}`).join(",")}`;if(n===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=n,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let o=ba/2/i,r=Math.max(Yu,Math.ceil(2*(o*Sa+o)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new Vu({listening:!1,name:"selection-beacons"});for(let c of e){let d=$u(c,o);l.add(new $n({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:o*ya,fill:D(s,.1),listening:!1,perfectDrawEnabled:!1}));let u=new $n({name:qu,x:c.anchor.x,y:c.anchor.y,radius:o*ya,stroke:D(s,.55),strokeWidth:Math.max(1,o*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(u),l.add(new $n({name:"selection-beacon-disc",x:d.x,y:d.y,radius:o,fill:s,stroke:D(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let h=new zu({x:d.x,y:d.y,text:String(c.count),fontSize:Ku/i,fontStyle:Xu,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],n=this.host.worldToScreen(this.centres[e]),o=i.offsetWidth||parseFloat(i.style.width)||ba;i.style.left=`${n.x-o/2}px`,i.style.top=`${n.y-o/2}px`}}buildButton(e,i,n){let o=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",Uu(e.count,e.name)),Object.assign(r.style,{position:"absolute",left:`${o.x-n/2}px`,top:`${o.y-n/2}px`,width:`${n}px`,height:`${n}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 n=t.width(),o=t.height(),r=1/0,s=1/0,a=-1/0,l=-1/0,c=n*2,d=o*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>n+c||h.y+h.height>o+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(),p=i.y*u+t.y();h<r&&(r=h),p<s&&(s=p),h+i.width*u>a&&(a=h+i.width*u),p+i.height*u>l&&(l=p+i.height*u)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var Ii=8,Zu=.02,wa=1,ka=.5;function xa(t,e,i,n,o){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=Ot(t,e,o);if(!s)return 0;qn(t,s,r);let a=Math.min((r.width-2*Ii)/s.width,(r.height-2*Ii)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>ka?a:Math.min(a,Qu(t.scaleX(),n));if(!(c>1+Zu)&&!(l>ka)||!(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,o);return h&&qn(t,h,r),c}function Zn(t,e,i,n){let o=i??{x:0,y:0,width:t.width(),height:t.height()},r=Ot(t,e,n);return r?qn(t,r,o):!1}function Qu(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(wa,e):wa)/i}function qn(t,e,i){let n=i.x+i.width/2-(e.x+e.width/2),o=i.y+i.height/2-(e.y+e.height/2);return n===0&&o===0?!1:(t.position({x:t.x()+n,y:t.y()+o}),!0)}function qe(t){return`${t.x()},${t.y()},${t.scaleX()}`}import{Group as ju}from"konva/lib/Group";import{Circle as La}from"konva/lib/shapes/Circle";import{Line as Ju}from"konva/lib/shapes/Line";import{Text as ep}from"konva/lib/shapes/Text";var tp=6;function Dt(t){return O(t)?"#0b1220":"#ffffff"}function Ca(t){let{points:e}=t;if(!e.length)return null;let i=t.categoryColor??"#6e7bff",n=0,o=0;for(let r of e)n+=r.x,o+=r.y;return{count:e.length,centroid:{x:n/e.length,y:o/e.length},fill:i,ink:Dt(i)}}var Pi=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 n=Ca({points:this.host.ownedPoints(i),categoryColor:null});if(n)return n.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>=ve){this.host.overlayLayer.batchDraw();return}let n=Math.max(this.host.stageScale(),1e-4),o=new ju({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=Ca({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(tp/2/n,1);for(let b of a)o.add(new La({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,f)=>b+this.host.ownedPoints(f).length,0),u=this.host.labelAnchor(s),h=11/n,p={x:u.x,y:u.y-h*2.1};o.add(new La({name:"owned-section-badge",x:p.x,y:p.y,radius:h,fill:l.fill,stroke:D(l.ink,.35),strokeWidth:1/n,listening:!1,perfectDrawEnabled:!1})),o.add(new Ju({x:p.x-h*.62,y:p.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 m=new ep({x:p.x+h*.12,y:p.y-h*.5,text:String(d),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});o.add(m),this.badges.push({id:s.logicalId,centre:p,radius:h*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};import{Text as ip}from"konva/lib/shapes/Text";var np=4;function Nt(t){return O(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function op(t,e,i,n){let o=Math.max(0,Math.min(n,e/2,i/2));t.beginPath(),t.moveTo(o,0),t.arcTo(e,0,e,i,o),t.arcTo(e,i,0,i,o),t.arcTo(0,i,0,0,o),t.arcTo(0,0,e,0,o),t.closePath()}function Ta(t,e){t.padding(np),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(n){let o=this.width(),r=this.height();n.save(),op(n,o,r,Math.min(r/2,8)),n.setAttr("fillStyle",e.plate),n.fill(),n.setAttr("strokeStyle",e.stroke),n.setAttr("lineWidth",1),n.stroke(),n.restore(),ip.prototype._sceneFunc.call(this,n)})}function Ia(t){return t?"seat":"section"}function Pa(t){let e=new Set,i=0;for(let o of t.memberIds){let r=t.categoryKey(o);r&&t.categorySellable(r)&&e.add(r),t.seatSellable(o)&&(i+=1)}let n=[];for(let o of t.categoryOrder)e.has(o)&&n.push({key:o,name:t.categoryLabel(o)||o,price:t.categoryPrice(o),color:t.categoryColor(o)});return n.length?i?{mode:"section",title:t.name,fields:[],rows:n,notes:[],facts:[],note:null}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:F("map.soldOut")}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],facts:[],note:F("picker.notForSale")}}function Ra(t){let e=t.place?.kind==="booth",i=e?"":sp(t.label,t.sectionLabel,t.rowLabel),n=t.place?{caption:t.place.typeWord?.trim()||F(e?"picker.booth":"picker.table"),value:t.place.name}:null,o=[t.sectionLabel,t.rowLabel?F("picker.rowLabel",{label:t.rowLabel}):null,n?n.value:null,i?F("picker.seatLabel",{label:i}):null].filter(Boolean).join(" \xB7 ")||t.label,r=[t.sectionLabel?{caption:F("picker.section"),value:t.sectionLabel}:null,t.rowLabel?{caption:F("picker.row"),value:t.rowLabel}:null,n,i?{caption:F("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=dr(t).map(c=>{let d=F(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:o,fields:r,rows:[s],notes:a,facts:l,...l.length&&t.head?{head:t.head}:{},note:l.length?null:rp(t.status,t.closed)}}function rp(t,e){return e||t==="not_for_sale"?F("picker.notForSale"):t==="booked"?F("map.statusTaken"):t==="held"?F("map.statusHeld"):null}function sp(t,e,i){let n=t;for(let o of[e,i])!o||!n.startsWith(o)||n.length<=o.length||(n=n.slice(o.length).replace(/^[\s·\-/_]+/,""));return n}var ap=16,lp=8;function Ma(t,e,i,n=ap){let o=lp,r=t.x+n;r+e.width>i.width-o&&(r=t.x-n-e.width);let s=t.y+n;return s+e.height>i.height-o&&(s=t.y-n-e.height),{x:Math.max(o,Math.min(r,Math.max(o,i.width-o-e.width))),y:Math.max(o,Math.min(s,Math.max(o,i.height-o-e.height)))}}var Ea=16,Qn=14,Aa=10.5,cp=14,dp=12.5,Fa={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},hp={warn:"#d8a425",premium:"#e8c15a"},up=.1,pp=.06,_a={minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",boxShadow:"0 6px 20px rgba(2,6,23,0.22)",lineHeight:"1.35"},fp={minWidth:"",maxWidth:"",padding:"",overflow:"",borderRadius:"",boxShadow:"",lineHeight:"",background:"",backgroundColor:"",border:"",fontFamily:""},Ri=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.factsEl=null;this.roomEl=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,n,o){if(!e||!i){this.presented&&(this.presented=null,this.mount=null,this.presentedView=null,this.hide());return}e!==this.presented&&(this.presentedView=null),o!==void 0&&(this.presentedView=o),this.presented=e,this.mount=n,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.head?[e.head.title,e.head.sub,...e.facts.map(i=>`${i.caption} ${i.value}`)].filter(Boolean).join(" | "):[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 n=this.host.hostCardOpen?.()?null:this.resolve(i);if(!n){this.hide(),this.lastUpdateMs=performance.now()-e;return}let o=this.ensureRoot(),r=`${n.mode}|${n.title}|${n.note??""}|${this.host.canvasBackground()}|`+n.rows.map(l=>`${l.key}:${l.price??""}:${l.color}`).join(",")+`|${n.notes.map(l=>`${l.icon}:${l.title}:${l.note??""}`).join(",")}|${n.facts.map(l=>`${l.caption}=${l.value}`).join(",")}`+(n.head?`|${n.head.title}|${n.head.sub??""}|${n.head.tone??""}|${n.head.plate??""}`:"");r!==this.signature&&(this.signature=r,this.paint(n)),this.showView(this.presented?this.presentedView:null),this.model=n,o.style.display="block";let s=this.mount??this.host.container,a=Ma(i,{width:o.offsetWidth,height:o.offsetHeight},{width:s.clientWidth,height:s.clientHeight});o.style.left=`${a.x}px`,o.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 n=this.viewEl;if(!n){n=document.createElement("div"),n.setAttribute("data-seat-view",""),Object.assign(n.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)"}),n.appendChild(r),this.viewEl=n}(n.parentElement!==i||i.firstChild!==n)&&i.insertBefore(n,i.firstChild);let o=`url("${e.replace(/"/g,"%22")}")`;n.style.backgroundImage!==o&&(n.style.backgroundImage=o),n.style.display="block"}resolve(e){if(this.presented)return this.seatModel(this.presented);if(Ia(this.host.seatsPickable())==="seat"){let a=this.host.hoveredSeatId()??this.host.nearestSeat(e);return a?this.seatModel(a):null}let i=this.host.sectionAt(e),n=i?this.host.sectionLabel(i):null;if(!i||n==null||this.host.sectionInteractive?.(i)===!1)return null;let o=this.host.sectionMembers(i),r=this.host.sectionCardHead?.(i,o)??null,s=Pa({name:n||i,memberIds:o,categoryOrder:this.host.categoryOrder(),categoryKey:a=>this.host.seat(a)?.categoryKey??null,categoryLabel:a=>this.host.categoryLabel(a),categoryPrice:a=>this.host.categoryPrice(a),categoryColor:a=>this.host.categoryColor(a),categorySellable:a=>this.host.categorySellable(a),seatSellable:a=>this.host.seatSellable(a)});return r?{...s,head:r,facts:s.rows.map(a=>({caption:a.name,value:a.price??""}))}:s}seatModel(e){let i=this.host.seat(e);if(!i)return null;let n=this.host.seatStatus(e),o=this.host.seatFacts?.(e)??null;if((n!=="free"&&!this.host.seatOwnedHold?.(e)||this.host.seatClosed(e))&&!o?.length)return null;let s=this.host.seatSectionLabel(e),a=o?.length?this.host.seatCardHead?.(e)??null:null;return Ra({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),...o?.length?{facts:o}:{},...a?{head:a}:{}})}placeOf(e){let i=this.host.chartDoc();if(!i)return{};if(this.placeDoc!==i){this.placeDoc=i,this.placeFacts.clear(),this.sectionEntrances=it(i);for(let r of ti(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 n=this.placeFacts.get(e.rowId);if(!n)return{};let o=n.entrance??(e.sectionId?this.sectionEntrances.get(e.sectionId):void 0);return{place:{kind:n.kind,name:n.name,...n.typeWord?{typeWord:n.typeWord}:{}},...n.boothType?{boothType:n.boothType}:{},...o?{entrance:o}:{}}}isAisleSeat(e){let i=this.host.chartDoc();return i?(this.aisleDoc!==i&&(this.aisleDoc=i,this.aisleIds=di(i)),this.aisleIds.has(e)):!1}rowName(e,i){let n=this.host.chartDoc();if(!n)return null;if(this.rowNamesDoc!==n){this.rowNamesDoc=n,this.rowNames.clear();for(let r of n.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 o=this.rowNames.get(e.logicalRowId??e.rowId)??this.rowNames.get(e.rowId);return o?Rt(o,i??void 0)||o: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()),n=document.createElement("div");n.className="sl-hover-card",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",left:"0",top:"0",display:"none",pointerEvents:"none",boxSizing:"border-box",..._a,background:i.plate,border:`1px solid ${i.stroke}`,fontFamily:this.host.labelFont(),zIndex:"2"});let o=document.createElement("div");Object.assign(o.style,{fontSize:`${Ea}px`,fontWeight:"700",padding:"10px 15px 9px",textAlign:"center",color:X(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:`${Qn}px`,fontWeight:"600",padding:"0 15px 10px",textAlign:"center",opacity:"0.72",color:X(i.plate,"#0b1220")});let l=document.createElement("div");return Object.assign(l.style,{display:"none"}),n.append(o,r,s,l,a),e.appendChild(n),this.root=n,this.titleEl=o,this.rowsEl=r,this.notesEl=s,this.factsEl=l,this.noteEl=a,n}paint(e){let i=this.ensureRoot();if(e.head)return this.paintRoomCard(i,e,e.head);this.roomEl&&this.leaveRoomCard(i);let n=Nt(this.host.canvasBackground());i.style.background=n.plate,i.style.border=`1px solid ${n.stroke}`;let o=this.titleEl,r=this.rowsEl,s=this.notesEl,a=this.noteEl,l=X(n.plate,"#0b1220");if(o.replaceChildren(),o.style.color=l,o.style.paddingBottom=e.rows.length||e.note?"9px":"10px",e.fields.length){let c=e.fields[0]?.caption;o.style.display="flex",o.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 ${n.stroke}`:"none"});let p=document.createElement("div");p.textContent=u.caption,Object.assign(p.style,{fontSize:`${Aa}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let m=document.createElement("div");m.textContent=u.value,Object.assign(m.style,{marginTop:"2px",fontSize:`${Ea}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),h.append(p,m),o.append(h)}}else o.style.display="block",o.style.padding="10px 15px 9px",o.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:`${Qn}px`,fontWeight:"700",background:c.color,color:Sn(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,n,l),this.paintFacts(this.factsEl,e,n,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=X(n.plate,"#0b1220")}paintRoomCard(e,i,n){e.classList.add("room"),Object.assign(e.style,fp);for(let c of[this.titleEl,this.rowsEl,this.notesEl,this.factsEl,this.noteEl])c&&(c.style.display="none");let o=this.roomEl;o||(o=document.createElement("div"),e.appendChild(o),this.roomEl=o),o.style.display="block";let r=document.createElement("div");if(r.className="slhc-head",n.plate){let c=document.createElement("span");c.className="slhc-plate",c.innerHTML=n.plate,r.appendChild(c)}let s=document.createElement("div"),a=document.createElement("b");if(a.className="slhc-title",a.textContent=n.title,s.appendChild(a),n.sub){let c=document.createElement("span");c.className="slhc-sub",c.textContent=n.sub,n.tone&&(c.style.color=n.tone),s.appendChild(c)}r.appendChild(s);let l=i.facts.map(c=>{let d=document.createElement("div");d.className="slhc-row";let u=document.createElement("span");u.textContent=c.caption;let h=document.createElement("b");return h.textContent=c.value,d.append(u,h),d});o.replaceChildren(r,...l)}leaveRoomCard(e){e.classList.remove("room"),this.roomEl?.remove(),this.roomEl=null,this.rowsEl&&(this.rowsEl.style.display="flex"),Object.assign(e.style,{..._a,fontFamily:this.host.labelFont()})}paintFacts(e,i,n,o){if(e.replaceChildren(),!i.facts.length){e.style.display="none";return}Object.assign(e.style,{display:"flex",borderTop:`1px solid ${n.stroke}`,color:o});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 ${n.stroke}`:"none"});let l=document.createElement("div");l.textContent=s.caption,Object.assign(l.style,{fontSize:`${Aa}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:`${Qn}px`,fontWeight:"700",whiteSpace:"nowrap"}),a.append(l,c),e.append(a)}}paintNotes(e,i,n,o){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=Sn(n.plate)==="#ffffff"?Fa.onDark:Fa.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:o,c=s.tone==="warn"||s.tone==="premium"?j(n.plate,hp[s.tone],up):j(n.plate,o,pp),d=document.createElement("div");Object.assign(d.style,{display:"flex",alignItems:"flex-start",gap:"9px",padding:"9px 15px",background:c,borderTop:r?`1px solid ${n.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=hr(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 p=document.createElement("div");if(p.textContent=s.title,Object.assign(p.style,{fontSize:`${cp}px`,fontWeight:"750",color:s.tone==="access"?o:l}),h.appendChild(p),s.note){let m=document.createElement("div");m.textContent=s.note,Object.assign(m.style,{fontSize:`${dp}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:o}),h.appendChild(m)}d.append(u,h),e.appendChild(d)}}};var Ba="#1f9d6b";function mp(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 Oa(t,e){let i=e?new Set(e):null;mp(i,t.seatHighlight())||(t.setSeatHighlightState(i),t.repaintSeats(),t.updateLabels(),t.draw())}function Da(t,e){let i=t.labelLayers(),n={...i,...e};n.seatLabels===i.seatLabels&&n.rowLabels===i.rowLabels||(t.setLabelLayersState(n),t.updateLabels(),t.draw())}function Na(t,e){e!==t.categoryColours()&&(t.setCategoryColoursState(e),t.repaintSectionsAndSeats(),t.updateLabels(),t.draw())}function z(t){let e=Pr(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 ht(t,e,i,n){let o=n*Math.PI/180,r=Math.cos(o),s=Math.sin(o);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 ut(t,e,i,n,o,r){let s=n*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),p={x:t.x+u*a-h*l,y:t.y+u*l+h*a};if(!te(p,o,r))return!1}return!0}function Ha(t,e,i){let n=z(t),o={x:n.x+n.width/2,y:n.y+n.height/2},r=te(o,t,e)?[o,i]:[i],s=[];for(let l=1;l<12;l+=1)for(let c=1;c<12;c+=1){let d={x:n.x+n.width*c/12,y:n.y+n.height*l/12};te(d,t,e)&&s.push(d)}let a=[t,...e];return[...r,...s.map(l=>({point:l,room:Yo(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 Ga(t,e){let{stageScale:i,stageX:n,stageY:o}=t;return z(e.outline.map(r=>({x:r.x*i+n,y:r.y*i+o})))}function gp(t,e){let i=t.width*t.height;if(i<=0)return 0;let n=Math.max(0,Math.min(t.x+t.width,e.width)-Math.max(t.x,0)),o=Math.max(0,Math.min(t.y+t.height,e.height)-Math.max(t.y,0));return n*o/i}function Wa(t){let{current:e,viewport:i}=t,n=new Map;for(let a of t.sections){let l=gp(a.bounds,i)*a.members;l<=0||n.set(a.logicalId,(n.get(a.logicalId)??0)+l)}if(!n.size)return e;let o=null,r=0;for(let[a,l]of n)l>r&&(r=l,o=a);if(!o||o===e)return e;let s=e!=null?n.get(e)??0:0;return r>s*1.35?o:e}import{Text as yp}from"konva/lib/shapes/Text";function bp(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 fe=class{constructor(){this.cells=new Map}insert(e){for(let i of this.keys(e)){let n=this.cells.get(i);n?n.push(e):this.cells.set(i,[e])}}collisionCount(e){let i=new Set,n=0;for(let o of this.keys(e))for(let r of this.cells.get(o)??[])i.has(r)||(i.add(r),bp(e,r)&&n++);return n}keys(e){let i=Math.floor(e.x/At),n=Math.floor((e.x+Math.max(0,e.width))/At),o=Math.floor(e.y/At),r=Math.floor((e.y+Math.max(0,e.height))/At),s=[];for(let a=o;a<=r;a++)for(let l=i;l<=n;l++)s.push(`${l}:${a}`);return s}};var jn=new WeakMap;function Ze(){if(typeof document>"u"||!("fonts"in document))return 0;let t=document.fonts;if(!t)return 0;let e=jn.get(t);if(e)e.status!==t.status&&(e.generation+=1,e.status=t.status);else{e={generation:0,status:t.status},jn.set(t,e);let i=()=>{let n=jn.get(t);n&&(n.generation+=1,n.status=t.status)};t.addEventListener?.("loadingdone",i),t.addEventListener?.("loadingerror",i)}return e.generation}var Va=new WeakMap,za=new WeakMap;function Ka(t){let e=new Map;return{get(i){let n=JSON.stringify([i.text,i.fontSize,i.rotation]),o=e.get(n);return o||(o=new yp({text:i.text,fontSize:i.fontSize,fontStyle:"700",fontFamily:t,rotation:i.rotation,listening:!1}),o.offsetX(o.width()/2),o.offsetY(o.height()/2),e.set(n,o)),o},destroy(){for(let i of e.values())i.destroy()}}}function Sp(t){let e=t.labelFont(),i=Ze(),n=za.get(t.rowLabelPlan);if(n?.font===e&&n.fontGeneration===i)return n.index;let o=new fe,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;o.insert({x:l.x-d,y:l.y-d,width:l.width+d*2,height:l.height+d*2})}return r.destroy(),za.set(t.rowLabelPlan,{font:e,fontGeneration:i,index:o}),o}function vp(t){let e=Sp(t),i=[...t.freeTextById.values()].map(({node:l})=>{let c=l.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});return{x:c.x-ee,y:c.y-ee,width:c.width+ee*2,height:c.height+ee*2}}).filter(l=>e.collisionCount(l)>0),n=JSON.stringify([t.labelFont(),Ze(),t.seatR,i]),o=Va.get(t.rowLabelPlan);if(o?.key===n&&o.seats===t.seatById)return o.boxes;let r=new fe;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),u=t.rowLabelBox(c,d);return r.insert(u),u});return s.destroy(),Va.set(t.rowLabelPlan,{key:n,seats:t.seatById,boxes:a}),a}function Xa(t,e){let i=t.sections.filter(m=>m.id===e||m.logicalId===e),n=i.map(m=>z(m.outline));if(!n.length)return null;let o=Math.min(...n.map(m=>m.x)),r=Math.min(...n.map(m=>m.y)),s=Math.max(...n.map(m=>m.x+m.width)),a=Math.max(...n.map(m=>m.y+m.height)),l=new Set(i.flatMap(m=>m.memberIds));for(let m of l){let b=t.seatById.get(m);b&&(o=Math.min(o,b.x-t.seatR),r=Math.min(r,b.y-t.seatR),s=Math.max(s,b.x+t.seatR),a=Math.max(a,b.y+t.seatR))}let c=m=>{[m.x,m.y,m.width,m.height].every(Number.isFinite)&&(o=Math.min(o,m.x),r=Math.min(r,m.y),s=Math.max(s,m.x+m.width),a=Math.max(a,m.y+m.height))},d=m=>{let b={x:m.x+m.width/2,y:m.y+m.height/2};return i.some(f=>te(b,f.outline,f.holes))};for(let{node:m,backdrop:b}of t.freeTextById.values()){let f=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(f)&&(c(f),b&&c(b.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:m}of t.iconNodeById.values()){let b=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(b)&&c(b)}let u=vp(t);t.rowLabelPlan.forEach((m,b)=>{(m.focusKeys??[]).some(g=>g===e||i.some(y=>g===y.id||g===y.logicalId))&&c(u[b])});let h=Math.max(s-o,a-r),p=Math.max(t.seatR*2,Math.min(24,h*.025));return{x:o-p,y:r-p,width:Math.max(1,s-o+p*2),height:Math.max(1,a-r+p*2)}}import{Rect as wp}from"konva/lib/shapes/Rect";import{Text as Ya}from"konva/lib/shapes/Text";var Jn="\0";function kp(t){let e=0;for(let i=0;i<t.length;i++){let n=t[i],o=t[(i+1)%t.length];e+=n.x*o.y-o.x*n.y}return Math.abs(e)/2}function xp(t,e){let i=t.filter(p=>Number.isFinite(p.centroid.x)&&Number.isFinite(p.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let n=i.map(p=>({member:p,weight:Math.max(1,kp(p.outline))})),o=n.reduce((p,m)=>p+m.weight,0),r=n.reduce((p,m)=>({x:p.x+m.member.centroid.x*m.weight/o,y:p.y+m.member.centroid.y*m.weight/o}),{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(p=>{let m={x:p.centroid.x-e.x,y:p.centroid.y-e.y},b={x:p.centroid.x-r.x,y:p.centroid.y-r.y};return{member:p,depth:m.x*l.x+m.y*l.y,lateral:Math.abs(b.x*-l.y+b.y*l.x)}}).sort((p,m)=>m.depth-p.depth||p.member.id.localeCompare(m.member.id)),d=c[0].depth-c[c.length-1].depth,u=c[0].depth-d/3,h=c.filter(p=>p.depth>=u);return h.sort((p,m)=>p.lateral-m.lateral||m.depth-p.depth||p.member.id.localeCompare(m.member.id)),h[0].member}function Lp(t){let i=[...F("map.fromPrice",{price:Jn}).toLocaleLowerCase()],n=i.findIndex(o=>o!==Jn&&o.toLocaleUpperCase()!==o.toLocaleLowerCase());return n>=0&&(i[n]=i[n].toLocaleUpperCase()),i.join("").split(Jn).join(t)}function Cp(t,e){let i=n=>n.trim().replace(/\s+/g," ").toLocaleLowerCase();return i(t)===i(e)}function Tp(t,e){let i=t.trim();return!i||/^\d{1,3}$/.test(i)?!1:!e.some(n=>Cp(n.label,i))}function Ua(t,e){if(!e.zones?.length||!t.sections.length)return;let i=Hs(t.canvasBackground),n=new Map;for(let o of t.sections)o.zone&&(n.get(o.zone)??n.set(o.zone,[]).get(o.zone)).push(o);for(let o of e.zones){let r=n.get(o.id);if(!r||!r.length||!t.derivedFloorGroups&&!Tp(o.label,r))continue;let s=r[0];for(let k of r)k.centroid.y<s.centroid.y&&(s=k);t.derivedFloorGroups&&(s=xp(r,o.focalPoint??e.focalPoint)??s);let a=1/0,l=-1/0,c=1/0,d=-1/0;for(let k of r)for(let w of k.outline)w.x<a&&(a=w.x),w.x>l&&(l=w.x),w.y<c&&(c=w.y),w.y>d&&(d=w.y);let u=isFinite(a)&&l>a?l-a:0,h=!t.derivedFloorGroups&&isFinite(c),p=h?(a+l)/2:s.centroid.x,m=h?c:s.centroid.y,b=1/0,f=1/0;for(let k of r)for(let w of k.memberIds){let v=t.seatById.get(w),x=v&&t.catPrice.get(v.categoryKey);!v||typeof x!="number"||(v.accessible||v.accessibility?.length?f=Math.min(f,x):b=Math.min(b,x))}isFinite(b)||(b=f);let g=new wp({x:p,y:m,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(g);let y=new Ya({x:p,y:m,text:o.label,fontSize:bi,fontStyle:ss,letterSpacing:0,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1});y.offsetX(y.width()/2),y.offsetY(y.height()/2),t.bgLayer.add(y);let S=null;isFinite(b)&&(S=new Ya({x:p,y:m,text:Lp(Ue(b,t.currency)),fontSize:yi,fontStyle:as,fontFamily:t.labelFont(),fill:i.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),S.offsetX(S.width()/2),t.bgLayer.add(S)),t.zones.push({id:o.id,anchor:{x:p,y:m},back:g,background:t.canvasBackground,name:o.label,spanWorld:u,aboveZone:h,area:isFinite(a)?{x:a,y:c,width:l-a,height:d-c}:void 0,label:y,sub:S})}}function $a(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 n=t.doc,o=n&&tt(n)==="combined"&&!n.zones?.length?n.floors?.find(d=>rr(d.id)===i.id):void 0;if(o)return t.enterFloor(o.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 Ip=new Set,qa=16,Pp=5,Mi=class{constructor(e,i,n=8e3){this.chunks=e;this.host=i;this.warmSeats=n;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 n=this.host.sectionOf?[this.host.sectionOf(e)]:[...this.chunks.keys()];for(let o of n){let r=o===void 0?-1:this.chunks.get(o)?.findIndex(s=>s.id===e)??-1;if(r>=0){i={section:o,seat:this.chunks.get(o)[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=Ip){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 n=0;for(let[r,s]of[...this.built].reverse()){if(this.wanted.has(r)||(n+=s,n<=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 o=[];for(let[r,s]of this.loose)i.has(r)||this.wanted.has(s.section)||(o.push(s.seat),this.loose.delete(r));o.length&&this.host.remove(o),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,n=()=>!i||this.host.now()-e<Pp;for(;this.pinQueue.length&&n();){let o=[];for(let r of this.pinQueue.splice(0,qa)){let s=this.locate(r);s&&!this.isResident(r)&&(o.push(s.seat),this.loose.set(r,s))}o.length&&this.host.build(o),i=!0}for(;this.queue.length&&n();){let o=this.queue[0],r=this.chunks.get(o);if(!r){this.queue.shift();continue}let s=this.built.get(o)??0,a=Math.min(s+qa,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(o,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 n=i.slice(this.built.get(e)??0).filter(o=>!this.loose.has(o.id));n.length&&this.host.build(n),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 Za(t,e,i,n=1e3){let o=new Set,r=s=>{for(let a of s){if(o.size>=n)return!1;a&&o.add(a)}return o.size<n};return r(t)&&r(e)&&r(i),o}import{Circle as Np}from"konva/lib/shapes/Circle";import{Line as Hp}from"konva/lib/shapes/Line";import{Rect as Gp}from"konva/lib/shapes/Rect";import{Text as Wp}from"konva/lib/shapes/Text";function Ie(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Pe(t,e){return Ie(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var Qa=.35,ja=.7,Qe="#0b1220",pt="#ffffff",Ja="#0b1220",eo="#232c40",el="#8b93a7";function to(t,e,i="normal"){let n=t?"bold":i;return e?`italic ${n}`.trim():n}var io="#f7f8fb";import{Text as il}from"konva/lib/shapes/Text";var tl="500",Rp=2.5;function Mp(t,e){return t>=ie||e&&t>=mi}function Ep(t){return t.effectiveScale<mi?!1:t.focusActive||t.stageWidth<U}function Ap(t,e,i){return i&&e>=mi?Math.max(t,Qr/Math.max(e,1e-4)):t}function Fp(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:n,effectiveScale:o}=t;if(!(i>n)||!(i>0))return e;let r=G/Math.max(o,1e-4),s=e*n/i;return Math.max(Math.min(st,r),s)}function no(t,e){let i=(e?1:3)*Math.min(1,t/J);return Math.max(1,t*2-i)}function nl(t){let e=new Map;for(let o of t){let r=e.get(o.rowId);r?r.push(o):e.set(o.rowId,[o])}let i=[];for(let o of e.values())if(!(o.length<2))for(let r=1;r<o.length;r+=1){let s=Math.hypot(o[r].x-o[r-1].x,o[r].y-o[r-1].y);s>0&&Number.isFinite(s)&&i.push(s)}if(!i.length)return 0;i.sort((o,r)=>o-r);let n=Math.floor(i.length/2);return i.length%2?i[n]:(i[n-1]+i[n])/2}function ol(t,e){return e>0?Math.min(t,e/2):t}function rl(t){return Ei(oo(t))}function oo(t){let e=no(t,!1),i=no(J,!1),n=e>0?i/e:1;return me/Math.max(1,n)}function Ei(t){return G/Math.max(t,1e-4)/In(1,!1,G)}function sl(t){return Ei(t)*vi}function _p(t,e,i){let n=t.seatLabelContainer(e);i.getParent()!==n&&n.add(i)}function al(t){let e=t.exportMode?Math.max(t.effScale(),ie):t.effScale(),i=Ep({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),n=t.exportMode?e:In(e,t.labelsWereVisible(),G),o=t.labelLayers(),r=o.seatLabels&&Mp(n,i);t.onLabelVisibilityChange(r),t.setSeatLabelRungOpen(r);let s=g=>{let y=t.worldToScreen({x:g.x(),y:g.y()}),S=g.width()*e,k=g.height()*e;return y.x-S/2>=0&&y.y-k/2>=0&&y.x+S/2<=t.stage.width()&&y.y+k/2<=t.stage.height()};for(let[g,y]of t.boothLabelById){let S=t.circleById.get(g);y.visible(be(y.fontSize(),n)&&!!S?.isVisible()&&t.focusedSeatOpacity(g,S?.getAbsoluteOpacity()??1)>=.5&&s(y))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let a=new Set,l=0,c=t.rowLabelDwell,d=t.gesturing?.()??!1,u=performance.now();if(c?.begin(),r)for(let g of t.visibleSeatCandidates()){if(g.kind==="booth")continue;let y=t.worldToScreen(g);if(y.x<-20||y.x>t.stage.width()+20||y.y<-20||y.y>t.stage.height()+20||t.accessGlyphById.has(g.id)&&t.accessGlyphShouldShow(g.id))continue;let S=t.circleById.get(g.id);if(!S?.isVisible()){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}let k=t.statusById.get(g.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(g.id)&&(k==="booked"||k==="not_for_sale"||k==="held"&&!t.ownedHold.has(g.id))){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(g.id)){t.seatLabelDrops.set(g.id,"selection-tick");continue}if(S&&t.opts.organizerGlyph?.isPainted(S)){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}if(t.focusedSeatOpacity(g.id,S.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(g.id,"dimmed-or-unavailable");continue}let x=Ap(me*t.seatLabelScale(g),e,i),T=ri(g.displayLabel??g.label),P=S?t.seatLabelInk(g,S):t.seatPreferredLabelInk(g),L=t.seatLabelPool.get(g.id);L?(L.position({x:g.x,y:g.y}),L.text(T),L.fontSize(x),L.fontFamily(t.labelFont()),L.fill(P),L.offset({x:0,y:0}),L.scale({x:1,y:1})):(L=new il({x:g.x,y:g.y,text:T,fontSize:x,fontStyle:tl,fontFamily:t.labelFont(),fill:P,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(g.id,L));let C=no(t.seatR,i);if(L.fontSize(Fp({authoredFontSize:x,measuredWidth:L.width(),maxWidth:C,effectiveScale:e})),L.width()>C+.01){t.seatLabelDrops.set(g.id,"label-overflows-marker");continue}if(!be(L.fontSize(),e)){t.seatLabelDrops.set(g.id,"below-minimum-size");continue}if(L.offsetX(L.width()/2),L.offsetY(L.height()/2),_p(t,g.id,L),!s(L)){t.seatLabelDrops.set(g.id,"outside-viewport");continue}if(!(c&&!c.admit(`seat:${g.id}`,u,d))&&(a.add(g.id),t.seatLabelById.set(g.id,L),++l>=jr))break}for(let[g,y]of t.seatLabelPool)a.has(g)||(y.destroy(),t.seatLabelPool.delete(g));let h=new fe;for(let{node:g}of t.freeTextById.values()){if(!g.isVisible())continue;let y=g.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:y.x-ee,y:y.y-ee,width:y.width+ee*2,height:y.height+ee*2})}let p=new fe,m=null,b=()=>{if(m)return m;m=new fe;for(let g of t.seatLabelById.values()){if(!g.isVisible())continue;let y=g.getClientRect({skipShadow:!0,skipStroke:!0});m.insert({x:y.x,y:y.y,width:y.width,height:y.height})}return m},f=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*Rp;if(o.rowLabels)for(let g of Bp(t.rowLabelPlan)){let y=t.rowLabelPlan[g],S=t.focusedSectionId!=null&&y.focusKeys?.includes(t.focusedSectionId),k=Math.max(e,1e-4),w=S?Math.max(y.fontSize,Et/k):y.fontSize,v=Math.max(Math.min(w,Zr(t.stage.width())/k),S?Et/k:0);if(!r&&(!S||!f)||!S&&!be(v,n))continue;let x=t.worldToScreen({x:y.x,y:y.y});if(x.x<-40||x.x>t.stage.width()+40||x.y<-40||x.y>t.stage.height()+40)continue;let T=new il({x:y.x,y:y.y,text:y.text,fontSize:v,fontStyle:tl,fontFamily:t.labelFont(),fill:y.ink,rotation:y.rotation,opacity:y.opacity,shadowColor:"#05070c",shadowBlur:y.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:y.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});y.pill&&Ta(T,y.pill),T.offsetX(T.width()/2),T.offsetY(T.height()/2);let P=t.resolveAutomaticRowLabelPosition(T,y,h);T.position(P),T.setAttr("rowLabel",!0),y.rowKey&&T.setAttr("rowKey",y.rowKey),T.setAttr("focusKeys",y.focusKeys??[]),t.rowLabelGroup.add(T);let L=T.getClientRect({skipShadow:!0,skipStroke:!0}),C=6,I=L.x<C?C-L.x:L.x+L.width>t.stage.width()-C?t.stage.width()-C-L.x-L.width:0,R=L.y<C?C-L.y:L.y+L.height>t.stage.height()-C?t.stage.height()-C-L.y-L.height:0,M=P;if(I||R){let E=t.labelGroup.getAbsoluteTransform(),W=E.point(P);M=E.copy().invert().point({x:W.x+I,y:W.y+R}),T.position(M);let N=T.getClientRect({skipShadow:!0,skipStroke:!0});if(b().collisionCount({x:N.x,y:N.y,width:N.width,height:N.height})>0){T.destroy();continue}}let A=t.rowLabelBox(T,M);if(p.collisionCount(A)>0){T.destroy();continue}if(y.automaticAway&&h.collisionCount(A)>0){T.destroy();continue}if(c&&!c.admit(`row:${g}`,u,d)){T.destroy();continue}h.insert(A),p.insert(A)}c?.end(),t.overlayLayer.batchDraw()}function Bp(t){let e=o=>o.focusKeys?.length?o.focusKeys.join(" "):"",i=[],n=0;for(;n<t.length;){let o=e(t[n]),r=n;for(;r+1<t.length&&e(t[r+1])===o;)r++;if(o){i.push(n),r>n&&i.push(r);for(let s=n+1;s<r;s++)i.push(s)}else for(let s=n;s<=r;s++)i.push(s);n=r+1}return i}function ro(t){let e=Math.max(t,1e-4);return{kind:"marker",diameter:e*2,labelFontSize:oo(e)}}function Op(t){let e=ft(t),i=Math.min(e.width,e.height);return{kind:"block",diameter:i>0?i:J*2,labelFontSize:ge({width:e.width,height:e.height,text:t.label})}}function ft(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,n=1/0,o=-1/0,r=-1/0;for(let s of e)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(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 Number.isFinite(i)?{width:o-i,height:r-n}:{width:Math.abs(t.width),height:Math.abs(t.height)}}function ll(t,e){let i=ro(e.markerRadius),n=null;for(let o of t){let r=o.kind==="booth"?Op({...e.blockDims.get(o.rowId)??{width:J*2,height:J*2},label:o.displayLabel??o.label}):i;(!n||r.labelFontSize<n.labelFontSize||r.labelFontSize===n.labelFontSize&&r.diameter<n.diameter)&&(n=r)}return n??i}function Dp(t){return sl(t.labelFontSize)}function cl(t){return Ei(t.labelFontSize)}function Ai(t){let e=Math.max(t.diameter,1e-4);return Math.max(ae,li/e)}function dl(t){return Math.max(Dp(t),Ai(t)*vi)}function hl(t){for(let e of t.seats){if(e.kind==="booth"){Vp(t,e);continue}let i=t.seatContainer(e.id),n=Ks({x:e.x,y:e.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:Ir(e.glyph,t.catByKey.get(e.categoryKey)),wheelchairBay:e.wheelchairSpaceType==="no-seat"});if(n instanceof Ye&&t.glyphMarkers.push(n),n.setAttr("seatId",e.id),t.circleById.set(e.id,n),t.paintSeat(n,e.id),i.add(n),e.accessible){if(e.wheelchairSpaceType!=="no-seat"){let o=new Np({x:e.x,y:e.y,radius:t.seatR+1.5,stroke:Pt(e.accessibility,{colorblind:t.colorblind,canvasBackground:t.canvasBackground}),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.accessRingById.set(e.id,o),i.add(o)}if(nt(e.accessibility??[])){let o=t.buildAccessGlyph(e,typeof n.fill()=="string"?n.fill():"");t.accessGlyphById.set(e.id,o),i.add(o)}}}}function Vp(t,e){let i=t.seatContainer(e.id),n=t.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},o=e.x,r=e.y,s;if(n.points&&n.points.length>=3?(s=new Hp({x:e.x,y:e.y,points:n.points.flatMap(c=>[c.x,c.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),o=e.x+n.points.reduce((c,d)=>c+d.x,0)/n.points.length,r=e.y+n.points.reduce((c,d)=>c+d.y,0)/n.points.length):s=new Gp({x:e.x,y:e.y,width:n.width,height:n.height,offsetX:n.width/2,offsetY:n.height/2,rotation:n.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s.setAttr("seatId",e.id),t.circleById.set(e.id,s),i.add(s),n.nameHidden){t.paintSeat(s,e.id);return}let a=e.displayLabel??e.label,l=new Wp({x:o,y:r,text:a,fontSize:n.nameSize??ge({...ft(n),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.boothLabelById.set(e.id,l),i.add(l),t.paintSeat(s,e.id)}function ul(t,e,i,n){let o=null,r=1/0,s=t.stage.scaleX()||1;for(let a of t.seats){if(!n?.includeUnavailable&&!t.selection.has(a.id)&&!t.isSelectable(a.id))continue;let l=t.worldToScreen(a),c=t.seatR*s+i,d=Math.hypot(l.x-e.x,l.y-e.y);d<=c&&d<r&&(r=d,o=a.id)}return o}function pl(t){if(!t.objectFloor.size)return null;let e=t.stage.getPointerPosition();if(!e)return null;let i=t.screenToWorld(e),n=null,o=1/0;for(let r of t.seats){let s=r.x-i.x,a=r.y-i.y,l=s*s+a*a;l<o&&(o=l,n=r.rowId)}return n?t.objectFloor.get(n)??null:null}import{Circle as uf}from"konva/lib/shapes/Circle";import{Group as Ol}from"konva/lib/Group";import{Rect as pf}from"konva/lib/shapes/Rect";import{Text as ff}from"konva/lib/shapes/Text";var Re=1.12;function mt(t,e,i,n){if(e.width<=0||e.height<=0)return t.scaleX();let o=n??{x:0,y:0,width:t.width(),height:t.height()},r=Math.min(o.width/(e.width*Re),o.height/(e.height*Re));return q(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 so(t){let{stage:e,box:i,bounds:n,viewport:o,centreScreen:r}=t,s=t.ratio??_t,a=e.scaleX(),l=mt(e,i,n,o)/Math.max(a,1e-4);if(l>=s||l<=1/s)return!1;let c=r.x-(o.x+o.width/2),d=r.y-(o.y+o.height/2);return Math.hypot(c,d)<=Math.min(o.width,o.height)*.02}function fl(t,e,i,n){let o=q(e,n.min,n.max),r=t.scaleX();if(o===r)return!1;let s=(i.x-t.x())/r,a=(i.y-t.y())/r;return t.setAttrs({scaleX:o,scaleY:o,x:i.x-s*o,y:i.y-a*o}),!0}function ml(t,e,i,n,o,r){let s=o??{x:0,y:0,width:t.width(),height:t.height()},a=Math.min(s.width/(e.width*Re),s.height/(e.height*Re)),l=n??i.min,c=q(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 gl(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function ao(t,e){let i=null;for(let n of t){let o=e.get(n)?.logicalId;if(!o||i!=null&&i!==o)return null;i=o}return i}function bl(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var zp="500",Kp=11;function Xp(t){let e=lt(Kp,t),i=gi(t),n=[];for(let o=Math.round(e);o>=i;o-=1)n.push(o);return n.length?n:[i]}var Yp=4;function Up(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 n=i[0];for(let o of i)o.length>=n.length&&(n=o);return n}return e}function yl(t,e,i){let n=t.numberLabel,o=Up(t.label);if(!o)return n.visible(!1),!1;n.text()!==o&&n.text(o),n.fontStyle(i<U?zp:Ce),n.visible(!0),n.rotation(0);let r=Yp/e;for(let s of Xp(i)){n.fontSize(s/e),n.offsetX(n.width()/2),n.offsetY(n.height()/2);for(let a of[t.centroid,...t.labelAnchors])if(n.position(a),ut(a,n.width()+r,n.height()+r,0,t.outline,t.holes))return!0}return n.position(t.centroid),!1}function Sl(t){let e=new Map;for(let i of t){if(i.numberLabel.opacity()<=.05)continue;let n=e.get(i.logicalId);n?n.push(i):e.set(i.logicalId,[i])}for(let i of e.values()){if(i.length<2)continue;let n=i[0];for(let o of i)o.labelArea>n.labelArea&&(n=o);for(let o of i)o!==n&&o.numberLabel.opacity(0)}}function xl(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 n=j("#f4b740","#ef4444",i);e.outlinePoly.stroke(D(n,.72+i*.25)),e.outlinePoly.fill(D(n,.08+i*.13)),e.outlinePoly.strokeWidth(2+i*3.5),e.outlinePoly.shadowColor(n),e.outlinePoly.shadowBlur(4+i*12),e.outlinePoly.shadowOpacity(.25+i*.45)}function lo(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function Ll(t,e,i,n){if(!e)return 0;let o=0;for(let r of t){if(i(r)!=="free")continue;let s=n(r);s&&Ie(s,e)&&(o+=1)}return o}function Cl(t,e){return lo(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Is?"nearly-gone":"normal"}function Tl(t,e){let i=Cl(t,e),n=t.accessFilterActive&&t.sectionAccessibleFree(e)<=0,o=t.blockPaint?.({id:e.logicalId,label:e.label,free:e.free,total:e.total,state:i})??null;e.stateWord=o?.stateWord??null;let r=Ds(t.canvasBackground,i,n?null:o?o.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"?F("map.soldOut"):F("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Il(t,e){return j(e,O(t)?"#ffffff":"#000000",vs)}function co(t,e,i=0){let n=Ss-i;return!e||t.length<=n?t:`${t.slice(0,Math.max(1,n-1)).trimEnd()}\u2026`}function $p(t,e){return Pl(t,e)!=null}function Pl(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function Rl(t,e,i){let n=co(t.label,e,i?i.length+1:0),o=t.stateWord?[`${n} \xB7 ${t.stateWord}`]:[];return i?[...o.map(r=>`${i} ${r}`),`${i} ${n}`,i]:[...o,n]}function qp(t,e,i){let n=Rl(t,e,i),o=(t.nameLabelBadgeOnly?n[1]:n[0])??n[0];t.nameLabel.text()!==o&&t.nameLabel.text(o),t.nameLabel.fontStyle(ys),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*Be:0)}function Zp(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}var Qp=.05;function Ml(t){if(!t.seatCount)return!1;let e=0;for(let n of t.sections)e+=n.memberIds.length;return(t.seatCount-Math.min(e,t.seatCount))/t.seatCount<=Qp}function El(t,e){let i,n;t.reducedMotion?(i=e<=Le?1:0,n=e<=Ke?1:0):(i=q((ve-e)/(ve-Le),0,1),n=q((Le-e)/(Le-Ke),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,n=0);let o=!t.floorOverview&&!t.focusedSectionId&&e<Q;o&&(i=1),(!t.zones.length||t.sectionsPinned)&&(n=0),t.seatLayer.opacity(Ml(t)?o?0:1-i:1);let r=t.stageScaleX,s=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>Rn);s&&t.setLodScale(e);let a=t.focusedSectionId,l=t.stageWidth<U,c=l&&o&&t.zones.length===0,d=le(t.canvasBackground),u=q((i-.2)/.8,0,1),h=new Set(t.zones.map(b=>b.id)),p=new Set;for(let b of t.sections){let f=t.hasFocusDimOverlay?1:a&&b.id!==a&&b.logicalId!==a&&b.zone!==a?Te:1,g=Pl(t,b);g&&b.zone&&p.add(b.zone);let y=Math.min(f,bl(b.memberCategoryKeys,t.categoryFilter)?Te:1,t.accessFilterActive&&!g?Te:1);b.outlinePoly.opacity(o?0:(1-i)*y),b.blockPoly.opacity(ns*i*y);let S=t.sectionIsOwned(b);b.blockPoly.stroke(S?t.selectionColor:b.shellStroke||d.sectionStroke),b.blockPoly.strokeWidth((S?os:Xe)/Math.max(r,1e-4));let k=b.blockPoly.fill(),w=typeof k=="string"?k:b.baseFill,v=!!b.shellCategoryColor&&!b.explicitInk&&["normal","nearly-gone"].includes(Cl(t,b)),x=v?Ws(b.shellCategoryColor,w,4.5):Gs(w,b.explicitInk,b.preferredInk,vr);b.nameLabel.fill(x),b.subLabel.fill(x),qp(b,l,g);let T=b.zone!=null&&h.has(b.zone);s&&(u>.01||b.externalLabel)&&tf(t,b,r,Rl(b,l,g),!T);let P=g||!T?1:1-n;b.nameLabel.opacity(b.nameLabelFits?(b.externalLabel?1:u)*P*y:0),b.subLabel.opacity(0);let L=c&&!b.nameLabelFits,C=T&&n>.01;s&&(b.numberLabelFits=(C||L)&&yl(b,r,t.stageWidth)),b.numberLabelFits&&b.numberLabel.fill(v?x:de(w,b.explicitInk,b.preferredInk)),b.numberLabel.opacity(b.numberLabelFits?(L?u:C?n:0)*y:0);let I=b.nameLabel.opacity(),R=b.numberLabel.opacity();if(I>.05&&R>.05){let M=Math.min(1*y,I+R);I>=R?(b.nameLabel.opacity(M),b.numberLabel.opacity(0)):(b.numberLabel.opacity(M),b.nameLabel.opacity(0))}}let m=n;for(let b of t.zones){let f=t.accessFilterActive&&!p.has(b.id)?Te:1,g=b.label.visible()?m*f:0;b.back.opacity(g),b.label.opacity(g),b.sub&&b.sub.opacity(vl(t,b)?0:g),s&&nf(t,b,r)}if(!t.glideInProgress&&(u>.01||m>.01)){Jp(t,r),jp(t.sections);for(let b of t.zones){let f=b.label.opacity();b.back.opacity(f),b.sub&&b.sub.opacity(vl(t,b)?0:f)}}(m>.01||c)&&Sl(t.sections);for(let b of t.sections)Zp(b);t.bgLayer.batchDraw()}function vl(t,e){return t.stageWidth<U||!e.sub||!e.sub.visible()}function jp(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 n=i.filter(o=>o.nameLabel.opacity()>.05).sort((o,r)=>{let s=z(o.outline),a=z(r.outline);return a.width*a.height-s.width*s.height});for(let o of n.slice(1))o.nameLabel.opacity(0)}}function Jp(t,e){let n=[],o=u=>{let h=t.worldToScreen({x:u.x(),y:u.y()}),p=z(ht({x:0,y:0},u.width()*e,u.height()*e,u.rotation()));return{x:h.x-p.width/2,y:h.y-p.height/2,w:p.width,h:p.height}};for(let u of t.zones){if(u.label.opacity()<=.05)continue;let h=u.back.getAbsolutePosition(),p=u.back.width()*e,m=u.back.height()*e;n.push({node:u.label,tier:2,section:!1,zone:u,box:{x:h.x-p/2,y:h.y-m/2,w:p,h:m}})}for(let u of t.sections){if(u.nameLabel.opacity()>.05){let h=$p(t,u)?-1:1;n.push({node:u.nameLabel,tier:h,section:!0,area:u.labelArea,box:o(u.nameLabel)})}u.numberLabel.opacity()>.05&&n.push({node:u.numberLabel,tier:1,section:!1,area:u.labelArea,box:o(u.numberLabel)})}let r=t.landmarks.map(u=>{let h=t.worldToScreen({x:u.x,y:u.y}),p=t.worldToScreen({x:u.x+u.width,y:u.y+u.height});return{x:Math.min(h.x,p.x),y:Math.min(h.y,p.y),w:Math.abs(p.x-h.x),h:Math.abs(p.y-h.y)}});if(n.length<2&&!r.length)return;n.sort((u,h)=>u.tier-h.tier||(h.area??0)-(u.area??0)||u.box.y-h.box.y||u.box.x-h.box.x);let s=[...r],a=u=>s.some(h=>u.x<h.x+h.w+4&&h.x<u.x+u.w+4&&u.y<h.y+h.h+4&&h.y<u.y+u.h+4),l=n.some(u=>u.zone)?af(t):[],c=t.bgLayer.getStage()?.height()??1/0,d=u=>!a(u)&&!l.some(h=>sf(u,h,2))&&u.x>=6&&u.x+u.w<=t.stageWidth-6&&u.y>=Al&&u.y+u.h<=c-6;for(let u of n){if(u.zone){let p=lf(t,u.zone,u.box,d);p?s.push(p):u.node.opacity(0);continue}if(!a(u.box)){s.push(u.box);continue}let h=!1;if(u.section){let p=u.node.fontSize(),m=u.node.y(),b=u.node.letterSpacing()>0;for(let f of Pn){let g=p*f;if(g*e<Ft(t.stageWidth))break;Me(u.node,g,m),b&&(u.node.letterSpacing(u.node.fontSize()*Be),u.node.offsetX(u.node.width()/2));let y=o(u.node);if(!a(y)){s.push(y),h=!0;break}}h||(Me(u.node,p,m),b&&(u.node.letterSpacing(u.node.fontSize()*Be),u.node.offsetX(u.node.width()/2)))}h||u.node.opacity(0)}}function Me(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}function ef(t,e,i){let n=z(t);return ge({width:n.width*i,height:n.height*i,text:e})}function tf(t,e,i,n,o=!1){e.subLabelFits=!1;let r=t.stageWidth<U,s=Ft(t.stageWidth),a=Mn(at*e.labelScale,t.stageWidth,i,t.fitScale,void 0,s),c=o&&!e.authoredLabelSize&&!(t.fitScale>0&&i>t.fitScale)&&Ml(t)?Math.max(a,ef(e.outline,n[0]??e.label,i)):a;if(e.externalLabel){e.nameLabel.text(n[0]),e.nameLabel.rotation(e.externalLabel.rotation),Me(e.nameLabel,c/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[h,p]of n.entries()){e.nameLabel.text(p);let m=z(e.outline),b=e.authoredLabelRotation!=null?[e.authoredLabelRotation]:m.height>m.width*Cs?[0,-90]:[0];for(let f of b)for(let g of e.labelAnchors)for(let y=c;y>=s;y-=1){e.nameLabel.rotation(f),Me(e.nameLabel,y/i,e.nameLabel.y()),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Be),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(g);let S=Ls/i;if(ut(g,e.nameLabel.width()+S,e.nameLabel.height()+S,f,e.outline,e.holes)){e.nameLabelFits=!0,e.nameLabelBadgeOnly=h>0;return}}}e.nameLabel.text(n[0]),e.nameLabelBadgeOnly=!1;let d=e.labelAnchors[0]??e.centroid;e.nameLabel.position(d),e.nameLabel.rotation(e.authoredLabelRotation??0),Me(e.nameLabel,s/i,d.y),r&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Be),e.nameLabel.offsetX(e.nameLabel.width()/2));let u=z(e.outline);e.nameLabelFits=e.nameLabel.width()<=u.width&&e.nameLabel.height()<=u.height}function wl(t,e,i){let n=o=>(t.text(o),t.width());if(!(n(e)<=i)){for(let o=e.length-1;o>=1;o-=1)if(n(`${e.slice(0,o).trimEnd()}\u2026`)<=i)return;n("\u2026")}}function nf(t,e,i){let n=Si(t.stageWidth),o=t.stageWidth<U,r=e.sub!=null&&!o,s=(o?ls:ds)*n/i,a=(o?cs:hs)*n/i,l=Mn(bi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Me(e.label,l/i,e.anchor.y),r&&(Me(e.sub,lt(yi,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*rs),e.sub.offsetX(e.sub.width()/2));let c=o?t.stageWidth*ps/i-s*2:1/0,d=!o&&e.spanWorld>0?e.spanWorld*fs-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 x of Pn){let T=Math.max(_e,l*x);if(T>=e.label.fontSize()*i-.001||(Me(e.label,T/i,e.anchor.y),e.label.width()<=u))break}if(e.label.width()>u&&(wl(e.label,e.name,Math.max(u,1)),of(e.label.text())<rf(e.name)&&wl(e.label,e.name,Math.max(c,1)),Me(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){kl(e);return}e.label.visible(!0),e.back.visible(!0);let p=r?3*n/i:0;e.label.x(e.anchor.x),r?e.sub.x(e.anchor.x):e.sub&&e.sub.opacity(0);let m=Math.max(e.label.width(),r?e.sub.width():0)+s*2,b=e.label.height()+(r?p+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(p+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+p)/2),e.back.position(e.anchor),e.back.size({width:m,height:b}),e.back.offset({x:m/2,y:b/2}),e.back.cornerRadius(us*n/i),e.back.strokeWidth(1/i),e.aboveZone&&Fi(e,0,-(b/2+4*n/i));let f=e.back.getAbsolutePosition(),g=6,y=m*i;if(y>t.stageWidth-g*2){kl(e);return}let S=y/2,w=(q(f.x,g+S,t.stageWidth-g-S)-f.x)/i;Math.abs(w)>.001&&Fi(e,w,0);let v=Al+b*i/2;f.y<v&&Fi(e,0,(v-f.y)/i)}function of(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function rf(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function kl(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 Fi(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)}var Al=62;function sf(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 af(t){return t.sections.map(e=>{let i=z(e.outline),n=t.worldToScreen({x:i.x,y:i.y}),o=t.worldToScreen({x:i.x+i.width,y:i.y+i.height});return{x:Math.min(n.x,o.x),y:Math.min(n.y,o.y),w:Math.abs(o.x-n.x),h:Math.abs(o.y-n.y)}})}function lf(t,e,i,n){let o=[i];if(e.area){let a=t.worldToScreen({x:e.area.x,y:e.area.y}),l=t.worldToScreen({x:e.area.x+e.area.width,y:e.area.y+e.area.height}),c=(a.x+l.x)/2-i.w/2,d=(a.y+l.y)/2-i.h/2;o.push({...i,x:c,y:l.y+6},{...i,x:a.x-6-i.w,y:d},{...i,x:l.x+6,y:d})}for(let s of ms)s!==0&&o.push({...i,y:i.y+s});let r=t.stageScaleX||1;for(let s of o)if(n(s))return s!==i&&Fi(e,(s.x-i.x)/r,(s.y-i.y)/r),s;return null}function cf(t,e){if(!t.length)return null;let i=1/0,n=1/0,o=-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<n&&(n=s.y),s.x>o&&(o=s.x),s.y>r&&(r=s.y));return!Number.isFinite(i)||!Number.isFinite(n)?null:{x:i-e,y:n-e,width:o-i+e*2,height:r-n+e*2}}function po(t,e=0){let i=new Map;for(let o of t){let r=`${o.rowId}|${o.categoryKey}`,s=i.get(r);s||(s={categoryKey:o.categoryKey,points:[]},i.set(r,s)),s.points.push({x:o.x,y:o.y})}let n=[];for(let[o,r]of i){let s=cf(r.points,e);s&&n.push({id:o,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return n}function ho(t,e){let i=Math.max(0,Math.max(t.x-(e.x+e.width),e.x-(t.x+t.width))),n=Math.max(0,Math.max(t.y-(e.y+e.height),e.y-(t.y+t.height)));return Math.hypot(i,n)}function uo(t,e){let i=Math.min(t.x,e.x),n=Math.min(t.y,e.y);return{x:i,y:n,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-n}}function Fl(t){if(!t.length)return 0;let e=[...t].sort((n,o)=>n-o),i=Math.floor(e.length/2);return e.length%2?e[i]:(e[i-1]+e[i])/2}function df(t){if(!t.length)return 0;let e=Fl(t.map(n=>Math.min(n.bounds.width,n.bounds.height)));if(t.length<2)return e;let i=[];for(let n=0;n<t.length;n+=1){let o=1/0;for(let r=0;r<t.length;r+=1)n!==r&&(o=Math.min(o,ho(t[n].bounds,t[r].bounds)));Number.isFinite(o)&&i.push(o)}return Fl(i)+e}function fo(t,e){if(!t.length)return[];let i=df(t)*(e?.gapRows??2),n=e?.minRows??2,o=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,p)=>h.bounds.y-p.bounds.y||h.bounds.x-p.bounds.x||h.id.localeCompare(p.id)),d=[];for(let h of c){let p=d.find(m=>ho(m.bounds,h.bounds)<=i);p?(p.bounds=uo(p.bounds,h.bounds),p.rowIds.push(h.id),p.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 p=h+1;p<d.length;p+=1)if(!(ho(d[h].bounds,d[p].bounds)>i)){d[h].bounds=uo(d[h].bounds,d[p].bounds),d[h].rowIds.push(...d[p].rowIds),d[h].seatCount+=d[p].seatCount,d.splice(p,1),u=!0;break e}}for(let h of d)h.rowIds.length<n&&h.seatCount<o||(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 _l(t){let e=null;for(let i of t)e=e?uo(e,i.bounds):{...i.bounds};return e}function Bl(t,e){let i=null,n=1/0;for(let o of t){let{x:r,y:s,width:a,height:l}=o.bounds;if(e.x<r||e.x>r+a||e.y<s||e.y>s+l)continue;let c=a*l;c<n&&(i=o,n=c)}return i}function Nl(t){return t*.3}function Dl(t){return Nl(t)*2+t*.42}var _i=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=fo(po(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),n=le(i),o=Il(i,i),r=X(o,n.sectionInk),s=new Ol({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 Ol({listening:!1}),u=new pf({...c,width:0,height:0,fill:o,stroke:n.sectionStroke,strokeWidth:Xe,opacity:ws,listening:!1,perfectDrawEnabled:!1}),h=new uf({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),p=new ff({...c,text:l,fontSize:at,fontStyle:Ce,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(u),d.add(h),d.add(p),s.add(d),this.labels.push({cluster:a,pill:d,plate:u,swatch:h,text:p,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,n=this.host.exportMode||this.host.seatsPickable()&&e<ae||e>=this.host.readableScale();return this.revealed=n||Xr(Tn(i,e),Tn(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.hasSections()||this.host.seatsPickable())return!1;let i=this.host.screenToWorld(e),n=this.clusterAt(i);if(!n)return!1;let o=this.host.seatR()*2,r={x:n.bounds.x-o,y:n.bounds.y-o,width:n.bounds.width+o*2,height:n.bounds.height+o*2},s=this.host.stage;if(mt(s,r,this.host.zoomBounds(),this.host.framingViewport())<=s.scaleX()*_t)return!1;let l=this.diveTarget(r,null,i);return l?(this.host.focusRegion(l,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,i,n){let o=this.host.stage,r=this.host.framingViewport(),s=this.host.zoomBounds(),a=mt(o,e,s,r),l=Math.min(Math.max(this.host.readableScale(),this.host.pickableScale()),s.max);if(a>=l)return e;let c=r.width/(l*Re),d=r.height/(l*Re);if(!(c>0)||!(d>0))return null;let u=i??{x:e.x+e.width/2,y:e.y+e.height/2},h={x:u.x-c/2,y:u.y-d/2,width:c,height:d};return n?gf(h,n):h}glideTowardTap(e){let i=this.host.stage.scaleX(),n=Ps(i,this.host.pickableScale());if(n==null||n<=i*_t)return!1;let o=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(n*Re),a=r.height/(n*Re);return!(s>0)||!(a>0)?!1:(this.host.focusRegion({x:o.x-s/2,y:o.y-a/2,width:s,height:a}),!0)}setPressLandsOnChart(e){this.pressOnChart=e}syncCursor(e){if(this.host.exportMode)return;let i=this.host.seatsPickable()?e?"pointer":"default":this.pressOnChart?"zoom-in":"default";for(let n of[this.host.stage.container(),this.host.stage.content])n&&n.style.cursor!==i&&(n.style.cursor=i)}clusterAt(e){let i=Bl(this.all,e);if(i)return i;if(!this.visible)return null;for(let n of this.labels){if(!n.pill.visible())continue;let o=n.plate.width()/2,r=n.plate.height()/2;if(Math.abs(e.x-n.text.x())<=o&&Math.abs(e.y-n.text.y())<=r)return n.cluster}return null}size(e,i){let n=Math.max(e,1e-4),o=i<U,r=`${n.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=lt(at,i),a=ks/n,l=xs/n;for(let c of this.labels){let{text:d,plate:u,swatch:h,cluster:p}=c;d.text(co(c.label,o)),d.fontStyle(o?bs:Ce);let m=s,b=0;for(;d.fontSize(Math.max(1,m/n)),d.letterSpacing(d.fontSize()*Be),b=Dl(d.fontSize())+d.width()+a*2,!(b<=p.bounds.width||m<=_e);)m=Math.max(_e,m-1);let f={x:p.bounds.x+p.bounds.width/2,y:p.bounds.y+p.bounds.height/2},g=d.height()+l*2,y=b-a*2,S=f.x-y/2;h.radius(Nl(d.fontSize())),h.position({x:S+h.radius(),y:f.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:S+Dl(d.fontSize()),y:f.y}),u.size({width:b,height:g}),u.offset({x:b/2,y:g/2}),u.cornerRadius(g/2),u.strokeWidth(Xe/n),u.position(f)}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},n=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=n.get(r.cluster.categoryKey);(!l||a<l.distance||a===l.distance&&r.cluster.seatCount>l.entry.cluster.seatCount)&&n.set(r.cluster.categoryKey,{entry:r,distance:a})}let o=!1;for(let r of this.labels){let s=n.get(r.cluster.categoryKey)?.entry===r;r.pill.visible()!==s&&(r.pill.visible(s),o=!0)}o&&this.host.labelLayer.batchDraw()}viewportWorldRect(){let e=this.host.framingViewport(),i=this.host.screenToWorld({x:e.x,y:e.y}),n=this.host.screenToWorld({x:e.x+e.width,y:e.y+e.height});return{x:i.x,y:i.y,width:n.x-i.x,height:n.y-i.y}}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),i=!1;for(let n of this.labels){let o=e&&!e.has(n.cluster.categoryKey)?.22:1;n.pill.opacity()!==o&&(n.pill.opacity(o),i=!0)}i&&this.host.labelLayer.batchDraw()}boundsForSeats(e,i){if(!e.length)return null;let n=po(e,this.host.seatR()),o=fo(n);o.length||(o=n.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=_l(o);if(!r)return null;let s=o.reduce((a,l)=>l.seatCount>a.seatCount?l:a,o[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:o.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 n=i.opacity(),o=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(n+(o-n)*l),l>=1&&i.visible(o>0),this.host.labelLayer.batchDraw(),this.fadeRaf=l<1?requestAnimationFrame(s):0};this.fadeRaf=requestAnimationFrame(s)}},mf=.18;function gf(t,e){let i=(n,o,r)=>{let s=o*mf;return r<n+s?r-s:r>n+o-s?r+s-o:n};return{...t,x:i(t.x,t.width,e.x),y:i(t.y,t.height,e.y)}}import{Circle as bf}from"konva/lib/shapes/Circle";import{Line as yf}from"konva/lib/shapes/Line";function Hl(t,e,i){let n=t.seatRadius(),o=new bf({x:e.x,y:e.y,radius:n,stroke:i,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.overlayLayer.add(o);let r=performance.now(),s=620,a=l=>{if(!o.getLayer())return;let c=Math.max(0,Math.min(1,(l-r)/s));o.radius(n*(1+c*1.8)),o.opacity(.9*(1-c)),t.overlayLayer.batchDraw(),c<1?requestAnimationFrame(a):(o.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(a)}function Gl(t,e,i){for(let n of e){let o=n.outline,r=o.reduce((u,h)=>({x:u.x+h.x,y:u.y+h.y}),{x:0,y:0});r.x/=o.length,r.y/=o.length;let s=new yf({x:r.x,y:r.y,points:o.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)),m=1+(1-Math.pow(1-h,3))*.04;s.scale({x:m,y:m}),s.opacity(.92*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as Lf}from"konva/lib/Group";import{Shape as Cf}from"konva/lib/Shape";import{Group as Sf}from"konva/lib/Group";import{Shape as vf}from"konva/lib/Shape";function wf(t,e,i){let n=e.length,o={x:(e[n-1].x+e[0].x)/2,y:(e[n-1].y+e[0].y)/2};t.moveTo(o.x,o.y);for(let r=0;r<n;r+=1){let s=e[r],a=e[(r+1)%n],l=e[(r-1+n)%n],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 kf(t,e){let i=1/0,n=1/0,o=-1/0,r=-1/0,s=(a,l)=>{!Number.isFinite(a)||!Number.isFinite(l)||(a<i&&(i=a),l<n&&(n=l),a>o&&(o=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 xf(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!(o>=i)||!(r>=n)?{x:0,y:0,width:0,height:0}:{x:i,y:n,width:o-i,height:r-n}}function xf(t,e){let{center:i,radius:n}=t;if(!(n>0))return[];let o=Math.PI*2,r=d=>(d%o+o)%o,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)||o,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+n*Math.cos(u),y:i.y+n*Math.sin(u)})}return c}function De(t,e,i,n){let o=vn(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0,s=new vf({...i,sceneFunc(l,c){l.beginPath();let d=h=>{if(h.length){if(r>0&&h.length>=3)return wf(l,h,r);l.moveTo(h[0].x,h[0].y);for(let p=1;p<h.length;p+=1)l.lineTo(h[p].x,h[p].y);l.closePath()}};n?(h=>{l.moveTo(h.start.x,h.start.y);let p=h.start;for(let m of h.segments)m.kind==="line"?l.lineTo(m.end.x,m.end.y):m.kind==="arc"?l.arc(m.center.x,m.center.y,m.radius,Math.atan2(p.y-m.center.y,p.x-m.center.x),Math.atan2(m.end.y-m.center.y,m.end.x-m.center.x),!m.clockwise):l.bezierCurveTo(m.control1.x,m.control1.y,m.control2.x,m.control2.y,m.end.x,m.end.y),p=m.end;l.closePath()})(n):d(t);for(let h of er(e)){let p=vn(h)>0;d(p===o?[...h].reverse():h)}l.fillStrokeShape(c)},perfectDrawEnabled:!1}),a=kf(t,n);return s.getSelfRect=()=>({...a}),s}var gt=class extends Sf{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 Wl(t,e){if(!e.length)return null;let i=new Lf({listening:!1});for(let n of e)i.add(De(n.outline,n.holes,{fill:Fs,stroke:D("#ffffff",.1),strokeWidth:1,listening:!1},n.outlinePath));return t.bgLayer.add(i),i.moveToTop(),i}function Vl(t,e){let{bounds:i}=t,o=Math.max(i.width,i.height,1)*4+1e3,r=[{x:i.x-o,y:i.y-o},{x:i.x+i.width+o,y:i.y-o},{x:i.x+i.width+o,y:i.y+i.height+o},{x:i.x-o,y:i.y+i.height+o}],s=new Cf({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)d.push(u.outline);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 Tf=.2;function zl(t,e){return t.startsWith("#")?j(e,t,Tf):t}var $l=.5,$=Math.SQRT1_2,If="#f3f4f6",Kl=4;function Pf(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?$l:Math.min(1,Math.max(0,e))}function Rf(t){return t==="booked"||t==="not_for_sale"?Ms:Rs}function Xl(t,e){return Number.parseInt(t.slice(e,e+2),16)}function Yl(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,n,o]=e.toLowerCase();return`#${i}${i}${n}${n}${o}${o}`}function Mf(t,e,i){let n=Yl(t),o=Yl(e);if(!n||!o)return t;let r=Math.min(1,Math.max(0,i)),s="#";for(let a=1;a<7;a+=2){let l=Math.round(Xl(n,a)*(1-r)+Xl(o,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function Ul(t,e,i,n){let o=i*4,r=e*$,s=-e*$,a=n*$*2*o,l=n*-$*2*o,c=r+o*$,d=s+o*$,u=r-o*$,h=s-o*$;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 Ef(t,e){let i=e*4,n=Math.max(e*.45,1);t.beginPath();for(let o=-Kl;o<=Kl;o++){let r=o*n*2,s=r+n,a=r*$,l=-r*$,c=s*$,d=-s*$;t.moveTo(a+i*$,l+i*$),t.lineTo(a-i*$,l-i*$),t.lineTo(c-i*$,d-i*$),t.lineTo(c+i*$,d+i*$),t.closePath()}t.clip()}function Bi(t,e){t._sceneFunc(e)}function ql(t){let e=this,i=e.attrs,n=i.markRadius||1,o=i.fill,r=e.getStage(),s=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(n*2*s<16){i.fill=i.markMidtone??o,Bi(e,t),i.fill=o;return}let l=(1-2*(i.markFraction??$l))*n;t.save(),Ul(t,l,n,1),i.fill=i.markBase??o,Bi(e,t),t.restore(),t.save(),Ul(t,l,n,-1),i.fill=i.markFill??o,Bi(e,t),i.markHatch&&(Ef(t,n),i.fill=If,Bi(e,t)),t.restore(),i.fill=o}function Af(t,e,i,n,o,r){let s=Pf(e),a=Rf(i),l=t.attrs;l.markFraction=s,l.markBase=n,l.markFill=a,l.markMidtone=Mf(n,a,1-s),l.markHatch=r,l.markRadius=o>0?o:1,t.fill(l.markMidtone),t.stroke(""),t.strokeWidth(0),t.dash([]),t.opacity(1),t.sceneFunc(ql)}function Ff(t){t.setAttr("sceneFunc",void 0)}function Di(t){return t.attrs.sceneFunc===ql}var Oi=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 n=new Set;for(let[o,r]of Object.entries(e))i.has(o)&&(r&&r.kind==="partial"?(this.marks.set(o,r),n.add(o)):this.marks.delete(o)&&n.add(o));return n}paint(e,i,n,o,r,s,a){let l=a?void 0:this.marks.get(i);if(!l){Di(e)&&Ff(e);return}Af(e,l,n,o,r,s)}};var Zl="#9ca3af";var _f="#f4b740",Bf="#854d0e",Of="#1a1200",Df="#f1f4f9",Nf="#1a2234",Hf="#475569",Gf="#c3cbdc";function Wf(t){return t==="held"||t==="booked"||t==="not_for_sale"}function Ql(t,e=!1,i=!1){if(!Wf(t))return null;if(e){if(t==="not_for_sale"){let n=i?Gf:Hf;return{fill:i?Nf:Df,stroke:n,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"cross",glyphInk:n}}return t==="booked"?{fill:Zl,stroke:"",strokeWidth:0,dash:[],opacity:.75,scale:1}:{fill:_f,stroke:Bf,strokeWidth:1,dash:[],opacity:1,scale:1,glyph:"clock",glyphInk:Of}}return{fill:Zl,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}}function jl(t){let{focusedId:e}=t;if(!e)return null;let i=new Set([e]),n=t.sectionOf(e);if(n!=null){for(let c of t.seats){let d=t.seatId(c);t.sectionOf(d)===n&&i.add(d)}return i}let o=t.seats.find(c=>t.seatId(c)===e);if(!o)return i;let r=t.seatPoint(o),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 Jl(t,e,i){let n=i(t);return n!=null&&n===i(e)}var Ni=Object.freeze([]),Vf=.18;function ec(t,e,i){let n=t.seat(i),o=t.seatStatus(i),r=t.isSelected(i),s=t.categoryColor(n.categoryKey),a=t.boothLabel(i),l=t.canvasBackground(),c=t.selectionColor();e.dash(Ni),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let d=o==="held"&&t.isOwnedHold(i),u=t.organizer?.()??!1,h=d?null:Ql(o,u,u&&!O(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(se(s,c===pt?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===pt?se(s,.28):s),t.seatMarks.paint(e,i,o,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),Di(e)&&e.scale({x:1,y:1}),n.wheelchairSpaceType==="no-seat"&&o==="free"&&(e.stroke(Pt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),e.strokeWidth(r?3:2),e.dash([3,2])),a){a.text(h?"":n.displayLabel??n.label);let L=t.boothExtent(n.rowId);a.fontSize(L?.nameSize??(L?ge({...L,text:n.displayLabel??n.label}):Ge)),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??Qe),a.offsetX(a.width()/2),a.offsetY(a.height()/2)}let p=o==="free"||o==="held"&&!t.isOwnedHold(i),m=()=>{let L=e.fill();typeof L=="string"&&e.fill(zl(L,l))},b=t.accessFilter();if(b&&p&&!r){let L=Pe(n,b);L==="other"?(m(),e.opacity(Math.min(e.opacity(),Qa))):L==="companion"&&e.opacity(Math.min(e.opacity(),ja))}let f=t.categoryHighlight();f&&o==="free"&&!r&&n.categoryKey!==f&&e.opacity(.25);let g=t.seatHighlight();g&&!r&&!g.has(i)&&e.opacity(Math.min(e.opacity(),Vf));let y=t.categoryFilter();y&&p&&!r&&!y.has(n.categoryKey)&&(m(),e.opacity(.22)),t.commercialLimitedFilter()&&o==="free"&&!r&&(n.commercial?.restrictedView||n.commercial?.obstructedView)&&e.opacity(.22);let S=t.dimmedSections();if(S.size){let L=t.seatSection(i);(L?S.has(L.id)||S.has(L.logicalId)||L.zone!=null&&S.has(L.zone):S.has(ur))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(Es),e.stroke(""),e.strokeWidth(0),e.dash(Ni),e.opacity(As),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let k=t.boothLabel(i)??t.seatLabel(i);if(k){k.fill(t.seatLabelInk(n,e));let L=!a&&(r||d);k.visible(be(k.fontSize(),t.effScale())&&e.opacity()>=.5&&!L)}let w=t.organizerGlyph,v=h?.glyph??null,x=Di(e)||t.closedSections().size>0&&t.seatInClosedSection(i);if(w&&v&&!x){let L=a?t.boothExtent(n.rowId):void 0,C=L?Math.min(L.width,L.height)/2:t.seatRadius();w.apply(e,v,h.glyphInk??"",C),a||k?.visible(!1)}else w?.isPainted(e)&&w.clear(e);let T=t.accessGlyph(i);if(T){let L=e.fill();T.fill(ai(typeof L=="string"?L:"")),T.opacity(e.opacity()),T.visible(t.accessGlyphShouldShow(i))}let P=t.accessRing(i);P&&(P.stroke(Pt(n.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),P.opacity(e.opacity()),P.visible(t.accessRingShouldShow(i)))}function Hi(t,e){let i=null,n=1/0;for(let[o,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 p=u*u+h*h;p<n&&(n=p,i=o)}return i}var zf=Math.log(1.15)/100,Kf=.01,Xf=220,Yf=50;function nc(){return{kind:null,at:-1/0}}function tc(t,e,i){return e===1?t*33:e===2?t*i:t}function oc(t,e,i,n=800){let o=tc(t.deltaX,t.deltaMode,n),r=tc(t.deltaY,t.deltaMode,n),s=i-e.at<Xf&&e.kind!==null,a,l=t.deltaX===0&&Number.isInteger(t.deltaY)&&Math.abs(t.deltaY)>=Yf;return(t.ctrlKey||t.metaKey)&&!(t.deltaMode!==0||l)?a="pinch":t.ctrlKey||t.metaKey?a="notch":s&&e.kind!=="pinch"?a=e.kind:t.deltaMode!==0||l?a="notch":a="pan",e.kind=a,e.at=i,a==="pan"?{kind:"pan",dx:o,dy:r}:a==="pinch"?{kind:"zoom",factor:ic(Math.exp(-r*Kf),.8,1.25),eased:!1}:{kind:"zoom",factor:ic(Math.exp(-r*zf),.5,2),eased:!0}}function ic(t,e,i){return Math.min(i,Math.max(e,t))}var bt=new WeakMap;function Wt(t){let e=bt.get(t);e&&(e.raf&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.raf),bt.delete(t))}function Gi(t,e,i){let{min:n,max:o}=t.bounds(),r=t.stage.scaleX(),s=bt.get(t.stage),a=s?.raf?s.target:r,l=Math.min(o,Math.max(n,a*e));if(t.reducedMotion()||typeof requestAnimationFrame!="function"){Wt(t.stage),t.apply(l,i);return}if(s?.raf){s.target=l,s.point=i;return}if(Math.abs(Math.log(l/r))<.002)return;let c={target:l,point:i,raf:0,last:performance.now()};bt.set(t.stage,c);let d=u=>{let h=bt.get(t.stage);if(h!==c)return;let p=Math.max(0,u-h.last);h.last=u;let m=t.stage.scaleX(),b=Math.log(h.target/m),f=1-Math.exp(-p/55),g=Math.abs(b*(1-f))<.002,y=g?h.target:m*Math.exp(b*f);t.apply(y,h.point);let S=Math.abs(y-m)>1e-9&&t.stage.scaleX()===m;if(g||S){bt.delete(t.stage);return}h.raf=requestAnimationFrame(d)};c.raf=requestAnimationFrame(d)}function Wi(t){return t?.getAttr?.("seatId")??void 0}var Vi=.85,Uf=.38,$f=Object.freeze([3,3]);function qf(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function rc(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function Zf(t){let e=null,i=0,n=()=>{i=0,!(!e||t.destroyed?.())&&(Vt(t)||(t.clusterLabels.setPressLandsOnChart(!rc(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return o=>{e=o,i||(i=requestAnimationFrame(n))}}var Qf=Object.freeze([2,2]);function jf(t){let e=null,i=0,n=!1,o=null,r=()=>{o&&(o=null,t.hoverRing.visible(!1),t.overlayLayer.batchDraw())},s=()=>{if(i=0,!e||n||t.destroyed?.())return;if(!t.manageSeatHits()||t.cached()){r();return}let a=t.nearestSeatToScreen(e,ue),l=a?t.seat(a):void 0;if(!a||!l){r();return}a!==o&&(o=a,t.hoverRing.position(l),t.hoverRing.opacity(Vi),t.hoverRing.dash(Qf),t.hoverRing.visible(!0),t.overlayLayer.batchDraw())};return{move(a){e=a,i||(i=requestAnimationFrame(s))},hide(){e=null,r()},onSeat(a){n=a,a&&(o=null)}}}var Vt=t=>t.seatsPickable()||t.manageSeatHits();function sc(t){t.attachHoverCard();let e=Zf(t),i=jf(t);t.seatLayer.on("click tap",o=>{if(t.moved()>we||t.isGhostClick(o))return;let r=Wi(o.target);r&&Vt(t)&&t.handleSeatTap(r)}),t.seatLayer.on("mouseover",o=>{let r=Wi(o.target);if(!r)return;let s=t.seat(r);if(!s)return;i.onSeat(!0),t.setHoveredId(r);let a=Jf(t,r);t.hoverRing.position(s),t.hoverRing.opacity(a==="muted"?Uf:Vi),t.hoverRing.dash(a==="muted"?$f:Ni),t.hoverRing.visible(a!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(a==="full"),t.onHover?.(s,{mark:t.seatMark(r),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{i.onSeat(!1),t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let o=t.stage.getPointerPosition();o&&(e(o),i.move(o))}),t.stage.on("mouseleave",()=>i.hide());let n=nc();t.stage.on("wheel",o=>{o.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let r=t.container.getBoundingClientRect(),s={x:o.evt.clientX-r.left,y:o.evt.clientY-r.top},a=oc(o.evt,n,performance.now(),t.stage.height());a.kind==="pan"&&t.panBy?t.panBy(a.dx,a.dy):a.kind==="zoom"&&a.eased&&t.zoomBounds?Gi({stage:t.stage,reducedMotion:t.reducedMotion,bounds:t.zoomBounds,apply:(l,c)=>t.zoomAbout(l,c,"frame")},a.factor,s):a.kind==="zoom"&&t.zoomAbout(t.stage.scaleX()*a.factor,s,"frame"),e(s)}),t.stage.on("click tap",o=>{if(t.moved()>we||t.isGhostClick(o))return;let r=t.stage.getPointerPosition();if(!r)return;if(t.sectionCount()){let a=t.ownedBadgeAt(t.screenToWorld(r));if(a&&t.focusOwnedSeats(a))return}if(!(Wi(o.target)&&Vt(t))){let a=Hi(t.selectionMarkers(),r);if(a){t.focusSeats([a],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(r))return;if(t.rowLabelAt&&t.selectRow){let a=t.rowLabelAt(r);if(a){t.selectRow(a);return}}if(!t.cached()){if(Wi(o.target)&&Vt(t))return;if(Vt(t)){let a=t.focusedSectionId(),l=t.manageSeatHits(),c=t.nearestSeatToScreen(r,ue),d=c?t.seatSection(c):null;if(c&&(!a||l||d&&t.sectionMatchesFocus(d))){t.handleSeatTap(c);return}let u=c?null:t.nearestSeatToScreen(r,ue,!0),h=u?t.seatSection(u):null;if(u&&(!a||l||h&&t.sectionMatchesFocus(h))){t.handleSeatTap(u);return}if(a&&t.onBackdropTap&&!t.floorOverview()){let m=t.sectionAt(r);if(m&&t.sectionInteractive?.(m)===!1)return;if(m&&m!==a){let b=t.sectionTapAnchor(m,t.screenToWorld(r));t.onSectionTap?t.onSectionTap(m,b):t.focusSection(m,{anchor:b})}else m||t.onBackdropTap();return}if(a||l)return;let p=t.sectionCount()?qf(t,r):null;if(!p||t.effScale()>=ie||t.sectionFrameScale(p)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let a=t.floorOverview()?t.sectionAt(r):null,l=(a?t.objectFloor(a):null)??t.deckFloorAt();if(l){t.onDeckTap(l);return}}if(t.sectionCount()){let a=t.screenToWorld(r),l=t.ownedBadgeAt(a);if(l&&t.focusOwnedSeats(l)||!l&&rc(t,r))return;let c=l??t.sectionAt(r);if(c){let d=t.sectionTapAnchor(c,a);t.onSectionTap?t.onSectionTap(c,d):t.focusSection(c,{anchor:d});return}if(!t.pressLandsOnChart(r))return}if(!t.seatsPickable()){let a=t.tableAt?.(r);if(a?.length&&t.focusSeats(a,{animate:!t.reducedMotion()}))return}if(t.clusterLabels.focusCluster(r)||t.clusterLabels.glideTowardTap(r))return;let s=Math.max(Se*1.2,t.stage.scaleX()*2.5);t.zoomAbout(s,r)})}function ac(t,e){if((t.stacked()||t.floorOverview())&&t.onDeckTap){let n=t.objectFloor(t.seat(e)?.rowId??"");if(n){t.onDeckTap(n);return}}if(t.effScale()<ie&&t.sectionCount()&&!t.manageSeatHits()){let n=t.seatSection(e);if(n){let o=t.focusedSectionId()===n.logicalId,r=t.sectionFrameScale(n.logicalId)>t.stage.scaleX()*1.02;if(!o&&r){let s=t.seat(e),a=s?{x:s.x,y:s.y}:void 0;t.onSectionTap?t.onSectionTap(n.logicalId,a):t.focusSection(n.logicalId,{anchor:a});return}}}if(!(t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e))){let n=t.seat(e)??null,o=t.hiddenByAccessFilter(e);n&&(o||t.hasSeatMark(e))&&(t.onHover?.(n,{mark:t.seatMark(e)??null,interaction:"press",unavailable:!0,...o?{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 Jf(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function lc(t,e){return!e.manageMode||!e.marqueeSelect?!1:t.pointerType!=="touch"&&t.button===0}var cc=450;function dc(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<ae}import{Path as bg}from"konva/lib/shapes/Path";import{Group as em}from"konva/lib/Group";import{Line as tm}from"konva/lib/shapes/Line";import{Text as im}from"konva/lib/shapes/Text";function hc(t,e,i,n){if(!e||!n)return;let o=lr(e,i);if(!o.length)return;let r=new em({name:"level-context",listening:!1});for(let s of o)if(s.type==="shape"&&s.points)r.add(new tm({points:s.points.flatMap(a=>[a.x,a.y]),closed:!0,stroke:s.stroke?.color??"#8a93a6",strokeWidth:1.5,strokeScaleEnabled:!1,opacity:s.opacity??.35,listening:!1,perfectDrawEnabled:!1}));else if(s.type==="text"){let a=new im({x:s.position.x,y:s.position.y,text:s.text,fontSize:s.fontSize,fontFamily:"Inter, system-ui, sans-serif",fontStyle:"600",fill:s.color??"#8a93a6",opacity:s.opacity??.6,listening:!1});a.offset({x:a.width()/2,y:a.height()/2}),r.add(a)}t.add(r),r.moveToBottom()}var nm=10;function om(t){let e=t.framingViewport();if(t.stage.width()>=U||t.exportMode())return e;let i=nm;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 uc(t){Wt(t.stage);let e=om(t),i=t.revealWorldRect?.()??null,n=e.width,o=e.height,r=t.bounds();if(t.setFitScale(Math.min(n/r.width,o/r.height)||1),t.portraitFitCrop()&&!t.exportMode()){let l=n/r.width<=o/r.height,c=r.height*t.fitScale();l&&c<.55*o&&t.setFitScale(Math.min(t.fitScale()*1.3,.62*o/r.height))}let s=sm(t);s&&t.setFitScale(rm);let a=t.fitScale();if(t.stage.scale({x:a,y:a}),t.stage.position({x:e.x+(n-r.width*a)/2-r.x*a,y:e.y+(o-r.height*a)/2-r.y*a}),t.settleView(),!t.exportMode()){let l=xa(t.stage,[t.bgLayer,t.seatLayer],e,s?t.stage.scaleX()*1.000001:t.effScale()<ae?ae*.999999*(t.stage.scaleX()/Math.max(t.effScale(),1e-9)):void 0,i);l>0&&l!==1&&t.setFitScale(t.fitScale()*l),l>0&&(t.afterViewChange(),Zn(t.stage,[t.bgLayer,t.seatLayer],e,i)),am(t,e),t.setFitPose(qe(t.stage))}t.stage.batchDraw()}var rm=Q*(1-1e-6);function sm(t){if(!t.openAtSectionsWhenDense?.()||!t.hasSections?.()||t.exportMode())return!1;let e=t.fitScale();return e>=Q&&e<Se}function am(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let n=t.revealWorldRect?.()??null,o=Ot(t.stage,[t.bgLayer,t.seatLayer],n);if(!o)return;let r=t.fitClearanceWidth?.()??0;if(r>0&&o.x+o.width<=e.x+e.width-r)return;let s=e.height-i;if(o.height<=s){Zn(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:s},n);return}let a=e.y+Ii-o.y;a<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+a})}function zt(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 pc(t,e,i,n="now"){let o=t.stage.position();fl(t.stage,e,i,zt(t))&&(t.stage.position(t.constrainPan(t.stage.position(),o)),n==="frame"?(t.gestureFrame?.(),t.updateSeatGroupVisibility(),mc(t)):t.afterViewChange(),t.stage.batchDraw())}function fc(t,e,i){let n=t.stage.position();t.stage.position(t.constrainPan({x:n.x-e,y:n.y-i},n)),t.gestureFrame?.(),t.updateSeatGroupVisibility(),mc(t),t.stage.batchDraw()}function mc(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function gc(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function lm(t,e,i,n,o=0){ml(t.stage,e,zt(t),i,Kt(t.framingViewport(),o),n),t.settleView(),t.stage.batchDraw()}function bc(t,e,i){let n=typeof e=="string"?t.sectionBounds(e):e;if(!n)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){lm(t,n,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let o=Kt(t.framingViewport(),i?.focusPaddingPx??0),r=o.width,s=o.height,{min:a,max:l}=zt(t),c=1.12,d=Math.min(r/(n.width*c),s/(n.height*c)),u=i?.minScale??a,h=q(Math.max(d,u),a,Math.max(u,Gt({min:a,max:l},i?.maxScale))),p=o.x+r/2-(n.x+n.width/2)*h,m=o.y+s/2-(n.y+n.height/2)*h,b=t.stage.scaleX(),f=t.stage.x(),g=t.stage.y();if(Math.abs(h-b)<1e-4&&Math.abs(p-f)<.5&&Math.abs(m-g)<.5){t.settleView();return}let y=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let k=w=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let v=Math.min(1,(w-y)/S),x=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,T=b+(h-b)*x;t.stage.setAttrs({scaleX:T,scaleY:T,x:f+(p-f)*x,y:g+(m-g)*x}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),v<1?t.setGlideRaf(requestAnimationFrame(k)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(k))}function Kt(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 cm}from"konva/lib/shapes/Text";function yc(t){let e=new WeakMap;return()=>{let i=t(),n=i.labelFont(),o=Ze(),r=e.get(i.seats);if(r&&r.radius===i.seatR&&r.font===n&&r.generation===o)return r.value;let s=dm(i);return e.set(i.seats,{radius:i.seatR,font:n,generation:o,value:s}),s}}function dm(t){let e=1/0,i=new cm({fontSize:me,fontStyle:"600",fontFamily:t.labelFont(),listening:!1}),n=t.seatR*2-3,o=new Map;for(let s of t.seats){if(s.kind==="booth"){let u=t.blockExtent?.(s);e=Math.min(e,u?ge({...u,text:s.displayLabel??s.label}):Ge);continue}let a=me*t.seatLabelScale(s),l=ri(s.displayLabel??s.label),c=o.get(a);c||o.set(a,c=new Map);let d=c.get(l);if(d===void 0&&(i.fontSize(a),i.text(l),d=i.width()>n?Math.max(st,a*n/i.width()):a,c.set(l,d)),e=Math.min(e,d),e<=st)break}i.destroy();let r=Number.isFinite(e)?e:Ge;return G/Math.max(st,r)}function vc(t,e,i,n,o,r=.35){return!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(e)||!(i.width>0)||!(i.height>0)?t:{x:Sc(t.x,e,i.x,i.width,n.x,n.width,r,o?.x),y:Sc(t.y,e,i.y,i.height,n.y,n.height,r,o?.y)}}function Sc(t,e,i,n,o,r,s,a){if(!Number.isFinite(i)||!Number.isFinite(n)||!Number.isFinite(o)||!Number.isFinite(r))return t;let l=n*e,c=Math.min(l,r*(1-s)),d=o+c-(i+n)*e,u=o+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 mo={top:0,right:0,bottom:0,left:0};function wc(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)}:{...mo}}var hm=.7;function kc(t,e,i){let{top:n,right:o,bottom:r,left:s}=i,a=(h,p,m)=>{let b=h+p,f=m*hm;if(b<=f||b<=0)return[h,p];let g=f/b;return[h*g,p*g]},[l,c]=a(s,o,t),[d,u]=a(n,r,e);return{x:l,y:d,width:Math.max(1,t-l-c),height:Math.max(1,e-d-u)}}function xc(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function Lc(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 zi(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function Cc(t,e){let i=e({x:t.x,y:t.y}),n=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(i.x,n.x),y:Math.min(i.y,n.y),width:Math.abs(n.x-i.x),height:Math.abs(n.y-i.y)}}function go(t,e,i,n,o,r,s){if(!e)return{box:{x:i,y:n,width:0,height:0},fitWidth:0,fitHeight:0,x:i,y:n,baseFontSize:o,insideInk:r,fill:s};let a=((t??0)%180+180)%180,l=a*Math.PI/180,c=Math.abs(Math.cos(l)),d=Math.abs(Math.sin(l)),u=e.x+e.width/2,h=e.y+e.height/2,p=e.width*c+e.height*d,m=e.width*d+e.height*c,b={x:u-p/2,y:h-m/2,width:p,height:m},f=a===0?[e.width,e.height]:a===90?[e.height,e.width]:[Math.min(e.width,e.height),Math.min(e.width,e.height)];return{box:b,fitWidth:f[0],fitHeight:f[1],x:i,y:n,baseFontSize:o,insideInk:r,fill:s}}var Tc=G,um=3,pm=.5;function fm(t){return X(t,O(t)?"#475569":"#cbd5e1")}function Ic(t,e,i){return{x:t-i.width/2,y:e-i.height/2,width:i.width,height:i.height}}function mm(t,e,i){let{spec:n}=t,o=Math.max(e,1e-6);if(n.baseFontSize*o>=Tc){let u=t.measure(n.baseFontSize);return i.occupied.insert(Ic(n.x,n.y,u)),{visible:!0,where:"inside",fontSize:n.baseFontSize,x:n.x,y:n.y}}let r=Tc/o,s=t.measure(r);if(Math.max(n.box.width,n.box.height)<s.width*pm)return{visible:!1,reason:"shape-too-small"};let a=um/o,l=s.width+a*2<=n.fitWidth&&s.height+a*2<=n.fitHeight,c=n.box.x+n.box.width/2,d=l?[{where:"inside",x:n.x,y:n.y}]:[{where:"below",x:c,y:n.box.y+n.box.height+a+s.height/2},{where:"above",x:c,y:n.box.y-a-s.height/2}];for(let u of d){let h=Ic(u.x,u.y,s);if(!(i.coversSeat(h)||i.occupied.collisionCount(h)>0))return i.occupied.insert(h),{visible:!0,where:u.where,fontSize:r,x:u.x,y:u.y}}return{visible:!1,reason:"no-clear-place"}}function Pc(t){let e=[],i=new fe,n=a=>{if(!a.isVisible())return;let l=a.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});i.insert(l)};for(let a of t.freeTextById.values())a.area?e.push({record:a,spec:a.area}):n(a.node);if(!e.length)return;for(let a of t.focalLabels)n(a);let o=t.seatIndex,r={coversSeat:a=>!!o&&rt(o,a,{mode:"overlap"}).length>0,occupied:i},s=fm(t.canvasBackground);e.sort((a,l)=>l.spec.box.width*l.spec.box.height-a.spec.box.width*a.spec.box.height);for(let{record:a,spec:l}of e){let{node:c}=a,d=mm({spec:l,measure:u=>(c.fontSize(u),{width:c.width(),height:c.height()})},t.scale,r);gm(c,l,d,s),d.visible&&(a.background=d.where==="inside"?l.fill:t.canvasBackground)}}function gm(t,e,i,n){if(!i.visible){t.fontSize(e.baseFontSize),t.visible(!1);return}t.fontSize(i.fontSize),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.position({x:i.x,y:i.y}),t.fill(i.where==="inside"?e.insideInk:n),t.visible(!0)}function Rc(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 bo(t,e,i,n){let o=bm(t,i,n);if(!o)return null;let r=e.filter(s=>s.rowId===o.id).map(s=>s.id);return r.length?r:null}function bm(t,e,i){let n=Math.max(i,1e-9),o=null;for(let r of t){let s=Math.max(r.radius,li/2/n),a=Math.hypot(e.x-r.centre.x,e.y-r.centre.y);a>s||(!o||a<o.distance)&&(o={table:r,distance:a})}return o?.table??null}function Ec(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?is:ts}function Ac(t){return Math.max(t*1.05,$r,Q*1.3)}var ym=42;function Fc(t){return ym/(2*Math.max(t,1e-4))}function je(t,e){let i=1/0,n=-1/0,o=1/0,r=-1/0;for(let s of t)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 i-=e,n+=e,o-=e,r+=e,{x:i,y:o,width:Math.max(40,n-i),height:Math.max(40,r-o)}}function _c(t){let{stageWidth:e,stageHeight:i,fullBounds:n,visibleBounds:o,seatPoints:r,minScale:s}=t;if(!r.length)return null;let a=1.12;if(Math.min(e/(n.width*a),i/(n.height*a))>=s)return null;let c=t.tapAnchor??{x:o.x+o.width/2,y:o.y+o.height/2},d=r[0],u=1/0;for(let b of r){let f=(b.x-c.x)**2+(b.y-c.y)**2;f<u&&(d=b,u=f)}let h=e/(s*a),p=i/(s*a),m=je(r,0);return{bounds:{x:Mc(d.x,h,m.x,m.width),y:Mc(d.y,p,m.y,m.height),width:h,height:p},minScale:s}}function Mc(t,e,i,n){return n<=e?i+n/2-e/2:Math.min(Math.max(t-e/2,i),i+n-e)}import{Shape as vm}from"konva/lib/Shape";var Bc=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},Sm=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function Oc(t,e){let i=new Map;for(let o of t){if(o.kind==="booth")continue;let r=e.get(o.rowId),s=Bc(o);if(!(r&&r>0)||s==null)continue;let a=Sm(o),l=i.get(a)??[];l.push({seat:o,index:s}),i.set(a,l)}let n=[];for(let o of i.values()){o.sort((a,l)=>a.index-l.index||a.seat.id.localeCompare(l.seat.id));let r=[],s=()=>{r.length&&(n.push({seats:r,points:r.map(({x:a,y:l})=>({x:a,y:l}))}),r=[])};for(let a of o){let l=r[r.length-1];if(l){let c=Bc(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 n}var Xt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15;this.paints=new Map}get active(){return this.entries.length>0}paint(e,i){let n=`${e}|${i}`,o=this.paints.get(n);return o===void 0&&(this.paints.size>512&&this.paints.clear(),o=D(e,i),this.paints.set(n,o)),o}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,n,o,r,s,a,l,c=()=>1,d=()=>!1,u=()=>1/0){if(!l||!e||!n){this.clear(),this.focusKey=null;return}if(this.doc!==e){this.clear(),this.doc=e,this.spacing.clear(),this.focusKey=null;for(let m of[...e.objects,...(e.floors??[]).flatMap(b=>b.objects)])m.type==="row"&&this.spacing.set(m.id,m.seatSpacing)}if(this.focusKey!==n&&(this.focusKey=n,this.detailScale=Math.min(Math.max(1.15,c()*1.15),u()*.9)),o>=this.detailScale){this.clear();return}let h=i.filter(m=>m.id===n||m.logicalId===n||d(m)),p=h.map(m=>m.id).join("|");if(!(this.key===p&&this.active)){this.clear(),this.key=p;for(let m of h){if(m.memberIds.length>2e3||m.memberIds.some(g=>!a.has(g)||!this.spacing.has(s.get(g)?.rowId??"")))continue;let b=Oc(m.memberIds.map(g=>s.get(g)).filter(Boolean),this.spacing);if(!b.length||b.reduce((g,y)=>g+y.seats.length,0)!==m.memberIds.length)continue;let f=new vm({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:g=>{let y=g._context,S=f.getStage(),k=S&&S.width()<=U?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;y.save(),y.lineWidth=k*2,y.lineCap="round",y.lineJoin="round";let w=v=>{let x=a.get(v.id);return this.paint(String(x.fill()),x.opacity())};for(let v of b){let x=v.points;if(x.length===1){y.fillStyle=w(v.seats[0]),y.beginPath(),y.arc(x[0].x,x[0].y,k,0,Math.PI*2),y.fill();continue}let T=v.seats.map(w),P=(R,M)=>{let A=Math.hypot(M.x-R.x,M.y-R.y);return{x:-(M.y-R.y)/A,y:(M.x-R.x)/A}},L=x.map((R,M)=>{let A=x[Math.max(0,M-1)],E=x[Math.min(x.length-1,M+1)];return Math.hypot(E.x-A.x,E.y-A.y)>.001?P(A,E):P(x[M],x[M+1]??x[M-1])}),C=(R,M,A)=>({x:R.x+M.x*k*A,y:R.y+M.y*k*A}),I=0;for(;I<x.length;){let R=I;for(;R+1<x.length&&T[R+1]===T[I];)R++;let M=I===0?x[0]:{x:(x[I-1].x+x[I].x)/2,y:(x[I-1].y+x[I].y)/2},A=R===x.length-1?x[R]:{x:(x[R].x+x[R+1].x)/2,y:(x[R].y+x[R+1].y)/2},E=I===0?L[0]:P(x[I-1],x[I]),W=R===x.length-1?L[R]:P(x[R],x[R+1]),N=[M,...x.slice(I,R+1),A],Y=[E,...L.slice(I,R+1),W],re=N.map((_,V)=>C(_,Y[V],1)),H=N.map((_,V)=>C(_,Y[V],-1));y.fillStyle=T[I],y.beginPath(),y.moveTo(re[0].x,re[0].y);for(let _ of re.slice(1))y.lineTo(_.x,_.y);if(R===x.length-1){let _=Math.atan2(W.y,W.x);y.arc(A.x,A.y,k,_,_-Math.PI,!0)}else y.lineTo(H[H.length-1].x,H[H.length-1].y);for(let _ of H.slice(0,-1).reverse())y.lineTo(_.x,_.y);if(I===0){let _=Math.atan2(-E.y,-E.x);y.arc(M.x,M.y,k,_,_-Math.PI,!0)}y.closePath(),y.fill(),I=R+1}}y.restore()}});this.entries.push({section:m,shape:f,opacity:m.liftGroupSeat.opacity(),listening:m.liftGroupSeat.listening()}),m.liftGroupBg.add(f),m.liftGroupSeat.opacity(0),m.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};import{Text as wm}from"konva/lib/shapes/Text";var Dc=new WeakMap,km=(t,e)=>{let i=new wm({text:t,fontSize:Et,fontStyle:"700",fontFamily:e}),n={width:i.width(),height:i.height()};return i.destroy(),n};function Nc(t,e,i,n=km){let o=Dc.get(t);o||Dc.set(t,o=new Map);let r=`${e}\0${Ze()}`,s=o.get(r);s||o.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=n(d.text,e);l=Math.max(l,u.width,u.height)}let c=l>0?Math.ceil(l+G+ee*2+6):0;return s.set(i,c),c}function Hc(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 yo=1e6;function xm(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function So(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Ki=class{constructor(e,i=xm()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.holdTimer=null;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,e.altKey))};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,e.type==="pointercancel")};this.onReleaseElsewhere=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId)||e.composedPath().includes(this.host.container))return;let i=e.type==="pointercancel";!i&&this.host.marqueeActive()&&this.host.updateMarquee(this.toLocal(e.clientX,e.clientY)),this.endPointer(e.pointerId,i)};this.onWindowBlur=()=>{this.abandonGesture()};this.onEscape=e=>{e.key!=="Escape"||this.pointers.size===0||!this.host.marqueeActive()||(e.preventDefault(),e.stopPropagation(),this.abandonGesture())};this.onTouchStart=e=>{if(!So(e)){e.preventDefault(),this.rect=null;for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.beginPointer(yo+n.identifier,this.toLocal(n.clientX,n.clientY),"touch",0)}}};this.onTouchMove=e=>{if(So(e))return;e.preventDefault();let i=null;for(let n=0;n<e.changedTouches.length;n+=1){let o=e.changedTouches.item(n);if(!o)continue;let r=this.toLocal(o.clientX,o.clientY);this.updatePointer(yo+o.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!So(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let n=e.changedTouches.item(i);n&&this.endPointer(yo+n.identifier,e.type==="touchcancel")}}};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),window.addEventListener("pointerup",this.onReleaseElsewhere,{capture:!0}),window.addEventListener("pointercancel",this.onReleaseElsewhere,{capture:!0}),window.addEventListener("blur",this.onWindowBlur),window.addEventListener("keydown",this.onEscape,{capture:!0})),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(){this.clearHold();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),window.removeEventListener("pointerup",this.onReleaseElsewhere,{capture:!0}),window.removeEventListener("pointercancel",this.onReleaseElsewhere,{capture:!0}),window.removeEventListener("blur",this.onWindowBlur),window.removeEventListener("keydown",this.onEscape,{capture:!0})),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<qr}invalidateRect(){this.rect=null}toLocal(e,i){let n=this.rect;if(!n){let o=this.host.container.getBoundingClientRect();n={left:o.left,top:o.top},this.rect=n}return{x:e-n.left,y:i-n.top}}beginPointer(e,i,n,o,r=!1,s=!1){if(this.host.cancelGlide(),this.host.dismissFocusRing?.(),this.pointers.set(e,i),this.pointers.size===1)this.movedPx=0,this.singleTouch=n==="touch",this.singleTouch&&this.host.touchProbeStart?.(i),this.pinch=null,this.panStart=i,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:n,button:o,local:i,shiftKey:r,altKey:s})?(this.host.beginMarquee(i,s),this.panLast=null):(this.panLast=i,n==="touch"&&this.host.marqueeShouldStart({pointerType:"touch-hold",button:o,local:i,shiftKey:r,altKey:s})&&(this.holdTimer=setTimeout(()=>{this.holdTimer=null,!(this.pointers.size!==1||this.panStarted||this.movedPx>we)&&(this.endTouchProbe(),this.panLast=null,this.host.beginMarquee(i,!1))},cc)));else if(this.pointers.size===2){this.clearHold(),this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[a,l]=[...this.pointers.values()],c={x:(a.x+l.x)/2,y:(a.y+l.y)/2},d=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(l.x-a.x,l.y-a.y),startScale:d,worldMid:{x:(c.x-this.host.stage.x())/d,y:(c.y-this.host.stage.y())/d}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=we+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.movedPx>we&&this.clearHold()):this.pointers.size>=2&&(this.movedPx=we+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>we?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,n]=[...this.pointers.values()],o=Math.hypot(n.x-i.x,n.y-i.y);if(this.pinch.startDist<1)return;let r={x:(i.x+n.x)/2,y:(i.y+n.y)/2},{min:s,max:a}=this.host.zoomBounds(),l=q(this.pinch.startScale*(o/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<=we)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()}}abandonGesture(){if(this.pointers.size===0)return;let e=this.host.marqueeActive();e&&this.host.cancelMarquee(),this.pointers.clear(),this.pinch=null,this.resetPan(),this.endTouchProbe(),e||this.host.afterViewChange()}clearHold(){this.holdTimer&&clearTimeout(this.holdTimer),this.holdTimer=null}endPointer(e,i=!1){if(this.pointers.has(e)){if(this.clearHold(),this.host.marqueeActive()){this.endTouchProbe(),i?this.host.cancelMarquee():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 Lm}from"konva/lib/shapes/Circle";import{Group as Cm}from"konva/lib/Group";import{Line as Tm}from"konva/lib/shapes/Line";import{Text as Im}from"konva/lib/shapes/Text";var Pm=11,Rm=.3,Mm=.08;function zc(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function Em(t,e){return!e||t.available==null?`cap ${t.capacity}`:t.available<=0?F("map.soldOut"):t.wheelchairFree!=null?t.wheelchairFree<=0?F("map.noWheelchairSpace"):F("map.seatsLeft",{count:t.wheelchairFree}):F("map.seatsLeft",{count:t.available})}function Kc(t,e){return e&&t.available!=null&&t.available<=0}function Am(t,e){return Kc(t,e)||e&&t.wheelchairFree!=null&&t.wheelchairFree<=0}function Xc(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),n=t.overviewHidden(e),o=Am(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(n?0:t.dimmed(e.categoryKey)?Ve*Mm:o?Ve*Rm:Ve),e.polygon.listening(!t.exportMode&&!n&&!i&&!Kc(e,t.pickerMode)),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),Fm(t,e,o,r,n,t.dimmed(e.categoryKey))}}function Fm(t,e,i,n,o,r){if(e.capacityNode){let s=Em(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}_m(t,e,o||r),n>0&&!o?Hm(t,e,n,Math.max(t.effScale(),1e-4)):e.chip&&e.chip.visible(!1)}var vo=9,Gc=.86;function _m(t,e,i){Bm(t,e,i),wo(e)}function wo(t){let e=t.wheelchairGlyph,i=t.capacityNode;if(!e)return;if(!i||!i.visible()||!i.text()){e.visible(!1);return}let n=i.fontSize(),o=n/ye;e.scale({x:o,y:o}),e.offset({x:ye/2,y:ye/2}),e.position({x:i.x()-i.width()/2-n*.7,y:i.y()-i.offsetY()+i.height()/2}),e.visible(!0)}function Bm(t,e,i){let{labelNode:n,capacityNode:o}=e;if(!n&&!o)return;let r=Math.max(t.effScale(),1e-4);if(i){n?.visible(!1),o?.visible(!1);return}if(!t.pickerMode){n?.visible(t.labelLegible(n.fontSize())),o?.visible(t.labelLegible(o.fontSize()));return}let s=Om(e,r),a=Wc(n,e.nameSize??ni,s.width*Gc,r),l=Wc(o,oi,s.width*Gc,r),c=a!=null,d=l!=null&&(n?c&&a+l+vo<=s.height:l<=s.height);Vc(n,c?a:null,e.labelPoint.y-vo/r,r),Vc(o,d?l:null,n?e.labelPoint.y+vo/r:e.labelPoint.y,r)}function Om(t,e){let i=1/0,n=-1/0,o=1/0,r=-1/0;for(let s of t.points)s.x<i&&(i=s.x),s.x>n&&(n=s.x),s.y<o&&(o=s.y),s.y>r&&(r=s.y);return Number.isFinite(i)?{width:(n-i)*e,height:(r-o)*e}:{width:0,height:0}}function Wc(t,e,i,n){if(!t||!t.text())return null;t.fontSize(e/n);let o=t.width()*n;if(o<=i||o<=0)return e;let r=e*(i/o);return r>=G?r:null}function Vc(t,e,i,n){if(t){if(e==null){t.visible(!1);return}t.fontSize(e/n),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i),t.visible(!0)}}var Dm=.72;function Nm(t,e,i){let n=-1/0,o=1/0;for(let s of t)s.x>n&&(n=s.x),s.y<o&&(o=s.y);if(!Number.isFinite(n)||!Number.isFinite(o))return e;let r=i*Dm;return{x:n+r,y:o-r}}function Hm(t,e,i,n){let o=Pm;if(!e.chip){let a=new Cm({listening:!1});a.add(new Lm({name:"ga-chip-disc",radius:o,strokeWidth:1,listening:!1,perfectDrawEnabled:!1})),a.add(new Tm({name:"ga-chip-tick",x:-o*.62,points:[-o*.22,0,-o*.02,o*.2,o*.34,-o*.26],strokeWidth:Math.max(.6,o*.16),lineCap:"round",lineJoin:"round",listening:!1}));let l=new Im({x:o*.12,y:-o*.5,text:String(i),fontSize:o,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(D(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(Nm(e.points,e.labelPoint,o/n)),e.chip.scale({x:1/n,y:1/n}),e.chip.visible(!0),e.chip.moveToTop()}function Yc(t,e){let i=!1;for(let[n,o]of Object.entries(e)){let r=t.get(n);r&&(o.available!==void 0&&r.available!==o.available&&(r.available=o.available,i=!0),o.wheelchairFree!==void 0&&(r.wheelchairFree??null)!==o.wheelchairFree&&(r.wheelchairFree=o.wheelchairFree,i=!0),o.selected!==void 0&&r.selected!==o.selected&&(r.selected=o.selected,i=!0))}return i}function Uc(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 Gm(t){let{sections:e,viewCentre:i,focusedSectionId:n}=t;if(n){let s=e.findIndex(a=>a.id===n||a.logicalId===n);if(s>=0)return s}let o=-1,r=1/0;return e.forEach((s,a)=>{if(s.outline.length<3)return;let l=z(s.outline),c=i.x>=l.x&&i.x<=l.x+l.width&&i.y>=l.y&&i.y<=l.y+l.height,d=l.x+l.width/2-i.x,u=l.y+l.height/2-i.y,h=(c?0:1e12)+d*d+u*u;h<r&&(o=a,r=h)}),o}function Wm(t){let{rung:e,viewCentre:i,target:n,width:o,height:r}=t,s=i.x,a=i.y;if(e==="sections"&&t.sections.length>0){let c=t.sections.map(p=>{let m=z(p.outline);return{x:m.x+m.width/2,y:m.y+m.height/2}}),d=o/(n*2),u=r/(n*2);if(!c.some(p=>Math.abs(p.x-i.x)<=d&&Math.abs(p.y-i.y)<=u)){let p=c.reduce((m,b)=>{let f=(b.x-i.x)**2+(b.y-i.y)**2;return f<m.distance?{point:b,distance:f}:m},{point:c[0],distance:1/0});s=p.point.x,a=p.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,p=u.y-i.y,m=h*h+p*p;m<d&&(c=u,d=m)}s=c.x,a=c.y}return{x:s,y:a}}function $c(t){if(t.rung==="sections")return{bounds:t.bounds};let e=Gm(t);if(e>=0)return{bounds:z(t.sections[e].outline),minScale:t.seatFloor};let i=t.seatScale,{x:n,y:o}=Wm({...t,rung:"seats",target:i}),r=t.width/(i*1.12),s=t.height/(i*1.12);return{bounds:{x:n-r/2,y:o-s/2,width:r,height:s}}}var qc=["pointerdown","pointermove","mousedown","mousemove","touchstart","click"],Xi=class{constructor(e=()=>{}){this.onEnd=e;this.until=0;this.timer=null;this.holding=!1;this.stale=new Set;this.flushNow=()=>this.flush();this.container=null}get active(){return this.holding}listen(e){this.container=e;for(let i of qc)e.addEventListener(i,this.flushNow,{capture:!0,passive:!0})}wrap(e){let i=e.drawHit;e.drawHit=((n,o)=>this.active&&!n?(this.stale.add(e),e):i.call(e,n,o))}bump(){typeof setTimeout=="function"&&(this.holding=!0,this.until=performance.now()+120,this.timer||this.arm(120))}arm(e){this.timer=setTimeout(()=>{this.timer=null;let i=this.until-performance.now();if(i>1){this.arm(i);return}this.flush()},e)}flush(){let e=this.holding;if(this.holding=!1,this.timer&&(clearTimeout(this.timer),this.timer=null),this.stale.size){let i=[...this.stale];this.stale.clear();for(let n of i)n.getStage()&&n.drawHit()}e&&this.onEnd()}destroy(){if(this.timer&&clearTimeout(this.timer),this.timer=null,this.holding=!1,this.stale.clear(),this.container)for(let e of qc)this.container.removeEventListener(e,this.flushNow,{capture:!0});this.container=null}};var Yi=class{constructor(){this.since=new Map;this.shown=new Set;this.wanted=new Set}begin(){this.wanted=new Set}admit(e,i,n){this.wanted.add(e);let o=this.since.get(e);return o===void 0&&(o=i,this.since.set(e,i)),!n||this.shown.has(e)||i-o>=150?(this.shown.add(e),!0):!1}end(){for(let e of[...this.since.keys()])this.wanted.has(e)||(this.since.delete(e),this.shown.delete(e))}reset(){this.since.clear(),this.shown.clear(),this.wanted.clear()}};function Zc(t,e,i,n){if(t.length<3)return[];let o=1/0,r=-1/0,s=1/0,a=-1/0;for(let d of t)d.x<o&&(o=d.x),d.x>r&&(r=d.x),d.y<s&&(s=d.y),d.y>a&&(a=d.y);if((r-o)*i<4&&(a-s)*i<4)return[];let l=t,c=[];for(let d of e)d.x<o||d.x>r||d.y<s||d.y>a||jt(d,l)&&n.selectable(d.id)&&c.push(d.id);return c}function Vm(t){return t.logicalRowId??t.rowId}function Qc(t,e,i){let n=[];for(let o of e)o.kind!=="booth"&&(Vm(o)!==t||!i(o.id)||n.push(o.id));return n}function jc(t,e,i=4){for(let n of e){let{box:o}=n;if(t.x>=o.x-i&&t.x<=o.x+o.width+i&&t.y>=o.y-i&&t.y<=o.y+o.height+i)return n.rowKey}return null}import{Line as zm}from"konva/lib/shapes/Line";import{Rect as Km}from"konva/lib/shapes/Rect";var Ui=class{constructor(e){this.host=e;this.box=null;this.lasso=null;this.remove=!1}active(){return this.box!==null||this.lasso!==null}begin(e,i,n=!1){this.cancel(),this.remove=n;let o=this.host.screenToWorld(e),r=this.host.stageScale()||1,s={stroke:n?"#d64545":this.host.selectionColor(),strokeWidth:1.5/r,dash:[5/r,4/r],fill:n?"rgba(214,69,69,0.10)":"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(i==="lasso"){let a=new zm({...s,points:[o.x,o.y],closed:!0,lineJoin:"round"});this.host.overlayLayer().add(a),this.lasso={points:[o],line:a}}else{let a=new Km({...s,x:o.x,y:o.y,width:0,height:0});this.host.overlayLayer().add(a),this.box={start:o,cur:o,rect:a}}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:n,rect:o}=this.box;o.setAttrs({x:Math.min(n.x,i.x),y:Math.min(n.y,i.y),width:Math.abs(i.x-n.x),height:Math.abs(i.y-n.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.apply(Zc(l,this.host.seats(),e,{selectable:h=>this.host.isSelectable(h)}),h=>jt(h,l));return}let i=this.box;if(this.box=null,!i)return;i.rect.destroy(),this.host.overlayLayer().batchDraw();let n=Math.min(i.start.x,i.cur.x),o=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((o-n)*e<4&&(s-r)*e<4)return;let a=[];for(let l of this.host.seats())l.x<n||l.x>o||l.y<r||l.y>s||this.host.isSelectable(l.id)&&a.push(l.id);this.apply(a,l=>l.x>=n&&l.x<=o&&l.y>=r&&l.y<=s)}apply(e,i){this.host.applyBand(e,i,this.remove),this.host.selectionChanged()}};var $i=class{constructor(e){this.sync=e;this.depth=0;this.pending=!1}request(){if(this.depth>0){this.pending=!0;return}this.sync()}batch(e){this.depth+=1;try{return e()}finally{this.depth-=1,this.depth===0&&this.pending&&(this.pending=!1,this.sync())}}};import{Rect as Jc}from"konva/lib/shapes/Rect";import{Text as Xm}from"konva/lib/shapes/Text";function ed(t){let e=t.effScale(),i=t.stage.scaleX(),n={width:t.stage.width(),height:t.stage.height()},o=f=>Math.round(f*100)/100,r=new Map(t.overlayLayer.find(".selection-ring").map(f=>[String(f.getAttr("seatId")??""),String(f.getAttr("ringColor")??t.effSelection)])),s=t.seats.map(f=>{let g=t.circleById.get(f.id),y=t.boothLabelById.get(f.id)??t.seatLabelById.get(f.id),S=f.kind==="booth"?Ge:me*t.seatLabelScale(f),k=o((y?.fontSize()??S)*e),w=t.worldToScreen(f),v=y?y.width()*i:0,x=y?y.height()*e:0,T=w.x-v/2<0||w.x+v/2>n.width||w.y-x/2<0||w.y+x/2>n.height,P=t.focusedSeatOpacity(f.id,g?.getAbsoluteOpacity()??0),L=t.seatSection.get(f.id),C=!!y?.isVisible()&&P>=.5&&!T,I;C||(P<.5?I="dimmed-or-unavailable":k<G?I="below-minimum-size":T?I="outside-viewport":y?I="renderer-hidden":I=t.seatLabelDrops.get(f.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let R=g instanceof Jc?g.width()*i:t.seatR*2*e,M=g instanceof Jc?g.height()*e:t.seatR*2*e,A=2*(t.seatR*e+ue),E=g?.fill(),W=y?.fill(),N=t.accessGlyphById.get(f.id),Y=N?.getAbsoluteScale();return{seatId:f.id,label:f.label,kind:f.kind==="booth"?"booth":"seat",markerShape:f.kind==="booth"?"booth":f.wheelchairSpaceType==="no-seat"?"square":"circle",...f.wheelchairSpaceType?{wheelchairSpaceType:f.wheelchairSpaceType}:{},categoryKey:f.categoryKey,...L?{sectionId:L.id}:{},...L?.zone?{zoneId:L.zone}:{},status:t.statusById.get(f.id)??"free",selected:t.selection.has(f.id),visible:C,renderedFontPx:k,fill:typeof E=="string"?E:"",ink:typeof W=="string"?W:g?t.seatLabelInk(f,g):t.seatPreferredLabelInk(f),...r.has(f.id)?{selectionRingColor:r.get(f.id)}:{},opacity:o(P),...N?{accessibilityMarker:{glyphVisible:N.isVisible(),glyphWidthPx:o(ye*Math.abs(Y?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(f.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(f.id)&&!!g?.isVisible()&&!!g?.isListening()&&t.isSelectable(f.id),directWidthPx:o(R),directHeightPx:o(M),effectiveMinimumPx:o(Math.max(Math.min(R,M),A))},screenCenter:{x:o(w.x),y:o(w.y)},...C?{screenBox:{x:o(w.x-v/2),y:o(w.y-x/2),width:o(v),height:o(x)}}:{},...I?{hiddenReason:I}:{}}}),a=s.filter(f=>f.visible).length,l=(f,g,y,S,k,w,v)=>{let x=ht({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),T=z(x.map(M=>t.worldToScreen(M))),P=o(S.opacity()),L=S.fill(),C=T.x+T.width<0||T.x>n.width||T.y+T.height<0||T.y>n.height,I=S.isVisible()&&P>.05&&!C,R=w?ut({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),w.outline,w.holes):void 0;return{id:f,kind:g,role:y,label:S.text(),visible:I,renderedFontPx:o(S.fontSize()*i),...v==null?{}:{sizeFloorPx:v},opacity:P,fill:k,ink:typeof L=="string"?L:"",...R==null?{}:{fitsContainer:R},...I?{screenBox:{x:o(T.x),y:o(T.y),width:o(T.width),height:o(T.height)}}:{}}},c=f=>{let g=f.namePlate.fill();if(f.namePlate.opacity()>.05&&typeof g=="string"&&g)return g;let y=f.blockPoly.fill();return typeof y=="string"?y:f.baseFill},d=f=>{let g=f.blockPoly.fill();return typeof g=="string"?g:f.baseFill},u=[...t.sections.map(f=>l(f.id,"section","name",f.nameLabel,c(f),f,Ft(n.width))),...t.sections.map(f=>l(`${f.id}:availability`,"section","availability",f.subLabel,c(f),f)),...t.sections.map(f=>l(`${f.id}:number`,"section","number",f.numberLabel,d(f),f,gi(n.width))),...t.zones.flatMap(f=>[l(f.id,"zone","name",f.label,f.background),...f.sub?[l(`${f.id}:price`,"zone","price",f.sub,f.background)]:[]])],h=[...t.gaById].map(([f,g])=>{let y=g.points.map(C=>t.worldToScreen(C)),S=Math.min(...y.map(C=>C.x)),k=Math.min(...y.map(C=>C.y)),w=Math.max(...y.map(C=>C.x)),v=Math.max(...y.map(C=>C.y)),x=w<0||S>n.width||v<0||k>n.height,T=o(g.polygon.opacity()),P=T>=.1&&!x,L=g.polygon.fill();return{areaId:f,label:g.label,capacity:g.capacity,categoryKey:g.categoryKey,...g.sectionId?{sectionId:g.sectionId}:{},visible:P,interactive:g.polygon.listening(),opacity:T,fill:typeof L=="string"?L:"",effectiveBackground:g.effectiveBackground,...P?{screenBox:{x:o(S),y:o(k),width:o(w-S),height:o(v-k)}}:{}}}),p=[...t.freeTextById].map(([f,g])=>{let{node:y,kind:S}=g,k=g.plate&&g.plate.opacity()>.05?g.plate.fill():null,w=typeof k=="string"&&k?k:g.background,v=t.worldToScreen({x:y.x(),y:y.y()}),x=y.width()*i,T=y.height()*e,P=v.x-y.offsetX()*i,L=v.y-y.offsetY()*e,C=o(y.fontSize()*e),I=P+x<0||P>n.width||L+T<0||L>n.height,R=y.isVisible()&&!I,M=y.fill(),A=o(y.getAbsoluteOpacity()),E;return R||(C<G?E="below-minimum-size":I?E="outside-viewport":E="renderer-hidden"),{objectId:g.objectId??f,kind:S,text:y.text(),visible:R,renderedFontPx:C,ink:typeof M=="string"?M:"",background:w,opacity:A,...R?{screenBox:{x:o(P),y:o(L),width:o(x),height:o(T)}}:{},...E?{hiddenReason:E}:{}}}),m=t.labelGroup.find(f=>f.getAttr("rowLabel")===!0).filter(f=>f instanceof Xm).map(f=>{let g=f.getClientRect({skipShadow:!0,skipStroke:!0}),y=g.x+g.width<0||g.x>n.width||g.y+g.height<0||g.y>n.height,S=f.fill();return{text:f.text(),visible:f.isVisible()&&!y,renderedFontPx:o(f.fontSize()*e),ink:typeof S=="string"?S:"",...y?{}:{screenBox:{x:o(g.x),y:o(g.y),width:o(g.width),height:o(g.height)}}}}),b=t.sections.filter(f=>f.blockPoly.opacity()>.05);return{viewport:n,projection:"flat",canvasBackground:t.canvasBackground,effectiveScale:o(e),rung:t.getRung(),minimumVisibleLabelPx:G,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+h.reduce((f,g)=>f+g.capacity,0),selectionRingSeatIds:t.overlayLayer.find(".selection-ring").map(f=>String(f.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(f=>{let g=f.blockPoly.fill();return typeof g!="string"||!An(t.canvasBackground,g)}).length,tintedSectionShells:b.filter(f=>{let g=f.blockPoly.fill();return typeof g=="string"&&Ns(t.canvasBackground,g)}).length,visibleCategoryDetailOutlines:t.sections.filter(f=>f.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:t.sections.filter(f=>f.subLabel.opacity()>.05).length,visibleSectionGADetails:[...t.gaById.values()].filter(f=>f.sectionId!=null&&f.polygon.opacity()>.05).length},labels:s,gaAreas:h,hierarchyLabels:u,freeTextLabels:p,rowLabels:m}}import{Circle as tg}from"konva/lib/shapes/Circle";import{Ellipse as ig}from"konva/lib/shapes/Ellipse";import{Line as ng}from"konva/lib/shapes/Line";import{Arrow as og}from"konva/lib/shapes/Arrow";import{Path as rg}from"konva/lib/shapes/Path";import{Rect as Yt}from"konva/lib/shapes/Rect";import{Text as Lo}from"konva/lib/shapes/Text";import{Image as sd}from"konva/lib/shapes/Image";import{Group as td}from"konva/lib/Group";import{Circle as Ym}from"konva/lib/shapes/Circle";import{Path as Um}from"konva/lib/shapes/Path";function $m(t,e){let i=e?.trim();return i&&i.toLowerCase()!==Ar?i:Mt[t.group]}var id=new WeakMap;function qi(t){let{icon:e,size:i}=t,n=$m(e,t.color),o=O(n)&&n!==Mt[e.group]?wr:ui,r=O(t.background)?0:i*wn.ringRatio,s=t.listening??!1,a=new td({x:t.x,y:t.y,rotation:t.rotation??0,listening:s,name:"venue-icon-badge"});a.setAttr("venueIconKey",e.key),a.add(new Ym({x:i/2,y:i/2,radius:i/2-r/2,fill:n,...r>0?{stroke:kr,strokeWidth:r}:{strokeEnabled:!1},listening:s,perfectDrawEnabled:!1}));let l=i*wn.glyphScale,c=new Um({x:(i-l)/2,y:(i-l)/2,data:e.solid,scaleX:l/kn,scaleY:l/kn,fill:o,strokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});return a.add(c),id.set(a,{glyph:c,icon:e}),a}function ko(t,e,i){let n=t instanceof td?id.get(t):void 0;if(n?.icon.solidLarge){let o=Mr(n.icon,e*i);n.glyph.data()!==o&&n.glyph.data(o)}return e}function nd(t,e,i){let n=pi("wheelchair"),o=Or(t);if(!n||!o)return null;let r=Br(e),s=qi({icon:n,x:o.x-r/2,y:o.y-r/2,size:r,background:i,listening:!1});return s.name("step-free-route-mark"),s}import{Group as qm}from"konva/lib/Group";import{Path as Zm}from"konva/lib/shapes/Path";import{Rect as Qm}from"konva/lib/shapes/Rect";import{Text as jm}from"konva/lib/shapes/Text";function Jm(t){let e=(t%360+360)%360;return e>90&&e<270?e-180:e}function eg(t,e,i={}){let n=t.height??40,o=t.width??n*3,r=(t.x??0)+o/2,s=(t.y??0)+n/2,a=n*.46,l=ui,c=new jm({name:"gate-sign-name",text:t.label??"",fontSize:a,fontFamily:e,fontStyle:"600",fill:l,listening:!1,perfectDrawEnabled:!1}),d=t.gate.stepFree?Er("wheelchair")?.solid:void 0,u=d?a*1.15:0,h=d?a*.3:0,p=u+h+c.width(),m=Math.max(o,p+n),b=new qm({name:"gate-sign",x:r,y:s,rotation:Jm(t.rotation??0),listening:i.hitTarget===!0});b.add(new Qm({name:"gate-sign-pill",x:-m/2,y:-n/2,width:m,height:n,cornerRadius:n/2,fill:t.fill??Mt.navigation,stroke:l,strokeWidth:Math.max(1,n*.05),opacity:i.organizerOnly?.55:1,dash:i.organizerOnly?[n*.2,n*.12]:void 0,listening:i.hitTarget===!0,perfectDrawEnabled:!1}));let f=-p/2;return d&&(b.add(new Zm({name:"gate-sign-step-free",data:d,x:f,y:-u/2,scaleX:u/24,scaleY:u/24,fill:l,listening:!1,perfectDrawEnabled:!1})),f+=u+h),c.position({x:f,y:-c.height()/2}),b.add(c),b.setAttr("gateSignHeight",n),{group:b,fontSize:a,bounds:{x:r-m/2,y:s-n/2,width:m,height:n}}}function od(t,e){if(e.gate.hideFromBuyers)return;let i=eg(e,t.labelFont());i.group.setAttr("shapeObjectId",e.id),e.opacity!=null&&i.group.opacity(Math.min(1,Math.max(.1,e.opacity))),t.bgLayer.add(i.group),t.iconNodeById.set(e.id,{node:i.group,fontSize:i.fontSize}),t.landmarkBoxes.push(i.bounds)}function ad(t,e){if(!e.url||e.visible===!1)return;let i=new window.Image;t.trackAssetImage(i,e.url,"Buyer background image",()=>{let n=i.naturalWidth||4,o=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*(o*l.height/(n*l.width)),u=new sd({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*n,y:l.y*o,width:l.width*n,height:l.height*o},opacity:e.opacity,listening:!1}),h=e.layer==="above"?t.fgDecorGroup:t.bgLayer;h.add(u),u.moveToBottom(),h.getLayer()?.batchDraw()})}function ld(t,e){let i=new window.Image,n=new sd({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:q(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?t.fgDecorGroup.add(n):t.bgLayer.add(n),e.role&&t.landmarkBoxes.push(z(ht({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 o=n.getLayer();o&&o.batchDraw()})}function cd(t,e){let i=e.fill??t.theme.decorFill??eo,n=se(i,.12);if(e.shape==="round")t.bgLayer.add(new tg({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:i,stroke:n,strokeWidth:1.5,listening:!1}));else{let r=e.width??80,s=e.height??50;t.bgLayer.add(new Yt({x:e.center.x,y:e.center.y,width:r,height:s,offsetX:r/2,offsetY:s/2,rotation:e.rotation,fill:i,stroke:n,strokeWidth:1.5,cornerRadius:4,listening:!1}))}if(!It(e))return;let o=Ut(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,X(i,t.theme.textColor??"#cbd5e1"),We(e)??Sr,!0);t.freeTextById.set(e.id,{node:o,background:i,kind:"table"})}var sg=8,ag=6;function lg(t,e){let i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),n=Math.max(sg,e*.35),o=Math.max(ag,e*.28);return{offsetX:-(i.x-n),offsetY:-(i.y-o),width:i.width+n*2,height:i.height+o*2}}function dd(t,e){let i=e.background?.color??t.canvasBackground,n=e.color??X(i,t.theme.textColor??el),o=e.semanticKind==="icon"?pi(e.iconKey):void 0;if(o){let d=qi({icon:o,x:e.position.x,y:e.position.y,size:e.fontSize,rotation:e.rotation,color:e.color,background:t.canvasBackground});t.iconNodeById.set(e.id,{node:d,fontSize:e.fontSize}),t.bgLayer.add(d);return}let r=e.background?.padding??0,s=e.opacity??1,a=or(e),l=new Lo({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:to(e.bold,e.italic,"600"),fill:n,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 Yt({x:e.position.x,y:e.position.y,...lg(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 hd(t,e){if(Hr(e)){od(t,e);return}let i=e.fill??t.theme.decorFill??eo,n=e.role==="stage",o=e.role==="reference-focal",r=!!e.role&&!n,s=nr(e),a=le(t.canvasBackground),l=o?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(n?se(l,.28):o?a.focalStroke:c?"#9aa3b5":void 0),u=e.stroke?.width??(n?1:o||c?2:0),h=e.opacity!=null?q(e.opacity,.1,1):1,p=0,m=0,b=null;if(c&&e.points&&e.points.length>=2){p=e.points.reduce((w,v)=>w+v.x,0)/e.points.length,m=e.points.reduce((w,v)=>w+v.y,0)/e.points.length;let f=Dr(e),g=Nr(u),y=Fr(e),S=new og({points:e.points.flatMap(w=>[w.x,w.y]),closed:!1,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:d,fill:d,strokeWidth:u,opacity:h,lineCap:f.lineCap,lineJoin:f.lineJoin,pointerAtBeginning:f.startEnding==="arrow",pointerAtEnding:f.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path",...y?{dash:_r(u)}:{}});S.setAttr("shapeObjectId",e.id),t.bgLayer.add(S);let k=y?nd(e,u,t.canvasBackground):null;k&&t.bgLayer.add(k)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let f=n?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,Fe(l,.3),1,se(l,.12)]}:{fill:l};p=e.x+e.width/2,m=e.y+e.height/2,b={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Yt({x:p,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...f,stroke:d,strokeWidth:u,cornerRadius:q(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){p=e.x+e.width/2,m=e.y+e.height/2,b={x:e.x,y:e.y,width:e.width,height:e.height};let f=n?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,Fe(l,.3),1,se(l,.12)]}:{fill:l};t.bgLayer.add(new ig({x:p,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...f,stroke:d,strokeWidth:u,opacity:h,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let f=qo(e),g=z(f);p=e.points.reduce((k,w)=>k+w.x,0)/e.points.length,m=e.points.reduce((k,w)=>k+w.y,0)/e.points.length,b=g;let y=n?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,Fe(l,.3),1,se(l,.12)]}:{fill:l},S=De(f,Zo(e),{stroke:d,strokeWidth:u,opacity:h,listening:!1},$o(e)??void 0);S.setAttrs({x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,...y}),t.bgLayer.add(S)}b&&e.role&&t.landmarkBoxes.push(b);for(let f of Jo(e))t.bgLayer.add(new ng({points:f.points.flatMap(g=>[g.x,g.y]),closed:f.closed,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:f.ink??jo,fill:f.fill,strokeWidth:2,opacity:h*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(n){let{node:f,spec:g}=dg(t,p,m,e.label,l,b,e.labelStyle);t.primaryFocalLabels.set(f,g),t.freeTextById.set(e.id,{node:f,background:l,plate:g.plate,kind:"stage"})}else if(r){let f=o||s,g=X(l,f?"#e6e9f0":"#9aa3b5"),y=Ut(t,t.bgLayer,e.label,p,m,g,f?18:12,!1);f&&t.primaryFocalLabels.set(y,{targetPx:18,trackingRatio:0,ink:String(y.fill()??""),plateInk:String(y.fill()??""),plate:new Yt({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:y,background:l,kind:"decor",...f?{}:{area:go(e.rotation,b,p,m,12,g,l)}})}else{let f=X(l,"#cbd5e1"),g=Ut(t,t.bgLayer,e.label,p,m,f,16,!0);t.freeTextById.set(e.id,{node:g,background:l,kind:"decor",area:go(e.rotation,b,p,m,16,f,l)})}}var xo=22,rd=G,Zi=6,cg=.5;function dg(t,e,i,n,o,r,s){let a=s?.size??xo,l=s?.color??t.theme.textColor??"#e6e9f0",c=s?.color??X(o,l),d=r?r.x+r.width/2:e,u=r?r.y+r.height/2:i,h=hg(t.canvasBackground,o),p=new Yt({x:d,y:u,width:0,height:0,cornerRadius:4,fill:h,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(p);let m=new Lo({x:d,y:u,text:n,fontSize:a,fontStyle:to(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/xo),fontFamily:s?.fontFamily??t.labelFont(),fill:c,textDecoration:s?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return m.offsetX(m.width()/2),m.offsetY(m.height()/2),t.bgLayer.add(m),{node:m,spec:{targetPx:a,...r?{bounds:r}:{},trackingRatio:4/xo,...s?.direction?{direction:s.direction}:{},ink:c,plateInk:s?.color??X(h,l),plate:p}}}function hg(t,e){return j(e,O(t)?"#ffffff":"#000000",.34)}function ud(t,e,i,n,o=0){let r=Math.max(i,1e-4),s=o>0&&r>o?r/o:1,l=Math.min(e.targetPx,Math.max(rd,e.targetPx*cg)*s)/r,c=g=>{t.letterSpacing(g*e.trackingRatio),n(t,g)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let u=Ko(e.direction,d);t.rotation(u?90:0);let h={width:(u?d.height:d.width)-Zi*2,height:(u?d.width:d.height)-Zi*2},p=Math.min(1,h.width/Math.max(t.width(),1e-6),h.height/Math.max(t.height(),1e-6));if(p<1&&(l=Math.max(rd/r,l*p),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())+Zi*2,f=(u?t.width():t.height())+Zi;e.plate.size({width:b,height:f}),e.plate.offset({x:b/2,y:f/2}),e.plate.opacity(1),t.fill(e.plateInk)}function pd(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",n=t.canvasBackground,o=xr(i,n,Ve),r=t.theme.textColor??"#e6e9f0",s=X(o,r),a=De(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=Jt(e.points,e.holes),c=t.sections.find(b=>te(l,b.outline,b.holes)),d=We(e)??ni,u=It(e)?Ut(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-.5-d/2,s,d,!1):void 0,h=Ut(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,oi,!1);u&&t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:u,background:o,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:o,kind:"ga-capacity",categoryKey:e.categoryKey});let p=Lt(e)>0?new rg({data:nt(["wheelchair"])??"",fill:s,listening:!1,perfectDrawEnabled:!1}):void 0;p&&t.bgLayer.add(p);let m={label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:o,strokeColor:i,labelPoint:l,labelNode:u,...We(e)!==void 0?{nameSize:d}:{},capacityNode:h,...p?{wheelchairGlyph:p}:{},...c?{sectionId:c.logicalId}:{}};t.gaById.set(e.id,m),wo(m)}function Ut(t,e,i,n,o,r,s,a){let l=new Lo({x:n,y:o,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 fd(t,e){let i=[],n=e.canvasBackground,o=new Map,r=(d,u)=>{let h=o.get(d)??[];h.push(u),o.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 p=d.segmentedRow&&!u?d.segmentedRow.groupId:d.id,m=(o.get(p)??[]).slice().sort((A,E)=>s(A)-s(E));if(!m.length)continue;let b=m[0],f=m[m.length-1],g=h?.labelStyle,y=h?.style==="pill"?Nt(n):null,S=y?y.plate:n,k=de(S,g?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",ze),w=g?.size??yr,v=h?.rotation??0,x=e.objectFilteredOut(d)?.15:1,T=m.reduce((A,E)=>A??e.seatSection.get(E.id),void 0),L=d.segmentedRow?.displayLabel??d.displayLabel??Rt(d.label,T?.label);if(!L)continue;let C=T?[...new Set([T.id,T.logicalId,T.zone].filter(A=>!!A))]:void 0,I=(A,E,W)=>i.push({text:L,x:A,y:E,rotation:v,fontSize:w,ink:k,opacity:x,rowKey:p,...y?{pill:y}:{},...C?.length?{focusKeys:C}:{},...W?{automaticAway:W}:{}});if(h?.position){I(h.position.x,h.position.y);continue}let R=e.seatR+12,M=h?.positionPreset??"start";if(M==="start"||M==="both"){let A=d.rotation*Math.PI/180,E={x:-Math.cos(A),y:-Math.sin(A)};I(b.x+E.x*R,b.y+E.y*R,E)}if(M==="end"||M==="both"){let A=(d.rotation+d.curve)*Math.PI/180,E={x:Math.cos(A),y:Math.sin(A)};I(f.x+E.x*R,f.y+E.y*R,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(p=>Math.hypot(p.x-d.x,p.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 Co(t,e,i=ee){let n=t.rotation()*Math.PI/180,o=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=(t.width()*o+t.height()*r)/2+i,a=(t.width()*r+t.height()*o)/2+i;return{x:e.x-s,y:e.y-a,width:s*2,height:a*2}}function md(t,e,i,n){let o={x:e.x,y:e.y},r=e.automaticAway;if(!r)return o;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 p=a*h;l.push({x:s.x*p,y:s.y*p},{x:-s.x*p,y:-s.y*p},{x:r.x*p,y:r.y*p},{x:(r.x+s.x)*p,y:(r.y+s.y)*p},{x:(r.x-s.x)*p,y:(r.y-s.y)*p})}let c=o,d=1/0,u=1/0;for(let h of l){let p={x:o.x+h.x,y:o.y+h.y},m=Co(t,p),f=(n?rt(n,m,{mode:"overlap"}).length:0)+i.collisionCount(m),g=Math.hypot(h.x,h.y);if((f<d||f===d&&g<u)&&(c=p,d=f,u=g),f===0)break}return c}var Qi=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,n,o,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&&o(),d();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.generationCount&&o()}).catch(()=>{s===this.generationCount&&this.errors.push(`${n} could not be decoded.`)}).finally(d)},e.onerror=()=>{s===this.generationCount&&this.errors.push(`${n} 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 gd(t,e){let i=e,n=i._cache instanceof Map?i._cache:null,o=i._canvasCache??n?.get("canvas");if(!o){e.isCached?.()&&e.clearCache();return}let r=[o.scene,o.filter,o.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&t.Util.releaseCanvas(...r),i._canvasCache&&(i._canvasCache=void 0),n?.delete("canvas")}function bd(t){let e=t.drawScene;t.drawScene=((i,n,...o)=>!i&&t.opacity()===0?(t.getCanvas().getContext().clear(),t):e.call(t,i,n,...o))}function yd(t,e){let i=0,n=0,o=r=>{i||(i=r),n+=1;let s=r-i;s>=1e3&&(t(Math.round(n*1e3/s)),n=0,i=r),e(requestAnimationFrame(o))};e(requestAnimationFrame(o))}function ug(t){return t<0?0:t>1?1:t}function Sd(t){let e=t.now??(()=>typeof performance<"u"?performance.now():Date.now()),i=t.budgetMs??8,n=t.reducedMotion===!0,o=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=f=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,f()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,f()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,f()},16)}},p=()=>{a||s||(a=!0,u(),t.done())},m=f=>{for(let g=c.length-1;g>=0;g--){let y=c[g],S=n?1:ug((f-y.startedAt)/160);t.fade(y.work,S),S>=1&&c.splice(g,1)}return c.length>0},b=()=>{if(s)return;let f=e(),g=f;for(;r<t.chunks.length&&(r===0||e()-g<i);){let S=t.chunks[r++];if(t.build(S.work),t.fade(S.work,n?1:0),n||c.push({work:S.work,startedAt:f+(r-1)*o}),e()-g>=i)break}let y=m(f);t.draw(),r<t.chunks.length||y?h(b):p()};return h(b),{cancel(){if(!a){s=!0,u();for(let f of c)t.fade(f.work,1);c.length=0}},finishNow(){if(!(s||a)){for(;r<t.chunks.length;){let f=t.chunks[r++];t.build(f.work)}for(let f of t.chunks)t.fade(f.work,1);c.length=0,t.draw(),p()}},get done(){return a}}}var pg={width:40,height:30,rotation:0};function vd(t,e){let i=1/0,n=1/0,o=-1/0,r=-1/0;for(let s of t){if(s.kind==="booth"){let l=e.boothDims.get(s.rowId)??pg;if(l.points&&l.points.length>=3){for(let m of l.points)s.x+m.x<i&&(i=s.x+m.x),s.y+m.y<n&&(n=s.y+m.y),s.x+m.x>o&&(o=s.x+m.x),s.y+m.y>r&&(r=s.y+m.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)),p=Math.abs(d*Math.sin(c))+Math.abs(u*Math.cos(c));s.x-h<i&&(i=s.x-h),s.y-p<n&&(n=s.y-p),s.x+h>o&&(o=s.x+h),s.y+p>r&&(r=s.y+p);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<n&&(n=s.y-a),s.x+a>o&&(o=s.x+a),s.y+a>r&&(r=s.y+a)}return isFinite(i)?{x:i,y:n,width:o-i,height:r-n}:null}function wd(t){let e=new Map,i=[];for(let o of t.seats){let r=t.sectionIdOf(o.id);if(r==null){i.push(o);continue}let s=e.get(r);s?s.push(o):e.set(r,[o])}let n=[...e.entries()].flatMap(([o,r])=>{let s=t.sections.find(a=>a.id===o);return s?[{chunk:{id:o,work:{seats:r,group:s.liftGroupSeat}},distance:Math.hypot(s.centroid.x-t.viewportCentre.x,s.centroid.y-t.viewportCentre.y)}]:[]}).sort((o,r)=>o.distance-r.distance).map(o=>o.chunk);return i.length&&t.looseGroup&&n.push({id:"",work:{seats:i,group:t.looseGroup}}),n}var kd=!1;function xd(t){return t&&t!=="flat"&&!kd&&(kd=!0,console.warn(`[seatlayer] view mode '${t}' was removed; the map shows the flat view. Pass 'flat', or use the Map | 3D control for the immersive venue view.`)),"flat"}var Ld=(t,e)=>t.length===e.length&&t.every(i=>e.some(n=>Math.abs(i.x-n.x)<.001&&Math.abs(i.y-n.y)<.001));function Cd(t,e){let n=(t?.floors?.length?t.floors.flatMap(c=>c.objects):t?.objects??[]).filter(c=>c.type==="section"),o=e.logicalSectionId??e.id,r=c=>(c.elevation??0)===(e.elevation??0)&&JSON.stringify(c.geometry??null)===JSON.stringify(e.geometry??null),s=n.find(c=>c.id===o),a=o!==e.id&&!!s&&r(s)&&(s.holes??[]).some(c=>Ld(c,e.outline)),l=n.filter(c=>c.id!==e.id&&c.logicalSectionId===e.id&&r(c));return{hidden:a,holes:(e.holes??[]).filter(c=>!l.some(d=>Ld(c,d.outline)))}}import{Group as Td}from"konva/lib/Group";import{Rect as fg}from"konva/lib/shapes/Rect";import{Text as To}from"konva/lib/shapes/Text";function Id(t,e){let i=Jt(e.outline,e.holes),n=le(t.canvasBackground),o=[],r=new Map,s=0,a=z(e.outline),l=t.seatIndex?rt(t.seatIndex,a).map(C=>t.seatById.get(C)).filter(C=>!!C):t.seats;for(let C of l)t.seatSection.has(C.id)||te(C,e.outline,e.holes)&&(o.push(C.id),r.set(C.categoryKey,(r.get(C.categoryKey)??0)+1),(t.statusById.get(C.id)??"free")==="free"&&s++);let c=e.color??ii([...r].map(([C,I])=>({hex:t.catColor.get(C)??"#6e7bff",w:I})),"#3a4358"),d=new Td({listening:!1});t.bgLayer.add(d);let u=new Td({listening:!1});d.add(u);let h=new gt({listening:!0});t.seatLayer.add(h);let p=u,m=Cd(t.chartDoc,e),b=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",f=De(e.outline,m.holes,{visible:!m.hidden,stroke:D(b,.5),strokeWidth:1,fill:D(b,.08),listening:!1},e.outlinePath);p.add(f);let g=De(e.outline,m.holes,{visible:!m.hidden,fill:n.sectionFill,stroke:n.sectionStroke,strokeWidth:Xe,opacity:0,listening:!1},e.outlinePath);p.add(g);let y=e.labelPresentation?.labelStyle,S=y?.color,k=n.sectionInk,w=(y?.size??18)/18,v=new fg({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});p.add(v);let x=new To({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*w,fontStyle:Ce,fontFamily:t.labelFont(),fill:de(n.sectionFill,S,k),listening:!1,perfectDrawEnabled:!1});x.offsetX(x.width()/2),x.offsetY(x.height()/2),p.add(x);let T=new To({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Ce,fontFamily:t.labelFont(),fill:de(n.sectionFill,S,k),opacity:0,listening:!1,perfectDrawEnabled:!1});p.add(T);let P=new To({x:i.x,y:i.y,text:F("map.seatsLeft",{count:s}),fontSize:12,fontStyle:gs,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:n.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});return P.offsetX(P.width()/2),p.add(P),{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]:[],...Ha(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(o.map(C=>t.seatById.get(C)?.categoryKey).filter(Boolean)),shellCategoryColor:t.dominantSellableColor(o),shellFill:n.sectionFill,shellStroke:n.sectionStroke,stateWord:null,...e.labelPresentation?.position&&!te(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:Uo(e.outline,e.holes),zone:e.zone,memberIds:o,total:o.length,free:s,baseFill:c,outlineTint:b,outlinePoly:f,blockPoly:g,namePlate:v,nameLabel:x,numberLabel:T,subLabel:P,preferredInk:k,...S?{explicitInk:S}:{},labelScale:w,authoredLabelSize:y?.size!=null,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,rootGroupBg:d,liftGroupBg:u,liftGroupSeat:h}}function Rd(t,e,i){if(!e?.length)return;let n=new Set(e),o=t.seats.filter(d=>!n.has(d.categoryKey)||t.seatInClosedSection(d.id)?!1:(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id));if(!o.length)return;let r=ao(o.map(d=>d.id),t.seatSection);r&&t.focusSection(r);let s=Math.max(24,t.seatR*3),a=t.clusterLabels.boundsForSeats(o,s),l=je(o,s);if(a?.singleBlock&&(!t.hasSections||r!=null)){let d=t.clusterLabels.diveTarget(a.bounds,a.anchor);if(d){t.focusRegion(d,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),maxScale:yt(t)});return}}let c={x:l.x+l.width/2,y:l.y+l.height/2};so({stage:t.stage,box:l,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(c)})||t.focusRegion(l,{animate:i?.animate,durationMs:t.cameraGlideMs})}function yt(t){let e=Fc(Math.max(t.seatR,t.markerR));return Math.max(e,rl(t.markerR))}var Pd=.25;function mg(t,e){if(e.length===0)return 1/0;let i=je([...e],t.sellableUnit.diameter/2),n=t.framingViewport();return Math.min(n.width*Pd/Math.max(i.width,1e-6),n.height*Pd/Math.max(i.height,1e-6))}function Md(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let n=Ed(t,i);if(!n.length)return!1;t.clearSectionFocus();let o=Math.max(24,t.seatR*3),r=je(n,o),s={x:r.x+r.width/2,y:r.y+r.height/2};return so({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:yt(t)}),!0}function Ed(t,e){return t.seats.filter(i=>t.seatInClosedSection(i.id)||Pe(i,e)!=="match"?!1:(t.statusById.get(i.id)??"free")==="free"||t.ownedHold.has(i.id))}function Ad(t,e,i){let n=i===void 0?t.accessFilter:i;if(!n||!t.sections.some(r=>r.id===e||r.logicalId===e))return!1;let o=t.sectionMembers(e).filter(r=>{if((t.statusById.get(r)??"free")!=="free")return!1;let s=t.seatById.get(r);return s!=null&&Pe(s,n)==="match"});return o.length&&Io(t,o)||t.focusSection(e),!0}function Fd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=Ed(t,i);if(!n.length)return null;let o=Math.max(24,t.seatR*3),r=je(n,o),s=t.getWorldBounds(),a=s.width>0&&s.height>0&&r.width>=s.width*Ht&&r.height>=s.height*Ht;return{spaces:n.length,sections:Ro(t,i),wholeVenue:a}}function Io(t,e,i){let n=e.map(h=>t.seatById.get(h)).filter(h=>h!=null);if(!n.length)return!1;let o=t.seatPitch>0?t.seatPitch:t.seatR*2,r=je(n,Math.max(24,t.seatR*3,o*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=ao(n.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=mg(t,n);return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:d,maxScale:Math.max(Math.min(yt(t),u),d)}),!0}function _d(t,e,i=!0,n){let o=t.sectionBounds(e);if(!o)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,l=t.focusedRowLabelGutter(e),c=t.narrowSeatDetailFocus(a,o,n,l);t.focusRegion(c?.bounds??o,{animate:i,minScale:c?.minScale,maxScale:yt(t),focusPaddingPx:l})}function Po(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let n=Bd(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,n),n}function Bd(t,e,i){return Ll(e.memberIds,i,n=>t.statusById.get(n)??"free",n=>t.seatById.get(n))}function Ro(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return[];let n=i===t.accessFilter,o=new Map;for(let r of t.sections){if(t.isSectionClosed(r))continue;let s=n?Po(t,r):Bd(t,r,i);if(s<=0)continue;let a=o.get(r.logicalId);a?a.free+=s:o.set(r.logicalId,{id:r.logicalId,label:r.label,free:s})}return[...o.values()]}var yg=1800,qt=class qt{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=io;this.effSelection=pt;this.colorblind=!1;this.cbHueByKey=new Map;this.colourOverride=null;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;this.sectionRungPinned=!1;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 Oi;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.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=Ec();this.fitScale=1;this.fitPose="";this.viewportInsets={...mo};this.fitClearance={bottom:0,width:0};this.seatR=J;this.markerR=J;this.seatPitch=0;this.sellableUnit=ro(J);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 Qi;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.gestureHits=new Xi(()=>{!this.destroyed&&!this.exportMode&&this.updateLabels()});this.rowLabelDwell=new Yi;this.readingFocusedFrame=!1;this.marquee=new Ui({overlayLayer:()=>this.overlayLayer,stageScale:()=>this.stage.scaleX(),screenToWorld:e=>this.screenToWorld(e),selectionColor:()=>this.effSelection,seats:()=>this.seats,isSelectable:e=>this.isSelectable(e),applyBand:(e,i,n)=>{this.opts.onBand?.(e,i,n)||(n?this.deselect(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 n=this.focusedId?this.nearestSeat(this.focusedId,i):this.seats[0]?.id??null;n&&this.focusSeat(n);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let n=this.seatById.get(this.focusedId);n&&this.opts.onFocusSeat?.(n)}};this.focusRingLinger=null;this.cameraHostCache=null;this.viewportWanted=[];this.viewportPinSync=!1;this.selectionFollowUps=new $i(()=>{this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)});this.sectionBoundsMemo=new Map;this.interactionHostCache=null;this.seatLabelTargetScale=yc(()=>({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?ft(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 n=ji.pixelRatio;if(this.exportMode&&(this.dpr=1),ji.pixelRatio=this.dpr,this.stage=new gg({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Ki(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",F("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Mo({listening:!this.exportMode}),this.seatLayer=new Mo({listening:!this.exportMode}),this.overlayLayer=new Mo({listening:!1}),this.exportMode||(this.gestureHits.wrap(this.bgLayer),this.gestureHits.wrap(this.seatLayer),this.gestureHits.listen(e),bd(this.seatLayer)),this.labelGroup=new $t({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new $t({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new $t({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new _i({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:()=>cl(this.sellableUnit),pickableScale:()=>Ai(this.sellableUnit),categoryLabel:o=>this.catByKey.get(o)?.label??"",categoryColor:o=>this.categoryDisplayColor(o),categoryFilter:()=>this.categoryFilter,seatsPickable:()=>this.seatsPickable(),screenToWorld:o=>this.screenToWorld(o),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(o,r)=>this.focusRegion(o,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new Od({radius:J+2,stroke:"#ffffff",strokeWidth:2,opacity:Vi,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new Od({radius:J+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&&(ji.pixelRatio=n),!this.exportMode){this.wireInteraction();let o=this.opts.onFps;o&&yd(o,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 Xt: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 Li({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(),seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(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 Ci({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,n,o){this.hoverCard.presentSeat(e,i,n,o)}get hoverCard(){return this.hoverCardCache||(this.hoverCardCache=new Ri({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,ue,!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,seatCardHead:e=>this.opts.hoverCardHead?.(e)??null,sectionCardHead:(e,i)=>this.opts.hoverSectionHead?.(e,i)??null})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new Ti({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 n=this.sectionTapAnchor(i,this.seatById.get(e.seatId)??{x:0,y:0});this.opts.onSectionTap?this.opts.onSectionTap(i,n):this.focusSection(i,{anchor:n})}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(n=>n.id).filter(n=>{let o=this.seatSection.get(n);return!!o&&(o.logicalId===e||o.id===e)});return i.length>0&&this.focusSeats(i)}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(va({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);if(!i.length)return{x:e.nameLabel.x(),y:e.nameLabel.y()};let n=0,o=0;for(let r of i)n+=r.x,o+=r.y;return{x:n/i.length,y:o/i.length}}get owned(){return this.ownedCache||(this.ownedCache=new Pi({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 n of e.memberIds){if(!this.selection.has(n)&&!this.ownedHold.has(n))continue;let o=this.seatById.get(n);o&&i.push(o)}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=>lc(e,{manageMode:this.opts.manageMode===!0,marqueeSelect:this.opts.marqueeSelect===!0}),beginMarquee:(e,i)=>this.marquee.begin(e,this.opts.marqueeShape==="lasso"?"lasso":"box",i),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.sectionBoundsMemo.clear(),this.rowBandPreview?.clear(),this.rowBandPreview=e.theme?.sectionDetail==="rows"?new Xt:null,this.rowBandZoomAnchor=null;let n=e===this.chartDoc;if(n||(this.sectionRungPinned=!1,this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??ei(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 o=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 $t({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),n||this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.selectionFocusKeep=null,n||this.statusById.clear(),this.accessFreeBySection.clear(),n||(this.selection.clear(),this.selectedSeatById.clear()),this.seatById.clear(),this.seatIndex=null,this.cached=!1,n||(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.hasSections=o.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=hi(this.theme.seatScale)*J,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,wi[l%wi.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=Rc(o.objects);for(let a of o.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}))}:{},...It(a)?{}:{nameHidden:!0},...We(a)?{nameSize:We(a)}:{}});if(this.seats=He(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!n){let a=o===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=Rr(this.seats,{seatRadius:this.seatR}),this.seatPitch=nl(this.seats),this.markerR=ol(this.seatR,this.seatPitch),this.sellableUnit=ll(this.seats,{markerRadius:this.markerR,blockDims:this.boothDims}),this.clusterLabels.rebuild(),this.bounds=ir(o,{freeText:"exclude"}),this.renderBackground(o),this.unsectionedSeatGroup=new $t({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.loadingReveal==="viewport"&&!this.exportMode&&this.sections.length>1;r&&this.startViewportSeats();let s=this.seatRevealWanted();this.seatRevealPending=s,this.revealWorldRect=s||r?vd(this.seats,{seatR:this.seatR,boothDims:this.boothDims}):null,!s&&!r&&this.renderSeats(),this.buildRowLabelPlan(o),this.overlayLayer.add(this.labelGroup,this.fgDecorGroup),this.overlayLayer.add(this.hoverRing,this.focusRing),hc(this.overlayLayer,this.chartDoc,this.activeFloorId,!this.floorOverview&&!this.stacked&&!this.exportMode),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=wd({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=Sd({chunks:e,build:i=>this.renderSeats(i.seats),fade:(i,n)=>i.group.opacity(n),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 n=this.viewportSeats;this.viewportSeats=null,e?n.finish():n.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:xt(e)};if(this.floorOverview&&e.floors.length>=2)return tt(e)==="combined"?ar(e):sr(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...tr(e),referenceImage:void 0,backgroundImage:xt(e)};let i=e.floors.find(n=>n.id===this.activeFloorId)??e.floors[0];return{...e,objects:i.objects,focalPoint:i.focalPoint,referenceImage:void 0,backgroundImage:xt(i),floors:void 0}}floorBaseHeightMFor(){let e=this.chartDoc?.floors;return e?.length?e.find(i=>i.id===this.activeFloorId)?.baseHeightM??0: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&&tt(this.chartDoc)!=="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?ei(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let n=!1,o=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),n=!0),o){let l=this.seatSection.get(r);l&&(this.accessFreeBySection.delete(l.id),s==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),o.add(l))}}if(o&&o.size){for(let r of o)this.refreshSectionFill(r);this.bgLayer.batchDraw()}n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setSeatCategories(e){let i=!1,n=!1,o=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),n=!0);let d=this.seatSection.get(s);d&&o.add(d)}if(!i)return;let r=new Map((this.chartDoc?ei(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of o){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=ii([...l].map(([c,d])=>({hex:this.catColor.get(c)??"#6e7bff",w:d})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}o.size&&this.bgLayer.batchDraw(),n&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels())}setOwnedHold(e){let i=new Set((e??[]).filter(o=>this.statusById.has(o))),n=new Set([...this.ownedHold,...i]);this.ownedHold=i,this.selectionFollowUps.batch(()=>{for(let o of n){let r=this.circleById.get(o);r&&this.paintSeat(r,o),this.syncSelectionMarker(o)}}),n.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ie&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;let n=this.selectionFocusId;this.selectionFocusId=i,this.selectionFocusKeep=jl({focusedId:i,seats:this.seats,seatId:s=>s.id,seatPoint:s=>s,sectionOf:s=>this.seatSection.get(s)?.logicalId??null,seatPitch:this.seatPitch,seatRadius:this.seatR});let r=n!=null&&i!=null&&Jl(n,i,s=>this.seatSection.get(s)?.logicalId??null)?[n,i]:this.seats.map(s=>s.id);for(let s of r){let a=this.circleById.get(s);a&&this.paintSeat(a,s)}n&&this.syncSelectionMarker(n),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 n of i){let o=this.circleById.get(n);o&&this.paintSeat(o,n)}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 n=this.seatById.get(i)??this.selectedSeatById.get(i);n&&e.push(n)}return e}clearSelection(){let e=[...this.selection];this.selectionFollowUps.batch(()=>{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=[];return this.selectionFollowUps.batch(()=>{for(let n of e){if(this.selection.has(n)||!this.isSelectable(n))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(n,!0,!0);let o=this.seatById.get(n);o&&i.push(o)}}),i.length&&this.overlayLayer.batchDraw(),i}setManageInteraction(e){this.marquee.cancel(),this.gestures.resetPan();let i=e.organizerStatus!==!1,n=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 o=[...this.selection].filter(r=>!this.isSelectable(r));o.length&&this.deselect(o),!e.manageMode&&this.selection.size&&this.clearSelection(),this.clusterLabels.syncCursor(!1),n&&this.repaintSectionsAndSeats(),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[i,n]of Object.entries(e??{}))Number.isFinite(n)&&this.sectionHeat.set(i,Math.max(0,Math.min(1,n)));for(let i of this.sections)this.refreshSectionHeat(i);this.bgLayer.batchDraw()}deselect(e){let i=!1;this.selectionFollowUps.batch(()=>{for(let n of e)this.selection.has(n)&&(this.setSelected(n,!1,!0),i=!0)}),i&&(this.overlayLayer.batchDraw(),this.effScale()>ie&&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),n=[];for(let o of this.seats)i.has(o.label)&&this.isSelectable(o.id)&&n.push(o.id);return this.selectMany(n)}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=[],n=new Set;for(let o of this.sections)if(!(o.id!==e&&o.logicalId!==e&&o.zone!==e))for(let r of o.memberIds){if(n.has(r)||(n.add(r),!this.isSelectable(r)))continue;let s=this.seatById.get(r);s&&i.push(s)}return i}selectMany(e){let i=e.filter(o=>!this.selection.has(o));if(!i.length)return this.getSelection();let n=this.selection.size+i.length<=es;return this.selectionFollowUps.batch(()=>{for(let o of i)if(n)this.setSelected(o,!0,!0);else{this.selection.add(o);let r=this.circleById.get(o);r&&this.paintSeat(r,o)}}),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=[],n=this.rowLabelGroup.find(o=>o.getAttr("rowLabel")===!0);for(let o of n){let r=o.getAttr("rowKey");!r||!o.isVisible()||i.push({rowKey:r,box:o.getClientRect({skipShadow:!0,skipStroke:!0})})}return jc(e,i)}selectRow(e){let i=Qc(e,this.seats,n=>this.isSelectable(n));return i.length&&(this.selectMany(i),this.opts.onMarquee?.(this.getSelection())),this.getSelection()}flashSeat(e,i="#f43f5e"){let n=this.seatById.get(e);n&&Hl(this.flashHost,n,i)}flashSection(e,i="#22a06b"){Gl(this.flashHost,this.sections.filter(n=>n.id===e||n.zone===e),i)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed}}nearestSeat(e,i){let n=this.seatById.get(e);if(!n)return null;let o=n,r=null,s=1/0;for(let a of this.seats){if(a.id===e)continue;let l=a,c=l.x-o.x,d=l.y-o.y,u=c*i.x+d*i.y;if(u<=.5)continue;let h=Math.abs(c*i.y-d*i.x),p=u+h*2.5;p<s&&(s=p,r=a.id)}return r}focusSeat(e,i){let n=this.seatById.get(e);n&&(this.focusedId=e,this.queueViewportPinSync(),this.focusRing.radius(this.seatR+3),this.focusRing.position(n),this.focusRing.scale({x:1,y:1}),this.focusRing.visible(!0),this.clearFocusRingLinger(),i?.transient&&(this.focusRingLinger=setTimeout(()=>{this.focusRingLinger=null,this.dismissFocusRing()},yg)),i?.move!==!1&&this.ensureVisible(n),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(n))}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(),n=this.stage.height(),o=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>n-s;if(this.stage.scaleX()<o||a){let l=e;this.stage.scale({x:o,y:o}),this.stage.position({x:i/2-l.x*o,y:n/2-l.y*o}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=wc(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}setFitClearance(e,i=0){let n={bottom:Math.max(0,e||0),width:Math.max(0,i||0)};n.bottom===this.fitClearance.bottom&&n.width===this.fitClearance.width||(this.fitClearance=n,this.fitPose&&qe(this.stage)===this.fitPose&&this.zoomToFit())}framingViewport(){return kc(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){return vc(e,this.stage.scaleX(),this.bounds,this.framingViewport(),i)}framingWorldRect(){return Cc(this.framingViewport(),e=>this.screenToWorld(e))}overview(){this.clearSectionFocus(),this.zoomToFit()}zoomToFit(){uc(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(),zones:()=>this.zones,markerR:()=>this.markerR,unitZoomCeiling:()=>Math.max(dl(this.sellableUnit),this.hasSections?ve:0),bounds:()=>this.bounds,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},gestureFrame:()=>this.gestureHits.bump(),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 xc(this.stage)}setCameraPose(e){this.cancelGlide(),Lc(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.stepZoom(qt.ZOOM_STEP)}zoomOut(){this.stepZoom(1/qt.ZOOM_STEP)}stepZoom(e){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),Gi({stage:this.stage,reducedMotion:()=>this.reducedMotion,bounds:()=>this.zoomBounds(),apply:(i,n)=>this.zoomAbout(i,n)},e,zi(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();return{x:e.x*i+this.stage.x(),y:e.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 n of this.sections)this.refreshSectionFill(n);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((n,o)=>n===e[o])}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);gl(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(){Xc({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=>zc(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<Q,effScale:()=>this.effScale(),labelLegible:e=>be(e,this.effScale())})}setGAStates(e){Yc(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),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.rowBandPreview.detailScale:0,framingViewport:()=>this.framingViewport(),worldToScreen:e=>this.worldToScreen(e),getWorldBounds:()=>this.getWorldBounds(),narrowSeatDetailFocus:(e,i,n,o)=>this.narrowSeatDetailFocus(e,i,n,o),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){Rd(this.focusFramingContext,e,i)}diveCeiling(){return yt(this.focusFramingContext)}focusAccessibleSeats(e){return Md(this.focusFramingContext,e)}focusAccessibleSection(e,i){return Ad(this.focusFramingContext,e,i)}accessibleSpread(e){return Fd(this.focusFramingContext,e)}setViewMode(e){xd(e),this.afterViewChange()}getViewMode(){return"flat"}effScale(){return this.stage.scaleX()}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.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.zoomSettleRaf&&cancelAnimationFrame(this.zoomSettleRaf),this.gestureHits.destroy(),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 n=this.seatSection.get(e);return i*(n&&this.sectionMatchesFocus(n)?1:Te)}sectionScreenBounds(e){return Ga({stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y()},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=Q,i=[],n=96,o=this.stage.width(),r=this.stage.height();for(let s of this.sections){let a=!0;if(e){let c=this.sectionScreenBounds(s);a=c.x+c.width>=-n&&c.y+c.height>=-n&&c.x<=o+n&&c.y<=r+n}this.viewportSeats&&a&&(e||s.id===this.focusedSectionId||s.logicalId===this.focusedSectionId)&&i.push(s.id),s.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(s.id)?.setViewportCulled(!a)}this.viewportSeats&&this.viewportSeats.sync(this.viewportWanted=[...i,"__loose"],this.viewportPins()),this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0)}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(let n of i.memberIds){let o=this.seatById.get(n);o&&e.push(o)}this.unsectionedSeatIds??=this.seats.filter(i=>!this.seatSection.has(i.id)).map(i=>i.id);for(let i of this.unsectionedSeatIds){let n=this.seatById.get(i);n&&e.push(n)}return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}seatLabelContainer(e){let i=this.seatSection.get(e);if(!i)return this.labelGroup;let n=this.labelLiftGroups.get(i.id);return n||(n=new gt({listening:!1}),n.setViewportCulled(i.liftGroupSeat.isViewportCulled()),this.labelGroup.add(n),this.labelLiftGroups.set(i.id,n)),n}viewportPins(){return Za([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 n=this.seatSection.get(i.id)?.id??"__loose",o=e.get(n);o||e.set(n,o=[]),o.push(i)}this.viewportSeats=new Mi(e,{build:i=>this.renderSeats(i),remove:i=>{for(let n of i)for(let o of[this.circleById,this.accessGlyphById,this.accessRingById,this.boothLabelById])o.get(n.id)?.destroy(),o.delete(n.id);this.glyphMarkers=this.glyphMarkers.filter(n=>!!n.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){hl({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,colorblind:this.colorblind,canvasBackground:this.canvasBackground,circleById:this.circleById,glyphMarkers:this.glyphMarkers,boothDims:this.boothDims,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,accessRingById:this.accessRingById,catByKey:this.catByKey,seatContainer:i=>this.seatContainer(i),buildAccessGlyph:(i,n)=>this.buildAccessGlyph(i,n),paintSeat:(i,n)=>this.paintSeat(i,n),labelFont:()=>this.labelFont()}),this.selectionFollowUps.batch(()=>{for(let i of e)this.selection.has(i.id)&&this.syncSelectionMarker(i.id)})}buildAccessGlyph(e,i){let n=this.seatR*1.5/ye,o=new bg({x:e.x,y:e.y,data:nt(e.accessibility??[])??"",scaleX:n,scaleY:n,fill:ai(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Hc(o),o}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[i,n]of this.accessGlyphById){let o=this.seatR*1.5/ye,s=this.accessGlyphFilterEmphasized(i)?Ur:Yr,a=Math.max(o,s/(ye*Math.max(e,.001)));n.scale({x:a,y:a}),n.visible(this.accessGlyphShouldShow(i))}}accessGlyphFilterEmphasized(e){let i=this.seatById.get(e),n=this.accessFilter;return!!i&&n!==null&&!!i.accessibility?.length&&Ie(i,n)}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 n=this.catPrice.get(e);return typeof n=="number"?Ue(n,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,n])=>[i,{min:n.min,max:n.max}])),!!this.chartDoc)){if(this.catPrice.clear(),this.categoryPriceRanges!==null)for(let i of this.chartDoc.categories){let n=this.categoryPriceRanges?.[i.key]?.min??i.price;typeof n=="number"&&this.catPrice.set(i.key,n)}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.colourOverride?.[e]?this.colourOverride[e]:this.colorblind?this.cbHueByKey.get(e)??wi[0]:this.catColor.get(e)??"#6e7bff":Ba}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??Qe}seatLabelInk(e,i){let n=i.fill();return de(typeof n=="string"?n:"",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?{...ft(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){ec(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){e!==this.colorblind&&(this.colorblind=e,this.recolourCategories())}setCategoryColourOverride(e){this.colourOverride=e,this.recolourCategories()}recolourCategories(){this.repaintSeats();for(let e of this.sections)e.shellCategoryColor=this.dominantSellableColor(e.memberIds),this.refreshSectionFill(e);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(n=>this.dimmedSections.has(n))||(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(n=>this.closedSections.has(n))||(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(n=>n.id===e||n.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 Io(this.focusFramingContext,e,i)}focusSectionCamera(e,i=!0,n){if(this.rowBandPreview&&!this.exportMode){let o=this.sectionBounds(e);if(o){let r=Math.min(this.sectionFrameScale(e),this.zoomBounds().max*.85);this.focusRegion(o,{animate:i,maxScale:r});return}}_d(this.focusFramingContext,e,i,n)}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()>=U}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()>=Ai(this.sellableUnit)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let i=this.sections.filter(n=>n.id===e||n.logicalId===e);if(this.focusBackdrop=Wl(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=Vl(this.focusBackdropHost,i);for(let n of this.selectionMarkers.values())n.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,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 n=i.getClientRect({relativeTo:this.overlayLayer,skipShadow:!0,skipStroke:!0}),o=2;return[{x:n.x-o,y:n.y-o},{x:n.x+n.width+o,y:n.y-o},{x:n.x+n.width+o,y:n.y+n.height+o},{x:n.x-o,y:n.y+n.height+o}]}):[]}}}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,n=-1/0,o=-1/0,r=(s,a)=>{s<e&&(e=s),a<i&&(i=a),s>n&&(n=s),a>o&&(o=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,n-e),height:Math.max(1,o-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(i=>{let n=this.isSectionClosed(i)||i.free<=0,o=i.memberIds.some(a=>this.selection.has(a)),r=o||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:o?"selected":n?"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),n={x:this.stage.x(),y:this.stage.y()};this.stage.position(this.constrainPan({x:n.x+this.stage.width()/2-i.x,y:n.y+this.stage.height()/2-i.y},n)),this.afterViewChange(),this.stage.batchDraw()}panScreenBy(e,i){if(Math.abs(e.x)<.5&&Math.abs(e.y)<.5)return;this.cancelGlide();let n=this.stage.x(),o=this.stage.y(),r=this.constrainPan({x:n+e.x,y:o+e.y},{x:n,y:o}),s=r.x-n,a=r.y-o;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),p=h<.5?4*h*h*h:1-Math.pow(-2*h+2,3)/2;if(this.stage.position({x:n+s*p,y:o+a*p}),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){Oa(this.readingAidsHost,e)}setLabelLayers(e){Da(this.readingAidsHost,e)}getLabelLayers(){return{...this.labelLayers}}setCategoryColours(e){Na(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=xt(e);i&&this.renderBackgroundImage(i);for(let n of e.objects)n.type==="decorImage"&&this.renderDecorImage(n);for(let n of e.objects)n.type==="section"&&this.renderSection(n);for(let n of e.objects)n.type==="shape"?this.renderShape(n):n.type==="gaArea"?this.renderGA(n):n.type==="table"?this.renderTable(n):n.type==="text"&&this.renderText(n);this.renderZones(e)}trackAssetImage(e,i,n,o){this.assets.track(e,i,n,o,{exportMode:this.exportMode})}cancelAssetLoads(){this.assets.cancelAll()}renderBackgroundImage(e){ad(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,n,o)=>this.trackAssetImage(e,i,n,o),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){ld(this.objectDrawContext,e)}renderTable(e){cd(this.objectDrawContext,e)}renderText(e){dd(this.objectDrawContext,e)}renderShape(e){hd(this.objectDrawContext,e)}renderGA(e){pd(this.objectDrawContext,e)}renderSection(e){let i=Id(this.sectionBuildContext,e);for(let n of i.memberIds)this.seatSection.set(n,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,labelFont:()=>this.labelFont(),dominantSellableColor:e=>this.dominantSellableColor(e)}}refreshSectionHeat(e){xl(this.sectionLodPaintContext,e)}refreshSectionFill(e){Tl(this.sectionLodPaintContext,e)}isSectionClosed(e){return lo(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=_s(e,n=>this.seatById.get(n)?.categoryKey,n=>this.catByKey.get(n)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return Po(this.focusFramingContext,e)}accessibleSections(e){return Ro(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,glideInProgress:this.glideInProgress,sectionsPinned:this.sectionRungPinned,reducedMotion:this.reducedMotion,seatCount:this.seats.length,lodScale:this.lodScale,fitScale:this.fitScale,setLodScale:i=>{this.lodScale=i},worldToScreen:i=>this.worldToScreen(i)}}renderZones(e){this.opts.manageMode||Ua({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,derivedFloorGroups:!!this.chartDoc&&tt(this.chartDoc)==="combined"&&!this.chartDoc.zones?.length,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let i=this.stage.scaleX();return{x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i}}sectionAt(e){if(!this.sections.length)return null;let i=this.screenToWorld(e),n=this.sections.find(o=>te(i,o.outline,o.holes));return n?n.logicalId:null}pressLandsOnChart(e){if(this.sectionAt(e)||Hi(this.selectionMarkers,e))return!0;let i=this.screenToWorld(e);for(let n of this.gaById.values())if(te(i,n.points,[]))return!0;return this.owned.badgeAt(i)||this.clusterLabels.clusterAt(i)||bo(this.tableFootprints,this.seats,i,this.effScale())||this.nearestSeatToScreen(e,ue,!0)?!0:(this.stacked||this.floorOverview)&&this.deckFloorAt()!==null}sectionInteractive(e){let i=this.sections.filter(n=>n.id===e||n.logicalId===e||n.zone===e);return!i.length||this.opts.manageMode?!0:i.some(n=>!this.isSectionClosed(n)&&n.free>0?!0:n.memberIds.some(o=>this.selection.has(o)||this.ownedHold.has(o)))}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?Pe(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()>ie&&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?bn(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let n=bn(getComputedStyle(i).backgroundColor);if(n)return n;i=i.parentElement}}return io}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:O(this.canvasBackground)?Ja:pt}setSelected(e,i,n=!1){let o=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());o&&(this.paintSeat(o,e),!n&&!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.selectionFollowUps.request()}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){let i=this.sectionBoundsMemo;if(i.has(e))return i.get(e)??null;!i.size&&typeof queueMicrotask=="function"&&queueMicrotask(()=>i.clear());let n=this.measureSectionBounds(e);return typeof queueMicrotask=="function"&&i.set(e,n),n}measureSectionBounds(e){return Xa({sections:this.sections,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(i,n,o)=>this.resolveAutomaticRowLabelPosition(i,n,o),rowLabelBox:(i,n)=>this.rowLabelBox(i,n)},e)}sectionFrameScale(e){let i=this.sectionBounds(e);return i?Math.min(mt(this.stage,i,this.zoomBounds(),Kt(this.framingViewport(),this.focusedRowLabelGutter(e))),Gt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){return Nc(this.rowLabelPlan,this.labelFont(),e)}deckFloorAt(){return pl(this.screenPickingHost)}nearestSeatToScreen(e,i,n=!1){return ul(this.screenPickingHost,e,i,{includeUnavailable:n})}get screenPickingHost(){return{seats:this.seats,stage:this.stage,seatR:this.seatR,selection:this.selection,objectFloor:this.objectFloor,screenToWorld:e=>this.screenToWorld(e),worldToScreen:e=>this.worldToScreen(e),isSelectable:e=>this.isSelectable(e)}}wireInteraction(){sc(this.interactionHost)}handleSeatTap(e){ac(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,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),setHoveredId:e=>{this.hoveredId!==e&&(this.hoveredId=e,this.queueViewportPinSync())},seatsPickable:()=>this.seatsPickable(),manageSeatHits:()=>this.opts.manageMode===!0&&this.getRung()==="seats",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),nearestSeatToScreen:(e,i,n)=>this.nearestSeatToScreen(e,i,n),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionMatchesFocus:e=>this.sectionMatchesFocus(e),navigateGroupAt:e=>$a({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=>bo(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,n)=>this.zoomAbout(e,i,n),panBy:(e,i)=>fc(this.cameraHost,e,i),zoomBounds:()=>this.zoomBounds(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let n=i?this.worldToScreen(i):zi(this.framingViewport());this.zoomAbout(Math.max(this.rowBandPreview.detailScale*1.08,this.stage.scaleX()*1.5),n)}else this.opts.onSectionTap?this.opts.onSectionTap(e,i):this.focusSection(e,{anchor:i})},onBackdropTap:this.opts.onBackdropTap??(this.opts.manageMode?()=>this.overview():void 0),onDeckTap:this.opts.onDeckTap}}zoomBounds(){return zt(this.cameraHost)}zoomAbout(e,i,n="now"){this.rowBandPreview&&this.focusRoams&&(this.rowBandZoomAnchor=i),pc(this.cameraHost,e,i,n)}cancelZoomSettle(){gc(this.cameraHost)}focusRegion(e,i){bc(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 n=performance.now();this.labelGroup.opacity(0);let o=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let s=Math.min(1,(r-n)/90);this.labelGroup.opacity(s),this.stage.batchDraw(),this.labelFadeRaf=s<1?requestAnimationFrame(o):0};this.labelFadeRaf=requestAnimationFrame(o)}cancelGlide(){Wt(this.stage),this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=Q?"seats":this.sectionRungPinned?"sections":this.zones.length&&e<Ke?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(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,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),ed(this.renderedQualityContext)}setRung(e){let i=this.sectionRungPinned;if(this.sectionRungPinned=e==="sections",e==="zones")this.cancelGlide(),this.zoomToFit();else{let n=this.framingViewport(),o=$c({rung:e,bounds:this.bounds,sections:this.sections,seats:this.seats,focusedSectionId:this.focusedSectionId,viewCentre:zi(this.framingWorldRect()),width:n.width,height:n.height,seatScale:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),seatFloor:Math.min(this.rowBandPreview?this.rowBandPreview.detailScale*1.08:Q*1.1,this.zoomBounds().max)});this.focusRegion(o.bounds,o.minScale===void 0?void 0:{minScale:o.minScale})}(i||this.sectionRungPinned)&&this.updateLOD()}seatRungScale(){return Ac(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,n,o=0){let r=Kt(this.framingViewport(),o);return _c({stageWidth:r.width,stageHeight:r.height,fullBounds:i,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:n})}releaseFocusOnPullBack(){this.rowBandPreview&&this.focusedSectionId&&this.effScale()>=Math.min(Q,this.sectionFrameScale(this.focusedSectionId)*.85)||dc({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.exportMode;if(!this.focusedSectionId&&(!i||this.effScale()<Q))return;let o=(i&&e?this.sectionAt(e):null)??Wa({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});!o||o===this.focusedSectionId||(this.focusedSectionId=o,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(o))}scheduleViewChange(){this.exportMode||(this.refreshLabelsWhileMoving(),!this.viewChangeRaf&&(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()})))}refreshLabelsWhileMoving(){this.movingLabelTimer||!this.seats.length||this.effScale()<=ie||(this.movingLabelTimer=setTimeout(()=>{this.movingLabelTimer=null,!(this.destroyed||this.exportMode)&&this.updateLabels()},Jr))}sizeLabel(e,i,n){e.fontSize(Math.max(1,i)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(n)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),ve+.01,ie):this.effScale(),i=Math.max(e,1e-4);for(let[r,s]of this.primaryFocalLabels)ud(r,s,i,(a,l)=>{this.sizeLabel(a,l,a.y())},this.fitScale);this.hasSections?(El(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&e>=Math.min(Q,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:Q),()=>this.sectionFrameScale(this.focusedSectionId),r=>{let s=r.outline.map(a=>this.worldToScreen(a));return Math.max(...s.map(a=>a.x))>=0&&Math.min(...s.map(a=>a.x))<=this.stage.width()&&Math.max(...s.map(a=>a.y))>=0&&Math.min(...s.map(a=>a.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 n=this.seatGlyphDetail;if(this.seatGlyphDetail=Xs(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail),n!==this.seatGlyphDetail&&this.glyphMarkers.length&&this.moments.resyncMarkers(this.selectionMarkers,()=>this.breath.sync(this.selectionMarkers)),this.viewportSeats){let r=this.seatLayer.opacity()>0;this.seatLayer.listening(r),!r&&this.hoveredId&&this.seatLayer.fire("mouseout");return}let o=!this.exportMode&&!this.rowBandPreview?.active&&e<Q;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),o&&!this.cached&&this.seatLayer.opacity()===0){this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.seatLayer.listening(!1),this.hoveredId&&this.seatLayer.fire("mouseout");return}if(o&&!this.cached){if(this.mountCachePending){this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>{this.recacheTimer=null,this.cacheSeatLayer()},0);return}this.cacheSeatLayer()}else!o&&(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;if(this.seatLayer.opacity()===0){this.cached&&this.releaseSeatLayerBitmap(),this.cached=!1,this.seatLayer.listening(!1);return}this.updateSeatGroupVisibility();let e=q(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(){gd(ji,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.gestureHits.flush(),this.zoomSettleRaf&&(this.cancelZoomSettle(),this.afterViewChange()),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<Q?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)),n=Math.min(...e.map(s=>s.y)),o=Math.max(...e.map(s=>s.x+s.width)),r=Math.max(...e.map(s=>s.y+s.height));return{x:i,y:n,width:Math.max(1,o-i),height:Math.max(1,r-n)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),i=this.stage.height(),n=Math.max(12,Math.min(36,Math.min(e,i)*.025)),o=()=>{let r=this.exportSceneBounds(),s=Math.max(1,e-n*2),a=Math.max(1,i-n*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()};o(),o()}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(o){let r=o instanceof Error?o.message:String(o);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 n=i.getContext("2d");if(!n)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");n.fillStyle=this.canvasBackground,n.fillRect(0,0,i.width,i.height);try{n.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ie):this.effScale();for(let{node:i,backdrop:n,kind:o,showAt:r,area:s}of this.freeTextById.values()){if(o==="ga-label"||o==="ga-capacity"||s)continue;let a=o==="free-text"&&this.nodeBelongsToFocusedSection(i),l=o==="direct-landmark";if(l){let u=Number(i.getAttr("directLandmarkBaseFontSize"))||i.fontSize();i.setAttr("directLandmarkBaseFontSize",u),i.fontSize(Math.max(u,G/e))}let c=r==="detail"&&!this.exportMode&&e<Le,d=l||a||!c&&be(i.fontSize(),e);if(i.visible(d),n?.visible(d),!this.exportMode&&o==="free-text"){let u=Math.min(1,Ts/Math.max(i.fontSize()*e,1e-6));i.scale({x:u,y:u}),n?.scale({x:u,y:u})}}Pc({freeTextById:this.freeTextById,focalLabels:this.primaryFocalLabels.keys(),seatIndex:this.seatIndex,bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,scale:e});for(let{node:i,fontSize:n}of this.iconNodeById.values())i.visible(this.nodeBelongsToFocusedSection(i)||be(ko(i,n,e),e))}nodeBelongsToFocusedSection(e){let i=this.focusedSectionId;if(!i)return!1;this.focusMembershipKey!==i&&(this.focusMembership.clear(),this.focusMembershipKey=i);let n=this.focusMembership.get(e);if(n!==void 0)return n;let o=this.sections.filter(s=>s.id===i||s.logicalId===i||s.zone===i),r=!1;if(o.length){let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),a={x:s.x+s.width/2,y:s.y+s.height/2};r=o.some(l=>te(a,l.outline,l.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.sectionBoundsMemo.clear(),this.rowLabelDwell.reset(),this.rowLabelPlan=fd(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,n=ee){return Co(e,i,n)}resolveAutomaticRowLabelPosition(e,i,n){return md(e,i,n,this.seatIndex)}objectFilteredOut(e){let i=e.categoryKey;return i?!!(this.categoryHighlight&&i!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(i)):!1}updateLabels(){al(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(),rowLabelDwell:this.rowLabelDwell,gesturing:()=>this.gestureHits.active,worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,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,n)=>this.resolveAutomaticRowLabelPosition(e,i,n),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),overlayLayer:this.overlayLayer}}handleResize(){this.gestures.invalidateRect();let e=Uc({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 n={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===n.width;r&&this.stage.position({x:this.stage.x()+(e.width-n.width)/2,y:this.stage.y()+(e.height-n.height)/2}),this.refitCurrentView(r)}};qt.ZOOM_STEP=1.4;var Eo=qt;function Dd(t,e){return new Eo(t,e)}function Sg(t,e){return t*2*.6*e>=6}function vg(t,e){t._sceneFunc(e)}function Ao(t){let e=this,i=e.attrs;vg(e,t);let n=i.organizerGlyphRadius||1,o=e.getStage(),r=Math.abs((o?o.scaleX():1)*(e.scaleX()||1))||1;if(!Sg(n,r))return;let s=n*.6;t.save(),t.setAttr("strokeStyle",i.organizerGlyphInk||"#000000"),t.setAttr("lineWidth",Math.max(n*.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 Nd(t){return t.attrs.sceneFunc===Ao}function Hd(t){Nd(t)&&t.setAttr("sceneFunc",void 0)}function wg(t,e,i,n){if(!e){Hd(t);return}let o=t.attrs;o.organizerGlyph=e,o.organizerGlyphInk=i,o.organizerGlyphRadius=n>0?n:1,o.sceneFunc!==Ao&&t.setAttr("sceneFunc",Ao)}function Gd(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 Fo(t,e){let i=t.renderer;if(!i?.focusAccessibleSeats)return!1;let n=e===void 0?t.accessFilter:e;if(!n)return!1;let o=Kd(t,n);o&&t.setFloor(o);let r=i.focusAccessibleSeats(n);return r&&t.emitSectionFocus(null),r}function Wd(t,e){let i=t.renderer;if(!i?.accessibleSpread)return null;let n=e===void 0?t.accessFilter:e;return n?i.accessibleSpread(n):null}function Vd(t,e,i,n){let o=t.renderer;o&&(t.accessFilter&&(i?.accessibleLeft??0)>0&&o.focusAccessibleSection?.(e,t.accessFilter)||(o.focusSection?o.focusSection(e,n?{anchor:n}:void 0):o.focusRegion?.(e)))}function zd(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let n=Kd(t,i);n&&t.setFloor(n);let o=t.renderer,r=o?.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,o?.focusAccessibleSection?.(a.id,i)||o?.focusSection?.(a.id),t.emitSectionFocus(t.sectionSummary(a.id)),{...a,index:r.indexOf(a),total:r.length}}function Kd(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let n=new Set(e),o=l=>n.size===0?!!l.accessible:!!l.accessibility?.some(c=>n.has(c)),r=l=>l.some(c=>c.type==="row"&&(c.overrides??[]).some(o)),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 Xd(t,e){return t.accessFilter?Pe(e,t.accessFilter)==="other":!1}function Yd(t,e){let i=t.renderer;if(!i)return;let n=i.getFocusedSection?.()??null;if(i.clearSectionFocus?.(),e?.length){t.emitSectionFocus(null),t.bandReturnPose||(t.bandReturnPose=i.getCameraPose?.()??null,t.bandReturnSection=t.bandReturnPose?n:null);let r=kg(t,e);r&&t.setFloor(r),i.focusCategories?i.focusCategories(e):i.zoomToFit();return}let o=t.bandReturnPose!=null;t.bandReturnPose=null,t.bandReturnSection=null,!(t.accessFilter&&Fo(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),o&&i.zoomToFit())}function kg(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let n=new Set(e),o=a=>a.some(l=>l.type==="row"&&(n.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&n.has(c.categoryKey)))||l.type==="gaArea"&&n.has(l.categoryKey)),r=t.getActiveFloorId(),s=i.floors.find(a=>a.id===r);return s&&o(s.objects)?null:i.floors.find(a=>o(a.objects))?.id??null}function Ud(t,e,i){let n=new Map,o=new Map,r=new Map,s=new Map,a=[],l=new Map(ti(t).map(h=>[h.id,h])),c=pr(t),d=it(t),u=di(t);for(let h of e){n.set(h.label,h.id),o.set(h.label,h),r.set(h.id,h),a.push(h.id);let p=l.get(h.rowId),m=p&&"label"in p&&typeof p.label=="string"?p.label:void 0,b=p?.type==="row"?p.segmentedRow:void 0,f=b?.displayLabel??(p&&"displayLabel"in p&&typeof p.displayLabel=="string"&&p.displayLabel?p.displayLabel:m),g=i.get(h.rowId),y=p?.type==="table"?"table":p?.type==="booth"?"booth":"seat",S=f,k=b?.displayType?.trim()||(p&&"displayType"in p&&typeof p.displayType=="string"&&p.displayType.trim()?p.displayType.trim():void 0),w=h.displayLabel??h.label,v=w.split("-"),x=g||h.kind==="booth"?void 0:f&&w.startsWith(`${f}-`)?w.slice(f.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:x,...k?{displayType:k,rowType:k}:{},...xg(p,h.sectionId?d.get(h.sectionId):void 0),...p?.type==="row"&&u.has(h.id)?{aisle:!0}:{}})}return{labelToId:n,labelToSeat:o,seatById:r,seatContext:s,allIds:a}}function xg(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 $d(t,e={}){let{baseMs:i=1e3,factor:n=2,maxMs:o=1/0,jitter:r=0,random:s=Math.random}=e,a=Math.min(i*n**Math.max(0,t),o);if(r<=0)return a;let l=Math.min(1,r);return a*(1-l+l*s())}function qd(t,e,i,n=1){let o=fr(t),r=it(t);return Ct(t).map(s=>{let a=t.categories.find(d=>d.key===s.categoryKey),l=o.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)),...Lg(s,i,n),categoryKey:s.categoryKey,tiers:a?.tiers,price:a?.tiers?.[0]?.price??a?.price??0,currency:e,...c?{entrance:c}:{}}})}function Lg(t,e,i){let n=pn(t,i),o=fn(t,i),r=Lt(t),s=i===2&&n.length===1&&n[0]===t.label?hn(t):null;if(s){let{min:l,max:c}=un(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=n.filter(l=>e(l)==="free");return{available:a.length,...r?{wheelchairPlaces:r,wheelchairAvailable:a.filter(l=>o.has(l)).length}:{}}}function Zd(t,e,i){let n=Math.floor(e),o=pn(t,i.modelVersion),r=i.modelVersion===2&&o.length===1&&o[0]===t.label?hn(t):null;if(r){let{min:d,max:u}=un(t);return i.alreadyHeld.has(t.label)||i.statusOf(t.label)!=="free"||i.wheelchairOnly&&!Lt(t)?null:r==="whole"?n===u?[{label:t.label}]:null:n>=d&&n<=u?[{label:t.label,quantity:n}]:null}let s=fn(t,i.modelVersion),a=o.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,n);return c.length===n?c.map(d=>({label:d})):null}function Cg(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 Qd(t,e,i={}){let n={};for(let o of t){let r=i.wheelchairOnly===!0?Cg(o):null;n[o.id]=e?{available:o.available,selected:e.get(o.id)??0,wheelchairFree:r}:{available:o.available,wheelchairFree:r}}return n}function jd(t){let e={};for(let[i,n]of t.seatById)t.groupedTableBySeatId.has(i)||t.closedMembers.has(i)||(t.statusOf(i)??"free")==="free"&&(e[n.categoryKey]=(e[n.categoryKey]??0)+1);for(let i of t.groupedTablesByLabel.values()){if(i.chairs.some(o=>t.closedMembers.has(o.id)))continue;let n=i.chairs[0];n&&(t.statusOf(n.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 Tg(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function Jd(t,e,i=[]){let n=new Set,o=new Map;for(let r of i)n.add(r.need),o.set(r.need,(o.get(r.need)??0)+r.free);for(let r of t){let s=Tg(r);if(!s.length)continue;let a=e(r.id)==="free";for(let l of s)n.add(l),a&&o.set(l,(o.get(l)??0)+1)}return n.size?Xo.filter(r=>n.has(r.key)).map(r=>({key:r.key,count:o.get(r.key)??0})):[]}var iT=5e3,nT={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function Ig(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 eh(t){let e=new Set(t.holdLabels),i=t.selection.filter(o=>!e.has(o)&&t.statusOf(o)!=="free");if(!Ig(t))return{lost:i,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let n=[...t.holdLabels];return{lost:i,holdLapsed:!0,lapsedLabels:n,recoverable:n.filter(o=>t.statusOf(o)==="free")}}function oT(t){return t.lost.length>0||t.holdLapsed}function rT(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function th(t,e,i=Date.now()){return e&&i<t+5e3}function ih(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 nh(t){if(!t?.zones?.length)return[];let e=new Set(mr(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 oh(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},n=He(e).filter(s=>!t.groupedObjectIds.has(s.rowId)),o=new Set;for(let s of n)t.heldLabels.has(s.label)||t.tierApplies(s)&&(t.accessFilter&&!Ie(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&o.add(s.label));let r=Vr(n,o,{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 _o=["background","rowLabelColor","textColor","selectionColor"];function rh(t,e){return!t||!e?!t&&!e:_o.every(i=>t[i]===e[i])}function St(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function Ji(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function sh(t,e,i){let n=cr(e,i);n==="all"?t.setFloorOverview?.(!0):n&&t.setActiveFloor?.(n)}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 Bo(t){return t==="setup"||t==="testable"||t==="live"||t==="paused"||t==="ended"?t:null}function ah(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var en=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 n=this.ref;this.pending=e.eventConfiguration(i).then(o=>{if(o.reference.id!==n.id||o.reference.version!==n.version||o.configuration.id!==n.id||o.configuration.version!==n.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return o.configuration})}return this.pending}};async function lh(t,e,i){if(!t.renderer)return null;let o=e??t.getSelection().map(l=>l.label),r=t.hold_?.items??[],s=[...new Set([...r.map(l=>l.label),...o])];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 u=r.find(m=>m.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),p=h?t.toSeat(h):null;return{label:d,...p?.tierId?{tierId:p.tierId}:{},...t.tableQuantityRequest(p)}}),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 ch(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 n=[...new Set(i.items.map(o=>o.label))];return n.length?(t.setHold({holdId:i.holdId,labels:n,expiresAt:i.expiresAt,items:i.items},"restored"),t.hold_):null}async function dh(t,e){let i=t.hold_;if(!i||!t.api.extend)return null;try{let n=await t.api.extend(t.key,i.holdId,e);return t.hold_?.holdId!==i.holdId||t.setHold({holdId:i.holdId,labels:i.labels,expiresAt:n.expiresAt,items:i.items}),t.hold_}catch{return null}}async function hh(t,e,i,n){let o=t.renderer;if(!o)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(u=>{let h=t.labelToSeat.get(u),p=h?t.toSeat(h):null;return{label:u,...p?.tierId?{tierId:p.tierId}:{},...t.tableQuantityRequest(p)}}),n,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}=St(c);if(t.clearHold(),d===409&&h==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&u?.length){let p=new Set(u.map(f=>f.label)),m=t.idsForLabels(p);m.length&&(o.setStatus(m,"booked"),o.deselect(m),t.resetTableQuantitiesForLabels(p));let b=r.filter(f=>!p.has(f));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&&(o.setStatus(l,"booked"),o.deselect(l)),t.clearHold(),t.resetTableQuantitiesForLabels(r),t.emitSelectionChange(),t.opts.onBook?.(e),r}async function uh(t){let e=t.hold_;if(!e)return!0;try{let n=await t.api.release(t.key,e.labels,e.holdId);if(!t.releaseConfirmed(n,e.labels))return await t.resnapshot(),!1}catch(n){return t.emitError(n),!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 ph(t,e){let i=t.hold_;if(!i)return!0;let n=e.filter(a=>i.labels.includes(a));if(!n.length)return!0;try{let a=await t.api.release(t.key,n,i.holdId);if(!t.releaseConfirmed(a,n))return await t.resnapshot(),!1}catch(a){return t.emitError(a),!1}if(t.hold_?.holdId!==i.holdId)return!0;let o=i.labels.filter(a=>!n.includes(a)),r=i.items?.filter(a=>!n.includes(a.label));o.length?t.setHold({...i,labels:o,items:r}):t.clearHold(),t.resetTableQuantitiesForLabels(n);let s=t.idsForLabels(n);return s.length&&(t.renderer?.deselect(s),t.renderer?.setStatus(s,"free")),!0}function fh(t,e){let i=t?.released;return!Array.isArray(i)||e.every(n=>i.includes(n))}function mh(t,e){let i=t.hold_;if(!i||i.labels.length!==e.length||!e.every(r=>i.labels.includes(r)))return!1;let n=new Map((i.items??[]).map(r=>[r.label,r.tierId])),o=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))&&(!o.has(r)||o.get(r)===a.quantity))&&(!n.has(r)||n.get(r)===l)})}function gh(t,e){let{status:i,conflicts:n}=St(e);if(i!==409||!n?.length)return;let o=t.renderer;if(!o)return;let r=t.idsForLabels(n.map(s=>s.label));r.length&&(o.deselect(r),o.setStatus(r,"held"),t.resetTableQuantitiesForLabels(n.map(s=>s.label))),t.emitSelectionChange()}function bh(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 n={...e,seats:t.seatsForLabels(e.labels)};t.hold_=n,t.renderer?.setOwnedHold?.(t.idsForLabels(n.labels)),t.expiryTimer&&clearTimeout(t.expiryTimer);let o=Math.max(0,n.expiresAt-Date.now());t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},o),i==="restored"?t.opts.onHoldRestored?.(n):t.opts.onHold?.(n)}function yh(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function Sh(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(th(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function vh(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function wh(t,e,i,n){if(i!=null&&!Array.isArray(i))throw new TypeError("picker: `selectionValidators` must be an array");let o=[],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&&o.push({type:"minimumSelectedPlaces",minimum:r}),s&&o.push({type:"consecutiveSeats"}),a&&o.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(n,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:o,maxSelection:t??l}}function Rg(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Mg(t){if(t.length<=1)return!1;let e=t[0]?.objectId,i=t[0]?.categoryKey;if(!e||t.some(o=>o.objectId!==e||o.categoryKey!==i))return!0;let n=t.map(o=>Rg(o.id)).sort((o,r)=>o-r);return n.some((o,r)=>o<0||r>0&&o!==n[r-1]+1)}function kh(t,e,i,n,o){let r=n.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"),n.some(l=>l.type==="consecutiveSeats")&&Mg(t)&&a.push("consecutiveSeats"),n.some(l=>l.type==="noOrphanSeats")&&o()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:s,remaining:Math.max(0,s-e),seats:t,violations:a}}function xh(t){let{id:e,doc:i,seatById:n,groupedTableBySeatId:o}=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,p=0;for(let v of l){let x=n.get(v);if(!x)continue;t.matchesAccessFilter&&t.statusOf(v)==="free"&&t.matchesAccessFilter(x)&&(p+=1);let T=o.get(v);if(T){if(u.has(T.label))continue;u.add(T.label),c.set(T.categoryKey,(c.get(T.categoryKey)??0)+T.maxOccupancy),t.statusOf(T.chairs[0]?.id??v)==="free"&&(h+=T.maxOccupancy,d.set(T.categoryKey,(d.get(T.categoryKey)??0)+T.maxOccupancy))}else c.set(x.categoryKey,(c.get(x.categoryKey)??0)+1),t.statusOf(v)==="free"&&(h++,d.set(x.categoryKey,(d.get(x.categoryKey)??0)+1))}let m=[...c.entries()].map(([v,x])=>{let T=i.categories.find(R=>R.key===v),P=T?.tiers?.map(R=>R.price).filter(Number.isFinite)??[],L=P.length?P:typeof T?.price=="number"&&Number.isFinite(T.price)?[T.price]:[],C=L.length?Math.min(...L):void 0,I=L.length?Math.max(...L):void 0;return{key:v,count:x,label:T?.label??v,color:T?.color??"#6e7bff",...C!==void 0?{price:C,priceMin:C,priceMax:I}:{}}}).sort((v,x)=>(v.priceMin??1/0)-(x.priceMin??1/0)||v.key.localeCompare(x.key)),b=m.flatMap(v=>v.priceMin===void 0?[]:[v.priceMin]),f=m.flatMap(v=>v.priceMax===void 0?[]:[v.priceMax]),g=a.zone?i.zones?.find(v=>v.id===a.zone):void 0,y=v=>{let x=null,T=0;for(let[P,L]of v)(L>T||L===T&&x!=null&&P<x)&&(x=P,T=L);return x},S=y(d)??y(c),w=(S?m.find(v=>v.key===S)?.color:void 0)??g?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:p}:{},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(...f)}:{},categories:m}}var tn=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 n=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===n&&(this.inFlight=null)});return this.inFlight=n,n}markSettled(){this.lastSettledAt=this.now()}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};function Lh(t,e){return t?.source==="socket"&&e.source==="http"?t:e}function Ch(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 _g=!0,Bg=!0,Og=10,Dg=15e3,Th=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new en;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 tn;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=vh(e.numberOfPlacesToSelect);let i=wh(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Og);this.selectionValidators=i.validators,this.maxSelection=i.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(n=>typeof n=="string"&&!!n))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=gr(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let n of _o){let o=this.mapTheme[n];o&&(i[n]=o)}return{...e,theme:i}}setMapTheme(e){return rh(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),n=this.getActiveFloorId(),o=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,s=e.getCameraPose?.();return e.setChart(this.visibleDoc(),n?{floorId:n}:void 0),this.applyRowBandPreview(e),o&&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(o=>typeof o=="string");if(i.length===this.hidden.size&&i.every(o=>this.hidden.has(o)))return!1;this.hidden=new Set(i);let n=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),this.renderer&&this.applyRowBandPreview(this.renderer),n&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let i=(e??[]).filter(n=>typeof n=="string");return i.length===this.closedSections.size&&i.every(n=>this.closedSections.has(n))?!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(o=>o.id);let n=this.labelToId.get(e);return n?[n]:[]}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 o=this.visibleDoc(),r=Ct(o).find(s=>s.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}if(e.objectType==="table"){let o=this.groupedTablesByLabel.get(e.label);return{...o?.displayLabel&&o.displayLabel!==o.label?{displayLabel:o.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}let i=this.labelToSeat.get(e.label),n=i?this.seatContext.get(i.id):void 0;return{...i?.displayLabel?{displayLabel:i.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}async render(e){if(this.renderer)return null;let i=performance.now(),n={},o=C=>Math.round((performance.now()-C)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(C=>({ok:!0,res:C,elapsed:o(r)}),C=>({ok:!1,error:C,elapsed:o(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(C=>({ok:!0,objects:C,elapsed:o(a)}),()=>({ok:!1,elapsed:o(a)})),c=await s;if(n.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=ah(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 C=zr(d.doc,this.inventoryModelVersion);this.groupedTablesByObject=new Map(C.map(I=>[I.objectId,I])),this.groupedTablesByLabel=new Map(C.map(I=>[I.label,I])),this.groupedTableBySeatId=new Map(C.flatMap(I=>I.chairs.map(R=>[R.id,I]))),this.tableQuantities=new Map(C.map(I=>[I.label,I.mode==="whole"?I.capacity:I.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=C.reduce((I,R)=>I+Math.max(0,R.chairs.length-1),0)}catch(C){return this.emitError(C),null}this.expandedSeats=He(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let h=Ud(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 C of this.groupedTablesByLabel.values()){let I=C.chairs[0];I&&(this.labelToId.set(C.label,I.id),this.labelToSeat.set(C.label,I))}n.normalizeBuyerModel=o(u);let p=d.event.currency??this.opts.currency;this.currency=p??"USD";let m=performance.now(),b=Dd(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:p,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{n.seatsComplete=o(i),this.opts.onSeatsRevealed?.()},onSelect:C=>{this.handleRendererSelect(C)},onDeselect:C=>{this.handleRendererDeselect(C)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(C,I)=>{this.opts.onHover?.(C),this.opts.onSeatHover&&this.opts.onSeatHover(C?this.describeSeat(C,I):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(C,I)=>this.previewSection(C,I),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:C=>this.opts.onSectionFocus?.(C==null||this.isSectionClosed(C)?null:this.sectionSummary(C)),onDeckTap:C=>this.handleDeckTap(C),onFps:this.opts.onFps});if(n.createRenderer=o(m),this.closed)return b.destroy(),null;this.renderer=b,this.viewportInsets&&b.setViewportInsets?.(this.viewportInsets),this.fitClearance>0&&b.setFitClearance?.(this.fitClearance);let f=null,g="free",y=[],S,k=await l;if(k.ok){let C=k.objects;this.hidden=new Set(C.hidden??[]),y=(C.closed??[]).filter(I=>typeof I=="string"),f=C.seats,g=C.default??"free",S=typeof C.fetchedAt=="number"?C.fetchedAt:void 0}if(n.loadStatuses=k.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),sh(b,d.doc,e.clientWidth),this.opts.colorblindSafe&&b.setColorblindSafe?.(!0),n.buildScene=o(w),this.closedSections=new Set(y);let v=performance.now();y.length&&b.setClosedSections?.(y),this.seatsBuilt=!0;let x=this.pendingSnapshot;this.pendingSnapshot=null;let T=Ch(x,f?{seats:f,default:g,fetchedAt:S}:null);T&&this.applySeatsMap(T.seats,T.default,T.source,T.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),n.applyInitialState=o(v);let P=performance.now();b.forceDraw(),n.firstPaint=o(P);let L=performance.now();return k.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),n.startRealtime=o(L),n.controllerTotal=o(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,salesState:Bo(d.event.status),eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:p,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,performanceProfile:n}}getSelection(){if(!this.renderer)return[];let e=[],i=new Set;for(let n of this.renderer.getSelection()){let o=this.groupedTableBySeatId.get(n.id);o?i.has(o.label)||(i.add(o.label),e.push(this.toTableSeat(o))):e.push(this.toSeat(n))}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 n of e){let o=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(o)o.chairs.forEach(r=>i.add(r.id)),this.hold_?.labels.includes(o.label)||(this.tableQuantities.set(o.label,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(o.label));else{let r=this.seatById.has(n)?n:this.labelToId.get(n);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)),n=new Set,o=[];for(let s of e){let a=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(a)this.tableTierResolution(a).kind==="invalid"?o.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&n.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"?o.push(c.label):n.add(l)}}if(o.length&&this.emitError(new Ee(Ln(o))),!n.size)return[];if(this.renderer?.select?.([...n]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...n]),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(n=>i.has(n.categoryKey)).map(n=>n.id))}deselectCategories(e){let i=new Set(e);this.deselect(this.getSelection().filter(n=>i.has(n.categoryKey)).map(n=>n.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(n=>typeof n=="string"&&!!n))],this.rebuildSelectableSeatIds();let i=this.renderer?.getSelection().filter(n=>!this.isSelectableByPolicy(n.id)).map(n=>n.id)??[];i.length&&this.deselect(i)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let i=this.getSelection(),n=e??i.reduce((o,r)=>o+(r.quantity??1),0);return kh(i,n,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let i=new Set(e.getSelection().map(n=>n.id));return i.size>0&&xn(this.seatById.values(),n=>e.getStatus(n),i).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let i of this.selectableObjectRefs){let n=this.groupedTableBySeatId.get(i)??this.groupedTablesByLabel.get(i);if(n){n.chairs.forEach(r=>e.add(r.id));continue}let o=this.seatById.has(i)?i:this.labelToId.get(i);o&&e.add(o)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,i){let n=this.groupedTablesByLabel.get(e);if(!n)return!1;let o=n.mode==="whole"?n.capacity:Math.floor(i);if(!Number.isInteger(o)||o<n.minOccupancy||o>n.maxOccupancy)return!1;let r=this.tableQuantities.get(e)??n.minOccupancy;return this.tableQuantities.set(e,o),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(n.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,i,n){let o=this.groupedTablesByLabel.get(e),r=this.hold_;if(!o||o.mode!=="variable"||!r?.labels.includes(e))return null;let s=Math.floor(i);if(!Number.isInteger(s)||s<o.minOccupancy||s>o.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,n,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 _g&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(Bg||!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(o=>o.id):[e.id]),this.emitSelectionChange();return}if((i?this.tableTierResolution(i):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(i?i.chairs.map(o=>o.id):[e.id]),this.emitError(new Ee(Ln([i?.label??e.label]))),this.emitSelectionChange();return}if(i){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(i.chairs.map(o=>o.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(i.chairs.map(o=>o.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),n=i?.label??e.label;if(this.opts.retapKeepsSelection&&!i&&(this.hold_?.labels.includes(n)||this.isSelectableByPolicy(e.id))){this.renderer?.select?.([e.id]),this.opts.onSeatRetap?.(this.toSeat(e));return}if(this.hold_?.labels.includes(n)){this.opts.onDeselect?.(i?{...e,label:n}:e);return}i?(this.renderer?.deselect(i.chairs.map(o=>o.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 n=this.groupedTablesByLabel.get(i);n&&(this.tableQuantities.set(i,n.mode==="whole"?n.capacity:n.minOccupancy),n.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 lh(this,e,i)}resumeHold(e){return ch(this,e)}extendHold(e){return dh(this,e)}categoryAvailability(){return jd({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 n of this.closedSections)for(let o of i.sectionMembers?.(n)??[])e.add(o);return e}getGAAreas(){let e=this.visibleDoc();return e?qd(e,this.currency,i=>this.statusOf(i),this.inventoryModelVersion):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Qd(this.getGAAreas(),this.gaSelected,{wheelchairOnly:this.accessFilter?.includes("wheelchair")===!0}))}async holdGA(e,i,n={}){let o=this.visibleDoc();if(!o||!Number.isFinite(i)||i<1)return null;let r=Ct(o).find(d=>d.id===e);if(!r)return null;let s=Zd(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,...n.tierId?{tierId:n.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,n.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 nh(this.visibleDoc())}pickPremiumBlock(e,i,n){return oh({doc:this.visibleDoc(),qty:e,categoryKey:i,zoneId:n,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:o=>this.seatTierResolution(o).kind!=="invalid",statusOfLabel:o=>this.getStatus(this.labelToId.get(o)??"")??"free",isPremium:o=>!!this.labelToSeat.get(o)?.commercial?.premium})}async bestAvailable(e,i,n={}){let o=this.renderer;if(!o)return null;if(n.preferPremium){let r=this.pickPremiumBlock(e,i,n.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,n.ttlMs);o.clearSelection();let l=this.idsForLabels(r);l.length&&o.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}=St(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,n.zoneId,n.ttlMs);o.clearSelection();let s=this.idsForLabels(r.labels);s.length&&o.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}=St(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,n){return hh(this,e,i,n)}release(){return uh(this)}releaseLabels(e){return ph(this,e)}releaseConfirmed(e,i){return fh(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(o=>o.notForSale).map(o=>o.key));if(!i.size)return[];let n=[];for(let[o,r]of this.seatById)i.has(r.categoryKey)&&n.push(o);return n}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 hi(this._doc?.theme?.seatScale)*J*e}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){Gd(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 Fo(this.pickerFocusContext,e)}accessibilitySpread(e){return Wd(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return zd(this.pickerFocusContext,e)}accessibilityFilterDims(e){return Xd(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.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){Yd(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 n=this.renderer;if(!n?.focusSeats?.(e,i))return!1;let o=n.getFocusedSection?.()??null;return this.opts.onSectionFocus?.(o?this.sectionSummary(o):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 n=this.isSectionClosed(e)?null:this.sectionSummary(e);Vd(this.pickerFocusContext,e,n,i),this.opts.onSectionFocus?.(n)}sectionSummary(e){return!this.renderer||!this._doc?null:xh({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 n=e.commercial?{commercial:e.commercial}:void 0,o=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,...o,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...n,...r,...s};let d=c.tier;return{id:e.id,label:e.label,...o,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...n,...r,...s}}toTableSeat(e){let i=e.chairs[0],n=this.tiersFor(e.categoryKey)?.filter(s=>fi(this._doc,this.tableTierSeat(e),s.id).kind==="resolved"),o=this.tableTierResolution(e),r=o.kind==="resolved"?o.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,...n?{tiers:n,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 n=this._doc?.categories.find(o=>o.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:n?.label??e.categoryKey,categoryColor:n?.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(n=>n.key===e)?.tiers;return i&&i.length?i:void 0}tiersForSeat(e){if(!this._doc)return;let i=Gr(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?fi(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 fi(this._doc,this.tableTierSeat(e),this.seatTiers.get(i))}setSeatTier(e,i){let n=this.seatById.get(e);if(!n)return;let o=this.tiersForSeat(n);if(o){if(i==null)this.seatTiers.delete(e);else if(o.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 n of e){let o=this.labelToSeat.get(n);o&&i.push(this.toSeat(o))}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 Wr(this._doc,i.map(n=>({label:n.label,...n.tierId?{tierId:n.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"?F("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let n=this.selectionValidators.some(s=>s.type==="noOrphanSeats"),o=new Set(e.getSelection().map(s=>s.id));(n&&o.size?xn(this.seatById.values(),s=>e.getStatus(s),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(F("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 mh(this,e)}handle409Conflicts(e){gh(this,e)}setHold(e,i="created"){bh(this,e,i)}clearHold(){yh(this)}expireActiveHold(){return Sh(this)}applySeatsMap(e,i="free",n="http",o){n==="socket"&&(this.socketVersion+=1);let r=this.renderer;if(!r||!this.seatsBuilt){this.pendingSnapshot=Lh(this.pendingSnapshot,{seats:e,default:i,source:n,...o===void 0?{}:{fetchedAt:o}});return}let s=this.seatsMapDiffers(e,i);this.lastSnapshotAt=o??Date.now(),this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=i;let a=Ji(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[Ji(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,n=await this.api.objects(this.key);this.socketVersion===i&&this.applySeatsMap(n.seats,n.default??"free","http",n.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=eh({selection:this.getSelection().map(n=>n.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:n=>this.statusOf(n)});if(i.lost.length&&this.deselect(i.lost),i.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(i.lapsedLabels);let n=this.idsForLabels(i.lapsedLabels);n.length&&this.renderer?.deselect(n),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(i),i}getAccessNeeds(){return Jd(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=ih(()=>{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 n=this.syncHidden(e),o=this.syncClosed(i);n&&this.resnapshot(),(n||o)&&this.opts.onStatusChange?.({changed:!0})}}}seatsMapDiffers(e,i){if(this.lastSnapshotAt===0||i!==this.liveDefault)return!0;let n=Object.entries(e);if(n.length!==this.liveStatuses.size)return!0;for(let[o,r]of n)if(this.liveStatuses.get(o)!==r)return!0;return!1}applyStatusChanges(e){this.socketVersion+=1;let i=this.renderer;if(!i)return;let n=e.some(s=>this.liveStatuses.get(s.label)!==s.status),o=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=Ji(s.status);this.opts.flashOnLiveChange&&l!=="free"&&a.some(c=>(o.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)o.set(c,l)}let r=new Map;for(let[s,a]of o){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:n})}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let n=null;try{n=this.api.createRealtime(this.key,this.realtimeSink())}catch{n=null}if(n){this.realtime=n,n.start();return}}if(this.realtime)return;let i;try{let n=this.api.socketProtocols?.(this.key);i=n&&n.length?new WebSocket(e,n):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=n=>{this.clearConnectFallback();let o;try{o=JSON.parse(typeof n.data=="string"?n.data:"")}catch{return}if(!this.renderer||!o||typeof o!="object")return;let s=o;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=$d(e,{baseMs:1e3,maxMs:Dg,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var Ng=5,Hg=-1.1,Oo=35;function Do(t,e){let i=t-Ae,n=Math.atan2(Ng-i,e)*180/Math.PI,o=Math.atan2(Hg-i,e)*180/Math.PI;return o<-Oo&&(n+=-Oo-o,o=-Oo),{topPitch:n,basePitch:o}}var ne=2048,ke=1024,Qt=Qo,B=Math.PI*2,Gg=ke/180,wt=t=>(t+180)/360*ne,Z=t=>(90-t)/180*ke;function Eh(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 Ah(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 nn=96,Go=360/nn,Wg=.6,No=[17,23,42];function Ho(t,e,i=1){let n=Math.max(0,Math.min(.58,e)),o=Math.round(t[0]+(No[0]-t[0])*n),r=Math.round(t[1]+(No[1]-t[1])*n),s=Math.round(t[2]+(No[2]-t[2])*n);return`rgba(${o},${r},${s},${i})`}function Ih(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 n=(1-Math.abs(2*i-1))*e,o=(t%360+360)%360/60,r=n*(1-Math.abs(o%2-1)),s=0,a=0,l=0;o<1?[s,a,l]=[n,r,0]:o<2?[s,a,l]=[r,n,0]:o<3?[s,a,l]=[0,n,r]:o<4?[s,a,l]=[0,r,n]:o<5?[s,a,l]=[r,0,n]:[s,a,l]=[n,0,r];let c=i-n/2;return[Math.round((s+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var Ph=new Map;function Rh(t){if(!t)return null;let e=Ph.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 n=(i>>>0)%360,o=ce(n,.3,.42);return Ph.set(t,o),o}function Vg(t,e,i,n){let o=new Array(nn).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??Ae,p=h-n;Math.abs(p)>r&&(r=Math.abs(p));let m=Math.atan2(p,u)*180/Math.PI,b=Math.atan2(h-Ae-n,u)*180/Math.PI,g=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,y=Math.min(nn-1,Math.max(0,Math.floor((g+180)/Go))),S=m>34&&u<16,k=o[y];k?(m>k.top&&(k.top=m),b<k.base&&(k.base=b),u<k.nearM&&(k.nearM=u,k.tint=Rh(a.categoryKey)),k.overhead=k.overhead||S):o[y]={top:m,base:b,nearM:u,overhead:S,tint:Rh(a.categoryKey)}}return{bins:o,maxDelta:r}}function zg(t,e,i,n){for(let o=0;o<nn;o++){let r=e[o];if(!r)continue;let s=-180+o*Go,a=i(s),l=i(s+Go);if(!(l>a))continue;let c=Math.min(72,r.top),d=Math.min(r.base,-4),u=n(c),h=n(d);if(h<=u)continue;let p=r.nearM/95,m=r.tint,b=m?Ih([44,54,80],m,.34):[44,54,80],f=m?Ih([24,30,48],m,.28):[24,30,48],g=t.createLinearGradient(0,u,0,h);g.addColorStop(0,Ho(b,p)),g.addColorStop(.24,Ho(f,p)),g.addColorStop(1,Ho([10,13,22],p)),t.fillStyle=g,t.fillRect(a,u,l-a+1,h-u),t.fillStyle=`rgba(150,165,205,${.35*(1-p*.55)})`,t.fillRect(a,u,l-a+1,1.5);let S=Math.min(h,n(0))-u;if(S>8){let w=1-p*.4;for(let v=1;v<6;v++){let x=u+S*v/6;t.fillStyle=`rgba(0,0,0,${.16*w})`,t.fillRect(a,x,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*w})`,t.fillRect(a,x+1.5,l-a+1,1.2)}}if(r.overhead){let k=n(Math.min(86,c+12)),w=t.createLinearGradient(0,k,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,k,l-a+1,u-k),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,u-1.5,l-a+1,1.5)}}}function Kg(t,e,i){let o=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,k=Math.hypot(y,S)*Qt;if(k<.5)continue;let w=Math.atan2(y,-S),v=Math.floor((w+Math.PI)/B*72);v<0?v=0:v>=72&&(v=71),o[v]=!0,k<r[v]&&(r[v]=k)}let l=0,c=[];for(let g=0;g<72;g++)o[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,p=c.length?c[Math.floor(c.length*.85)]??u:0,m=h>.5?p/h:1,b=Eh(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),f;return d>=300&&u>11&&m>1.35?f="sport":d>=285?f="arena":f="proscenium",{mode:f,seed:b,voidRadiusM:u,aspect:m}}var Xg=5;function Yg(t,e,i){switch(i){case 1:t.beginPath(),t.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,B),t.fill();break;case 2:t.beginPath(),t.ellipse(0,-e*1.02,e*.42,e*.42,0,0,B),t.fill(),t.beginPath(),t.ellipse(0,-e*.2,e*.98,e*1.02,0,0,B),t.fill();break;case 3:t.beginPath(),t.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,B),t.fill(),t.beginPath(),t.ellipse(0,-e*.52,e*1.22,e*.24,0,0,B),t.fill();break;case 4:t.beginPath(),t.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,B),t.fill(),t.beginPath(),t.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,B),t.fill(),t.beginPath(),t.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,B),t.fill();break;default:break}}function Ug(t,e,i,n,o){let r=n*.44,s=n*o.shoulderK,a=n*.66,l=n*1.68,c=n*5.4,d=`rgba(${o.clothing[0]},${o.clothing[1]},${o.clothing[2]},${o.alpha})`,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`;t.save(),t.translate(e,i);let h=o.lean*n;t.fillStyle=d,t.beginPath(),t.moveTo(-r,a),t.quadraticCurveTo(-r*1.18,l-h-n*.6,-s,l-h),t.quadraticCurveTo(-s*1.05,l+n*1.2,-s*.94,c),t.lineTo(s*.94,c),t.quadraticCurveTo(s*1.05,l+n*1.2,s,l+h),t.quadraticCurveTo(r*1.18,l+h-n*.6,r,a),t.closePath(),t.fill(),t.fillStyle=u,t.fillRect(-r*.82,n*.5,r*1.64,n*.9),t.save(),t.rotate(o.tilt),t.translate(o.turn*n,0),t.fillStyle=u,n>=18?(t.beginPath(),t.moveTo(-n*.9,-n*.15),t.quadraticCurveTo(-n*.96,-n*1.12,0,-n*1.06),t.quadraticCurveTo(n*.96,-n*1.12,n*.9,-n*.15),t.quadraticCurveTo(n*.86,n*.55,n*.36,n*.98),t.quadraticCurveTo(0,n*1.14,-n*.36,n*.98),t.quadraticCurveTo(-n*.86,n*.55,-n*.9,-n*.15),t.closePath(),t.fill(),n>=22&&(t.beginPath(),t.ellipse(-n*.9,n*.18,n*.13,n*.22,0,0,B),t.ellipse(n*.9,n*.18,n*.13,n*.22,0,0,B),t.fill())):(t.beginPath(),t.ellipse(0,0,n*.9,n*1.06,0,0,B),t.fill()),Yg(t,n,o.hair),o.rim>.01&&(t.strokeStyle=`rgba(245,205,150,${(.5*o.rim).toFixed(3)})`,t.lineWidth=Math.max(1,n*.14),t.beginPath(),t.ellipse(0,-n*.06,n*.86,n*1,0,Math.PI*1.12,Math.PI*1.9),t.stroke()),t.restore(),o.rim>.01&&(t.strokeStyle=`rgba(240,200,150,${(.28*o.rim).toFixed(3)})`,t.lineWidth=Math.max(1,n*.12),t.beginPath(),t.moveTo(-s*.8,l-n*.05),t.quadraticCurveTo(-r,l-n*.75,0,l-n*.82),t.quadraticCurveTo(r,l-n*.75,s*.8,l-n*.05),t.stroke()),t.restore()}function $g(t,e,i,n,o,r,s){t.fillStyle=`rgba(${o[0]},${o[1]},${o[2]},${s})`,t.beginPath(),t.moveTo(e-n*1.72,i+n*4),t.quadraticCurveTo(e-n*1.78,i+n*1.55,e-n*.46,i+n*1.02),t.lineTo(e-n*.4,i+n*.62),t.lineTo(e+n*.4,i+n*.62),t.lineTo(e+n*.46,i+n*1.02),t.quadraticCurveTo(e+n*1.78,i+n*1.55,e+n*1.72,i+n*4),t.closePath(),t.fill(),t.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${s})`,t.beginPath(),t.ellipse(e,i,n*.9,n*1.05,0,0,B),t.fill()}function Vo(t,e,i,n,o){let r=n*.1,s=i-n*.9,a=i-n*.74,l=i-n*.46,c=n*.13,d=n*.09,u=`rgba(${o.tone[0]},${o.tone[1]},${o.tone[2]},${o.alpha})`,h=t.createRadialGradient(e,i,1,e,i,n*.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,n*.24,n*.24,0,0,B),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+n*.02),t.lineTo(e+d*.1,l+n*.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-n*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-n*.12,e+c,a),t.quadraticCurveTo(e,a-n*.05,e-c,a),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=u,t.lineWidth=n*.055;let p=a+n*.02;o.pose===1?(t.beginPath(),t.moveTo(e-c*.8,p),t.lineTo(e-c*1.5,i-n*1.02),t.moveTo(e+c*.8,p),t.lineTo(e+c*1.5,i-n*1.02),t.stroke()):o.pose===2?(t.beginPath(),t.moveTo(e-c*.8,p),t.lineTo(e+d*1.4,l-n*.02),t.moveTo(e+c*.8,p),t.lineTo(e-d*.4,l-n*.06),t.stroke(),t.fillStyle=u,t.beginPath(),t.ellipse(e+d*1.5,l-n*.04,n*.07,n*.09,-.5,0,B),t.fill()):o.pose===3?(t.beginPath(),t.moveTo(e-c*.8,p),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,p),t.lineTo(e+c*1.1,l),t.stroke(),t.lineWidth=n*.02,t.beginPath(),t.moveTo(e-c*.2,s+r*.9),t.lineTo(e-c*.2,i-n*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,p),t.lineTo(e-c*.95,l+n*.02),t.moveTo(e+c*.85,p),t.lineTo(e+c*.95,l+n*.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,B),t.fill(),o.rimStrength>.01&&(t.strokeStyle=`rgba(${o.rim[0]},${o.rim[1]},${o.rim[2]},${(.6*o.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,n*.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 on(t,e,i,n,o,r,s,a,l){t.save(),t.globalCompositeOperation="lighter";let c=t.createLinearGradient(0,i,0,o);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(n-s,o),t.lineTo(n+s,o),t.lineTo(e+r,i),t.closePath(),t.fill(),t.restore()}function zo(t,e,i,n,o){let r=t.createRadialGradient(e,i,0,e,i,n*3);r.addColorStop(0,`rgba(${o},0.9)`),r.addColorStop(.4,`rgba(${o},0.35)`),r.addColorStop(1,`rgba(${o},0)`),t.fillStyle=r,t.beginPath(),t.arc(e,i,n*3,0,B),t.fill(),t.fillStyle=`rgba(${o},1)`,t.beginPath(),t.arc(e,i,n,0,B),t.fill()}function iI(t,e,i){let n=document.createElement("canvas");n.width=ne,n.height=ke;let o=n.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??Ae,d=Kg(t,e,i),u=Ah(d.seed),h=210+u()*150,p=ce(220+(u()-.5)*60,.55,.82),m=`${p[0]},${p[1]},${p[2]}`,b=o.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"),o.fillStyle=b,o.fillRect(0,0,ne,ke);let f=o.createLinearGradient(0,Z(-6),0,ke);f.addColorStop(0,"rgba(30, 37, 56, 0)"),f.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),f.addColorStop(1,"rgba(22, 28, 44, 0.12)"),o.fillStyle=f,o.fillRect(0,Z(-6),ne,ke-Z(-6));let g=Math.atan2(r,-s),y=Vg(t,i,g,c),S=y.maxDelta>=Wg;S&&zg(o,y.bins,wt,Z);let k=Math.max(.3,Math.min(1,1-(l-6)/60)),w=Do(c,l),v=Math.min(80,Math.atan2(4,l)*180/Math.PI),x=Math.min(45,w.topPitch),T=w.basePitch;d.mode==="sport"?Qg(o,l,c,d,k,h,m,u):d.mode==="arena"?Zg(o,l,c,d,k,m,u):qg(o,v,x,T,k,h,m,u);let P=d.mode==="sport"?34:24+Math.floor(u()*8);o.fillStyle=`rgba(${m},0.8)`;for(let C=0;C<P;C++){let I=(C+.5)/P*ne,R=Z(d.mode==="sport"?58:54+C*7%3*6);o.beginPath(),o.arc(I,R,d.mode==="sport"?2.6:3.2,0,B),o.fill()}jg(o,t,i,e,g,c,r,s,S,d);let L=o.createLinearGradient(0,0,0,ke);return L.addColorStop(0,"rgba(0,0,0,0.85)"),L.addColorStop(.12,"rgba(0,0,0,0)"),L.addColorStop(.9,"rgba(0,0,0,0)"),L.addColorStop(1,"rgba(0,0,0,0.55)"),o.fillStyle=L,o.fillRect(0,0,ne,ke),{url:n.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function qg(t,e,i,n,o,r,s,a){let l=wt(-e),c=wt(e),d=Z(i),u=Z(n),h=c-l,p=u-d,m=Z(Math.min(50,i+10)),b=h*(1.1+(1-o)*.5),f=t.createRadialGradient(ne/2,(d+u)/2,8,ne/2,(d+u)/2,b);f.addColorStop(0,"rgba(255, 214, 150, 0.34)"),f.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),f.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),f.addColorStop(1,"rgba(99, 102, 241, 0)"),t.fillStyle=f,t.fillRect(l-h*.6,d-p*1.2,h*2.2,p*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,p),t.clip();let k=t.createLinearGradient(0,d,0,u);k.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),k.addColorStop(.5,`rgb(${y[0]},${y[1]},${y[2]})`),k.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=k,t.fillRect(l,d,h,p),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,p),t.restore();let v=3+Math.floor(a()*3),x=p*.46,T=u-p*.08;for(let E=0;E<v;E++){let W=(E+1)/(v+1),N=l+h*(.22+W*.56+(a()-.5)*.06);Vo(t,N,T,x*(.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,m,h*.5,u-m),t.fillRect(c,m,h*.5,u-m);let P=h*.055+3,L=P*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,u),t.lineTo(l-P,u),t.lineTo(l-L,m),t.lineTo(l+h*.012,m),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,u),t.lineTo(c+P,u),t.lineTo(c+L,m),t.lineTo(c-h*.012,m),t.closePath(),t.fill(),t.fillRect(l-L,m,h+L*2,(u-m)*.12);let C=p*.14,I=m+(u-m)*.12;t.fillStyle="rgba(4,6,12,0.96)";let R=7;t.beginPath(),t.moveTo(l-L,I);for(let E=0;E<=R;E++){let W=l-L+(h+L*2)*E/R;t.quadraticCurveTo(W-(h+L*2)/R/2,I+C,W,I)}t.lineTo(c+L,I),t.lineTo(c+L,m),t.lineTo(l-L,m),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-P,u-p*.05,h+P*2,p*.05+3);let M=t.createLinearGradient(0,u-p*.05,0,u+p*.12);M.addColorStop(0,`rgba(255,206,140,${(.5*o).toFixed(3)})`),M.addColorStop(1,"rgba(255,206,140,0)"),t.fillStyle=M,t.fillRect(l-P,u-p*.05,h+P*2,p*.2);let A=3+Math.floor(a()*2);for(let E=0;E<A;E++){let W=(E+1)/(A+1),N=l+h*(W+(a()-.5)*.08),Y=Z(Math.min(62,i+26)),re=(a()-.5)*h*.16;on(t,N,Y,N+re,u,4,h*.09,s,.16*(.7+o*.5)),zo(t,N,Y,2.4,s)}}function Zg(t,e,i,n,o,r,s){let a=Math.min(e*.6,Math.max(3,n.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,p=Math.atan2(d-i,u)*180/Math.PI,m=Math.atan2(d-i,h)*180/Math.PI,b=Math.atan2(-i,u)*180/Math.PI,f=Z(p),g=Z(m),y=Z(b),S=wt(l)-c,k=Math.max(6,(f-g)/2),w=(f+g)/2,v=t.createRadialGradient(c,y,4,c,y,S*2.6);v.addColorStop(0,`rgba(255,206,150,${(.2*o).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-k,S*5.2,y-g+k+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,w),t.ellipse(c,w,S,k,0,Math.PI,0,!1),t.lineTo(c+S,y),t.ellipse(c,y,S,k,0,0,Math.PI,!1),t.closePath(),t.fill();let x=t.createLinearGradient(0,w,0,y);x.addColorStop(0,`rgba(${r},0.14)`),x.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=x,t.fillRect(c-S,w,S*2,y-w);let T=[[{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}]],P=T[Math.floor(s()*T.length)],L=s()<.5?-1:1,C=K=>c+K.u*L*S*.84,I=K=>w+K.v*k*.8,R=P.find(K=>K.lead)??P[0],M=C(R),A=t.createLinearGradient(0,w-k,0,w+k);A.addColorStop(0,"#3d4a72"),A.addColorStop(1,"#232b47"),t.fillStyle=A,t.beginPath(),t.ellipse(c,w,S,k,0,0,B),t.fill();let E=t.createRadialGradient(M,w,2,M,w,S);E.addColorStop(0,`rgba(255,214,160,${(.5*o).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,k,0,0,B),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,w,S,k,0,0,B),t.stroke();let W=Math.max(24,(y-g)*1.3),N=P.length>=3?3:2;for(let K=0;K<N;K++){let xe=(-.62+K*.52+(s()-.5)*.12)*-L,Ne=c+xe*S*.7,kt=w-k*(.45+s()*.18),et=S*(.07+s()*.04),dn=W*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Ne-et/2,kt-dn,et,dn),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Ne-et/2,kt-dn,et,1.5)}if(P.length>=3){let K=c-R.u*L*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(K,w-k*.34,S*.08,k*.1,0,0,B),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let K of[...P].sort((xe,Ne)=>xe.v-Ne.v)){let xe=.82+(K.v+1)*.14;Vo(t,C(K),I(K),W*xe*(K.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:K.pose,rim:ce(40,.72,.8),rimStrength:K.lead?1.4:.9})}let Y=Z(Math.min(60,m+34)),re=k*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,Y,S*1.15,re,0,0,B),t.stroke();let H=4+Math.floor(s()*3);for(let K=0;K<H;K++){let xe=K/H*B,Ne=c+Math.cos(xe)*S*1.15,kt=Y+Math.sin(xe)*re;if(Math.sin(xe)>-.2){let et=c+(s()-.5)*S*.8;on(t,Ne,kt,et,w,3,S*.32,r,.2*(.7+o*.4))}zo(t,Ne,kt,3,r)}let _=Z(Math.min(52,m+24)),V=Math.max(60,S*.4),oe=Math.max(24,V*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-V*.3,_-oe/2),t.lineTo(c-V*.16,_-oe*2.2),t.moveTo(c+V*.3,_-oe/2),t.lineTo(c+V*.16,_-oe*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-V/2,_-oe/2,V,oe);let sn=t.createLinearGradient(0,_-oe*.3,0,_+oe*.42);sn.addColorStop(0,`rgba(${r},0.5)`),sn.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=sn,t.fillRect(c-V*.42,_-oe*.3,V*.84,oe*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-V/2,_+oe/2-2,V,2);let an=t.createRadialGradient(c,_,4,c,_,V*1.1);an.addColorStop(0,`rgba(${r},0.2)`),an.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=an,t.fillRect(c-V*1.1,_-V*.8,V*2.2,V*1.6);let ln=t.createRadialGradient(c,(Y+w)/2,6,c,(Y+w)/2,S*1.5);ln.addColorStop(0,`rgba(${r},${(.1*(.6+o*.5)).toFixed(3)})`),ln.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=ln,t.fillRect(c-S*1.5,Y-40,S*3,w-Y+80),t.restore();let _h=c+Math.sign(M-c||1)*S*.5;on(t,_h,Y-re*.4,M,I(R),2.5,S*.16,"255,224,178",.42*(.7+o*.4));let cn=t.createRadialGradient(M,I(R),1,M,I(R),S*.2);cn.addColorStop(0,`rgba(255,228,185,${(.4*o).toFixed(3)})`),cn.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=cn,t.beginPath(),t.ellipse(M,I(R),S*.2,k*.24,0,0,B),t.fill(),t.restore()}function Qg(t,e,i,n,o,r,s,a){let l=ne/2,c=Math.max(10,n.voidRadiusM),d=Math.max(2,e-c),u=e+c,h=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),p=Math.atan2(-i,d)*180/Math.PI,m=Math.atan2(-i,u)*180/Math.PI,b=Z(p),f=Z(m),g=wt(h)-l,y=(b+f)/2,S=Math.max(10,(b-f)/2),k=t.createRadialGradient(l,y,4,l,y,g);k.addColorStop(0,"#e8f0fb"),k.addColorStop(.7,"#b9c9e2"),k.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,y,g,S,0,0,B),t.clip(),t.fillStyle=k,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,B),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,B),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let C=0;C<5;C++){let I=l+(a()-.5)*g*1.4,R=y+(a()-.5)*S*1.1,M=Math.max(2,S*.06);t.beginPath(),t.ellipse(I,R,M*.6,M,0,0,B),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,f-S,g*2.8,b-f+S*2),t.restore();let v=Z(Math.min(66,m+60)),x=Math.max(80,g*.7),T=x*.5,P=t.createRadialGradient(l,v,4,l,v,x*1.6);P.addColorStop(0,`rgba(${s},0.3)`),P.addColorStop(1,`rgba(${s},0)`),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=P,t.fillRect(l-x*1.6,v-x*1.2,x*3.2,x*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-x/2,v-T/2),t.lineTo(l+x/2,v-T/2),t.lineTo(l+x*.6,v),t.lineTo(l+x/2,v+T/2),t.lineTo(l-x/2,v+T/2),t.lineTo(l-x*.6,v),t.closePath(),t.fill();let L=r;for(let C=0;C<3;C++){let I=ce(L+C*30,.5,.5);t.fillStyle=`rgba(${I[0]},${I[1]},${I[2]},0.75)`;let R=x*.26;t.fillRect(l-x*.42+C*(R+x*.06),v-T*.32,R,T*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let C=0;C<8;C++){let I=l-x*.6+x*1.2*C/7;t.beginPath(),t.arc(I,v+T*.62,2.4,0,B),t.fill()}}function jg(t,e,i,n,o,r,s,a,l,c){let d=e.sectionId,u=!1,h=[];for(let b of i){if(b.id===e.id)continue;let f=b.x-e.x,g=b.y-e.y,y=Math.hypot(f,g)*Qt;if(d&&b.sectionId===d&&y<3&&f*s+g*a>0&&(u=!0),y<.3||y>32)continue;let k=((Math.atan2(f,-g)-o)*180/Math.PI+540)%360-180,w=l?(b.eyeHeightM??Ae)-r:0,v=Math.atan2(w-.28,y)*180/Math.PI;if(v>10&&y>5)continue;let x=0;for(let L=0;L<b.id.length;L++)x=x*31+b.id.charCodeAt(L)&65535;let T=.9+(x&15)/40,P=Math.min(78,Math.atan2(.16,y)*180/Math.PI*Gg*T);P<1.2||h.push({hx:wt(k),hy:Z(v),r:P,d:y,hash:x})}h.sort((b,f)=>f.d-b.d);let p=[];{let b=[...h].sort((y,S)=>y.hy-S.hy),f=[],g=()=>{if(!f.length)return;let y=f.reduce((w,v)=>w+v.d,0)/f.length,S=f.reduce((w,v)=>w+v.hy,0)/f.length,k=f.reduce((w,v)=>w+v.r,0)/f.length;p.push({figs:f.sort((w,v)=>v.d-w.d),d:y,hy:S,r:k}),f=[]};for(let y of b){let S=f[f.length-1];S&&Math.abs(y.hy-S.hy)>Math.max(5,(S.r+y.r)/2*1.7)&&g(),f.push(y)}g()}p.sort((b,f)=>f.d-b.d);let m=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let b of p){if(b.figs.length>=3&&b.r>=1.6&&b.r<26){let f=[],g=[...b.figs].sort((k,w)=>k.hx-w.hx),y=[];for(let k of g){let w=y[y.length-1];w&&k.hx-w.hx>Math.max(14,k.r*7)&&(y.length>=3&&f.push(y),y=[]),y.push(k)}y.length>=3&&f.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 k of f){let w=k[0].hx-b.r*1.6,v=k[k.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 f of b.figs){let g=f.d<12?.95:f.d<17?Math.max(.66,.95-(f.d-12)/18):Math.max(.3,.68-(f.d-17)/34),y=Math.round((1-Math.min(1,f.d/16))*10),S=[14+(f.hash>>4&6)+y,17+(f.hash>>4&6)+y,25+(f.hash>>4&6)+y],k=m[f.hash%m.length],w=[k[0]+y,k[1]+y,k[2]+y];if(f.r>=13){let v=f.d<9?.16*(1-f.d/9)+(c.mode==="proscenium"?.06:0):0;Ug(t,f.hx,f.hy,f.r,{tone:S,clothing:w,alpha:g,tilt:((f.hash>>2&7)-3.5)*.018,shoulderK:1.72+(f.hash>>5&7)/22,hair:f.hash%Xg,rim:v,turn:((f.hash>>8&7)-3.5)*.034,lean:((f.hash>>10&3)-1.5)*.09})}else f.r>=5.5?$g(t,f.hx,f.hy,f.r,w,S,g):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,t.beginPath(),t.arc(f.hx,f.hy,f.r,0,B),t.fill(),t.beginPath(),t.ellipse(f.hx,f.hy+f.r*1.4,f.r*1.85,f.r*.95,0,Math.PI,0,!0),t.fill())}}if(u){let b=Z(-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 f=16;for(let g=0;g<f;g++){let y=(g+.5)/f*ne;t.beginPath(),t.ellipse(y,b+6,ne/f*.42,22,0,Math.PI,0,!0),t.fill()}}}var he=480,vt=270,Wo=50,Je=30,Mh=t=>(t+Wo)/(2*Wo)*he,Zt=t=>(Je-t)/(2*Je)*vt;function nI(t,e,i){let n=document.createElement("canvas");n.width=he,n.height=vt;let o=n.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*Qt),l=Ah(Eh(`${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=o.createLinearGradient(0,0,0,vt);h.addColorStop(0,"#080b12"),h.addColorStop(.44,"#151c32"),h.addColorStop(.5,"#1d2644"),h.addColorStop(.58,"#161c2e"),h.addColorStop(1,"#131829"),o.fillStyle=h,o.fillRect(0,0,he,vt);let p=t.eyeHeightM??Ae,m=Do(p,a),b=Math.min(Wo-2,Math.atan2(4,a)*180/Math.PI),f=Math.min(Je-2,m.topPitch),g=Math.max(-Je+2,m.basePitch),y=Mh(-b),S=Mh(b),k=Zt(f),w=Zt(g),v=S-y,x=w-k,T=Math.max(.35,Math.min(1,1-(a-6)/60)),P=Zt(Math.min(Je-1,f+8)),L=o.createRadialGradient(he/2,(k+w)/2,4,he/2,(k+w)/2,v*1.15);L.addColorStop(0,"rgba(255,214,150,0.34)"),L.addColorStop(.28,"rgba(150,150,230,0.3)"),L.addColorStop(.6,"rgba(99,102,241,0.12)"),L.addColorStop(1,"rgba(99,102,241,0)"),o.fillStyle=L,o.fillRect(y-v*.6,k-x*1.2,v*2.2,x*3.4);let C=ce(c,.62,.55),I=ce(c+40,.7,.5),R=ce(c+70,.78,.52);o.save(),o.beginPath(),o.rect(y,k,v,x),o.clip();let M=o.createLinearGradient(0,k,0,w);M.addColorStop(0,`rgb(${C[0]},${C[1]},${C[2]})`),M.addColorStop(.5,`rgb(${I[0]},${I[1]},${I[2]})`),M.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),o.globalAlpha=.8,o.fillStyle=M,o.fillRect(y,k,v,x),o.globalAlpha=1;let A=o.createRadialGradient(he/2,(k+w)/2,v*.12,he/2,(k+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)"),o.fillStyle=A,o.fillRect(y,k,v,x),o.restore();let E=3,W=w-x*.08;for(let H=0;H<E;H++){let _=(H+1)/(E+1);Vo(o,y+v*(.24+_*.52),W,x*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:ce(c+20,.5,.7),rimStrength:.7})}o.fillStyle="#05070d",o.fillRect(y-v*.5,P,v*.5,w-P),o.fillRect(S,P,v*.5,w-P);let N=v*.05+2,Y=N*1.35;o.fillStyle="#03050a",o.beginPath(),o.moveTo(y,w),o.lineTo(y-N,w),o.lineTo(y-Y,P),o.lineTo(y+v*.012,P),o.closePath(),o.fill(),o.beginPath(),o.moveTo(S,w),o.lineTo(S+N,w),o.lineTo(S+Y,P),o.lineTo(S-v*.012,P),o.closePath(),o.fill(),o.fillRect(y-Y,P,v+Y*2,(w-P)*.13),o.fillStyle=`rgba(${u},0.12)`,o.fillRect(y-1.2,P,1.2,w-P),o.fillRect(S,P,1.2,w-P),o.fillStyle="#0b0f18",o.fillRect(y-N,w-x*.05,v+N*2,x*.05+2);let re=o.createLinearGradient(0,w-x*.05,0,w+x*.14);re.addColorStop(0,`rgba(255,206,140,${(.5*T).toFixed(3)})`),re.addColorStop(1,"rgba(255,206,140,0)"),o.fillStyle=re,o.fillRect(y-N,w-x*.05,v+N*2,x*.22);for(let H=0;H<3;H++){let _=(H+1)/4,V=y+v*_,oe=Zt(Math.min(Je-1,f+20));on(o,V,oe,V+(l()-.5)*v*.14,w,3,v*.09,u,.17*T),zo(o,V,oe,1.8,u)}o.fillStyle=`rgba(${u},0.75)`;for(let H=0;H<8;H++)o.beginPath(),o.arc((H+.5)/8*he,Zt(Je-4-H%2*3),2.2,0,B),o.fill();o.fillStyle="rgba(10,13,20,0.9)",o.fillRect(0,vt-26,he,26),o.fillStyle="rgba(30,37,54,0.9)";for(let H=0;H<9;H++){let _=H*(he/9)+he/18;o.beginPath(),o.ellipse(_,vt-22,he/9*.4,15,0,Math.PI,0,!0),o.fill()}return{url:n.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var Fh=new Set(["en"]),rn=new Map;async function Jg(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await Kr(`i18n/${t}.mjs`)).default??null;let{LOADERS:e}=await import("./localeLoaders-STMEO2AW.js"),i=e[t];return i?await i():null}async function aI(t,e){let i=ra(t,e);if(i==="en"||Fh.has(i))return ct(i),i;if(!oa.includes(i))return ct("en"),"en";try{let n=rn.get(i);n||(n=Jg(i),rn.set(i,n));let o=await n;return rn.delete(i),o?(ct(i,o),Fh.add(i),i):(ct("en"),"en")}catch{return rn.delete(i),ct("en"),"en"}}export{nb as ACCESSIBILITY_RING_COLOR,Xo as ACCESSIBILITY_TYPES,Qb as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,Zb as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,db as BOOTH_TYPES,tb as CHART_STORAGE_KEY,Ny as CURRENCY_CHOICES,Oy as DEFAULT_CURRENCY,fb as DEFAULT_EVENT_INVENTORY_LIMIT,nT as EMPTY_AVAILABILITY_REFRESH,yb as EVENT_CONFIGURATION_EXPORT_SCHEMA,bb as EVENT_CONFIGURATION_SCHEMA,Yb as FLOOR_COVER_LIMIT,zb as FLOOR_STACK_GAP_RATIO,qb as FLOOR_STACK_MIN_SURFACE_PX,Jb as GA_UNIT_LABEL_PREFIX,iT as HOLD_CLOCK_SKEW_MS,Cn as LABEL_FADE_MS,lb as LABEL_STYLE_MAX_SIZE,ab as LABEL_STYLE_MIN_SIZE,mb as LARGE_VENUE_INVENTORY_MODULE,yy as LEGIBILITY_HYSTERESIS_PX,Ub as LEVEL_CONTEXT_PREFIX,Uy as LOCALE_NAMES,pb as MAX_EVENT_INVENTORY,ty as MAX_GA_CAPACITY,ry as MAX_ONE_PARTY_GUESTS,li as MIN_POINTER_TARGET_PX,sy as ONE_PARTY_LIMIT_MESSAGE,Th as PickerController,Ee as PickerSelectionError,gy as RENDERED_QUALITY_REPORT_VERSION,cb as ROW_AISLE_SEATS,rb as SEAT_COMMERCIAL_MARKS,dy as SEAT_TYPE_ICON_BODY,mn as SEAT_TYPE_ICON_VIEWBOX,eb as STAGE_LABEL_STYLE_MAX_SIZE,Iu as SUPPORTED_LOCALES,hb as SURROUNDINGS_SHAPE_ROLES,Eo as SeatmapRenderer,Pb as TABLE_SEAT_OFFSET,Tb as TIER_HEIGHT_M,oa as TRANSLATED_LOCALES,ur as UNGROUPED_ID,Jd as accessNeedsFor,cy as accessibilityLabelKey,ib as accessibilityMeta,ob as accessibilityRingColor,ti as allObjects,gr as applyHidden,wg as applyOrganizerSeatGlyph,Bo as asPickerSalesState,ih as attachVisibilityCatchUp,jb as automaticRoundTableRadius,xb as canTransitionEventConfiguration,wb as canonicalEventConfigurationJson,ir as chartBounds,Hd as clearOrganizerSeatGlyph,rr as combinedFloorZoneId,Rt as compactRowLabel,mr as computeSections,py as computeSectionsPerFloor,Dd as createRenderer,Xr as crossesThreshold,Cu as currencyExponent,Wy as currencySymbol,tt as effectiveFloorOverview,gb as eventInventoryLimitFor,Db as expandBooth,He as expandChart,Ab as expandRow,Eb as expandRowSlots,Ob as expandTable,_b as expandTableSlots,Wb as floorObjects,Kb as floorStackPlacements,ei as floorsOf,Jy as formatDate,Gy as formatMinor,Ue as formatMoney,Tu as fromMinorUnits,Ct as gaAreasOf,un as gaBoxBounds,hn as gaBoxMode,oy as gaInventorySegments,iy as gaUnitLabel,ay as gaUnitLabels,pn as gaUnitLabelsForModel,Lt as gaWheelchairPlaceCount,fn as gaWheelchairUnitLabels,iI as generateSeatPanorama,nI as generateSeatThumb,$y as getLocale,ly as growJoinedGAInventory,my as hiddenObjectIds,Ig as holdHasLapsed,rT as holdRecoveryShape,In as hysteresisScale,cr as initialFloorMode,kb as inspectEventConfigurationCompatibility,by as inspectRenderedQualityEvidence,ey as isGaUnitLabel,Zy as isLocaleLoaded,Nd as isOrganizerGlyphPainted,fy as isSectionHidden,ub as layerOf,ar as layoutCombinedFloorPlan,sr as layoutFloorStack,lr as levelContextOutlines,aI as loadLocale,qy as localeDirection,$b as mainFloorId,Cb as migrateLegacyEventConfigurations,Hy as numberLocale,Hb as objectCenter,Qy as onLocaleChange,Gb as owningSectionForObject,vb as parseEventConfigurationExport,Sb as parseEventConfigurationVersion,jt as pointInPolygon,te as pointInPolygonWithHoles,Nb as pointOnPolygonBoundary,Jt as polygonLabelPoint,eh as reconcileAvailability,oT as refreshChangedSomething,Tn as renderedPx,Dy as resolveCurrency,Lb as resolveEventConfigurationRollback,ra as resolveLocale,Mb as rowInventoryCount,Rb as rowSeatPositions,sb as seatCommercialMeta,dr as seatNoteRowModel,hr as seatTypeIconBody,hy as seatTypeIconSvg,it as sectionEntrancesById,Ib as sectionGeometry,uy as sectionIdentitiesById,pr as sectionLabelsById,fr as sectionOwnersByObject,ct as setLocale,na as setMoneyLocale,jy as setStringOverrides,th as shouldWaitForHoldExpiry,tr as stackFloors,Xb as suggestedFloorOverview,F as t,aa as tCount,Bb as tableInventoryCount,Fb as tableSeatCountsBySide,Vb as translateObject,er as usableHoles,ny as validGAInventorySegments,Sy as zoomTowardPoint};
|