@seatlayer/core 0.88.0 → 0.88.1

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.
Files changed (41) hide show
  1. package/dist/{ar-M4J6FMBS.js → ar-4SZT3THP.js} +1 -1
  2. package/dist/{be-7LLBCORG.js → be-6TW5GRGS.js} +1 -1
  3. package/dist/{bg-OSQA2I5V.js → bg-P7K6SESD.js} +1 -1
  4. package/dist/{ca-PDMTUK73.js → ca-E6R73FI4.js} +1 -1
  5. package/dist/{cs-O56YK3FJ.js → cs-3JAN3UIR.js} +1 -1
  6. package/dist/{cy-MIKYAZZ3.js → cy-4G5GKLQ2.js} +1 -1
  7. package/dist/{da-VUTTWBSM.js → da-7HO2Z7S3.js} +1 -1
  8. package/dist/{de-EOFVEAS6.js → de-NUKO6ZXA.js} +1 -1
  9. package/dist/{el-KEJC46AX.js → el-H55AXK2J.js} +1 -1
  10. package/dist/{es-3YOTG2P7.js → es-QSTKSWCW.js} +1 -1
  11. package/dist/{et-MGD4D2J5.js → et-5PPWOPTR.js} +1 -1
  12. package/dist/{fa-ROAPRPUJ.js → fa-OLG2YL4K.js} +1 -1
  13. package/dist/{fi-UNQJPG3S.js → fi-PAV5SN5D.js} +1 -1
  14. package/dist/{fr-WAXC5IQR.js → fr-UZCQILN3.js} +1 -1
  15. package/dist/{he-7HKZNP4G.js → he-RJCSPJ6G.js} +1 -1
  16. package/dist/{hr-L3PXRPIH.js → hr-PAOMST2Q.js} +1 -1
  17. package/dist/{hu-7GV2Q5RY.js → hu-4Z36Q2UK.js} +1 -1
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/{it-AENJ74J3.js → it-QQZIYWUZ.js} +1 -1
  21. package/dist/{ja-OA37L5Y4.js → ja-IZR5KSXG.js} +1 -1
  22. package/dist/{ku-NDD6SXXQ.js → ku-VCCWSULB.js} +1 -1
  23. package/dist/localeLoaders-YBKNUI3J.js +1 -0
  24. package/dist/{lt-OKCXRYLH.js → lt-U5AHDGDJ.js} +1 -1
  25. package/dist/{lv-X3KIQS63.js → lv-WY22HKO4.js} +1 -1
  26. package/dist/{nl-EWJH4B2L.js → nl-MNIC4WUI.js} +1 -1
  27. package/dist/{no-DCUBIM6R.js → no-YFUAME7I.js} +1 -1
  28. package/dist/{pl-3BKTQ7PO.js → pl-2ETFV772.js} +1 -1
  29. package/dist/{pt-ZJETW6HS.js → pt-5CQK36EB.js} +1 -1
  30. package/dist/{ro-SLDMZD7M.js → ro-AANRNCTZ.js} +1 -1
  31. package/dist/{ru-G4DJI3BQ.js → ru-CTBOMCZ2.js} +1 -1
  32. package/dist/{sk-E2P5YQEI.js → sk-MJ4GVTMT.js} +1 -1
  33. package/dist/{sl-DDYI225R.js → sl-X7LAO2EK.js} +1 -1
  34. package/dist/{sr-P3TXIOLM.js → sr-J6QX5N7R.js} +1 -1
  35. package/dist/{sv-ZRNFDBAN.js → sv-G5NMSDZW.js} +1 -1
  36. package/dist/{tr-B4MF36GP.js → tr-QQPKF6XB.js} +1 -1
  37. package/dist/{uk-URI7EJV5.js → uk-XY7N2ZWK.js} +1 -1
  38. package/dist/{zh-Hans-77FXIBDN.js → zh-Hans-OEZKZLYA.js} +1 -1
  39. package/dist/{zh-Hant-UPIV62WV.js → zh-Hant-EJGZWB2N.js} +1 -1
  40. package/package.json +1 -1
  41. package/dist/localeLoaders-GISJKBJ2.js +0 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as Ji,c as eo,e as qn,f as ai,h as Zn,i as jn,l as Qn}from"./chunk-PI3UH2EN.js";import{a as jf,b as kn,c as Qf,d as Ln,e as xn,f as Jf,g as em,h as Cn,j as Hn,m as ni,o as Gn,p as ke,q as ue,r as Vn,s as Wn,t as ri,u as zn}from"./chunk-66Q5LOBH.js";import{a as mm,b as _n,c as gm}from"./chunk-GI7ZTQ7C.js";import{a as Yi,b as hm,c as Pn,d as um}from"./chunk-P4J57TK6.js";import{b as Jn}from"./chunk-FOYQOIWG.js";import{a as bt}from"./chunk-QJXSZT3H.js";import{a as tm,b as im,c as om}from"./chunk-WAGKI44J.js";import{A as he,B as ti,a as we,b as An,c as De,d as jt,e as Qt,f as Ne,g as Y,i as En,n as me,o as Re,r as Jt,s as yt,t as ei,v as Fn,w as Je,x as Zi,y as ji,z as J}from"./chunk-W53J4FJS.js";import{a as Kn,b as Xn,h as Yn,s as Un,t as $n}from"./chunk-TQN2VWQO.js";import{b as vn,c as wn,l as mt}from"./chunk-5BMXWOE7.js";import{a as nm,b as rm,c as sm,d as am,e as lm,f as $t,g as cm,h as gt,i as dm,j as In,k as qt,l as pm,m as fm,n as Tn}from"./chunk-AHPF5SD6.js";import{b as Bn,e as Qi,i as si}from"./chunk-R7TV7RYQ.js";import{a as mf,b as gf,c as Kt,d as yf,e as bf,f as Sf,g as vf,h as wf,i as kf,j as Lf,k as xf,l as Cf}from"./chunk-4I2VWFJY.js";import{b as ii,f as On,h as oi,i as Dn,k as Nn}from"./chunk-UL5OIGIF.js";import{$ as Bf,Aa as zf,Ba as Kf,Ca as Xf,Da as Yf,E as hn,Ea as j,Fa as Yt,G as un,Ga as Uf,Ha as $f,I as K,Ia as Ut,Ja as qf,Ka as yn,La as Zf,Ma as bn,Na as Oe,Oa as Sn,Z as pn,_ as Qe,d as Pf,e as If,f as Tf,g as Mf,h as Rf,ha as re,i as Af,ia as fn,j as Ef,ja as Xt,k as Ff,l as _f,pa as mn,ra as gn,ta as Of,ua as Df,va as Nf,wa as Hf,xa as Gf,ya as Vf,za as Wf}from"./chunk-E7TOTX6I.js";import"./chunk-5ITK5236.js";import{C as D,c as Ui,h as $i,m as qi,o as Mn,t as X,u as de,v as ve,w as Q,x as Zt,z as Rn}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var dd=new Map(Kt.map(t=>[t.key,t.label]));function hd(t){return`picker.access.${t}`}function er(t){let e=[],i=t.wheelchairSpaceType;for(let r of t.accessibility??[]){if(r==="wheelchair"&&i)continue;let s=dd.get(r);s&&e.push({key:`access:${r}`,icon:r,titleKey:hd(r),titleFallback:s,tone:"access"})}i==="no-seat"?e.push({key:"wheelchair:no-seat",icon:"wheelchair",titleKey:"picker.emptyWheelchairSpace",titleFallback:"Empty wheelchair space",tone:"access"}):i==="seat-present"&&e.push({key:"wheelchair:seat-present",icon:"wheelchair",titleKey:"picker.accessiblePhysicalSeat",titleFallback:"Accessible physical seat",tone:"access"});let o=t.commercial;o?.restrictedView&&e.push({key:"mark:restrictedView",icon:"restrictedView",titleKey:"picker.restrictedView",titleFallback:"Restricted view",tone:"warn"}),o?.obstructedView&&e.push({key:"mark:obstructedView",icon:"obstructedView",titleKey:"picker.obstructedView",titleFallback:"Obstructed view",tone:"warn"}),o?.premium&&e.push({key:"mark:premium",icon:"premium",titleKey:"picker.premiumSeat",titleFallback:"Premium seat",tone:"premium"});let n=o?.note?.trim();if(n){let r=e.find(s=>s.tone==="warn"||s.tone==="premium");r?r.note=n:e.push({key:"note",icon:"note",titleKey:"picker.organizerNote",titleFallback:"Organizer note",tone:"note",note:n})}return e}var Sm=1,to=90;function io(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function tr(t,e,i,o=1){if(!Number.isFinite(t))return i;let n=Math.max(0,o);return i?t>=e-n:t>=e+n}function oo(t,e,i,o=1){if(!Number.isFinite(t)||!(i>0))return t;let n=Math.max(0,o)/i;return e?t*(1+n):t*(1-n)}function vm(t){let{point:e,camera:i,scale:o,nextScale:n}=t;if(!Number.isFinite(o)||o<=0||!Number.isFinite(n))return{...i};let r=(e.x-i.x)/o,s=(e.y-i.y)/o;return{x:e.x-r*n,y:e.y-s*n}}import{Konva as _i}from"konva/lib/Core";import{Stage as _p}from"konva/lib/Stage";import{Layer as Qo}from"konva/lib/Layer";import{Group as Gt}from"konva/lib/Group";import{Circle as fc}from"konva/lib/shapes/Circle";import{Group as mo}from"konva/lib/Group";import{Circle as Ke}from"konva/lib/shapes/Circle";import{Line as go}from"konva/lib/shapes/Line";import{Rect as yo}from"konva/lib/shapes/Rect";import{Text as ws}from"konva/lib/shapes/Text";var pe=9,Ae=.9,te=.55*Ae,ee=Y/we,St=4,ge=14,ir=10;var or=14;var ye=.45*Ae,Le=.9*Ae,le=(ye+Le)/2,nr=Math.max(Ae*1.1,Le),Ee=8,rr=700,ie=2,vt=Y,ud=12,pd=12;function sr(t){return t<q?pd:ud}var li=.85,ar=Y,wt=64,He=.55*ye,lr=700,cr=120,dr=2500,ci=-11.5,kt=.58,hr=320,ur=420,pr=420,fr=1,Ge=1,mr=2,et=16,Fe=12,no=[.85,.72,.62],fd=10,md=9;function di(t){return t<q?md:fd}var hi=13,ui=12,gr=0,yr="700",br="600",Sr=8,vr=5,wr=10,kr=6,Lr=8,xr=.6,Cr=.6,Pr=.7,Ir=[0,18,-18,36,-36,54,-54],Ve="600",Tr="500",q=640,Mr=Ve,Rr="400",_e=0,Ar=14,Er=.34,Fr=.92,_r=7,Br=3;function pi(t){return Math.min(1,Math.max(Fe/et,t/900))}function tt(t,e){return Math.max(Fe,t*pi(e))}var gd=.5,yd=1.15,Or=2,Dr=3,Nr=22,bd=8,Sd=6;function Lt(t){return t<q?Sd:bd}var ro=.08;function so(t,e,i,o,n=gd,r=Fe){let s=t*pi(e),a=Math.max(r*(1+ro),s*n),l=o>0&&i>o?i/o:1,c=Math.max(a,s*yd);return Math.min(c,a*l)}var Hr=.1,xt=1.02;var Gr=1.25;function Vr(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var vd="#e5e7eb",wd="#c7cbd1",kd="#6b7280",Ld=["#6b7280","#5b6470","#4b5563","#374151"],xd=["#cbd5e1","#e2e8f0","#f8fafc"],Cd="#d1d5db",Pd="#b8bdc4",Id="#273142",Td="#526078",Md="#f1f5f9",Rd="#374151",Ad="#64748b",Ed="#111827",Wr="#6b7280",zr="#374151";var Kr="#4b5563",Xr=.4,xe=.16,Yr="rgba(244,246,248,0.06)",fi=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Ur(t,e,i){let o=new Map;for(let s of t){let a=e(s);!a||i(a)||o.set(a,(o.get(a)??0)+1)}let n=null,r=0;for(let[s,a]of o)(a>r||a===r&&n!=null&&s<n)&&(n=s,r=a);return n}function se(t){return X(t)?{sectionFill:vd,sectionStroke:wd,sectionInk:kd,focalFill:Cd,focalStroke:Pd}:{sectionFill:Id,sectionStroke:Td,sectionInk:Md,focalFill:Rd,focalStroke:Ad}}function ao(t,e){let i=t.sectionFill,o=X(i),n=o?de(i,.6):Rn(ve(i,.2),.85);switch(e){case"closed":return o?de(i,.4):ve(i,.12);case"sold-out":return n;case"nearly-gone":return Q(i,n,.4);default:return i}}var $r=.28,qr=.42,Fd=.55,_d=.7;function Zr(t,e,i){let o=se(t),n=ao(o,e);if(!i||e==="sold-out"||e==="closed")return{fill:n,stroke:o.sectionStroke};let r=X(t);return{fill:Q(n,i,r?qr:$r),stroke:D(i,r?_d:Fd)}}var Bd=.03;function jr(t,e){let i=se(t);return!["normal","nearly-gone","sold-out","closed"].map(n=>ao(i,n).toLowerCase()).includes(e.trim().toLowerCase())&&lo(t,e)}function lo(t,e){let i=Ui(e);if(!i)return!1;let o=se(t),n=Math.max($r,qr)+Bd;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=Ui(ao(o,r));return s?Math.max(Math.abs(s[0]-i[0]),Math.abs(s[1]-i[1]),Math.abs(s[2]-i[2]))/255<=n:!1})}var Od="#f8fafc",Dd="#f4f6fb",Nd="#111827",Hd=.72;function Qr(t){let e=X(t),i=e?Od:Ed,o=e?Nd:Dd,n=Q(o,i,1-Hd);return{plate:i,ink:o,subInk:qi(n,i)>=Mn?n:o}}function Jr(t,e,i,o){if(e)return e;let n=X(i)?xd:Ld;for(let r of[i,...n])if(qi(r,t)>=o)return r;return he(t,e,i,o)}function mi(t){return t?.35:.3}function is(t){if(t<=0||t>=1)return 1;let e=1.25-1;if(t<.45){let o=t/.45;return 1+e*(1-(1-o)**2)}let i=(t-.45)/(1-.45);return 1+e*Math.cos(i*Math.PI*1.5)*(1-i)**2}function co(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 os=700,Gd=2400,ho=12,ns=30,es=1,Vd=1.16,ts=.5,Wd=1;function uo(t){return t*.61803398875%1}function rs(t,e){let o=((t/Gd+e)%1+1)%1,n=(1-Math.cos(o*2*Math.PI))/2;return{scale:es+(Vd-es)*n,opacity:ts+(Wd-ts)*n}}var as;function ls(t){as=t}function zd(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var ss=new Map;function Kd(t,e){let i=t??as,o=`${i??""}|${JSON.stringify(e)}`,n=ss.get(o);return n||(n=new Intl.DateTimeFormat(i,e),ss.set(o,n)),n}var Xd={dateStyle:"medium",timeStyle:"short"};function cs(t,e={}){let{locale:i,...o}=e,n=zd(t);if(!Number.isFinite(n))return"";let r=Object.keys(o).length?o:Xd;return Kd(i,r).format(n)}var Mm="USD",Rm=["USD","EUR","GBP","CAD","AUD","INR","AED","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL"],hs;function us(t){hs=t}var ds=new Map;function gi(t,e,i,o){let n=o??hs,r=`${n??""}|${t}|${e??"auto"}|${i??"auto"}`,s=ds.get(r);return s||(s=new Intl.NumberFormat(n,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),ds.set(r,s)),s}function We(t,e="USD",i,o){if(typeof i=="object"){let r=i;try{return gi(e,r.minimumFractionDigits,r.maximumFractionDigits,r.locale).format(t)}catch(s){if(r.fallback)return r.fallback(t,e);throw s}}let n=i??(Number.isInteger(t)?0:void 0);return gi(e,n,n,o).format(t)}function Yd(t="USD"){try{return gi(t,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function Ud(t,e="USD"){return t/10**Yd(e)}function Am(t,e="USD",i){return We(Ud(t,e),e,void 0,i)}function Em(t="USD"){return gi(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Ct={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired \u2014 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 \u2014 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 \u2014 consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.beaconAria":"Go to your {seats} in {name}","map.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview \u2014 groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks \u2014 sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats \u2014 blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.seatsLeftShort":"{count} left","picker.overview":"Venue","picker.entrance":"Entrance","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","picker.viewSeats":"View seats","picker.tapSeatHint":"Tap any seat to check its view","picker.ticketTierFor":"Ticket tier for {label}","picker.viewFromSeat":"View from seat {label}","picker.real360":"REAL 360\xB0","picker.preview":"PREVIEW","picker.sightline":"\u2248 {m} m to stage","picker.panorama360":"360\xB0 venue photo","picker.illustrationCaption":"illustration \xB7 \u2248 {m} m from stage","picker.restrictedView":"Restricted view","picker.obstructedView":"Obstructed view","picker.premiumSeat":"Premium seat","picker.access.wheelchair":"Wheelchair space","picker.access.companion":"Companion seat","picker.access.semi-ambulatory":"Semi-ambulatory (limited mobility)","picker.access.designated-aisle":"Designated aisle / transfer seat","picker.access.step-free":"Step-free accessible seat","picker.access.hearing":"Assistive listening","picker.access.cart":"CART live-caption view","picker.access.sign-language":"Sign-language view","picker.access.low-vision":"Blind / low-vision viewing","picker.access.sensory-friendly":"Quiet / sensory-friendly seating","picker.access.plus-size":"Plus-size seat","picker.access.lift-armrest":"Lift-up armrest","picker.accessShort.wheelchair":"Wheelchair space","picker.accessShort.companion":"Companion seat","picker.accessShort.semi-ambulatory":"Limited mobility","picker.accessShort.designated-aisle":"Aisle / transfer","picker.accessShort.step-free":"Step-free","picker.accessShort.hearing":"Assistive listening","picker.accessShort.cart":"Live captions","picker.accessShort.sign-language":"Sign language","picker.accessShort.low-vision":"Low vision","picker.accessShort.sensory-friendly":"Sensory-friendly","picker.accessShort.plus-size":"Plus-size","picker.accessShort.lift-armrest":"Lift-up armrest","picker.organizerNote":"Organizer note","picker.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count} \u2014 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.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} \u2014 you won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types \u2014 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.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 \u2014 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 \u2014 please head to checkout now.","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 \u2014 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.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 \u2014 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.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.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 \u2014 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"};var $d=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hr","hu","it","ja","ku","lt","lv","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","uk","zh-Hans","zh-Hant"],Nm={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",hr:"Hrvatski",hu:"Magyar",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ku:"Kurd\xEE",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",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",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430","zh-Hans":"\u7B80\u4F53\u4E2D\u6587","zh-Hant":"\u7E41\u9AD4\u4E2D\u6587"},ps=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hr","hu","it","ja","ku","lt","lv","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","uk","zh-Hans","zh-Hant"],qd=new Set(["ar","fa","he"]),po={li:"lt",iw:"he",mo:"ro",sh:"sr",nb:"no",nn:"no",kmr:"ku",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"},fo=new Map($d.map(t=>[t.toLowerCase(),t]));function Zd(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=fo.get(e)??po[e];if(i)return i;let o=e.split("-");if(o.length>=2){let n=`${o[0]}-${o[1]}`,r=fo.get(n)??po[n];if(r)return r}return fo.get(o[0])??po[o[0]]}var ze={en:Ct},yi={},fe="en";function fs(t,e){let i=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let o of[t,e,...i]){if(!o)continue;let n=Zd(o);if(n)return n}return"en"}function Hm(){return fe}function Gm(t=fe){return qd.has(t)?"rtl":"ltr"}function Vm(t){return!!ze[t]}function it(t,e){e&&(ze[t]={...ze[t],...e}),fe=ze[t]?t:"en",us(fe),ls(fe),typeof document<"u"&&(document.documentElement.lang=fe)}function Wm(t){yi=t}var ms=/\{(\w+)\}/g;function B(t,e){let i=yi[t]??ze[fe]?.[t]??Ct[t]??t;return e?i.replace(ms,(o,n)=>String(e[n]??`{${n}}`)):i}function gs(t,e,i){let o=new Intl.PluralRules(fe).select(e);return(yi[`${t}.${o}`]??ze[fe]?.[`${t}.${o}`]??Ct[`${t}.${o}`]??yi[`${t}.other`]??ze[fe]?.[`${t}.other`]??Ct[`${t}.other`]??t).replace(ms,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function zm(t,e){return cs(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:fe})}function bs(t,e,i,o=!1){let n=t.displayLabel?.trim()||t.label;return o?{title:n,detail:B("map.statusTaken"),sellable:!1}:e==="booked"?{title:n,detail:B("map.statusTaken"),sellable:!1}:e==="held"?{title:n,detail:B("map.statusHeld"),sellable:!1}:{title:n,detail:i()??"",sellable:!0}}var ot=32,ys=70;function Ss(t,e){let i=ot+6,o=t.y-ys;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:o>=i?o:Math.min(t.y+ys,e.height-i)}}var ks=.8,eh=Math.hypot(.46,.36),th=.26,ih=1.6,oh=2*(1-eh),nh=220,rh=.08,bi=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,i,o){let n=o.get(e);if(o.delete(e),!i){this.retire(n);return}n?.destroy();let r=this.host,s=r.seat(e);if(!s)return;let a=r.seatShape(e)?.fill(),l=J(typeof a=="string"?a:"",r.selectionColor(),Je),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),h=r.seatRadius(),u=r.seatPoint(s),f=new mo({name:"selection-ring",x:u.x,y:u.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});if(r.viewMode()==="perspective"){let p=r.perspectiveSeatScale(e);f.scale({x:p,y:p})}f.setAttrs({seatId:e,ringColor:l});let m={name:"selection-halo",stroke:D(r.categoryColor(s.categoryKey),mi(X(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let p=h*1.2;f.add(new yo({...m,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 f.add(new Ke({...m,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let g={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(f.add(new yo({...g,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)f.add(new yo({...g,stroke:ji(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:ks}));else{let p=Math.max(0,d.width/2-14),y=-Math.max(0,d.height/2-14);f.add(new Ke({x:p,y,radius:10,fill:l,listening:!1})),f.add(new go({x:p,y,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:X(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else{let p=Math.max(1,h-1.25),y=Math.min(2.5,Math.max(1.8,h*.22));if(f.add(new Ke({...g,radius:p,strokeWidth:y})),c)f.add(new Ke({...g,stroke:ji(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:ks}));else{let b=Math.max(0,p-y/2),S=Math.min(Math.max(ih,b*th),b*oh);f.add(new go({points:[-b*.42,b*.02,-b*.1,b*.34,b*.46,-b*.36],stroke:"#ffffff",strokeWidth:S,lineCap:"round",lineJoin:"round",shadowColor:"#0b1220",shadowBlur:1.5,shadowOpacity:.55,listening:!1}))}}o.set(e,f),this.host.overlayLayer.add(f)}retire(e){let i=this.host;if(!e)return;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden){e.destroy();return}let o=performance.now(),n=r=>{if(i.isDestroyed()||!e.getLayer()){e.destroy();return}let s=Math.min(1,(r-o)/160);e.opacity(1-s),i.overlayLayer.batchDraw(),s<1?requestAnimationFrame(n):(e.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(n)}play(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden||!i.seat(e))return;this.emitPulse(e,!0);let o=this.echoTimers.get(e);o&&clearTimeout(o),this.echoTimers.set(e,setTimeout(()=>{this.echoTimers.delete(e),!(i.isDestroyed()||i.reducedMotion())&&(typeof document<"u"&&document.hidden||this.emitPulse(e,!1))},os))}emitPulse(e,i){let o=this.host,n=o.seat(e);if(!n)return;let r=o.seatRadius(),s=o.seatPoint(n);this.pulses.get(e)?.destroy();let a=new Ke({name:"selection-pulse",x:s.x,y:s.y,radius:r,stroke:o.categoryColor(n.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:co(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,a),this.pulseHome().add(a);let l=i&&!o.isCached()?o.seatShape(e):void 0,c=performance.now(),d=()=>{l?.scale({x:1,y:1}),a.destroy(),this.pulses.get(e)===a&&this.pulses.delete(e),o.overlayLayer.batchDraw(),l&&!o.isCached()&&o.seatLayer.batchDraw()},h=u=>{if(o.isDestroyed()){d();return}a.getLayer()||this.pulseHome().add(a);let f=u-c,m=co(f/420);if(a.radius(r*m.radiusScale),a.opacity(m.opacity),l){let g=is(f/320);l.scale({x:g,y:g})}o.overlayLayer.batchDraw(),l&&!o.isCached()&&o.seatLayer.batchDraw(),f<420?requestAnimationFrame(h):d()};queueMicrotask(()=>{o.isDestroyed()||typeof requestAnimationFrame!="function"||requestAnimationFrame(h)})}nudge(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||i.isCached()||typeof document<"u"&&document.hidden)return;let o=i.seatShape(e);if(!o)return;let n=performance.now(),r=()=>{o.scale({x:1,y:1}),i.seatLayer.batchDraw()},s=a=>{if(i.isDestroyed()||i.isCached()||!o.getLayer()){r();return}let l=a-n,c=Math.min(1,l/nh),d=1+rh*Math.sin(Math.PI*c);o.scale({x:d,y:d}),i.seatLayer.batchDraw(),c<1?requestAnimationFrame(s):r()};requestAnimationFrame(s)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new mo({name:"seat-pulses",listening:!1})),this.pulseGroup.getLayer()||this.host.overlayLayer.add(this.pulseGroup),this.host.overlayLayer.isCached()&&this.host.overlayLayer.clearCache(),this.pulseGroup.moveToTop(),this.pulseGroup}showLoupe(e){let i=this.host;if(i.isExportMode()||i.isDestroyed())return;let o=i.nearestSeat(e,ge),n=o?i.seat(o):void 0;if(!n){this.hideLoupe();return}let r=bs(n,i.seatStatus(n.id),()=>i.priceLabel(n),i.seatClosed(n.id)),s=Ss(e,{width:i.stage.width(),height:i.stage.height()}),a=1/(i.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=n.id,l.group.position(i.screenToWorld(s)),l.group.scale({x:a,y:a}),l.group.opacity(r.sellable?1:.75),l.group.visible(!0),l.disc.fill(i.categoryColor(n.categoryKey)),l.title.text(r.title),l.title.offsetX(l.title.width()/2),l.detail.text(r.detail),l.detail.offsetX(l.detail.width()/2),i.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,i=e.canvasBackground(),o=J(i,se(i).sectionInk),n=new mo({name:"touch-loupe",listening:!1,visible:!1});n.add(new go({points:[-7,ot-4,0,ot+12,7,ot-4],closed:!0,fill:i,stroke:D(o,.25),strokeWidth:1,listening:!1})),n.add(new Ke({radius:ot,fill:i,stroke:D(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new Ke({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new ws({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),a=new ws({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:D(o,.72),listening:!1,perfectDrawEnabled:!1});return n.add(r),n.add(s),n.add(a),e.overlayLayer.add(n),n.moveToTop(),this.loupe={group:n,title:s,detail:a,disc:r,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}destroy(){for(let e of this.echoTimers.values())clearTimeout(e);this.echoTimers.clear()}};import{Animation as sh}from"konva/lib/Animation";var ah=1e3/ns;function Ls(t){return t.findOne(".selection-halo")??null}var Si=class{constructor(e){this.animation=null;this.targets=[];this.startedAt=0;this.lastFrameAt=0;this.visibilityBound=!1;this.onVisibilityChange=()=>{this.refresh()};this.markers=new Map;this.beaconRings=[];this.host=e}sync(e){this.markers=e,this.refresh()}syncBeacons(e){this.beaconRings=e,this.refresh()}refresh(){let e=this.host,i=this.markers.size>0||this.beaconRings.length>0;if(i&&!e.isDestroyed()&&!e.reducedMotion()&&this.bindVisibility(),e.isDestroyed()||e.reducedMotion()||!this.pageVisible()||!i){this.stop(),this.rest(),(!i||e.isDestroyed()||e.reducedMotion())&&this.unbindVisibility();return}let o=[],n=0;for(let[s,a]of this.markers){let l=Ls(a);if(l){if(this.paintHalo(s,l),n>=ho){l.scale({x:1,y:1}),l.opacity(1);continue}o.push({node:l,phase:uo(n)}),n+=1}}let r=0;for(let s of this.beaconRings){if(r>=ho){s.scale({x:1,y:1}),s.opacity(1);continue}o.push({node:s,phase:uo(r)}),r+=1}if(this.targets=o,!o.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new sh(()=>this.frame(),e.overlayLayer),this.animation.start())}stop(){this.targets=[],this.animation&&(this.animation.stop(),this.animation=null)}destroy(){this.stop(),this.markers=new Map,this.beaconRings=[],this.unbindVisibility()}isRunning(){return!!this.animation?.isRunning()}paintHalo(e,i){let o=this.host,n=mi(X(o.canvasBackground())),r=o.seatCategoryKey(e),s=o.isOwnedHold(e)?Q(o.selectionColor(),o.canvasBackground(),.55):r?o.categoryColor(r):o.selectionColor();i.stroke(D(s,n))}rest(){let e=!1;for(let[i,o]of this.markers){let n=Ls(o);n&&(this.paintHalo(i,n),n.scale({x:1,y:1}),n.opacity(1),e=!0)}for(let i of this.beaconRings)i.scale({x:1,y:1}),i.opacity(1),e=!0;e&&!this.host.isDestroyed()&&this.host.overlayLayer.batchDraw()}frame(){if(this.host.isDestroyed()||!this.targets.length)return this.stop(),!1;let i=performance.now();if(i-this.lastFrameAt<ah)return!1;this.lastFrameAt=i;let o=i-this.startedAt;for(let n of this.targets){let{scale:r,opacity:s}=rs(o,n.phase);n.node.scale({x:r,y:r}),n.node.opacity(s)}return!0}pageVisible(){return typeof document>"u"?!0:document.visibilityState==="visible"}bindVisibility(){this.visibilityBound||typeof document>"u"||(document.addEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!0)}unbindVisibility(){!this.visibilityBound||typeof document>"u"||(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!1)}};import{Group as lh}from"konva/lib/Group";import{Circle as bo}from"konva/lib/shapes/Circle";import{Text as ch}from"konva/lib/shapes/Text";var xs=28,dh=12,hh="800",uh=44,Cs=1.6,Ps=1.95;function Is(t){if(t.rung==="seats")return[];let e=new Map,i=new Map,o=new Map(t.zones.map(n=>[n.id,n.name]));for(let n of t.sections){let r=t.ownedSeatIds(n);if(!r.length)continue;let s=t.rung==="zones"&&n.zone!=null&&o.has(n.zone),a=s?n.zone:n.logicalId,l=e.get(a);if(l){l.count+=r.length,r.length>(i.get(a)??0)&&(i.set(a,r.length),l.seatId=r[0],l.anchor=t.sectionAnchor(n),l.toward=t.sectionCentre(n));continue}i.set(a,r.length),e.set(a,{id:a,kind:s?"zone":"section",name:s?o.get(n.zone):t.sectionName(n),count:r.length,seatId:r[0],anchor:t.sectionAnchor(n),toward:t.sectionCentre(n)})}return[...e.values()]}function ph(t,e){return B("map.beaconAria",{seats:gs("picker.seatCount",t),name:e})}function fh(t,e){let i=e*Ps,o=t.toward.x-t.anchor.x,n=t.toward.y-t.anchor.y,r=Math.hypot(o,n);return r<1e-6?{x:t.anchor.x,y:t.anchor.y-i}:{x:t.anchor.x+o/r*i,y:t.anchor.y+n/r*i}}var mh="selection-beacon-ring",vi=class{constructor(e){this.group=null;this.buttons=[];this.centres=[];this.rings=[];this.targets=[];this.signature="";this.host=e}breathingRings(){return this.rings}current(){return this.targets}sync(e){let i=Math.max(this.host.stageScale(),1e-4),o=`${i.toFixed(4)}|${e.map(c=>`${c.id}:${c.count}:${c.seatId}`).join(",")}`;if(o===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=o,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let n=xs/2/i,r=Math.max(uh,Math.ceil(2*(n*Ps+n)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new lh({listening:!1,name:"selection-beacons"});for(let c of e){let d=fh(c,n);l.add(new bo({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:n*Cs,fill:D(s,.1),listening:!1,perfectDrawEnabled:!1}));let h=new bo({name:mh,x:c.anchor.x,y:c.anchor.y,radius:n*Cs,stroke:D(s,.55),strokeWidth:Math.max(1,n*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(h),l.add(new bo({name:"selection-beacon-disc",x:d.x,y:d.y,radius:n,fill:s,stroke:D(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let u=new ch({x:d.x,y:d.y,text:String(c.count),fontSize:dh/i,fontStyle:hh,fontFamily:this.host.labelFont(),fill:a,listening:!1,perfectDrawEnabled:!1});u.offsetX(u.width()/2),u.offsetY(u.height()/2),l.add(u),this.rings.push(h),this.centres.push(c.anchor),this.buttons.push(this.buildButton(c,c.anchor,r))}this.host.overlayLayer.add(l),l.moveToTop(),this.group=l,this.host.overlayLayer.batchDraw()}raise(){this.group?.moveToTop()}clear(){this.group?.destroy(),this.group=null,this.rings=[],this.targets=[],this.centres=[],this.signature="";for(let e of this.buttons)e.remove();this.buttons=[]}repositionButtons(){for(let e=0;e<this.buttons.length;e+=1){let i=this.buttons[e],o=this.host.worldToScreen(this.centres[e]),n=i.offsetWidth||parseFloat(i.style.width)||xs;i.style.left=`${o.x-n/2}px`,i.style.top=`${o.y-n/2}px`}}buildButton(e,i,o){let n=this.host.worldToScreen(i),r=document.createElement("button");return r.type="button",r.className="sl-beacon",r.dataset.beacon=e.id,r.setAttribute("aria-label",ph(e.count,e.name)),Object.assign(r.style,{position:"absolute",left:`${n.x-o/2}px`,top:`${n.y-o/2}px`,width:`${o}px`,height:`${o}px`,padding:"0",margin:"0",border:"none",borderRadius:"50%",background:"transparent",cursor:"pointer",touchAction:"manipulation",zIndex:"3"}),r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.host.activate(e)}),r.addEventListener("pointerdown",s=>s.stopPropagation()),this.host.container.appendChild(r),r}};function Pt(t,e,i){let o=t.width(),n=t.height(),r=1/0,s=1/0,a=-1/0,l=-1/0,c=o*2,d=n*2;for(let h of e){let u=h.getClientRect();if(!(!(u.width>1)||!(u.height>1))){if(u.x<-c||u.y<-d||u.x+u.width>o+c||u.y+u.height>n+d)return null;u.x<r&&(r=u.x),u.y<s&&(s=u.y),u.x+u.width>a&&(a=u.x+u.width),u.y+u.height>l&&(l=u.y+u.height)}}if(i&&i.width>=0&&i.height>=0){let h=t.scaleX(),u=i.x*h+t.x(),f=i.y*h+t.y();u<r&&(r=u),f<s&&(s=f),u+i.width*h>a&&(a=u+i.width*h),f+i.height*h>l&&(l=f+i.height*h)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var wi=8,gh=.02,Ts=1,Ms=.5;function Rs(t,e,i,o,n){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=Pt(t,e,n);if(!s)return 0;So(t,s,r);let a=Math.min((r.width-2*wi)/s.width,(r.height-2*wi)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>Ms?a:Math.min(a,yh(t.scaleX(),o));if(!(c>1+gh)&&!(l>Ms)||!(c>0)||c===1)return 1;let d=r.x+r.width/2,h=r.y+r.height/2;t.scale({x:t.scaleX()*c,y:t.scaleY()*c}),t.position({x:d+(t.x()-d)*c,y:h+(t.y()-h)*c});let u=Pt(t,e,n);return u&&So(t,u,r),c}function vo(t,e,i,o){let n=i??{x:0,y:0,width:t.width(),height:t.height()},r=Pt(t,e,o);return r?So(t,r,n):!1}function yh(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(Ts,e):Ts)/i}function So(t,e,i){let o=i.x+i.width/2-(e.x+e.width/2),n=i.y+i.height/2-(e.y+e.height/2);return o===0&&n===0?!1:(t.position({x:t.x()+o,y:t.y()+n}),!0)}function Xe(t){return`${t.x()},${t.y()},${t.scaleX()}`}import{Group as bh}from"konva/lib/Group";import{Circle as As}from"konva/lib/shapes/Circle";import{Line as Sh}from"konva/lib/shapes/Line";import{Text as vh}from"konva/lib/shapes/Text";var wh=6;function wo(t){return X(t)?"#0b1220":"#ffffff"}function Es(t){let{points:e}=t;if(!e.length)return null;let i=t.categoryColor??"#6e7bff",o=0,n=0;for(let r of e)o+=r.x,n+=r.y;return{count:e.length,centroid:{x:o/e.length,y:n/e.length},fill:i,ink:wo(i)}}var ki=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let i of this.host.sections()){if(i.logicalId!==e&&i.id!==e)continue;let o=Es({points:this.host.ownedPoints(i),categoryColor:null});if(o)return o.centroid}return null}badgeAt(e){for(let i of this.badges)if(Math.hypot(e.x-i.centre.x,e.y-i.centre.y)<=i.radius)return i.id;return null}sync(e,i="seats"){if(this.group?.destroy(),this.group=null,this.badges=[],e>=Le){this.host.overlayLayer.batchDraw();return}let o=Math.max(this.host.stageScale(),1e-4),n=new bh({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=Es({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(wh/2/o,1);for(let g of a)n.add(new As({name:"owned-seat-dot",x:g.x,y:g.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(g=>g.logicalId===s.logicalId).reduce((g,p)=>g+this.host.ownedPoints(p).length,0),h=this.host.labelAnchor(s),u=11/o,f={x:h.x,y:h.y-u*2.1};n.add(new As({name:"owned-section-badge",x:f.x,y:f.y,radius:u,fill:l.fill,stroke:D(l.ink,.35),strokeWidth:1/o,listening:!1,perfectDrawEnabled:!1})),n.add(new Sh({x:f.x-u*.62,y:f.y,points:[-u*.22,0,-u*.02,u*.2,u*.34,-u*.26],stroke:l.ink,strokeWidth:Math.max(.6,u*.16),lineCap:"round",lineJoin:"round",listening:!1}));let m=new vh({x:f.x+u*.12,y:f.y-u*.5,text:String(d),fontSize:u,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});n.add(m),this.badges.push({id:s.logicalId,centre:f,radius:u*1.8})}if(!n.hasChildren()){n.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(n),n.moveToTop(),this.group=n,this.host.overlayLayer.batchDraw()}};import{Text as kh}from"konva/lib/shapes/Text";var Lh=4;function It(t){return X(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function xh(t,e,i,o){let n=Math.max(0,Math.min(o,e/2,i/2));t.beginPath(),t.moveTo(n,0),t.arcTo(e,0,e,i,n),t.arcTo(e,i,0,i,n),t.arcTo(0,i,0,0,n),t.arcTo(0,0,e,0,n),t.closePath()}function Fs(t,e){t.padding(Lh),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(o){let n=this.width(),r=this.height();o.save(),xh(o,n,r,Math.min(r/2,8)),o.setAttr("fillStyle",e.plate),o.fill(),o.setAttr("strokeStyle",e.stroke),o.setAttr("lineWidth",1),o.stroke(),o.restore(),kh.prototype._sceneFunc.call(this,o)})}function _s(t){return t?"seat":"section"}function Bs(t){let e=new Set,i=0;for(let n of t.memberIds){let r=t.categoryKey(n);r&&t.categorySellable(r)&&e.add(r),t.seatSellable(n)&&(i+=1)}let o=[];for(let n of t.categoryOrder)e.has(n)&&o.push({key:n,name:t.categoryLabel(n)||n,price:t.categoryPrice(n),color:t.categoryColor(n)});return o.length?i?{mode:"section",title:t.name,fields:[],rows:o,notes:[],note:null}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],note:B("map.soldOut")}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],note:B("picker.notForSale")}}function Os(t){let e=Ph(t.label,t.sectionLabel,t.rowLabel),i=[t.sectionLabel,t.rowLabel?B("picker.rowLabel",{label:t.rowLabel}):null,e?B("picker.seatLabel",{label:e}):null].filter(Boolean).join(" \xB7 ")||t.label,o=[t.sectionLabel?{caption:B("picker.section"),value:t.sectionLabel}:null,t.rowLabel?{caption:B("picker.row"),value:t.rowLabel}:null,e?{caption:B("picker.seat"),value:e}:null].filter(s=>s!=null),n={key:t.categoryKey,name:t.categoryLabel||t.categoryKey,price:t.categoryPrice,color:t.categoryColor},r=er(t).map(s=>{let a=B(s.titleKey);return{icon:s.icon,title:a===s.titleKey?s.titleFallback:a,tone:s.tone,...s.note?{note:s.note}:{}}});return{mode:"seat",title:i,fields:o,rows:[n],notes:r,note:Ch(t.status,t.closed)}}function Ch(t,e){return e||t==="not_for_sale"?B("picker.notForSale"):t==="booked"?B("map.statusTaken"):t==="held"?B("map.statusHeld"):null}function Ph(t,e,i){let o=t;for(let n of[e,i])!n||!o.startsWith(n)||o.length<=n.length||(o=o.slice(n.length).replace(/^[\s·\-/_]+/,""));return o}var Ih=16,Th=8;function Ds(t,e,i,o=Ih){let n=Th,r=t.x+o;r+e.width>i.width-n&&(r=t.x-o-e.width);let s=t.y+o;return s+e.height>i.height-n&&(s=t.y-o-e.height),{x:Math.max(n,Math.min(r,Math.max(n,i.width-n-e.width))),y:Math.max(n,Math.min(s,Math.max(n,i.height-n-e.height)))}}var Ns=16,Hs=14,Mh=10.5,Rh=14,Ah=12.5,Gs={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},Eh={warn:"#d8a425",premium:"#e8c15a"},Fh=.1,_h=.06,Li=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.noteEl=null;this.signature="";this.model=null;this.cursor=null;this.raf=0;this.attached=!1;this.lastUpdateMs=0;this.rowNames=new Map;this.rowNamesDoc=null;this.onPointerMove=e=>{if(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=()=>this.hide();this.onPointerDown=e=>{e.pointerType!=="mouse"&&this.hide()};this.onWheel=()=>{this.cursor&&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.noteEl=null,this.signature=""}hide(){this.cursor=null,this.signature="",this.model=null,this.root&&(this.root.style.display="none")}text(){let e=this.model;return!e||!this.root||this.root.style.display==="none"?"":[e.title,...e.rows.map(i=>[i.name,i.price].filter(Boolean).join(" ")),...e.notes.map(i=>[i.title,i.note].filter(Boolean).join(": ")),e.note].filter(Boolean).join(" | ")}schedule(){this.raf||(this.raf=requestAnimationFrame(()=>{this.raf=0,this.update()}))}update(){let e=performance.now(),i=this.cursor;if(!i)return;let o=this.host.hostCardOpen?.()?null:this.resolve(i);if(!o){this.hide(),this.lastUpdateMs=performance.now()-e;return}let n=this.ensureRoot(),r=`${o.mode}|${o.title}|${o.note??""}|${this.host.canvasBackground()}|`+o.rows.map(a=>`${a.key}:${a.price??""}:${a.color}`).join(",")+`|${o.notes.map(a=>`${a.icon}:${a.title}:${a.note??""}`).join(",")}`;r!==this.signature&&(this.signature=r,this.paint(o)),this.model=o,n.style.display="block";let s=Ds(i,{width:n.offsetWidth,height:n.offsetHeight},{width:this.host.container.clientWidth,height:this.host.container.clientHeight});n.style.left=`${s.x}px`,n.style.top=`${s.y}px`,this.lastUpdateMs=performance.now()-e}resolve(e){if(_s(this.host.seatsPickable())==="seat"){let n=this.host.hoveredSeatId()??this.host.nearestSeat(e),r=n?this.host.seat(n):void 0;if(!n||!r||this.host.seatStatus(n)!=="free"&&!this.host.seatOwnedHold?.(n)||this.host.seatClosed(n))return null;let l=this.host.seatSectionLabel(n);return Os({label:r.displayLabel?.trim()||r.label,rowLabel:this.rowName(r,l),sectionLabel:l,categoryKey:r.categoryKey,categoryLabel:this.host.categoryLabel(r.categoryKey),categoryPrice:this.host.categoryPrice(r.categoryKey),categoryColor:this.host.categoryColor(r.categoryKey),status:this.host.seatStatus(n),closed:this.host.seatClosed(n),...r.accessibility?.length?{accessibility:r.accessibility}:{},...r.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{},...r.commercial?{commercial:r.commercial}:{}})}let i=this.host.sectionAt(e),o=i?this.host.sectionLabel(i):null;return!i||o==null||this.host.sectionInteractive?.(i)===!1?null:Bs({name:o||i,memberIds:this.host.sectionMembers(i),categoryOrder:this.host.categoryOrder(),categoryKey:n=>this.host.seat(n)?.categoryKey??null,categoryLabel:n=>this.host.categoryLabel(n),categoryPrice:n=>this.host.categoryPrice(n),categoryColor:n=>this.host.categoryColor(n),categorySellable:n=>this.host.categorySellable(n),seatSellable:n=>this.host.seatSellable(n)})}rowName(e,i){let o=this.host.chartDoc();if(!o)return null;if(this.rowNamesDoc!==o){this.rowNamesDoc=o,this.rowNames.clear();for(let r of o.objects){if(r.type!=="row")continue;let s=r.segmentedRow?.displayLabel??r.displayLabel??r.label;s&&(this.rowNames.set(r.id,s),r.segmentedRow&&this.rowNames.set(r.segmentedRow.groupId,s))}}let n=this.rowNames.get(e.logicalRowId??e.rowId)??this.rowNames.get(e.rowId);return n?bt(n,i??void 0)||n:null}ensureRoot(){if(this.root)return this.root;let e=It(this.host.canvasBackground()),i=document.createElement("div");i.className="sl-hover-card",i.setAttribute("aria-hidden","true"),Object.assign(i.style,{position:"absolute",left:"0",top:"0",display:"none",pointerEvents:"none",boxSizing:"border-box",minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",background:e.plate,border:`1px solid ${e.stroke}`,boxShadow:"0 6px 20px rgba(2,6,23,0.22)",fontFamily:this.host.labelFont(),lineHeight:"1.35",zIndex:"2"});let o=document.createElement("div");Object.assign(o.style,{fontSize:`${Ns}px`,fontWeight:"700",padding:"10px 15px 9px",textAlign:"center",color:J(e.plate,"#0b1220")});let n=document.createElement("div");Object.assign(n.style,{display:"flex",flexDirection:"column",gap:"0"});let r=document.createElement("div");Object.assign(r.style,{display:"none",flexDirection:"column",gap:"0"});let s=document.createElement("div");return Object.assign(s.style,{fontSize:`${Hs}px`,fontWeight:"600",padding:"0 15px 10px",textAlign:"center",opacity:"0.72",color:J(e.plate,"#0b1220")}),i.append(o,n,r,s),this.host.container.appendChild(i),this.root=i,this.titleEl=o,this.rowsEl=n,this.notesEl=r,this.noteEl=s,i}paint(e){let i=this.ensureRoot(),o=It(this.host.canvasBackground());i.style.background=o.plate,i.style.border=`1px solid ${o.stroke}`;let n=this.titleEl,r=this.rowsEl,s=this.notesEl,a=this.noteEl,l=J(o.plate,"#0b1220");if(n.replaceChildren(),n.style.color=l,n.style.paddingBottom=e.rows.length||e.note?"9px":"10px",e.fields.length){let c=e.fields[0]?.caption;n.style.display="flex",n.style.padding="0";for(let[d,h]of e.fields.entries()){let u=document.createElement("div");Object.assign(u.style,{flex:h.caption===c?"1 1 auto":"0 0 auto",minWidth:"0",padding:"9px 13px 10px",textAlign:"center",borderLeft:d?`1px solid ${o.stroke}`:"none"});let f=document.createElement("div");f.textContent=h.caption,Object.assign(f.style,{fontSize:`${Mh}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let m=document.createElement("div");m.textContent=h.value,Object.assign(m.style,{marginTop:"2px",fontSize:`${Ns}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),u.append(f,m),n.append(u)}}else n.style.display="block",n.style.padding="10px 15px 9px",n.textContent=e.title;r.replaceChildren();for(let c of e.rows){let d=document.createElement("div");Object.assign(d.style,{display:"flex",justifyContent:"space-between",gap:"16px",padding:"9px 15px",fontSize:`${Hs}px`,fontWeight:"700",background:c.color,color:Zi(c.color)});let h=document.createElement("span");h.textContent=c.name;let u=document.createElement("span");u.textContent=c.price??"",d.append(h,u),r.appendChild(d)}this.paintNotes(s,e,o,l),a.textContent=e.note??"",a.style.display=e.note?"block":"none",a.style.marginTop=e.note&&e.rows.length?"6px":"0",a.style.color=J(o.plate,"#0b1220")}paintNotes(e,i,o,n){if(e.replaceChildren(),!i.notes.length){e.style.display="none";return}e.style.display="flex";for(let[r,s]of i.notes.entries()){let a=Zi(o.plate)==="#ffffff"?Gs.onDark:Gs.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:n,c=s.tone==="warn"||s.tone==="premium"?Q(o.plate,Eh[s.tone],Fh):Q(o.plate,n,_h),d=document.createElement("div");Object.assign(d.style,{display:"flex",alignItems:"flex-start",gap:"9px",padding:"9px 15px",background:c,borderTop:r?`1px solid ${o.stroke}`:"none"});let h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("viewBox",`0 0 ${20} ${20}`),h.setAttribute("width","17"),h.setAttribute("height","17"),h.setAttribute("fill","none"),h.setAttribute("stroke",l),h.setAttribute("stroke-width","1.45"),h.setAttribute("stroke-linecap","round"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("aria-hidden","true"),h.innerHTML=Pn(s.icon),Object.assign(h.style,{flex:"none",marginTop:"1px"});let u=document.createElement("div");Object.assign(u.style,{display:"flex",flexDirection:"column",gap:"2px",minWidth:"0"});let f=document.createElement("div");if(f.textContent=s.title,Object.assign(f.style,{fontSize:`${Rh}px`,fontWeight:"750",color:s.tone==="access"?n:l}),u.appendChild(f),s.note){let m=document.createElement("div");m.textContent=s.note,Object.assign(m.style,{fontSize:`${Ah}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:n}),u.appendChild(m)}d.append(h,u),e.appendChild(d)}}};function z(t){let e=Bn(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 nt(t,e,i,o){let n=o*Math.PI/180,r=Math.cos(n),s=Math.sin(n);return[{x:-e/2,y:-i/2},{x:e/2,y:-i/2},{x:e/2,y:i/2},{x:-e/2,y:i/2}].map(a=>({x:t.x+a.x*r-a.y*s,y:t.y+a.x*s+a.y*r}))}function rt(t,e,i,o,n,r){let s=o*Math.PI/180,a=Math.cos(s),l=Math.sin(s);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let h=e*(d/6-.5),u=i*(c/4-.5),f={x:t.x+h*a-u*l,y:t.y+h*l+u*a};if(!j(f,n,r))return!1}return!0}function Vs(t,e,i){let o=z(t),n={x:o.x+o.width/2,y:o.y+o.height/2},r=j(n,t,e)?[n,i]:[i],s=[];for(let l=1;l<12;l+=1)for(let c=1;c<12;c+=1){let d={x:o.x+o.width*c/12,y:o.y+o.height*l/12};j(d,t,e)&&s.push(d)}let a=[t,...e];return[...r,...s.map(l=>({point:l,room:hn(l,a)})).sort((l,c)=>c.room-l.room).map(l=>l.point)].filter((l,c,d)=>c===d.findIndex(h=>Math.abs(h.x-l.x)<1e-6&&Math.abs(h.y-l.y)<1e-6))}function Ws(t,e){let{stageScale:i,stageX:o,stageY:n}=t;if(t.viewMode==="perspective"&&e.perspectiveAffine)return z(e.outline.map(s=>{let a=t.projectedSectionPoint(e,s);return{x:a.x*i+o,y:a.y*i+n}}));let r=e.liftWorld>0?t.isoLiftLocal(e.liftWorld):{x:0,y:0};return z(e.outline.map(s=>{let a={x:s.x+r.x,y:s.y+r.y},l=t.isoT===0?a:t.isoForward(a);return{x:l.x*i+o,y:l.y*i+n}}))}function Bh(t,e){let i=t.width*t.height;if(i<=0)return 0;let o=Math.max(0,Math.min(t.x+t.width,e.width)-Math.max(t.x,0)),n=Math.max(0,Math.min(t.y+t.height,e.height)-Math.max(t.y,0));return o*n/i}function zs(t){let{current:e,viewport:i}=t,o=new Map;for(let a of t.sections){let l=Bh(a.bounds,i)*a.members;l<=0||o.set(a.logicalId,(o.get(a.logicalId)??0)+l)}if(!o.size)return e;let n=null,r=0;for(let[a,l]of o)l>r&&(r=l,n=a);if(!n||n===e)return e;let s=e!=null?o.get(e)??0:0;return r>s*1.35?n:e}import{Text as Dh}from"konva/lib/shapes/Text";function Oh(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 Ye=class{constructor(){this.cells=new Map}insert(e){for(let i of this.keys(e)){let o=this.cells.get(i);o?o.push(e):this.cells.set(i,[e])}}collisionCount(e){let i=new Set,o=0;for(let n of this.keys(e))for(let r of this.cells.get(n)??[])i.has(r)||(i.add(r),Oh(e,r)&&o++);return o}keys(e){let i=Math.floor(e.x/wt),o=Math.floor((e.x+Math.max(0,e.width))/wt),n=Math.floor(e.y/wt),r=Math.floor((e.y+Math.max(0,e.height))/wt),s=[];for(let a=n;a<=r;a++)for(let l=i;l<=o;l++)s.push(`${l}:${a}`);return s}};function Ks(t,e){let i=t.sections.filter(m=>m.id===e||m.logicalId===e),o=i.map(m=>{if(t.viewMode==="perspective"&&m.perspectiveAffine)return z(m.outline.map(y=>t.projectedSectionPoint(m,y)));let g=m.liftWorld>0?t.isoLiftLocal(m.liftWorld):{x:0,y:0},p=m.outline.map(y=>{let b={x:y.x+g.x,y:y.y+g.y};return t.isoT===0?b:t.isoForward(b)});return z(p)});if(!o.length)return null;let n=Math.min(...o.map(m=>m.x)),r=Math.min(...o.map(m=>m.y)),s=Math.max(...o.map(m=>m.x+m.width)),a=Math.max(...o.map(m=>m.y+m.height)),l=new Set(i.flatMap(m=>m.memberIds));for(let m of l){let g=t.seatById.get(m);if(!g)continue;let p=t.renderedSeatPoint(g);n=Math.min(n,p.x-t.seatR),r=Math.min(r,p.y-t.seatR),s=Math.max(s,p.x+t.seatR),a=Math.max(a,p.y+t.seatR)}let c=m=>{[m.x,m.y,m.width,m.height].every(Number.isFinite)&&(n=Math.min(n,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 g={x:m.x+m.width/2,y:m.y+m.height/2};return i.some(p=>j(g,p.outline,p.holes))};for(let{node:m,backdrop:g}of t.freeTextById.values()){let p=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(p)&&(c(p),g&&c(g.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:m}of t.iconNodeById.values()){let g=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(g)&&c(g)}let h=new Ye;for(let{node:m}of t.freeTextById.values()){let g=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:g.x-ie,y:g.y-ie,width:g.width+ie*2,height:g.height+ie*2})}for(let m of t.rowLabelPlan){let g=(m.focusKeys??[]).some(S=>S===e||i.some(w=>S===w.id||S===w.logicalId)),p=new Dh({text:m.text,fontSize:m.fontSize,fontStyle:"700",fontFamily:t.labelFont(),rotation:m.rotation,listening:!1});p.offsetX(p.width()/2),p.offsetY(p.height()/2);let y=t.resolveAutomaticRowLabelPosition(p,m,h),b=t.rowLabelBox(p,y);g&&c(b),h.insert(b),p.destroy()}let u=Math.max(s-n,a-r),f=Math.max(t.seatR*2,Math.min(24,u*.025));return{x:n-f,y:r-f,width:Math.max(1,s-n+f*2),height:Math.max(1,a-r+f*2)}}import{Rect as Nh}from"konva/lib/shapes/Rect";import{Text as Xs}from"konva/lib/shapes/Text";var ko="\0";function Hh(t){let e=0;for(let i=0;i<t.length;i++){let o=t[i],n=t[(i+1)%t.length];e+=o.x*n.y-n.x*o.y}return Math.abs(e)/2}function Gh(t,e){let i=t.filter(f=>Number.isFinite(f.centroid.x)&&Number.isFinite(f.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let o=i.map(f=>({member:f,weight:Math.max(1,Hh(f.outline))})),n=o.reduce((f,m)=>f+m.weight,0),r=o.reduce((f,m)=>({x:f.x+m.member.centroid.x*m.weight/n,y:f.y+m.member.centroid.y*m.weight/n}),{x:0,y:0}),s={x:r.x-e.x,y:r.y-e.y},a=Math.hypot(s.x,s.y);if(!(a>1e-6))return null;let l={x:s.x/a,y:s.y/a},c=i.map(f=>{let m={x:f.centroid.x-e.x,y:f.centroid.y-e.y},g={x:f.centroid.x-r.x,y:f.centroid.y-r.y};return{member:f,depth:m.x*l.x+m.y*l.y,lateral:Math.abs(g.x*-l.y+g.y*l.x)}}).sort((f,m)=>m.depth-f.depth||f.member.id.localeCompare(m.member.id)),d=c[0].depth-c[c.length-1].depth,h=c[0].depth-d/3,u=c.filter(f=>f.depth>=h);return u.sort((f,m)=>f.lateral-m.lateral||m.depth-f.depth||f.member.id.localeCompare(m.member.id)),u[0].member}function Vh(t){let i=[...B("map.fromPrice",{price:ko}).toLocaleLowerCase()],o=i.findIndex(n=>n!==ko&&n.toLocaleUpperCase()!==n.toLocaleLowerCase());return o>=0&&(i[o]=i[o].toLocaleUpperCase()),i.join("").split(ko).join(t)}function Ys(t,e){if(!e.zones?.length||!t.sections.length)return;let i=Qr(t.canvasBackground),o=new Map;for(let n of t.sections)n.zone&&(o.get(n.zone)??o.set(n.zone,[]).get(n.zone)).push(n);for(let n of e.zones){let r=o.get(n.id);if(!r||!r.length)continue;let s=r[0];for(let p of r)p.centroid.y<s.centroid.y&&(s=p);t.derivedFloorGroups&&(s=Gh(r,n.focalPoint??e.focalPoint)??s);let a=s.centroid.x,l=s.centroid.y,c=1/0,d=-1/0;for(let p of r)for(let y of p.outline)y.x<c&&(c=y.x),y.x>d&&(d=y.x);let h=isFinite(c)&&d>c?d-c:0,u=1/0;for(let p of r)for(let y of p.memberIds){let b=t.seatById.get(y),S=b&&t.catPrice.get(b.categoryKey);typeof S=="number"&&S<u&&(u=S)}let f=new Nh({x:a,y:l,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:i.plate,stroke:D(n.color??s.outlineTint,xr),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(f);let m=new Xs({x:a,y:l,text:n.label,fontSize:hi,fontStyle:yr,letterSpacing:0,fontFamily:t.labelFont(),fill:i.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});m.offsetX(m.width()/2),m.offsetY(m.height()/2),t.bgLayer.add(m);let g=null;isFinite(u)&&(g=new Xs({x:a,y:l,text:Vh(We(u,t.currency)),fontSize:ui,fontStyle:br,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:n.id,anchor:{x:a,y:l},back:f,background:i.plate,name:n.label,spanWorld:h,label:m,sub:g})}}function Us(t,e){let i=t.zones.find(({back:d})=>{if(!d.visible()||d.opacity()<.5)return!1;let h=d.getClientRect();return e.x>=h.x&&e.x<=h.x+h.width&&e.y>=h.y&&e.y<=h.y+h.height});if(!i)return!1;let o=t.doc,n=o?.floorOverview==="combined"&&!o.zones?.length?o.floors?.find(d=>kn(d.id)===i.id):void 0;if(n)return t.enterFloor(n.id),!0;let r=t.sections.filter(d=>d.zone===i.id).flatMap(d=>d.outline);if(!r.length)return!1;let s=Math.min(...r.map(d=>d.x)),a=Math.max(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=Math.max(...r.map(d=>d.y));return t.frame({x:s,y:l,width:Math.max(1,a-s),height:Math.max(1,c-l)}),!0}import{Circle as $h}from"konva/lib/shapes/Circle";import{Line as qh}from"konva/lib/shapes/Line";import{Rect as Zh}from"konva/lib/shapes/Rect";import{Text as jh}from"konva/lib/shapes/Text";function Ce(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Pe(t,e){return Ce(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var $s=.35,qs=.7,Ue="#0b1220",st="#ffffff",Zs="#0b1220",js="#232c40",Qs="#8b93a7";function Lo(t,e,i="normal"){let o=t?"bold":i;return e?`italic ${o}`.trim():o}var xo="#f7f8fb";import{Shape as zh}from"konva/lib/Shape";import{Circle as Kh}from"konva/lib/shapes/Circle";import{Rect as Xh}from"konva/lib/shapes/Rect";var Wh={M:2,L:2,Q:4,C:6,Z:0},Co=new Map;function Po(t){let e=Co.get(t);if(e)return e;let i=oi(t);if(!i)return Co.set(t,[]),[];let o=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],n=[],r=0;for(;r<o.length;){let s=o[r++],a=Wh[s];if(a===void 0||r+a>o.length)throw new Error(`Invalid path data for seat glyph "${t}".`);let l=o.slice(r,r+a).map(Number);if(l.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${t}".`);r+=a,s==="M"||s==="L"?n.push({command:s,points:l}):s==="Q"?n.push({command:s,points:l}):s==="C"?n.push({command:s,points:l}):n.push({command:"Z",points:[]})}return Co.set(t,n),n}function Js(t,e,i,o=0,n=0){let r=Po(e),s=On(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=Dn(s,i);t.save(),t.translate(o,n),t.scale(a.scale,a.scale),t.translate(-a.centreX,-a.centreY);for(let l of r)l.command==="M"?t.moveTo(l.points[0],l.points[1]):l.command==="L"?t.lineTo(l.points[0],l.points[1]):l.command==="Q"?t.quadraticCurveTo(l.points[0],l.points[1],l.points[2],l.points[3]):l.command==="C"?t.bezierCurveTo(l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]):t.closePath();return t.restore(),!0}function ea(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var Tt=class extends zh{_sceneFunc(e){let i=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,n=Po(o),r=this.attrs.seatGlyphDetail,s;if(r===void 0){let a=this.getAbsoluteScale(),l=Math.max(Math.abs(a.x),Math.abs(a.y)),c=Number.isFinite(l)&&l>0?l:1;s=i*2*c>=16}else s=r;if(!n.length||!s){ea(e,i),e.fillStrokeShape(this);return}e.beginPath(),Js(e,o,i),e.fillStrokeShape(this)}_hitFunc(e){ea(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 Yh(t,e){return t==="circle"||!oi(t)?null:new Tt({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 ta(t){let{x:e,y:i,radius:o}=t;return t.wheelchairBay?new Xh({x:e,y:i,width:o*2,height:o*2,offsetX:o,offsetY:o,cornerRadius:2,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):Yh(t.glyph,{x:e,y:i,radius:o,detail:t.detail,fill:t.fill})??new Kh({x:e,y:i,radius:o,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Uh(t,e){return t*2*e>=16}function ia(t,e,i,o){let n=Uh(e,i);if(n===o||!t.length)return n;for(let r of t)r.setAttr("seatGlyphDetail",n);return n}function oa(t){let e=[...t.seats].sort((i,o)=>(t.perspectiveSeatDepth.get(o.id)??0)-(t.perspectiveSeatDepth.get(i.id)??0));for(let i of e){if(i.kind==="booth"){Qh(t,i);continue}let o=t.seatContainer(i.id),n=ta({x:i.x,y:i.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:Nn(i.glyph,t.catByKey.get(i.categoryKey)),wheelchairBay:i.wheelchairSpaceType==="no-seat"});if(n instanceof Tt&&t.glyphMarkers.push(n),n.setAttr("seatId",i.id),t.circleById.set(i.id,n),t.paintSeat(n,i.id),o.add(n),i.accessible){if(i.wheelchairSpaceType!=="no-seat"){let r=new $h({x:i.x,y:i.y,radius:t.seatR+1.5,stroke:yt(i.accessibility,{colorblind:t.colorblind,canvasBackground:t.canvasBackground}),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.accessRingById.set(i.id,r),o.add(r)}if(Jt(i.accessibility??[])){let r=t.buildAccessGlyph(i,typeof n.fill()=="string"?n.fill():"");t.accessGlyphById.set(i.id,r),o.add(r)}}}}function Qh(t,e){let i=t.seatContainer(e.id),o=t.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},n=e.x,r=e.y,s;o.points&&o.points.length>=3?(s=new qh({x:e.x,y:e.y,points:o.points.flatMap(l=>[l.x,l.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),n=e.x+o.points.reduce((l,c)=>l+c.x,0)/o.points.length,r=e.y+o.points.reduce((l,c)=>l+c.y,0)/o.points.length):s=new Zh({x:e.x,y:e.y,width:o.width,height:o.height,offsetX:o.width/2,offsetY:o.height/2,rotation:o.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s.setAttr("seatId",e.id),t.circleById.set(e.id,s),i.add(s);let a=new jh({x:n,y:r,text:e.displayLabel??e.label,fontSize:De,fontStyle:"600",fontFamily:t.labelFont(),fill:t.theme.seatLabelColor??Ue,listening:!1,perfectDrawEnabled:!1});a.offsetX(a.width()/2),a.offsetY(a.height()/2),a.visible(!1),t.setHasBoothText(),t.boothLabelById.set(e.id,a),i.add(a),t.paintSeat(s,e.id)}function na(t,e,i,o){let n=null,r=1/0,s=t.stage.scaleX()||1;for(let a of t.seats){if(!o?.includeUnavailable&&!t.selection.has(a.id)&&!t.isSelectable(a.id))continue;let l=t.worldToScreen(a),c=t.viewMode==="perspective"?t.perspectiveSeatScale.get(a.id)??1:1,d=t.seatR*s*c+i,h=Math.hypot(l.x-e.x,l.y-e.y);h<=d&&h<r&&(r=h,n=a.id)}return n}function ra(t){if(!t.objectFloor.size)return null;let e=t.stage.getPointerPosition();if(!e)return null;let i=t.screenToWorld(e),o=null,n=1/0;for(let r of t.seats){let s=t.renderedSeatPoint(r),a=s.x-i.x,l=s.y-i.y,c=a*a+l*l;c<n&&(n=c,o=r.rowId)}return o?t.objectFloor.get(o)??null:null}import{Circle as Su}from"konva/lib/shapes/Circle";import{Group as Pa}from"konva/lib/Group";import{Rect as vu}from"konva/lib/shapes/Rect";import{Text as wu}from"konva/lib/shapes/Text";var Ie=1.12;function at(t,e,i,o){if(e.width<=0||e.height<=0)return t.scaleX();let n=o??{x:0,y:0,width:t.width(),height:t.height()},r=Math.min(n.width/(e.width*Ie),n.height/(e.height*Ie));return K(r,i.min,i.max)}var Mt=.55;function Rt(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function Io(t){let{stage:e,box:i,bounds:o,viewport:n,centreScreen:r}=t,s=t.ratio??xt,a=e.scaleX(),l=at(e,i,o,n)/Math.max(a,1e-4);if(l>=s||l<=1/s)return!1;let c=r.x-(n.x+n.width/2),d=r.y-(n.y+n.height/2);return Math.hypot(c,d)<=Math.min(n.width,n.height)*.02}function sa(t,e,i,o){let n=K(e,o.min,o.max),r=t.scaleX();if(n===r)return!1;let s=(i.x-t.x())/r,a=(i.y-t.y())/r;return t.scale({x:n,y:n}),t.position({x:i.x-s*n,y:i.y-a*n}),!0}function aa(t,e,i,o,n,r){let s=n??{x:0,y:0,width:t.width(),height:t.height()},a=Math.min(s.width/(e.width*Ie),s.height/(e.height*Ie)),l=o??i.min,c=K(Math.max(a,l),i.min,Math.max(l,Rt(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 la(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function To(t,e){let i=null;for(let o of t){let n=e.get(o)?.logicalId;if(!n||i!=null&&i!==n)return null;i=n}return i}function ca(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var Jh=11;function eu(t){let e=tt(Jh,t),i=di(t),o=[];for(let n=Math.round(e);n>=i;n-=1)o.push(n);return o.length?o:[i]}var tu=4,iu=2;function ou(t){let e=t.trim();if(!e)return null;if(/^[a-z]{1,3}\d{1,4}[a-z]?$/i.test(e))return e;let i=e.match(/\d+/g);if(i?.length){let o=i[0];for(let n of i)n.length>=o.length&&(o=n);return o}return e.length<=4?e:null}function da(t,e,i){let o=t.numberLabel,n=ou(t.label);if(!n)return o.visible(!1),!1;o.text()!==n&&o.text(n),o.visible(!0),o.rotation(0);let r=tu/e;for(let s of eu(i)){o.fontSize(s/e),o.offsetX(o.width()/2),o.offsetY(o.height()/2);for(let a of[t.centroid,...t.labelAnchors])if(o.position(a),rt(a,o.width()+r,o.height()+r,0,t.outline,t.holes))return!0}return o.position(t.centroid),!1}function nu(t,e,i){let o=i({x:t.x(),y:t.y()}),n=t.width()*e,r=t.height()*e;return{x:o.x-n/2,y:o.y-r/2,w:n,h:r}}function ru(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 ha(t,e,i,o){let n=[];for(let r of e){if(r.label.opacity()<=.05)continue;let s=r.back.getAbsolutePosition(),a=r.back.width()*i,l=r.back.height()*i;n.push({x:s.x-a/2,y:s.y-l/2,w:a,h:l})}if(n.length)for(let r of t){if(r.numberLabel.opacity()<=.05)continue;let s=nu(r.numberLabel,i,o);for(let a of n)if(ru(s,a,iu)){r.numberLabel.opacity(0);break}}}function ua(t){let e=new Map;for(let i of t){if(i.numberLabel.opacity()<=.05)continue;let o=e.get(i.logicalId);o?o.push(i):e.set(i.logicalId,[i])}for(let i of e.values()){if(i.length<2)continue;let o=i[0];for(let n of i)n.labelArea>o.labelArea&&(o=n);for(let n of i)n!==o&&n.numberLabel.opacity(0)}}function ga(t,e){let i=t.sectionHeat.get(e.id)??t.sectionHeat.get(e.logicalId)??(e.zone?t.sectionHeat.get(e.zone):void 0);if(i==null||i<=0){e.outlinePoly.stroke(D(e.outlineTint,.5)),e.outlinePoly.fill(D(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=Q("#f4b740","#ef4444",i);e.outlinePoly.stroke(D(o,.72+i*.25)),e.outlinePoly.fill(D(o,.08+i*.13)),e.outlinePoly.strokeWidth(2+i*3.5),e.outlinePoly.shadowColor(o),e.outlinePoly.shadowBlur(4+i*12),e.outlinePoly.shadowOpacity(.25+i*.45)}function Ro(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function ya(t,e,i,o){if(!e)return 0;let n=0;for(let r of t){if(i(r)!=="free")continue;let s=o(r);s&&Ce(s,e)&&(n+=1)}return n}function su(t,e){return Ro(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Hr?"nearly-gone":"normal"}function ba(t,e){let i=su(t,e),o=t.accessFilterActive&&t.sectionAccessibleFree(e)<=0,n=Zr(t.canvasBackground,i,o?null:e.shellCategoryColor);e.shellFill=n.fill,e.shellStroke=n.stroke,e.blockPoly.fill(n.fill),e.blockPoly.stroke(n.stroke),e.subLabel.text(i==="sold-out"?B("map.soldOut"):B("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Sa(t,e){return Q(e,X(t)?"#ffffff":"#000000",Er)}function Ao(t,e,i=0){let o=Ar-i;return!e||t.length<=o?t:`${t.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function au(t,e){return va(t,e)!=null}function va(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function wa(t,e,i){let o=Ao(t.label,e,i?i.length+1:0);return i?[`${i} ${o}`,i]:[o]}function lu(t,e,i){let o=wa(t,e,i),n=(t.nameLabelBadgeOnly?o[1]:o[0])??o[0];t.nameLabel.text()!==n&&t.nameLabel.text(n),t.nameLabel.fontStyle(Rr),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*_e:0)}function cu(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}function ka(t,e){let i,o;t.reducedMotion?(i=e<=ye?1:0,o=e<=He?1:0):(i=K((Le-e)/(Le-ye),0,1),o=K((ye-e)/(ye-He),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,o=0);let n=!t.floorOverview&&!t.focusedSectionId&&e<te;n&&(i=1),t.zones.length||(o=0);let r=t.viewMode==="perspective"&&t.glideInProgress&&t.seatCount>2500;t.seatLayer.opacity(n||r?0:1-i);let s=t.stageScaleX,a=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>ro);a&&t.setLodScale(e);let l=t.focusedSectionId,c=t.stageWidth<q,d=c&&n&&t.zones.length===0,h=se(t.canvasBackground),u=K((i-.2)/.8,0,1),f=new Set;for(let g of t.sections){let p=t.hasFocusDimOverlay?1:l&&g.id!==l&&g.logicalId!==l&&g.zone!==l?xe:1,y=va(t,g);y&&g.zone&&f.add(g.zone);let b=Math.min(p,ca(g.memberCategoryKeys,t.categoryFilter)?xe:1,t.accessFilterActive&&!y?xe:1);g.outlinePoly.opacity(n?0:(1-i)*b),g.blockPoly.opacity(fr*i*b);let S=t.sectionIsOwned(g);g.blockPoly.stroke(S?t.selectionColor:g.shellStroke||h.sectionStroke),g.blockPoly.strokeWidth((S?mr:Ge)/Math.max(s,1e-4));let w=g.blockPoly.fill(),k=typeof w=="string"?w:g.baseFill,v=Jr(k,g.explicitInk,g.preferredInk,En);g.nameLabel.fill(v),g.subLabel.fill(v),lu(g,c,y),a&&(u>.01||g.externalLabel)&&uu(t,g,s,wa(g,c,y));let L=y?1:1-o;g.nameLabel.opacity(g.nameLabelFits?(g.externalLabel?1:u)*L*b:0),g.subLabel.opacity(0);let P=d&&!g.nameLabelFits;a&&(g.numberLabelFits=(o>.01||P)&&da(g,s,t.stageWidth)),g.numberLabelFits&&g.numberLabel.fill(he(k,g.explicitInk,g.preferredInk)),g.numberLabel.opacity(g.numberLabelFits?(P?u:o)*b:0)}let m=o*(1-t.isoT);for(let g of t.zones){let p=t.accessFilterActive&&!f.has(g.id)?xe:1,y=g.label.visible()?m*p:0;g.back.opacity(y),g.label.opacity(y),g.sub&&g.sub.opacity(pa(t,g)?0:y),a&&pu(t,g,s)}if(!t.glideInProgress&&(u>.01||m>.01)){hu(t,s,d),du(t.sections);for(let g of t.zones){let p=g.label.opacity();g.back.opacity(p),g.sub&&g.sub.opacity(pa(t,g)?0:p)}}(m>.01||d)&&(m>.01&&ha(t.sections,t.zones,s,t.worldToScreen),ua(t.sections));for(let g of t.sections)cu(g);t.bgLayer.batchDraw()}function pa(t,e){return t.stageWidth<q||!e.sub||!e.sub.visible()}function du(t){let e=new Map;for(let i of t)(e.get(i.logicalId)??e.set(i.logicalId,[]).get(i.logicalId)).push(i);for(let i of e.values()){if(i.length<2)continue;let o=i.filter(n=>n.nameLabel.opacity()>.05).sort((n,r)=>{let s=z(n.outline),a=z(r.outline);return a.width*a.height-s.width*s.height});for(let n of o.slice(1))n.nameLabel.opacity(0)}}function hu(t,e,i=!1){let n=[],r=c=>{let d=t.worldToScreen({x:c.x(),y:c.y()}),h=z(nt({x:0,y:0},c.width()*e,c.height()*e,c.rotation()));return{x:d.x-h.width/2,y:d.y-h.height/2,w:h.width,h:h.height}};for(let c of t.zones){if(c.label.opacity()<=.05)continue;let d=c.back.getAbsolutePosition(),h=c.back.width()*e,u=c.back.height()*e;n.push({node:c.label,tier:0,section:!1,zone:c,box:{x:d.x-h/2,y:d.y-u/2,w:h,h:u}})}for(let c of t.sections){if(c.nameLabel.opacity()>.05){let d=au(t,c)?-1:1;n.push({node:c.nameLabel,tier:d,section:!0,area:c.labelArea,box:r(c.nameLabel)})}i&&c.numberLabel.opacity()>.05&&n.push({node:c.numberLabel,tier:1,section:!1,area:c.labelArea,box:r(c.numberLabel)})}let s=t.landmarks.map(c=>{let d=t.worldToScreen({x:c.x,y:c.y}),h=t.worldToScreen({x:c.x+c.width,y:c.y+c.height});return{x:Math.min(d.x,h.x),y:Math.min(d.y,h.y),w:Math.abs(h.x-d.x),h:Math.abs(h.y-d.y)}});if(n.length<2&&!s.length)return;n.sort((c,d)=>c.tier-d.tier||(d.area??0)-(c.area??0)||c.box.y-d.box.y||c.box.x-d.box.x);let a=[...s],l=c=>a.some(d=>c.x<d.x+d.w+4&&d.x<c.x+c.w+4&&c.y<d.y+d.h+4&&d.y<c.y+c.h+4);for(let c of n){if(!l(c.box)){a.push(c.box);continue}let d=!1;if(c.zone)for(let h of Ir){if(h===0)continue;let u={...c.box,y:c.box.y+h};if(!l(u)){Mo(c.zone,0,h/e),a.push(u),d=!0;break}}if(c.section){let h=c.node.fontSize(),u=c.node.y(),f=c.node.letterSpacing()>0;for(let m of no){let g=h*m;if(g*e<Lt(t.stageWidth))break;Te(c.node,g,u),f&&(c.node.letterSpacing(c.node.fontSize()*_e),c.node.offsetX(c.node.width()/2));let p=r(c.node);if(!l(p)){a.push(p),d=!0;break}}d||(Te(c.node,h,u),f&&(c.node.letterSpacing(c.node.fontSize()*_e),c.node.offsetX(c.node.width()/2)))}d||c.node.opacity(0)}}function Te(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}function uu(t,e,i,o){e.subLabelFits=!1;let n=t.stageWidth<q,r=Lt(t.stageWidth),s=so(et*e.labelScale,t.stageWidth,i,t.fitScale,void 0,r);if(e.externalLabel){e.nameLabel.text(o[0]),e.nameLabel.rotation(e.externalLabel.rotation),Te(e.nameLabel,s/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[c,d]of o.entries()){e.nameLabel.text(d);let h=z(e.outline),u=h.height>h.width*Dr?[0,-90]:[0];for(let f of u)for(let m of e.labelAnchors)for(let g=s;g>=r;g-=1){e.nameLabel.rotation(f),Te(e.nameLabel,g/i,e.nameLabel.y()),n&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*_e),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(m);let p=Or/i;if(rt(m,e.nameLabel.width()+p,e.nameLabel.height()+p,f,e.outline,e.holes)){e.nameLabelFits=!0,e.nameLabelBadgeOnly=c>0;return}}}e.nameLabel.text(o[0]),e.nameLabelBadgeOnly=!1;let a=e.labelAnchors[0]??e.centroid;e.nameLabel.position(a),e.nameLabel.rotation(0),Te(e.nameLabel,r/i,a.y),n&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*_e),e.nameLabel.offsetX(e.nameLabel.width()/2));let l=z(e.outline);e.nameLabelFits=e.nameLabel.width()<=l.width&&e.nameLabel.height()<=l.height}function fa(t,e,i){let o=n=>(t.text(n),t.width());if(!(o(e)<=i)){for(let n=e.length-1;n>=1;n-=1)if(o(`${e.slice(0,n).trimEnd()}\u2026`)<=i)return;o("\u2026")}}function pu(t,e,i){let o=pi(t.stageWidth),n=t.stageWidth<q,r=e.sub!=null&&!n,s=(n?Sr:wr)*o/i,a=(n?vr:kr)*o/i,l=so(hi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Te(e.label,l/i,e.anchor.y),r&&(Te(e.sub,tt(ui,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*gr),e.sub.offsetX(e.sub.width()/2));let c=n?t.stageWidth*Cr/i-s*2:1/0,d=!n&&e.spanWorld>0?e.spanWorld*Pr-s*2:1/0,h=Math.min(c,d),u=()=>Math.max(e.label.width(),r?e.sub.width():0);if(r&&u()>h&&(r=!1),u()>h)for(let L of no){let P=Math.max(Fe,l*L);if(P>=e.label.fontSize()*i-.001||(Te(e.label,P/i,e.anchor.y),e.label.width()<=h))break}if(e.label.width()>h&&(fa(e.label,e.name,Math.max(h,1)),fu(e.label.text())<mu(e.name)&&fa(e.label,e.name,Math.max(c,1)),Te(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){ma(e);return}e.label.visible(!0),e.back.visible(!0);let f=r?3*o/i:0;e.label.x(e.anchor.x),r?e.sub.x(e.anchor.x):e.sub&&e.sub.opacity(0);let m=Math.max(e.label.width(),r?e.sub.width():0)+s*2,g=e.label.height()+(r?f+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(f+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+f)/2),e.back.position(e.anchor),e.back.size({width:m,height:g}),e.back.offset({x:m/2,y:g/2}),e.back.cornerRadius(Lr*o/i),e.back.strokeWidth(1/i);let p=e.back.getAbsolutePosition(),y=6,b=m*i;if(b>t.stageWidth-y*2){ma(e);return}let S=b/2,k=(K(p.x,y+S,t.stageWidth-y-S)-p.x)/i;Math.abs(k)>.001&&Mo(e,k,0);let v=62+g*i/2;p.y<v&&Mo(e,0,(v-p.y)/i)}function fu(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function mu(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function ma(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 Mo(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 gu(t,e){if(!t.length)return null;let i=1/0,o=1/0,n=-1/0,r=-1/0;for(let s of t)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(s.x<i&&(i=s.x),s.y<o&&(o=s.y),s.x>n&&(n=s.x),s.y>r&&(r=s.y));return!Number.isFinite(i)||!Number.isFinite(o)?null:{x:i-e,y:o-e,width:n-i+e*2,height:r-o+e*2}}function _o(t,e=0){let i=new Map;for(let n of t){let r=`${n.rowId}|${n.categoryKey}`,s=i.get(r);s||(s={categoryKey:n.categoryKey,points:[]},i.set(r,s)),s.points.push({x:n.x,y:n.y})}let o=[];for(let[n,r]of i){let s=gu(r.points,e);s&&o.push({id:n,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return o}function Eo(t,e){let i=Math.max(0,Math.max(t.x-(e.x+e.width),e.x-(t.x+t.width))),o=Math.max(0,Math.max(t.y-(e.y+e.height),e.y-(t.y+t.height)));return Math.hypot(i,o)}function Fo(t,e){let i=Math.min(t.x,e.x),o=Math.min(t.y,e.y);return{x:i,y:o,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-o}}function La(t){if(!t.length)return 0;let e=[...t].sort((o,n)=>o-n),i=Math.floor(e.length/2);return e.length%2?e[i]:(e[i-1]+e[i])/2}function yu(t){if(!t.length)return 0;let e=La(t.map(o=>Math.min(o.bounds.width,o.bounds.height)));if(t.length<2)return e;let i=[];for(let o=0;o<t.length;o+=1){let n=1/0;for(let r=0;r<t.length;r+=1)o!==r&&(n=Math.min(n,Eo(t[o].bounds,t[r].bounds)));Number.isFinite(n)&&i.push(n)}return La(i)+e}function Bo(t,e){if(!t.length)return[];let i=yu(t)*(e?.gapRows??2),o=e?.minRows??2,n=e?.minSeats??12,r=new Map;for(let a of t){let l=r.get(a.categoryKey);l?l.push(a):r.set(a.categoryKey,[a])}let s=[];for(let[a,l]of r){let c=[...l].sort((u,f)=>u.bounds.y-f.bounds.y||u.bounds.x-f.bounds.x||u.id.localeCompare(f.id)),d=[];for(let u of c){let f=d.find(m=>Eo(m.bounds,u.bounds)<=i);f?(f.bounds=Fo(f.bounds,u.bounds),f.rowIds.push(u.id),f.seatCount+=u.seatCount):d.push({categoryKey:a,bounds:{...u.bounds},rowIds:[u.id],seatCount:u.seatCount})}let h=!0;for(;h&&d.length>1;){h=!1;e:for(let u=0;u<d.length;u+=1)for(let f=u+1;f<d.length;f+=1)if(!(Eo(d[u].bounds,d[f].bounds)>i)){d[u].bounds=Fo(d[u].bounds,d[f].bounds),d[u].rowIds.push(...d[f].rowIds),d[u].seatCount+=d[f].seatCount,d.splice(f,1),h=!0;break e}}for(let u of d)u.rowIds.length<o&&u.seatCount<n||(u.rowIds.sort(),s.push(u))}return s.sort((a,l)=>a.bounds.y-l.bounds.y||a.bounds.x-l.bounds.x||a.categoryKey.localeCompare(l.categoryKey)),s}function xa(t){let e=null;for(let i of t)e=e?Fo(e,i.bounds):{...i.bounds};return e}function Ca(t,e){let i=null,o=1/0;for(let n of t){let{x:r,y:s,width:a,height:l}=n.bounds;if(e.x<r||e.x>r+a||e.y<s||e.y>s+l)continue;let c=a*l;c<o&&(i=n,o=c)}return i}function Ta(t){return t*.3}function Ia(t){return Ta(t)*2+t*.42}var xi=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=Bo(_o(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),o=se(i),n=Sa(i,i),r=J(n,o.sectionInk),s=new Pa({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 Pa({listening:!1}),h=new vu({...c,width:0,height:0,fill:n,stroke:o.sectionStroke,strokeWidth:Ge,opacity:Fr,listening:!1,perfectDrawEnabled:!1}),u=new Su({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),f=this.host.categoryPriceLabel(a.categoryKey),m=new wu({...c,text:l,fontSize:et,fontStyle:Ve,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(h),d.add(u),d.add(m),s.add(d),this.labels.push({cluster:a,pill:d,plate:h,swatch:u,text:m,label:l,price:f})}if(!this.labels.length){s.destroy();return}this.group=s,this.host.labelLayer.add(s)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let i=this.host.seatR()*2,o=this.host.exportMode||this.host.viewMode()!=="flat"||this.host.seatsPickable()&&e<le;return this.revealed=o||tr(io(i,e),io(i,le),this.revealed),!this.revealed&&this.size(this.host.stage.scaleX(),this.host.stage.width())&&this.host.labelLayer.batchDraw(),this.applyFilterDim(),this.applyVisibility(!this.revealed),!0}focusCluster(e){if(this.host.viewMode()!=="flat"||this.host.hasSections()||this.host.seatsPickable())return!1;let i=this.clusterAt(this.host.screenToWorld(e));if(!i)return!1;let o=this.host.seatR()*2,n={x:i.bounds.x-o,y:i.bounds.y-o,width:i.bounds.width+o*2,height:i.bounds.height+o*2},r=this.host.stage;if(at(r,n,this.host.zoomBounds(),this.host.framingViewport())<=r.scaleX()*xt)return!1;let a=this.diveTarget(n);return a?(this.host.focusRegion(a,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,i){let o=this.host.stage,n=this.host.framingViewport(),r=this.host.zoomBounds(),s=at(o,e,r,n),a=Math.min(Math.max(this.host.readableScale(),this.host.pickableScale()),r.max);if(s>=a)return e;let l=n.width/(a*Ie),c=n.height/(a*Ie);if(!(l>0)||!(c>0))return null;let d=i??{x:e.x+e.width/2,y:e.y+e.height/2};return{x:d.x-l/2,y:d.y-c/2,width:l,height:c}}glideTowardTap(e){if(this.host.viewMode()!=="flat")return!1;let i=this.host.stage.scaleX(),o=Vr(i,this.host.pickableScale());if(o==null||o<=i*xt)return!1;let n=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(o*Ie),a=r.height/(o*Ie);return!(s>0)||!(a>0)?!1:(this.host.focusRegion({x:n.x-s/2,y:n.y-a/2,width:s,height:a}),!0)}setPressLandsOnChart(e){this.pressOnChart=e}syncCursor(e){if(this.host.exportMode)return;let i=this.host.viewMode()==="flat"&&!this.host.seatsPickable()?this.pressOnChart?"zoom-in":"default":e?"pointer":"default";for(let o of[this.host.stage.container(),this.host.stage.content])o&&o.style.cursor!==i&&(o.style.cursor=i)}clusterAt(e){let i=Ca(this.all,e);if(i)return i;if(!this.visible)return null;for(let o of this.labels){let n=o.plate.width()/2,r=o.plate.height()/2;if(Math.abs(e.x-o.text.x())<=n&&Math.abs(e.y-o.text.y())<=r)return o.cluster}return null}size(e,i){let o=Math.max(e,1e-4),n=i<q,r=`${o.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=tt(et,i),a=_r/o,l=Br/o;for(let c of this.labels){let{text:d,plate:h,swatch:u,cluster:f}=c,m=Ao(c.label,n);d.text(c.price?`${m} \xB7 ${c.price}`:m),d.fontStyle(n?Mr:Ve);let g=s,p=0;for(;d.fontSize(Math.max(1,g/o)),d.letterSpacing(d.fontSize()*_e),p=Ia(d.fontSize())+d.width()+a*2,!(p<=f.bounds.width||g<=Fe);)g=Math.max(Fe,g-1);let y={x:f.bounds.x+f.bounds.width/2,y:f.bounds.y+f.bounds.height/2},b=d.height()+l*2,S=p-a*2,w=y.x-S/2;u.radius(Ta(d.fontSize())),u.position({x:w+u.radius(),y:y.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:w+Ia(d.fontSize()),y:y.y}),h.size({width:p,height:b}),h.offset({x:p/2,y:b/2}),h.cornerRadius(b/2),h.strokeWidth(Ge/o),h.position(y)}return!0}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),i=!1;for(let o of this.labels){let n=e&&!e.has(o.cluster.categoryKey)?.22:1;o.pill.opacity()!==n&&(o.pill.opacity(n),i=!0)}i&&this.host.labelLayer.batchDraw()}boundsForSeats(e,i){if(!e.length)return null;let o=_o(e,this.host.seatR()),n=Bo(o);n.length||(n=o.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=xa(n);if(!r)return null;let s=n.reduce((a,l)=>l.seatCount>a.seatCount?l:a,n[0]);return{bounds:{x:r.x-i,y:r.y-i,width:r.width+i*2,height:r.height+i*2},anchor:{x:s.bounds.x+s.bounds.width/2,y:s.bounds.y+s.bounds.height/2},singleBlock:n.length===1&&e.every(a=>a.x>=r.x&&a.x<=r.x+r.width&&a.y>=r.y&&a.y<=r.y+r.height)}}applyVisibility(e){let i=this.group;if(!i||e===this.visible)return;if(this.visible=e,this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),i.visible(!0),this.host.reducedMotion()){i.opacity(e?1:0),i.visible(e),this.host.labelLayer.batchDraw();return}let o=i.opacity(),n=e?1:0,r=performance.now(),s=a=>{if(this.host.destroyed()||!this.group){this.fadeRaf=0;return}let l=Math.min(1,(a-r)/90);i.opacity(o+(n-o)*l),l>=1&&i.visible(n>0),this.host.labelLayer.batchDraw(),this.fadeRaf=l<1?requestAnimationFrame(s):0};this.fadeRaf=requestAnimationFrame(s)}};import{Circle as ku}from"konva/lib/shapes/Circle";import{Line as Lu}from"konva/lib/shapes/Line";function Ma(t,e,i,o){let n=t.seatRadius(),r=new ku({x:i.x,y:i.y,radius:n,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),s=t.viewMode()==="perspective"?t.perspectiveSeatScale(e):1;r.scale({x:s,y:s}),t.overlayLayer.add(r);let a=performance.now(),l=620,c=d=>{if(!r.getLayer())return;let h=Math.max(0,Math.min(1,(d-a)/l));r.radius(n*(1+h*1.8)),r.opacity(.9*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(c):(r.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(c)}function Ra(t,e,i){for(let o of e){let n=t.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(h=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,h))):o.outline.map(h=>{let u=o.liftWorld>0?t.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:h.x+u.x,y:h.y+u.y}}),r=n.reduce((h,u)=>({x:h.x+u.x,y:h.y+u.y}),{x:0,y:0});r.x/=n.length,r.y/=n.length;let s=new Lu({x:r.x,y:r.y,points:n.flatMap(h=>[h.x-r.x,h.y-r.y]),closed:!0,stroke:i,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:i,shadowBlur:14,shadowOpacity:.7});t.overlayLayer.add(s),t.overlayLayer.batchDraw();let a=()=>{s.getLayer()&&(s.destroy(),t.overlayLayer.batchDraw())};if(t.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=h=>{if(t.isDestroyed()||!s.getLayer())return;let u=Math.max(0,Math.min(1,(h-l)/c)),m=1+(1-Math.pow(1-u,3))*.04;s.scale({x:m,y:m}),s.opacity(.92*(1-u)),t.overlayLayer.batchDraw(),u<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as Iu}from"konva/lib/Group";import{Shape as Tu}from"konva/lib/Shape";import{Group as xu}from"konva/lib/Group";import{Shape as Cu}from"konva/lib/Shape";function Pu(t,e,i){let o=e.length,n={x:(e[o-1].x+e[0].x)/2,y:(e[o-1].y+e[0].y)/2};t.moveTo(n.x,n.y);for(let r=0;r<o;r+=1){let s=e[r],a=e[(r+1)%o],l=e[(r-1+o)%o],c=Math.min(Math.hypot(s.x-l.x,s.y-l.y)/2,Math.hypot(a.x-s.x,a.y-s.y)/2);t.arcTo(s.x,s.y,a.x,a.y,Math.max(0,Math.min(i,c)))}t.closePath()}function $e(t,e,i,o){let n=Qi(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0;return new Cu({...i,sceneFunc(s,a){s.beginPath();let l=d=>{if(d.length){if(r>0&&d.length>=3)return Pu(s,d,r);s.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h+=1)s.lineTo(d[h].x,d[h].y);s.closePath()}};o?(d=>{s.moveTo(d.start.x,d.start.y);let h=d.start;for(let u of d.segments)u.kind==="line"?s.lineTo(u.end.x,u.end.y):u.kind==="arc"?s.arc(u.center.x,u.center.y,u.radius,Math.atan2(h.y-u.center.y,h.x-u.center.x),Math.atan2(u.end.y-u.center.y,u.end.x-u.center.x),!u.clockwise):s.bezierCurveTo(u.control1.x,u.control1.y,u.control2.x,u.control2.y,u.end.x,u.end.y),h=u.end;s.closePath()})(o):l(t);for(let d of e??[]){let h=Qi(d)>0;l(h===n?[...d].reverse():d)}s.fillStrokeShape(a)},perfectDrawEnabled:!1})}var lt=class extends xu{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 Aa(t,e){if(!e.length)return null;let i=new Iu({listening:!1});for(let o of e){let n=t.viewMode==="perspective"&&o.perspectiveAffine,r=n?o.outline.map(a=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,a))):o.outline,s=n?o.holes.map(a=>a.map(l=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,l)))):o.holes;i.add($e(r,s,{fill:Yr,stroke:D("#ffffff",.1),strokeWidth:1,listening:!1},n?void 0:o.outlinePath))}return t.bgLayer.add(i),i.moveToTop(),i}function Ea(t,e){let{bounds:i}=t,n=Math.max(i.width,i.height,1)*4+1e3,r=[{x:i.x-n,y:i.y-n},{x:i.x+i.width+n,y:i.y-n},{x:i.x+i.width+n,y:i.y+i.height+n},{x:i.x-n,y:i.y+i.height+n}],s=new Tu({fill:t.canvasBackground,opacity:1-xe,listening:!1,perfectDrawEnabled:!1,sceneFunc:(a,l)=>{let c=h=>{if(h.length){a.moveTo(h[0].x,h[0].y);for(let u=1;u<h.length;u++)a.lineTo(h[u].x,h[u].y);a.closePath()}};a.beginPath(),c(r);let d=[];for(let h of e){let u=t.viewMode==="perspective"&&h.perspectiveAffine?h.outline.map(f=>t.perspectiveLocalPoint(t.projectedSectionPoint(h,f))):h.outline.map(f=>{let m=h.liftWorld>0?t.isoLiftLocal(h.liftWorld):{x:0,y:0};return{x:f.x+m.x,y:f.y+m.y}});d.push(u)}d.push(...t.focusedRowLabelCutouts?.()??[]),a.save();for(let h of d)h.length<3||(a.beginPath(),c(r),c(h),a.clip("evenodd"));a.beginPath(),c(r),a.fillStrokeShape(l),a.restore()}});return t.overlayLayer.add(s),s.moveToTop(),s}var Mu=.2;function Fa(t,e){return t.startsWith("#")?Q(e,t,Mu):t}var Na=.5,U=Math.SQRT1_2,Ru="#f3f4f6",_a=4;function Au(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?Na:Math.min(1,Math.max(0,e))}function Eu(t){return t==="booked"||t==="not_for_sale"?zr:Wr}function Ba(t,e){return Number.parseInt(t.slice(e,e+2),16)}function Oa(t){let e=t.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,i,o,n]=e.toLowerCase();return`#${i}${i}${o}${o}${n}${n}`}function Fu(t,e,i){let o=Oa(t),n=Oa(e);if(!o||!n)return t;let r=Math.min(1,Math.max(0,i)),s="#";for(let a=1;a<7;a+=2){let l=Math.round(Ba(o,a)*(1-r)+Ba(n,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function Da(t,e,i,o){let n=i*4,r=e*U,s=-e*U,a=o*U*2*n,l=o*-U*2*n,c=r+n*U,d=s+n*U,h=r-n*U,u=s-n*U;t.beginPath(),t.moveTo(c,d),t.lineTo(h,u),t.lineTo(h+a,u+l),t.lineTo(c+a,d+l),t.closePath(),t.clip()}function _u(t,e){let i=e*4,o=Math.max(e*.45,1);t.beginPath();for(let n=-_a;n<=_a;n++){let r=n*o*2,s=r+o,a=r*U,l=-r*U,c=s*U,d=-s*U;t.moveTo(a+i*U,l+i*U),t.lineTo(a-i*U,l-i*U),t.lineTo(c-i*U,d-i*U),t.lineTo(c+i*U,d+i*U),t.closePath()}t.clip()}function Ci(t,e){t._sceneFunc(e)}function Ha(t){let e=this,i=e.attrs,o=i.markRadius||1,n=i.fill,r=e.getStage(),s=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(o*2*s<16){i.fill=i.markMidtone??n,Ci(e,t),i.fill=n;return}let l=(1-2*(i.markFraction??Na))*o;t.save(),Da(t,l,o,1),i.fill=i.markBase??n,Ci(e,t),t.restore(),t.save(),Da(t,l,o,-1),i.fill=i.markFill??n,Ci(e,t),i.markHatch&&(_u(t,o),i.fill=Ru,Ci(e,t)),t.restore(),i.fill=n}function Bu(t,e,i,o,n,r){let s=Au(e),a=Eu(i),l=t.attrs;l.markFraction=s,l.markBase=o,l.markFill=a,l.markMidtone=Fu(o,a,1-s),l.markHatch=r,l.markRadius=n>0?n:1,t.fill(l.markMidtone),t.stroke(""),t.strokeWidth(0),t.dash([]),t.opacity(1),t.sceneFunc(Ha)}function Ou(t){t.setAttr("sceneFunc",void 0)}function Oo(t){return t.attrs.sceneFunc===Ha}var Pi=class{constructor(){this.marks=new Map}get size(){return this.marks.size}get(e){return this.marks.get(e)??null}has(e){return this.marks.has(e)}clear(){this.marks.clear()}merge(e,i){let o=new Set;for(let[n,r]of Object.entries(e))i.has(n)&&(r&&r.kind==="partial"?(this.marks.set(n,r),o.add(n)):this.marks.delete(n)&&o.add(n));return o}paint(e,i,o,n,r,s,a){let l=a?void 0:this.marks.get(i);if(!l){Oo(e)&&Ou(e);return}Bu(e,l,o,n,r,s)}};var Du="#9ca3af";function Nu(t){return t==="held"||t==="booked"||t==="not_for_sale"}function Ga(t,e=!1){return Nu(t)?e?t==="not_for_sale"?{fill:"#e2e8f0",stroke:"#475569",strokeWidth:2,dash:[3,2],opacity:1,scale:1}:t==="booked"?{fill:"#15803d",stroke:"#14532d",strokeWidth:1,dash:[],opacity:1,scale:1}:{fill:"#f4b740",stroke:"#854d0e",strokeWidth:1,dash:[],opacity:1,scale:1}:{fill:Du,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}:null}function Va(t){let{focusedId:e}=t;if(!e)return null;let i=new Set([e]),o=t.sectionOf(e);if(o!=null){for(let c of t.seats){let d=t.seatId(c);t.sectionOf(d)===o&&i.add(d)}return i}let n=t.seats.find(c=>t.seatId(c)===e);if(!n)return i;let r=t.seatPoint(n),s=t.seatPitch>0?t.seatPitch:t.seatRadius*2,a=6*(s>0?s:1),l=a*a;for(let c of t.seats){let d=t.seatPoint(c),h=d.x-r.x,u=d.y-r.y;h*h+u*u<=l&&i.add(t.seatId(c))}return i}function Wa(t,e,i){let o=i(t);return o!=null&&o===i(e)}var Ii=Object.freeze([]);function za(t,e,i){let o=t.seat(i),n=t.seatStatus(i),r=t.isSelected(i),s=t.categoryColor(o.categoryKey),a=t.boothLabel(i),l=t.canvasBackground(),c=t.selectionColor();e.dash(Ii),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let d=n==="held"&&t.isOwnedHold(i),h=d?null:Ga(n,t.organizer?.()??!1);h?(e.fill(h.fill),e.stroke(h.stroke),e.strokeWidth(h.strokeWidth),e.dash(h.dash),e.opacity(h.opacity),h.scale!==1&&e.scale({x:h.scale,y:h.scale})):d?(e.fill(de(s,c===st?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===st?de(s,.28):s),t.seatMarks.paint(e,i,n,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),Oo(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&n==="free"&&(e.stroke(yt(o.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),e.strokeWidth(r?3:2),e.dash([3,2])),a&&(a.text(h?"":o.label),a.fontSize(10),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??Ue),a.offsetX(a.width()/2),a.offsetY(a.height()/2));let u=n==="free"||n==="held"&&!t.isOwnedHold(i),f=()=>{let k=e.fill();typeof k=="string"&&e.fill(Fa(k,l))},m=t.accessFilter();if(m&&u&&!r){let k=Pe(o,m);k==="other"?(f(),e.opacity(Math.min(e.opacity(),$s))):k==="companion"&&e.opacity(Math.min(e.opacity(),qs))}let g=t.categoryHighlight();g&&n==="free"&&!r&&o.categoryKey!==g&&e.opacity(.25);let p=t.categoryFilter();p&&u&&!r&&!p.has(o.categoryKey)&&(f(),e.opacity(.22)),t.commercialLimitedFilter()&&n==="free"&&!r&&(o.commercial?.restrictedView||o.commercial?.obstructedView)&&e.opacity(.22);let y=t.dimmedSections();if(y.size){let k=t.seatSection(i);(k?y.has(k.id)||y.has(k.logicalId)||k.zone!=null&&y.has(k.zone):y.has(In))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(Kr),e.stroke(""),e.strokeWidth(0),e.dash(Ii),e.opacity(Xr),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let b=t.boothLabel(i)??t.seatLabel(i);if(b){b.fill(t.seatLabelInk(o,e));let k=!a&&(r||d);b.visible(me(b.fontSize(),t.effScale())&&e.opacity()>=.5&&!k)}let S=t.accessGlyph(i);if(S){let k=e.fill();S.fill(ti(typeof k=="string"?k:"")),S.opacity(e.opacity()),S.visible(t.accessGlyphShouldShow(i))}let w=t.accessRing(i);w&&(w.stroke(yt(o.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),w.opacity(e.opacity()),w.visible(t.accessRingShouldShow(i)))}function Ti(t,e){let i=null,o=1/0;for(let[n,r]of t){if(!r.getLayer())continue;let s=r.getClientRect(),a=s.x+s.width/2,l=s.y+s.height/2,c=Math.max(s.width/2,22),d=Math.max(s.height/2,22),h=Math.abs(e.x-a),u=Math.abs(e.y-l);if(h>c||u>d)continue;let f=h*h+u*u;f<o&&(o=f,i=n)}return i}function Mi(t){return t?.getAttr?.("seatId")??void 0}var Do=.85,Hu=.38,Gu=Object.freeze([3,3]);function Vu(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function Ka(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function Wu(t){let e=null,i=0,o=()=>{i=0,!(!e||t.destroyed?.())&&(t.viewMode()!=="flat"||t.seatsPickable()||(t.clusterLabels.setPressLandsOnChart(!Ka(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return n=>{e=n,i||(i=requestAnimationFrame(o))}}function Xa(t){t.attachHoverCard();let e=Wu(t);t.seatLayer.on("click tap",i=>{if(t.moved()>Ee||t.isGhostClick(i))return;let o=Mi(i.target);o&&t.seatsPickable()&&t.handleSeatTap(o)}),t.seatLayer.on("mouseover",i=>{let o=Mi(i.target);if(!o)return;let n=t.seat(o);if(!n)return;t.setHoveredId(o);let r=zu(t,o);t.hoverRing.position(t.renderedSeatPoint(n));let s=t.viewMode()==="perspective"?t.perspectiveSeatScale(o):1;t.hoverRing.scale({x:s,y:s}),t.hoverRing.opacity(r==="muted"?Hu:Do),t.hoverRing.dash(r==="muted"?Gu:Ii),t.hoverRing.visible(r!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(r==="full"),t.onHover?.(n,{mark:t.seatMark(o),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let i=t.stage.getPointerPosition();i&&e(i)}),t.stage.on("wheel",i=>{i.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let o=t.container.getBoundingClientRect(),n={x:i.evt.clientX-o.left,y:i.evt.clientY-o.top},r=Math.exp(-i.evt.deltaY*.002);t.zoomAbout(t.stage.scaleX()*K(r,.5,2),n,"frame"),e(n)}),t.stage.on("click tap",i=>{if(t.moved()>Ee||t.isGhostClick(i))return;let o=t.stage.getPointerPosition();if(!o)return;if(t.sectionCount()){let r=t.ownedBadgeAt(t.screenToWorld(o));if(r&&t.focusOwnedSeats(r))return}if(!(Mi(i.target)&&t.seatsPickable())){let r=Ti(t.selectionMarkers(),o);if(r){t.focusSeats([r],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(o))return;if(!t.cached()){if(Mi(i.target)&&t.seatsPickable())return;if(t.seatsPickable()){let r=t.focusedSectionId(),s=t.nearestSeatToScreen(o,ge),a=s?t.seatSection(s):null;if(s&&(!r||a&&t.sectionMatchesFocus(a))){t.handleSeatTap(s);return}let l=s?null:t.nearestSeatToScreen(o,ge,!0),c=l?t.seatSection(l):null;if(l&&(!r||c&&t.sectionMatchesFocus(c))){t.handleSeatTap(l);return}if(r&&t.onBackdropTap&&!t.floorOverview()){let h=t.sectionAt(o);if(h&&t.sectionInteractive?.(h)===!1)return;if(h&&h!==r){let u=t.sectionTapAnchor(h,t.screenToWorld(o));t.onSectionTap?t.onSectionTap(h,u):t.focusSection(h,{anchor:u})}else h||t.onBackdropTap();return}if(r)return;let d=t.sectionCount()?Vu(t,o):null;if(!d||t.effScale()>=ee||t.sectionFrameScale(d)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let r=t.floorOverview()?t.sectionAt(o):null,s=(r?t.objectFloor(r):null)??t.deckFloorAt();if(s){t.onDeckTap(s);return}}if(t.sectionCount()){let r=t.screenToWorld(o),s=t.ownedBadgeAt(r);if(s&&t.focusOwnedSeats(s)||!s&&Ka(t,o))return;let a=s??t.sectionAt(o);if(a){let l=t.sectionTapAnchor(a,r);t.onSectionTap?t.onSectionTap(a,l):t.focusSection(a,{anchor:l});return}if(!t.pressLandsOnChart(o))return}if(t.clusterLabels.focusCluster(o)||t.clusterLabels.glideTowardTap(o))return;let n=Math.max(Ae*1.2,t.stage.scaleX()*2.5);t.zoomAbout(n,o)})}function Ya(t,e){if((t.stacked()||t.floorOverview())&&t.onDeckTap){let o=t.objectFloor(t.seat(e)?.rowId??"");if(o){t.onDeckTap(o);return}}if(t.effScale()<ee&&t.sectionCount()){let o=t.seatSection(e);if(o){let n=t.focusedSectionId()===o.logicalId,r=t.sectionFrameScale(o.logicalId)>t.stage.scaleX()*1.02;if(!n&&r){let s=t.seat(e),a=s?t.renderedSeatPoint(s):void 0;t.onSectionTap?t.onSectionTap(o.logicalId,a):t.focusSection(o.logicalId,{anchor:a});return}}}if(!(t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e))){let o=t.seat(e)??null,n=t.hiddenByAccessFilter(e);o&&(n||t.hasSeatMark(e))&&(t.onHover?.(o,{mark:t.seatMark(e)??null,interaction:"press",unavailable:!0,...n?{filteredOut:!0}:{}}),t.nudgeSeat(e));return}t.hasSeatMark(e)&&t.onHover?.(t.seat(e)??null,{mark:t.seatMark(e),interaction:"press"}),t.toggleSeat(e)}function zu(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function Ua(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<le}import{Rect as Bp}from"konva/lib/shapes/Rect";import{Text as Op}from"konva/lib/shapes/Text";import{Path as Dp}from"konva/lib/shapes/Path";import{Text as qa}from"konva/lib/shapes/Text";var $a="500",Ku=2.5;function Xu(t,e){return t>=ee||e&&t>=li}function Yu(t){return t.effectiveScale<li?!1:t.focusActive||t.stageWidth<q}function Uu(t,e,i){return i&&e>=li?Math.max(t,ar/Math.max(e,1e-4)):t}function $u(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:o,effectiveScale:n}=t;if(!(i>o)||!(i>0))return e;let r=Y/Math.max(n,1e-4),s=e*o/i;return Math.max(Math.min(St,r),s)}function No(t,e){let i=(e?1:3)*Math.min(1,t/pe);return Math.max(1,t*2-i)}function Za(t){let e=new Map;for(let n of t){let r=e.get(n.rowId);r?r.push(n):e.set(n.rowId,[n])}let i=[];for(let n of e.values())if(!(n.length<2))for(let r=1;r<n.length;r+=1){let s=Math.hypot(n[r].x-n[r-1].x,n[r].y-n[r-1].y);s>0&&Number.isFinite(s)&&i.push(s)}if(!i.length)return 0;i.sort((n,r)=>n-r);let o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o])/2}function ja(t,e){return e>0?Math.min(t,e/2):t}function Ho(t){let e=Math.max(t*2,1e-4);return Math.max(le,_n/e)}function At(t){let e=No(t,!1),i=No(pe,!1),o=e>0?i/e:1;return ee*Math.max(1,o)/oo(1,!1,Y)}function Qa(t){return At(t)*Gr}function qu(t,e,i){let o=t.seatLabelContainer(e);i.getParent()!==o&&o.add(i)}function Ja(t){let e=t.exportMode?Math.max(t.effScale(),ee):t.effScale(),i=Yu({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),o=t.exportMode?e:oo(e,t.labelsWereVisible(),Y),n=Xu(o,i);t.onLabelVisibilityChange(n),t.setSeatLabelRungOpen(n);let r=h=>{let u=h.getClientRect({skipShadow:!0,skipStroke:!0});return u.x>=0&&u.y>=0&&u.x+u.width<=t.stage.width()&&u.y+u.height<=t.stage.height()};for(let[h,u]of t.boothLabelById){let f=t.circleById.get(h);u.visible(me(u.fontSize(),o)&&!!f?.isVisible()&&t.focusedSeatOpacity(h,f?.getAbsoluteOpacity()??1)>=.5&&r(u))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let s=new Set,a=0;if(n)for(let h of t.visibleSeatCandidates()){if(h.kind==="booth")continue;let u=t.worldToScreen(h);if(u.x<-20||u.x>t.stage.width()+20||u.y<-20||u.y>t.stage.height()+20||t.accessGlyphById.has(h.id)&&t.accessGlyphShouldShow(h.id))continue;let f=t.circleById.get(h.id);if(!f?.isVisible()){t.seatLabelDrops.set(h.id,"dimmed-or-unavailable");continue}let m=t.statusById.get(h.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(h.id)&&(m==="booked"||m==="not_for_sale"||m==="held"&&!t.ownedHold.has(h.id))){t.seatLabelDrops.set(h.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(h.id)){t.seatLabelDrops.set(h.id,"selection-tick");continue}if(t.focusedSeatOpacity(h.id,f.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(h.id,"dimmed-or-unavailable");continue}let y=t.renderedSeatPoint(h),b=t.viewMode==="perspective"?t.perspectiveSeatScale.get(h.id)??1:1,S=Uu(we*t.seatLabelScale(h),e,i),w=ei(h.displayLabel??h.label),k=f?t.seatLabelInk(h,f):t.seatPreferredLabelInk(h),v=t.seatLabelPool.get(h.id);v?(v.position(y),v.text(w),v.fontSize(S),v.fontFamily(t.labelFont()),v.fill(k),v.offset({x:0,y:0}),v.scale({x:1,y:1})):(v=new qa({x:y.x,y:y.y,text:w,fontSize:S,fontStyle:$a,fontFamily:t.labelFont(),fill:k,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(h.id,v));let L=No(t.seatR,i);if(v.fontSize($u({authoredFontSize:S,measuredWidth:v.width(),maxWidth:L,effectiveScale:e})),v.width()>L+.01){t.seatLabelDrops.set(h.id,"label-overflows-marker");continue}if(!me(v.fontSize(),e)){t.seatLabelDrops.set(h.id,"below-minimum-size");continue}if(v.offsetX(v.width()/2),v.offsetY(v.height()/2),v.scale({x:b,y:b}),qu(t,h.id,v),!r(v)){t.seatLabelDrops.set(h.id,"outside-viewport");continue}if(s.add(h.id),t.seatLabelById.set(h.id,v),++a>=lr)break}for(let[h,u]of t.seatLabelPool)s.has(h)||(u.destroy(),t.seatLabelPool.delete(h));let l=new Ye;for(let{node:h}of t.freeTextById.values()){if(!h.isVisible())continue;let u=h.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});l.insert({x:u.x-ie,y:u.y-ie,width:u.width+ie*2,height:u.height+ie*2})}let c=new Ye,d=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*Ku;for(let h of Zu(t.rowLabelPlan)){let u=t.rowLabelPlan[h],f=t.focusedSectionId!=null&&u.focusKeys?.includes(t.focusedSectionId),m=Math.max(e,1e-4),g=f?Math.max(u.fontSize,vt/m):u.fontSize,p=Math.max(Math.min(g,sr(t.stage.width())/m),f?vt/m:0);if(!n&&(!f||!d)||!f&&!me(p,o))continue;let y=t.worldToScreen({x:u.x,y:u.y});if(y.x<-40||y.x>t.stage.width()+40||y.y<-40||y.y>t.stage.height()+40)continue;let b=new qa({x:u.x,y:u.y,text:u.text,fontSize:p,fontStyle:$a,fontFamily:t.labelFont(),fill:u.ink,rotation:u.rotation,opacity:u.opacity,shadowColor:"#05070c",shadowBlur:u.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:u.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});u.pill&&Fs(b,u.pill),b.offsetX(b.width()/2),b.offsetY(b.height()/2);let S=t.resolveAutomaticRowLabelPosition(b,u,l);b.position(S),b.setAttr("rowLabel",!0),b.setAttr("focusKeys",u.focusKeys??[]),t.rowLabelGroup.add(b);let w=b.getClientRect({skipShadow:!0,skipStroke:!0}),k=6,v=w.x<k?k-w.x:w.x+w.width>t.stage.width()-k?t.stage.width()-k-w.x-w.width:0,L=w.y<k?k-w.y:w.y+w.height>t.stage.height()-k?t.stage.height()-k-w.y-w.height:0,P=S;if(v||L){let M=t.labelGroup.getAbsoluteTransform(),x=M.point(S);P=M.copy().invert().point({x:x.x+v,y:x.y+L}),b.position(P)}let I=t.rowLabelBox(b,P);if(c.collisionCount(I)>0){b.destroy();continue}if(u.automaticAway&&l.collisionCount(I)>0){b.destroy();continue}l.insert(I),c.insert(I)}t.isoT>0&&t.viewMode!=="perspective"&&t.applyUprightLabels(),t.overlayLayer.batchDraw()}function Zu(t){let e=n=>n.focusKeys?.length?n.focusKeys.join(" "):"",i=[],o=0;for(;o<t.length;){let n=e(t[o]),r=o;for(;r+1<t.length&&e(t[r+1])===n;)r++;if(n){i.push(o),r>o&&i.push(r);for(let s=o+1;s<r;s++)i.push(s)}else for(let s=o;s<=r;s++)i.push(s);o=r+1}return i}var ju=10;function Qu(t){let e=t.framingViewport();if(t.stage.width()>=q||t.exportMode())return e;let i=ju;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 el(t){let e=Qu(t),i=t.revealWorldRect?.()??null,o=e.width,n=e.height,r=t.perspectiveBounds(),s=t.viewMode()==="perspective"&&r?r:t.bounds();if(t.setFitScale(Math.min(o/s.width,n/s.height)||1),t.portraitFitCrop()&&!t.exportMode()){let l=o/s.width<=n/s.height,c=s.height*t.fitScale();l&&c<.55*n&&t.setFitScale(Math.min(t.fitScale()*1.3,.62*n/s.height))}let a=t.fitScale();if(t.stage.scale({x:a,y:a}),t.stage.position({x:e.x+(o-s.width*a)/2-s.x*a,y:e.y+(n-s.height*a)/2-s.y*a}),t.settleView(),!t.exportMode()){let l=Rs(t.stage,[t.bgLayer,t.seatLayer],e,t.effScale()<le?le*.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(),vo(t.stage,[t.bgLayer,t.seatLayer],e,i)),Ju(t,e),t.setFitPose(Xe(t.stage))}t.stage.batchDraw()}function Ju(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let o=t.revealWorldRect?.()??null,n=Pt(t.stage,[t.bgLayer,t.seatLayer],o);if(!n)return;let r=e.height-i;if(n.height<=r){vo(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:r},o);return}let s=e.y+wi-n.y;s<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+s})}function Et(t){let e=t.fitScale();t.zones().length&&(e=Math.min(e,He*.9));let i=(t.focusedFrameScale?.()??0)*2;return{min:e,max:Math.max(e,Qa(t.markerR()),i)}}function tl(t,e,i,o="now"){let n=t.stage.position();sa(t.stage,e,i,Et(t))&&(t.stage.position(t.constrainPan(t.stage.position(),n)),o==="frame"?(t.updateSeatGroupVisibility(),ep(t)):t.afterViewChange(),t.stage.batchDraw())}function ep(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function il(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function tp(t,e,i,o,n=0){aa(t.stage,e,Et(t),i,Ft(t.framingViewport(),n),o),t.settleView(),t.stage.batchDraw()}function ol(t,e,i){let o=typeof e=="string"?t.sectionBounds(e):e;if(!o)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){tp(t,o,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let n=Ft(t.framingViewport(),i?.focusPaddingPx??0),r=n.width,s=n.height,{min:a,max:l}=Et(t),c=1.12,d=Math.min(r/(o.width*c),s/(o.height*c)),h=i?.minScale??a,u=K(Math.max(d,h),a,Math.max(h,Rt({min:a,max:l},i?.maxScale))),f=n.x+r/2-(o.x+o.width/2)*u,m=n.y+s/2-(o.y+o.height/2)*u,g=t.stage.scaleX(),p=t.stage.x(),y=t.stage.y();if(Math.abs(u-g)<1e-4&&Math.abs(f-p)<.5&&Math.abs(m-y)<.5){t.settleView();return}let b=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let w=k=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let v=Math.min(1,(k-b)/S),L=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,P=g+(u-g)*L;t.stage.scale({x:P,y:P}),t.stage.position({x:p+(f-p)*L,y:y+(m-y)*L}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),v<1?t.setGlideRaf(requestAnimationFrame(w)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(w))}function Ft(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 ip}from"konva/lib/shapes/Text";function nl(t){let e=De,i=new ip({fontSize:we,fontStyle:"600",fontFamily:t.labelFont(),listening:!1}),o=t.seatR*2-3;for(let n of t.seats){if(n.kind==="booth"){e=Math.min(e,De);continue}let r=we*t.seatLabelScale(n);i.fontSize(r),i.text(ei(n.displayLabel??n.label));let s=i.width()>o?Math.max(St,r*o/i.width()):r;e=Math.min(e,s)}return i.destroy(),Y/Math.max(St,e)}function sl(t,e,i,o,n,r=.35){return!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(e)||!(i.width>0)||!(i.height>0)?t:{x:rl(t.x,e,i.x,i.width,o.x,o.width,r,n?.x),y:rl(t.y,e,i.y,i.height,o.y,o.height,r,n?.y)}}function rl(t,e,i,o,n,r,s,a){if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(n)||!Number.isFinite(r))return t;let l=o*e,c=Math.min(l,r*(1-s)),d=n+c-(i+o)*e,h=n+r-c-i*e;if(!(d<=h))return t;if(Number.isFinite(a)){let u=a;return Math.min(Math.max(t,Math.min(d,u)),Math.max(h,u))}return Math.min(Math.max(t,d),h)}var Go={top:0,right:0,bottom:0,left:0};function al(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)}:{...Go}}var op=.7;function ll(t,e,i){let{top:o,right:n,bottom:r,left:s}=i,a=(u,f,m)=>{let g=u+f,p=m*op;if(g<=p||g<=0)return[u,f];let y=p/g;return[u*y,f*y]},[l,c]=a(s,n,t),[d,h]=a(o,r,e);return{x:l,y:d,width:Math.max(1,t-l-c),height:Math.max(1,e-d-h)}}function cl(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function dl(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 _t(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function hl(t,e){let i=e({x:t.x,y:t.y}),o=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(i.x,o.x),y:Math.min(i.y,o.y),width:Math.abs(o.x-i.x),height:Math.abs(o.y-i.y)}}function pl(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?pr:ur}function fl(t){return Math.max(t*1.05,nr,te*1.3)}var np=42;function ml(t){return np/(2*Math.max(t,1e-4))}function ct(t,e){let i=1/0,o=-1/0,n=1/0,r=-1/0;for(let s of t)i=Math.min(i,s.x),o=Math.max(o,s.x),n=Math.min(n,s.y),r=Math.max(r,s.y);return i-=e,o+=e,n-=e,r+=e,{x:i,y:n,width:Math.max(40,o-i),height:Math.max(40,r-n)}}function gl(t){let{stageWidth:e,stageHeight:i,fullBounds:o,visibleBounds:n,seatPoints:r,minScale:s}=t;if(!r.length)return null;let a=1.12;if(Math.min(e/(o.width*a),i/(o.height*a))>=s)return null;let c=t.tapAnchor??{x:n.x+n.width/2,y:n.y+n.height/2},d=r[0],h=1/0;for(let g of r){let p=(g.x-c.x)**2+(g.y-c.y)**2;p<h&&(d=g,h=p)}let u=e/(s*a),f=i/(s*a),m=ct(r,0);return{bounds:{x:ul(d.x,u,m.x,m.width),y:ul(d.y,f,m.y,m.height),width:u,height:f},minScale:s}}function ul(t,e,i,o){return o<=e?i+o/2-e/2:Math.min(Math.max(t-e/2,i),i+o-e)}import{Shape as sp}from"konva/lib/Shape";var yl=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},rp=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function bl(t,e){let i=new Map;for(let n of t){if(n.kind==="booth")continue;let r=e.get(n.rowId),s=yl(n);if(!(r&&r>0)||s==null)continue;let a=rp(n),l=i.get(a)??[];l.push({seat:n,index:s}),i.set(a,l)}let o=[];for(let n of i.values()){n.sort((a,l)=>a.index-l.index||a.seat.id.localeCompare(l.seat.id));let r=[],s=()=>{r.length&&(o.push({seats:r,points:r.map(({x:a,y:l})=>({x:a,y:l}))}),r=[])};for(let a of n){let l=r[r.length-1];if(l){let c=yl(l),d=Math.hypot(a.seat.x-l.x,a.seat.y-l.y),h=e.get(a.seat.rowId),u=Math.max(1e-6,h*1e-6);(c==null||a.index!==c+1||d<=u||d>h*1.5)&&s()}r.push(a.seat)}s()}return o}var Bt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15}get active(){return this.entries.length>0}clear(){for(let e of this.entries)e.section.liftGroupSeat.opacity(e.opacity),e.section.liftGroupSeat.listening(e.listening),e.shape.destroy();this.entries=[],this.key=""}sync(e,i,o,n,r,s,a,l,c=()=>1,d=()=>!1,h=()=>1/0){if(!l||!e||!o){this.clear(),this.focusKey=null;return}if(this.doc!==e){this.clear(),this.doc=e,this.spacing.clear(),this.focusKey=null;for(let m of[...e.objects,...(e.floors??[]).flatMap(g=>g.objects)])m.type==="row"&&this.spacing.set(m.id,m.seatSpacing)}if(this.focusKey!==o&&(this.focusKey=o,this.detailScale=Math.min(Math.max(1.15,c()*1.15),h()*.9)),n>=this.detailScale){this.clear();return}let u=i.filter(m=>m.id===o||m.logicalId===o||d(m)),f=u.map(m=>m.id).join("|");if(!(this.key===f&&this.active)){this.clear(),this.key=f;for(let m of u){if(m.memberIds.length>2e3||m.memberIds.some(y=>!a.has(y)||!this.spacing.has(s.get(y)?.rowId??"")))continue;let g=bl(m.memberIds.map(y=>s.get(y)).filter(Boolean),this.spacing);if(!g.length||g.reduce((y,b)=>y+b.seats.length,0)!==m.memberIds.length)continue;let p=new sp({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:y=>{let b=y._context,S=p.getStage(),w=S&&S.width()<=q?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;b.save(),b.lineWidth=w*2,b.lineCap="round",b.lineJoin="round";let k=v=>{let L=a.get(v.id);return D(String(L.fill()),L.opacity())};for(let v of g){let L=v.points;if(L.length===1){b.fillStyle=k(v.seats[0]),b.beginPath(),b.arc(L[0].x,L[0].y,w,0,Math.PI*2),b.fill();continue}let P=v.seats.map(k),I=(T,R)=>{let A=Math.hypot(R.x-T.x,R.y-T.y);return{x:-(R.y-T.y)/A,y:(R.x-T.x)/A}},M=L.map((T,R)=>{let A=L[Math.max(0,R-1)],_=L[Math.min(L.length-1,R+1)];return Math.hypot(_.x-A.x,_.y-A.y)>.001?I(A,_):I(L[R],L[R+1]??L[R-1])}),x=(T,R,A)=>({x:T.x+R.x*w*A,y:T.y+R.y*w*A}),C=0;for(;C<L.length;){let T=C;for(;T+1<L.length&&P[T+1]===P[C];)T++;let R=C===0?L[0]:{x:(L[C-1].x+L[C].x)/2,y:(L[C-1].y+L[C].y)/2},A=T===L.length-1?L[T]:{x:(L[T].x+L[T+1].x)/2,y:(L[T].y+L[T+1].y)/2},_=C===0?M[0]:I(L[C-1],L[C]),E=T===L.length-1?M[T]:I(L[T],L[T+1]),H=[R,...L.slice(C,T+1),A],G=[_,...M.slice(C,T+1),E],Z=H.map((F,V)=>x(F,G[V],1)),N=H.map((F,V)=>x(F,G[V],-1));b.fillStyle=P[C],b.beginPath(),b.moveTo(Z[0].x,Z[0].y);for(let F of Z.slice(1))b.lineTo(F.x,F.y);if(T===L.length-1){let F=Math.atan2(E.y,E.x);b.arc(A.x,A.y,w,F,F-Math.PI,!0)}else b.lineTo(N[N.length-1].x,N[N.length-1].y);for(let F of N.slice(0,-1).reverse())b.lineTo(F.x,F.y);if(C===0){let F=Math.atan2(-_.y,-_.x);b.arc(R.x,R.y,w,F,F-Math.PI,!0)}b.closePath(),b.fill(),C=T+1}}b.restore()}});this.entries.push({section:m,shape:p,opacity:m.liftGroupSeat.opacity(),listening:m.liftGroupSeat.listening()}),m.liftGroupBg.add(p),m.liftGroupSeat.opacity(0),m.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};function Sl(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 Vo=1e6;function ap(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function Wo(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Ri=class{constructor(e,i=ap()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.lastTapAt=0;this.rect=null;this.onLayoutChanged=()=>{this.rect=null};this.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||(this.rect=null,this.beginPointer(e.pointerId,this.toLocal(e.clientX,e.clientY),e.pointerType,e.button))};this.onPointerMove=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId))return;e.preventDefault();let i=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,i)&&this.applyPointerMove(i)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId)};this.onTouchStart=e=>{if(!Wo(e)){e.preventDefault(),this.rect=null;for(let i=0;i<e.changedTouches.length;i+=1){let o=e.changedTouches.item(i);o&&this.beginPointer(Vo+o.identifier,this.toLocal(o.clientX,o.clientY),"touch",0)}}};this.onTouchMove=e=>{if(Wo(e))return;e.preventDefault();let i=null;for(let o=0;o<e.changedTouches.length;o+=1){let n=e.changedTouches.item(o);if(!n)continue;let r=this.toLocal(n.clientX,n.clientY);this.updatePointer(Vo+n.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!Wo(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let o=e.changedTouches.item(i);o&&this.endPointer(Vo+o.identifier)}}};this.host=e,this.useWebKitTouchEvents=i}get moved(){return this.movedPx}attach(){let{container:e}=this.host;this.rect=null,typeof window<"u"&&(window.addEventListener("scroll",this.onLayoutChanged,{capture:!0,passive:!0}),window.addEventListener("resize",this.onLayoutChanged,{passive:!0}),window.visualViewport?.addEventListener("resize",this.onLayoutChanged),window.visualViewport?.addEventListener("scroll",this.onLayoutChanged)),e.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),e.addEventListener("pointermove",this.onPointerMove,{passive:!1}),e.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),e.addEventListener("pointercancel",this.onPointerEnd,{passive:!1}),this.useWebKitTouchEvents&&(e.addEventListener("touchstart",this.onTouchStart,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove,{passive:!1}),e.addEventListener("touchend",this.onTouchEnd,{passive:!1}),e.addEventListener("touchcancel",this.onTouchEnd,{passive:!1}))}detach(){let{container:e}=this.host;typeof window<"u"&&(window.removeEventListener("scroll",this.onLayoutChanged,{capture:!0}),window.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("scroll",this.onLayoutChanged)),e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerEnd),e.removeEventListener("pointercancel",this.onPointerEnd),this.useWebKitTouchEvents&&(e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("touchcancel",this.onTouchEnd))}resetPan(){this.panLast=null,this.panStart=null,this.panStarted=!1}isGhostClick(e){return e.type==="tap"?(this.lastTapAt=performance.now(),!1):this.lastTapAt>0&&performance.now()-this.lastTapAt<rr}invalidateRect(){this.rect=null}toLocal(e,i){let o=this.rect;if(!o){let n=this.host.container.getBoundingClientRect();o={left:n.left,top:n.top},this.rect=o}return{x:e-o.left,y:i-o.top}}beginPointer(e,i,o,n){if(this.host.cancelGlide(),this.host.dismissFocusRing?.(),this.pointers.set(e,i),this.pointers.size===1)this.movedPx=0,this.singleTouch=o==="touch",this.singleTouch&&this.host.touchProbeStart?.(i),this.pinch=null,this.panStart=i,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:o,button:n})?(this.host.beginMarquee(i),this.panLast=null):this.panLast=i;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[r,s]=[...this.pointers.values()],a={x:(r.x+s.x)/2,y:(r.y+s.y)/2},l=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(s.x-r.x,s.y-r.y),startScale:l,worldMid:{x:(a.x-this.host.stage.x())/l,y:(a.y-this.host.stage.y())/l}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=Ee+1}}updatePointer(e,i){return this.pointers.has(e)?(this.pointers.set(e,i),this.pointers.size===1&&this.panStart?this.movedPx=Math.max(this.movedPx,Math.hypot(i.x-this.panStart.x,i.y-this.panStart.y)):this.pointers.size>=2&&(this.movedPx=Ee+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>Ee?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[i,o]=[...this.pointers.values()],n=Math.hypot(o.x-i.x,o.y-i.y);if(this.pinch.startDist<1)return;let r={x:(i.x+o.x)/2,y:(i.y+o.y)/2},{min:s,max:a}=this.host.zoomBounds(),l=K(this.pinch.startScale*(n/this.pinch.startDist),s,a),c={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.scale({x:l,y:l}),this.host.stage.position(this.host.constrainPan({x:r.x-this.pinch.worldMid.x*l,y:r.y-this.pinch.worldMid.y*l},c)),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=Ee)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}let i={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.position(this.host.constrainPan({x:i.x+(e.x-this.panLast.x),y:i.y+(e.y-this.panLast.y)},i)),this.panLast=e,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}}endPointer(e){if(this.pointers.has(e)){if(this.host.marqueeActive()){this.endTouchProbe(),this.host.finishMarquee(),this.pointers.delete(e),this.pointers.size===0&&(this.panLast=null);return}this.pointers.delete(e),this.pointers.size<2&&(this.pinch=null),this.pointers.size===1&&(this.panLast=[...this.pointers.values()][0],this.panStart=this.panLast,this.panStarted=!0),this.pointers.size===0&&(this.panLast=null,this.panStart=null,this.panStarted=!1,this.endTouchProbe(),this.host.afterViewChange())}}endTouchProbe(){this.singleTouch&&(this.singleTouch=!1,this.host.touchProbeEnd?.())}};import{Circle as lp}from"konva/lib/shapes/Circle";import{Group as cp}from"konva/lib/Group";import{Text as dp}from"konva/lib/shapes/Text";var vl=13,hp=15,up=.3,pp=.08;function xl(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function fp(t,e){return!e||t.available==null?`cap ${t.capacity}`:t.available<=0?B("map.soldOut"):B("map.seatsLeft",{count:t.available})}function mp(t,e){return e&&t.available!=null&&t.available<=0}function Cl(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),o=t.overviewHidden(e),n=mp(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:t.dimmed(e.categoryKey)?Ne*pp:n?Ne*up:Ne),e.polygon.listening(!t.exportMode&&!o&&!i&&!n),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),gp(t,e,n,r,o,t.dimmed(e.categoryKey))}}function gp(t,e,i,o,n,r){if(e.capacityNode){let s=fp(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}yp(t,e,n||r),o>0&&!n?Sp(t,e,o):e.chip&&e.chip.visible(!1)}var zo=9,wl=.86;function yp(t,e,i){let{labelNode:o,capacityNode:n}=e;if(!o&&!n)return;let r=Math.max(t.effScale(),1e-4);if(i){o?.visible(!1),n?.visible(!1);return}if(!t.pickerMode){o?.visible(t.labelLegible(o.fontSize())),n?.visible(t.labelLegible(n.fontSize()));return}let s=bp(e,r),a=kl(o,jt,s.width*wl,r),l=kl(n,Qt,s.width*wl,r),c=a!=null,d=l!=null&&c&&a+l+zo<=s.height;Ll(o,c?a:null,e.labelPoint.y-zo/r,r),Ll(n,d?l:null,e.labelPoint.y+zo/r,r)}function bp(t,e){let i=1/0,o=-1/0,n=1/0,r=-1/0;for(let s of t.points)s.x<i&&(i=s.x),s.x>o&&(o=s.x),s.y<n&&(n=s.y),s.y>r&&(r=s.y);return Number.isFinite(i)?{width:(o-i)*e,height:(r-n)*e}:{width:0,height:0}}function kl(t,e,i,o){if(!t||!t.text())return null;t.fontSize(e/o);let n=t.width()*o;if(n<=i||n<=0)return e;let r=e*(i/n);return r>=Y?r:null}function Ll(t,e,i,o){if(t){if(e==null){t.visible(!1);return}t.fontSize(e/o),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i),t.visible(!0)}}function Sp(t,e,i){if(!e.chip){let o=new cp({x:e.labelPoint.x,y:e.labelPoint.y-vl-16,listening:!1}),n=new lp({radius:vl,fill:t.selectionColor,listening:!1,perfectDrawEnabled:!1}),r=new dp({text:String(i),fontSize:hp,fontStyle:"800",fontFamily:t.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});o.add(n),o.add(r),t.bgLayer.add(o),e.chip=o,e.chipText=r}e.chipText&&e.chipText.text()!==String(i)&&e.chipText.text(String(i)),e.chipText&&(e.chipText.offsetX(e.chipText.width()/2),e.chipText.offsetY(e.chipText.height()/2)),e.chip.visible(!0),e.chip.moveToTop()}function Pl(t,e){let i=!1;for(let[o,n]of Object.entries(e)){let r=t.get(o);r&&(n.available!==void 0&&r.available!==n.available&&(r.available=n.available,i=!0),n.selected!==void 0&&r.selected!==n.selected&&(r.selected=n.selected,i=!0))}return i}function Il(t){let{width:e,height:i}=t;return!(e>0)||!(i>0)?"hidden":e===t.stageWidth&&i===t.stageHeight?"unchanged":{width:e,height:i}}import{Rect as Tl}from"konva/lib/shapes/Rect";import{Text as vp}from"konva/lib/shapes/Text";function Ml(t){let e=t.effScale(),i=t.stage.scaleX(),o={width:t.stage.width(),height:t.stage.height()},n=p=>Math.round(p*100)/100,r=new Map(t.overlayLayer.find(".selection-ring").map(p=>[String(p.getAttr("seatId")??""),String(p.getAttr("ringColor")??t.effSelection)])),s=t.seats.map(p=>{let y=t.circleById.get(p.id),b=t.boothLabelById.get(p.id)??t.seatLabelById.get(p.id),S=t.viewMode==="perspective"?t.perspectiveSeatScale.get(p.id)??1:1,w=(t.viewMode==="perspective"?i:e)*S,k=p.kind==="booth"?De:we*t.seatLabelScale(p),v=t.viewMode==="perspective"&&p.kind!=="booth"?e*S:w,L=n((b?.fontSize()??k)*v),P=t.worldToScreen(p),I=b?b.width()*i*S:0,M=b?b.height()*(t.viewMode==="perspective"&&p.kind==="booth"?i:e)*S:0,x=P.x-I/2<0||P.x+I/2>o.width||P.y-M/2<0||P.y+M/2>o.height,C=t.focusedSeatOpacity(p.id,y?.getAbsoluteOpacity()??0),T=t.seatSection.get(p.id),R=!!b?.isVisible()&&C>=.5&&!x,A;R||(C<.5?A="dimmed-or-unavailable":L<Y?A="below-minimum-size":x?A="outside-viewport":b?A="renderer-hidden":A=t.seatLabelDrops.get(p.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let _=y instanceof Tl?y.width()*i*S:t.seatR*2*w,E=y instanceof Tl?y.height()*(t.viewMode==="perspective"?i:e)*S:t.seatR*2*w,H=2*(t.seatR*w+ge),G=y?.fill(),Z=b?.fill(),N=t.accessGlyphById.get(p.id),F=N?.getAbsoluteScale();return{seatId:p.id,label:p.label,kind:p.kind==="booth"?"booth":"seat",markerShape:p.kind==="booth"?"booth":p.wheelchairSpaceType==="no-seat"?"square":"circle",...p.wheelchairSpaceType?{wheelchairSpaceType:p.wheelchairSpaceType}:{},categoryKey:p.categoryKey,...T?{sectionId:T.id}:{},...T?.zone?{zoneId:T.zone}:{},status:t.statusById.get(p.id)??"free",selected:t.selection.has(p.id),visible:R,renderedFontPx:L,fill:typeof G=="string"?G:"",ink:typeof Z=="string"?Z:y?t.seatLabelInk(p,y):t.seatPreferredLabelInk(p),...r.has(p.id)?{selectionRingColor:r.get(p.id)}:{},opacity:n(C),...N?{accessibilityMarker:{glyphVisible:N.isVisible(),glyphWidthPx:n(Re*Math.abs(F?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(p.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(p.id)&&!!y?.isVisible()&&!!y?.isListening()&&t.isSelectable(p.id),directWidthPx:n(_),directHeightPx:n(E),effectiveMinimumPx:n(Math.max(Math.min(_,E),H))},screenCenter:{x:n(P.x),y:n(P.y)},...R?{screenBox:{x:n(P.x-I/2),y:n(P.y-M/2),width:n(I),height:n(M)}}:{},...A?{hiddenReason:A}:{}}}),a=s.filter(p=>p.visible).length,l=(p,y,b,S,w,k,v)=>{let L=nt({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),P=k&&k.liftWorld>0?t.isoLiftLocal(k.liftWorld):{x:0,y:0},I=z(L.map(A=>t.worldToScreen({x:A.x+P.x,y:A.y+P.y}))),M=n(S.opacity()),x=S.fill(),C=I.x+I.width<0||I.x>o.width||I.y+I.height<0||I.y>o.height,T=S.isVisible()&&M>.05&&!C,R=k?rt({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),k.outline,k.holes):void 0;return{id:p,kind:y,role:b,label:S.text(),visible:T,renderedFontPx:n(S.fontSize()*i),...v==null?{}:{sizeFloorPx:v},opacity:M,fill:w,ink:typeof x=="string"?x:"",...R==null?{}:{fitsContainer:R},...T?{screenBox:{x:n(I.x),y:n(I.y),width:n(I.width),height:n(I.height)}}:{}}},c=p=>{let y=p.namePlate.fill();if(p.namePlate.opacity()>.05&&typeof y=="string"&&y)return y;let b=p.blockPoly.fill();return typeof b=="string"?b:p.baseFill},d=p=>{let y=p.blockPoly.fill();return typeof y=="string"?y:p.baseFill},h=[...t.sections.map(p=>l(p.id,"section","name",p.nameLabel,c(p),p,Lt(o.width))),...t.sections.map(p=>l(`${p.id}:availability`,"section","availability",p.subLabel,c(p),p)),...t.sections.map(p=>l(`${p.id}:number`,"section","number",p.numberLabel,d(p),p,di(o.width))),...t.zones.flatMap(p=>[l(p.id,"zone","name",p.label,p.background),...p.sub?[l(`${p.id}:price`,"zone","price",p.sub,p.background)]:[]])],u=[...t.gaById].map(([p,y])=>{let b=y.points.map(x=>t.worldToScreen(x)),S=Math.min(...b.map(x=>x.x)),w=Math.min(...b.map(x=>x.y)),k=Math.max(...b.map(x=>x.x)),v=Math.max(...b.map(x=>x.y)),L=k<0||S>o.width||v<0||w>o.height,P=n(y.polygon.opacity()),I=P>=.1&&!L,M=y.polygon.fill();return{areaId:p,label:y.label,capacity:y.capacity,categoryKey:y.categoryKey,...y.sectionId?{sectionId:y.sectionId}:{},visible:I,interactive:y.polygon.listening(),opacity:P,fill:typeof M=="string"?M:"",effectiveBackground:y.effectiveBackground,...I?{screenBox:{x:n(S),y:n(w),width:n(k-S),height:n(v-w)}}:{}}}),f=[...t.freeTextById].map(([p,y])=>{let{node:b,background:S,kind:w}=y,k=t.worldToScreen({x:b.x(),y:b.y()}),v=b.width()*i,L=b.height()*e,P=k.x-b.offsetX()*i,I=k.y-b.offsetY()*e,M=n(b.fontSize()*e),x=P+v<0||P>o.width||I+L<0||I>o.height,C=b.isVisible()&&!x,T=b.fill(),R=n(b.getAbsoluteOpacity()),A;return C||(M<Y?A="below-minimum-size":x?A="outside-viewport":A="renderer-hidden"),{objectId:y.objectId??p,kind:w,text:b.text(),visible:C,renderedFontPx:M,ink:typeof T=="string"?T:"",background:S,opacity:R,...C?{screenBox:{x:n(P),y:n(I),width:n(v),height:n(L)}}:{},...A?{hiddenReason:A}:{}}}),m=t.labelGroup.find(p=>p.getAttr("rowLabel")===!0).filter(p=>p instanceof vp).map(p=>{let y=p.getClientRect({skipShadow:!0,skipStroke:!0}),b=y.x+y.width<0||y.x>o.width||y.y+y.height<0||y.y>o.height,S=p.fill();return{text:p.text(),visible:p.isVisible()&&!b,renderedFontPx:n(p.fontSize()*e),ink:typeof S=="string"?S:"",...b?{}:{screenBox:{x:n(y.x),y:n(y.y),width:n(y.width),height:n(y.height)}}}}),g=t.sections.filter(p=>p.blockPoly.opacity()>.05);return{viewport:o,projection:t.viewMode,...t.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:t.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:t.canvasBackground,effectiveScale:n(e),rung:t.getRung(),minimumVisibleLabelPx:Y,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+u.reduce((p,y)=>p+y.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 y=p.blockPoly.fill();return typeof y!="string"||!lo(t.canvasBackground,y)}).length,tintedSectionShells:g.filter(p=>{let y=p.blockPoly.fill();return typeof y=="string"&&jr(t.canvasBackground,y)}).length,visibleCategoryDetailOutlines:t.sections.filter(p=>p.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:t.sections.filter(p=>p.subLabel.opacity()>.05).length,visibleSectionGADetails:[...t.gaById.values()].filter(p=>p.sectionId!=null&&p.polygon.opacity()>.05).length},labels:s,gaAreas:u,hierarchyLabels:h,freeTextLabels:f,rowLabels:m}}import{Circle as wp}from"konva/lib/shapes/Circle";import{Ellipse as kp}from"konva/lib/shapes/Ellipse";import{Line as Rl}from"konva/lib/shapes/Line";import{Arrow as Lp}from"konva/lib/shapes/Arrow";import{Path as xp}from"konva/lib/shapes/Path";import{Rect as Ot}from"konva/lib/shapes/Rect";import{Text as Xo}from"konva/lib/shapes/Text";import{Image as El}from"konva/lib/shapes/Image";function Fl(t,e){if(!e.url||e.visible===!1)return;let i=new window.Image;t.trackAssetImage(i,e.url,"Buyer background image",()=>{let o=i.naturalWidth||4,n=i.naturalHeight||3,r=e.crop??{x:0,y:0,width:1,height:1},s=Math.max(0,Math.min(.99,r.x)),a=Math.max(0,Math.min(.99,r.y)),l={x:s,y:a,width:Math.max(.01,Math.min(1-s,r.width)),height:Math.max(.01,Math.min(1-a,r.height))},c=e.width,d=c*(n*l.height/(o*l.width)),h=new El({image:i,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:d/2,width:c,height:d,rotation:e.rotation??0,crop:{x:l.x*o,y:l.y*n,width:l.width*o,height:l.height*n},opacity:e.opacity,listening:!1});t.bgLayer.add(h),h.moveToBottom(),t.bgLayer.batchDraw()})}function _l(t,e){let i=new window.Image,o=new El({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(o):t.bgLayer.add(o),e.role&&t.landmarkBoxes.push(z(nt({x:e.x+e.width/2,y:e.y+e.height/2},e.width,e.height,e.rotation??0))),t.trackAssetImage(i,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let n=o.getLayer();n&&n.batchDraw()})}function Bl(t,e){if(e.shape==="round")t.bgLayer.add(new wp({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,listening:!1}));else{let o=e.width??80,n=e.height??50;t.bgLayer.add(new Ot({x:e.center.x,y:e.center.y,width:o,height:n,offsetX:o/2,offsetY:n/2,rotation:e.rotation,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,cornerRadius:4,listening:!1}))}let i=Dt(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,"#cbd5e1",12,!0);t.freeTextById.set(e.id,{node:i,background:"#232c40",kind:"table"})}var Cp=8,Pp=6;function Ol(t,e){let i=e.background?.color??t.canvasBackground,o=e.color??J(i,t.theme.textColor??Qs),n=e.semanticKind==="icon"?Yn(e.iconKey):void 0;if(n){let d=e.fontSize/24,h=new xp({x:e.position.x,y:e.position.y,data:n,rotation:e.rotation,scaleX:d,scaleY:d,stroke:o,strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});t.iconNodeById.set(e.id,{node:h,fontSize:e.fontSize}),t.bgLayer.add(h);return}let r=e.background?.padding??0,s=e.opacity??1,a=wn(e),l=new Xo({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:Lo(e.bold,e.italic,"600"),fill:o,fontFamily:e.fontFamily??t.labelFont(),...e.width!=null?{width:e.width}:{},align:e.align??"left",lineHeight:e.lineHeight??1.2,letterSpacing:e.letterSpacing??0,textDecoration:e.underline?"underline":"",padding:r,opacity:s,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;if(e.background){let d=l.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),h=Math.max(Cp,e.fontSize*.35),u=Math.max(Pp,e.fontSize*.28);c=new Ot({x:e.position.x,y:e.position.y,offsetX:-(d.x-h),offsetY:-(d.y-u),width:d.width+h*2,height:d.height+u*2,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 Dl(t,e){let i=e.fill??t.theme.decorFill??js,o=e.role==="stage",n=e.role==="reference-focal",r=!!e.role&&!o,s=vn(e),a=se(t.canvasBackground),l=n?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(o?de(l,.28):n?a.focalStroke:c?"#9aa3b5":void 0),h=e.stroke?.width??(o?1:n||c?2:0),u=e.opacity!=null?K(e.opacity,.1,1):1,f=0,m=0,g=null;if(c&&e.points&&e.points.length>=2){f=e.points.reduce((S,w)=>S+w.x,0)/e.points.length,m=e.points.reduce((S,w)=>S+w.y,0)/e.points.length;let p=Un(e),y=$n(h),b=new Lp({points:e.points.flatMap(S=>[S.x,S.y]),closed:!1,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,stroke:d,fill:d,strokeWidth:h,opacity:u,lineCap:p.lineCap,lineJoin:p.lineJoin,pointerAtBeginning:p.startEnding==="arrow",pointerAtEnding:p.endEnding==="arrow",...y,listening:!1,name:"buyer-shape-open-path"});b.setAttr("shapeObjectId",e.id),t.bgLayer.add(b)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let p=o?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,ve(l,.3),1,de(l,.12)]}:{fill:l};f=e.x+e.width/2,m=e.y+e.height/2,g={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Ot({x:f,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:d,strokeWidth:h,cornerRadius:K(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:u,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){f=e.x+e.width/2,m=e.y+e.height/2,g={x:e.x,y:e.y,width:e.width,height:e.height};let p=o?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,ve(l,.3),1,de(l,.12)]}:{fill:l};t.bgLayer.add(new kp({x:f,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...p,stroke:d,strokeWidth:h,opacity:u,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let p=e.points.flatMap(S=>[S.x,S.y]),y=z(e.points);f=e.points.reduce((S,w)=>S+w.x,0)/e.points.length,m=e.points.reduce((S,w)=>S+w.y,0)/e.points.length,g=y;let b=o?{fillLinearGradientStartPoint:{x:0,y:y.y},fillLinearGradientEndPoint:{x:0,y:y.y+y.height},fillLinearGradientColorStops:[0,ve(l,.3),1,de(l,.12)]}:{fill:l};t.bgLayer.add(new Rl({points:p,closed:!0,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,...b,stroke:d,strokeWidth:h,opacity:u,listening:!1}))}g&&e.role&&t.landmarkBoxes.push(g);for(let p of gn(e))t.bgLayer.add(new Rl({points:p.points.flatMap(y=>[y.x,y.y]),closed:p.closed,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,stroke:p.ink??mn,fill:p.fill,strokeWidth:2,opacity:u*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:p,spec:y}=Tp(t,f,m,e.label,l,g,e.labelStyle);t.primaryFocalLabels.set(p,y),t.freeTextById.set(e.id,{node:p,background:l,kind:"stage"})}else if(r){let p=n||s,y=Dt(t,t.bgLayer,e.label,f,m,p?J(l,"#e6e9f0"):"#9aa3b5",p?18:12,!1);p&&t.primaryFocalLabels.set(y,{targetPx:18,trackingRatio:0,ink:String(y.fill()??""),plateInk:String(y.fill()??""),plate:new Ot({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:y,background:l,kind:"decor"})}else{let p=Dt(t,t.bgLayer,e.label,f,m,"#cbd5e1",16,!0);t.freeTextById.set(e.id,{node:p,background:l,kind:"decor"})}}var Ko=22,Al=Y,Ai=6,Ip=.5;function Tp(t,e,i,o,n,r,s){let a=s?.size??Ko,l=s?.color??t.theme.textColor??"#e6e9f0",c=s?.color??J(n,l),d=r?r.x+r.width/2:e,h=r?r.y+r.height/2:i,u=Mp(t.canvasBackground,n),f=new Ot({x:d,y:h,width:0,height:0,cornerRadius:4,fill:u,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(f);let m=new Xo({x:d,y:h,text:o,fontSize:a,fontStyle:Lo(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/Ko),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/Ko,ink:c,plateInk:s?.color??J(u,l),plate:f}}}function Mp(t,e){return Q(e,X(t)?"#ffffff":"#000000",.34)}function Nl(t,e,i,o,n=0){let r=Math.max(i,1e-4),s=n>0&&r>n?r/n:1,l=Math.min(e.targetPx,Math.max(Al,e.targetPx*Ip)*s)/r,c=y=>{t.letterSpacing(y*e.trackingRatio),o(t,y)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let h=d.height>d.width;t.rotation(h?90:0);let u={width:(h?d.height:d.width)-Ai*2,height:(h?d.width:d.height)-Ai*2},f=Math.min(1,u.width/Math.max(t.width(),1e-6),u.height/Math.max(t.height(),1e-6));if(f<1&&(l=Math.max(Al/r,l*f),c(l)),t.width()<=u.width&&t.height()<=u.height){e.plate.opacity(0),t.fill(e.ink);return}let g=(h?t.height():t.width())+Ai*2,p=(h?t.width():t.height())+Ai;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 Hl(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",o=t.canvasBackground,n=Fn(i,o,Ne),r=t.theme.textColor??"#e6e9f0",s=J(n,r),a=$e(e.points,e.holes,{fill:i,opacity:Ne,stroke:i,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",u=>{t.isGhostClick(u)||t.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{t.container.style.cursor="pointer"}),a.on("mouseleave",()=>{t.container.style.cursor="default"}),t.bgLayer.add(a);let l=Yt(e.points,e.holes),c=t.sections.find(u=>j(l,u.outline,u.holes)),d=Dt(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-8,s,jt,!1),h=Dt(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,Qt,!1);t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:d,background:n,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:n,kind:"ga-capacity",categoryKey:e.categoryKey}),t.gaById.set(e.id,{label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:n,strokeColor:i,labelPoint:l,labelNode:d,capacityNode:h,...c?{sectionId:c.logicalId}:{}})}function Dt(t,e,i,o,n,r,s,a){let l=new Xo({x:o,y:n,text:i,fontSize:s,fontStyle:a?"700":"500",fontFamily:t.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function Gl(t,e){let i=[],o=e.canvasBackground,n=new Map,r=(c,d)=>{let h=n.get(c)??[];h.push(d),n.set(c,h)};for(let c of e.seats){if(c.kind==="booth")continue;let d=c.logicalRowId??c.rowId;r(d,c),d!==c.rowId&&r(c.rowId,c)}let s=c=>c.logicalSeatIndex??Number(c.id.split(":").pop()??0);for(let c of t.objects){if(c.type!=="row")continue;let d=c.segmentedRow?.repeatLabelOnComponents===!0;if(c.segmentedRow&&!d&&c.segmentedRow.componentIndex!==0)continue;let h=d?c.labelPresentation:c.segmentedRow?.labelPresentation??c.labelPresentation;if(h?.visible===!1||h?.positionPreset==="none")continue;let u=c.segmentedRow&&!d?c.segmentedRow.groupId:c.id,f=(n.get(u)??[]).slice().sort((R,A)=>s(R)-s(A));if(!f.length)continue;let m=f[0],g=f[f.length-1],p=h?.labelStyle,y=h?.style==="pill"?It(o):null,b=y?y.plate:o,S=he(b,p?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Je),w=p?.size??An,k=h?.rotation??0,v=e.objectFilteredOut(c)?.15:1,L=f.reduce((R,A)=>R??e.seatSection.get(A.id),void 0),I=c.segmentedRow?.displayLabel??c.displayLabel??bt(c.label,L?.label);if(!I)continue;let M=L?[...new Set([L.id,L.logicalId,L.zone].filter(R=>!!R))]:void 0,x=(R,A,_)=>i.push({text:I,x:R,y:A,rotation:k,fontSize:w,ink:S,opacity:v,...y?{pill:y}:{},...M?.length?{focusKeys:M}:{},..._?{automaticAway:_}:{}});if(h?.position){x(h.position.x,h.position.y);continue}let C=e.seatR+12,T=h?.positionPreset??"start";if(T==="start"||T==="both"){let R=c.rotation*Math.PI/180,A={x:-Math.cos(R),y:-Math.sin(R)};x(m.x+A.x*C,m.y+A.y*C,A)}if(T==="end"||T==="both"){let R=(c.rotation+c.curve)*Math.PI/180,A={x:Math.cos(R),y:Math.sin(R)};x(g.x+A.x*C,g.y+A.y*C,A)}}let a=(e.seatR+12)*2.2,l=[];for(let c of i){let d=l.find(h=>h.text===c.text&&Math.hypot(h.x-c.x,h.y-c.y)<=a);if(d){d.x=(d.x+c.x)/2,d.y=(d.y+c.y)/2;continue}l.push(c)}return l}function Yo(t,e,i=ie){let o=t.rotation()*Math.PI/180,n=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),s=(t.width()*n+t.height()*r)/2+i,a=(t.width()*r+t.height()*n)/2+i;return{x:e.x-s,y:e.y-a,width:s*2,height:a*2}}function Vl(t,e,i,o){let n={x:e.x,y:e.y},r=e.automaticAway;if(!r)return n;let s={x:-r.y,y:r.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=[{x:0,y:0}];for(let u=1;u<=4;u++){let f=a*u;l.push({x:s.x*f,y:s.y*f},{x:-s.x*f,y:-s.y*f},{x:r.x*f,y:r.y*f},{x:(r.x+s.x)*f,y:(r.y+s.y)*f},{x:(r.x-s.x)*f,y:(r.y-s.y)*f})}let c=n,d=1/0,h=1/0;for(let u of l){let f={x:n.x+u.x,y:n.y+u.y},m=Yo(t,f),p=(o?ni(o,m,{mode:"overlap"}).length:0)+i.collisionCount(m),y=Math.hypot(u.x,u.y);if((p<d||p===d&&y<h)&&(c=f,d=p,h=y),p===0)break}return c}var Ei=class{constructor(){this.generationCount=0;this.promises=[];this.errors=[];this.cancels=new Set}get generation(){return this.generationCount}get failures(){return this.errors}pending(){return this.promises.slice()}track(e,i,o,n,r){let s=this.generationCount;/^https?:\/\//i.test(i)&&(e.crossOrigin="anonymous");let a=new Promise(l=>{let c=!1,d=()=>{c||(c=!0,this.cancels.delete(h),l())},h=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}d()};this.cancels.add(h),e.onload=()=>{if(!r.exportMode){s===this.generationCount&&n(),d();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.generationCount&&n()}).catch(()=>{s===this.generationCount&&this.errors.push(`${o} could not be decoded.`)}).finally(d)},e.onerror=()=>{s===this.generationCount&&this.errors.push(`${o} could not be loaded.`),d()},e.src=i});this.promises.push(a)}cancelAll(){this.generationCount++;for(let e of[...this.cancels])e();this.cancels.clear(),this.promises=[],this.errors=[]}};function Wl(t,e){let i=e,o=i._cache instanceof Map?i._cache:null,n=i._canvasCache??o?.get("canvas");if(!n){e.isCached?.()&&e.clearCache();return}let r=[n.scene,n.filter,n.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&t.Util.releaseCanvas(...r),i._canvasCache&&(i._canvasCache=void 0),o?.delete("canvas")}function zl(t,e){let i=0,o=0,n=r=>{i||(i=r),o+=1;let s=r-i;s>=1e3&&(t(Math.round(o*1e3/s)),o=0,i=r),e(requestAnimationFrame(n))};e(requestAnimationFrame(n))}function Rp(t){return t<0?0:t>1?1:t}function Kl(t){let e=t.now??(()=>typeof performance<"u"?performance.now():Date.now()),i=t.budgetMs??8,o=t.reducedMotion===!0,n=t.chunks.length>1?Math.min(30,Math.max(0,840/(t.chunks.length-1))):0,r=0,s=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},h=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},u=p=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,p()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,p()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,p()},16)}},f=()=>{a||s||(a=!0,h(),t.done())},m=p=>{for(let y=c.length-1;y>=0;y--){let b=c[y],S=o?1:Rp((p-b.startedAt)/160);t.fade(b.work,S),S>=1&&c.splice(y,1)}return c.length>0},g=()=>{if(s)return;let p=e(),y=p;for(;r<t.chunks.length&&(r===0||e()-y<i);){let S=t.chunks[r++];if(t.build(S.work),t.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:p+(r-1)*n}),e()-y>=i)break}let b=m(p);t.draw(),r<t.chunks.length||b?u(g):f()};return u(g),{cancel(){if(!a){s=!0,h();for(let p of c)t.fade(p.work,1);c.length=0}},finishNow(){if(!(s||a)){for(;r<t.chunks.length;){let p=t.chunks[r++];t.build(p.work)}for(let p of t.chunks)t.fade(p.work,1);c.length=0,t.draw(),f()}},get done(){return a}}}var Ap={width:40,height:30,rotation:0};function Xl(t,e){let i=1/0,o=1/0,n=-1/0,r=-1/0;for(let s of t){if(s.kind==="booth"){let l=e.boothDims.get(s.rowId)??Ap;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<o&&(o=s.y+m.y),s.x+m.x>n&&(n=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,h=l.height/2,u=Math.abs(d*Math.cos(c))+Math.abs(h*Math.sin(c)),f=Math.abs(d*Math.sin(c))+Math.abs(h*Math.cos(c));s.x-u<i&&(i=s.x-u),s.y-f<o&&(o=s.y-f),s.x+u>n&&(n=s.x+u),s.y+f>r&&(r=s.y+f);continue}let a=e.seatR+(s.accessible&&s.wheelchairSpaceType!=="no-seat"?2.75:0);s.x-a<i&&(i=s.x-a),s.y-a<o&&(o=s.y-a),s.x+a>n&&(n=s.x+a),s.y+a>r&&(r=s.y+a)}return isFinite(i)?{x:i,y:o,width:n-i,height:r-o}:null}function Yl(t){let e=new Map,i=[];for(let n of t.seats){let r=t.sectionIdOf(n.id);if(r==null){i.push(n);continue}let s=e.get(r);s?s.push(n):e.set(r,[n])}let o=[...e.entries()].flatMap(([n,r])=>{let s=t.sections.find(a=>a.id===n);return s?[{chunk:{id:n,work:{seats:r,group:s.liftGroupSeat}},distance:Math.hypot(s.centroid.x-t.viewportCentre.x,s.centroid.y-t.viewportCentre.y)}]:[]}).sort((n,r)=>n.distance-r.distance).map(n=>n.chunk);return i.length&&t.looseGroup&&o.push({id:"",work:{seats:i,group:t.looseGroup}}),o}function Nt(t){return{th:ci*Math.PI/180*t.isoT,sg:1-(1-kt)*t.isoT}}function Ul(t,e){let{th:i,sg:o}=Nt(e),n=e.centre,r=t.x-n.x,s=t.y-n.y,a=r*Math.cos(i)-s*Math.sin(i),l=(r*Math.sin(i)+s*Math.cos(i))*o;return{x:n.x+a,y:n.y+l}}function $l(t,e){let{th:i,sg:o}=Nt(e),n=e.centre,r=t.x-n.x,a=(t.y-n.y)/o,l=r*Math.cos(i)+a*Math.sin(i),c=-r*Math.sin(i)+a*Math.cos(i);return{x:n.x+l,y:n.y+c}}function ql(t,e){let{th:i,sg:o}=Nt(e),n=t*e.isoT;return{x:-(n/o)*Math.sin(i),y:-(n/o)*Math.cos(i)}}function Uo(t,e,i){let o=zn(e);t.offset(i),t.position(ue(e,i)),t.rotation(o.rotationDeg),t.scale({x:o.scaleX,y:o.scaleY}),t.skewX(o.skewX),t.skewY(0)}function Ht(t){t.position({x:0,y:0}),t.offset({x:0,y:0}),t.scale({x:1,y:1}),t.rotation(0),t.skewX(0),t.skewY(0)}function Zl(t,e){let i=Math.hypot(e.x-t.surfaceFocal.x,e.y-t.surfaceFocal.y),o=Math.max(0,i-t.frontDistanceWorld);return t.liftWorld+o*Math.tan(t.rakeDeg*Math.PI/180)}function jl(t,e,i){return t.perspectiveAffine?ue(t.perspectiveAffine,e):ue(i,e)}function qe(t,e){return e?ue(e,t):t}function Ql(t,e){let i=0;for(let h of t.seats){let u=Math.max(0,(h.eyeHeightM??re)-re);i=Math.max(i,u*Qe)}for(let h of t.objects)h.type==="section"&&(i=Math.max(i,Xt(h,{floorBaseHeightM:t.floorBaseHeightMFor(h.id)}).height*Qe));let o=Gn(t.bounds,i),n=ri(o,o.target),r=Vn(n);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let s=1/0,a=1/0,l=-1/0,c=-1/0;for(let h of t.seats){let u=Math.max(0,(h.eyeHeightM??re)-re),f=ke(o,h,u*Qe),m={x:f.x,y:f.y};e.seatProjected.set(h.id,m),e.seatLocal.set(h.id,ue(r,m)),e.seatDepth.set(h.id,f.depth),e.seatScale.set(h.id,f.scale),s=Math.min(s,f.x),a=Math.min(a,f.y),l=Math.max(l,f.x),c=Math.max(c,f.y)}for(let h of[{x:t.bounds.x,y:t.bounds.y},{x:t.bounds.x+t.bounds.width,y:t.bounds.y},{x:t.bounds.x+t.bounds.width,y:t.bounds.y+t.bounds.height},{x:t.bounds.x,y:t.bounds.y+t.bounds.height}]){let u=ke(o,h,0);s=Math.min(s,u.x),a=Math.min(a,u.y),l=Math.max(l,u.x),c=Math.max(c,u.y)}let d=Math.max(24,t.seatR*3);return{camera:o,baseAffine:n,baseInverse:r,bounds:Number.isFinite(s)?{x:s-d,y:a-d,width:Math.max(1,l-s+d*2),height:Math.max(1,c-a+d*2)}:null}}function Jl(t,e,i){let o=i?[...i].map(n=>t.seatById.get(n)).filter(n=>!!n):e?t.seats:[...t.perspectiveAppliedSeats].map(n=>t.seatById.get(n)).filter(n=>!!n);for(let n of o){if(e&&t.perspectiveAppliedSeats.has(n.id))continue;let r=e?t.perspectiveSeatProjected.get(n.id)??n:n,s=e?t.perspectiveSeatScale.get(n.id)??1:1,a=t.circleById.get(n.id);a?.position(r),a?.scale({x:s,y:s});let l=t.accessRingById.get(n.id);l?.position(r),l?.scale({x:s,y:s});let c=t.accessGlyphById.get(n.id);if(c){let h=t.seatR*1.5/Re;c.position(r),c.scale({x:h*s,y:h*s})}let d=t.boothLabelById.get(n.id);d?.position(r),d?.scale({x:s,y:s}),e&&t.perspectiveAppliedSeats.add(n.id)}e||t.perspectiveAppliedSeats.clear()}function Fi(t,e=!0){let i=e?[t.bgLayer,t.seatLayer,t.overlayLayer]:[t.bgLayer,t.overlayLayer];for(let o of i)o.position({x:0,y:0}),o.offset({x:0,y:0}),o.scale({x:1,y:1}),o.rotation(0),o.skewX(0),o.skewY(0)}function ec(t,e=!0){for(let i of t.sections()){Ht(i.rootGroupBg),Ht(i.liftGroupBg),e&&Ht(i.liftGroupSeat),i.rootGroupBg.zIndex(i.bgZIndex),e&&i.liftGroupSeat.zIndex(i.seatZIndex);let o=t.labelLiftGroups.get(i.id);o&&e&&Ht(o),i.perspectiveAffine=void 0,i.perspectiveCorrection=void 0,i.perspectiveDepth=void 0}}function tc(t,e=!0){let i=t.perspectiveCamera(),o=t.perspectiveBaseAffine(),n=t.perspectiveBaseInverse();if(!i||!o||!n)return;let r=t.seats().length>2500&&t.sections().length>0;t.cached()&&!r&&(t.seatLayer.clearCache(),t.seatLayer.listening(!0),t.setCached(!1)),Fi(t,e),ec(t,e);for(let a of[t.bgLayer,t.overlayLayer])Uo(a,o,i.target);t.perspectiveAppliedSeats.clear(),r||t.applyExactSeatAnchors(!0);for(let a of t.sections()){let l=h=>Zl(a,h),c=ri(i,a.centroid,l),d=Wn(n,c);a.perspectiveAffine=c,a.perspectiveCorrection=d,a.perspectiveDepth=ke(i,a.centroid,l(a.centroid)).depth,Uo(a.liftGroupBg,d,a.centroid);for(let h=0;h<a.sideFaces.length;h++){let u=a.outline[h],f=a.outline[(h+1)%a.outline.length],m=qe(ke(i,u,0),n),g=qe(ke(i,f,0),n),p=qe(ke(i,f,l(f)),n),y=qe(ke(i,u,l(u)),n);a.sideFaces[h].points([m.x,m.y,g.x,g.y,p.x,p.y,y.x,y.y]),a.sideFaces[h].opacity(.9)}}let s=[...t.sections()].sort((a,l)=>(l.perspectiveDepth??0)-(a.perspectiveDepth??0));for(let a of s)a.rootGroupBg.moveToTop(),a.liftGroupSeat.moveToTop();t.unsectionedSeatGroup()?.moveToTop(),t.syncSeatOverlayPositions(),r||t.updateSeatGroupVisibility(),t.bgLayer.batchDraw(),t.seatLayer.batchDraw(),t.overlayLayer.batchDraw()}function ic(t){if(ec(t),t.applyExactSeatAnchors(!1),t.isoT()===0)Fi(t);else{let{th:i,sg:o}=Nt(t.isoState()),n=Math.cos(i),r=o*Math.sin(i),s=-Math.sin(i),a=o*Math.cos(i),l=Math.sqrt(n*n+r*r),c=n*a-r*s,d=Math.atan2(r,n)*180/Math.PI,h=l,u=c/l,f=(n*s+r*a)/c,m=t.isoCentre();for(let g of[t.bgLayer,t.seatLayer,t.overlayLayer])g.position({x:m.x,y:m.y}),g.offset({x:m.x,y:m.y}),g.rotation(d),g.scaleX(h),g.scaleY(u),g.skewX(f),g.skewY(0)}t.applyUprightLabels(),t.applyElevation(),t.updateSeatGroupVisibility(),t.bgLayer.batchDraw(),t.seatLayer.batchDraw(),t.overlayLayer.batchDraw()}var oc=(t,e)=>t.length===e.length&&t.every(i=>e.some(o=>Math.abs(i.x-o.x)<.001&&Math.abs(i.y-o.y)<.001));function nc(t,e){let o=(t?.floors?.length?t.floors.flatMap(c=>c.objects):t?.objects??[]).filter(c=>c.type==="section"),n=e.logicalSectionId??e.id,r=c=>(c.elevation??0)===(e.elevation??0)&&JSON.stringify(c.geometry??null)===JSON.stringify(e.geometry??null),s=o.find(c=>c.id===n),a=n!==e.id&&!!s&&r(s)&&(s.holes??[]).some(c=>oc(c,e.outline)),l=o.filter(c=>c.id!==e.id&&c.logicalSectionId===e.id&&r(c));return{hidden:a,holes:(e.holes??[]).filter(c=>!l.some(d=>oc(c,d.outline)))}}import{Group as rc}from"konva/lib/Group";import{Line as Ep}from"konva/lib/shapes/Line";import{Rect as Fp}from"konva/lib/shapes/Rect";import{Text as $o}from"konva/lib/shapes/Text";function sc(t,e){let i=Yt(e.outline,e.holes),o=se(t.canvasBackground),n=[],r=new Map,s=0,a=z(e.outline),l=t.seatIndex?ni(t.seatIndex,a).map(E=>t.seatById.get(E)).filter(E=>!!E):t.seats;for(let E of l)t.seatSection.has(E.id)||j(E,e.outline,e.holes)&&(n.push(E.id),r.set(E.categoryKey,(r.get(E.categoryKey)??0)+1),(t.statusById.get(E.id)??"free")==="free"&&s++);let c=e.color??Zt([...r].map(([E,H])=>({hex:t.catColor.get(E)??"#6e7bff",w:H})),"#3a4358"),d=fn(e.elevation),h=Xt(e,{floorBaseHeightM:t.floorBaseHeightMFor(e.id)}),u=h.height*Qe,f=new rc({listening:!1});t.bgLayer.add(f);let m=new rc({listening:!1});f.add(m);let g=new lt({listening:!0});t.seatLayer.add(g);let p=[];if(u>0){let E=ve(t.zoneColor.get(e.zone??"")??c,.42);for(let H=0;H<e.outline.length;H++){let G=new Ep({points:[],closed:!0,fill:E,stroke:D("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});p.push(G),f.add(G)}}m.moveToTop();let y=m,b=nc(t.chartDoc,e),S=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",w=$e(e.outline,b.holes,{visible:!b.hidden,stroke:D(S,.5),strokeWidth:1,fill:D(S,.08),listening:!1},e.outlinePath);y.add(w);let k=$e(e.outline,b.holes,{visible:!b.hidden,fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Ge,opacity:0,listening:!1},e.outlinePath);y.add(k);let v=e.labelPresentation?.labelStyle,L=v?.color,P=o.sectionInk,I=(v?.size??18)/18,M=new Fp({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});y.add(M);let x=new $o({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*I,fontStyle:Ve,fontFamily:t.labelFont(),fill:he(o.sectionFill,L,P),listening:!1,perfectDrawEnabled:!1});x.offsetX(x.width()/2),x.offsetY(x.height()/2),y.add(x);let C=new $o({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Ve,fontFamily:t.labelFont(),fill:he(o.sectionFill,L,P),opacity:0,listening:!1,perfectDrawEnabled:!1});y.add(C);let T=new $o({x:i.x,y:i.y,text:B("map.seatsLeft",{count:s}),fontSize:12,fontStyle:Tr,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});T.offsetX(T.width()/2),y.add(T);let R={id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:i,labelAnchors:[...e.labelPresentation?.position?[e.labelPresentation.position]:[],...Vs(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(n.map(E=>t.seatById.get(E)?.categoryKey).filter(Boolean)),shellCategoryColor:t.dominantSellableColor(n),shellFill:o.sectionFill,shellStroke:o.sectionStroke,...e.labelPresentation?.position&&!j(e.labelPresentation.position,e.outline,e.holes)?{externalLabel:{position:e.labelPresentation.position,rotation:e.labelPresentation.rotation??0}}:{},labelArea:un(e.outline,e.holes),zone:e.zone,memberIds:n,total:n.length,free:s,baseFill:c,outlineTint:S,outlinePoly:w,blockPoly:k,namePlate:M,nameLabel:x,numberLabel:C,subLabel:T,preferredInk:P,...L?{explicitInk:L}:{},labelScale:I,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,elevation:d,liftWorld:u,rakeDeg:h.rake,surfaceFocal:n.length?{...t.seatById.get(n[0])?.focalPoint??t.isoCentre}:{...t.chartDoc?.focalPoint??t.isoCentre},frontDistanceWorld:0,rootGroupBg:f,bgZIndex:f.zIndex(),seatZIndex:g.zIndex(),liftGroupBg:m,liftGroupSeat:g,sideFaces:p},A=n.map(E=>t.seatById.get(E)).filter(E=>!!E),_=A.length?A:e.outline;return R.frontDistanceWorld=Math.min(..._.map(E=>Math.hypot(E.x-R.surfaceFocal.x,E.y-R.surfaceFocal.y))),R}function ac(t,e,i){if(!e?.length)return;let o=new Set(e),n=t.seats.filter(h=>!o.has(h.categoryKey)||t.seatInClosedSection(h.id)?!1:(t.statusById.get(h.id)??"free")==="free"||t.ownedHold.has(h.id));if(!n.length)return;let r=To(n.map(h=>h.id),t.seatSection);r&&t.focusSection(r);let s=Math.max(24,t.seatR*3),a=n.map(h=>t.renderedSeatPoint(h)),l=t.clusterLabels.boundsForSeats(n.map((h,u)=>({...h,...a[u]})),s),c=ct(a,s);if(l?.singleBlock&&(!t.hasSections||r!=null)){let h=t.clusterLabels.diveTarget(l.bounds,l.anchor);if(h){t.focusRegion(h,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),maxScale:dt(t)});return}}let d={x:c.x+c.width/2,y:c.y+c.height/2};Io({stage:t.stage,box:c,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(d)})||t.focusRegion(c,{animate:i?.animate,durationMs:t.cameraGlideMs})}function dt(t){let e=ml(Math.max(t.seatR,t.markerR));return Math.max(e,At(t.markerR))}function lc(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let o=cc(t,i);if(!o.length)return!1;t.clearSectionFocus();let n=Math.max(24,t.seatR*3),r=ct(o.map(a=>t.renderedSeatPoint(a)),n),s={x:r.x+r.width/2,y:r.y+r.height/2};return Io({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:dt(t)}),!0}function cc(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 dc(t,e,i){let o=i===void 0?t.accessFilter:i;if(!o||!t.sections.some(r=>r.id===e||r.logicalId===e))return!1;let n=t.sectionMembers(e).filter(r=>{if((t.statusById.get(r)??"free")!=="free")return!1;let s=t.seatById.get(r);return s!=null&&Pe(s,o)==="match"});return n.length&&qo(t,n)||t.focusSection(e),!0}function hc(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let o=cc(t,i);if(!o.length)return null;let n=Math.max(24,t.seatR*3),r=ct(o.map(l=>t.renderedSeatPoint(l)),n),s=t.getWorldBounds(),a=s.width>0&&s.height>0&&r.width>=s.width*Mt&&r.height>=s.height*Mt;return{spaces:o.length,sections:jo(t,i),wholeVenue:a}}function qo(t,e,i){let o=e.map(d=>t.seatById.get(d)).filter(d=>d!=null);if(!o.length)return!1;let n=t.seatPitch>0?t.seatPitch:t.seatR*2,r=ct(o.map(d=>t.renderedSeatPoint(d)),Math.max(24,t.seatR*3,n*4)),s=t.getWorldBounds();if(s.width>0&&s.height>0&&r.width>=s.width*Mt&&r.height>=s.height*Mt)return!1;let a=To(o.map(d=>d.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=Math.max(Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),l);return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:c,maxScale:Math.max(dt(t),c)}),!0}function uc(t,e,i=!0,o){let n=t.sectionBounds(e);if(!n)return;let r=t.sectionMembers(e).map(d=>t.seatById.get(d)).filter(d=>d!=null),s=r.filter(d=>(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id)),a=(s.length?s:r).map(d=>t.renderedSeatPoint(d)),l=t.focusedRowLabelGutter(e),c=t.narrowSeatDetailFocus(a,n,o,l);t.focusRegion(c?.bounds??n,{animate:i,minScale:c?.minScale,maxScale:dt(t),focusPaddingPx:l})}function Zo(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let o=pc(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,o),o}function pc(t,e,i){return ya(e.memberIds,i,o=>t.statusById.get(o)??"free",o=>t.seatById.get(o))}function jo(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return[];let o=i===t.accessFilter,n=new Map;for(let r of t.sections){if(t.isSectionClosed(r))continue;let s=o?Zo(t,r):pc(t,r,i);if(s<=0)continue;let a=n.get(r.logicalId);a?a.free+=s:n.set(r.logicalId,{id:r.logicalId,label:r.label,free:s})}return[...n.values()]}var Np=1800,Vt=class Vt{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=xo;this.effSelection=st;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;this.catOrder=[];this.selection=new Set;this.selectedSeatById=new Map;this.selectionMarkers=new Map;this.momentsCache=null;this.breathCache=null;this.ownedCache=null;this.beaconsCache=null;this.hoverCardCache=null;this.ownedHold=new Set;this.seatMarks=new Pi;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.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.zoneColor=new Map;this.hasSections=!1;this.hasBoothText=!1;this.isoT=0;this.isoTarget=0;this.isoRaf=0;this.viewMode="flat";this.perspectiveCamera=null;this.perspectiveBaseAffine=null;this.perspectiveBaseInverse=null;this.perspectiveSeatLocal=new Map;this.perspectiveSeatProjected=new Map;this.perspectiveSeatDepth=new Map;this.perspectiveSeatScale=new Map;this.perspectiveAppliedSeats=new Set;this.perspectiveBounds=null;this.isoCentre={x:0,y:0};this.glideRaf=0;this.labelsVisible=!1;this.labelFadeRaf=0;this.glideInProgress=!1;this.destroyed=!1;this.lodScale=0;this.reducedMotion=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.cameraGlideMs=pl();this.fitScale=1;this.fitPose="";this.viewportInsets={...Go};this.fitClearanceBottom=0;this.seatR=pe;this.markerR=pe;this.seatPitch=0;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 Ei;this.seatReveal=null;this.seatRevealPending=!1;this.revealWorldRect=null;this.progressiveSeatFloor=800;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.zoomSettleRaf=0;this.readingFocusedFrame=!1;this.marquee=null;this.marqueeCur=null;this.organizerStatus=!0;this.onKeyDown=e=>{if(this.opts.manageMode){if((e.metaKey||e.ctrlKey)&&(e.key==="a"||e.key==="A")){e.preventDefault(),this.opts.onMarquee?.(this.selectAllSelectable());return}if(e.key==="Escape"&&this.selection.size){e.preventDefault(),this.clearSelection(),this.opts.onMarquee?.([]);return}}let i=e.key==="ArrowLeft"?{x:-1,y:0}:e.key==="ArrowRight"?{x:1,y:0}:e.key==="ArrowUp"?{x:0,y:-1}:e.key==="ArrowDown"?{x:0,y:1}:null;if(i){e.preventDefault();let o=this.focusedId?this.nearestSeat(this.focusedId,i):this.seats[0]?.id??null;o&&this.focusSeat(o);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let o=this.seatById.get(this.focusedId);o&&this.opts.onFocusSeat?.(o)}};this.focusRingLinger=null;this.cameraHostCache=null;this.projectionHostCache=null;this.seatAnchorContextCache=null;this.interactionHostCache=null;this.movingLabelTimer=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...i},this.exportMode=i.exportMode===!0,this.loadingReveal=i.loadingReveal??"progressive",this.onSeatsRevealed=i.onSeatsRevealed,this.currency=i.currency;let o=_i.pixelRatio;if(this.exportMode&&(this.dpr=1),_i.pixelRatio=this.dpr,this.stage=new _p({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Ri(this.pointerHost),this.exportMode||(e.style.touchAction="none",this.gestures.attach(),e.tabIndex<0&&(e.tabIndex=0),e.setAttribute("role","application"),e.getAttribute("aria-label")||e.setAttribute("aria-label",B("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Qo({listening:!this.exportMode}),this.seatLayer=new Qo({listening:!this.exportMode}),this.overlayLayer=new Qo({listening:!1}),this.labelGroup=new Gt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new Gt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new Gt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new xi({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:()=>At(this.markerR),pickableScale:()=>Ho(this.markerR),categoryLabel:n=>this.catByKey.get(n)?.label??"",categoryColor:n=>this.categoryDisplayColor(n),categoryPriceLabel:n=>this.categoryPriceLabel(n),categoryFilter:()=>this.categoryFilter,viewMode:()=>this.viewMode,seatsPickable:()=>this.seatsPickable(),screenToWorld:n=>this.screenToWorld(n),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(n,r)=>this.focusRegion(n,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new fc({radius:pe+2,stroke:"#ffffff",strokeWidth:2,opacity:Do,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new fc({radius:pe+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&&(_i.pixelRatio=o),!this.exportMode){this.wireInteraction();let n=this.opts.onFps;n&&zl(n,r=>{this.rafId=r})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}setRowBandPreview(e){this.rowBandPreview?.clear(),this.rowBandPreview=e?new Bt: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 bi({overlayLayer:this.overlayLayer,seatLayer:this.seatLayer,stage:this.stage,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,isCached:()=>this.cached,isExportMode:()=>this.exportMode,labelFont:()=>this.labelFont(),viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),seatPoint:e=>this.renderedSeatPoint(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,selectionFocusDims:e=>this.selectionFocusDims(e),categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.categoryPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,i)=>this.nearestSeatToScreen(e,i)})),this.momentsCache}get breath(){return this.breathCache||(this.breathCache=new Si({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}get hoverCard(){return this.hoverCardCache||(this.hoverCardCache=new Li({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,ge,!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.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})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new vi({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>wo(this.effSelection),labelFont:()=>this.labelFont(),stageScale:()=>this.stage.scaleX(),worldToScreen:e=>this.worldToScreen(e),activate:e=>this.activateBeacon(e)})),this.beaconsCache}activateBeacon(e){let i=e.kind==="section"?e.id:this.seatSection.get(e.seatId)?.logicalId??null;if(i&&this.focusOwnedSeatsIn(i)){this.focusSeat(e.seatId,{move:!1,transient:!0});return}if(i){let o=this.sectionTapAnchor(i,this.renderedSeatPoint(this.seatById.get(e.seatId)??{x:0,y:0}));this.opts.onSectionTap?this.opts.onSectionTap(i,o):this.focusSection(i,{anchor:o})}this.focusSeat(e.seatId,{move:!i,transient:!0})}focusedFrameScaleForBounds(){if(this.readingFocusedFrame||!this.focusedSectionId)return 0;this.readingFocusedFrame=!0;try{return this.sectionBounds(this.focusedSectionId)?this.sectionFrameScale(this.focusedSectionId):0}finally{this.readingFocusedFrame=!1}}focusOwnedSeatsIn(e){let i=this.getSelection().map(o=>o.id).filter(o=>{let n=this.seatSection.get(o);return!!n&&(n.logicalId===e||n.id===e)});return i.length>0&&this.focusSeats(i)}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(Is({rung:this.getRung(),sections:this.sections,zones:this.zones,ownedSeatIds:i=>this.ownedSeatIds(i),sectionName:i=>i.nameLabel.text()||i.logicalId,sectionAnchor:i=>this.ownedAnchor(i),sectionCentre:i=>i.centroid})),this.breath.syncBeacons(e.breathingRings())}ownedSeatIds(e){return e.memberIds.filter(i=>this.selection.has(i)||this.ownedHold.has(i))}ownedAnchor(e){let i=this.ownedSeatIds(e).map(r=>this.seatById.get(r)).filter(r=>r!=null).map(r=>this.renderedSeatPoint(r));if(!i.length)return{x:e.nameLabel.x(),y:e.nameLabel.y()};let o=0,n=0;for(let r of i)o+=r.x,n+=r.y;return{x:o/i.length,y:n/i.length}}get owned(){return this.ownedCache||(this.ownedCache=new ki({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>this.ownedAnchor(e),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,i){return this.owned.anchorFor(e)??i}ownedSeatPoints(e){let i=[];for(let o of e.memberIds){if(!this.selection.has(o)&&!this.ownedHold.has(o))continue;let n=this.seatById.get(o);n&&i.push(this.renderedSeatPoint(n))}return i}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),dismissFocusRing:()=>this.dismissFocusRing(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),constrainPan:(e,i)=>this.constrainPan(e,i),marqueeActive:()=>!!this.marquee,marqueeShouldStart:e=>!!(this.opts.manageMode&&this.opts.marqueeSelect&&e.pointerType!=="touch"&&e.button===0&&this.getRung()==="seats"),beginMarquee:e=>this.beginMarquee(e),updateMarquee:e=>this.updateMarquee(e),finishMarquee:()=>this.finishMarquee(),cancelMarquee:()=>this.cancelMarquee(),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 Bt:null,this.rowBandZoomAnchor=null;let o=e===this.chartDoc;if(o||(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??Ut(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let s of e.floors)for(let a of s.objects)this.objectFloor.set(a.id,s.id),a.type==="section"&&a.logicalSectionId&&this.objectFloor.set(a.logicalSectionId,s.id);let n=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.seatLabelPool.clear(),this.rowLabelGroup=new Gt({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 s of this.selectionMarkers.values())s.destroy();this.selectionMarkers.clear(),this.beaconsCache?.clear(),this.breathCache?.syncBeacons([]),this.breathCache?.sync(this.selectionMarkers),o||this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.selectionFocusKeep=null,o||this.statusById.clear(),this.accessFreeBySection.clear(),this.seatAnchorContextCache=null,o||(this.selection.clear(),this.selectedSeatById.clear()),this.seatById.clear(),this.seatIndex=null,this.cached=!1,o||(this.accessFilter=null,this.categoryFilter=null,this.categoryHighlight=null,this.commercialLimitedFilter=!1),this.sections=[],this.zones=[],this.landmarkBoxes=[],this.seatSection.clear(),this.focusedSectionId=null,this.focusBackdrop=null,this.catPrice.clear(),this.zoneColor.clear(),this.lodScale=0,this.hasBoothText=!1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.isoT=0,this.isoTarget=0,this.viewMode="flat",this.perspectiveCamera=null,this.perspectiveBaseAffine=null,this.perspectiveBaseInverse=null,this.perspectiveSeatLocal.clear(),this.perspectiveSeatProjected.clear(),this.perspectiveSeatDepth.clear(),this.perspectiveSeatScale.clear(),this.perspectiveAppliedSeats.clear(),this.perspectiveBounds=null,this.resetLayerTransforms(),this.hasSections=n.objects.some(s=>s.type==="section");for(let s of e.zones??[])s.color&&this.zoneColor.set(s.id,s.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=si(this.theme.seatScale)*pe,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(s=>s.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((s,a)=>{this.cbHueByKey.set(s,fi[a%fi.length])});for(let s of e.categories){this.catColor.set(s.key,s.color),this.catByKey.set(s.key,s);let a=this.categoryPriceRanges===null?void 0:this.categoryPriceRanges?.[s.key]?.min??s.price;typeof a=="number"&&this.catPrice.set(s.key,a)}for(let s of n.objects)s.type==="booth"&&this.boothDims.set(s.id,{width:s.width,height:s.height,rotation:s.rotation,...s.points&&s.points.length>=3?{points:s.points.map(a=>({x:a.x,y:a.y}))}:{}});if(this.seats=Oe(n,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!o){let s=n===e?this.seats:Oe(e);this.canonicalSeatIds=new Set(s.map(a=>a.id))}for(let s of this.seats)this.seatById.set(s.id,s),this.statusById.has(s.id)||this.statusById.set(s.id,"free");this.seatIndex=Hn(this.seats,{seatRadius:this.seatR}),this.seatPitch=Za(this.seats),this.markerR=ja(this.seatR,this.seatPitch),this.clusterLabels.rebuild(),this.bounds=Sn(n,{freeText:"exclude"}),this.isoCentre={x:this.bounds.x+this.bounds.width/2,y:this.bounds.y+this.bounds.height/2},this.buildPerspectiveProjection(n),this.renderBackground(n),this.unsectionedSeatGroup=new Gt({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.seatRevealWanted();this.seatRevealPending=r,this.revealWorldRect=r?Xl(this.seats,{seatR:this.seatR,boothDims:this.boothDims}):null,r||this.renderSeats(),this.buildRowLabelPlan(n),this.overlayLayer.add(this.labelGroup),this.overlayLayer.add(this.fgDecorGroup),this.overlayLayer.add(this.hoverRing),this.overlayLayer.add(this.focusRing),this.mountCachePending=!r,this.zoomToFit(),r&&this.startSeatReveal()}seatRevealWanted(){return this.loadingReveal==="progressive"&&!this.exportMode&&this.sections.length>1&&this.seats.length>=this.progressiveSeatFloor}startSeatReveal(){this.cancelSeatReveal();let e=Yl({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=Kl({chunks:e,build:i=>this.renderSeats(i.seats),fade:(i,o)=>i.group.opacity(o),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.afterViewChange(),this.fitPose&&Xe(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){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:mt(e)};if(this.floorOverview&&e.floors.length>=2)return e.floorOverview==="combined"?xn(e):Ln(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...bn(e),referenceImage:void 0,backgroundImage:mt(e)};let i=e.floors.find(o=>o.id===this.activeFloorId)??e.floors[0];return{...e,objects:i.objects,focalPoint:i.focalPoint,referenceImage:void 0,backgroundImage:mt(i),floors:void 0}}floorBaseHeightMFor(e){let i=this.chartDoc?.floors;if(!i?.length)return 0;let o=this.stacked&&e?this.objectFloor.get(e)??this.activeFloorId:this.activeFloorId;return i.find(n=>n.id===o)?.baseHeightM??0}setStacked(e){!this.chartDoc||e===this.stacked||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.stacked=e,e&&(this.floorOverview=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isStacked(){return this.stacked}setFloorOverview(e){!this.chartDoc||e===this.floorOverview||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.floorOverview=e,e&&(this.stacked=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isFloorOverview(){return this.floorOverview}get separatedFloorOverview(){return this.floorOverview&&this.chartDoc?.floorOverview!=="combined"}setFloorLabelStyle(e){e===this.floorLabelStyle||!this.chartDoc||(this.floorLabelStyle=e,this.floorOverview&&this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}getFloorLabelStyle(){return this.floorLabelStyle}setActiveFloor(e){!this.chartDoc||e===this.activeFloorId&&!this.floorOverview&&!this.stacked||(this.floorOverview=!1,this.stacked=!1,this.setChart(this.chartDoc,{floorId:e}))}getFloors(){return this.chartDoc?Ut(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let o=!1,n=this.hasSections?new Set:null;for(let r of e){if(!this.canonicalSeatIds.has(r))continue;let s=this.statusById.get(r);if(s===i)continue;this.statusById.set(r,i);let a=this.circleById.get(r);if(a&&(this.paintSeat(a,r),o=!0),n){let l=this.seatSection.get(r);l&&(this.accessFreeBySection.delete(l.id),s==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),n.add(l))}}if(n&&n.size){for(let r of n)this.refreshSectionFill(r);this.bgLayer.batchDraw()}o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ee&&this.updateLabels())}setSeatCategories(e){let i=!1,o=new Set;for(let[r,s]of Object.entries(e)){let a=this.seatById.get(r);if(!a||!this.catColor.has(s)||a.categoryKey===s)continue;a.categoryKey=s;let l=this.circleById.get(r);l&&(this.paintSeat(l,r),i=!0);let c=this.seatSection.get(r);c&&o.add(c)}if(!i)return;let n=new Map((this.chartDoc?Ut(this.chartDoc):[]).flatMap(r=>r.objects).filter(r=>r.type==="section").map(r=>[r.id,r]));for(let r of o){if(!n.get(r.id)?.color){let a=new Map;for(let l of r.memberIds){let c=this.seatById.get(l)?.categoryKey;c&&a.set(c,(a.get(c)??0)+1)}r.baseFill=Zt([...a].map(([l,c])=>({hex:this.catColor.get(l)??"#6e7bff",w:c})),"#3a4358")}r.shellCategoryColor=this.dominantSellableColor(r.memberIds),this.refreshSectionFill(r)}o.size&&this.bgLayer.batchDraw(),this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ee&&this.updateLabels()}setOwnedHold(e){let i=new Set((e??[]).filter(n=>this.statusById.has(n))),o=new Set([...this.ownedHold,...i]);this.ownedHold=i;for(let n of o){let r=this.circleById.get(n);r&&this.paintSeat(r,n),this.syncSelectionMarker(n)}o.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ee&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;let o=this.selectionFocusId;this.selectionFocusId=i,this.selectionFocusKeep=Va({focusedId:i,seats:this.seats,seatId:s=>s.id,seatPoint:s=>this.renderedSeatPoint(s),sectionOf:s=>this.seatSection.get(s)?.logicalId??null,seatPitch:this.seatPitch,seatRadius:this.seatR});let r=o!=null&&i!=null&&Wa(o,i,s=>this.seatSection.get(s)?.logicalId??null)?[o,i]:this.seats.map(s=>s.id);for(let s of r){let a=this.circleById.get(s);a&&this.paintSeat(a,s)}o&&this.syncSelectionMarker(o),i&&this.syncSelectionMarker(i);for(let[s,a]of this.selectionMarkers)a.opacity(this.selectionFocusDims(s)?.2:1);this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.updateLabels(),this.overlayLayer.batchDraw()}setSeatMarks(e){let i=this.seatMarks.merge(e,this.statusById);for(let o of i){let n=this.circleById.get(o);n&&this.paintSeat(n,o)}i.size&&(this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}getSeatMark(e){return this.seatMarks.get(e)}getStatus(e){return this.statusById.get(e)??"free"}getSelection(){let e=[];for(let i of this.selection){let o=this.seatById.get(i)??this.selectedSeatById.get(i);o&&e.push(o)}return e}clearSelection(){let e=[...this.selection];for(let i of e)this.setSelected(i,!1,!0);this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let i=[];for(let o of e){if(this.selection.has(o)||!this.isSelectable(o))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(o,!0,!0);let n=this.seatById.get(o);n&&i.push(n)}return i.length&&this.overlayLayer.batchDraw(),i}setManageInteraction(e){this.marquee&&this.cancelMarquee(),this.gestures.resetPan();let i=e.organizerStatus!==!1,o=i!==this.organizerStatus;this.organizerStatus=i,this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let n=[...this.selection].filter(r=>!this.isSelectable(r));n.length&&this.deselect(n),!e.manageMode&&this.selection.size&&this.clearSelection(),this.clusterLabels.syncCursor(!1),o&&this.repaintSectionsAndSeats(),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[i,o]of Object.entries(e??{}))Number.isFinite(o)&&this.sectionHeat.set(i,Math.max(0,Math.min(1,o)));for(let i of this.sections)this.refreshSectionHeat(i);this.bgLayer.batchDraw()}deselect(e){let i=!1;for(let o of e)this.selection.has(o)&&(this.setSelected(o,!1,!0),i=!0);i&&(this.overlayLayer.batchDraw(),this.effScale()>ee&&this.updateLabels())}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let i of this.seats)this.isSelectable(i.id)&&e.push(i.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let i=new Set(e),o=[];for(let n of this.seats)i.has(n.label)&&this.isSelectable(n.id)&&o.push(n.id);return this.selectMany(o)}setEvidenceSelection(e){return!this.seatById.has(e)||!this.isSelectable(e)?!1:(this.selection.size&&this.clearSelection(),this.setSelected(e,!0),this.overlayLayer.batchDraw(),this.selection.has(e))}getSelectableInSection(e){let i=[],o=new Set;for(let n of this.sections)if(!(n.id!==e&&n.logicalId!==e&&n.zone!==e))for(let r of n.memberIds){if(o.has(r)||(o.add(r),!this.isSelectable(r)))continue;let s=this.seatById.get(r);s&&i.push(s)}return i}selectMany(e){let i=e.filter(n=>!this.selection.has(n));if(!i.length)return this.getSelection();let o=this.selection.size+i.length<=dr;for(let n of i)if(o)this.setSelected(n,!0,!0);else{this.selection.add(n);let r=this.circleById.get(n);r&&this.paintSeat(r,n)}return this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}beginMarquee(e){let i=this.screenToWorld(e),o=this.stage.scaleX()||1,n=new Bp({x:i.x,y:i.y,width:0,height:0,stroke:this.effSelection,strokeWidth:1.5/o,dash:[5/o,4/o],fill:"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.overlayLayer.add(n),this.marquee={start:i,rect:n},this.marqueeCur=i,this.overlayLayer.batchDraw()}updateMarquee(e){if(!this.marquee)return;let i=this.screenToWorld(e),{start:o,rect:n}=this.marquee;n.setAttrs({x:Math.min(o.x,i.x),y:Math.min(o.y,i.y),width:Math.abs(i.x-o.x),height:Math.abs(i.y-o.y)}),this.marqueeCur=i,this.overlayLayer.batchDraw()}cancelMarquee(){this.marquee&&(this.marquee.rect.destroy(),this.marquee=null,this.marqueeCur=null,this.overlayLayer.batchDraw())}finishMarquee(){let e=this.marquee;if(this.marquee=null,!e)return;e.rect.destroy(),this.overlayLayer.batchDraw();let i=this.marqueeCur??e.start;this.marqueeCur=null;let o=Math.min(e.start.x,i.x),n=Math.max(e.start.x,i.x),r=Math.min(e.start.y,i.y),s=Math.max(e.start.y,i.y),a=this.stage.scaleX()||1;if((n-o)*a<4&&(s-r)*a<4)return;let l=[];for(let c of this.seats){let d=this.renderedSeatPoint(c);d.x<o||d.x>n||d.y<r||d.y>s||this.isSelectable(c.id)&&l.push(c.id)}this.selectMany(l),this.opts.onMarquee?.(this.getSelection())}flashSeat(e,i="#f43f5e"){let o=this.seatById.get(e);o&&Ma(this.flashHost,e,this.renderedSeatPoint(o),i)}flashSection(e,i="#22a06b"){Ra(this.flashHost,this.sections.filter(o=>o.id===e||o.zone===e),i)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,i)=>this.projectedSectionPoint(e,i),isoLiftLocal:e=>this.isoLiftLocal(e)}}nearestSeat(e,i){let o=this.seatById.get(e);if(!o)return null;let n=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(o.id)??o:o,r=null,s=1/0;for(let a of this.seats){if(a.id===e)continue;let l=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(a.id)??a:a,c=l.x-n.x,d=l.y-n.y,h=c*i.x+d*i.y;if(h<=.5)continue;let u=Math.abs(c*i.y-d*i.x),f=h+u*2.5;f<s&&(s=f,r=a.id)}return r}focusSeat(e,i){let o=this.seatById.get(e);if(!o)return;this.focusedId=e,this.focusRing.radius(this.seatR+3),this.focusRing.position(this.renderedSeatPoint(o));let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;this.focusRing.scale({x:n,y:n}),this.focusRing.visible(!0),this.clearFocusRingLinger(),i?.transient&&(this.focusRingLinger=setTimeout(()=>{this.focusRingLinger=null,this.dismissFocusRing()},Np)),i?.move!==!1&&this.ensureVisible(o),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(o)}clearFocusRingLinger(){this.focusRingLinger&&clearTimeout(this.focusRingLinger),this.focusRingLinger=null}dismissFocusRing(){this.clearFocusRingLinger(),this.focusRing.visible()&&(this.focusRing.visible(!1),this.overlayLayer.batchDraw())}ensureVisible(e){let i=this.stage.width(),o=this.stage.height(),n=Math.max(this.stage.scaleX(),Ae*1.2),r=this.worldToScreen(e),s=70,a=r.x<s||r.x>i-s||r.y<s||r.y>o-s;if(this.stage.scaleX()<n||a){let l=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?ue(this.perspectiveBaseAffine,l):this.isoT===0?l:this.isoForward(l);this.stage.scale({x:n,y:n}),this.stage.position({x:i/2-c.x*n,y:o/2-c.y*n}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=al(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}setFitClearance(e){let i=Math.max(0,e||0);i!==this.fitClearanceBottom&&(this.fitClearanceBottom=i,this.fitPose&&Xe(this.stage)===this.fitPose&&this.zoomToFit())}framingViewport(){return ll(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){let o=this.viewMode==="perspective"?this.perspectiveBounds:null;return sl(e,this.stage.scaleX(),o??this.bounds,this.framingViewport(),i)}framingWorldRect(){return hl(this.framingViewport(),e=>this.screenToWorld(e))}zoomToFit(){el(this.cameraHost)}isSeatRevealPending(){return this.seatRevealPending||this.seatReveal!==null}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,fitClearanceBottom:()=>this.fitClearanceBottom,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),viewMode:()=>this.viewMode,zones:()=>this.zones,markerR:()=>this.markerR,bounds:()=>this.bounds,perspectiveBounds:()=>this.perspectiveBounds,fitScale:()=>this.fitScale,setFitScale:e=>{this.fitScale=e},setFitPose:e=>{this.fitPose=e},revealWorldRect:()=>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 cl(this.stage)}setCameraPose(e){this.cancelGlide(),dl(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()*Vt.ZOOM_STEP,_t(this.framingViewport()))}zoomOut(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()/Vt.ZOOM_STEP,_t(this.framingViewport()))}zoomOutLevel(){this.dismissFocusRing();let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e,{maxScale:this.diveCeiling(),focusPaddingPx:this.focusedRowLabelGutter(e)}),"section"):"venue":this.getRung()==="seats"&&(this.setRung("sections"),this.getRung()!=="seats")?"sections":(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let i of this.gaById.values())e+=i.capacity;return e}worldToScreen(e){let i=this.stage.scaleX(),o=e.id,n=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let a=n?this.perspectiveSeatProjected.get(n.id)??ue(this.perspectiveBaseAffine,e):ue(this.perspectiveBaseAffine,e);return{x:a.x*i+this.stage.x(),y:a.y*i+this.stage.y()}}let r=n?this.renderedSeatPoint(n):e,s=this.isoT===0?r:this.isoForward(r);return{x:s.x*i+this.stage.x(),y:s.y*i+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let i=e===null?null:[...e];if(!this.sameAccessFilter(i)){this.accessFilter=i,this.accessFreeBySection.clear();for(let o of this.sections)this.refreshSectionFill(o);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale());for(let o of this.seats){let n=this.circleById.get(o.id);n&&this.paintSeat(n,o.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let i=this.accessFilter;return i===null||e===null?i===e:i.length===e.length&&i.every((o,n)=>o===e[n])}setCommercialLimitedFilter(e){if(this.commercialLimitedFilter!==e){this.commercialLimitedFilter=e;for(let i of this.seats){let o=this.circleById.get(i.id);o&&this.paintSeat(o,i.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setCategoryFilter(e){let i=e===null?null:new Set(e);if(!la(i,this.categoryFilter)){this.categoryFilter=i,this.lodScale=0,this.updateLOD();for(let o of this.seats){let n=this.circleById.get(o.id);n&&this.paintSeat(n,o.id)}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(){Cl({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=>xl(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<te,effScale:()=>this.effScale(),labelLegible:e=>me(e,this.effScale())})}setGAStates(e){Pl(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,seatPitch:this.seatPitch,cameraGlideMs:this.cameraGlideMs,seatInClosedSection:e=>this.seatInClosedSection(e),isSectionClosed:e=>this.isSectionClosed(e),renderedSeatPoint:e=>this.renderedSeatPoint(e),sectionMembers:e=>this.sectionMembers(e),sectionBounds:e=>this.sectionBounds(e),focusedRowLabelGutter:e=>this.focusedRowLabelGutter(e),seatLabelTargetScale:()=>this.seatLabelTargetScale(),zoomBounds:()=>this.zoomBounds(),rowBandDetailScale:()=>this.rowBandPreview&&this.viewMode==="flat"?this.rowBandPreview.detailScale:0,framingViewport:()=>this.framingViewport(),worldToScreen:e=>this.worldToScreen(e),getWorldBounds:()=>this.getWorldBounds(),narrowSeatDetailFocus:(e,i,o,n)=>this.narrowSeatDetailFocus(e,i,o,n),focusSection:(e,i)=>this.focusSection(e,i),markSectionFocus:(e,i)=>this.markSectionFocus(e,i),clearSectionFocus:()=>this.clearSectionFocus(),focusRegion:(e,i)=>this.focusRegion(e,i)}}focusCategories(e,i){ac(this.focusFramingContext,e,i)}diveCeiling(){return dt(this.focusFramingContext)}focusAccessibleSeats(e){return lc(this.focusFramingContext,e)}focusAccessibleSection(e,i){return dc(this.focusFramingContext,e,i)}accessibleSpread(e){return hc(this.focusFramingContext,e)}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let a=this.viewMode==="isometric"&&this.isoT>0;this.viewMode=e,this.isoTarget=1,this.isoT=1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.applyPerspective(a),this.zoomToFit();return}let i=e==="isometric"?1:0,o=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=i,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),o){this.isoT=i,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=i,this.applyIso(),this.afterViewChange();return}let n=this.isoT;if(n===i){this.applyIso(),this.afterViewChange();return}let r=performance.now(),s=a=>{if(this.destroyed)return;let l=Math.min(1,(a-r)/hr),c=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2;this.isoT=n+(this.isoTarget-n)*c,this.applyIso(),this.scheduleViewChange(),l<1?this.isoRaf=requestAnimationFrame(s):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(s)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),i=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,i)}return this.stage.scaleX()*(1-(1-kt)*this.isoT)}isoForward(e){return Ul(e,this.isoState)}isoInverse(e){return $l(e,this.isoState)}buildPerspectiveProjection(e){let i=Ql({seats:this.seats,objects:e.objects,bounds:this.bounds,seatR:this.seatR,floorBaseHeightMFor:o=>this.floorBaseHeightMFor(o)},{seatLocal:this.perspectiveSeatLocal,seatProjected:this.perspectiveSeatProjected,seatDepth:this.perspectiveSeatDepth,seatScale:this.perspectiveSeatScale});this.perspectiveCamera=i.camera,this.perspectiveBaseAffine=i.baseAffine,this.perspectiveBaseInverse=i.baseInverse,this.perspectiveBounds=i.bounds}projectedSectionPoint(e,i){return jl(e,i,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return qe(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return ql(e,this.isoState)}get projectionHost(){return this.projectionHostCache??={bgLayer:this.bgLayer,seatLayer:this.seatLayer,overlayLayer:this.overlayLayer,labelLiftGroups:this.labelLiftGroups,perspectiveAppliedSeats:this.perspectiveAppliedSeats,seats:()=>this.seats,sections:()=>this.sections,unsectionedSeatGroup:()=>this.unsectionedSeatGroup,cached:()=>this.cached,setCached:e=>{this.cached=e},isoT:()=>this.isoT,isoState:()=>this.isoState,isoCentre:()=>this.isoCentre,perspectiveCamera:()=>this.perspectiveCamera,perspectiveBaseAffine:()=>this.perspectiveBaseAffine,perspectiveBaseInverse:()=>this.perspectiveBaseInverse,applyExactSeatAnchors:(e,i)=>this.applyExactSeatAnchors(e,i),applyUprightLabels:()=>this.applyUprightLabels(),applyElevation:()=>this.applyElevation(),syncSeatOverlayPositions:()=>this.syncSeatOverlayPositions(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility()}}resetLayerTransforms(e=!0){Fi(this.projectionHost,e)}get seatAnchorContext(){return this.seatAnchorContextCache??={seats:this.seats,seatById:this.seatById,seatR:this.seatR,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,perspectiveAppliedSeats:this.perspectiveAppliedSeats,circleById:this.circleById,accessRingById:this.accessRingById,accessGlyphById:this.accessGlyphById,boothLabelById:this.boothLabelById}}applyExactSeatAnchors(e,i){Jl(this.seatAnchorContext,e,i)}applyPerspective(e=!0){tc(this.projectionHost,e)}applyIso(){ic(this.projectionHost)}applyUprightLabels(){let e=ci*this.isoT,i=1/(1-(1-kt)*this.isoT),o=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let n of o){let r=n.find("Text");for(let s of r){let a=s.getAttr("uprightBase");a==null&&(a=s.rotation(),s.setAttr("uprightBase",a)),s.rotation(a-e),s.scaleX(1),s.scaleY(i),s.skewX(0)}}}applyElevation(){let e=this.isoT;for(let i of this.sections){if(i.liftWorld<=0)continue;let o=this.isoLiftLocal(i.liftWorld);i.liftGroupBg?.position(o),i.liftGroupSeat.position(o),this.labelLiftGroups.get(i.id)?.position(o);let n=.9*e;for(let r=0;r<i.sideFaces.length;r++){let s=i.sideFaces[r],a=i.outline[r],l=i.outline[(r+1)%i.outline.length];s.points([a.x,a.y,l.x,l.y,l.x+o.x,l.y+o.y,a.x+o.x,a.y+o.y]),s.opacity(n)}}this.syncSeatOverlayPositions()}destroy(){this.movingLabelTimer&&(clearTimeout(this.movingLabelTimer),this.movingLabelTimer=null),this.rowBandPreview?.clear(),this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.rafId&&cancelAnimationFrame(this.rafId),this.isoRaf&&cancelAnimationFrame(this.isoRaf),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.zoomSettleRaf&&cancelAnimationFrame(this.zoomSettleRaf),this.breathCache?.destroy(),this.momentsCache?.destroy(),this.beaconsCache?.clear(),this.hoverCardCache?.destroy(),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),this.clusterLabels.destroy(),this.container.removeEventListener("keydown",this.onKeyDown),this.stage.destroy()}labelFont(){return this.exportMode?this.theme.fontFamily?.toLowerCase().includes("jetbrains")?"JetBrains Mono, monospace":"Inter, sans-serif":this.theme.fontFamily||"Inter, sans-serif"}seatContainer(e){return this.seatSection.get(e)?.liftGroupSeat??this.unsectionedSeatGroup??this.seatLayer}sectionMatchesFocus(e){let i=this.focusedSectionId;return i==null||e.id===i||e.logicalId===i||e.zone===i}selectionFocusDims(e){return this.selectionFocusId?!(this.selectionFocusKeep?.has(e)??e===this.selectionFocusId):!1}focusedSeatOpacity(e,i){if(!this.focusedSectionId||!this.focusDimOverlay)return i;let o=this.seatSection.get(e);return i*(o&&this.sectionMatchesFocus(o)?1:xe)}sectionScreenBounds(e){return Ws({viewMode:this.viewMode,isoT:this.isoT,stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y(),projectedSectionPoint:(i,o)=>this.projectedSectionPoint(i,o),isoLiftLocal:i=>this.isoLiftLocal(i),isoForward:i=>this.isoForward(i)},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=te,i=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,o=96,n=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>=-o&&c.y+c.height>=-o&&c.x<=n+o&&c.y<=r+o,a&&this.viewMode==="perspective"&&!i&&this.applyExactSeatAnchors(!0,s.memberIds)}s.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(s.id)?.setViewportCulled(!a)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!i&&(this.unsectionedSeatIds||(this.unsectionedSeatIds=this.seats.filter(s=>!this.seatSection.has(s.id)).map(s=>s.id)),this.applyExactSeatAnchors(!0,this.unsectionedSeatIds))}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(let o of i.memberIds){let n=this.seatById.get(o);n&&e.push(n)}for(let i of this.seats)this.seatSection.has(i.id)||e.push(i);return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}renderedSeatPoint(e){if(this.viewMode==="perspective")return this.perspectiveSeatLocal.get(e.id)??e;let i=this.seatSection.get(e.id);if(!i||i.liftWorld<=0||this.isoT===0)return e;let o=this.isoLiftLocal(i.liftWorld);return{x:e.x+o.x,y:e.y+o.y}}seatLabelContainer(e){let i=this.seatSection.get(e);if(!i)return this.labelGroup;let o=this.labelLiftGroups.get(i.id);return o||(o=new lt({listening:!1}),o.setViewportCulled(i.liftGroupSeat.isViewportCulled()),o.position(this.viewMode==="perspective"?{x:0,y:0}:this.isoLiftLocal(i.liftWorld)),this.labelGroup.add(o),this.labelLiftGroups.set(i.id,o)),o}syncSeatOverlayPositions(){if(this.hoveredId){let e=this.seatById.get(this.hoveredId);if(e){this.hoverRing.position(this.renderedSeatPoint(e));let i=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.hoverRing.scale({x:i,y:i})}}if(this.focusedId){let e=this.seatById.get(this.focusedId);if(e){this.focusRing.position(this.renderedSeatPoint(e));let i=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.focusRing.scale({x:i,y:i})}}for(let[e,i]of this.selectionMarkers){let o=this.seatById.get(e);if(o){i.position(this.renderedSeatPoint(o));let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(o.id)??1:1;i.scale({x:n,y:n})}}}renderSeats(e=this.seats){oa({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,colorblind:this.colorblind,canvasBackground:this.canvasBackground,setHasBoothText:()=>{this.hasBoothText=!0},circleById:this.circleById,glyphMarkers:this.glyphMarkers,boothDims:this.boothDims,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,accessRingById:this.accessRingById,catByKey:this.catByKey,perspectiveSeatDepth:this.perspectiveSeatDepth,seatContainer:i=>this.seatContainer(i),buildAccessGlyph:(i,o)=>this.buildAccessGlyph(i,o),paintSeat:(i,o)=>this.paintSeat(i,o),labelFont:()=>this.labelFont()});for(let i of e)this.selection.has(i.id)&&this.syncSelectionMarker(i.id)}buildAccessGlyph(e,i){let o=this.seatR*1.5/Re,n=new Dp({x:e.x,y:e.y,data:Jt(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:ti(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Sl(n),n}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[i,o]of this.accessGlyphById){let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(i)??1:1,r=this.seatR*1.5/Re*n,a=this.accessGlyphFilterEmphasized(i)?or:ir,l=Math.max(r,a/(Re*Math.max(e,.001)));o.scale({x:l,y:l}),o.visible(this.accessGlyphShouldShow(i))}}accessGlyphFilterEmphasized(e){let i=this.seatById.get(e),o=this.accessFilter;return!!i&&o!==null&&!!i.accessibility?.length&&Ce(i,o)}accessGlyphShouldShow(e){return!this.accessGlyphById.has(e)||!this.accessMarkerEligible(e)?!1:!(this.selection.has(e)||this.ownedHold.has(e))}accessRingShouldShow(e){return this.accessRingById.has(e)&&this.accessMarkerEligible(e)}accessMarkerEligible(e){let i=this.statusById.get(e)??"free";return!(i==="booked"||i==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryPriceLabel(e){if(this.categoryPriceRanges===null)return null;let i=this.categoryPriceRanges?.[e];if(i&&i.max>i.min)return`${We(i.min,this.currency)}\u2013${We(i.max,this.currency)}`;let o=this.catPrice.get(e);return typeof o=="number"?We(o,this.currency):null}setCategoryPriceRanges(e){if(JSON.stringify(e)!==JSON.stringify(this.categoryPriceRanges)&&(this.categoryPriceRanges=e==null?e:Object.fromEntries(Object.entries(e).filter(([,i])=>Number.isFinite(i.min)&&Number.isFinite(i.max)&&i.min>=0&&i.max>=i.min).map(([i,o])=>[i,{min:o.min,max:o.max}])),!!this.chartDoc)){if(this.catPrice.clear(),this.categoryPriceRanges!==null)for(let i of this.chartDoc.categories){let o=this.categoryPriceRanges?.[i.key]?.min??i.price;typeof o=="number"&&this.catPrice.set(i.key,o)}this.hoverCardCache?.hide(),this.clusterLabels.rebuild();for(let i of this.zones)i.back.destroy(),i.label.destroy(),i.sub?.destroy();this.zones.length=0,this.renderZones(this.chartDoc),this.updateLOD(),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw()}}categoryDisplayColor(e){return this.colorblind?this.cbHueByKey.get(e)??fi[0]:this.catColor.get(e)??"#6e7bff"}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??Ue}seatLabelInk(e,i){let o=i.fill();return he(typeof o=="string"?o:"",e.labelStyle?.color,this.theme.seatLabelColor??Ue,Je)}get seatPaintContext(){return this.seatPaintCache||(this.seatPaintCache={organizer:()=>this.opts.manageMode===!0&&this.organizerStatus,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),boothWidth:e=>this.boothDims.get(e)?.width,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,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){za(this.seatPaintContext,e,i),this.rowBandPreview?.repaint()}seatInClosedSection(e){if(!this.closedSections.size)return!1;let i=this.seatSection.get(e);return!!i&&(this.closedSections.has(i.id)||this.closedSections.has(i.logicalId)||i.zone!=null&&this.closedSections.has(i.zone))}setColorblindSafe(e){if(e!==this.colorblind){this.colorblind=e;for(let i of this.seats){let o=this.circleById.get(i.id);o&&this.paintSeat(o,i.id)}for(let i of this.sections)i.shellCategoryColor=this.dominantSellableColor(i.memberIds),this.refreshSectionFill(i);this.bgLayer.batchDraw(),this.updateLabels(),this.clusterLabels.rebuild(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setDimmedSections(e){let i=new Set(e??[]);if(!(i.size===this.dimmedSections.size&&[...i].every(o=>this.dimmedSections.has(o)))){this.dimmedSections=i;for(let o of this.seats){let n=this.circleById.get(o.id);n&&this.paintSeat(n,o.id)}this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setClosedSections(e){let i=new Set(e??[]);i.size===this.closedSections.size&&[...i].every(o=>this.closedSections.has(o))||(this.closedSections=i,this.repaintSectionsAndSeats())}focusSection(e,i){this.markSectionFocus(e,i?.anchor??null)&&this.focusSectionCamera(e,!0,i?.anchor)}markSectionFocus(e,i){return this.sections.some(o=>o.id===e||o.logicalId===e)?(this.focusedSectionId=e,this.focusAnchor=i,this.focusRoams=!1,this.sectionDimEnabled()&&this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),!0):!1}focusSeats(e,i){return qo(this.focusFramingContext,e,i)}focusSectionCamera(e,i=!0,o){if(this.rowBandPreview&&this.viewMode==="flat"&&!this.exportMode){let n=this.sectionBounds(e);if(n){let r=Math.min(this.sectionFrameScale(e),this.zoomBounds().max*.85);this.focusRegion(n,{animate:i,maxScale:r});return}}uc(this.focusFramingContext,e,i,o)}releaseSectionFocusDim(){this.cameraGestures+=1,this.focusRoams=!0,this.dropFocusDim()}dropFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}sectionDimEnabled(){return this.sectionFocusDim??this.stage.width()>=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()>=le}atVenueFit(){return this.fitPose!==""&&Xe(this.stage)===this.fitPose}canZoomIn(){return this.stage.scaleX()<this.zoomBounds().max*(1-1e-6)}seatsPickable(){return this.rowBandPreview?.active?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=Ho(this.markerR)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let i=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=Aa(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=Ea(this.focusBackdropHost,i);for(let o of this.selectionMarkers.values())o.moveToTop();this.beaconsCache?.raise(),this.hoverRing.moveToTop(),this.focusRing.moveToTop()}}get focusBackdropHost(){return{bgLayer:this.bgLayer,overlayLayer:this.overlayLayer,bounds:this.bounds,canvasBackground:this.canvasBackground,viewMode:this.viewMode,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,i)=>this.projectedSectionPoint(e,i),isoLiftLocal:e=>this.isoLiftLocal(e),focusedRowLabelCutouts:()=>{let e=this.focusedSectionId;return e?this.rowLabelGroup.find(i=>i.getAttr("rowLabel")===!0).filter(i=>i.getAttr("focusKeys")?.includes(e)).map(i=>{let o=i.getClientRect({relativeTo:this.overlayLayer,skipShadow:!0,skipStroke:!0}),n=2;return[{x:o.x-n,y:o.y-n},{x:o.x+o.width+n,y:o.y-n},{x:o.x+o.width+n,y:o.y+o.height+n},{x:o.x-n,y:o.y+o.height+n}]}):[]}}}repaintSectionsAndSeats(){for(let e of this.seats){let i=this.circleById.get(e.id);i&&this.paintSeat(i,e.id)}for(let e of this.sections)this.refreshSectionFill(e);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){let e=this.screenToWorld({x:0,y:0}),i=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,i.x),y:Math.min(e.y,i.y),width:Math.abs(i.x-e.x),height:Math.abs(i.y-e.y)}}getWorldBounds(){let e=1/0,i=1/0,o=-1/0,n=-1/0,r=(s,a)=>{s<e&&(e=s),a<i&&(i=a),s>o&&(o=s),a>n&&(n=a)};for(let s of this.seats)r(s.x,s.y);for(let s of this.sections)for(let a of s.outline)r(a.x,a.y);for(let s of this.gaById.values())for(let a of s.points)r(a.x,a.y);return Number.isFinite(e)?{x:e,y:i,width:Math.max(1,o-e),height:Math.max(1,n-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(i=>{let o=this.isSectionClosed(i)||i.free<=0,n=i.memberIds.some(a=>this.selection.has(a)),r=n||i.memberIds.some(a=>this.ownedHold.has(a)),s=this.focusedSectionId===i.id||this.focusedSectionId===i.logicalId;return{id:i.logicalId,label:i.label,outline:i.outline.map(a=>({...a})),...this.objectFloor.get(i.id)?{floorId:this.objectFloor.get(i.id)}:{},state:n?"selected":o?"inactive":"available",active:s,paint:{fill:i.shellFill,stroke:i.shellStroke},owned:r}});return{sections:e,seats:e.length?[]:this.seats.map(i=>({x:i.x,y:i.y,categoryKey:i.categoryKey,state:this.selection.has(i.id)?"selected":this.statusById.get(i.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let i=this.worldToScreen(e),o={x:this.stage.x(),y:this.stage.y()};this.stage.position(this.constrainPan({x:o.x+this.stage.width()/2-i.x,y:o.y+this.stage.height()/2-i.y},o)),this.afterViewChange(),this.stage.batchDraw()}panScreenBy(e,i){if(Math.abs(e.x)<.5&&Math.abs(e.y)<.5)return;this.cancelGlide();let o=this.stage.x(),n=this.stage.y(),r=this.constrainPan({x:o+e.x,y:n+e.y},{x:o,y:n}),s=r.x-o,a=r.y-n;if(Math.abs(s)<.5&&Math.abs(a)<.5)return;if(i?.animate===!1||this.reducedMotion||typeof requestAnimationFrame!="function"){this.stage.position({x:r.x,y:r.y}),this.afterViewChange(),this.stage.batchDraw();return}let l=performance.now(),c=Math.max(180,Math.min(1200,this.cameraGlideMs));this.glideInProgress=!0;let d=h=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let u=Math.min(1,(h-l)/c),f=u<.5?4*u*u*u:1-Math.pow(-2*u+2,3)/2;if(this.stage.position({x:o+s*f,y:n+a*f}),this.scheduleViewChange(),this.stage.batchDraw(),u<1){this.glideRaf=requestAnimationFrame(d);return}this.glideRaf=0,this.glideInProgress=!1,this.settleView()};this.glideRaf=requestAnimationFrame(d)}getCameraGestureCount(){return this.cameraGestures}setCategoryHighlight(e){if(this.categoryHighlight!==e){this.categoryHighlight=e;for(let i of this.seats){let o=this.circleById.get(i.id);o&&this.paintSeat(o,i.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}renderBackground(e){let i=mt(e);i&&this.renderBackgroundImage(i);for(let o of e.objects)o.type==="decorImage"&&this.renderDecorImage(o);for(let o of e.objects)o.type==="section"&&this.renderSection(o);for(let o of e.objects)o.type==="shape"?this.renderShape(o):o.type==="gaArea"?this.renderGA(o):o.type==="table"?this.renderTable(o):o.type==="text"&&this.renderText(o);this.renderZones(e)}trackAssetImage(e,i,o,n){this.assets.track(e,i,o,n,{exportMode:this.exportMode})}cancelAssetLoads(){this.assets.cancelAll()}renderBackgroundImage(e){Fl(this.objectDrawContext,e)}get objectDrawContext(){return{bgLayer:this.bgLayer,fgDecorGroup:this.fgDecorGroup,container:this.container,opts:this.opts,theme:this.theme,canvasBackground:this.canvasBackground,catColor:this.catColor,sections:this.sections,freeTextById:this.freeTextById,gaById:this.gaById,iconNodeById:this.iconNodeById,primaryFocalLabels:this.primaryFocalLabels,landmarkBoxes:this.landmarkBoxes,labelFont:()=>this.labelFont(),trackAssetImage:(e,i,o,n)=>this.trackAssetImage(e,i,o,n),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){_l(this.objectDrawContext,e)}renderTable(e){Bl(this.objectDrawContext,e)}renderText(e){Ol(this.objectDrawContext,e)}renderShape(e){Dl(this.objectDrawContext,e)}renderGA(e){Hl(this.objectDrawContext,e)}renderSection(e){let i=sc(this.sectionBuildContext,e);for(let o of i.memberIds)this.seatSection.set(o,i);this.unsectionedSeatIds=null,this.refreshSectionFill(i),this.refreshSectionHeat(i),this.sections.push(i)}get sectionBuildContext(){return{bgLayer:this.bgLayer,seatLayer:this.seatLayer,canvasBackground:this.canvasBackground,seats:this.seats,seatById:this.seatById,seatSection:this.seatSection,seatIndex:this.seatIndex,statusById:this.statusById,catColor:this.catColor,zoneColor:this.zoneColor,chartDoc:this.chartDoc,isoCentre:this.isoCentre,labelFont:()=>this.labelFont(),floorBaseHeightMFor:e=>this.floorBaseHeightMFor(e),dominantSellableColor:e=>this.dominantSellableColor(e)}}refreshSectionHeat(e){ga(this.sectionLodPaintContext,e)}refreshSectionFill(e){ba(this.sectionLodPaintContext,e)}isSectionClosed(e){return Ro(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=Ur(e,o=>this.seatById.get(o)?.categoryKey,o=>this.catByKey.get(o)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return Zo(this.focusFramingContext,e)}accessibleSections(e){return jo(this.focusFramingContext,e)}get sectionLodPaintContext(){return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:e=>e.memberIds.some(i=>this.selection.has(i)||this.ownedHold.has(i)),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:e=>this.sectionAccessibleFree(e),selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.separatedFloorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,viewMode:this.viewMode,glideInProgress:this.glideInProgress,reducedMotion:this.reducedMotion,isoT:this.isoT,seatCount:this.seats.length,lodScale:this.lodScale,fitScale:this.fitScale,setLodScale:e=>{this.lodScale=e},worldToScreen:e=>this.worldToScreen(e)}}renderZones(e){Ys({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,derivedFloorGroups:this.chartDoc?.floorOverview==="combined"&&!this.chartDoc.zones?.length,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let i=this.stage.scaleX(),o={x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i};return this.viewMode==="perspective"&&this.perspectiveBaseInverse?ue(this.perspectiveBaseInverse,o):this.isoT===0?o:this.isoInverse(o)}sectionAt(e){if(!this.sections.length)return null;let i=this.screenToWorld(e),o=this.sections.find(n=>{if(this.viewMode==="perspective"&&n.perspectiveAffine)return j(i,n.outline.map(s=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,s))),n.holes.map(s=>s.map(a=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,a)))));let r=n.liftWorld>0?this.isoLiftLocal(n.liftWorld):{x:0,y:0};return j({x:i.x-r.x,y:i.y-r.y},n.outline,n.holes)});return o?o.logicalId:null}pressLandsOnChart(e){if(this.sectionAt(e)||Ti(this.selectionMarkers,e))return!0;let i=this.screenToWorld(e);for(let o of this.gaById.values())if(j(i,o.points,[]))return!0;return this.owned.badgeAt(i)||this.clusterLabels.clusterAt(i)||this.nearestSeatToScreen(e,ge,!0)?!0:(this.stacked||this.floorOverview)&&this.deckFloorAt()!==null}sectionInteractive(e){let i=this.sections.filter(o=>o.id===e||o.logicalId===e||o.zone===e);return i.length?i.some(o=>!this.isSectionClosed(o)&&o.free>0?!0:o.memberIds.some(n=>this.selection.has(n)||this.ownedHold.has(n))):!0}sectionMembers(e){return[...new Set(this.sections.filter(i=>i.id===e||i.logicalId===e||i.zone===e).flatMap(i=>i.memberIds))]}isSelectable(e){return this.seatInClosedSection(e)||!(this.opts.selectableStatuses??["free"]).includes(this.statusById.get(e)??"free")?!1:!this.hiddenByAccessFilter(e)}hiddenByAccessFilter(e){if(!this.accessFilter||this.selection.has(e))return!1;let i=this.seatById.get(e);return i?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()>ee&&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?$i(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let o=$i(getComputedStyle(i).backgroundColor);if(o)return o;i=i.parentElement}}return xo}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:X(this.canvasBackground)?Zs:st}setSelected(e,i,o=!1){let n=this.circleById.get(e);if(i){this.selection.add(e);let r=this.seatById.get(e);r&&this.selectedSeatById.set(e,r)}else this.selection.delete(e),this.selectedSeatById.delete(e),this.selectionFocusId===e&&this.setSelectionFocus(null),this.focusedId===e&&(this.focusedId=null,this.focusRing.visible(!1),this.overlayLayer.batchDraw());n&&(this.paintSeat(n,e),!o&&!this.cached&&this.seatLayer.batchDraw()),this.syncSelectionMarker(e)}syncSelectionMarker(e){this.moments.syncMarker(e,this.selection.has(e)||this.ownedHold.has(e),this.selectionMarkers),this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){return Ks({sections:this.sections,viewMode:this.viewMode,isoT:this.isoT,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,projectedSectionPoint:(i,o)=>this.projectedSectionPoint(i,o),isoLiftLocal:i=>this.isoLiftLocal(i),isoForward:i=>this.isoForward(i),renderedSeatPoint:i=>this.renderedSeatPoint(i),labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(i,o,n)=>this.resolveAutomaticRowLabelPosition(i,o,n),rowLabelBox:(i,o)=>this.rowLabelBox(i,o)},e)}sectionFrameScale(e){let i=this.sectionBounds(e);return i?Math.min(at(this.stage,i,this.zoomBounds(),Ft(this.framingViewport(),this.focusedRowLabelGutter(e))),Rt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){let i=0;for(let o of this.rowLabelPlan){if(!o.focusKeys?.includes(e))continue;let n=new Op({text:o.text,fontSize:vt,fontStyle:"700",fontFamily:this.labelFont()});i=Math.max(i,n.width(),n.height()),n.destroy()}return i>0?Math.ceil(i+Y+ie*2+6):0}deckFloorAt(){return ra(this.screenPickingHost)}nearestSeatToScreen(e,i,o=!1){return na(this.screenPickingHost,e,i,{includeUnavailable:o})}get screenPickingHost(){return{seats:this.seats,stage:this.stage,seatR:this.seatR,viewMode:this.viewMode,selection:this.selection,objectFloor:this.objectFloor,perspectiveSeatScale:this.perspectiveSeatScale,renderedSeatPoint:e=>this.renderedSeatPoint(e),screenToWorld:e=>this.screenToWorld(e),worldToScreen:e=>this.worldToScreen(e),isSelectable:e=>this.isSelectable(e)}}wireInteraction(){Xa(this.interactionHost)}handleSeatTap(e){Ya(this.interactionHost,e)}get interactionHost(){return this.interactionHostCache??={stage:this.stage,seatLayer:this.seatLayer,overlayLayer:this.overlayLayer,hoverRing:this.hoverRing,clusterLabels:this.clusterLabels,container:this.container,attachHoverCard:()=>this.hoverCard.attach(),moved:()=>this.moved,isGhostClick:e=>this.isGhostClick(e),cached:()=>this.cached,reducedMotion:()=>this.reducedMotion,stacked:()=>this.stacked,floorOverview:()=>this.separatedFloorOverview,viewMode:()=>this.viewMode,focusedSectionId:()=>this.focusedSectionId,sectionCount:()=>this.sections.length,selectionMarkers:()=>this.selectionMarkers,dismissFocusRing:()=>this.dismissFocusRing(),seat:e=>this.seatById.get(e),seatMark:e=>this.seatMarks.get(e),seatSection:e=>this.seatSection.get(e),objectFloor:e=>this.objectFloor.get(e),perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,setHoveredId:e=>{this.hoveredId=e},seatsPickable:()=>this.seatsPickable(),handleSeatTap:e=>this.handleSeatTap(e),seatStatus:e=>this.statusById.get(e)??"free",hasSeatMark:e=>this.seatMarks.has(e),isOwnedHold:e=>this.ownedHold.has(e),isSelected:e=>this.selection.has(e),isSelectable:e=>this.isSelectable(e),hiddenByAccessFilter:e=>this.hiddenByAccessFilter(e),seatInClosedSection:e=>this.seatInClosedSection(e),toggleSeat:e=>this.toggleSeat(e),nudgeSeat:e=>this.moments.nudge(e),renderedSeatPoint:e=>this.renderedSeatPoint(e),nearestSeatToScreen:(e,i,o)=>this.nearestSeatToScreen(e,i,o),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionMatchesFocus:e=>this.sectionMatchesFocus(e),navigateGroupAt:e=>Us({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),ownedBadgeAt:e=>this.owned.badgeAt(e),focusOwnedSeats:e=>this.focusOwnedSeatsIn(e),pressLandsOnChart:e=>this.pressLandsOnChart(e),destroyed:()=>this.destroyed,deckFloorAt:()=>this.deckFloorAt(),screenToWorld:e=>this.screenToWorld(e),effScale:()=>this.effScale(),focusSeats:(e,i)=>this.focusSeats(e,i),focusSection:(e,i)=>this.focusSection(e,i),zoomAbout:(e,i,o)=>this.zoomAbout(e,i,o),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let o=i?this.worldToScreen(i):_t(this.framingViewport());this.zoomAbout(Math.max(this.rowBandPreview.detailScale*1.08,this.stage.scaleX()*1.5),o)}else this.opts.onSectionTap?this.opts.onSectionTap(e,i):this.focusSection(e,{anchor:i})},onBackdropTap:this.opts.onBackdropTap,onDeckTap:this.opts.onDeckTap}}zoomBounds(){return Et(this.cameraHost)}zoomAbout(e,i,o="now"){this.rowBandPreview&&this.focusRoams&&this.viewMode==="flat"&&(this.rowBandZoomAnchor=i),tl(this.cameraHost,e,i,o)}cancelZoomSettle(){il(this.cameraHost)}focusRegion(e,i){ol(this.cameraHost,e,i)}applyLabelVisibility(e){let i=e!==this.labelsVisible;if(this.labelsVisible=e,!i||!e)return;if(this.labelFadeRaf&&(cancelAnimationFrame(this.labelFadeRaf),this.labelFadeRaf=0),this.reducedMotion){this.labelGroup.opacity(1);return}let o=performance.now();this.labelGroup.opacity(0);let n=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let s=Math.min(1,(r-o)/90);this.labelGroup.opacity(s),this.stage.batchDraw(),this.labelFadeRaf=s<1?requestAnimationFrame(n):0};this.labelFadeRaf=requestAnimationFrame(n)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=te?"seats":this.zones.length&&e<He?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,viewMode:this.viewMode,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(e),isoLiftLocal:e=>this.isoLiftLocal(e),seats:this.seats,sections:this.sections,zones:this.zones,seatSection:this.seatSection,statusById:this.statusById,selection:this.selection,circleById:this.circleById,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,seatLabelRungOpen:()=>this.seatLabelRungOpen,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,freeTextById:this.freeTextById,gaById:this.gaById,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,seatR:this.seatR,canvasBackground:this.canvasBackground,effSelection:this.effSelection,categoryFilter:this.categoryFilter,focusedSectionId:this.focusedSectionId,focusBackdrop:this.focusBackdrop,isSelectable:e=>this.isSelectable(e),seatViewportCulled:e=>this.seatViewportCulled(e),focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),Ml(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let i=e==="sections"?(ye+te)/2:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),o=this.framingViewport(),n=o.width,r=o.height,s=_t(this.framingWorldRect()),a=s.x,l=s.y;if(e==="sections"&&this.sections.length>0){let u=this.sections.map(p=>{let y=z(p.outline);return{x:y.x+y.width/2,y:y.y+y.height/2}}),f=n/(i*2),m=r/(i*2);if(!u.some(p=>Math.abs(p.x-s.x)<=f&&Math.abs(p.y-s.y)<=m)){let p=u.reduce((y,b)=>{let S=(b.x-s.x)**2+(b.y-s.y)**2;return S<y.distance?{point:b,distance:S}:y},{point:u[0],distance:1/0});a=p.point.x,l=p.point.y}}let c=e==="seats"?this.seats.filter(u=>u.kind!=="booth"):[];if(c.length>0){let u=c[0],f=1/0;for(let m of c){let g=m.x-s.x,p=m.y-s.y,y=g*g+p*p;y<f&&(u=m,f=y)}a=u.x,l=u.y}let d=n/(i*1.12),h=r/(i*1.12);this.focusRegion({x:a-d/2,y:l-h/2,width:d,height:h})}seatRungScale(){return fl(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,o,n=0){let r=Ft(this.framingViewport(),n);return gl({stageWidth:r.width,stageHeight:r.height,fullBounds:i,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}seatLabelTargetScale(){return nl({seats:this.seats,seatR:this.seatR,labelFont:()=>this.labelFont(),seatLabelScale:e=>this.seatLabelScale(e)})}releaseFocusOnPullBack(){this.rowBandPreview&&this.viewMode==="flat"&&this.focusedSectionId&&this.effScale()>=Math.min(te,this.sectionFrameScale(this.focusedSectionId)*.85)||Ua({focusedSectionId:this.focusedSectionId,roaming:this.focusRoams,floorOverview:this.separatedFloorOverview,effScale:this.effScale()})&&(this.clearSectionFocus(),this.opts.onFocusedSectionChange?.(null))}afterViewChange(){this.releaseFocusOnPullBack(),this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.cancelZoomSettle(),this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){let e=this.rowBandZoomAnchor;if(this.rowBandZoomAnchor=null,!this.focusRoams||this.separatedFloorOverview)return;let i=!!this.rowBandPreview&&this.viewMode==="flat"&&!this.exportMode;if(!this.focusedSectionId&&(!i||this.effScale()<te))return;let n=(i&&e?this.sectionAt(e):null)??zs({sections:this.sections.map(r=>({logicalId:r.logicalId,members:r.memberIds.length,bounds:this.sectionScreenBounds(r)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!n||n===this.focusedSectionId||(this.focusedSectionId=n,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(n))}scheduleViewChange(){this.exportMode||(this.refreshLabelsWhileMoving(),!this.viewChangeRaf&&(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()})))}refreshLabelsWhileMoving(){this.movingLabelTimer||!this.seats.length||this.effScale()<=ee||(this.movingLabelTimer=setTimeout(()=>{this.movingLabelTimer=null,!(this.destroyed||this.exportMode)&&this.updateLabels()},cr))}sizeLabel(e,i,o){e.fontSize(Math.max(1,i)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(o)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),Le+.01,ee):this.effScale(),i=Math.max(e,1e-4);for(let[r,s]of this.primaryFocalLabels)Nl(r,s,i,(a,l)=>{this.sizeLabel(a,l,a.y())},this.fitScale);this.hasSections?(ka(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&this.viewMode==="flat"&&e>=Math.min(te,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:te),()=>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),this.seatGlyphDetail=ia(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail);let o=!this.exportMode&&!this.rowBandPreview?.active&&e<te;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.viewMode==="perspective"&&this.hasSections&&this.seats.length>2500&&o){this.seatLayer.listening(!1);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.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(){Wl(_i,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()<te?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){this.cancelSeatReveal(!0);let e=this.assets.generation,i=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assets.pending(),...i?[i.ready.then(()=>{}),i.load("700 24px Inter").then(()=>{}),i.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assets.generation)throw new Error("The chart changed while its export assets were loading.");if(this.assets.failures.length)throw new Error(`Export stopped because ${this.assets.failures.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(s=>s.getClientRect({relativeTo:this.stage})).filter(s=>s.width>0&&s.height>0);if(!e.length)return this.bounds;let i=Math.min(...e.map(s=>s.x)),o=Math.min(...e.map(s=>s.y)),n=Math.max(...e.map(s=>s.x+s.width)),r=Math.max(...e.map(s=>s.y+s.height));return{x:i,y:o,width:Math.max(1,n-i),height:Math.max(1,r-o)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),i=this.stage.height(),o=Math.max(12,Math.min(36,Math.min(e,i)*.025)),n=()=>{let r=this.exportSceneBounds(),s=Math.max(1,e-o*2),a=Math.max(1,i-o*2),l=Math.min(s/r.width,a/r.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-r.width*l)/2-r.x*l,y:(i-r.height*l)/2-r.y*l}),this.afterViewChange()};n(),n()}captureCanvas(){if(!this.exportMode)throw new Error("captureCanvas() is available only on a renderer created with exportMode.");this.forceDraw();let e;try{e=this.stage.toCanvas({pixelRatio:1,imageSmoothingEnabled:!0})}catch(n){let r=n instanceof Error?n.message:String(n);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${r}`)}let i=document.createElement("canvas");i.width=this.stage.width(),i.height=this.stage.height();let o=i.getContext("2d");if(!o)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");o.fillStyle=this.canvasBackground,o.fillRect(0,0,i.width,i.height);try{o.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ee):this.effScale();for(let{node:i,backdrop:o,kind:n,showAt:r}of this.freeTextById.values()){if(n==="ga-label"||n==="ga-capacity")continue;let s=n==="free-text"&&this.nodeBelongsToFocusedSection(i),a=n==="direct-landmark";if(a){let d=Number(i.getAttr("directLandmarkBaseFontSize"))||i.fontSize();i.setAttr("directLandmarkBaseFontSize",d),i.fontSize(Math.max(d,Y/e))}let l=r==="detail"&&!this.exportMode&&e<ye,c=a||s||!l&&me(i.fontSize(),e);if(i.visible(c),o?.visible(c),!this.exportMode&&n==="free-text"){let d=Math.min(1,Nr/Math.max(i.fontSize()*e,1e-6));i.scale({x:d,y:d}),o?.scale({x:d,y:d})}}for(let{node:i,fontSize:o}of this.iconNodeById.values())i.visible(this.nodeBelongsToFocusedSection(i)||me(o,e))}nodeBelongsToFocusedSection(e){let i=this.focusedSectionId;if(!i)return!1;this.focusMembershipKey!==i&&(this.focusMembership.clear(),this.focusMembershipKey=i);let o=this.focusMembership.get(e);if(o!==void 0)return o;let n=this.sections.filter(s=>s.id===i||s.logicalId===i||s.zone===i),r=!1;if(n.length){let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),a={x:s.x+s.width/2,y:s.y+s.height/2};r=n.some(l=>j(a,l.outline,l.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.rowLabelPlan=Gl(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,o=ie){return Yo(e,i,o)}resolveAutomaticRowLabelPosition(e,i,o){return Vl(e,i,o,this.seatIndex)}objectFilteredOut(e){let i=e.categoryKey;return i?!!(this.categoryHighlight&&i!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(i)):!1}updateLabels(){Ja(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,fitScale:()=>this.fitScale,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),otherSectionCount:()=>this.sections.filter(e=>e.id!==this.focusedSectionId&&e.logicalId!==this.focusedSectionId).length,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),labelGroup:this.labelGroup,rowLabelGroup:this.rowLabelGroup,seatLabelPool:this.seatLabelPool,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,setSeatLabelRungOpen:e=>{this.seatLabelRungOpen=e},visibleSeatCandidates:()=>this.visibleSeatCandidates(),worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,renderedSeatPoint:e=>this.renderedSeatPoint(e),viewMode:this.viewMode,perspectiveSeatScale:this.perspectiveSeatScale,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),hasSelectionMarker:e=>this.selection.has(e)||this.ownedHold.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,i,o)=>this.resolveAutomaticRowLabelPosition(e,i,o),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),isoT:this.isoT,applyUprightLabels:()=>this.applyUprightLabels(),overlayLayer:this.overlayLayer}}handleResize(){this.gestures.invalidateRect();let e=Il({width:this.container.clientWidth,height:this.container.clientHeight,stageWidth:this.stage.width(),stageHeight:this.stage.height()});if(e==="hidden"){this.hiddenPose??=this.getCameraPose();return}let i=this.hiddenPose;if(this.hiddenPose=null,e==="unchanged"){i&&this.setCameraPose(i);return}let o={width:this.stage.width(),height:this.stage.height()};this.stage.size(e),i&&this.setCameraPose(i);let r=!(this.fitPose===""||Xe(this.stage)===this.fitPose)&&e.width===o.width;r&&this.stage.position({x:this.stage.x()+(e.width-o.width)/2,y:this.stage.y()+(e.height-o.height)/2}),this.refitCurrentView(r)}};Vt.ZOOM_STEP=1.4;var Jo=Vt;function mc(t,e){return new Jo(t,e)}function gc(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 en(t,e){let i=t.renderer;if(!i?.focusAccessibleSeats)return!1;let o=e===void 0?t.accessFilter:e;if(!o)return!1;let n=vc(t,o);n&&t.setFloor(n);let r=i.focusAccessibleSeats(o);return r&&t.emitSectionFocus(null),r}function yc(t,e){let i=t.renderer;if(!i?.accessibleSpread)return null;let o=e===void 0?t.accessFilter:e;return o?i.accessibleSpread(o):null}function bc(t,e,i,o){let n=t.renderer;n&&(t.accessFilter&&(i?.accessibleLeft??0)>0&&n.focusAccessibleSection?.(e,t.accessFilter)||(n.focusSection?n.focusSection(e,o?{anchor:o}:void 0):n.focusRegion?.(e)))}function Sc(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let o=vc(t,i);o&&t.setFloor(o);let n=t.renderer,r=n?.accessibleSections?.(i)??[];if(!r.length)return null;let s=t.accessStepAt?r.findIndex(l=>l.id===t.accessStepAt):-1,a=r[(s+1)%r.length];return t.accessStepAt=a.id,n?.focusAccessibleSection?.(a.id,i)||n?.focusSection?.(a.id),t.emitSectionFocus(t.sectionSummary(a.id)),{...a,index:r.indexOf(a),total:r.length}}function vc(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let o=new Set(e),n=l=>o.size===0?!!l.accessible:!!l.accessibility?.some(c=>o.has(c)),r=l=>l.some(c=>c.type==="row"&&(c.overrides??[]).some(n)),s=t.getActiveFloorId(),a=i.floors.find(l=>l.id===s);return a&&r(a.objects)?null:i.floors.find(l=>r(l.objects))?.id??null}function wc(t,e){return t.accessFilter?Pe(e,t.accessFilter)==="other":!1}function kc(t,e){let i=t.renderer;if(!i)return;let o=i.getFocusedSection?.()??null;if(i.clearSectionFocus?.(),e?.length){t.emitSectionFocus(null),t.bandReturnPose||(t.bandReturnPose=i.getCameraPose?.()??null,t.bandReturnSection=t.bandReturnPose?o:null);let r=Hp(t,e);r&&t.setFloor(r),i.focusCategories?i.focusCategories(e):i.zoomToFit();return}let n=t.bandReturnPose!=null;t.bandReturnPose=null,t.bandReturnSection=null,!(t.accessFilter&&en(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),n&&i.zoomToFit())}function Hp(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let o=new Set(e),n=a=>a.some(l=>l.type==="row"&&(o.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||l.type==="gaArea"&&o.has(l.categoryKey)),r=t.getActiveFloorId(),s=i.floors.find(a=>a.id===r);return s&&n(s.objects)?null:i.floors.find(a=>n(a.objects))?.id??null}function Lc(t,e,i){let o=new Map,n=new Map,r=new Map,s=new Map,a=[],l=new Map(yn(t).map(h=>[h.id,h])),c=qt(t),d=new Map(c.sections.map(h=>[h.id,h.label]));for(let h of e){o.set(h.label,h.id),n.set(h.label,h),r.set(h.id,h),a.push(h.id);let u=l.get(h.rowId),f=u&&"label"in u&&typeof u.label=="string"?u.label:void 0,m=u?.type==="row"?u.segmentedRow:void 0,g=m?.displayLabel??(u&&"displayLabel"in u&&typeof u.displayLabel=="string"&&u.displayLabel?u.displayLabel:f),p=i.get(h.rowId),y=u?.type==="table"?"table":u?.type==="booth"?"booth":"seat",b=g,S=m?.displayType?.trim()||(u&&"displayType"in u&&typeof u.displayType=="string"&&u.displayType.trim()?u.displayType.trim():void 0),w=h.displayLabel??h.label,k=w.split("-"),v=p||h.kind==="booth"?void 0:g&&w.startsWith(`${g}-`)?w.slice(g.length+1):k[k.length-1]??w;s.set(h.id,{objectId:h.rowId,objectType:y,sectionLabel:d.get(c.objectToSection.get(h.rowId)??""),rowLabel:b,seatNumber:v,...S?{displayType:S,rowType:S}:{}})}return{labelToId:o,labelToSeat:n,seatById:r,seatContext:s,allIds:a}}function xc(t,e={}){let{baseMs:i=1e3,factor:o=2,maxMs:n=1/0,jitter:r=0,random:s=Math.random}=e,a=Math.min(i*o**Math.max(0,t),n);if(r<=0)return a;let l=Math.min(1,r);return a*(1-l+l*s())}function Cc(t,e,i){return gt(t).map(o=>{let n=t.categories.find(r=>r.key===o.categoryKey);return{id:o.id,label:o.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},capacity:Math.max(0,Math.floor(o.capacity)),available:$t(o).filter(r=>i(r)==="free").length,categoryKey:o.categoryKey,tiers:n?.tiers,price:n?.tiers?.[0]?.price??n?.price??0,currency:e}})}function Pc(t,e){let i={};for(let o of t)i[o.id]=e?{available:o.available,selected:e.get(o.id)??0}:{available:o.available};return i}function Ic(t){let e={};for(let[i,o]of t.seatById)t.groupedTableBySeatId.has(i)||t.closedMembers.has(i)||(t.statusOf(i)??"free")==="free"&&(e[o.categoryKey]=(e[o.categoryKey]??0)+1);for(let i of t.groupedTablesByLabel.values()){if(i.chairs.some(n=>t.closedMembers.has(n.id)))continue;let o=i.chairs[0];o&&(t.statusOf(o.id)??"free")==="free"&&(e[i.categoryKey]=(e[i.categoryKey]??0)+i.maxOccupancy)}for(let i of t.gaAreas??[])e[i.categoryKey]=(e[i.categoryKey]??0)+i.available;return e}function Gp(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function Tc(t,e){let i=new Set,o=new Map;for(let n of t){let r=Gp(n);if(!r.length)continue;let s=e(n.id)==="free";for(let a of r)i.add(a),s&&o.set(a,(o.get(a)??0)+1)}return i.size?Kt.filter(n=>i.has(n.key)).map(n=>({key:n.key,count:o.get(n.key)??0})):[]}var k0=5e3,L0={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function Vp(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 Mc(t){let e=new Set(t.holdLabels),i=t.selection.filter(n=>!e.has(n)&&t.statusOf(n)!=="free");if(!Vp(t))return{lost:i,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let o=[...t.holdLabels];return{lost:i,holdLapsed:!0,lapsedLabels:o,recoverable:o.filter(n=>t.statusOf(n)==="free")}}function x0(t){return t.lost.length>0||t.holdLapsed}function C0(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function Rc(t,e,i=Date.now()){return e&&i<t+5e3}function Ac(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 Ec(t){if(!t?.zones?.length)return[];let e=new Set(qt(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 Fc(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},o=Oe(e).filter(s=>!t.groupedObjectIds.has(s.rowId)),n=new Set;for(let s of o)t.heldLabels.has(s.label)||t.tierApplies(s)&&(t.accessFilter&&!Ce(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&n.add(s.label));let r=jn(o,n,{qty:t.qty,categoryKey:t.categoryKey,zoneId:t.zoneId,focal:i,preferPremium:!0});return r.labels.length!==t.qty?null:r.labels.every(s=>t.isPremium(s))?[...r.labels]:null}var tn=["background","rowLabelColor","textColor","selectionColor"];function _c(t,e){return!t||!e?!t&&!e:tn.every(i=>t[i]===e[i])}function ht(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function Bi(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function Bc(t,e,i){let o=Cn(e,i);o==="all"?t.setFloorOverview?.(!0):o&&t.setActiveFloor?.(o)}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 Oc(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var Oi=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,i){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let o=this.ref;this.pending=e.eventConfiguration(i).then(n=>{if(n.reference.id!==o.id||n.reference.version!==o.version||n.configuration.id!==o.id||n.configuration.version!==o.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return n.configuration})}return this.pending}};async function Dc(t,e,i){if(!t.renderer)return null;let n=e??t.getSelection().map(l=>l.label),r=t.hold_?.items??[],s=[...new Set([...r.map(l=>l.label),...n])];if(!s.length)return null;let a=t.ticketIssue(s);if(a)throw new Me(a);if(t.hold_&&t.holdCovers(s))return t.hold_;try{let l=s.map(d=>{let h=r.find(m=>m.label===d);if(h&&(h.objectType==="ga"||h.quantity!=null||h.tierId!=null))return{label:d,tierId:h.tierId,...h.quantity!=null?{quantity:h.quantity}:{}};let u=t.labelToSeat.get(d),f=u?t.toSeat(u):null;return{label:d,...f?.tierId?{tierId:f.tierId}:{},...t.tableQuantityRequest(f)}}),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 Nc(t,e){if(t.closed||!e||!t.api.resume)return null;let i=await t.api.resume(t.key,e);if(t.closed)return null;let o=[...new Set(i.items.map(n=>n.label))];return o.length?(t.setHold({holdId:i.holdId,labels:o,expiresAt:i.expiresAt,items:i.items},"restored"),t.hold_):null}async function Hc(t,e){let i=t.hold_;if(!i||!t.api.extend)return null;try{let o=await t.api.extend(t.key,i.holdId,e);return t.hold_?.holdId!==i.holdId||t.setHold({holdId:i.holdId,labels:i.labels,expiresAt:o.expiresAt,items:i.items}),t.hold_}catch{return null}}async function Gc(t,e,i,o){let n=t.renderer;if(!n)return null;if(!t.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let r=i??t.getSelection().map(c=>c.label);if(!r.length)return null;let s=t.ticketIssue(r);if(s)throw new 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(h=>{let u=t.labelToSeat.get(h),f=u?t.toSeat(u):null;return{label:h,...f?.tierId?{tierId:f.tierId}:{},...t.tableQuantityRequest(f)}}),o,c);a=d.holdId,t.setHold({holdId:a,labels:[...r],expiresAt:d.expiresAt,items:d.items})}await t.api.book(t.key,r,a,e)}catch(c){let{status:d,conflicts:h,reason:u}=ht(c);if(t.clearHold(),d===409&&u==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&h?.length){let f=new Set(h.map(p=>p.label)),m=t.idsForLabels(f);m.length&&(n.setStatus(m,"booked"),n.deselect(m),t.resetTableQuantitiesForLabels(f));let g=r.filter(p=>!f.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&&(n.setStatus(l,"booked"),n.deselect(l)),t.clearHold(),t.resetTableQuantitiesForLabels(r),t.emitSelectionChange(),t.opts.onBook?.(e),r}async function Vc(t){let e=t.hold_;if(!e)return!0;try{let o=await t.api.release(t.key,e.labels,e.holdId);if(!t.releaseConfirmed(o,e.labels))return await t.resnapshot(),!1}catch(o){return t.emitError(o),!1}if(t.hold_?.holdId!==e.holdId)return!0;t.clearHold(),t.resetTableQuantitiesForLabels(e.labels);let i=t.idsForLabels(e.labels);return i.length&&(t.renderer?.deselect(i),t.renderer?.setStatus(i,"free")),!0}async function Wc(t,e){let i=t.hold_;if(!i)return!0;let o=e.filter(a=>i.labels.includes(a));if(!o.length)return!0;try{let a=await t.api.release(t.key,o,i.holdId);if(!t.releaseConfirmed(a,o))return await t.resnapshot(),!1}catch(a){return t.emitError(a),!1}if(t.hold_?.holdId!==i.holdId)return!0;let n=i.labels.filter(a=>!o.includes(a)),r=i.items?.filter(a=>!o.includes(a.label));n.length?t.setHold({...i,labels:n,items:r}):t.clearHold(),t.resetTableQuantitiesForLabels(o);let s=t.idsForLabels(o);return s.length&&(t.renderer?.deselect(s),t.renderer?.setStatus(s,"free")),!0}function zc(t,e){let i=t?.released;return!Array.isArray(i)||e.every(o=>i.includes(o))}function Kc(t,e){let i=t.hold_;if(!i||i.labels.length!==e.length||!e.every(r=>i.labels.includes(r)))return!1;let o=new Map((i.items??[]).map(r=>[r.label,r.tierId])),n=new Map((i.items??[]).map(r=>[r.label,r.quantity??1]));return e.every(r=>{let s=t.labelToSeat.get(r),a=s?t.toSeat(s):null,l=a?.tierId??null;return(a?.objectType!=="table"||(a.bookingMode!=="variable"||t.confirmedVariableTables.has(r))&&(!n.has(r)||n.get(r)===a.quantity))&&(!o.has(r)||o.get(r)===l)})}function Xc(t,e){let{status:i,conflicts:o}=ht(e);if(i!==409||!o?.length)return;let n=t.renderer;if(!n)return;let r=t.idsForLabels(o.map(s=>s.label));r.length&&(n.deselect(r),n.setStatus(r,"held"),t.resetTableQuantitiesForLabels(o.map(s=>s.label))),t.emitSelectionChange()}function Yc(t,e,i="created"){for(let r of e.items??[])t.groupedTablesByLabel.has(r.label)&&r.quantity!=null&&(t.tableQuantities.set(r.label,r.quantity),t.groupedTablesByLabel.get(r.label)?.mode==="variable"&&t.confirmedVariableTables.add(r.label));let o={...e,seats:t.seatsForLabels(e.labels)};t.hold_=o,t.renderer?.setOwnedHold?.(t.idsForLabels(o.labels)),t.expiryTimer&&clearTimeout(t.expiryTimer);let n=Math.max(0,o.expiresAt-Date.now());t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},n),i==="restored"?t.opts.onHoldRestored?.(o):t.opts.onHold?.(o)}function Uc(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function $c(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(Rc(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function qc(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function Zc(t,e,i,o){if(i!=null&&!Array.isArray(i))throw new TypeError("picker: `selectionValidators` must be an array");let n=[],r=0,s=!1,a=!1;for(let c of i??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");r=Math.max(r,Number(c.minimum))}else if(c?.type==="consecutiveSeats")s=!0;else if(c?.type==="noOrphanSeats")a=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(r&&n.push({type:"minimumSelectedPlaces",minimum:r}),s&&n.push({type:"consecutiveSeats"}),a&&n.push({type:"noOrphanSeats"}),t!=null&&r>t)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let l=Math.max(0,Math.floor(e??t??Math.max(o,r)));if(t!=null&&l<t)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&l<r)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:n,maxSelection:t??l}}function zp(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Kp(t){if(t.length<=1)return!1;let e=t[0]?.objectId,i=t[0]?.categoryKey;if(!e||t.some(n=>n.objectId!==e||n.categoryKey!==i))return!0;let o=t.map(n=>zp(n.id)).sort((n,r)=>n-r);return o.some((n,r)=>n<0||r>0&&n!==o[r-1]+1)}function jc(t,e,i,o,n){let r=o.find(l=>l.type==="minimumSelectedPlaces")?.minimum??0,s=i??r,a=[];return i!=null&&e!==i&&a.push("numberOfPlacesToSelect"),r&&e<r&&a.push("minimumSelectedPlaces"),o.some(l=>l.type==="consecutiveSeats")&&Kp(t)&&a.push("consecutiveSeats"),o.some(l=>l.type==="noOrphanSeats")&&n()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:s,remaining:Math.max(0,s-e),seats:t,violations:a}}function Qc(t){let{id:e,doc:i,seatById:o,groupedTableBySeatId:n}=t,r=v=>v.type==="section"&&(v.id===e||v.logicalSectionId===e),s=i.floors?.find(v=>v.objects.some(r)),a=(s?.objects??i.objects).find(r);if(!a)return null;let l=t.sectionMembers(e),c=new Map,d=new Map,h=new Set,u=0,f=0;for(let v of l){let L=o.get(v);if(!L)continue;t.matchesAccessFilter&&t.statusOf(v)==="free"&&t.matchesAccessFilter(L)&&(f+=1);let P=n.get(v);if(P){if(h.has(P.label))continue;h.add(P.label),c.set(P.categoryKey,(c.get(P.categoryKey)??0)+P.maxOccupancy),t.statusOf(P.chairs[0]?.id??v)==="free"&&(u+=P.maxOccupancy,d.set(P.categoryKey,(d.get(P.categoryKey)??0)+P.maxOccupancy))}else c.set(L.categoryKey,(c.get(L.categoryKey)??0)+1),t.statusOf(v)==="free"&&(u++,d.set(L.categoryKey,(d.get(L.categoryKey)??0)+1))}let m=[...c.entries()].map(([v,L])=>{let P=i.categories.find(T=>T.key===v),I=P?.tiers?.map(T=>T.price).filter(Number.isFinite)??[],M=I.length?I:typeof P?.price=="number"&&Number.isFinite(P.price)?[P.price]:[],x=M.length?Math.min(...M):void 0,C=M.length?Math.max(...M):void 0;return{key:v,count:L,label:P?.label??v,color:P?.color??"#6e7bff",...x!==void 0?{price:x,priceMin:x,priceMax:C}:{}}}).sort((v,L)=>(v.priceMin??1/0)-(L.priceMin??1/0)||v.key.localeCompare(L.key)),g=m.flatMap(v=>v.priceMin===void 0?[]:[v.priceMin]),p=m.flatMap(v=>v.priceMax===void 0?[]:[v.priceMax]),y=a.zone?i.zones?.find(v=>v.id===a.zone):void 0,b=v=>{let L=null,P=0;for(let[I,M]of v)(M>P||M===P&&L!=null&&I<L)&&(L=I,P=M);return L},S=b(d)??b(c),k=(S?m.find(v=>v.key===S)?.color:void 0)??y?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:f}:{},label:a.displayLabel??a.label,zoneLabel:y?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:k,seatsLeft:u,...g.length?{priceMin:Math.min(...g),priceMax:Math.max(...p)}:{},categories:m}}var Di=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,i=!1){if(!i){if(this.inFlight)return this.inFlight;if(this.now()-this.lastSettledAt<this.windowMs)return Promise.resolve()}let o=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===o&&(this.inFlight=null)});return this.inFlight=o,o}markSettled(){this.lastSettledAt=this.now()}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};function Jc(t,e){return t?.source==="socket"&&e.source==="http"?t:e}function ed(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 $p=!0,qp=!0,Zp=10,jp=15e3,td=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new Oi;this.hidden=new Set;this.mapTheme=null;this.closedSections=new Set;this.labelToId=new Map;this.labelToSeat=new Map;this.expandedSeats=[];this.seatTiers=new Map;this.seatById=new Map;this.seatContext=new Map;this.allIds=[];this.groupedTablesByObject=new Map;this.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.connectFallback=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.detachVisibility=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.snapshots=new Di;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=qc(e.numberOfPlacesToSelect);let i=Zc(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Zp);this.selectionValidators=i.validators,this.maxSelection=i.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(o=>typeof o=="string"&&!!o))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=Tn(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let o of tn){let n=this.mapTheme[o];n&&(i[o]=n)}return{...e,theme:i}}setMapTheme(e){return _c(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let i=e.getSelection().map(a=>a.id),o=this.getActiveFloorId(),n=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,s=e.getCameraPose?.();return e.setChart(this.visibleDoc(),o?{floorId:o}:void 0),this.applyRowBandPreview(e),n&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),i.length&&e.select?.(i),r&&e.focusSection?.(r),s&&e.setCameraPose&&e.setCameraPose(s),e.settleView?.(),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let i=e.filter(n=>typeof n=="string");if(i.length===this.hidden.size&&i.every(n=>this.hidden.has(n)))return!1;this.hidden=new Set(i);let o=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),this.renderer&&this.applyRowBandPreview(this.renderer),o&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let i=(e??[]).filter(o=>typeof o=="string");return i.length===this.closedSections.size&&i.every(o=>this.closedSections.has(o))?!1:(this.closedSections=new Set(i),this.renderer?.setClosedSections?.(i),!0)}isSectionClosed(e){return this.closedSections.has(e)}currentHold(){return this.hold_}getRenderer(){return this.renderer}seatByLabel(e){return this.labelToSeat.get(e)}getExpandedSeats(){return this.expandedSeats}loadEventConfiguration(){return this.eventConfiguration.load(this.api,this.key)}idForLabel(e){return this.labelToId.get(e)}idsForLabel(e){let i=this.groupedTablesByLabel.get(e);if(i)return i.chairs.map(n=>n.id);let o=this.labelToId.get(e);return o?[o]:[]}idsForLabels(e){return[...new Set([...e].flatMap(i=>this.idsForLabel(i)))]}tableSelection(e){let i=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return i?this.toTableSeat(i):null}lineItemDisplay(e){if(e.objectType==="ga"){let n=this.visibleDoc(),r=gt(n).find(s=>s.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}if(e.objectType==="table"){let n=this.groupedTablesByLabel.get(e.label);return{...n?.displayLabel&&n.displayLabel!==n.label?{displayLabel:n.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}let i=this.labelToSeat.get(e.label),o=i?this.seatContext.get(i.id):void 0;return{...i?.displayLabel?{displayLabel:i.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}async render(e){if(this.renderer)return null;let i=performance.now(),o={},n=x=>Math.round((performance.now()-x)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(x=>({ok:!0,res:x,elapsed:n(r)}),x=>({ok:!1,error:x,elapsed:n(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(x=>({ok:!0,objects:x,elapsed:n(a)}),()=>({ok:!1,elapsed:n(a)})),c=await s;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=Oc(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let h=performance.now();try{let x=Qn(d.doc,d.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(x.map(C=>[C.objectId,C])),this.groupedTablesByLabel=new Map(x.map(C=>[C.label,C])),this.groupedTableBySeatId=new Map(x.flatMap(C=>C.chairs.map(T=>[T.id,C]))),this.tableQuantities=new Map(x.map(C=>[C.label,C.mode==="whole"?C.capacity:C.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=x.reduce((C,T)=>C+Math.max(0,T.chairs.length-1),0)}catch(x){return this.emitError(x),null}this.expandedSeats=Oe(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let u=Lc(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=u.labelToId,this.labelToSeat=u.labelToSeat,this.seatById=u.seatById,this.seatContext=u.seatContext,this.allIds=u.allIds;for(let x of this.groupedTablesByLabel.values()){let C=x.chairs[0];C&&(this.labelToId.set(x.label,C.id),this.labelToSeat.set(x.label,C))}o.normalizeBuyerModel=n(h);let f=d.event.currency??this.opts.currency;this.currency=f??"USD";let m=performance.now(),g=mc(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:f,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=n(i),this.opts.onSeatsRevealed?.()},onSelect:x=>{this.handleRendererSelect(x)},onDeselect:x=>{this.handleRendererDeselect(x)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(x,C)=>{this.opts.onHover?.(x),this.opts.onSeatHover&&this.opts.onSeatHover(x?this.describeSeat(x,C):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(x,C)=>this.previewSection(x,C),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:x=>this.opts.onSectionFocus?.(x==null||this.isSectionClosed(x)?null:this.sectionSummary(x)),onDeckTap:x=>this.handleDeckTap(x),onFps:this.opts.onFps});if(o.createRenderer=n(m),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,y="free",b=[],S,w=await l;if(w.ok){let x=w.objects;this.hidden=new Set(x.hidden??[]),b=(x.closed??[]).filter(C=>typeof C=="string"),p=x.seats,y=x.default??"free",S=typeof x.fetchedAt=="number"?x.fetchedAt:void 0}if(o.loadStatuses=w.elapsed,this.closed)return g.destroy(),this.renderer=null,null;let k=performance.now();this.opts.categoryPriceRanges&&g.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),g.setChart(this.visibleDoc()),this.applyRowBandPreview(g),Bc(g,d.doc,e.clientWidth),this.opts.colorblindSafe&&g.setColorblindSafe?.(!0),o.buildScene=n(k),this.closedSections=new Set(b);let v=performance.now();b.length&&g.setClosedSections?.(b),this.seatsBuilt=!0;let L=this.pendingSnapshot;this.pendingSnapshot=null;let P=ed(L,p?{seats:p,default:y,fetchedAt:S}:null);P&&this.applySeatsMap(P.seats,P.default,P.source,P.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=n(v);let I=performance.now();g.forceDraw(),o.firstPaint=n(I);let M=performance.now();return w.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),o.startRealtime=n(M),o.controllerTotal=n(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:f,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],i=new Set;for(let o of this.renderer.getSelection()){let n=this.groupedTableBySeatId.get(o.id);n?i.has(n.label)||(i.add(n.label),e.push(this.toTableSeat(n))):e.push(this.toSeat(o))}return e}seatDetails(e){let i=this.seatById.get(e);return i?this.describeSeat(i):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let i=new Set;for(let o of e){let n=this.groupedTableBySeatId.get(o)??this.groupedTablesByLabel.get(o);if(n)n.chairs.forEach(r=>i.add(r.id)),this.hold_?.labels.includes(n.label)||(this.tableQuantities.set(n.label,n.mode==="whole"?n.capacity:n.minOccupancy),n.mode==="variable"&&this.confirmedVariableTables.delete(n.label));else{let r=this.seatById.has(o)?o:this.labelToId.get(o);r&&i.add(r)}}this.renderer?.deselect([...i]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let i=new Set(this.getSelection().map(s=>s.label)),o=new Set,n=[];for(let s of e){let a=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(a)this.tableTierResolution(a).kind==="invalid"?n.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let l=this.seatById.has(s)?s:this.labelToId.get(s);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?n.push(c.label):o.add(l)}}if(n.length&&this.emitError(new Me(eo(n))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let r=this.getSelection().filter(s=>!i.has(s.label));return r.length&&this.emitSelectionChange(),r}selectCategories(e){let i=new Set(e);return this.select([...this.seatById.values()].filter(o=>i.has(o.categoryKey)).map(o=>o.id))}deselectCategories(e){let i=new Set(e);this.deselect(this.getSelection().filter(o=>i.has(o.categoryKey)).map(o=>o.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(o=>typeof o=="string"&&!!o))],this.rebuildSelectableSeatIds();let i=this.renderer?.getSelection().filter(o=>!this.isSelectableByPolicy(o.id)).map(o=>o.id)??[];i.length&&this.deselect(i)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let i=this.getSelection(),o=e??i.reduce((n,r)=>n+(r.quantity??1),0);return jc(i,o,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let i=new Set(e.getSelection().map(o=>o.id));return i.size>0&&Ji(this.seatById.values(),o=>e.getStatus(o),i).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let i of this.selectableObjectRefs){let o=this.groupedTableBySeatId.get(i)??this.groupedTablesByLabel.get(i);if(o){o.chairs.forEach(r=>e.add(r.id));continue}let n=this.seatById.has(i)?i:this.labelToId.get(i);n&&e.add(n)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,i){let o=this.groupedTablesByLabel.get(e);if(!o)return!1;let n=o.mode==="whole"?o.capacity:Math.floor(i);if(!Number.isInteger(n)||n<o.minOccupancy||n>o.maxOccupancy)return!1;let r=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,n),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,i,o){let n=this.groupedTablesByLabel.get(e),r=this.hold_;if(!n||n.mode!=="variable"||!r?.labels.includes(e))return null;let s=Math.floor(i);if(!Number.isInteger(s)||s<n.minOccupancy||s>n.maxOccupancy)return null;if((r.items??[]).filter(d=>d.label!==e).reduce((d,h)=>d+(h.quantity??1),0)+s>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(r.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?s:d.quantity}));if(!l.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,l,o,r.holdId);return this.tableQuantities.set(e,s),this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}setNarrowLayout(e){this.narrowLayout!==e&&(this.narrowLayout=e,this.renderer&&this.applyRowBandPreview(this.renderer))}rowBandsWanted(){return $p&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(qp||!this.narrowLayout)}applyRowBandPreview(e){if(!this.opts.sectionPreview)return;let i=this.rowBandsWanted();e.setRowBandPreview?.(i),i&&e.setSectionFocusDim?.(!1)}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,i)=>e+(i.quantity??1),0)}handleRendererSelect(e){let i=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(i?i.chairs.map(n=>n.id):[e.id]),this.emitSelectionChange();return}if((i?this.tableTierResolution(i):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(i?i.chairs.map(n=>n.id):[e.id]),this.emitError(new Me(eo([i?.label??e.label]))),this.emitSelectionChange();return}if(i){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(i.chairs.map(n=>n.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(i.chairs.map(n=>n.id)),this.opts.onSelect?.(i.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(i)),this.emitSelectionChange();return}if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect([e.id]),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.opts.onSelect?.(e),this.emitSelectionChange()}handleRendererDeselect(e){let i=this.groupedTableBySeatId.get(e.id),o=i?.label??e.label;if(this.opts.retapKeepsSelection&&!i&&(this.hold_?.labels.includes(o)||this.isSelectableByPolicy(e.id))){this.renderer?.select?.([e.id]),this.opts.onSeatRetap?.(this.toSeat(e));return}if(this.hold_?.labels.includes(o)){this.opts.onDeselect?.(i?{...e,label:o}:e);return}i?(this.renderer?.deselect(i.chairs.map(n=>n.id)),this.hold_?.labels.includes(i.label)||(this.tableQuantities.set(i.label,i.mode==="whole"?i.capacity:i.minOccupancy),i.mode==="variable"&&this.confirmedVariableTables.delete(i.label)),this.opts.onDeselect?.(i.chairs[0]??e)):this.opts.onDeselect?.(e),this.emitSelectionChange()}resetUnheldTableQuantities(){for(let e of this.groupedTablesByLabel.values())this.hold_?.labels.includes(e.label)||(this.tableQuantities.set(e.label,e.mode==="whole"?e.capacity:e.minOccupancy),e.mode==="variable"&&this.confirmedVariableTables.delete(e.label))}resetTableQuantitiesForLabels(e){for(let i of e){let o=this.groupedTablesByLabel.get(i);o&&(this.tableQuantities.set(i,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(i))}}tableQuantityRequest(e){if(e?.objectType!=="table")return{};if(e.bookingMode==="variable"&&!this.confirmedVariableTables.has(e.label))throw new Error("picker: confirm a variable table guest quantity before holding");return{quantity:e.quantity}}hold(e,i){return Dc(this,e,i)}resumeHold(e){return Nc(this,e)}extendHold(e){return Hc(this,e)}categoryAvailability(){return Ic({seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,groupedTablesByLabel:this.groupedTablesByLabel,closedMembers:this.closedMemberIds(),statusOf:e=>this.getStatus(e),gaAreas:this.getGAAreas()})}closedMemberIds(){let e=new Set,i=this.renderer;if(!i||!this.closedSections.size)return e;for(let o of this.closedSections)for(let n of i.sectionMembers?.(o)??[])e.add(n);return e}getGAAreas(){let e=this.visibleDoc();return e?Cc(e,this.currency,i=>this.statusOf(i)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Pc(this.getGAAreas(),this.gaSelected))}async holdGA(e,i,o={}){let n=this.visibleDoc();if(!n||!Number.isFinite(i)||i<1)return null;let r=gt(n).find(d=>d.id===e);if(!r)return null;let s=$t(r).filter(d=>!this.hold_?.labels.includes(d)&&this.statusOf(d)==="free").slice(0,Math.floor(i));if(s.length!==Math.floor(i))return null;let a=new Map;for(let d of this.hold_?.items??[])a.set(d.label,{label:d.label,tierId:d.tierId,quantity:d.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let d of this.hold_.seats)a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{}});for(let d of this.getSelection())a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{},...this.tableQuantityRequest(d)});for(let d of s)a.set(d,{label:d,...o.tierId?{tierId:o.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,o.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}hasPremiumSeats(){for(let e of this.labelToSeat.values())if(e.commercial?.premium)return!0;return!1}getBestAvailableZones(){return Ec(this.visibleDoc())}pickPremiumBlock(e,i,o){return Fc({doc:this.visibleDoc(),qty:e,categoryKey:i,zoneId:o,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:n=>this.seatTierResolution(n).kind!=="invalid",statusOfLabel:n=>this.getStatus(this.labelToId.get(n)??"")??"free",isPremium:n=>!!this.labelToSeat.get(n)?.commercial?.premium})}async bestAvailable(e,i,o={}){let n=this.renderer;if(!n)return null;if(o.preferPremium){let r=this.pickPremiumBlock(e,i,o.zoneId);if(r){if(this.hold_&&!await this.release())return null;try{let s=r.map(d=>{let h=this.labelToSeat.get(d),u=h?this.toSeat(h):null;return{label:d,...u?.tierId?{tierId:u.tierId}:{}}}),a=await this.api.hold(this.key,s,o.ttlMs);n.clearSelection();let l=this.idsForLabels(r);l.length&&n.setStatus(l,"held"),this.setHold({holdId:a.holdId,labels:[...r],expiresAt:a.expiresAt,items:a.items});let c=r.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(s){let{status:a,reason:l}=ht(s);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),s}}}if(this.hold_&&!await this.release())return null;try{let r=await this.api.bestAvailable(this.key,e,i,o.zoneId,o.ttlMs);n.clearSelection();let s=this.idsForLabels(r.labels);s.length&&n.setStatus(s,"held"),this.setHold({holdId:r.holdId,labels:[...r.labels],expiresAt:r.expiresAt,items:r.items});let a=r.labels.map(l=>this.labelToSeat.get(l)).filter(l=>!!l).map(l=>this.toSeat(l));return this.opts.onSelectionChange?.(a),this.hold_}catch(r){let{status:s,reason:a}=ht(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,o){return Gc(this,e,i,o)}release(){return Vc(this)}releaseLabels(e){return Wc(this,e)}releaseConfirmed(e,i){return zc(e,i)}setStatus(e,i){this.renderer?.setStatus(e,i)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let i=new Set(e.categories.filter(n=>n.notForSale).map(n=>n.key));if(!i.size)return[];let o=[];for(let[n,r]of this.seatById)i.has(r.categoryKey)&&o.push(n);return o}flashSeat(e,i){this.renderer?.flashSeat(e,i)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let i=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&i&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}setViewportInsets(e){this.viewportInsets=e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:null,this.renderer?.setViewportInsets?.(this.viewportInsets)}setFitClearance(e){this.fitClearance=Math.max(0,e||0),this.renderer?.setFitClearance?.(this.fitClearance)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}seatScreenRadius(){let e=this.renderer?.getCameraPose?.()?.scale??0;return si(this._doc?.theme?.seatScale)*pe*e}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){gc(this.pickerFocusContext,e)}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}get pickerFocusContext(){let e=this;return{renderer:e.renderer,doc:e._doc,get accessFilter(){return e.accessFilter},set accessFilter(i){e.accessFilter=i},get accessStepAt(){return e.accessStepAt},set accessStepAt(i){e.accessStepAt=i},get bandReturnPose(){return e.bandReturnPose},set bandReturnPose(i){e.bandReturnPose=i},get bandReturnSection(){return e.bandReturnSection},set bandReturnSection(i){e.bandReturnSection=i},getActiveFloorId:()=>e.getActiveFloorId(),setFloor:i=>e.setFloor(i),sectionSummary:i=>e.sectionSummary(i),emitSectionFocus:i=>{e.opts.onSectionFocus?.(i)}}}focusAccessibilityFilter(e){return en(this.pickerFocusContext,e)}accessibilitySpread(e){return yc(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return Sc(this.pickerFocusContext,e)}accessibilityFilterDims(e){return wc(this.pickerFocusContext,e)}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let i=this.renderer;!i?.setActiveFloor||e===i.getActiveFloorId?.()&&!i.isFloorOverview?.()||(i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let i=this.renderer;!i?.setStacked||e===i.isStacked?.()||(i.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let i=this.renderer;!i?.setFloorOverview||e===i.isFloorOverview?.()||(i.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let i=this.renderer;i&&(i.setViewMode?.("flat"),i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor?.(e),this.resnapshot(),this.emitSelectionChange(),this.opts.onDeckTap?.(e))}setViewMode(e){this.renderer?.setViewMode?.(e)}getViewMode(){return this.renderer?.getViewMode?.()??"flat"}getRung(){return this.renderer?.getRung?.()??"seats"}getFocusedSection(){return this.renderer?.getFocusedSection?.()??null}seatsRevealed(){let e=this.renderer;return e?.seatsRevealed?e.seatsRevealed():this.getRung()==="seats"||!!this.getFocusedSection()}atVenueFit(){return this.renderer?.atVenueFit?.()}canZoomIn(){return this.renderer?.canZoomIn?.()}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){kc(this.pickerFocusContext,e)}getViewport(){let e=this.renderer;return!e?.getVisibleWorldRect||!e.getWorldBounds?null:{visible:e.getVisibleWorldRect(),bounds:e.getWorldBounds()}}getMinimapSnapshot(){return this.renderer?.getMinimapSnapshot?.()??{sections:[],seats:[]}}panToWorld(e){this.renderer?.panToWorld?.(e)}clearSectionFocus(){this.renderer?.clearSectionFocus?.(),this.opts.onSectionFocus?.(null)}getRenderedQualityEvidence(){return this.renderer?.getRenderedQualityEvidence()??null}focusSection(e,i){this.handleSectionTap(e,i)}focusSeats(e,i){let o=this.renderer;if(!o?.focusSeats?.(e,i))return!1;let n=o.getFocusedSection?.()??null;return this.opts.onSectionFocus?.(n?this.sectionSummary(n):null),!0}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}previewSection(e,i){this.handleSectionTap(e,i)}handleSectionTap(e,i){if(!this.renderer)return;let o=this.isSectionClosed(e)?null:this.sectionSummary(e);bc(this.pickerFocusContext,e,o,i),this.opts.onSectionFocus?.(o)}sectionSummary(e){return!this.renderer||!this._doc?null:Qc({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=>Ce(i,this.accessFilter)}:{}})}clearConnectFallback(){this.connectFallback&&(clearTimeout(this.connectFallback),this.connectFallback=null)}destroy(){if(this.closed=!0,this.seatsBuilt=!1,this.pendingSnapshot=null,this.clearConnectFallback(),this.detachVisibility?.(),this.detachVisibility=null,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null),this.realtime){try{this.realtime.stop()}catch{}this.realtime=null}if(this.ws){try{this.ws.close()}catch{}this.ws=null}this.renderer?.destroy(),this.renderer=null}toSeat(e){let i=this.groupedTableBySeatId.get(e.id);if(i)return this.toTableSeat(i);let o=e.commercial?{commercial:e.commercial}:void 0,n=e.displayLabel?{displayLabel:e.displayLabel}:void 0,r=e.accessibility?.length?{accessibility:e.accessibility}:void 0,s=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,a=this.seatContext.get(e.id),l=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!l)return{id:e.id,label:e.label,...n,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...r,...s};let d=c.tier;return{id:e.id,label:e.label,...n,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...o,...r,...s}}toTableSeat(e){let i=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(s=>ai(this._doc,this.tableTierSeat(e),s.id).kind==="resolved"),n=this.tableTierResolution(e),r=n.kind==="resolved"?n.tier:void 0;return{id:i?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:i?this.seatContext.get(i.id)?.sectionLabel:void 0,rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:r?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:r?.id}:{},objectType:"table",bookingMode:e.mode,quantity:this.tableQuantities.get(e.label)??(e.mode==="whole"?e.capacity:e.minOccupancy),capacity:e.capacity,minOccupancy:e.minOccupancy,maxOccupancy:e.maxOccupancy,physicalSeatIds:e.chairs.map(s=>s.id)}}describeSeat(e,i){let o=this._doc?.categories.find(n=>n.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:o?.label??e.categoryKey,categoryColor:o?.color??"#6e7bff",status:this.renderer?.getStatus(e.id)??"free",mark:this.renderer?.getSeatMark?.(e.id)??null,...i?.interaction?{interaction:i.interaction}:{},...i?.unavailable?{unavailable:!0}:{},...i?.filteredOut?{filteredOut:!0}:{},currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(i=>i.key===e)?.price??0}tiersFor(e){let i=this._doc?.categories.find(o=>o.key===e)?.tiers;return i&&i.length?i:void 0}tiersForSeat(e){if(!this._doc)return;let i=qn(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?ai(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 ai(this._doc,this.tableTierSeat(e),this.seatTiers.get(i))}setSeatTier(e,i){let o=this.seatById.get(e);if(!o)return;let n=this.tiersForSeat(o);if(n){if(i==null)this.seatTiers.delete(e);else if(n.some(r=>r.id===i))this.seatTiers.set(e,i);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let i=[];for(let o of e){let n=this.labelToSeat.get(o);n&&i.push(this.toSeat(n))}return i}emitSelectionChange(){let e=this.getSelection();this.opts.onSelectionChange?.(e),this.emitSelectionValidity(),this.emitOrphanHint()}emitSelectionValidity(){let e=this.getSelectionValidity();e&&(this.opts.onSelectionValidityChange?.(e),e.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(e.seats):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(e),this.lastSelectionValidity=e.isValid)}ticketIssue(e){if(!this._doc)return null;let i=e?this.seatsForLabels(e):this.getSelection();return Zn(this._doc,i.map(o=>({label:o.label,...o.tierId?{tierId:o.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let i=this.ticketIssue();if(i){this.hintShown=!0,this.opts.onHint(i.code==="companion_pair_required"?B("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=this.selectionValidators.some(s=>s.type==="noOrphanSeats"),n=new Set(e.getSelection().map(s=>s.id));(o&&n.size?Ji(this.seatById.values(),s=>e.getStatus(s),n):[]).length>0?(this.hintShown=!0,this.opts.onHint(B("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}setSectionFocusDim(e){this.renderer?.setSectionFocusDim?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){return Kc(this,e)}handle409Conflicts(e){Xc(this,e)}setHold(e,i="created"){Yc(this,e,i)}clearHold(){Uc(this)}expireActiveHold(){return $c(this)}applySeatsMap(e,i="free",o="http",n){o==="socket"&&(this.socketVersion+=1);let r=this.renderer;if(!r||!this.seatsBuilt){this.pendingSnapshot=Jc(this.pendingSnapshot,{seats:e,default:i,source:o,...n===void 0?{}:{fetchedAt:n}});return}let s=this.seatsMapDiffers(e,i);this.lastSnapshotAt=n??Date.now(),this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=i;let a=Bi(i);this.allIds.length&&r.setStatus(this.allIds,a),r.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let l={free:[],held:[],booked:[],not_for_sale:[]};for(let[d,h]of Object.entries(e))l[Bi(h)].push(...this.idsForLabel(d));["free","held","booked","not_for_sale"].forEach(d=>{d!==a&&l[d].length&&r.setStatus(l[d],d)});let c=this.notForSaleCategorySeatIds();c.length&&r.setStatus(c,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:s})}snapshotIsFresh(e=5e3){return this.lastSnapshotAt>0&&Date.now()-this.lastSnapshotAt<e}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(i=>this.statusOf(i)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let i=this.socketVersion,o=await this.api.objects(this.key);this.socketVersion===i&&this.applySeatsMap(o.seats,o.default??"free","http",o.fetchedAt)},e)}resync(e){return e?.reason==="connect"&&this.snapshotIsFresh()?Promise.resolve():this.resnapshot()}applyProjection(e){this.applySeatsMap(e.exceptions,e.default,"socket")}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,i=Mc({selection:this.getSelection().map(o=>o.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:o=>this.statusOf(o)});if(i.lost.length&&this.deselect(i.lost),i.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(i.lapsedLabels);let o=this.idsForLabels(i.lapsedLabels);o.length&&this.renderer?.deselect(o),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(i),i}getAccessNeeds(){return Tc(this.seatById.values(),e=>this.getStatus(e)??"free")}attachVisibility(){this.detachVisibility||(this.detachVisibility=Ac(()=>{this.closed||this.refreshAvailability().then(()=>{this.closed||this.renderer?.forceDraw()})}))}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applyProjection(e),resync:e=>this.resync(e),onSections:(e,i)=>{let o=this.syncHidden(e),n=this.syncClosed(i);o&&this.resnapshot(),(o||n)&&this.opts.onStatusChange?.({changed:!0})}}}seatsMapDiffers(e,i){if(this.lastSnapshotAt===0||i!==this.liveDefault)return!0;let o=Object.entries(e);if(o.length!==this.liveStatuses.size)return!0;for(let[n,r]of o)if(this.liveStatuses.get(n)!==r)return!0;return!1}applyStatusChanges(e){this.socketVersion+=1;let i=this.renderer;if(!i)return;let o=e.some(n=>this.liveStatuses.get(n.label)!==n.status);for(let n of e){this.liveStatuses.set(n.label,n.status);let r=this.idsForLabel(n.label);if(!r.length)continue;let s=Bi(n.status);this.opts.flashOnLiveChange&&s!=="free"&&r.some(a=>i.getStatus(a)==="free")&&!this.hold_?.labels.includes(n.label)&&r.forEach(a=>i.flashSeat(a,s==="held"?"#f4b740":"#f43f5e")),i.setStatus(r,s)}this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&i.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:o})}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let o=null;try{o=this.api.createRealtime(this.key,this.realtimeSink())}catch{o=null}if(o){this.realtime=o,o.start();return}}if(this.realtime)return;let i;try{let o=this.api.socketProtocols?.(this.key);i=o&&o.length?new WebSocket(e,o):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=i,i.onopen=()=>{if(this.attempt=0,!this.snapshotIsFresh()){this.resnapshot();return}this.clearConnectFallback(),this.connectFallback=setTimeout(()=>{this.connectFallback=null,this.resnapshot()},2500)},i.onmessage=o=>{this.clearConnectFallback();let n;try{n=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(!this.renderer||!n||typeof n!="object")return;let s=n;Array.isArray(s.hidden)&&this.syncHidden(s.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.({changed:!0})),Array.isArray(s.closed)&&this.syncClosed(s.closed)&&this.opts.onStatusChange?.({changed:!0}),s.type!=="hidden"&&(s.seats&&typeof s.seats=="object"?this.applySeatsMap(s.seats):Array.isArray(s.changes)&&this.applyStatusChanges(s.changes))},i.onclose=()=>{this.ws===i&&(this.ws=null),this.scheduleReconnect()},i.onerror=()=>{try{i.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),i=xc(e,{baseMs:1e3,maxMs:jp,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var Qp=5,Jp=-1.1,on=35;function nn(t,e){let i=t-re,o=Math.atan2(Qp-i,e)*180/Math.PI,n=Math.atan2(Jp-i,e)*180/Math.PI;return n<-on&&(o+=-on-n,n=-on),{topPitch:o,basePitch:n}}var oe=2048,be=1024,zt=pn,O=Math.PI*2,ef=be/180,pt=t=>(t+180)/360*oe,$=t=>(90-t)/180*be;function sd(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 ad(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 Ni=96,an=360/Ni,tf=.6,rn=[17,23,42];function sn(t,e,i=1){let o=Math.max(0,Math.min(.58,e)),n=Math.round(t[0]+(rn[0]-t[0])*o),r=Math.round(t[1]+(rn[1]-t[1])*o),s=Math.round(t[2]+(rn[2]-t[2])*o);return`rgba(${n},${r},${s},${i})`}function id(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 ae(t,e,i){let o=(1-Math.abs(2*i-1))*e,n=(t%360+360)%360/60,r=o*(1-Math.abs(n%2-1)),s=0,a=0,l=0;n<1?[s,a,l]=[o,r,0]:n<2?[s,a,l]=[r,o,0]:n<3?[s,a,l]=[0,o,r]:n<4?[s,a,l]=[0,r,o]:n<5?[s,a,l]=[r,0,o]:[s,a,l]=[o,0,r];let c=i-o/2;return[Math.round((s+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var od=new Map;function nd(t){if(!t)return null;let e=od.get(t);if(e)return e;let i=2166136261;for(let r=0;r<t.length;r++)i^=t.charCodeAt(r),i=Math.imul(i,16777619);let o=(i>>>0)%360,n=ae(o,.3,.42);return od.set(t,n),n}function of(t,e,i,o){let n=new Array(Ni).fill(null),r=0,s=t.sectionId;for(let a of e){if(a.id===t.id)continue;let l=a.sectionId;if(!l||s&&l===s)continue;let c=a.x-t.x,d=a.y-t.y,h=Math.hypot(c,d)*zt;if(h<1.5||h>95)continue;let u=a.eyeHeightM??re,f=u-o;Math.abs(f)>r&&(r=Math.abs(f));let m=Math.atan2(f,h)*180/Math.PI,g=Math.atan2(u-re-o,h)*180/Math.PI,y=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,b=Math.min(Ni-1,Math.max(0,Math.floor((y+180)/an))),S=m>34&&h<16,w=n[b];w?(m>w.top&&(w.top=m),g<w.base&&(w.base=g),h<w.nearM&&(w.nearM=h,w.tint=nd(a.categoryKey)),w.overhead=w.overhead||S):n[b]={top:m,base:g,nearM:h,overhead:S,tint:nd(a.categoryKey)}}return{bins:n,maxDelta:r}}function nf(t,e,i,o){for(let n=0;n<Ni;n++){let r=e[n];if(!r)continue;let s=-180+n*an,a=i(s),l=i(s+an);if(!(l>a))continue;let c=Math.min(72,r.top),d=Math.min(r.base,-4),h=o(c),u=o(d);if(u<=h)continue;let f=r.nearM/95,m=r.tint,g=m?id([44,54,80],m,.34):[44,54,80],p=m?id([24,30,48],m,.28):[24,30,48],y=t.createLinearGradient(0,h,0,u);y.addColorStop(0,sn(g,f)),y.addColorStop(.24,sn(p,f)),y.addColorStop(1,sn([10,13,22],f)),t.fillStyle=y,t.fillRect(a,h,l-a+1,u-h),t.fillStyle=`rgba(150,165,205,${.35*(1-f*.55)})`,t.fillRect(a,h,l-a+1,1.5);let S=Math.min(u,o(0))-h;if(S>8){let k=1-f*.4;for(let v=1;v<6;v++){let L=h+S*v/6;t.fillStyle=`rgba(0,0,0,${.16*k})`,t.fillRect(a,L,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*k})`,t.fillRect(a,L+1.5,l-a+1,1.2)}}if(r.overhead){let w=o(Math.min(86,c+12)),k=t.createLinearGradient(0,w,0,h);k.addColorStop(0,"rgba(3,4,8,0.9)"),k.addColorStop(1,"rgba(3,4,8,0)"),t.fillStyle=k,t.fillRect(a,w,l-a+1,h-w),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,h-1.5,l-a+1,1.5)}}}function rf(t,e,i){let n=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let y of i){a++,y.sectionId&&s.add(y.sectionId);let b=y.x-e.x,S=y.y-e.y,w=Math.hypot(b,S)*zt;if(w<.5)continue;let k=Math.atan2(b,-S),v=Math.floor((k+Math.PI)/O*72);v<0?v=0:v>=72&&(v=71),n[v]=!0,w<r[v]&&(r[v]=w)}let l=0,c=[];for(let y=0;y<72;y++)n[y]&&(l++,c.push(r[y]));let d=l/72*360;c.sort((y,b)=>y-b);let h=c.length?c[c.length>>1]:0,u=c.length?c[Math.floor(c.length*.15)]??h:0,f=c.length?c[Math.floor(c.length*.85)]??h:0,m=u>.5?f/u:1,g=sd(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return d>=300&&h>11&&m>1.35?p="sport":d>=285?p="arena":p="proscenium",{mode:p,seed:g,voidRadiusM:h,aspect:m}}var sf=5;function af(t,e,i){switch(i){case 1:t.beginPath(),t.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,O),t.fill();break;case 2:t.beginPath(),t.ellipse(0,-e*1.02,e*.42,e*.42,0,0,O),t.fill(),t.beginPath(),t.ellipse(0,-e*.2,e*.98,e*1.02,0,0,O),t.fill();break;case 3:t.beginPath(),t.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,O),t.fill(),t.beginPath(),t.ellipse(0,-e*.52,e*1.22,e*.24,0,0,O),t.fill();break;case 4:t.beginPath(),t.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,O),t.fill(),t.beginPath(),t.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,O),t.fill(),t.beginPath(),t.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,O),t.fill();break;default:break}}function lf(t,e,i,o,n){let r=o*.44,s=o*n.shoulderK,a=o*.66,l=o*1.68,c=o*5.4,d=`rgba(${n.clothing[0]},${n.clothing[1]},${n.clothing[2]},${n.alpha})`,h=`rgba(${n.tone[0]},${n.tone[1]},${n.tone[2]},${n.alpha})`;t.save(),t.translate(e,i);let u=n.lean*o;t.fillStyle=d,t.beginPath(),t.moveTo(-r,a),t.quadraticCurveTo(-r*1.18,l-u-o*.6,-s,l-u),t.quadraticCurveTo(-s*1.05,l+o*1.2,-s*.94,c),t.lineTo(s*.94,c),t.quadraticCurveTo(s*1.05,l+o*1.2,s,l+u),t.quadraticCurveTo(r*1.18,l+u-o*.6,r,a),t.closePath(),t.fill(),t.fillStyle=h,t.fillRect(-r*.82,o*.5,r*1.64,o*.9),t.save(),t.rotate(n.tilt),t.translate(n.turn*o,0),t.fillStyle=h,o>=18?(t.beginPath(),t.moveTo(-o*.9,-o*.15),t.quadraticCurveTo(-o*.96,-o*1.12,0,-o*1.06),t.quadraticCurveTo(o*.96,-o*1.12,o*.9,-o*.15),t.quadraticCurveTo(o*.86,o*.55,o*.36,o*.98),t.quadraticCurveTo(0,o*1.14,-o*.36,o*.98),t.quadraticCurveTo(-o*.86,o*.55,-o*.9,-o*.15),t.closePath(),t.fill(),o>=22&&(t.beginPath(),t.ellipse(-o*.9,o*.18,o*.13,o*.22,0,0,O),t.ellipse(o*.9,o*.18,o*.13,o*.22,0,0,O),t.fill())):(t.beginPath(),t.ellipse(0,0,o*.9,o*1.06,0,0,O),t.fill()),af(t,o,n.hair),n.rim>.01&&(t.strokeStyle=`rgba(245,205,150,${(.5*n.rim).toFixed(3)})`,t.lineWidth=Math.max(1,o*.14),t.beginPath(),t.ellipse(0,-o*.06,o*.86,o*1,0,Math.PI*1.12,Math.PI*1.9),t.stroke()),t.restore(),n.rim>.01&&(t.strokeStyle=`rgba(240,200,150,${(.28*n.rim).toFixed(3)})`,t.lineWidth=Math.max(1,o*.12),t.beginPath(),t.moveTo(-s*.8,l-o*.05),t.quadraticCurveTo(-r,l-o*.75,0,l-o*.82),t.quadraticCurveTo(r,l-o*.75,s*.8,l-o*.05),t.stroke()),t.restore()}function cf(t,e,i,o,n,r,s){t.fillStyle=`rgba(${n[0]},${n[1]},${n[2]},${s})`,t.beginPath(),t.moveTo(e-o*1.72,i+o*4),t.quadraticCurveTo(e-o*1.78,i+o*1.55,e-o*.46,i+o*1.02),t.lineTo(e-o*.4,i+o*.62),t.lineTo(e+o*.4,i+o*.62),t.lineTo(e+o*.46,i+o*1.02),t.quadraticCurveTo(e+o*1.78,i+o*1.55,e+o*1.72,i+o*4),t.closePath(),t.fill(),t.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${s})`,t.beginPath(),t.ellipse(e,i,o*.9,o*1.05,0,0,O),t.fill()}function cn(t,e,i,o,n){let r=o*.1,s=i-o*.9,a=i-o*.74,l=i-o*.46,c=o*.13,d=o*.09,h=`rgba(${n.tone[0]},${n.tone[1]},${n.tone[2]},${n.alpha})`,u=t.createRadialGradient(e,i,1,e,i,o*.24);u.addColorStop(0,"rgba(0,0,0,0.4)"),u.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.scale(1,.28),t.fillStyle=u,t.beginPath(),t.ellipse(e,i/.28,o*.24,o*.24,0,0,O),t.fill(),t.restore(),t.fillStyle=h,t.beginPath(),t.moveTo(e-d,l),t.lineTo(e-d*.7,i),t.lineTo(e-d*.1,i),t.lineTo(e-d*.1,l+o*.02),t.lineTo(e+d*.1,l+o*.02),t.lineTo(e+d*.1,i),t.lineTo(e+d*.7,i),t.lineTo(e+d,l),t.closePath(),t.fill(),t.beginPath(),t.moveTo(e-c,a),t.quadraticCurveTo(e-c*.9,l-o*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-o*.12,e+c,a),t.quadraticCurveTo(e,a-o*.05,e-c,a),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=h,t.lineWidth=o*.055;let f=a+o*.02;n.pose===1?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e-c*1.5,i-o*1.02),t.moveTo(e+c*.8,f),t.lineTo(e+c*1.5,i-o*1.02),t.stroke()):n.pose===2?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e+d*1.4,l-o*.02),t.moveTo(e+c*.8,f),t.lineTo(e-d*.4,l-o*.06),t.stroke(),t.fillStyle=h,t.beginPath(),t.ellipse(e+d*1.5,l-o*.04,o*.07,o*.09,-.5,0,O),t.fill()):n.pose===3?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,f),t.lineTo(e+c*1.1,l),t.stroke(),t.lineWidth=o*.02,t.beginPath(),t.moveTo(e-c*.2,s+r*.9),t.lineTo(e-c*.2,i-o*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,f),t.lineTo(e-c*.95,l+o*.02),t.moveTo(e+c*.85,f),t.lineTo(e+c*.95,l+o*.02),t.stroke()),t.fillStyle=h,t.fillRect(e-r*.34,s+r*.6,r*.68,r*.9),t.beginPath(),t.ellipse(e,s,r*.86,r*1.05,0,0,O),t.fill(),n.rimStrength>.01&&(t.strokeStyle=`rgba(${n.rim[0]},${n.rim[1]},${n.rim[2]},${(.6*n.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,o*.02),t.beginPath(),t.moveTo(e-c,a),t.lineTo(e-r*.6,s+r*.4),t.moveTo(e-r*.7,s),t.ellipse(e,s,r*.84,r*1.02,0,Math.PI*1.05,Math.PI*1.55),t.stroke())}function Hi(t,e,i,o,n,r,s,a,l){t.save(),t.globalCompositeOperation="lighter";let c=t.createLinearGradient(0,i,0,n);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),t.fillStyle=c,t.beginPath(),t.moveTo(e-r,i),t.lineTo(o-s,n),t.lineTo(o+s,n),t.lineTo(e+r,i),t.closePath(),t.fill(),t.restore()}function dn(t,e,i,o,n){let r=t.createRadialGradient(e,i,0,e,i,o*3);r.addColorStop(0,`rgba(${n},0.9)`),r.addColorStop(.4,`rgba(${n},0.35)`),r.addColorStop(1,`rgba(${n},0)`),t.fillStyle=r,t.beginPath(),t.arc(e,i,o*3,0,O),t.fill(),t.fillStyle=`rgba(${n},1)`,t.beginPath(),t.arc(e,i,o,0,O),t.fill()}function kk(t,e,i){let o=document.createElement("canvas");o.width=oe,o.height=be;let n=o.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.hypot(r,s),l=Math.max(2,a*zt),c=t.eyeHeightM??re,d=rf(t,e,i),h=ad(d.seed),u=210+h()*150,f=ae(220+(h()-.5)*60,.55,.82),m=`${f[0]},${f[1]},${f[2]}`,g=n.createLinearGradient(0,0,0,be);g.addColorStop(0,"#080b12"),g.addColorStop(.42,"#12182c"),g.addColorStop(.5,"#1c2440"),g.addColorStop(.56,"#151b2c"),g.addColorStop(.78,"#171e30"),g.addColorStop(1,"#131829"),n.fillStyle=g,n.fillRect(0,0,oe,be);let p=n.createLinearGradient(0,$(-6),0,be);p.addColorStop(0,"rgba(30, 37, 56, 0)"),p.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),p.addColorStop(1,"rgba(22, 28, 44, 0.12)"),n.fillStyle=p,n.fillRect(0,$(-6),oe,be-$(-6));let y=Math.atan2(r,-s),b=of(t,i,y,c),S=b.maxDelta>=tf;S&&nf(n,b.bins,pt,$);let w=Math.max(.3,Math.min(1,1-(l-6)/60)),k=nn(c,l),v=Math.min(80,Math.atan2(4,l)*180/Math.PI),L=Math.min(45,k.topPitch),P=k.basePitch;d.mode==="sport"?uf(n,l,c,d,w,u,m,h):d.mode==="arena"?hf(n,l,c,d,w,m,h):df(n,v,L,P,w,u,m,h);let I=d.mode==="sport"?34:24+Math.floor(h()*8);n.fillStyle=`rgba(${m},0.8)`;for(let x=0;x<I;x++){let C=(x+.5)/I*oe,T=$(d.mode==="sport"?58:54+x*7%3*6);n.beginPath(),n.arc(C,T,d.mode==="sport"?2.6:3.2,0,O),n.fill()}pf(n,t,i,e,y,c,r,s,S,d);let M=n.createLinearGradient(0,0,0,be);return M.addColorStop(0,"rgba(0,0,0,0.85)"),M.addColorStop(.12,"rgba(0,0,0,0)"),M.addColorStop(.9,"rgba(0,0,0,0)"),M.addColorStop(1,"rgba(0,0,0,0.55)"),n.fillStyle=M,n.fillRect(0,0,oe,be),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function df(t,e,i,o,n,r,s,a){let l=pt(-e),c=pt(e),d=$(i),h=$(o),u=c-l,f=h-d,m=$(Math.min(50,i+10)),g=u*(1.1+(1-n)*.5),p=t.createRadialGradient(oe/2,(d+h)/2,8,oe/2,(d+h)/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-u*.6,d-f*1.2,u*2.2,f*3.4);let y=ae(r,.62,.55),b=ae(r+40,.7,.5),S=ae(r+70,.78,.52);t.save(),t.beginPath(),t.rect(l,d,u,f),t.clip();let w=t.createLinearGradient(0,d,0,h);w.addColorStop(0,`rgb(${y[0]},${y[1]},${y[2]})`),w.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),w.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=w,t.fillRect(l,d,u,f),t.globalAlpha=1;let k=t.createRadialGradient(oe/2,(d+h)/2,u*.12,oe/2,(d+h)/2,u*.62);k.addColorStop(0,"rgba(6,8,14,0)"),k.addColorStop(.7,"rgba(6,8,14,0.15)"),k.addColorStop(1,"rgba(5,6,11,0.92)"),t.fillStyle=k,t.fillRect(l,d,u,f),t.restore();let v=3+Math.floor(a()*3),L=f*.46,P=h-f*.08;for(let _=0;_<v;_++){let E=(_+1)/(v+1),H=l+u*(.22+E*.56+(a()-.5)*.06);cn(t,H,P,L*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:ae(r+20,.5,.7),rimStrength:.7})}t.fillStyle="#05070d",t.fillRect(l-u*.5,m,u*.5,h-m),t.fillRect(c,m,u*.5,h-m);let I=u*.055+3,M=I*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,h),t.lineTo(l-I,h),t.lineTo(l-M,m),t.lineTo(l+u*.012,m),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,h),t.lineTo(c+I,h),t.lineTo(c+M,m),t.lineTo(c-u*.012,m),t.closePath(),t.fill(),t.fillRect(l-M,m,u+M*2,(h-m)*.12);let x=f*.14,C=m+(h-m)*.12;t.fillStyle="rgba(4,6,12,0.96)";let T=7;t.beginPath(),t.moveTo(l-M,C);for(let _=0;_<=T;_++){let E=l-M+(u+M*2)*_/T;t.quadraticCurveTo(E-(u+M*2)/T/2,C+x,E,C)}t.lineTo(c+M,C),t.lineTo(c+M,m),t.lineTo(l-M,m),t.closePath(),t.fill(),t.fillStyle=`rgba(${s},0.12)`,t.fillRect(l-1.5,C,1.5,h-C),t.fillRect(c,C,1.5,h-C),t.fillStyle="#0b0f18",t.fillRect(l-I,h-f*.05,u+I*2,f*.05+3);let R=t.createLinearGradient(0,h-f*.05,0,h+f*.12);R.addColorStop(0,`rgba(255,206,140,${(.5*n).toFixed(3)})`),R.addColorStop(1,"rgba(255,206,140,0)"),t.fillStyle=R,t.fillRect(l-I,h-f*.05,u+I*2,f*.2);let A=3+Math.floor(a()*2);for(let _=0;_<A;_++){let E=(_+1)/(A+1),H=l+u*(E+(a()-.5)*.08),G=$(Math.min(62,i+26)),Z=(a()-.5)*u*.16;Hi(t,H,G,H+Z,h,4,u*.09,s,.16*(.7+n*.5)),dn(t,H,G,2.4,s)}}function hf(t,e,i,o,n,r,s){let a=Math.min(e*.6,Math.max(3,o.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=oe/2,d=1.2,h=Math.max(e*.45,e-a),u=e+a,f=Math.atan2(d-i,h)*180/Math.PI,m=Math.atan2(d-i,u)*180/Math.PI,g=Math.atan2(-i,h)*180/Math.PI,p=$(f),y=$(m),b=$(g),S=pt(l)-c,w=Math.max(6,(p-y)/2),k=(p+y)/2,v=t.createRadialGradient(c,b,4,c,b,S*2.6);v.addColorStop(0,`rgba(255,206,150,${(.2*n).toFixed(3)})`),v.addColorStop(.5,"rgba(150,140,190,0.08)"),v.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=v,t.fillRect(c-S*2.6,y-w,S*5.2,b-y+w+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,k),t.ellipse(c,k,S,w,0,Math.PI,0,!1),t.lineTo(c+S,b),t.ellipse(c,b,S,w,0,0,Math.PI,!1),t.closePath(),t.fill();let L=t.createLinearGradient(0,k,0,b);L.addColorStop(0,`rgba(${r},0.14)`),L.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=L,t.fillRect(c-S,k,S*2,b-k);let P=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],I=P[Math.floor(s()*P.length)],M=s()<.5?-1:1,x=W=>c+W.u*M*S*.84,C=W=>k+W.v*w*.8,T=I.find(W=>W.lead)??I[0],R=x(T),A=t.createLinearGradient(0,k-w,0,k+w);A.addColorStop(0,"#3d4a72"),A.addColorStop(1,"#232b47"),t.fillStyle=A,t.beginPath(),t.ellipse(c,k,S,w,0,0,O),t.fill();let _=t.createRadialGradient(R,k,2,R,k,S);_.addColorStop(0,`rgba(255,214,160,${(.5*n).toFixed(3)})`),_.addColorStop(1,"rgba(255,214,160,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=_,t.beginPath(),t.ellipse(c,k,S,w,0,0,O),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,k,S,w,0,0,O),t.stroke();let E=Math.max(24,(b-y)*1.3),H=I.length>=3?3:2;for(let W=0;W<H;W++){let Se=(-.62+W*.52+(s()-.5)*.12)*-M,Be=c+Se*S*.7,ft=k-w*(.45+s()*.18),je=S*(.07+s()*.04),Xi=E*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Be-je/2,ft-Xi,je,Xi),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Be-je/2,ft-Xi,je,1.5)}if(I.length>=3){let W=c-T.u*M*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(W,k-w*.34,S*.08,w*.1,0,0,O),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let W of[...I].sort((Se,Be)=>Se.v-Be.v)){let Se=.82+(W.v+1)*.14;cn(t,x(W),C(W),E*Se*(W.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:W.pose,rim:ae(40,.72,.8),rimStrength:W.lead?1.4:.9})}let G=$(Math.min(60,m+34)),Z=w*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,G,S*1.15,Z,0,0,O),t.stroke();let N=4+Math.floor(s()*3);for(let W=0;W<N;W++){let Se=W/N*O,Be=c+Math.cos(Se)*S*1.15,ft=G+Math.sin(Se)*Z;if(Math.sin(Se)>-.2){let je=c+(s()-.5)*S*.8;Hi(t,Be,ft,je,k,3,S*.32,r,.2*(.7+n*.4))}dn(t,Be,ft,3,r)}let F=$(Math.min(52,m+24)),V=Math.max(60,S*.4),ne=Math.max(24,V*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-V*.3,F-ne/2),t.lineTo(c-V*.16,F-ne*2.2),t.moveTo(c+V*.3,F-ne/2),t.lineTo(c+V*.16,F-ne*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-V/2,F-ne/2,V,ne);let Vi=t.createLinearGradient(0,F-ne*.3,0,F+ne*.42);Vi.addColorStop(0,`rgba(${r},0.5)`),Vi.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=Vi,t.fillRect(c-V*.42,F-ne*.3,V*.84,ne*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-V/2,F+ne/2-2,V,2);let Wi=t.createRadialGradient(c,F,4,c,F,V*1.1);Wi.addColorStop(0,`rgba(${r},0.2)`),Wi.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=Wi,t.fillRect(c-V*1.1,F-V*.8,V*2.2,V*1.6);let zi=t.createRadialGradient(c,(G+k)/2,6,c,(G+k)/2,S*1.5);zi.addColorStop(0,`rgba(${r},${(.1*(.6+n*.5)).toFixed(3)})`),zi.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=zi,t.fillRect(c-S*1.5,G-40,S*3,k-G+80),t.restore();let cd=c+Math.sign(R-c||1)*S*.5;Hi(t,cd,G-Z*.4,R,C(T),2.5,S*.16,"255,224,178",.42*(.7+n*.4));let Ki=t.createRadialGradient(R,C(T),1,R,C(T),S*.2);Ki.addColorStop(0,`rgba(255,228,185,${(.4*n).toFixed(3)})`),Ki.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=Ki,t.beginPath(),t.ellipse(R,C(T),S*.2,w*.24,0,0,O),t.fill(),t.restore()}function uf(t,e,i,o,n,r,s,a){let l=oe/2,c=Math.max(10,o.voidRadiusM),d=Math.max(2,e-c),h=e+c,u=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),f=Math.atan2(-i,d)*180/Math.PI,m=Math.atan2(-i,h)*180/Math.PI,g=$(f),p=$(m),y=pt(u)-l,b=(g+p)/2,S=Math.max(10,(g-p)/2),w=t.createRadialGradient(l,b,4,l,b,y);w.addColorStop(0,"#e8f0fb"),w.addColorStop(.7,"#b9c9e2"),w.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,b,y,S,0,0,O),t.clip(),t.fillStyle=w,t.fillRect(l-y,b-S,y*2,S*2),t.strokeStyle="rgba(90,120,170,0.5)",t.lineWidth=3,t.beginPath(),t.moveTo(l,b-S),t.lineTo(l,b+S),t.moveTo(l-y*.5,b-S),t.lineTo(l-y*.5,b+S),t.moveTo(l+y*.5,b-S),t.lineTo(l+y*.5,b+S),t.stroke(),t.strokeStyle="rgba(180,90,110,0.45)",t.beginPath(),t.ellipse(l,b,S*.9,S*.5,0,0,O),t.stroke(),t.restore(),t.strokeStyle="rgba(210,225,245,0.6)",t.lineWidth=2.5,t.beginPath(),t.ellipse(l,b,y,S,0,0,O),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let x=0;x<5;x++){let C=l+(a()-.5)*y*1.4,T=b+(a()-.5)*S*1.1,R=Math.max(2,S*.06);t.beginPath(),t.ellipse(C,T,R*.6,R,0,0,O),t.fill()}let k=t.createRadialGradient(l,b,4,l,b,y*1.4);k.addColorStop(0,"rgba(200,220,255,0.12)"),k.addColorStop(1,"rgba(200,220,255,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=k,t.fillRect(l-y*1.4,p-S,y*2.8,g-p+S*2),t.restore();let v=$(Math.min(66,m+60)),L=Math.max(80,y*.7),P=L*.5,I=t.createRadialGradient(l,v,4,l,v,L*1.6);I.addColorStop(0,`rgba(${s},0.3)`),I.addColorStop(1,`rgba(${s},0)`),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=I,t.fillRect(l-L*1.6,v-L*1.2,L*3.2,L*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-L/2,v-P/2),t.lineTo(l+L/2,v-P/2),t.lineTo(l+L*.6,v),t.lineTo(l+L/2,v+P/2),t.lineTo(l-L/2,v+P/2),t.lineTo(l-L*.6,v),t.closePath(),t.fill();let M=r;for(let x=0;x<3;x++){let C=ae(M+x*30,.5,.5);t.fillStyle=`rgba(${C[0]},${C[1]},${C[2]},0.75)`;let T=L*.26;t.fillRect(l-L*.42+x*(T+L*.06),v-P*.32,T,P*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let x=0;x<8;x++){let C=l-L*.6+L*1.2*x/7;t.beginPath(),t.arc(C,v+P*.62,2.4,0,O),t.fill()}}function pf(t,e,i,o,n,r,s,a,l,c){let d=e.sectionId,h=!1,u=[];for(let g of i){if(g.id===e.id)continue;let p=g.x-e.x,y=g.y-e.y,b=Math.hypot(p,y)*zt;if(d&&g.sectionId===d&&b<3&&p*s+y*a>0&&(h=!0),b<.3||b>32)continue;let w=((Math.atan2(p,-y)-n)*180/Math.PI+540)%360-180,k=l?(g.eyeHeightM??re)-r:0,v=Math.atan2(k-.28,b)*180/Math.PI;if(v>10&&b>5)continue;let L=0;for(let M=0;M<g.id.length;M++)L=L*31+g.id.charCodeAt(M)&65535;let P=.9+(L&15)/40,I=Math.min(78,Math.atan2(.16,b)*180/Math.PI*ef*P);I<1.2||u.push({hx:pt(w),hy:$(v),r:I,d:b,hash:L})}u.sort((g,p)=>p.d-g.d);let f=[];{let g=[...u].sort((b,S)=>b.hy-S.hy),p=[],y=()=>{if(!p.length)return;let b=p.reduce((k,v)=>k+v.d,0)/p.length,S=p.reduce((k,v)=>k+v.hy,0)/p.length,w=p.reduce((k,v)=>k+v.r,0)/p.length;f.push({figs:p.sort((k,v)=>v.d-k.d),d:b,hy:S,r:w}),p=[]};for(let b of g){let S=p[p.length-1];S&&Math.abs(b.hy-S.hy)>Math.max(5,(S.r+b.r)/2*1.7)&&y(),p.push(b)}y()}f.sort((g,p)=>p.d-g.d);let m=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let g of f){if(g.figs.length>=3&&g.r>=1.6&&g.r<26){let p=[],y=[...g.figs].sort((w,k)=>w.hx-k.hx),b=[];for(let w of y){let k=b[b.length-1];k&&w.hx-k.hx>Math.max(14,w.r*7)&&(b.length>=3&&p.push(b),b=[]),b.push(w)}b.length>=3&&p.push(b);let S=Math.min(.42,.5*(1-g.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let w of p){let k=w[0].hx-g.r*1.6,v=w[w.length-1].hx+g.r*1.6;t.beginPath(),t.roundRect(k,g.hy+g.r*.8,v-k,g.r*2.4,g.r*.8),t.fill()}}}for(let p of g.figs){let y=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),b=Math.round((1-Math.min(1,p.d/16))*10),S=[14+(p.hash>>4&6)+b,17+(p.hash>>4&6)+b,25+(p.hash>>4&6)+b],w=m[p.hash%m.length],k=[w[0]+b,w[1]+b,w[2]+b];if(p.r>=13){let v=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;lf(t,p.hx,p.hy,p.r,{tone:S,clothing:k,alpha:y,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%sf,rim:v,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?cf(t,p.hx,p.hy,p.r,k,S,y):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${y.toFixed(3)})`,t.beginPath(),t.arc(p.hx,p.hy,p.r,0,O),t.fill(),t.beginPath(),t.ellipse(p.hx,p.hy+p.r*1.4,p.r*1.85,p.r*.95,0,Math.PI,0,!0),t.fill())}}if(h){let g=$(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,g,oe,be-g),t.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let y=0;y<p;y++){let b=(y+.5)/p*oe;t.beginPath(),t.ellipse(b,g+6,oe/p*.42,22,0,Math.PI,0,!0),t.fill()}}}var ce=480,ut=270,ln=50,Ze=30,rd=t=>(t+ln)/(2*ln)*ce,Wt=t=>(Ze-t)/(2*Ze)*ut;function Lk(t,e,i){let o=document.createElement("canvas");o.width=ce,o.height=ut;let n=o.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*zt),l=ad(sd(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=ae(220+(l()-.5)*60,.55,.82),h=`${d[0]},${d[1]},${d[2]}`,u=n.createLinearGradient(0,0,0,ut);u.addColorStop(0,"#080b12"),u.addColorStop(.44,"#151c32"),u.addColorStop(.5,"#1d2644"),u.addColorStop(.58,"#161c2e"),u.addColorStop(1,"#131829"),n.fillStyle=u,n.fillRect(0,0,ce,ut);let f=t.eyeHeightM??re,m=nn(f,a),g=Math.min(ln-2,Math.atan2(4,a)*180/Math.PI),p=Math.min(Ze-2,m.topPitch),y=Math.max(-Ze+2,m.basePitch),b=rd(-g),S=rd(g),w=Wt(p),k=Wt(y),v=S-b,L=k-w,P=Math.max(.35,Math.min(1,1-(a-6)/60)),I=Wt(Math.min(Ze-1,p+8)),M=n.createRadialGradient(ce/2,(w+k)/2,4,ce/2,(w+k)/2,v*1.15);M.addColorStop(0,"rgba(255,214,150,0.34)"),M.addColorStop(.28,"rgba(150,150,230,0.3)"),M.addColorStop(.6,"rgba(99,102,241,0.12)"),M.addColorStop(1,"rgba(99,102,241,0)"),n.fillStyle=M,n.fillRect(b-v*.6,w-L*1.2,v*2.2,L*3.4);let x=ae(c,.62,.55),C=ae(c+40,.7,.5),T=ae(c+70,.78,.52);n.save(),n.beginPath(),n.rect(b,w,v,L),n.clip();let R=n.createLinearGradient(0,w,0,k);R.addColorStop(0,`rgb(${x[0]},${x[1]},${x[2]})`),R.addColorStop(.5,`rgb(${C[0]},${C[1]},${C[2]})`),R.addColorStop(1,`rgb(${T[0]},${T[1]},${T[2]})`),n.globalAlpha=.8,n.fillStyle=R,n.fillRect(b,w,v,L),n.globalAlpha=1;let A=n.createRadialGradient(ce/2,(w+k)/2,v*.12,ce/2,(w+k)/2,v*.6);A.addColorStop(0,"rgba(6,8,14,0)"),A.addColorStop(.7,"rgba(6,8,14,0.15)"),A.addColorStop(1,"rgba(5,6,11,0.9)"),n.fillStyle=A,n.fillRect(b,w,v,L),n.restore();let _=3,E=k-L*.08;for(let N=0;N<_;N++){let F=(N+1)/(_+1);cn(n,b+v*(.24+F*.52),E,L*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:ae(c+20,.5,.7),rimStrength:.7})}n.fillStyle="#05070d",n.fillRect(b-v*.5,I,v*.5,k-I),n.fillRect(S,I,v*.5,k-I);let H=v*.05+2,G=H*1.35;n.fillStyle="#03050a",n.beginPath(),n.moveTo(b,k),n.lineTo(b-H,k),n.lineTo(b-G,I),n.lineTo(b+v*.012,I),n.closePath(),n.fill(),n.beginPath(),n.moveTo(S,k),n.lineTo(S+H,k),n.lineTo(S+G,I),n.lineTo(S-v*.012,I),n.closePath(),n.fill(),n.fillRect(b-G,I,v+G*2,(k-I)*.13),n.fillStyle=`rgba(${h},0.12)`,n.fillRect(b-1.2,I,1.2,k-I),n.fillRect(S,I,1.2,k-I),n.fillStyle="#0b0f18",n.fillRect(b-H,k-L*.05,v+H*2,L*.05+2);let Z=n.createLinearGradient(0,k-L*.05,0,k+L*.14);Z.addColorStop(0,`rgba(255,206,140,${(.5*P).toFixed(3)})`),Z.addColorStop(1,"rgba(255,206,140,0)"),n.fillStyle=Z,n.fillRect(b-H,k-L*.05,v+H*2,L*.22);for(let N=0;N<3;N++){let F=(N+1)/4,V=b+v*F,ne=Wt(Math.min(Ze-1,p+20));Hi(n,V,ne,V+(l()-.5)*v*.14,k,3,v*.09,h,.17*P),dn(n,V,ne,1.8,h)}n.fillStyle=`rgba(${h},0.75)`;for(let N=0;N<8;N++)n.beginPath(),n.arc((N+.5)/8*ce,Wt(Ze-4-N%2*3),2.2,0,O),n.fill();n.fillStyle="rgba(10,13,20,0.9)",n.fillRect(0,ut-26,ce,26),n.fillStyle="rgba(30,37,54,0.9)";for(let N=0;N<9;N++){let F=N*(ce/9)+ce/18;n.beginPath(),n.ellipse(F,ut-22,ce/9*.4,15,0,Math.PI,0,!0),n.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var ld=new Set(["en"]),Gi=new Map;async function ff(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(Jn(`i18n/${t}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-GISJKBJ2.js"),i=e[t];return i?await i():null}async function Ik(t,e){let i=fs(t,e);if(i==="en"||ld.has(i))return it(i),i;if(!ps.includes(i))return it("en"),"en";try{let o=Gi.get(i);o||(o=ff(i),Gi.set(i,o));let n=await o;return Gi.delete(i),n?(it(i,n),ld.add(i),i):(it("en"),"en")}catch{return Gi.delete(i),it("en"),"en"}}export{bf as ACCESSIBILITY_RING_COLOR,Kt as ACCESSIBILITY_TYPES,im as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,tm as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,gf as CHART_STORAGE_KEY,Rm as CURRENCY_CHOICES,Mm as DEFAULT_CURRENCY,L0 as EMPTY_AVAILABILITY_REFRESH,If as EVENT_CONFIGURATION_EXPORT_SCHEMA,Pf as EVENT_CONFIGURATION_SCHEMA,jf as FLOOR_STACK_GAP_RATIO,em as FLOOR_STACK_MIN_SURFACE_PX,k0 as HOLD_CLOCK_SKEW_MS,to as LABEL_FADE_MS,Lf as LABEL_STYLE_MAX_SIZE,kf as LABEL_STYLE_MIN_SIZE,Sm as LEGIBILITY_HYSTERESIS_PX,Nm as LOCALE_NAMES,rm as MAX_EVENT_INVENTORY,nm as MAX_GA_CAPACITY,_n as MIN_POINTER_TARGET_PX,td as PickerController,Me as PickerSelectionError,mm as RENDERED_QUALITY_REPORT_VERSION,vf as SEAT_COMMERCIAL_MARKS,hm as SEAT_TYPE_ICON_BODY,Yi as SEAT_TYPE_ICON_VIEWBOX,mf as STAGE_LABEL_STYLE_MAX_SIZE,$d as SUPPORTED_LOCALES,xf as SURROUNDINGS_SHAPE_ROLES,Jo as SeatmapRenderer,Of as TABLE_SEAT_OFFSET,Bf as TIER_HEIGHT_M,ps as TRANSLATED_LOCALES,In as UNGROUPED_ID,Tc as accessNeedsFor,hd as accessibilityLabelKey,yf as accessibilityMeta,Sf as accessibilityRingColor,yn as allObjects,Tn as applyHidden,Ac as attachVisibilityCatchUp,om as automaticRoundTableRadius,Ef as canTransitionEventConfiguration,Rf as canonicalEventConfigurationJson,Sn as chartBounds,kn as combinedFloorZoneId,bt as compactRowLabel,qt as computeSections,mc as createRenderer,tr as crossesThreshold,Yd as currencyExponent,Em as currencySymbol,Xf as expandBooth,Oe as expandChart,Gf as expandRow,Hf as expandRowSlots,Kf as expandTable,Wf as expandTableSlots,qf as floorObjects,Qf as floorStackPlacements,Ut as floorsOf,zm as formatDate,Am as formatMinor,We as formatMoney,Ud as fromMinorUnits,gt as gaAreasOf,lm as gaInventorySegments,sm as gaUnitLabel,$t as gaUnitLabels,kk as generateSeatPanorama,Lk as generateSeatThumb,Hm as getLocale,cm as growJoinedGAInventory,fm as hiddenObjectIds,Vp as holdHasLapsed,C0 as holdRecoveryShape,oo as hysteresisScale,Cn as initialFloorMode,Af as inspectEventConfigurationCompatibility,gm as inspectRenderedQualityEvidence,dm as isGaUnitLabel,Vm as isLocaleLoaded,pm as isSectionHidden,Cf as layerOf,xn as layoutCombinedFloorPlan,Ln as layoutFloorStack,Ik as loadLocale,Gm as localeDirection,Jf as mainFloorId,_f as migrateLegacyEventConfigurations,Uf as objectCenter,$f as owningSectionForObject,Mf as parseEventConfigurationExport,Tf as parseEventConfigurationVersion,Yf as pointInPolygon,j as pointInPolygonWithHoles,Yt as polygonLabelPoint,Mc as reconcileAvailability,x0 as refreshChangedSomething,io as renderedPx,Ff as resolveEventConfigurationRollback,fs as resolveLocale,Nf as rowInventoryCount,Df as rowSeatPositions,wf as seatCommercialMeta,er as seatNoteRowModel,Pn as seatTypeIconBody,um as seatTypeIconSvg,Xt as sectionGeometry,it as setLocale,us as setMoneyLocale,Wm as setStringOverrides,Rc as shouldWaitForHoldExpiry,bn as stackFloors,B as t,gs as tCount,zf as tableInventoryCount,Vf as tableSeatCountsBySide,Zf as translateObject,am as validGAInventorySegments,vm as zoomTowardPoint};
1
+ import{a as Ji,c as eo,e as qn,f as ai,h as Zn,i as jn,l as Qn}from"./chunk-PI3UH2EN.js";import{a as jf,b as kn,c as Qf,d as Ln,e as xn,f as Jf,g as em,h as Cn,j as Hn,m as ni,o as Gn,p as ke,q as ue,r as Vn,s as Wn,t as ri,u as zn}from"./chunk-66Q5LOBH.js";import{a as mm,b as _n,c as gm}from"./chunk-GI7ZTQ7C.js";import{a as Yi,b as hm,c as Pn,d as um}from"./chunk-P4J57TK6.js";import{b as Jn}from"./chunk-FOYQOIWG.js";import{a as bt}from"./chunk-QJXSZT3H.js";import{a as tm,b as im,c as om}from"./chunk-WAGKI44J.js";import{A as he,B as ti,a as we,b as An,c as De,d as jt,e as Qt,f as Ne,g as Y,i as En,n as me,o as Re,r as Jt,s as yt,t as ei,v as Fn,w as Je,x as Zi,y as ji,z as J}from"./chunk-W53J4FJS.js";import{a as Kn,b as Xn,h as Yn,s as Un,t as $n}from"./chunk-TQN2VWQO.js";import{b as vn,c as wn,l as mt}from"./chunk-5BMXWOE7.js";import{a as nm,b as rm,c as sm,d as am,e as lm,f as $t,g as cm,h as gt,i as dm,j as In,k as qt,l as pm,m as fm,n as Tn}from"./chunk-AHPF5SD6.js";import{b as Bn,e as Qi,i as si}from"./chunk-R7TV7RYQ.js";import{a as mf,b as gf,c as Kt,d as yf,e as bf,f as Sf,g as vf,h as wf,i as kf,j as Lf,k as xf,l as Cf}from"./chunk-4I2VWFJY.js";import{b as ii,f as On,h as oi,i as Dn,k as Nn}from"./chunk-UL5OIGIF.js";import{$ as Bf,Aa as zf,Ba as Kf,Ca as Xf,Da as Yf,E as hn,Ea as j,Fa as Yt,G as un,Ga as Uf,Ha as $f,I as K,Ia as Ut,Ja as qf,Ka as yn,La as Zf,Ma as bn,Na as Oe,Oa as Sn,Z as pn,_ as Qe,d as Pf,e as If,f as Tf,g as Mf,h as Rf,ha as re,i as Af,ia as fn,j as Ef,ja as Xt,k as Ff,l as _f,pa as mn,ra as gn,ta as Of,ua as Df,va as Nf,wa as Hf,xa as Gf,ya as Vf,za as Wf}from"./chunk-E7TOTX6I.js";import"./chunk-5ITK5236.js";import{C as D,c as Ui,h as $i,m as qi,o as Mn,t as X,u as de,v as ve,w as Q,x as Zt,z as Rn}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var dd=new Map(Kt.map(t=>[t.key,t.label]));function hd(t){return`picker.access.${t}`}function er(t){let e=[],i=t.wheelchairSpaceType;for(let r of t.accessibility??[]){if(r==="wheelchair"&&i)continue;let s=dd.get(r);s&&e.push({key:`access:${r}`,icon:r,titleKey:hd(r),titleFallback:s,tone:"access"})}i==="no-seat"?e.push({key:"wheelchair:no-seat",icon:"wheelchair",titleKey:"picker.emptyWheelchairSpace",titleFallback:"Empty wheelchair space",tone:"access"}):i==="seat-present"&&e.push({key:"wheelchair:seat-present",icon:"wheelchair",titleKey:"picker.accessiblePhysicalSeat",titleFallback:"Accessible physical seat",tone:"access"});let o=t.commercial;o?.restrictedView&&e.push({key:"mark:restrictedView",icon:"restrictedView",titleKey:"picker.restrictedView",titleFallback:"Restricted view",tone:"warn"}),o?.obstructedView&&e.push({key:"mark:obstructedView",icon:"obstructedView",titleKey:"picker.obstructedView",titleFallback:"Obstructed view",tone:"warn"}),o?.premium&&e.push({key:"mark:premium",icon:"premium",titleKey:"picker.premiumSeat",titleFallback:"Premium seat",tone:"premium"});let n=o?.note?.trim();if(n){let r=e.find(s=>s.tone==="warn"||s.tone==="premium");r?r.note=n:e.push({key:"note",icon:"note",titleKey:"picker.organizerNote",titleFallback:"Organizer note",tone:"note",note:n})}return e}var Sm=1,to=90;function io(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?0:Math.max(0,t*e)}function tr(t,e,i,o=1){if(!Number.isFinite(t))return i;let n=Math.max(0,o);return i?t>=e-n:t>=e+n}function oo(t,e,i,o=1){if(!Number.isFinite(t)||!(i>0))return t;let n=Math.max(0,o)/i;return e?t*(1+n):t*(1-n)}function vm(t){let{point:e,camera:i,scale:o,nextScale:n}=t;if(!Number.isFinite(o)||o<=0||!Number.isFinite(n))return{...i};let r=(e.x-i.x)/o,s=(e.y-i.y)/o;return{x:e.x-r*n,y:e.y-s*n}}import{Konva as _i}from"konva/lib/Core";import{Stage as _p}from"konva/lib/Stage";import{Layer as Qo}from"konva/lib/Layer";import{Group as Gt}from"konva/lib/Group";import{Circle as fc}from"konva/lib/shapes/Circle";import{Group as mo}from"konva/lib/Group";import{Circle as Ke}from"konva/lib/shapes/Circle";import{Line as go}from"konva/lib/shapes/Line";import{Rect as yo}from"konva/lib/shapes/Rect";import{Text as ws}from"konva/lib/shapes/Text";var pe=9,Ae=.9,te=.55*Ae,ee=Y/we,St=4,ge=14,ir=10;var or=14;var ye=.45*Ae,Le=.9*Ae,le=(ye+Le)/2,nr=Math.max(Ae*1.1,Le),Ee=8,rr=700,ie=2,vt=Y,ud=12,pd=12;function sr(t){return t<q?pd:ud}var li=.85,ar=Y,wt=64,He=.55*ye,lr=700,cr=120,dr=2500,ci=-11.5,kt=.58,hr=320,ur=420,pr=420,fr=1,Ge=1,mr=2,et=16,Fe=12,no=[.85,.72,.62],fd=10,md=9;function di(t){return t<q?md:fd}var hi=13,ui=12,gr=0,yr="700",br="600",Sr=8,vr=5,wr=10,kr=6,Lr=8,xr=.6,Cr=.6,Pr=.7,Ir=[0,18,-18,36,-36,54,-54],Ve="600",Tr="500",q=640,Mr=Ve,Rr="400",_e=0,Ar=14,Er=.34,Fr=.92,_r=7,Br=3;function pi(t){return Math.min(1,Math.max(Fe/et,t/900))}function tt(t,e){return Math.max(Fe,t*pi(e))}var gd=.5,yd=1.15,Or=2,Dr=3,Nr=22,bd=8,Sd=6;function Lt(t){return t<q?Sd:bd}var ro=.08;function so(t,e,i,o,n=gd,r=Fe){let s=t*pi(e),a=Math.max(r*(1+ro),s*n),l=o>0&&i>o?i/o:1,c=Math.max(a,s*yd);return Math.min(c,a*l)}var Hr=.1,xt=1.02;var Gr=1.25;function Vr(t,e){return!(t>0)||!(e>0)||t>=e?null:e}var vd="#e5e7eb",wd="#c7cbd1",kd="#6b7280",Ld=["#6b7280","#5b6470","#4b5563","#374151"],xd=["#cbd5e1","#e2e8f0","#f8fafc"],Cd="#d1d5db",Pd="#b8bdc4",Id="#273142",Td="#526078",Md="#f1f5f9",Rd="#374151",Ad="#64748b",Ed="#111827",Wr="#6b7280",zr="#374151";var Kr="#4b5563",Xr=.4,xe=.16,Yr="rgba(244,246,248,0.06)",fi=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Ur(t,e,i){let o=new Map;for(let s of t){let a=e(s);!a||i(a)||o.set(a,(o.get(a)??0)+1)}let n=null,r=0;for(let[s,a]of o)(a>r||a===r&&n!=null&&s<n)&&(n=s,r=a);return n}function se(t){return X(t)?{sectionFill:vd,sectionStroke:wd,sectionInk:kd,focalFill:Cd,focalStroke:Pd}:{sectionFill:Id,sectionStroke:Td,sectionInk:Md,focalFill:Rd,focalStroke:Ad}}function ao(t,e){let i=t.sectionFill,o=X(i),n=o?de(i,.6):Rn(ve(i,.2),.85);switch(e){case"closed":return o?de(i,.4):ve(i,.12);case"sold-out":return n;case"nearly-gone":return Q(i,n,.4);default:return i}}var $r=.28,qr=.42,Fd=.55,_d=.7;function Zr(t,e,i){let o=se(t),n=ao(o,e);if(!i||e==="sold-out"||e==="closed")return{fill:n,stroke:o.sectionStroke};let r=X(t);return{fill:Q(n,i,r?qr:$r),stroke:D(i,r?_d:Fd)}}var Bd=.03;function jr(t,e){let i=se(t);return!["normal","nearly-gone","sold-out","closed"].map(n=>ao(i,n).toLowerCase()).includes(e.trim().toLowerCase())&&lo(t,e)}function lo(t,e){let i=Ui(e);if(!i)return!1;let o=se(t),n=Math.max($r,qr)+Bd;return["normal","nearly-gone","sold-out","closed"].some(r=>{let s=Ui(ao(o,r));return s?Math.max(Math.abs(s[0]-i[0]),Math.abs(s[1]-i[1]),Math.abs(s[2]-i[2]))/255<=n:!1})}var Od="#f8fafc",Dd="#f4f6fb",Nd="#111827",Hd=.72;function Qr(t){let e=X(t),i=e?Od:Ed,o=e?Nd:Dd,n=Q(o,i,1-Hd);return{plate:i,ink:o,subInk:qi(n,i)>=Mn?n:o}}function Jr(t,e,i,o){if(e)return e;let n=X(i)?xd:Ld;for(let r of[i,...n])if(qi(r,t)>=o)return r;return he(t,e,i,o)}function mi(t){return t?.35:.3}function is(t){if(t<=0||t>=1)return 1;let e=1.25-1;if(t<.45){let o=t/.45;return 1+e*(1-(1-o)**2)}let i=(t-.45)/(1-.45);return 1+e*Math.cos(i*Math.PI*1.5)*(1-i)**2}function co(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 os=700,Gd=2400,ho=12,ns=30,es=1,Vd=1.16,ts=.5,Wd=1;function uo(t){return t*.61803398875%1}function rs(t,e){let o=((t/Gd+e)%1+1)%1,n=(1-Math.cos(o*2*Math.PI))/2;return{scale:es+(Vd-es)*n,opacity:ts+(Wd-ts)*n}}var as;function ls(t){as=t}function zd(t){return typeof t=="number"?t:t instanceof Date?t.getTime():Date.parse(t)}var ss=new Map;function Kd(t,e){let i=t??as,o=`${i??""}|${JSON.stringify(e)}`,n=ss.get(o);return n||(n=new Intl.DateTimeFormat(i,e),ss.set(o,n)),n}var Xd={dateStyle:"medium",timeStyle:"short"};function cs(t,e={}){let{locale:i,...o}=e,n=zd(t);if(!Number.isFinite(n))return"";let r=Object.keys(o).length?o:Xd;return Kd(i,r).format(n)}var Mm="USD",Rm=["USD","EUR","GBP","CAD","AUD","INR","AED","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL"],hs;function us(t){hs=t}var ds=new Map;function gi(t,e,i,o){let n=o??hs,r=`${n??""}|${t}|${e??"auto"}|${i??"auto"}`,s=ds.get(r);return s||(s=new Intl.NumberFormat(n,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),ds.set(r,s)),s}function We(t,e="USD",i,o){if(typeof i=="object"){let r=i;try{return gi(e,r.minimumFractionDigits,r.maximumFractionDigits,r.locale).format(t)}catch(s){if(r.fallback)return r.fallback(t,e);throw s}}let n=i??(Number.isInteger(t)?0:void 0);return gi(e,n,n,o).format(t)}function Yd(t="USD"){try{return gi(t,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function Ud(t,e="USD"){return t/10**Yd(e)}function Am(t,e="USD",i){return We(Ud(t,e),e,void 0,i)}function Em(t="USD"){return gi(t,0,0).formatToParts(0).find(i=>i.type==="currency")?.value??t}var Ct={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired \u2014 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 \u2014 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 \u2014 consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.beaconAria":"Go to your {seats} in {name}","map.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview \u2014 groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks \u2014 sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats \u2014 blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.seatsLeftShort":"{count} left","picker.overview":"Venue","picker.entrance":"Entrance","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","picker.viewSeats":"View seats","picker.tapSeatHint":"Tap any seat to check its view","picker.ticketTierFor":"Ticket tier for {label}","picker.viewFromSeat":"View from seat {label}","picker.real360":"REAL 360\xB0","picker.preview":"PREVIEW","picker.sightline":"\u2248 {m} m to stage","picker.panorama360":"360\xB0 venue photo","picker.illustrationCaption":"illustration \xB7 \u2248 {m} m from stage","picker.restrictedView":"Restricted view","picker.obstructedView":"Obstructed view","picker.premiumSeat":"Premium seat","picker.access.wheelchair":"Wheelchair space","picker.access.companion":"Companion seat","picker.access.semi-ambulatory":"Semi-ambulatory (limited mobility)","picker.access.designated-aisle":"Designated aisle / transfer seat","picker.access.step-free":"Step-free accessible seat","picker.access.hearing":"Assistive listening","picker.access.cart":"CART live-caption view","picker.access.sign-language":"Sign-language view","picker.access.low-vision":"Blind / low-vision viewing","picker.access.sensory-friendly":"Quiet / sensory-friendly seating","picker.access.plus-size":"Plus-size seat","picker.access.lift-armrest":"Lift-up armrest","picker.accessShort.wheelchair":"Wheelchair space","picker.accessShort.companion":"Companion seat","picker.accessShort.semi-ambulatory":"Limited mobility","picker.accessShort.designated-aisle":"Aisle / transfer","picker.accessShort.step-free":"Step-free","picker.accessShort.hearing":"Assistive listening","picker.accessShort.cart":"Live captions","picker.accessShort.sign-language":"Sign language","picker.accessShort.low-vision":"Low vision","picker.accessShort.sensory-friendly":"Sensory-friendly","picker.accessShort.plus-size":"Plus-size","picker.accessShort.lift-armrest":"Lift-up armrest","picker.organizerNote":"Organizer note","picker.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count} \u2014 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.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} \u2014 you won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types \u2014 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.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 \u2014 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 \u2014 please head to checkout now.","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 \u2014 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.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 \u2014 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.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 \u2014 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"};var $d=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hr","hu","it","ja","ku","lt","lv","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","uk","zh-Hans","zh-Hant"],Nm={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",hr:"Hrvatski",hu:"Magyar",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ku:"Kurd\xEE",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",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",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430","zh-Hans":"\u7B80\u4F53\u4E2D\u6587","zh-Hant":"\u7E41\u9AD4\u4E2D\u6587"},ps=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hr","hu","it","ja","ku","lt","lv","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","uk","zh-Hans","zh-Hant"],qd=new Set(["ar","fa","he"]),po={li:"lt",iw:"he",mo:"ro",sh:"sr",nb:"no",nn:"no",kmr:"ku",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"},fo=new Map($d.map(t=>[t.toLowerCase(),t]));function Zd(t){let e=t.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let i=fo.get(e)??po[e];if(i)return i;let o=e.split("-");if(o.length>=2){let n=`${o[0]}-${o[1]}`,r=fo.get(n)??po[n];if(r)return r}return fo.get(o[0])??po[o[0]]}var ze={en:Ct},yi={},fe="en";function fs(t,e){let i=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let o of[t,e,...i]){if(!o)continue;let n=Zd(o);if(n)return n}return"en"}function Hm(){return fe}function Gm(t=fe){return qd.has(t)?"rtl":"ltr"}function Vm(t){return!!ze[t]}function it(t,e){e&&(ze[t]={...ze[t],...e}),fe=ze[t]?t:"en",us(fe),ls(fe),typeof document<"u"&&(document.documentElement.lang=fe)}function Wm(t){yi=t}var ms=/\{(\w+)\}/g;function B(t,e){let i=yi[t]??ze[fe]?.[t]??Ct[t]??t;return e?i.replace(ms,(o,n)=>String(e[n]??`{${n}}`)):i}function gs(t,e,i){let o=new Intl.PluralRules(fe).select(e);return(yi[`${t}.${o}`]??ze[fe]?.[`${t}.${o}`]??Ct[`${t}.${o}`]??yi[`${t}.other`]??ze[fe]?.[`${t}.other`]??Ct[`${t}.other`]??t).replace(ms,(s,a)=>String({count:e,...i}[a]??`{${a}}`))}function zm(t,e){return cs(t,{...e??{dateStyle:"medium",timeStyle:"short"},locale:fe})}function bs(t,e,i,o=!1){let n=t.displayLabel?.trim()||t.label;return o?{title:n,detail:B("map.statusTaken"),sellable:!1}:e==="booked"?{title:n,detail:B("map.statusTaken"),sellable:!1}:e==="held"?{title:n,detail:B("map.statusHeld"),sellable:!1}:{title:n,detail:i()??"",sellable:!0}}var ot=32,ys=70;function Ss(t,e){let i=ot+6,o=t.y-ys;return{x:Math.min(Math.max(t.x,i),Math.max(i,e.width-i)),y:o>=i?o:Math.min(t.y+ys,e.height-i)}}var ks=.8,eh=Math.hypot(.46,.36),th=.26,ih=1.6,oh=2*(1-eh),nh=220,rh=.08,bi=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,i,o){let n=o.get(e);if(o.delete(e),!i){this.retire(n);return}n?.destroy();let r=this.host,s=r.seat(e);if(!s)return;let a=r.seatShape(e)?.fill(),l=J(typeof a=="string"?a:"",r.selectionColor(),Je),c=r.selectionFocusId()===e,d=r.boothDims(s.rowId),h=r.seatRadius(),u=r.seatPoint(s),f=new mo({name:"selection-ring",x:u.x,y:u.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusDims(e)?.2:1});if(r.viewMode()==="perspective"){let p=r.perspectiveSeatScale(e);f.scale({x:p,y:p})}f.setAttrs({seatId:e,ringColor:l});let m={name:"selection-halo",stroke:D(r.categoryColor(s.categoryKey),mi(X(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let p=h*1.2;f.add(new yo({...m,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 f.add(new Ke({...m,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let g={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(f.add(new yo({...g,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)f.add(new yo({...g,stroke:ji(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:ks}));else{let p=Math.max(0,d.width/2-14),y=-Math.max(0,d.height/2-14);f.add(new Ke({x:p,y,radius:10,fill:l,listening:!1})),f.add(new go({x:p,y,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:X(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else{let p=Math.max(1,h-1.25),y=Math.min(2.5,Math.max(1.8,h*.22));if(f.add(new Ke({...g,radius:p,strokeWidth:y})),c)f.add(new Ke({...g,stroke:ji(r.canvasBackground()),radius:h+2,strokeWidth:Math.max(2,h*.2),opacity:ks}));else{let b=Math.max(0,p-y/2),S=Math.min(Math.max(ih,b*th),b*oh);f.add(new go({points:[-b*.42,b*.02,-b*.1,b*.34,b*.46,-b*.36],stroke:"#ffffff",strokeWidth:S,lineCap:"round",lineJoin:"round",shadowColor:"#0b1220",shadowBlur:1.5,shadowOpacity:.55,listening:!1}))}}o.set(e,f),this.host.overlayLayer.add(f)}retire(e){let i=this.host;if(!e)return;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden){e.destroy();return}let o=performance.now(),n=r=>{if(i.isDestroyed()||!e.getLayer()){e.destroy();return}let s=Math.min(1,(r-o)/160);e.opacity(1-s),i.overlayLayer.batchDraw(),s<1?requestAnimationFrame(n):(e.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(n)}play(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||typeof document<"u"&&document.hidden||!i.seat(e))return;this.emitPulse(e,!0);let o=this.echoTimers.get(e);o&&clearTimeout(o),this.echoTimers.set(e,setTimeout(()=>{this.echoTimers.delete(e),!(i.isDestroyed()||i.reducedMotion())&&(typeof document<"u"&&document.hidden||this.emitPulse(e,!1))},os))}emitPulse(e,i){let o=this.host,n=o.seat(e);if(!n)return;let r=o.seatRadius(),s=o.seatPoint(n);this.pulses.get(e)?.destroy();let a=new Ke({name:"selection-pulse",x:s.x,y:s.y,radius:r,stroke:o.categoryColor(n.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:co(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,a),this.pulseHome().add(a);let l=i&&!o.isCached()?o.seatShape(e):void 0,c=performance.now(),d=()=>{l?.scale({x:1,y:1}),a.destroy(),this.pulses.get(e)===a&&this.pulses.delete(e),o.overlayLayer.batchDraw(),l&&!o.isCached()&&o.seatLayer.batchDraw()},h=u=>{if(o.isDestroyed()){d();return}a.getLayer()||this.pulseHome().add(a);let f=u-c,m=co(f/420);if(a.radius(r*m.radiusScale),a.opacity(m.opacity),l){let g=is(f/320);l.scale({x:g,y:g})}o.overlayLayer.batchDraw(),l&&!o.isCached()&&o.seatLayer.batchDraw(),f<420?requestAnimationFrame(h):d()};queueMicrotask(()=>{o.isDestroyed()||typeof requestAnimationFrame!="function"||requestAnimationFrame(h)})}nudge(e){let i=this.host;if(i.reducedMotion()||i.isDestroyed()||i.isCached()||typeof document<"u"&&document.hidden)return;let o=i.seatShape(e);if(!o)return;let n=performance.now(),r=()=>{o.scale({x:1,y:1}),i.seatLayer.batchDraw()},s=a=>{if(i.isDestroyed()||i.isCached()||!o.getLayer()){r();return}let l=a-n,c=Math.min(1,l/nh),d=1+rh*Math.sin(Math.PI*c);o.scale({x:d,y:d}),i.seatLayer.batchDraw(),c<1?requestAnimationFrame(s):r()};requestAnimationFrame(s)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new mo({name:"seat-pulses",listening:!1})),this.pulseGroup.getLayer()||this.host.overlayLayer.add(this.pulseGroup),this.host.overlayLayer.isCached()&&this.host.overlayLayer.clearCache(),this.pulseGroup.moveToTop(),this.pulseGroup}showLoupe(e){let i=this.host;if(i.isExportMode()||i.isDestroyed())return;let o=i.nearestSeat(e,ge),n=o?i.seat(o):void 0;if(!n){this.hideLoupe();return}let r=bs(n,i.seatStatus(n.id),()=>i.priceLabel(n),i.seatClosed(n.id)),s=Ss(e,{width:i.stage.width(),height:i.stage.height()}),a=1/(i.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=n.id,l.group.position(i.screenToWorld(s)),l.group.scale({x:a,y:a}),l.group.opacity(r.sellable?1:.75),l.group.visible(!0),l.disc.fill(i.categoryColor(n.categoryKey)),l.title.text(r.title),l.title.offsetX(l.title.width()/2),l.detail.text(r.detail),l.detail.offsetX(l.detail.width()/2),i.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,i=e.canvasBackground(),o=J(i,se(i).sectionInk),n=new mo({name:"touch-loupe",listening:!1,visible:!1});n.add(new go({points:[-7,ot-4,0,ot+12,7,ot-4],closed:!0,fill:i,stroke:D(o,.25),strokeWidth:1,listening:!1})),n.add(new Ke({radius:ot,fill:i,stroke:D(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new Ke({y:-15,radius:6,fill:"#6e7bff",listening:!1}),s=new ws({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),a=new ws({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:D(o,.72),listening:!1,perfectDrawEnabled:!1});return n.add(r),n.add(s),n.add(a),e.overlayLayer.add(n),n.moveToTop(),this.loupe={group:n,title:s,detail:a,disc:r,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}destroy(){for(let e of this.echoTimers.values())clearTimeout(e);this.echoTimers.clear()}};import{Animation as sh}from"konva/lib/Animation";var ah=1e3/ns;function Ls(t){return t.findOne(".selection-halo")??null}var Si=class{constructor(e){this.animation=null;this.targets=[];this.startedAt=0;this.lastFrameAt=0;this.visibilityBound=!1;this.onVisibilityChange=()=>{this.refresh()};this.markers=new Map;this.beaconRings=[];this.host=e}sync(e){this.markers=e,this.refresh()}syncBeacons(e){this.beaconRings=e,this.refresh()}refresh(){let e=this.host,i=this.markers.size>0||this.beaconRings.length>0;if(i&&!e.isDestroyed()&&!e.reducedMotion()&&this.bindVisibility(),e.isDestroyed()||e.reducedMotion()||!this.pageVisible()||!i){this.stop(),this.rest(),(!i||e.isDestroyed()||e.reducedMotion())&&this.unbindVisibility();return}let o=[],n=0;for(let[s,a]of this.markers){let l=Ls(a);if(l){if(this.paintHalo(s,l),n>=ho){l.scale({x:1,y:1}),l.opacity(1);continue}o.push({node:l,phase:uo(n)}),n+=1}}let r=0;for(let s of this.beaconRings){if(r>=ho){s.scale({x:1,y:1}),s.opacity(1);continue}o.push({node:s,phase:uo(r)}),r+=1}if(this.targets=o,!o.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new sh(()=>this.frame(),e.overlayLayer),this.animation.start())}stop(){this.targets=[],this.animation&&(this.animation.stop(),this.animation=null)}destroy(){this.stop(),this.markers=new Map,this.beaconRings=[],this.unbindVisibility()}isRunning(){return!!this.animation?.isRunning()}paintHalo(e,i){let o=this.host,n=mi(X(o.canvasBackground())),r=o.seatCategoryKey(e),s=o.isOwnedHold(e)?Q(o.selectionColor(),o.canvasBackground(),.55):r?o.categoryColor(r):o.selectionColor();i.stroke(D(s,n))}rest(){let e=!1;for(let[i,o]of this.markers){let n=Ls(o);n&&(this.paintHalo(i,n),n.scale({x:1,y:1}),n.opacity(1),e=!0)}for(let i of this.beaconRings)i.scale({x:1,y:1}),i.opacity(1),e=!0;e&&!this.host.isDestroyed()&&this.host.overlayLayer.batchDraw()}frame(){if(this.host.isDestroyed()||!this.targets.length)return this.stop(),!1;let i=performance.now();if(i-this.lastFrameAt<ah)return!1;this.lastFrameAt=i;let o=i-this.startedAt;for(let n of this.targets){let{scale:r,opacity:s}=rs(o,n.phase);n.node.scale({x:r,y:r}),n.node.opacity(s)}return!0}pageVisible(){return typeof document>"u"?!0:document.visibilityState==="visible"}bindVisibility(){this.visibilityBound||typeof document>"u"||(document.addEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!0)}unbindVisibility(){!this.visibilityBound||typeof document>"u"||(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!1)}};import{Group as lh}from"konva/lib/Group";import{Circle as bo}from"konva/lib/shapes/Circle";import{Text as ch}from"konva/lib/shapes/Text";var xs=28,dh=12,hh="800",uh=44,Cs=1.6,Ps=1.95;function Is(t){if(t.rung==="seats")return[];let e=new Map,i=new Map,o=new Map(t.zones.map(n=>[n.id,n.name]));for(let n of t.sections){let r=t.ownedSeatIds(n);if(!r.length)continue;let s=t.rung==="zones"&&n.zone!=null&&o.has(n.zone),a=s?n.zone:n.logicalId,l=e.get(a);if(l){l.count+=r.length,r.length>(i.get(a)??0)&&(i.set(a,r.length),l.seatId=r[0],l.anchor=t.sectionAnchor(n),l.toward=t.sectionCentre(n));continue}i.set(a,r.length),e.set(a,{id:a,kind:s?"zone":"section",name:s?o.get(n.zone):t.sectionName(n),count:r.length,seatId:r[0],anchor:t.sectionAnchor(n),toward:t.sectionCentre(n)})}return[...e.values()]}function ph(t,e){return B("map.beaconAria",{seats:gs("picker.seatCount",t),name:e})}function fh(t,e){let i=e*Ps,o=t.toward.x-t.anchor.x,n=t.toward.y-t.anchor.y,r=Math.hypot(o,n);return r<1e-6?{x:t.anchor.x,y:t.anchor.y-i}:{x:t.anchor.x+o/r*i,y:t.anchor.y+n/r*i}}var mh="selection-beacon-ring",vi=class{constructor(e){this.group=null;this.buttons=[];this.centres=[];this.rings=[];this.targets=[];this.signature="";this.host=e}breathingRings(){return this.rings}current(){return this.targets}sync(e){let i=Math.max(this.host.stageScale(),1e-4),o=`${i.toFixed(4)}|${e.map(c=>`${c.id}:${c.count}:${c.seatId}`).join(",")}`;if(o===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=o,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let n=xs/2/i,r=Math.max(uh,Math.ceil(2*(n*Ps+n)*i)),s=this.host.accent(),a=this.host.accentInk(),l=new lh({listening:!1,name:"selection-beacons"});for(let c of e){let d=fh(c,n);l.add(new bo({name:"selection-beacon-halo",x:c.anchor.x,y:c.anchor.y,radius:n*Cs,fill:D(s,.1),listening:!1,perfectDrawEnabled:!1}));let h=new bo({name:mh,x:c.anchor.x,y:c.anchor.y,radius:n*Cs,stroke:D(s,.55),strokeWidth:Math.max(1,n*.18),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(h),l.add(new bo({name:"selection-beacon-disc",x:d.x,y:d.y,radius:n,fill:s,stroke:D(a,.28),strokeWidth:1/i,listening:!1,perfectDrawEnabled:!1}));let u=new ch({x:d.x,y:d.y,text:String(c.count),fontSize:dh/i,fontStyle:hh,fontFamily:this.host.labelFont(),fill:a,listening:!1,perfectDrawEnabled:!1});u.offsetX(u.width()/2),u.offsetY(u.height()/2),l.add(u),this.rings.push(h),this.centres.push(c.anchor),this.buttons.push(this.buildButton(c,c.anchor,r))}this.host.overlayLayer.add(l),l.moveToTop(),this.group=l,this.host.overlayLayer.batchDraw()}raise(){this.group?.moveToTop()}clear(){this.group?.destroy(),this.group=null,this.rings=[],this.targets=[],this.centres=[],this.signature="";for(let e of this.buttons)e.remove();this.buttons=[]}repositionButtons(){for(let e=0;e<this.buttons.length;e+=1){let i=this.buttons[e],o=this.host.worldToScreen(this.centres[e]),n=i.offsetWidth||parseFloat(i.style.width)||xs;i.style.left=`${o.x-n/2}px`,i.style.top=`${o.y-n/2}px`}}buildButton(e,i,o){let n=this.host.worldToScreen(i),r=document.createElement("button");return r.type="button",r.className="sl-beacon",r.dataset.beacon=e.id,r.setAttribute("aria-label",ph(e.count,e.name)),Object.assign(r.style,{position:"absolute",left:`${n.x-o/2}px`,top:`${n.y-o/2}px`,width:`${o}px`,height:`${o}px`,padding:"0",margin:"0",border:"none",borderRadius:"50%",background:"transparent",cursor:"pointer",touchAction:"manipulation",zIndex:"3"}),r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.host.activate(e)}),r.addEventListener("pointerdown",s=>s.stopPropagation()),this.host.container.appendChild(r),r}};function Pt(t,e,i){let o=t.width(),n=t.height(),r=1/0,s=1/0,a=-1/0,l=-1/0,c=o*2,d=n*2;for(let h of e){let u=h.getClientRect();if(!(!(u.width>1)||!(u.height>1))){if(u.x<-c||u.y<-d||u.x+u.width>o+c||u.y+u.height>n+d)return null;u.x<r&&(r=u.x),u.y<s&&(s=u.y),u.x+u.width>a&&(a=u.x+u.width),u.y+u.height>l&&(l=u.y+u.height)}}if(i&&i.width>=0&&i.height>=0){let h=t.scaleX(),u=i.x*h+t.x(),f=i.y*h+t.y();u<r&&(r=u),f<s&&(s=f),u+i.width*h>a&&(a=u+i.width*h),f+i.height*h>l&&(l=f+i.height*h)}return isFinite(r)?{x:r,y:s,width:a-r,height:l-s}:null}var wi=8,gh=.02,Ts=1,Ms=.5;function Rs(t,e,i,o,n){let r=i??{x:0,y:0,width:t.width(),height:t.height()},s=Pt(t,e,n);if(!s)return 0;So(t,s,r);let a=Math.min((r.width-2*wi)/s.width,(r.height-2*wi)/s.height);if(!(a>0))return 1;let l=Math.max(s.width-r.width,s.height-r.height),c=l>Ms?a:Math.min(a,yh(t.scaleX(),o));if(!(c>1+gh)&&!(l>Ms)||!(c>0)||c===1)return 1;let d=r.x+r.width/2,h=r.y+r.height/2;t.scale({x:t.scaleX()*c,y:t.scaleY()*c}),t.position({x:d+(t.x()-d)*c,y:h+(t.y()-h)*c});let u=Pt(t,e,n);return u&&So(t,u,r),c}function vo(t,e,i,o){let n=i??{x:0,y:0,width:t.width(),height:t.height()},r=Pt(t,e,o);return r?So(t,r,n):!1}function yh(t,e){let i=Math.max(t,1e-9);return(e!=null&&e>i?Math.min(Ts,e):Ts)/i}function So(t,e,i){let o=i.x+i.width/2-(e.x+e.width/2),n=i.y+i.height/2-(e.y+e.height/2);return o===0&&n===0?!1:(t.position({x:t.x()+o,y:t.y()+n}),!0)}function Xe(t){return`${t.x()},${t.y()},${t.scaleX()}`}import{Group as bh}from"konva/lib/Group";import{Circle as As}from"konva/lib/shapes/Circle";import{Line as Sh}from"konva/lib/shapes/Line";import{Text as vh}from"konva/lib/shapes/Text";var wh=6;function wo(t){return X(t)?"#0b1220":"#ffffff"}function Es(t){let{points:e}=t;if(!e.length)return null;let i=t.categoryColor??"#6e7bff",o=0,n=0;for(let r of e)o+=r.x,n+=r.y;return{count:e.length,centroid:{x:o/e.length,y:n/e.length},fill:i,ink:wo(i)}}var ki=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let i of this.host.sections()){if(i.logicalId!==e&&i.id!==e)continue;let o=Es({points:this.host.ownedPoints(i),categoryColor:null});if(o)return o.centroid}return null}badgeAt(e){for(let i of this.badges)if(Math.hypot(e.x-i.centre.x,e.y-i.centre.y)<=i.radius)return i.id;return null}sync(e,i="seats"){if(this.group?.destroy(),this.group=null,this.badges=[],e>=Le){this.host.overlayLayer.batchDraw();return}let o=Math.max(this.host.stageScale(),1e-4),n=new bh({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let a=this.host.ownedPoints(s),l=Es({points:a,categoryColor:this.host.sectionColor(s)});if(!l)continue;let c=Math.max(wh/2/o,1);for(let g of a)n.add(new As({name:"owned-seat-dot",x:g.x,y:g.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(g=>g.logicalId===s.logicalId).reduce((g,p)=>g+this.host.ownedPoints(p).length,0),h=this.host.labelAnchor(s),u=11/o,f={x:h.x,y:h.y-u*2.1};n.add(new As({name:"owned-section-badge",x:f.x,y:f.y,radius:u,fill:l.fill,stroke:D(l.ink,.35),strokeWidth:1/o,listening:!1,perfectDrawEnabled:!1})),n.add(new Sh({x:f.x-u*.62,y:f.y,points:[-u*.22,0,-u*.02,u*.2,u*.34,-u*.26],stroke:l.ink,strokeWidth:Math.max(.6,u*.16),lineCap:"round",lineJoin:"round",listening:!1}));let m=new vh({x:f.x+u*.12,y:f.y-u*.5,text:String(d),fontSize:u,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});n.add(m),this.badges.push({id:s.logicalId,centre:f,radius:u*1.8})}if(!n.hasChildren()){n.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(n),n.moveToTop(),this.group=n,this.host.overlayLayer.batchDraw()}};import{Text as kh}from"konva/lib/shapes/Text";var Lh=4;function It(t){return X(t)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function xh(t,e,i,o){let n=Math.max(0,Math.min(o,e/2,i/2));t.beginPath(),t.moveTo(n,0),t.arcTo(e,0,e,i,n),t.arcTo(e,i,0,i,n),t.arcTo(0,i,0,0,n),t.arcTo(0,0,e,0,n),t.closePath()}function Fs(t,e){t.padding(Lh),t.shadowBlur(0),t.shadowOpacity(0),t.sceneFunc(function(o){let n=this.width(),r=this.height();o.save(),xh(o,n,r,Math.min(r/2,8)),o.setAttr("fillStyle",e.plate),o.fill(),o.setAttr("strokeStyle",e.stroke),o.setAttr("lineWidth",1),o.stroke(),o.restore(),kh.prototype._sceneFunc.call(this,o)})}function _s(t){return t?"seat":"section"}function Bs(t){let e=new Set,i=0;for(let n of t.memberIds){let r=t.categoryKey(n);r&&t.categorySellable(r)&&e.add(r),t.seatSellable(n)&&(i+=1)}let o=[];for(let n of t.categoryOrder)e.has(n)&&o.push({key:n,name:t.categoryLabel(n)||n,price:t.categoryPrice(n),color:t.categoryColor(n)});return o.length?i?{mode:"section",title:t.name,fields:[],rows:o,notes:[],note:null}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],note:B("map.soldOut")}:{mode:"section",title:t.name,fields:[],rows:[],notes:[],note:B("picker.notForSale")}}function Os(t){let e=Ph(t.label,t.sectionLabel,t.rowLabel),i=[t.sectionLabel,t.rowLabel?B("picker.rowLabel",{label:t.rowLabel}):null,e?B("picker.seatLabel",{label:e}):null].filter(Boolean).join(" \xB7 ")||t.label,o=[t.sectionLabel?{caption:B("picker.section"),value:t.sectionLabel}:null,t.rowLabel?{caption:B("picker.row"),value:t.rowLabel}:null,e?{caption:B("picker.seat"),value:e}:null].filter(s=>s!=null),n={key:t.categoryKey,name:t.categoryLabel||t.categoryKey,price:t.categoryPrice,color:t.categoryColor},r=er(t).map(s=>{let a=B(s.titleKey);return{icon:s.icon,title:a===s.titleKey?s.titleFallback:a,tone:s.tone,...s.note?{note:s.note}:{}}});return{mode:"seat",title:i,fields:o,rows:[n],notes:r,note:Ch(t.status,t.closed)}}function Ch(t,e){return e||t==="not_for_sale"?B("picker.notForSale"):t==="booked"?B("map.statusTaken"):t==="held"?B("map.statusHeld"):null}function Ph(t,e,i){let o=t;for(let n of[e,i])!n||!o.startsWith(n)||o.length<=n.length||(o=o.slice(n.length).replace(/^[\s·\-/_]+/,""));return o}var Ih=16,Th=8;function Ds(t,e,i,o=Ih){let n=Th,r=t.x+o;r+e.width>i.width-n&&(r=t.x-o-e.width);let s=t.y+o;return s+e.height>i.height-n&&(s=t.y-o-e.height),{x:Math.max(n,Math.min(r,Math.max(n,i.width-n-e.width))),y:Math.max(n,Math.min(s,Math.max(n,i.height-n-e.height)))}}var Ns=16,Hs=14,Mh=10.5,Rh=14,Ah=12.5,Gs={onDark:{warn:"#f4b740",premium:"#e8c15a"},onLight:{warn:"#8a5a00",premium:"#7a5c05"}},Eh={warn:"#d8a425",premium:"#e8c15a"},Fh=.1,_h=.06,Li=class{constructor(e){this.root=null;this.titleEl=null;this.rowsEl=null;this.notesEl=null;this.noteEl=null;this.signature="";this.model=null;this.cursor=null;this.raf=0;this.attached=!1;this.lastUpdateMs=0;this.rowNames=new Map;this.rowNamesDoc=null;this.onPointerMove=e=>{if(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=()=>this.hide();this.onPointerDown=e=>{e.pointerType!=="mouse"&&this.hide()};this.onWheel=()=>{this.cursor&&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.noteEl=null,this.signature=""}hide(){this.cursor=null,this.signature="",this.model=null,this.root&&(this.root.style.display="none")}text(){let e=this.model;return!e||!this.root||this.root.style.display==="none"?"":[e.title,...e.rows.map(i=>[i.name,i.price].filter(Boolean).join(" ")),...e.notes.map(i=>[i.title,i.note].filter(Boolean).join(": ")),e.note].filter(Boolean).join(" | ")}schedule(){this.raf||(this.raf=requestAnimationFrame(()=>{this.raf=0,this.update()}))}update(){let e=performance.now(),i=this.cursor;if(!i)return;let o=this.host.hostCardOpen?.()?null:this.resolve(i);if(!o){this.hide(),this.lastUpdateMs=performance.now()-e;return}let n=this.ensureRoot(),r=`${o.mode}|${o.title}|${o.note??""}|${this.host.canvasBackground()}|`+o.rows.map(a=>`${a.key}:${a.price??""}:${a.color}`).join(",")+`|${o.notes.map(a=>`${a.icon}:${a.title}:${a.note??""}`).join(",")}`;r!==this.signature&&(this.signature=r,this.paint(o)),this.model=o,n.style.display="block";let s=Ds(i,{width:n.offsetWidth,height:n.offsetHeight},{width:this.host.container.clientWidth,height:this.host.container.clientHeight});n.style.left=`${s.x}px`,n.style.top=`${s.y}px`,this.lastUpdateMs=performance.now()-e}resolve(e){if(_s(this.host.seatsPickable())==="seat"){let n=this.host.hoveredSeatId()??this.host.nearestSeat(e),r=n?this.host.seat(n):void 0;if(!n||!r||this.host.seatStatus(n)!=="free"&&!this.host.seatOwnedHold?.(n)||this.host.seatClosed(n))return null;let l=this.host.seatSectionLabel(n);return Os({label:r.displayLabel?.trim()||r.label,rowLabel:this.rowName(r,l),sectionLabel:l,categoryKey:r.categoryKey,categoryLabel:this.host.categoryLabel(r.categoryKey),categoryPrice:this.host.categoryPrice(r.categoryKey),categoryColor:this.host.categoryColor(r.categoryKey),status:this.host.seatStatus(n),closed:this.host.seatClosed(n),...r.accessibility?.length?{accessibility:r.accessibility}:{},...r.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{},...r.commercial?{commercial:r.commercial}:{}})}let i=this.host.sectionAt(e),o=i?this.host.sectionLabel(i):null;return!i||o==null||this.host.sectionInteractive?.(i)===!1?null:Bs({name:o||i,memberIds:this.host.sectionMembers(i),categoryOrder:this.host.categoryOrder(),categoryKey:n=>this.host.seat(n)?.categoryKey??null,categoryLabel:n=>this.host.categoryLabel(n),categoryPrice:n=>this.host.categoryPrice(n),categoryColor:n=>this.host.categoryColor(n),categorySellable:n=>this.host.categorySellable(n),seatSellable:n=>this.host.seatSellable(n)})}rowName(e,i){let o=this.host.chartDoc();if(!o)return null;if(this.rowNamesDoc!==o){this.rowNamesDoc=o,this.rowNames.clear();for(let r of o.objects){if(r.type!=="row")continue;let s=r.segmentedRow?.displayLabel??r.displayLabel??r.label;s&&(this.rowNames.set(r.id,s),r.segmentedRow&&this.rowNames.set(r.segmentedRow.groupId,s))}}let n=this.rowNames.get(e.logicalRowId??e.rowId)??this.rowNames.get(e.rowId);return n?bt(n,i??void 0)||n:null}ensureRoot(){if(this.root)return this.root;let e=It(this.host.canvasBackground()),i=document.createElement("div");i.className="sl-hover-card",i.setAttribute("aria-hidden","true"),Object.assign(i.style,{position:"absolute",left:"0",top:"0",display:"none",pointerEvents:"none",boxSizing:"border-box",minWidth:"190px",maxWidth:"340px",padding:"0",overflow:"hidden",borderRadius:"10px",background:e.plate,border:`1px solid ${e.stroke}`,boxShadow:"0 6px 20px rgba(2,6,23,0.22)",fontFamily:this.host.labelFont(),lineHeight:"1.35",zIndex:"2"});let o=document.createElement("div");Object.assign(o.style,{fontSize:`${Ns}px`,fontWeight:"700",padding:"10px 15px 9px",textAlign:"center",color:J(e.plate,"#0b1220")});let n=document.createElement("div");Object.assign(n.style,{display:"flex",flexDirection:"column",gap:"0"});let r=document.createElement("div");Object.assign(r.style,{display:"none",flexDirection:"column",gap:"0"});let s=document.createElement("div");return Object.assign(s.style,{fontSize:`${Hs}px`,fontWeight:"600",padding:"0 15px 10px",textAlign:"center",opacity:"0.72",color:J(e.plate,"#0b1220")}),i.append(o,n,r,s),this.host.container.appendChild(i),this.root=i,this.titleEl=o,this.rowsEl=n,this.notesEl=r,this.noteEl=s,i}paint(e){let i=this.ensureRoot(),o=It(this.host.canvasBackground());i.style.background=o.plate,i.style.border=`1px solid ${o.stroke}`;let n=this.titleEl,r=this.rowsEl,s=this.notesEl,a=this.noteEl,l=J(o.plate,"#0b1220");if(n.replaceChildren(),n.style.color=l,n.style.paddingBottom=e.rows.length||e.note?"9px":"10px",e.fields.length){let c=e.fields[0]?.caption;n.style.display="flex",n.style.padding="0";for(let[d,h]of e.fields.entries()){let u=document.createElement("div");Object.assign(u.style,{flex:h.caption===c?"1 1 auto":"0 0 auto",minWidth:"0",padding:"9px 13px 10px",textAlign:"center",borderLeft:d?`1px solid ${o.stroke}`:"none"});let f=document.createElement("div");f.textContent=h.caption,Object.assign(f.style,{fontSize:`${Mh}px`,fontWeight:"800",letterSpacing:".12em",textTransform:"uppercase",opacity:"0.6"});let m=document.createElement("div");m.textContent=h.value,Object.assign(m.style,{marginTop:"2px",fontSize:`${Ns}px`,fontWeight:"700",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"}),u.append(f,m),n.append(u)}}else n.style.display="block",n.style.padding="10px 15px 9px",n.textContent=e.title;r.replaceChildren();for(let c of e.rows){let d=document.createElement("div");Object.assign(d.style,{display:"flex",justifyContent:"space-between",gap:"16px",padding:"9px 15px",fontSize:`${Hs}px`,fontWeight:"700",background:c.color,color:Zi(c.color)});let h=document.createElement("span");h.textContent=c.name;let u=document.createElement("span");u.textContent=c.price??"",d.append(h,u),r.appendChild(d)}this.paintNotes(s,e,o,l),a.textContent=e.note??"",a.style.display=e.note?"block":"none",a.style.marginTop=e.note&&e.rows.length?"6px":"0",a.style.color=J(o.plate,"#0b1220")}paintNotes(e,i,o,n){if(e.replaceChildren(),!i.notes.length){e.style.display="none";return}e.style.display="flex";for(let[r,s]of i.notes.entries()){let a=Zi(o.plate)==="#ffffff"?Gs.onDark:Gs.onLight,l=s.tone==="warn"?a.warn:s.tone==="premium"?a.premium:n,c=s.tone==="warn"||s.tone==="premium"?Q(o.plate,Eh[s.tone],Fh):Q(o.plate,n,_h),d=document.createElement("div");Object.assign(d.style,{display:"flex",alignItems:"flex-start",gap:"9px",padding:"9px 15px",background:c,borderTop:r?`1px solid ${o.stroke}`:"none"});let h=document.createElementNS("http://www.w3.org/2000/svg","svg");h.setAttribute("viewBox",`0 0 ${20} ${20}`),h.setAttribute("width","17"),h.setAttribute("height","17"),h.setAttribute("fill","none"),h.setAttribute("stroke",l),h.setAttribute("stroke-width","1.45"),h.setAttribute("stroke-linecap","round"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("aria-hidden","true"),h.innerHTML=Pn(s.icon),Object.assign(h.style,{flex:"none",marginTop:"1px"});let u=document.createElement("div");Object.assign(u.style,{display:"flex",flexDirection:"column",gap:"2px",minWidth:"0"});let f=document.createElement("div");if(f.textContent=s.title,Object.assign(f.style,{fontSize:`${Rh}px`,fontWeight:"750",color:s.tone==="access"?n:l}),u.appendChild(f),s.note){let m=document.createElement("div");m.textContent=s.note,Object.assign(m.style,{fontSize:`${Ah}px`,fontWeight:"600",lineHeight:"1.35",opacity:"0.75",color:n}),u.appendChild(m)}d.append(h,u),e.appendChild(d)}}};function z(t){let e=Bn(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 nt(t,e,i,o){let n=o*Math.PI/180,r=Math.cos(n),s=Math.sin(n);return[{x:-e/2,y:-i/2},{x:e/2,y:-i/2},{x:e/2,y:i/2},{x:-e/2,y:i/2}].map(a=>({x:t.x+a.x*r-a.y*s,y:t.y+a.x*s+a.y*r}))}function rt(t,e,i,o,n,r){let s=o*Math.PI/180,a=Math.cos(s),l=Math.sin(s);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let h=e*(d/6-.5),u=i*(c/4-.5),f={x:t.x+h*a-u*l,y:t.y+h*l+u*a};if(!j(f,n,r))return!1}return!0}function Vs(t,e,i){let o=z(t),n={x:o.x+o.width/2,y:o.y+o.height/2},r=j(n,t,e)?[n,i]:[i],s=[];for(let l=1;l<12;l+=1)for(let c=1;c<12;c+=1){let d={x:o.x+o.width*c/12,y:o.y+o.height*l/12};j(d,t,e)&&s.push(d)}let a=[t,...e];return[...r,...s.map(l=>({point:l,room:hn(l,a)})).sort((l,c)=>c.room-l.room).map(l=>l.point)].filter((l,c,d)=>c===d.findIndex(h=>Math.abs(h.x-l.x)<1e-6&&Math.abs(h.y-l.y)<1e-6))}function Ws(t,e){let{stageScale:i,stageX:o,stageY:n}=t;if(t.viewMode==="perspective"&&e.perspectiveAffine)return z(e.outline.map(s=>{let a=t.projectedSectionPoint(e,s);return{x:a.x*i+o,y:a.y*i+n}}));let r=e.liftWorld>0?t.isoLiftLocal(e.liftWorld):{x:0,y:0};return z(e.outline.map(s=>{let a={x:s.x+r.x,y:s.y+r.y},l=t.isoT===0?a:t.isoForward(a);return{x:l.x*i+o,y:l.y*i+n}}))}function Bh(t,e){let i=t.width*t.height;if(i<=0)return 0;let o=Math.max(0,Math.min(t.x+t.width,e.width)-Math.max(t.x,0)),n=Math.max(0,Math.min(t.y+t.height,e.height)-Math.max(t.y,0));return o*n/i}function zs(t){let{current:e,viewport:i}=t,o=new Map;for(let a of t.sections){let l=Bh(a.bounds,i)*a.members;l<=0||o.set(a.logicalId,(o.get(a.logicalId)??0)+l)}if(!o.size)return e;let n=null,r=0;for(let[a,l]of o)l>r&&(r=l,n=a);if(!n||n===e)return e;let s=e!=null?o.get(e)??0:0;return r>s*1.35?n:e}import{Text as Dh}from"konva/lib/shapes/Text";function Oh(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 Ye=class{constructor(){this.cells=new Map}insert(e){for(let i of this.keys(e)){let o=this.cells.get(i);o?o.push(e):this.cells.set(i,[e])}}collisionCount(e){let i=new Set,o=0;for(let n of this.keys(e))for(let r of this.cells.get(n)??[])i.has(r)||(i.add(r),Oh(e,r)&&o++);return o}keys(e){let i=Math.floor(e.x/wt),o=Math.floor((e.x+Math.max(0,e.width))/wt),n=Math.floor(e.y/wt),r=Math.floor((e.y+Math.max(0,e.height))/wt),s=[];for(let a=n;a<=r;a++)for(let l=i;l<=o;l++)s.push(`${l}:${a}`);return s}};function Ks(t,e){let i=t.sections.filter(m=>m.id===e||m.logicalId===e),o=i.map(m=>{if(t.viewMode==="perspective"&&m.perspectiveAffine)return z(m.outline.map(y=>t.projectedSectionPoint(m,y)));let g=m.liftWorld>0?t.isoLiftLocal(m.liftWorld):{x:0,y:0},p=m.outline.map(y=>{let b={x:y.x+g.x,y:y.y+g.y};return t.isoT===0?b:t.isoForward(b)});return z(p)});if(!o.length)return null;let n=Math.min(...o.map(m=>m.x)),r=Math.min(...o.map(m=>m.y)),s=Math.max(...o.map(m=>m.x+m.width)),a=Math.max(...o.map(m=>m.y+m.height)),l=new Set(i.flatMap(m=>m.memberIds));for(let m of l){let g=t.seatById.get(m);if(!g)continue;let p=t.renderedSeatPoint(g);n=Math.min(n,p.x-t.seatR),r=Math.min(r,p.y-t.seatR),s=Math.max(s,p.x+t.seatR),a=Math.max(a,p.y+t.seatR)}let c=m=>{[m.x,m.y,m.width,m.height].every(Number.isFinite)&&(n=Math.min(n,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 g={x:m.x+m.width/2,y:m.y+m.height/2};return i.some(p=>j(g,p.outline,p.holes))};for(let{node:m,backdrop:g}of t.freeTextById.values()){let p=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(p)&&(c(p),g&&c(g.getClientRect({relativeTo:t.bgLayer,skipShadow:!0})))}for(let{node:m}of t.iconNodeById.values()){let g=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0});d(g)&&c(g)}let h=new Ye;for(let{node:m}of t.freeTextById.values()){let g=m.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:g.x-ie,y:g.y-ie,width:g.width+ie*2,height:g.height+ie*2})}for(let m of t.rowLabelPlan){let g=(m.focusKeys??[]).some(S=>S===e||i.some(w=>S===w.id||S===w.logicalId)),p=new Dh({text:m.text,fontSize:m.fontSize,fontStyle:"700",fontFamily:t.labelFont(),rotation:m.rotation,listening:!1});p.offsetX(p.width()/2),p.offsetY(p.height()/2);let y=t.resolveAutomaticRowLabelPosition(p,m,h),b=t.rowLabelBox(p,y);g&&c(b),h.insert(b),p.destroy()}let u=Math.max(s-n,a-r),f=Math.max(t.seatR*2,Math.min(24,u*.025));return{x:n-f,y:r-f,width:Math.max(1,s-n+f*2),height:Math.max(1,a-r+f*2)}}import{Rect as Nh}from"konva/lib/shapes/Rect";import{Text as Xs}from"konva/lib/shapes/Text";var ko="\0";function Hh(t){let e=0;for(let i=0;i<t.length;i++){let o=t[i],n=t[(i+1)%t.length];e+=o.x*n.y-n.x*o.y}return Math.abs(e)/2}function Gh(t,e){let i=t.filter(f=>Number.isFinite(f.centroid.x)&&Number.isFinite(f.centroid.y));if(!i.length||!e||!Number.isFinite(e.x)||!Number.isFinite(e.y))return null;let o=i.map(f=>({member:f,weight:Math.max(1,Hh(f.outline))})),n=o.reduce((f,m)=>f+m.weight,0),r=o.reduce((f,m)=>({x:f.x+m.member.centroid.x*m.weight/n,y:f.y+m.member.centroid.y*m.weight/n}),{x:0,y:0}),s={x:r.x-e.x,y:r.y-e.y},a=Math.hypot(s.x,s.y);if(!(a>1e-6))return null;let l={x:s.x/a,y:s.y/a},c=i.map(f=>{let m={x:f.centroid.x-e.x,y:f.centroid.y-e.y},g={x:f.centroid.x-r.x,y:f.centroid.y-r.y};return{member:f,depth:m.x*l.x+m.y*l.y,lateral:Math.abs(g.x*-l.y+g.y*l.x)}}).sort((f,m)=>m.depth-f.depth||f.member.id.localeCompare(m.member.id)),d=c[0].depth-c[c.length-1].depth,h=c[0].depth-d/3,u=c.filter(f=>f.depth>=h);return u.sort((f,m)=>f.lateral-m.lateral||m.depth-f.depth||f.member.id.localeCompare(m.member.id)),u[0].member}function Vh(t){let i=[...B("map.fromPrice",{price:ko}).toLocaleLowerCase()],o=i.findIndex(n=>n!==ko&&n.toLocaleUpperCase()!==n.toLocaleLowerCase());return o>=0&&(i[o]=i[o].toLocaleUpperCase()),i.join("").split(ko).join(t)}function Ys(t,e){if(!e.zones?.length||!t.sections.length)return;let i=Qr(t.canvasBackground),o=new Map;for(let n of t.sections)n.zone&&(o.get(n.zone)??o.set(n.zone,[]).get(n.zone)).push(n);for(let n of e.zones){let r=o.get(n.id);if(!r||!r.length)continue;let s=r[0];for(let p of r)p.centroid.y<s.centroid.y&&(s=p);t.derivedFloorGroups&&(s=Gh(r,n.focalPoint??e.focalPoint)??s);let a=s.centroid.x,l=s.centroid.y,c=1/0,d=-1/0;for(let p of r)for(let y of p.outline)y.x<c&&(c=y.x),y.x>d&&(d=y.x);let h=isFinite(c)&&d>c?d-c:0,u=1/0;for(let p of r)for(let y of p.memberIds){let b=t.seatById.get(y),S=b&&t.catPrice.get(b.categoryKey);typeof S=="number"&&S<u&&(u=S)}let f=new Nh({x:a,y:l,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:i.plate,stroke:D(n.color??s.outlineTint,xr),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(f);let m=new Xs({x:a,y:l,text:n.label,fontSize:hi,fontStyle:yr,letterSpacing:0,fontFamily:t.labelFont(),fill:i.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});m.offsetX(m.width()/2),m.offsetY(m.height()/2),t.bgLayer.add(m);let g=null;isFinite(u)&&(g=new Xs({x:a,y:l,text:Vh(We(u,t.currency)),fontSize:ui,fontStyle:br,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:n.id,anchor:{x:a,y:l},back:f,background:i.plate,name:n.label,spanWorld:h,label:m,sub:g})}}function Us(t,e){let i=t.zones.find(({back:d})=>{if(!d.visible()||d.opacity()<.5)return!1;let h=d.getClientRect();return e.x>=h.x&&e.x<=h.x+h.width&&e.y>=h.y&&e.y<=h.y+h.height});if(!i)return!1;let o=t.doc,n=o?.floorOverview==="combined"&&!o.zones?.length?o.floors?.find(d=>kn(d.id)===i.id):void 0;if(n)return t.enterFloor(n.id),!0;let r=t.sections.filter(d=>d.zone===i.id).flatMap(d=>d.outline);if(!r.length)return!1;let s=Math.min(...r.map(d=>d.x)),a=Math.max(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=Math.max(...r.map(d=>d.y));return t.frame({x:s,y:l,width:Math.max(1,a-s),height:Math.max(1,c-l)}),!0}import{Circle as $h}from"konva/lib/shapes/Circle";import{Line as qh}from"konva/lib/shapes/Line";import{Rect as Zh}from"konva/lib/shapes/Rect";import{Text as jh}from"konva/lib/shapes/Text";function Ce(t,e){return e.length===0?!!t.accessible:!!t.accessibility?.some(i=>e.includes(i))}function Pe(t,e){return Ce(t,e)?"match":t.accessibility?.includes("companion")?"companion":"other"}var $s=.35,qs=.7,Ue="#0b1220",st="#ffffff",Zs="#0b1220",js="#232c40",Qs="#8b93a7";function Lo(t,e,i="normal"){let o=t?"bold":i;return e?`italic ${o}`.trim():o}var xo="#f7f8fb";import{Shape as zh}from"konva/lib/Shape";import{Circle as Kh}from"konva/lib/shapes/Circle";import{Rect as Xh}from"konva/lib/shapes/Rect";var Wh={M:2,L:2,Q:4,C:6,Z:0},Co=new Map;function Po(t){let e=Co.get(t);if(e)return e;let i=oi(t);if(!i)return Co.set(t,[]),[];let o=i.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],n=[],r=0;for(;r<o.length;){let s=o[r++],a=Wh[s];if(a===void 0||r+a>o.length)throw new Error(`Invalid path data for seat glyph "${t}".`);let l=o.slice(r,r+a).map(Number);if(l.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${t}".`);r+=a,s==="M"||s==="L"?n.push({command:s,points:l}):s==="Q"?n.push({command:s,points:l}):s==="C"?n.push({command:s,points:l}):n.push({command:"Z",points:[]})}return Co.set(t,n),n}function Js(t,e,i,o=0,n=0){let r=Po(e),s=On(e).bounds;if(!r.length||!s||!(i>0))return!1;let a=Dn(s,i);t.save(),t.translate(o,n),t.scale(a.scale,a.scale),t.translate(-a.centreX,-a.centreY);for(let l of r)l.command==="M"?t.moveTo(l.points[0],l.points[1]):l.command==="L"?t.lineTo(l.points[0],l.points[1]):l.command==="Q"?t.quadraticCurveTo(l.points[0],l.points[1],l.points[2],l.points[3]):l.command==="C"?t.bezierCurveTo(l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]):t.closePath();return t.restore(),!0}function ea(t,e){t.beginPath(),t.arc(0,0,e,0,Math.PI*2,!1),t.closePath()}var Tt=class extends zh{_sceneFunc(e){let i=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,n=Po(o),r=this.attrs.seatGlyphDetail,s;if(r===void 0){let a=this.getAbsoluteScale(),l=Math.max(Math.abs(a.x),Math.abs(a.y)),c=Number.isFinite(l)&&l>0?l:1;s=i*2*c>=16}else s=r;if(!n.length||!s){ea(e,i),e.fillStrokeShape(this);return}e.beginPath(),Js(e,o,i),e.fillStrokeShape(this)}_hitFunc(e){ea(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 Yh(t,e){return t==="circle"||!oi(t)?null:new Tt({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 ta(t){let{x:e,y:i,radius:o}=t;return t.wheelchairBay?new Xh({x:e,y:i,width:o*2,height:o*2,offsetX:o,offsetY:o,cornerRadius:2,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):Yh(t.glyph,{x:e,y:i,radius:o,detail:t.detail,fill:t.fill})??new Kh({x:e,y:i,radius:o,...t.fill?{fill:t.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Uh(t,e){return t*2*e>=16}function ia(t,e,i,o){let n=Uh(e,i);if(n===o||!t.length)return n;for(let r of t)r.setAttr("seatGlyphDetail",n);return n}function oa(t){let e=[...t.seats].sort((i,o)=>(t.perspectiveSeatDepth.get(o.id)??0)-(t.perspectiveSeatDepth.get(i.id)??0));for(let i of e){if(i.kind==="booth"){Qh(t,i);continue}let o=t.seatContainer(i.id),n=ta({x:i.x,y:i.y,radius:t.seatR,detail:t.seatGlyphDetail,glyph:Nn(i.glyph,t.catByKey.get(i.categoryKey)),wheelchairBay:i.wheelchairSpaceType==="no-seat"});if(n instanceof Tt&&t.glyphMarkers.push(n),n.setAttr("seatId",i.id),t.circleById.set(i.id,n),t.paintSeat(n,i.id),o.add(n),i.accessible){if(i.wheelchairSpaceType!=="no-seat"){let r=new $h({x:i.x,y:i.y,radius:t.seatR+1.5,stroke:yt(i.accessibility,{colorblind:t.colorblind,canvasBackground:t.canvasBackground}),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});t.accessRingById.set(i.id,r),o.add(r)}if(Jt(i.accessibility??[])){let r=t.buildAccessGlyph(i,typeof n.fill()=="string"?n.fill():"");t.accessGlyphById.set(i.id,r),o.add(r)}}}}function Qh(t,e){let i=t.seatContainer(e.id),o=t.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},n=e.x,r=e.y,s;o.points&&o.points.length>=3?(s=new qh({x:e.x,y:e.y,points:o.points.flatMap(l=>[l.x,l.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),n=e.x+o.points.reduce((l,c)=>l+c.x,0)/o.points.length,r=e.y+o.points.reduce((l,c)=>l+c.y,0)/o.points.length):s=new Zh({x:e.x,y:e.y,width:o.width,height:o.height,offsetX:o.width/2,offsetY:o.height/2,rotation:o.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s.setAttr("seatId",e.id),t.circleById.set(e.id,s),i.add(s);let a=new jh({x:n,y:r,text:e.displayLabel??e.label,fontSize:De,fontStyle:"600",fontFamily:t.labelFont(),fill:t.theme.seatLabelColor??Ue,listening:!1,perfectDrawEnabled:!1});a.offsetX(a.width()/2),a.offsetY(a.height()/2),a.visible(!1),t.setHasBoothText(),t.boothLabelById.set(e.id,a),i.add(a),t.paintSeat(s,e.id)}function na(t,e,i,o){let n=null,r=1/0,s=t.stage.scaleX()||1;for(let a of t.seats){if(!o?.includeUnavailable&&!t.selection.has(a.id)&&!t.isSelectable(a.id))continue;let l=t.worldToScreen(a),c=t.viewMode==="perspective"?t.perspectiveSeatScale.get(a.id)??1:1,d=t.seatR*s*c+i,h=Math.hypot(l.x-e.x,l.y-e.y);h<=d&&h<r&&(r=h,n=a.id)}return n}function ra(t){if(!t.objectFloor.size)return null;let e=t.stage.getPointerPosition();if(!e)return null;let i=t.screenToWorld(e),o=null,n=1/0;for(let r of t.seats){let s=t.renderedSeatPoint(r),a=s.x-i.x,l=s.y-i.y,c=a*a+l*l;c<n&&(n=c,o=r.rowId)}return o?t.objectFloor.get(o)??null:null}import{Circle as Su}from"konva/lib/shapes/Circle";import{Group as Pa}from"konva/lib/Group";import{Rect as vu}from"konva/lib/shapes/Rect";import{Text as wu}from"konva/lib/shapes/Text";var Ie=1.12;function at(t,e,i,o){if(e.width<=0||e.height<=0)return t.scaleX();let n=o??{x:0,y:0,width:t.width(),height:t.height()},r=Math.min(n.width/(e.width*Ie),n.height/(e.height*Ie));return K(r,i.min,i.max)}var Mt=.55;function Rt(t,e){return e==null?t.max:Math.max(t.min,Math.min(t.max,e))}function Io(t){let{stage:e,box:i,bounds:o,viewport:n,centreScreen:r}=t,s=t.ratio??xt,a=e.scaleX(),l=at(e,i,o,n)/Math.max(a,1e-4);if(l>=s||l<=1/s)return!1;let c=r.x-(n.x+n.width/2),d=r.y-(n.y+n.height/2);return Math.hypot(c,d)<=Math.min(n.width,n.height)*.02}function sa(t,e,i,o){let n=K(e,o.min,o.max),r=t.scaleX();if(n===r)return!1;let s=(i.x-t.x())/r,a=(i.y-t.y())/r;return t.scale({x:n,y:n}),t.position({x:i.x-s*n,y:i.y-a*n}),!0}function aa(t,e,i,o,n,r){let s=n??{x:0,y:0,width:t.width(),height:t.height()},a=Math.min(s.width/(e.width*Ie),s.height/(e.height*Ie)),l=o??i.min,c=K(Math.max(a,l),i.min,Math.max(l,Rt(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 la(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function To(t,e){let i=null;for(let o of t){let n=e.get(o)?.logicalId;if(!n||i!=null&&i!==n)return null;i=n}return i}function ca(t,e){if(!e?.size)return!1;for(let i of t)if(e.has(i))return!1;return!0}var Jh=11;function eu(t){let e=tt(Jh,t),i=di(t),o=[];for(let n=Math.round(e);n>=i;n-=1)o.push(n);return o.length?o:[i]}var tu=4,iu=2;function ou(t){let e=t.trim();if(!e)return null;if(/^[a-z]{1,3}\d{1,4}[a-z]?$/i.test(e))return e;let i=e.match(/\d+/g);if(i?.length){let o=i[0];for(let n of i)n.length>=o.length&&(o=n);return o}return e.length<=4?e:null}function da(t,e,i){let o=t.numberLabel,n=ou(t.label);if(!n)return o.visible(!1),!1;o.text()!==n&&o.text(n),o.visible(!0),o.rotation(0);let r=tu/e;for(let s of eu(i)){o.fontSize(s/e),o.offsetX(o.width()/2),o.offsetY(o.height()/2);for(let a of[t.centroid,...t.labelAnchors])if(o.position(a),rt(a,o.width()+r,o.height()+r,0,t.outline,t.holes))return!0}return o.position(t.centroid),!1}function nu(t,e,i){let o=i({x:t.x(),y:t.y()}),n=t.width()*e,r=t.height()*e;return{x:o.x-n/2,y:o.y-r/2,w:n,h:r}}function ru(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 ha(t,e,i,o){let n=[];for(let r of e){if(r.label.opacity()<=.05)continue;let s=r.back.getAbsolutePosition(),a=r.back.width()*i,l=r.back.height()*i;n.push({x:s.x-a/2,y:s.y-l/2,w:a,h:l})}if(n.length)for(let r of t){if(r.numberLabel.opacity()<=.05)continue;let s=nu(r.numberLabel,i,o);for(let a of n)if(ru(s,a,iu)){r.numberLabel.opacity(0);break}}}function ua(t){let e=new Map;for(let i of t){if(i.numberLabel.opacity()<=.05)continue;let o=e.get(i.logicalId);o?o.push(i):e.set(i.logicalId,[i])}for(let i of e.values()){if(i.length<2)continue;let o=i[0];for(let n of i)n.labelArea>o.labelArea&&(o=n);for(let n of i)n!==o&&n.numberLabel.opacity(0)}}function ga(t,e){let i=t.sectionHeat.get(e.id)??t.sectionHeat.get(e.logicalId)??(e.zone?t.sectionHeat.get(e.zone):void 0);if(i==null||i<=0){e.outlinePoly.stroke(D(e.outlineTint,.5)),e.outlinePoly.fill(D(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=Q("#f4b740","#ef4444",i);e.outlinePoly.stroke(D(o,.72+i*.25)),e.outlinePoly.fill(D(o,.08+i*.13)),e.outlinePoly.strokeWidth(2+i*3.5),e.outlinePoly.shadowColor(o),e.outlinePoly.shadowBlur(4+i*12),e.outlinePoly.shadowOpacity(.25+i*.45)}function Ro(t,e){return t.closedSections.has(e.id)||t.closedSections.has(e.logicalId)||e.zone!=null&&t.closedSections.has(e.zone)}function ya(t,e,i,o){if(!e)return 0;let n=0;for(let r of t){if(i(r)!=="free")continue;let s=o(r);s&&Ce(s,e)&&(n+=1)}return n}function su(t,e){return Ro(t,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Hr?"nearly-gone":"normal"}function ba(t,e){let i=su(t,e),o=t.accessFilterActive&&t.sectionAccessibleFree(e)<=0,n=Zr(t.canvasBackground,i,o?null:e.shellCategoryColor);e.shellFill=n.fill,e.shellStroke=n.stroke,e.blockPoly.fill(n.fill),e.blockPoly.stroke(n.stroke),e.subLabel.text(i==="sold-out"?B("map.soldOut"):B("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Sa(t,e){return Q(e,X(t)?"#ffffff":"#000000",Er)}function Ao(t,e,i=0){let o=Ar-i;return!e||t.length<=o?t:`${t.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function au(t,e){return va(t,e)!=null}function va(t,e){if(!t.accessFilterActive)return null;let i=t.sectionAccessibleFree(e);return i>0?`\u267F ${i}`:null}function wa(t,e,i){let o=Ao(t.label,e,i?i.length+1:0);return i?[`${i} ${o}`,i]:[o]}function lu(t,e,i){let o=wa(t,e,i),n=(t.nameLabelBadgeOnly?o[1]:o[0])??o[0];t.nameLabel.text()!==n&&t.nameLabel.text(n),t.nameLabel.fontStyle(Rr),t.nameLabel.letterSpacing(e?t.nameLabel.fontSize()*_e:0)}function cu(t){t.namePlate.opacity(0),t.subLabel.opacity(0)}function ka(t,e){let i,o;t.reducedMotion?(i=e<=ye?1:0,o=e<=He?1:0):(i=K((Le-e)/(Le-ye),0,1),o=K((ye-e)/(ye-He),0,1)),(t.floorOverview||t.focusedSectionId)&&(i=0,o=0);let n=!t.floorOverview&&!t.focusedSectionId&&e<te;n&&(i=1),t.zones.length||(o=0);let r=t.viewMode==="perspective"&&t.glideInProgress&&t.seatCount>2500;t.seatLayer.opacity(n||r?0:1-i);let s=t.stageScaleX,a=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>ro);a&&t.setLodScale(e);let l=t.focusedSectionId,c=t.stageWidth<q,d=c&&n&&t.zones.length===0,h=se(t.canvasBackground),u=K((i-.2)/.8,0,1),f=new Set;for(let g of t.sections){let p=t.hasFocusDimOverlay?1:l&&g.id!==l&&g.logicalId!==l&&g.zone!==l?xe:1,y=va(t,g);y&&g.zone&&f.add(g.zone);let b=Math.min(p,ca(g.memberCategoryKeys,t.categoryFilter)?xe:1,t.accessFilterActive&&!y?xe:1);g.outlinePoly.opacity(n?0:(1-i)*b),g.blockPoly.opacity(fr*i*b);let S=t.sectionIsOwned(g);g.blockPoly.stroke(S?t.selectionColor:g.shellStroke||h.sectionStroke),g.blockPoly.strokeWidth((S?mr:Ge)/Math.max(s,1e-4));let w=g.blockPoly.fill(),k=typeof w=="string"?w:g.baseFill,v=Jr(k,g.explicitInk,g.preferredInk,En);g.nameLabel.fill(v),g.subLabel.fill(v),lu(g,c,y),a&&(u>.01||g.externalLabel)&&uu(t,g,s,wa(g,c,y));let L=y?1:1-o;g.nameLabel.opacity(g.nameLabelFits?(g.externalLabel?1:u)*L*b:0),g.subLabel.opacity(0);let P=d&&!g.nameLabelFits;a&&(g.numberLabelFits=(o>.01||P)&&da(g,s,t.stageWidth)),g.numberLabelFits&&g.numberLabel.fill(he(k,g.explicitInk,g.preferredInk)),g.numberLabel.opacity(g.numberLabelFits?(P?u:o)*b:0)}let m=o*(1-t.isoT);for(let g of t.zones){let p=t.accessFilterActive&&!f.has(g.id)?xe:1,y=g.label.visible()?m*p:0;g.back.opacity(y),g.label.opacity(y),g.sub&&g.sub.opacity(pa(t,g)?0:y),a&&pu(t,g,s)}if(!t.glideInProgress&&(u>.01||m>.01)){hu(t,s,d),du(t.sections);for(let g of t.zones){let p=g.label.opacity();g.back.opacity(p),g.sub&&g.sub.opacity(pa(t,g)?0:p)}}(m>.01||d)&&(m>.01&&ha(t.sections,t.zones,s,t.worldToScreen),ua(t.sections));for(let g of t.sections)cu(g);t.bgLayer.batchDraw()}function pa(t,e){return t.stageWidth<q||!e.sub||!e.sub.visible()}function du(t){let e=new Map;for(let i of t)(e.get(i.logicalId)??e.set(i.logicalId,[]).get(i.logicalId)).push(i);for(let i of e.values()){if(i.length<2)continue;let o=i.filter(n=>n.nameLabel.opacity()>.05).sort((n,r)=>{let s=z(n.outline),a=z(r.outline);return a.width*a.height-s.width*s.height});for(let n of o.slice(1))n.nameLabel.opacity(0)}}function hu(t,e,i=!1){let n=[],r=c=>{let d=t.worldToScreen({x:c.x(),y:c.y()}),h=z(nt({x:0,y:0},c.width()*e,c.height()*e,c.rotation()));return{x:d.x-h.width/2,y:d.y-h.height/2,w:h.width,h:h.height}};for(let c of t.zones){if(c.label.opacity()<=.05)continue;let d=c.back.getAbsolutePosition(),h=c.back.width()*e,u=c.back.height()*e;n.push({node:c.label,tier:0,section:!1,zone:c,box:{x:d.x-h/2,y:d.y-u/2,w:h,h:u}})}for(let c of t.sections){if(c.nameLabel.opacity()>.05){let d=au(t,c)?-1:1;n.push({node:c.nameLabel,tier:d,section:!0,area:c.labelArea,box:r(c.nameLabel)})}i&&c.numberLabel.opacity()>.05&&n.push({node:c.numberLabel,tier:1,section:!1,area:c.labelArea,box:r(c.numberLabel)})}let s=t.landmarks.map(c=>{let d=t.worldToScreen({x:c.x,y:c.y}),h=t.worldToScreen({x:c.x+c.width,y:c.y+c.height});return{x:Math.min(d.x,h.x),y:Math.min(d.y,h.y),w:Math.abs(h.x-d.x),h:Math.abs(h.y-d.y)}});if(n.length<2&&!s.length)return;n.sort((c,d)=>c.tier-d.tier||(d.area??0)-(c.area??0)||c.box.y-d.box.y||c.box.x-d.box.x);let a=[...s],l=c=>a.some(d=>c.x<d.x+d.w+4&&d.x<c.x+c.w+4&&c.y<d.y+d.h+4&&d.y<c.y+c.h+4);for(let c of n){if(!l(c.box)){a.push(c.box);continue}let d=!1;if(c.zone)for(let h of Ir){if(h===0)continue;let u={...c.box,y:c.box.y+h};if(!l(u)){Mo(c.zone,0,h/e),a.push(u),d=!0;break}}if(c.section){let h=c.node.fontSize(),u=c.node.y(),f=c.node.letterSpacing()>0;for(let m of no){let g=h*m;if(g*e<Lt(t.stageWidth))break;Te(c.node,g,u),f&&(c.node.letterSpacing(c.node.fontSize()*_e),c.node.offsetX(c.node.width()/2));let p=r(c.node);if(!l(p)){a.push(p),d=!0;break}}d||(Te(c.node,h,u),f&&(c.node.letterSpacing(c.node.fontSize()*_e),c.node.offsetX(c.node.width()/2)))}d||c.node.opacity(0)}}function Te(t,e,i){t.fontSize(Math.max(1,e)),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i)}function uu(t,e,i,o){e.subLabelFits=!1;let n=t.stageWidth<q,r=Lt(t.stageWidth),s=so(et*e.labelScale,t.stageWidth,i,t.fitScale,void 0,r);if(e.externalLabel){e.nameLabel.text(o[0]),e.nameLabel.rotation(e.externalLabel.rotation),Te(e.nameLabel,s/i,e.externalLabel.position.y),e.nameLabel.position(e.externalLabel.position),e.nameLabelFits=!0,e.nameLabelBadgeOnly=!1;return}for(let[c,d]of o.entries()){e.nameLabel.text(d);let h=z(e.outline),u=h.height>h.width*Dr?[0,-90]:[0];for(let f of u)for(let m of e.labelAnchors)for(let g=s;g>=r;g-=1){e.nameLabel.rotation(f),Te(e.nameLabel,g/i,e.nameLabel.y()),n&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*_e),e.nameLabel.offsetX(e.nameLabel.width()/2)),e.nameLabel.position(m);let p=Or/i;if(rt(m,e.nameLabel.width()+p,e.nameLabel.height()+p,f,e.outline,e.holes)){e.nameLabelFits=!0,e.nameLabelBadgeOnly=c>0;return}}}e.nameLabel.text(o[0]),e.nameLabelBadgeOnly=!1;let a=e.labelAnchors[0]??e.centroid;e.nameLabel.position(a),e.nameLabel.rotation(0),Te(e.nameLabel,r/i,a.y),n&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*_e),e.nameLabel.offsetX(e.nameLabel.width()/2));let l=z(e.outline);e.nameLabelFits=e.nameLabel.width()<=l.width&&e.nameLabel.height()<=l.height}function fa(t,e,i){let o=n=>(t.text(n),t.width());if(!(o(e)<=i)){for(let n=e.length-1;n>=1;n-=1)if(o(`${e.slice(0,n).trimEnd()}\u2026`)<=i)return;o("\u2026")}}function pu(t,e,i){let o=pi(t.stageWidth),n=t.stageWidth<q,r=e.sub!=null&&!n,s=(n?Sr:wr)*o/i,a=(n?vr:kr)*o/i,l=so(hi,t.stageWidth,i,t.fitScale,1);e.label.text(e.name),Te(e.label,l/i,e.anchor.y),r&&(Te(e.sub,tt(ui,t.stageWidth)/i,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*gr),e.sub.offsetX(e.sub.width()/2));let c=n?t.stageWidth*Cr/i-s*2:1/0,d=!n&&e.spanWorld>0?e.spanWorld*Pr-s*2:1/0,h=Math.min(c,d),u=()=>Math.max(e.label.width(),r?e.sub.width():0);if(r&&u()>h&&(r=!1),u()>h)for(let L of no){let P=Math.max(Fe,l*L);if(P>=e.label.fontSize()*i-.001||(Te(e.label,P/i,e.anchor.y),e.label.width()<=h))break}if(e.label.width()>h&&(fa(e.label,e.name,Math.max(h,1)),fu(e.label.text())<mu(e.name)&&fa(e.label,e.name,Math.max(c,1)),Te(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){ma(e);return}e.label.visible(!0),e.back.visible(!0);let f=r?3*o/i:0;e.label.x(e.anchor.x),r?e.sub.x(e.anchor.x):e.sub&&e.sub.opacity(0);let m=Math.max(e.label.width(),r?e.sub.width():0)+s*2,g=e.label.height()+(r?f+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(r?(f+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+f)/2),e.back.position(e.anchor),e.back.size({width:m,height:g}),e.back.offset({x:m/2,y:g/2}),e.back.cornerRadius(Lr*o/i),e.back.strokeWidth(1/i);let p=e.back.getAbsolutePosition(),y=6,b=m*i;if(b>t.stageWidth-y*2){ma(e);return}let S=b/2,k=(K(p.x,y+S,t.stageWidth-y-S)-p.x)/i;Math.abs(k)>.001&&Mo(e,k,0);let v=62+g*i/2;p.y<v&&Mo(e,0,(v-p.y)/i)}function fu(t){return t.endsWith("\u2026")?t.slice(0,-1).trimEnd().length:t.length}function mu(t){return Math.min(t.length,Math.max(6,Math.ceil(t.length/2)))}function ma(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 Mo(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 gu(t,e){if(!t.length)return null;let i=1/0,o=1/0,n=-1/0,r=-1/0;for(let s of t)!Number.isFinite(s.x)||!Number.isFinite(s.y)||(s.x<i&&(i=s.x),s.y<o&&(o=s.y),s.x>n&&(n=s.x),s.y>r&&(r=s.y));return!Number.isFinite(i)||!Number.isFinite(o)?null:{x:i-e,y:o-e,width:n-i+e*2,height:r-o+e*2}}function _o(t,e=0){let i=new Map;for(let n of t){let r=`${n.rowId}|${n.categoryKey}`,s=i.get(r);s||(s={categoryKey:n.categoryKey,points:[]},i.set(r,s)),s.points.push({x:n.x,y:n.y})}let o=[];for(let[n,r]of i){let s=gu(r.points,e);s&&o.push({id:n,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:s})}return o}function Eo(t,e){let i=Math.max(0,Math.max(t.x-(e.x+e.width),e.x-(t.x+t.width))),o=Math.max(0,Math.max(t.y-(e.y+e.height),e.y-(t.y+t.height)));return Math.hypot(i,o)}function Fo(t,e){let i=Math.min(t.x,e.x),o=Math.min(t.y,e.y);return{x:i,y:o,width:Math.max(t.x+t.width,e.x+e.width)-i,height:Math.max(t.y+t.height,e.y+e.height)-o}}function La(t){if(!t.length)return 0;let e=[...t].sort((o,n)=>o-n),i=Math.floor(e.length/2);return e.length%2?e[i]:(e[i-1]+e[i])/2}function yu(t){if(!t.length)return 0;let e=La(t.map(o=>Math.min(o.bounds.width,o.bounds.height)));if(t.length<2)return e;let i=[];for(let o=0;o<t.length;o+=1){let n=1/0;for(let r=0;r<t.length;r+=1)o!==r&&(n=Math.min(n,Eo(t[o].bounds,t[r].bounds)));Number.isFinite(n)&&i.push(n)}return La(i)+e}function Bo(t,e){if(!t.length)return[];let i=yu(t)*(e?.gapRows??2),o=e?.minRows??2,n=e?.minSeats??12,r=new Map;for(let a of t){let l=r.get(a.categoryKey);l?l.push(a):r.set(a.categoryKey,[a])}let s=[];for(let[a,l]of r){let c=[...l].sort((u,f)=>u.bounds.y-f.bounds.y||u.bounds.x-f.bounds.x||u.id.localeCompare(f.id)),d=[];for(let u of c){let f=d.find(m=>Eo(m.bounds,u.bounds)<=i);f?(f.bounds=Fo(f.bounds,u.bounds),f.rowIds.push(u.id),f.seatCount+=u.seatCount):d.push({categoryKey:a,bounds:{...u.bounds},rowIds:[u.id],seatCount:u.seatCount})}let h=!0;for(;h&&d.length>1;){h=!1;e:for(let u=0;u<d.length;u+=1)for(let f=u+1;f<d.length;f+=1)if(!(Eo(d[u].bounds,d[f].bounds)>i)){d[u].bounds=Fo(d[u].bounds,d[f].bounds),d[u].rowIds.push(...d[f].rowIds),d[u].seatCount+=d[f].seatCount,d.splice(f,1),h=!0;break e}}for(let u of d)u.rowIds.length<o&&u.seatCount<n||(u.rowIds.sort(),s.push(u))}return s.sort((a,l)=>a.bounds.y-l.bounds.y||a.bounds.x-l.bounds.x||a.categoryKey.localeCompare(l.categoryKey)),s}function xa(t){let e=null;for(let i of t)e=e?Fo(e,i.bounds):{...i.bounds};return e}function Ca(t,e){let i=null,o=1/0;for(let n of t){let{x:r,y:s,width:a,height:l}=n.bounds;if(e.x<r||e.x>r+a||e.y<s||e.y>s+l)continue;let c=a*l;c<o&&(i=n,o=c)}return i}function Ta(t){return t*.3}function Ia(t){return Ta(t)*2+t*.42}var xi=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=Bo(_o(this.host.seats(),this.host.seatR()));if(!e.length)return;let i=this.host.canvasBackground(),o=se(i),n=Sa(i,i),r=J(n,o.sectionInk),s=new Pa({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 Pa({listening:!1}),h=new vu({...c,width:0,height:0,fill:n,stroke:o.sectionStroke,strokeWidth:Ge,opacity:Fr,listening:!1,perfectDrawEnabled:!1}),u=new Su({...c,radius:0,fill:this.host.categoryColor(a.categoryKey),listening:!1,perfectDrawEnabled:!1}),f=this.host.categoryPriceLabel(a.categoryKey),m=new wu({...c,text:l,fontSize:et,fontStyle:Ve,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});d.add(h),d.add(u),d.add(m),s.add(d),this.labels.push({cluster:a,pill:d,plate:h,swatch:u,text:m,label:l,price:f})}if(!this.labels.length){s.destroy();return}this.group=s,this.host.labelLayer.add(s)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let i=this.host.seatR()*2,o=this.host.exportMode||this.host.viewMode()!=="flat"||this.host.seatsPickable()&&e<le;return this.revealed=o||tr(io(i,e),io(i,le),this.revealed),!this.revealed&&this.size(this.host.stage.scaleX(),this.host.stage.width())&&this.host.labelLayer.batchDraw(),this.applyFilterDim(),this.applyVisibility(!this.revealed),!0}focusCluster(e){if(this.host.viewMode()!=="flat"||this.host.hasSections()||this.host.seatsPickable())return!1;let i=this.clusterAt(this.host.screenToWorld(e));if(!i)return!1;let o=this.host.seatR()*2,n={x:i.bounds.x-o,y:i.bounds.y-o,width:i.bounds.width+o*2,height:i.bounds.height+o*2},r=this.host.stage;if(at(r,n,this.host.zoomBounds(),this.host.framingViewport())<=r.scaleX()*xt)return!1;let a=this.diveTarget(n);return a?(this.host.focusRegion(a,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,i){let o=this.host.stage,n=this.host.framingViewport(),r=this.host.zoomBounds(),s=at(o,e,r,n),a=Math.min(Math.max(this.host.readableScale(),this.host.pickableScale()),r.max);if(s>=a)return e;let l=n.width/(a*Ie),c=n.height/(a*Ie);if(!(l>0)||!(c>0))return null;let d=i??{x:e.x+e.width/2,y:e.y+e.height/2};return{x:d.x-l/2,y:d.y-c/2,width:l,height:c}}glideTowardTap(e){if(this.host.viewMode()!=="flat")return!1;let i=this.host.stage.scaleX(),o=Vr(i,this.host.pickableScale());if(o==null||o<=i*xt)return!1;let n=this.host.screenToWorld(e),r=this.host.framingViewport(),s=r.width/(o*Ie),a=r.height/(o*Ie);return!(s>0)||!(a>0)?!1:(this.host.focusRegion({x:n.x-s/2,y:n.y-a/2,width:s,height:a}),!0)}setPressLandsOnChart(e){this.pressOnChart=e}syncCursor(e){if(this.host.exportMode)return;let i=this.host.viewMode()==="flat"&&!this.host.seatsPickable()?this.pressOnChart?"zoom-in":"default":e?"pointer":"default";for(let o of[this.host.stage.container(),this.host.stage.content])o&&o.style.cursor!==i&&(o.style.cursor=i)}clusterAt(e){let i=Ca(this.all,e);if(i)return i;if(!this.visible)return null;for(let o of this.labels){let n=o.plate.width()/2,r=o.plate.height()/2;if(Math.abs(e.x-o.text.x())<=n&&Math.abs(e.y-o.text.y())<=r)return o.cluster}return null}size(e,i){let o=Math.max(e,1e-4),n=i<q,r=`${o.toFixed(4)}|${i}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let s=tt(et,i),a=_r/o,l=Br/o;for(let c of this.labels){let{text:d,plate:h,swatch:u,cluster:f}=c,m=Ao(c.label,n);d.text(c.price?`${m} \xB7 ${c.price}`:m),d.fontStyle(n?Mr:Ve);let g=s,p=0;for(;d.fontSize(Math.max(1,g/o)),d.letterSpacing(d.fontSize()*_e),p=Ia(d.fontSize())+d.width()+a*2,!(p<=f.bounds.width||g<=Fe);)g=Math.max(Fe,g-1);let y={x:f.bounds.x+f.bounds.width/2,y:f.bounds.y+f.bounds.height/2},b=d.height()+l*2,S=p-a*2,w=y.x-S/2;u.radius(Ta(d.fontSize())),u.position({x:w+u.radius(),y:y.y}),d.offsetX(0),d.offsetY(d.height()/2),d.position({x:w+Ia(d.fontSize()),y:y.y}),h.size({width:p,height:b}),h.offset({x:p/2,y:b/2}),h.cornerRadius(b/2),h.strokeWidth(Ge/o),h.position(y)}return!0}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),i=!1;for(let o of this.labels){let n=e&&!e.has(o.cluster.categoryKey)?.22:1;o.pill.opacity()!==n&&(o.pill.opacity(n),i=!0)}i&&this.host.labelLayer.batchDraw()}boundsForSeats(e,i){if(!e.length)return null;let o=_o(e,this.host.seatR()),n=Bo(o);n.length||(n=o.map(a=>({categoryKey:a.categoryKey,bounds:a.bounds,rowIds:[a.id],seatCount:a.seatCount})));let r=xa(n);if(!r)return null;let s=n.reduce((a,l)=>l.seatCount>a.seatCount?l:a,n[0]);return{bounds:{x:r.x-i,y:r.y-i,width:r.width+i*2,height:r.height+i*2},anchor:{x:s.bounds.x+s.bounds.width/2,y:s.bounds.y+s.bounds.height/2},singleBlock:n.length===1&&e.every(a=>a.x>=r.x&&a.x<=r.x+r.width&&a.y>=r.y&&a.y<=r.y+r.height)}}applyVisibility(e){let i=this.group;if(!i||e===this.visible)return;if(this.visible=e,this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),i.visible(!0),this.host.reducedMotion()){i.opacity(e?1:0),i.visible(e),this.host.labelLayer.batchDraw();return}let o=i.opacity(),n=e?1:0,r=performance.now(),s=a=>{if(this.host.destroyed()||!this.group){this.fadeRaf=0;return}let l=Math.min(1,(a-r)/90);i.opacity(o+(n-o)*l),l>=1&&i.visible(n>0),this.host.labelLayer.batchDraw(),this.fadeRaf=l<1?requestAnimationFrame(s):0};this.fadeRaf=requestAnimationFrame(s)}};import{Circle as ku}from"konva/lib/shapes/Circle";import{Line as Lu}from"konva/lib/shapes/Line";function Ma(t,e,i,o){let n=t.seatRadius(),r=new ku({x:i.x,y:i.y,radius:n,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),s=t.viewMode()==="perspective"?t.perspectiveSeatScale(e):1;r.scale({x:s,y:s}),t.overlayLayer.add(r);let a=performance.now(),l=620,c=d=>{if(!r.getLayer())return;let h=Math.max(0,Math.min(1,(d-a)/l));r.radius(n*(1+h*1.8)),r.opacity(.9*(1-h)),t.overlayLayer.batchDraw(),h<1?requestAnimationFrame(c):(r.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(c)}function Ra(t,e,i){for(let o of e){let n=t.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(h=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,h))):o.outline.map(h=>{let u=o.liftWorld>0?t.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:h.x+u.x,y:h.y+u.y}}),r=n.reduce((h,u)=>({x:h.x+u.x,y:h.y+u.y}),{x:0,y:0});r.x/=n.length,r.y/=n.length;let s=new Lu({x:r.x,y:r.y,points:n.flatMap(h=>[h.x-r.x,h.y-r.y]),closed:!0,stroke:i,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:i,shadowBlur:14,shadowOpacity:.7});t.overlayLayer.add(s),t.overlayLayer.batchDraw();let a=()=>{s.getLayer()&&(s.destroy(),t.overlayLayer.batchDraw())};if(t.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=h=>{if(t.isDestroyed()||!s.getLayer())return;let u=Math.max(0,Math.min(1,(h-l)/c)),m=1+(1-Math.pow(1-u,3))*.04;s.scale({x:m,y:m}),s.opacity(.92*(1-u)),t.overlayLayer.batchDraw(),u<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as Iu}from"konva/lib/Group";import{Shape as Tu}from"konva/lib/Shape";import{Group as xu}from"konva/lib/Group";import{Shape as Cu}from"konva/lib/Shape";function Pu(t,e,i){let o=e.length,n={x:(e[o-1].x+e[0].x)/2,y:(e[o-1].y+e[0].y)/2};t.moveTo(n.x,n.y);for(let r=0;r<o;r+=1){let s=e[r],a=e[(r+1)%o],l=e[(r-1+o)%o],c=Math.min(Math.hypot(s.x-l.x,s.y-l.y)/2,Math.hypot(a.x-s.x,a.y-s.y)/2);t.arcTo(s.x,s.y,a.x,a.y,Math.max(0,Math.min(i,c)))}t.closePath()}function $e(t,e,i,o){let n=Qi(t)>0,r=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0;return new Cu({...i,sceneFunc(s,a){s.beginPath();let l=d=>{if(d.length){if(r>0&&d.length>=3)return Pu(s,d,r);s.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h+=1)s.lineTo(d[h].x,d[h].y);s.closePath()}};o?(d=>{s.moveTo(d.start.x,d.start.y);let h=d.start;for(let u of d.segments)u.kind==="line"?s.lineTo(u.end.x,u.end.y):u.kind==="arc"?s.arc(u.center.x,u.center.y,u.radius,Math.atan2(h.y-u.center.y,h.x-u.center.x),Math.atan2(u.end.y-u.center.y,u.end.x-u.center.x),!u.clockwise):s.bezierCurveTo(u.control1.x,u.control1.y,u.control2.x,u.control2.y,u.end.x,u.end.y),h=u.end;s.closePath()})(o):l(t);for(let d of e??[]){let h=Qi(d)>0;l(h===n?[...d].reverse():d)}s.fillStrokeShape(a)},perfectDrawEnabled:!1})}var lt=class extends xu{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 Aa(t,e){if(!e.length)return null;let i=new Iu({listening:!1});for(let o of e){let n=t.viewMode==="perspective"&&o.perspectiveAffine,r=n?o.outline.map(a=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,a))):o.outline,s=n?o.holes.map(a=>a.map(l=>t.perspectiveLocalPoint(t.projectedSectionPoint(o,l)))):o.holes;i.add($e(r,s,{fill:Yr,stroke:D("#ffffff",.1),strokeWidth:1,listening:!1},n?void 0:o.outlinePath))}return t.bgLayer.add(i),i.moveToTop(),i}function Ea(t,e){let{bounds:i}=t,n=Math.max(i.width,i.height,1)*4+1e3,r=[{x:i.x-n,y:i.y-n},{x:i.x+i.width+n,y:i.y-n},{x:i.x+i.width+n,y:i.y+i.height+n},{x:i.x-n,y:i.y+i.height+n}],s=new Tu({fill:t.canvasBackground,opacity:1-xe,listening:!1,perfectDrawEnabled:!1,sceneFunc:(a,l)=>{let c=h=>{if(h.length){a.moveTo(h[0].x,h[0].y);for(let u=1;u<h.length;u++)a.lineTo(h[u].x,h[u].y);a.closePath()}};a.beginPath(),c(r);let d=[];for(let h of e){let u=t.viewMode==="perspective"&&h.perspectiveAffine?h.outline.map(f=>t.perspectiveLocalPoint(t.projectedSectionPoint(h,f))):h.outline.map(f=>{let m=h.liftWorld>0?t.isoLiftLocal(h.liftWorld):{x:0,y:0};return{x:f.x+m.x,y:f.y+m.y}});d.push(u)}d.push(...t.focusedRowLabelCutouts?.()??[]),a.save();for(let h of d)h.length<3||(a.beginPath(),c(r),c(h),a.clip("evenodd"));a.beginPath(),c(r),a.fillStrokeShape(l),a.restore()}});return t.overlayLayer.add(s),s.moveToTop(),s}var Mu=.2;function Fa(t,e){return t.startsWith("#")?Q(e,t,Mu):t}var Na=.5,U=Math.SQRT1_2,Ru="#f3f4f6",_a=4;function Au(t){let e=t.fraction;return typeof e!="number"||!Number.isFinite(e)?Na:Math.min(1,Math.max(0,e))}function Eu(t){return t==="booked"||t==="not_for_sale"?zr:Wr}function Ba(t,e){return Number.parseInt(t.slice(e,e+2),16)}function Oa(t){let e=t.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,i,o,n]=e.toLowerCase();return`#${i}${i}${o}${o}${n}${n}`}function Fu(t,e,i){let o=Oa(t),n=Oa(e);if(!o||!n)return t;let r=Math.min(1,Math.max(0,i)),s="#";for(let a=1;a<7;a+=2){let l=Math.round(Ba(o,a)*(1-r)+Ba(n,a)*r);s+=l.toString(16).padStart(2,"0")}return s}function Da(t,e,i,o){let n=i*4,r=e*U,s=-e*U,a=o*U*2*n,l=o*-U*2*n,c=r+n*U,d=s+n*U,h=r-n*U,u=s-n*U;t.beginPath(),t.moveTo(c,d),t.lineTo(h,u),t.lineTo(h+a,u+l),t.lineTo(c+a,d+l),t.closePath(),t.clip()}function _u(t,e){let i=e*4,o=Math.max(e*.45,1);t.beginPath();for(let n=-_a;n<=_a;n++){let r=n*o*2,s=r+o,a=r*U,l=-r*U,c=s*U,d=-s*U;t.moveTo(a+i*U,l+i*U),t.lineTo(a-i*U,l-i*U),t.lineTo(c-i*U,d-i*U),t.lineTo(c+i*U,d+i*U),t.closePath()}t.clip()}function Ci(t,e){t._sceneFunc(e)}function Ha(t){let e=this,i=e.attrs,o=i.markRadius||1,n=i.fill,r=e.getStage(),s=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(o*2*s<16){i.fill=i.markMidtone??n,Ci(e,t),i.fill=n;return}let l=(1-2*(i.markFraction??Na))*o;t.save(),Da(t,l,o,1),i.fill=i.markBase??n,Ci(e,t),t.restore(),t.save(),Da(t,l,o,-1),i.fill=i.markFill??n,Ci(e,t),i.markHatch&&(_u(t,o),i.fill=Ru,Ci(e,t)),t.restore(),i.fill=n}function Bu(t,e,i,o,n,r){let s=Au(e),a=Eu(i),l=t.attrs;l.markFraction=s,l.markBase=o,l.markFill=a,l.markMidtone=Fu(o,a,1-s),l.markHatch=r,l.markRadius=n>0?n:1,t.fill(l.markMidtone),t.stroke(""),t.strokeWidth(0),t.dash([]),t.opacity(1),t.sceneFunc(Ha)}function Ou(t){t.setAttr("sceneFunc",void 0)}function Oo(t){return t.attrs.sceneFunc===Ha}var Pi=class{constructor(){this.marks=new Map}get size(){return this.marks.size}get(e){return this.marks.get(e)??null}has(e){return this.marks.has(e)}clear(){this.marks.clear()}merge(e,i){let o=new Set;for(let[n,r]of Object.entries(e))i.has(n)&&(r&&r.kind==="partial"?(this.marks.set(n,r),o.add(n)):this.marks.delete(n)&&o.add(n));return o}paint(e,i,o,n,r,s,a){let l=a?void 0:this.marks.get(i);if(!l){Oo(e)&&Ou(e);return}Bu(e,l,o,n,r,s)}};var Du="#9ca3af";function Nu(t){return t==="held"||t==="booked"||t==="not_for_sale"}function Ga(t,e=!1){return Nu(t)?e?t==="not_for_sale"?{fill:"#e2e8f0",stroke:"#475569",strokeWidth:2,dash:[3,2],opacity:1,scale:1}:t==="booked"?{fill:"#15803d",stroke:"#14532d",strokeWidth:1,dash:[],opacity:1,scale:1}:{fill:"#f4b740",stroke:"#854d0e",strokeWidth:1,dash:[],opacity:1,scale:1}:{fill:Du,stroke:"",strokeWidth:0,dash:[],opacity:.55,scale:1}:null}function Va(t){let{focusedId:e}=t;if(!e)return null;let i=new Set([e]),o=t.sectionOf(e);if(o!=null){for(let c of t.seats){let d=t.seatId(c);t.sectionOf(d)===o&&i.add(d)}return i}let n=t.seats.find(c=>t.seatId(c)===e);if(!n)return i;let r=t.seatPoint(n),s=t.seatPitch>0?t.seatPitch:t.seatRadius*2,a=6*(s>0?s:1),l=a*a;for(let c of t.seats){let d=t.seatPoint(c),h=d.x-r.x,u=d.y-r.y;h*h+u*u<=l&&i.add(t.seatId(c))}return i}function Wa(t,e,i){let o=i(t);return o!=null&&o===i(e)}var Ii=Object.freeze([]);function za(t,e,i){let o=t.seat(i),n=t.seatStatus(i),r=t.isSelected(i),s=t.categoryColor(o.categoryKey),a=t.boothLabel(i),l=t.canvasBackground(),c=t.selectionColor();e.dash(Ii),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let d=n==="held"&&t.isOwnedHold(i),h=d?null:Ga(n,t.organizer?.()??!1);h?(e.fill(h.fill),e.stroke(h.stroke),e.strokeWidth(h.strokeWidth),e.dash(h.dash),e.opacity(h.opacity),h.scale!==1&&e.scale({x:h.scale,y:h.scale})):d?(e.fill(de(s,c===st?.24:.1)),e.stroke(c),e.strokeWidth(3)):e.fill(r&&c===st?de(s,.28):s),t.seatMarks.paint(e,i,n,s,t.seatRadius(),t.colorblind(),t.seatInClosedSection(i)),Oo(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&n==="free"&&(e.stroke(yt(o.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),e.strokeWidth(r?3:2),e.dash([3,2])),a&&(a.text(h?"":o.label),a.fontSize(10),a.fontStyle("600"),a.fill(t.theme().seatLabelColor??Ue),a.offsetX(a.width()/2),a.offsetY(a.height()/2));let u=n==="free"||n==="held"&&!t.isOwnedHold(i),f=()=>{let k=e.fill();typeof k=="string"&&e.fill(Fa(k,l))},m=t.accessFilter();if(m&&u&&!r){let k=Pe(o,m);k==="other"?(f(),e.opacity(Math.min(e.opacity(),$s))):k==="companion"&&e.opacity(Math.min(e.opacity(),qs))}let g=t.categoryHighlight();g&&n==="free"&&!r&&o.categoryKey!==g&&e.opacity(.25);let p=t.categoryFilter();p&&u&&!r&&!p.has(o.categoryKey)&&(f(),e.opacity(.22)),t.commercialLimitedFilter()&&n==="free"&&!r&&(o.commercial?.restrictedView||o.commercial?.obstructedView)&&e.opacity(.22);let y=t.dimmedSections();if(y.size){let k=t.seatSection(i);(k?y.has(k.id)||y.has(k.logicalId)||k.zone!=null&&y.has(k.zone):y.has(In))&&e.opacity(.18)}t.closedSections().size&&t.seatInClosedSection(i)&&(e.fill(Kr),e.stroke(""),e.strokeWidth(0),e.dash(Ii),e.opacity(Xr),e.scale({x:1,y:1})),t.selectionFocusDims(i)&&e.opacity(Math.min(e.opacity(),.16));let b=t.boothLabel(i)??t.seatLabel(i);if(b){b.fill(t.seatLabelInk(o,e));let k=!a&&(r||d);b.visible(me(b.fontSize(),t.effScale())&&e.opacity()>=.5&&!k)}let S=t.accessGlyph(i);if(S){let k=e.fill();S.fill(ti(typeof k=="string"?k:"")),S.opacity(e.opacity()),S.visible(t.accessGlyphShouldShow(i))}let w=t.accessRing(i);w&&(w.stroke(yt(o.accessibility,{colorblind:t.colorblind(),canvasBackground:l})),w.opacity(e.opacity()),w.visible(t.accessRingShouldShow(i)))}function Ti(t,e){let i=null,o=1/0;for(let[n,r]of t){if(!r.getLayer())continue;let s=r.getClientRect(),a=s.x+s.width/2,l=s.y+s.height/2,c=Math.max(s.width/2,22),d=Math.max(s.height/2,22),h=Math.abs(e.x-a),u=Math.abs(e.y-l);if(h>c||u>d)continue;let f=h*h+u*u;f<o&&(o=f,i=n)}return i}function Mi(t){return t?.getAttr?.("seatId")??void 0}var Do=.85,Hu=.38,Gu=Object.freeze([3,3]);function Vu(t,e){let i=t.sectionAt(e);return i==null||t.sectionInteractive?.(i)===!1?null:i}function Ka(t,e){let i=t.sectionAt(e);return i!=null&&t.sectionInteractive?.(i)===!1}function Wu(t){let e=null,i=0,o=()=>{i=0,!(!e||t.destroyed?.())&&(t.viewMode()!=="flat"||t.seatsPickable()||(t.clusterLabels.setPressLandsOnChart(!Ka(t,e)&&(!t.sectionCount()||t.pressLandsOnChart(e))),t.clusterLabels.syncCursor(!1)))};return n=>{e=n,i||(i=requestAnimationFrame(o))}}function Xa(t){t.attachHoverCard();let e=Wu(t);t.seatLayer.on("click tap",i=>{if(t.moved()>Ee||t.isGhostClick(i))return;let o=Mi(i.target);o&&t.seatsPickable()&&t.handleSeatTap(o)}),t.seatLayer.on("mouseover",i=>{let o=Mi(i.target);if(!o)return;let n=t.seat(o);if(!n)return;t.setHoveredId(o);let r=zu(t,o);t.hoverRing.position(t.renderedSeatPoint(n));let s=t.viewMode()==="perspective"?t.perspectiveSeatScale(o):1;t.hoverRing.scale({x:s,y:s}),t.hoverRing.opacity(r==="muted"?Hu:Do),t.hoverRing.dash(r==="muted"?Gu:Ii),t.hoverRing.visible(r!=="none"),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(r==="full"),t.onHover?.(n,{mark:t.seatMark(o),interaction:"hover"})}),t.seatLayer.on("mouseout",()=>{t.setHoveredId(null),t.hoverRing.visible(!1),t.overlayLayer.batchDraw(),t.clusterLabels.syncCursor(!1),t.onHover?.(null,{mark:null})}),t.stage.on("mousemove",()=>{let i=t.stage.getPointerPosition();i&&e(i)}),t.stage.on("wheel",i=>{i.evt.preventDefault(),t.releaseSectionFocusDim(),t.dismissFocusRing?.();let o=t.container.getBoundingClientRect(),n={x:i.evt.clientX-o.left,y:i.evt.clientY-o.top},r=Math.exp(-i.evt.deltaY*.002);t.zoomAbout(t.stage.scaleX()*K(r,.5,2),n,"frame"),e(n)}),t.stage.on("click tap",i=>{if(t.moved()>Ee||t.isGhostClick(i))return;let o=t.stage.getPointerPosition();if(!o)return;if(t.sectionCount()){let r=t.ownedBadgeAt(t.screenToWorld(o));if(r&&t.focusOwnedSeats(r))return}if(!(Mi(i.target)&&t.seatsPickable())){let r=Ti(t.selectionMarkers(),o);if(r){t.focusSeats([r],{animate:!t.reducedMotion()});return}}if(t.navigateGroupAt?.(o))return;if(!t.cached()){if(Mi(i.target)&&t.seatsPickable())return;if(t.seatsPickable()){let r=t.focusedSectionId(),s=t.nearestSeatToScreen(o,ge),a=s?t.seatSection(s):null;if(s&&(!r||a&&t.sectionMatchesFocus(a))){t.handleSeatTap(s);return}let l=s?null:t.nearestSeatToScreen(o,ge,!0),c=l?t.seatSection(l):null;if(l&&(!r||c&&t.sectionMatchesFocus(c))){t.handleSeatTap(l);return}if(r&&t.onBackdropTap&&!t.floorOverview()){let h=t.sectionAt(o);if(h&&t.sectionInteractive?.(h)===!1)return;if(h&&h!==r){let u=t.sectionTapAnchor(h,t.screenToWorld(o));t.onSectionTap?t.onSectionTap(h,u):t.focusSection(h,{anchor:u})}else h||t.onBackdropTap();return}if(r)return;let d=t.sectionCount()?Vu(t,o):null;if(!d||t.effScale()>=ee||t.sectionFrameScale(d)<=t.stage.scaleX()*1.02)return}}if((t.stacked()||t.floorOverview())&&t.onDeckTap){let r=t.floorOverview()?t.sectionAt(o):null,s=(r?t.objectFloor(r):null)??t.deckFloorAt();if(s){t.onDeckTap(s);return}}if(t.sectionCount()){let r=t.screenToWorld(o),s=t.ownedBadgeAt(r);if(s&&t.focusOwnedSeats(s)||!s&&Ka(t,o))return;let a=s??t.sectionAt(o);if(a){let l=t.sectionTapAnchor(a,r);t.onSectionTap?t.onSectionTap(a,l):t.focusSection(a,{anchor:l});return}if(!t.pressLandsOnChart(o))return}if(t.clusterLabels.focusCluster(o)||t.clusterLabels.glideTowardTap(o))return;let n=Math.max(Ae*1.2,t.stage.scaleX()*2.5);t.zoomAbout(n,o)})}function Ya(t,e){if((t.stacked()||t.floorOverview())&&t.onDeckTap){let o=t.objectFloor(t.seat(e)?.rowId??"");if(o){t.onDeckTap(o);return}}if(t.effScale()<ee&&t.sectionCount()){let o=t.seatSection(e);if(o){let n=t.focusedSectionId()===o.logicalId,r=t.sectionFrameScale(o.logicalId)>t.stage.scaleX()*1.02;if(!n&&r){let s=t.seat(e),a=s?t.renderedSeatPoint(s):void 0;t.onSectionTap?t.onSectionTap(o.logicalId,a):t.focusSection(o.logicalId,{anchor:a});return}}}if(!(t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e))){let o=t.seat(e)??null,n=t.hiddenByAccessFilter(e);o&&(n||t.hasSeatMark(e))&&(t.onHover?.(o,{mark:t.seatMark(e)??null,interaction:"press",unavailable:!0,...n?{filteredOut:!0}:{}}),t.nudgeSeat(e));return}t.hasSeatMark(e)&&t.onHover?.(t.seat(e)??null,{mark:t.seatMark(e),interaction:"press"}),t.toggleSeat(e)}function zu(t,e){return t.isOwnedHold(e)||t.isSelected(e)||t.isSelectable(e)?"full":"none"}function Ua(t){return!t.focusedSectionId||!t.roaming||t.floorOverview?!1:t.effScale<le}import{Rect as Bp}from"konva/lib/shapes/Rect";import{Text as Op}from"konva/lib/shapes/Text";import{Path as Dp}from"konva/lib/shapes/Path";import{Text as qa}from"konva/lib/shapes/Text";var $a="500",Ku=2.5;function Xu(t,e){return t>=ee||e&&t>=li}function Yu(t){return t.effectiveScale<li?!1:t.focusActive||t.stageWidth<q}function Uu(t,e,i){return i&&e>=li?Math.max(t,ar/Math.max(e,1e-4)):t}function $u(t){let{authoredFontSize:e,measuredWidth:i,maxWidth:o,effectiveScale:n}=t;if(!(i>o)||!(i>0))return e;let r=Y/Math.max(n,1e-4),s=e*o/i;return Math.max(Math.min(St,r),s)}function No(t,e){let i=(e?1:3)*Math.min(1,t/pe);return Math.max(1,t*2-i)}function Za(t){let e=new Map;for(let n of t){let r=e.get(n.rowId);r?r.push(n):e.set(n.rowId,[n])}let i=[];for(let n of e.values())if(!(n.length<2))for(let r=1;r<n.length;r+=1){let s=Math.hypot(n[r].x-n[r-1].x,n[r].y-n[r-1].y);s>0&&Number.isFinite(s)&&i.push(s)}if(!i.length)return 0;i.sort((n,r)=>n-r);let o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o])/2}function ja(t,e){return e>0?Math.min(t,e/2):t}function Ho(t){let e=Math.max(t*2,1e-4);return Math.max(le,_n/e)}function At(t){let e=No(t,!1),i=No(pe,!1),o=e>0?i/e:1;return ee*Math.max(1,o)/oo(1,!1,Y)}function Qa(t){return At(t)*Gr}function qu(t,e,i){let o=t.seatLabelContainer(e);i.getParent()!==o&&o.add(i)}function Ja(t){let e=t.exportMode?Math.max(t.effScale(),ee):t.effScale(),i=Yu({effectiveScale:e,focusActive:t.focusedSectionId!=null,stageWidth:t.stage.width()}),o=t.exportMode?e:oo(e,t.labelsWereVisible(),Y),n=Xu(o,i);t.onLabelVisibilityChange(n),t.setSeatLabelRungOpen(n);let r=h=>{let u=h.getClientRect({skipShadow:!0,skipStroke:!0});return u.x>=0&&u.y>=0&&u.x+u.width<=t.stage.width()&&u.y+u.height<=t.stage.height()};for(let[h,u]of t.boothLabelById){let f=t.circleById.get(h);u.visible(me(u.fontSize(),o)&&!!f?.isVisible()&&t.focusedSeatOpacity(h,f?.getAbsoluteOpacity()??1)>=.5&&r(u))}t.rowLabelGroup.destroyChildren(),t.seatLabelById.clear(),t.seatLabelDrops.clear();let s=new Set,a=0;if(n)for(let h of t.visibleSeatCandidates()){if(h.kind==="booth")continue;let u=t.worldToScreen(h);if(u.x<-20||u.x>t.stage.width()+20||u.y<-20||u.y>t.stage.height()+20||t.accessGlyphById.has(h.id)&&t.accessGlyphShouldShow(h.id))continue;let f=t.circleById.get(h.id);if(!f?.isVisible()){t.seatLabelDrops.set(h.id,"dimmed-or-unavailable");continue}let m=t.statusById.get(h.id)??"free";if(!t.opts.manageMode&&!t.hasSeatMark(h.id)&&(m==="booked"||m==="not_for_sale"||m==="held"&&!t.ownedHold.has(h.id))){t.seatLabelDrops.set(h.id,"dimmed-or-unavailable");continue}if(t.hasSelectionMarker(h.id)){t.seatLabelDrops.set(h.id,"selection-tick");continue}if(t.focusedSeatOpacity(h.id,f.getAbsoluteOpacity())<.5){t.seatLabelDrops.set(h.id,"dimmed-or-unavailable");continue}let y=t.renderedSeatPoint(h),b=t.viewMode==="perspective"?t.perspectiveSeatScale.get(h.id)??1:1,S=Uu(we*t.seatLabelScale(h),e,i),w=ei(h.displayLabel??h.label),k=f?t.seatLabelInk(h,f):t.seatPreferredLabelInk(h),v=t.seatLabelPool.get(h.id);v?(v.position(y),v.text(w),v.fontSize(S),v.fontFamily(t.labelFont()),v.fill(k),v.offset({x:0,y:0}),v.scale({x:1,y:1})):(v=new qa({x:y.x,y:y.y,text:w,fontSize:S,fontStyle:$a,fontFamily:t.labelFont(),fill:k,listening:!1,perfectDrawEnabled:!1}),t.seatLabelPool.set(h.id,v));let L=No(t.seatR,i);if(v.fontSize($u({authoredFontSize:S,measuredWidth:v.width(),maxWidth:L,effectiveScale:e})),v.width()>L+.01){t.seatLabelDrops.set(h.id,"label-overflows-marker");continue}if(!me(v.fontSize(),e)){t.seatLabelDrops.set(h.id,"below-minimum-size");continue}if(v.offsetX(v.width()/2),v.offsetY(v.height()/2),v.scale({x:b,y:b}),qu(t,h.id,v),!r(v)){t.seatLabelDrops.set(h.id,"outside-viewport");continue}if(s.add(h.id),t.seatLabelById.set(h.id,v),++a>=lr)break}for(let[h,u]of t.seatLabelPool)s.has(h)||(u.destroy(),t.seatLabelPool.delete(h));let l=new Ye;for(let{node:h}of t.freeTextById.values()){if(!h.isVisible())continue;let u=h.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});l.insert({x:u.x-ie,y:u.y-ie,width:u.width+ie*2,height:u.height+ie*2})}let c=new Ye,d=t.focusedSectionId==null||t.otherSectionCount()===0||t.focusedFrameScale()>=t.fitScale()*Ku;for(let h of Zu(t.rowLabelPlan)){let u=t.rowLabelPlan[h],f=t.focusedSectionId!=null&&u.focusKeys?.includes(t.focusedSectionId),m=Math.max(e,1e-4),g=f?Math.max(u.fontSize,vt/m):u.fontSize,p=Math.max(Math.min(g,sr(t.stage.width())/m),f?vt/m:0);if(!n&&(!f||!d)||!f&&!me(p,o))continue;let y=t.worldToScreen({x:u.x,y:u.y});if(y.x<-40||y.x>t.stage.width()+40||y.y<-40||y.y>t.stage.height()+40)continue;let b=new qa({x:u.x,y:u.y,text:u.text,fontSize:p,fontStyle:$a,fontFamily:t.labelFont(),fill:u.ink,rotation:u.rotation,opacity:u.opacity,shadowColor:"#05070c",shadowBlur:u.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:u.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});u.pill&&Fs(b,u.pill),b.offsetX(b.width()/2),b.offsetY(b.height()/2);let S=t.resolveAutomaticRowLabelPosition(b,u,l);b.position(S),b.setAttr("rowLabel",!0),b.setAttr("focusKeys",u.focusKeys??[]),t.rowLabelGroup.add(b);let w=b.getClientRect({skipShadow:!0,skipStroke:!0}),k=6,v=w.x<k?k-w.x:w.x+w.width>t.stage.width()-k?t.stage.width()-k-w.x-w.width:0,L=w.y<k?k-w.y:w.y+w.height>t.stage.height()-k?t.stage.height()-k-w.y-w.height:0,P=S;if(v||L){let M=t.labelGroup.getAbsoluteTransform(),x=M.point(S);P=M.copy().invert().point({x:x.x+v,y:x.y+L}),b.position(P)}let I=t.rowLabelBox(b,P);if(c.collisionCount(I)>0){b.destroy();continue}if(u.automaticAway&&l.collisionCount(I)>0){b.destroy();continue}l.insert(I),c.insert(I)}t.isoT>0&&t.viewMode!=="perspective"&&t.applyUprightLabels(),t.overlayLayer.batchDraw()}function Zu(t){let e=n=>n.focusKeys?.length?n.focusKeys.join(" "):"",i=[],o=0;for(;o<t.length;){let n=e(t[o]),r=o;for(;r+1<t.length&&e(t[r+1])===n;)r++;if(n){i.push(o),r>o&&i.push(r);for(let s=o+1;s<r;s++)i.push(s)}else for(let s=o;s<=r;s++)i.push(s);o=r+1}return i}var ju=10;function Qu(t){let e=t.framingViewport();if(t.stage.width()>=q||t.exportMode())return e;let i=ju;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 el(t){let e=Qu(t),i=t.revealWorldRect?.()??null,o=e.width,n=e.height,r=t.perspectiveBounds(),s=t.viewMode()==="perspective"&&r?r:t.bounds();if(t.setFitScale(Math.min(o/s.width,n/s.height)||1),t.portraitFitCrop()&&!t.exportMode()){let l=o/s.width<=n/s.height,c=s.height*t.fitScale();l&&c<.55*n&&t.setFitScale(Math.min(t.fitScale()*1.3,.62*n/s.height))}let a=t.fitScale();if(t.stage.scale({x:a,y:a}),t.stage.position({x:e.x+(o-s.width*a)/2-s.x*a,y:e.y+(n-s.height*a)/2-s.y*a}),t.settleView(),!t.exportMode()){let l=Rs(t.stage,[t.bgLayer,t.seatLayer],e,t.effScale()<le?le*.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(),vo(t.stage,[t.bgLayer,t.seatLayer],e,i)),Ju(t,e),t.setFitPose(Xe(t.stage))}t.stage.batchDraw()}function Ju(t,e){let i=t.fitClearanceBottom?.()??0;if(!(i>0))return;let o=t.revealWorldRect?.()??null,n=Pt(t.stage,[t.bgLayer,t.seatLayer],o);if(!n)return;let r=e.height-i;if(n.height<=r){vo(t.stage,[t.bgLayer,t.seatLayer],{x:e.x,y:e.y,width:e.width,height:r},o);return}let s=e.y+wi-n.y;s<0&&t.stage.position({x:t.stage.x(),y:t.stage.y()+s})}function Et(t){let e=t.fitScale();t.zones().length&&(e=Math.min(e,He*.9));let i=(t.focusedFrameScale?.()??0)*2;return{min:e,max:Math.max(e,Qa(t.markerR()),i)}}function tl(t,e,i,o="now"){let n=t.stage.position();sa(t.stage,e,i,Et(t))&&(t.stage.position(t.constrainPan(t.stage.position(),n)),o==="frame"?(t.updateSeatGroupVisibility(),ep(t)):t.afterViewChange(),t.stage.batchDraw())}function ep(t){if(t.exportMode()||typeof requestAnimationFrame!="function"){t.afterViewChange();return}t.zoomSettleRaf()||t.setZoomSettleRaf(requestAnimationFrame(()=>{t.setZoomSettleRaf(0),!t.destroyed()&&t.afterViewChange()}))}function il(t){t.zoomSettleRaf()&&(cancelAnimationFrame(t.zoomSettleRaf()),t.setZoomSettleRaf(0))}function tp(t,e,i,o,n=0){aa(t.stage,e,Et(t),i,Ft(t.framingViewport(),n),o),t.settleView(),t.stage.batchDraw()}function ol(t,e,i){let o=typeof e=="string"?t.sectionBounds(e):e;if(!o)return;if(t.cancelGlide(),i?.animate===!1||t.reducedMotion()){tp(t,o,i?.minScale,i?.maxScale,i?.focusPaddingPx);return}let n=Ft(t.framingViewport(),i?.focusPaddingPx??0),r=n.width,s=n.height,{min:a,max:l}=Et(t),c=1.12,d=Math.min(r/(o.width*c),s/(o.height*c)),h=i?.minScale??a,u=K(Math.max(d,h),a,Math.max(h,Rt({min:a,max:l},i?.maxScale))),f=n.x+r/2-(o.x+o.width/2)*u,m=n.y+s/2-(o.y+o.height/2)*u,g=t.stage.scaleX(),p=t.stage.x(),y=t.stage.y();if(Math.abs(u-g)<1e-4&&Math.abs(f-p)<.5&&Math.abs(m-y)<.5){t.settleView();return}let b=performance.now(),S=Math.max(180,Math.min(1200,i?.durationMs??t.cameraGlideMs()));t.setGlideInProgress(!0);let w=k=>{if(t.destroyed()){t.setGlideRaf(0),t.setGlideInProgress(!1);return}let v=Math.min(1,(k-b)/S),L=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,P=g+(u-g)*L;t.stage.scale({x:P,y:P}),t.stage.position({x:p+(f-p)*L,y:y+(m-y)*L}),t.updateSeatGroupVisibility(),t.updateLOD(),t.scheduleViewChange(),t.stage.batchDraw(),v<1?t.setGlideRaf(requestAnimationFrame(w)):(t.setGlideRaf(0),t.setGlideInProgress(!1),t.settleView())};t.setGlideRaf(requestAnimationFrame(w))}function Ft(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 ip}from"konva/lib/shapes/Text";function nl(t){let e=De,i=new ip({fontSize:we,fontStyle:"600",fontFamily:t.labelFont(),listening:!1}),o=t.seatR*2-3;for(let n of t.seats){if(n.kind==="booth"){e=Math.min(e,De);continue}let r=we*t.seatLabelScale(n);i.fontSize(r),i.text(ei(n.displayLabel??n.label));let s=i.width()>o?Math.max(St,r*o/i.width()):r;e=Math.min(e,s)}return i.destroy(),Y/Math.max(St,e)}function sl(t,e,i,o,n,r=.35){return!Number.isFinite(t.x)||!Number.isFinite(t.y)||!Number.isFinite(e)||!(i.width>0)||!(i.height>0)?t:{x:rl(t.x,e,i.x,i.width,o.x,o.width,r,n?.x),y:rl(t.y,e,i.y,i.height,o.y,o.height,r,n?.y)}}function rl(t,e,i,o,n,r,s,a){if(!Number.isFinite(i)||!Number.isFinite(o)||!Number.isFinite(n)||!Number.isFinite(r))return t;let l=o*e,c=Math.min(l,r*(1-s)),d=n+c-(i+o)*e,h=n+r-c-i*e;if(!(d<=h))return t;if(Number.isFinite(a)){let u=a;return Math.min(Math.max(t,Math.min(d,u)),Math.max(h,u))}return Math.min(Math.max(t,d),h)}var Go={top:0,right:0,bottom:0,left:0};function al(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)}:{...Go}}var op=.7;function ll(t,e,i){let{top:o,right:n,bottom:r,left:s}=i,a=(u,f,m)=>{let g=u+f,p=m*op;if(g<=p||g<=0)return[u,f];let y=p/g;return[u*y,f*y]},[l,c]=a(s,n,t),[d,h]=a(o,r,e);return{x:l,y:d,width:Math.max(1,t-l-c),height:Math.max(1,e-d-h)}}function cl(t){return{x:t.x(),y:t.y(),scale:t.scaleX()}}function dl(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 _t(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function hl(t,e){let i=e({x:t.x,y:t.y}),o=e({x:t.x+t.width,y:t.y+t.height});return{x:Math.min(i.x,o.x),y:Math.min(i.y,o.y),width:Math.abs(o.x-i.x),height:Math.abs(o.y-i.y)}}function pl(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?pr:ur}function fl(t){return Math.max(t*1.05,nr,te*1.3)}var np=42;function ml(t){return np/(2*Math.max(t,1e-4))}function ct(t,e){let i=1/0,o=-1/0,n=1/0,r=-1/0;for(let s of t)i=Math.min(i,s.x),o=Math.max(o,s.x),n=Math.min(n,s.y),r=Math.max(r,s.y);return i-=e,o+=e,n-=e,r+=e,{x:i,y:n,width:Math.max(40,o-i),height:Math.max(40,r-n)}}function gl(t){let{stageWidth:e,stageHeight:i,fullBounds:o,visibleBounds:n,seatPoints:r,minScale:s}=t;if(!r.length)return null;let a=1.12;if(Math.min(e/(o.width*a),i/(o.height*a))>=s)return null;let c=t.tapAnchor??{x:n.x+n.width/2,y:n.y+n.height/2},d=r[0],h=1/0;for(let g of r){let p=(g.x-c.x)**2+(g.y-c.y)**2;p<h&&(d=g,h=p)}let u=e/(s*a),f=i/(s*a),m=ct(r,0);return{bounds:{x:ul(d.x,u,m.x,m.width),y:ul(d.y,f,m.y,m.height),width:u,height:f},minScale:s}}function ul(t,e,i,o){return o<=e?i+o/2-e/2:Math.min(Math.max(t-e/2,i),i+o-e)}import{Shape as sp}from"konva/lib/Shape";var yl=t=>{if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let e=t.id.match(/(?:^|:)(\d+)$/);return e?Number(e[1]):null},rp=t=>`${t.floorId??""}\0${t.sectionId??""}\0${t.rowId}`;function bl(t,e){let i=new Map;for(let n of t){if(n.kind==="booth")continue;let r=e.get(n.rowId),s=yl(n);if(!(r&&r>0)||s==null)continue;let a=rp(n),l=i.get(a)??[];l.push({seat:n,index:s}),i.set(a,l)}let o=[];for(let n of i.values()){n.sort((a,l)=>a.index-l.index||a.seat.id.localeCompare(l.seat.id));let r=[],s=()=>{r.length&&(o.push({seats:r,points:r.map(({x:a,y:l})=>({x:a,y:l}))}),r=[])};for(let a of n){let l=r[r.length-1];if(l){let c=yl(l),d=Math.hypot(a.seat.x-l.x,a.seat.y-l.y),h=e.get(a.seat.rowId),u=Math.max(1e-6,h*1e-6);(c==null||a.index!==c+1||d<=u||d>h*1.5)&&s()}r.push(a.seat)}s()}return o}var Bt=class{constructor(){this.entries=[];this.key="";this.spacing=new Map;this.doc=null;this.focusKey=null;this.detailScale=1.15}get active(){return this.entries.length>0}clear(){for(let e of this.entries)e.section.liftGroupSeat.opacity(e.opacity),e.section.liftGroupSeat.listening(e.listening),e.shape.destroy();this.entries=[],this.key=""}sync(e,i,o,n,r,s,a,l,c=()=>1,d=()=>!1,h=()=>1/0){if(!l||!e||!o){this.clear(),this.focusKey=null;return}if(this.doc!==e){this.clear(),this.doc=e,this.spacing.clear(),this.focusKey=null;for(let m of[...e.objects,...(e.floors??[]).flatMap(g=>g.objects)])m.type==="row"&&this.spacing.set(m.id,m.seatSpacing)}if(this.focusKey!==o&&(this.focusKey=o,this.detailScale=Math.min(Math.max(1.15,c()*1.15),h()*.9)),n>=this.detailScale){this.clear();return}let u=i.filter(m=>m.id===o||m.logicalId===o||d(m)),f=u.map(m=>m.id).join("|");if(!(this.key===f&&this.active)){this.clear(),this.key=f;for(let m of u){if(m.memberIds.length>2e3||m.memberIds.some(y=>!a.has(y)||!this.spacing.has(s.get(y)?.rowId??"")))continue;let g=bl(m.memberIds.map(y=>s.get(y)).filter(Boolean),this.spacing);if(!g.length||g.reduce((y,b)=>y+b.seats.length,0)!==m.memberIds.length)continue;let p=new sp({listening:!1,name:"focused-row-bands",perfectDrawEnabled:!1,sceneFunc:y=>{let b=y._context,S=p.getStage(),w=S&&S.width()<=q?Math.min(r*.8,Math.max(r*.45,1.6/S.scaleX())):r*.45;b.save(),b.lineWidth=w*2,b.lineCap="round",b.lineJoin="round";let k=v=>{let L=a.get(v.id);return D(String(L.fill()),L.opacity())};for(let v of g){let L=v.points;if(L.length===1){b.fillStyle=k(v.seats[0]),b.beginPath(),b.arc(L[0].x,L[0].y,w,0,Math.PI*2),b.fill();continue}let P=v.seats.map(k),I=(T,R)=>{let A=Math.hypot(R.x-T.x,R.y-T.y);return{x:-(R.y-T.y)/A,y:(R.x-T.x)/A}},M=L.map((T,R)=>{let A=L[Math.max(0,R-1)],_=L[Math.min(L.length-1,R+1)];return Math.hypot(_.x-A.x,_.y-A.y)>.001?I(A,_):I(L[R],L[R+1]??L[R-1])}),x=(T,R,A)=>({x:T.x+R.x*w*A,y:T.y+R.y*w*A}),C=0;for(;C<L.length;){let T=C;for(;T+1<L.length&&P[T+1]===P[C];)T++;let R=C===0?L[0]:{x:(L[C-1].x+L[C].x)/2,y:(L[C-1].y+L[C].y)/2},A=T===L.length-1?L[T]:{x:(L[T].x+L[T+1].x)/2,y:(L[T].y+L[T+1].y)/2},_=C===0?M[0]:I(L[C-1],L[C]),E=T===L.length-1?M[T]:I(L[T],L[T+1]),H=[R,...L.slice(C,T+1),A],G=[_,...M.slice(C,T+1),E],Z=H.map((F,V)=>x(F,G[V],1)),N=H.map((F,V)=>x(F,G[V],-1));b.fillStyle=P[C],b.beginPath(),b.moveTo(Z[0].x,Z[0].y);for(let F of Z.slice(1))b.lineTo(F.x,F.y);if(T===L.length-1){let F=Math.atan2(E.y,E.x);b.arc(A.x,A.y,w,F,F-Math.PI,!0)}else b.lineTo(N[N.length-1].x,N[N.length-1].y);for(let F of N.slice(0,-1).reverse())b.lineTo(F.x,F.y);if(C===0){let F=Math.atan2(-_.y,-_.x);b.arc(R.x,R.y,w,F,F-Math.PI,!0)}b.closePath(),b.fill(),C=T+1}}b.restore()}});this.entries.push({section:m,shape:p,opacity:m.liftGroupSeat.opacity(),listening:m.liftGroupSeat.listening()}),m.liftGroupBg.add(p),m.liftGroupSeat.opacity(0),m.liftGroupSeat.listening(!1)}}}repaint(){for(let e of this.entries)e.shape.getLayer()?.batchDraw()}};function Sl(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 Vo=1e6;function ap(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}function Wo(t){let e=t.target;return e instanceof Element?e.closest('button, a, input, select, textarea, [role="button"]')!=null:!1}var Ri=class{constructor(e,i=ap()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.lastTapAt=0;this.rect=null;this.onLayoutChanged=()=>{this.rect=null};this.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||(this.rect=null,this.beginPointer(e.pointerId,this.toLocal(e.clientX,e.clientY),e.pointerType,e.button))};this.onPointerMove=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId))return;e.preventDefault();let i=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,i)&&this.applyPointerMove(i)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId)};this.onTouchStart=e=>{if(!Wo(e)){e.preventDefault(),this.rect=null;for(let i=0;i<e.changedTouches.length;i+=1){let o=e.changedTouches.item(i);o&&this.beginPointer(Vo+o.identifier,this.toLocal(o.clientX,o.clientY),"touch",0)}}};this.onTouchMove=e=>{if(Wo(e))return;e.preventDefault();let i=null;for(let o=0;o<e.changedTouches.length;o+=1){let n=e.changedTouches.item(o);if(!n)continue;let r=this.toLocal(n.clientX,n.clientY);this.updatePointer(Vo+n.identifier,r)&&(i=r)}i&&this.applyPointerMove(i)};this.onTouchEnd=e=>{if(!Wo(e)){e.preventDefault();for(let i=0;i<e.changedTouches.length;i+=1){let o=e.changedTouches.item(i);o&&this.endPointer(Vo+o.identifier)}}};this.host=e,this.useWebKitTouchEvents=i}get moved(){return this.movedPx}attach(){let{container:e}=this.host;this.rect=null,typeof window<"u"&&(window.addEventListener("scroll",this.onLayoutChanged,{capture:!0,passive:!0}),window.addEventListener("resize",this.onLayoutChanged,{passive:!0}),window.visualViewport?.addEventListener("resize",this.onLayoutChanged),window.visualViewport?.addEventListener("scroll",this.onLayoutChanged)),e.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),e.addEventListener("pointermove",this.onPointerMove,{passive:!1}),e.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),e.addEventListener("pointercancel",this.onPointerEnd,{passive:!1}),this.useWebKitTouchEvents&&(e.addEventListener("touchstart",this.onTouchStart,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove,{passive:!1}),e.addEventListener("touchend",this.onTouchEnd,{passive:!1}),e.addEventListener("touchcancel",this.onTouchEnd,{passive:!1}))}detach(){let{container:e}=this.host;typeof window<"u"&&(window.removeEventListener("scroll",this.onLayoutChanged,{capture:!0}),window.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("scroll",this.onLayoutChanged)),e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerEnd),e.removeEventListener("pointercancel",this.onPointerEnd),this.useWebKitTouchEvents&&(e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("touchcancel",this.onTouchEnd))}resetPan(){this.panLast=null,this.panStart=null,this.panStarted=!1}isGhostClick(e){return e.type==="tap"?(this.lastTapAt=performance.now(),!1):this.lastTapAt>0&&performance.now()-this.lastTapAt<rr}invalidateRect(){this.rect=null}toLocal(e,i){let o=this.rect;if(!o){let n=this.host.container.getBoundingClientRect();o={left:n.left,top:n.top},this.rect=o}return{x:e-o.left,y:i-o.top}}beginPointer(e,i,o,n){if(this.host.cancelGlide(),this.host.dismissFocusRing?.(),this.pointers.set(e,i),this.pointers.size===1)this.movedPx=0,this.singleTouch=o==="touch",this.singleTouch&&this.host.touchProbeStart?.(i),this.pinch=null,this.panStart=i,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:o,button:n})?(this.host.beginMarquee(i),this.panLast=null):this.panLast=i;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[r,s]=[...this.pointers.values()],a={x:(r.x+s.x)/2,y:(r.y+s.y)/2},l=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(s.x-r.x,s.y-r.y),startScale:l,worldMid:{x:(a.x-this.host.stage.x())/l,y:(a.y-this.host.stage.y())/l}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=Ee+1}}updatePointer(e,i){return this.pointers.has(e)?(this.pointers.set(e,i),this.pointers.size===1&&this.panStart?this.movedPx=Math.max(this.movedPx,Math.hypot(i.x-this.panStart.x,i.y-this.panStart.y)):this.pointers.size>=2&&(this.movedPx=Ee+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>Ee?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[i,o]=[...this.pointers.values()],n=Math.hypot(o.x-i.x,o.y-i.y);if(this.pinch.startDist<1)return;let r={x:(i.x+o.x)/2,y:(i.y+o.y)/2},{min:s,max:a}=this.host.zoomBounds(),l=K(this.pinch.startScale*(n/this.pinch.startDist),s,a),c={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.scale({x:l,y:l}),this.host.stage.position(this.host.constrainPan({x:r.x-this.pinch.worldMid.x*l,y:r.y-this.pinch.worldMid.y*l},c)),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=Ee)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}let i={x:this.host.stage.x(),y:this.host.stage.y()};this.host.stage.position(this.host.constrainPan({x:i.x+(e.x-this.panLast.x),y:i.y+(e.y-this.panLast.y)},i)),this.panLast=e,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}}endPointer(e){if(this.pointers.has(e)){if(this.host.marqueeActive()){this.endTouchProbe(),this.host.finishMarquee(),this.pointers.delete(e),this.pointers.size===0&&(this.panLast=null);return}this.pointers.delete(e),this.pointers.size<2&&(this.pinch=null),this.pointers.size===1&&(this.panLast=[...this.pointers.values()][0],this.panStart=this.panLast,this.panStarted=!0),this.pointers.size===0&&(this.panLast=null,this.panStart=null,this.panStarted=!1,this.endTouchProbe(),this.host.afterViewChange())}}endTouchProbe(){this.singleTouch&&(this.singleTouch=!1,this.host.touchProbeEnd?.())}};import{Circle as lp}from"konva/lib/shapes/Circle";import{Group as cp}from"konva/lib/Group";import{Text as dp}from"konva/lib/shapes/Text";var vl=13,hp=15,up=.3,pp=.08;function xl(t,e,i){return!!(t&&i!==t||e&&!e.has(i))}function fp(t,e){return!e||t.available==null?`cap ${t.capacity}`:t.available<=0?B("map.soldOut"):B("map.seatsLeft",{count:t.available})}function mp(t,e){return e&&t.available!=null&&t.available<=0}function Cl(t){for(let e of t.gaById.values()){let i=t.filteredOut(e.categoryKey),o=t.overviewHidden(e),n=mp(e,t.pickerMode),r=t.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:t.dimmed(e.categoryKey)?Ne*pp:n?Ne*up:Ne),e.polygon.listening(!t.exportMode&&!o&&!i&&!n),e.polygon.stroke(r>0?t.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),gp(t,e,n,r,o,t.dimmed(e.categoryKey))}}function gp(t,e,i,o,n,r){if(e.capacityNode){let s=fp(e,t.pickerMode);e.capacityNode.text()!==s&&(e.capacityNode.text(s),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(i?.75:1)}yp(t,e,n||r),o>0&&!n?Sp(t,e,o):e.chip&&e.chip.visible(!1)}var zo=9,wl=.86;function yp(t,e,i){let{labelNode:o,capacityNode:n}=e;if(!o&&!n)return;let r=Math.max(t.effScale(),1e-4);if(i){o?.visible(!1),n?.visible(!1);return}if(!t.pickerMode){o?.visible(t.labelLegible(o.fontSize())),n?.visible(t.labelLegible(n.fontSize()));return}let s=bp(e,r),a=kl(o,jt,s.width*wl,r),l=kl(n,Qt,s.width*wl,r),c=a!=null,d=l!=null&&c&&a+l+zo<=s.height;Ll(o,c?a:null,e.labelPoint.y-zo/r,r),Ll(n,d?l:null,e.labelPoint.y+zo/r,r)}function bp(t,e){let i=1/0,o=-1/0,n=1/0,r=-1/0;for(let s of t.points)s.x<i&&(i=s.x),s.x>o&&(o=s.x),s.y<n&&(n=s.y),s.y>r&&(r=s.y);return Number.isFinite(i)?{width:(o-i)*e,height:(r-n)*e}:{width:0,height:0}}function kl(t,e,i,o){if(!t||!t.text())return null;t.fontSize(e/o);let n=t.width()*o;if(n<=i||n<=0)return e;let r=e*(i/n);return r>=Y?r:null}function Ll(t,e,i,o){if(t){if(e==null){t.visible(!1);return}t.fontSize(e/o),t.offsetX(t.width()/2),t.offsetY(t.height()/2),t.y(i),t.visible(!0)}}function Sp(t,e,i){if(!e.chip){let o=new cp({x:e.labelPoint.x,y:e.labelPoint.y-vl-16,listening:!1}),n=new lp({radius:vl,fill:t.selectionColor,listening:!1,perfectDrawEnabled:!1}),r=new dp({text:String(i),fontSize:hp,fontStyle:"800",fontFamily:t.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});o.add(n),o.add(r),t.bgLayer.add(o),e.chip=o,e.chipText=r}e.chipText&&e.chipText.text()!==String(i)&&e.chipText.text(String(i)),e.chipText&&(e.chipText.offsetX(e.chipText.width()/2),e.chipText.offsetY(e.chipText.height()/2)),e.chip.visible(!0),e.chip.moveToTop()}function Pl(t,e){let i=!1;for(let[o,n]of Object.entries(e)){let r=t.get(o);r&&(n.available!==void 0&&r.available!==n.available&&(r.available=n.available,i=!0),n.selected!==void 0&&r.selected!==n.selected&&(r.selected=n.selected,i=!0))}return i}function Il(t){let{width:e,height:i}=t;return!(e>0)||!(i>0)?"hidden":e===t.stageWidth&&i===t.stageHeight?"unchanged":{width:e,height:i}}import{Rect as Tl}from"konva/lib/shapes/Rect";import{Text as vp}from"konva/lib/shapes/Text";function Ml(t){let e=t.effScale(),i=t.stage.scaleX(),o={width:t.stage.width(),height:t.stage.height()},n=p=>Math.round(p*100)/100,r=new Map(t.overlayLayer.find(".selection-ring").map(p=>[String(p.getAttr("seatId")??""),String(p.getAttr("ringColor")??t.effSelection)])),s=t.seats.map(p=>{let y=t.circleById.get(p.id),b=t.boothLabelById.get(p.id)??t.seatLabelById.get(p.id),S=t.viewMode==="perspective"?t.perspectiveSeatScale.get(p.id)??1:1,w=(t.viewMode==="perspective"?i:e)*S,k=p.kind==="booth"?De:we*t.seatLabelScale(p),v=t.viewMode==="perspective"&&p.kind!=="booth"?e*S:w,L=n((b?.fontSize()??k)*v),P=t.worldToScreen(p),I=b?b.width()*i*S:0,M=b?b.height()*(t.viewMode==="perspective"&&p.kind==="booth"?i:e)*S:0,x=P.x-I/2<0||P.x+I/2>o.width||P.y-M/2<0||P.y+M/2>o.height,C=t.focusedSeatOpacity(p.id,y?.getAbsoluteOpacity()??0),T=t.seatSection.get(p.id),R=!!b?.isVisible()&&C>=.5&&!x,A;R||(C<.5?A="dimmed-or-unavailable":L<Y?A="below-minimum-size":x?A="outside-viewport":b?A="renderer-hidden":A=t.seatLabelDrops.get(p.id)??(t.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let _=y instanceof Tl?y.width()*i*S:t.seatR*2*w,E=y instanceof Tl?y.height()*(t.viewMode==="perspective"?i:e)*S:t.seatR*2*w,H=2*(t.seatR*w+ge),G=y?.fill(),Z=b?.fill(),N=t.accessGlyphById.get(p.id),F=N?.getAbsoluteScale();return{seatId:p.id,label:p.label,kind:p.kind==="booth"?"booth":"seat",markerShape:p.kind==="booth"?"booth":p.wheelchairSpaceType==="no-seat"?"square":"circle",...p.wheelchairSpaceType?{wheelchairSpaceType:p.wheelchairSpaceType}:{},categoryKey:p.categoryKey,...T?{sectionId:T.id}:{},...T?.zone?{zoneId:T.zone}:{},status:t.statusById.get(p.id)??"free",selected:t.selection.has(p.id),visible:R,renderedFontPx:L,fill:typeof G=="string"?G:"",ink:typeof Z=="string"?Z:y?t.seatLabelInk(p,y):t.seatPreferredLabelInk(p),...r.has(p.id)?{selectionRingColor:r.get(p.id)}:{},opacity:n(C),...N?{accessibilityMarker:{glyphVisible:N.isVisible(),glyphWidthPx:n(Re*Math.abs(F?.x??0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(p.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(p.id)&&!!y?.isVisible()&&!!y?.isListening()&&t.isSelectable(p.id),directWidthPx:n(_),directHeightPx:n(E),effectiveMinimumPx:n(Math.max(Math.min(_,E),H))},screenCenter:{x:n(P.x),y:n(P.y)},...R?{screenBox:{x:n(P.x-I/2),y:n(P.y-M/2),width:n(I),height:n(M)}}:{},...A?{hiddenReason:A}:{}}}),a=s.filter(p=>p.visible).length,l=(p,y,b,S,w,k,v)=>{let L=nt({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation()),P=k&&k.liftWorld>0?t.isoLiftLocal(k.liftWorld):{x:0,y:0},I=z(L.map(A=>t.worldToScreen({x:A.x+P.x,y:A.y+P.y}))),M=n(S.opacity()),x=S.fill(),C=I.x+I.width<0||I.x>o.width||I.y+I.height<0||I.y>o.height,T=S.isVisible()&&M>.05&&!C,R=k?rt({x:S.x(),y:S.y()},S.width(),S.height(),S.rotation(),k.outline,k.holes):void 0;return{id:p,kind:y,role:b,label:S.text(),visible:T,renderedFontPx:n(S.fontSize()*i),...v==null?{}:{sizeFloorPx:v},opacity:M,fill:w,ink:typeof x=="string"?x:"",...R==null?{}:{fitsContainer:R},...T?{screenBox:{x:n(I.x),y:n(I.y),width:n(I.width),height:n(I.height)}}:{}}},c=p=>{let y=p.namePlate.fill();if(p.namePlate.opacity()>.05&&typeof y=="string"&&y)return y;let b=p.blockPoly.fill();return typeof b=="string"?b:p.baseFill},d=p=>{let y=p.blockPoly.fill();return typeof y=="string"?y:p.baseFill},h=[...t.sections.map(p=>l(p.id,"section","name",p.nameLabel,c(p),p,Lt(o.width))),...t.sections.map(p=>l(`${p.id}:availability`,"section","availability",p.subLabel,c(p),p)),...t.sections.map(p=>l(`${p.id}:number`,"section","number",p.numberLabel,d(p),p,di(o.width))),...t.zones.flatMap(p=>[l(p.id,"zone","name",p.label,p.background),...p.sub?[l(`${p.id}:price`,"zone","price",p.sub,p.background)]:[]])],u=[...t.gaById].map(([p,y])=>{let b=y.points.map(x=>t.worldToScreen(x)),S=Math.min(...b.map(x=>x.x)),w=Math.min(...b.map(x=>x.y)),k=Math.max(...b.map(x=>x.x)),v=Math.max(...b.map(x=>x.y)),L=k<0||S>o.width||v<0||w>o.height,P=n(y.polygon.opacity()),I=P>=.1&&!L,M=y.polygon.fill();return{areaId:p,label:y.label,capacity:y.capacity,categoryKey:y.categoryKey,...y.sectionId?{sectionId:y.sectionId}:{},visible:I,interactive:y.polygon.listening(),opacity:P,fill:typeof M=="string"?M:"",effectiveBackground:y.effectiveBackground,...I?{screenBox:{x:n(S),y:n(w),width:n(k-S),height:n(v-w)}}:{}}}),f=[...t.freeTextById].map(([p,y])=>{let{node:b,background:S,kind:w}=y,k=t.worldToScreen({x:b.x(),y:b.y()}),v=b.width()*i,L=b.height()*e,P=k.x-b.offsetX()*i,I=k.y-b.offsetY()*e,M=n(b.fontSize()*e),x=P+v<0||P>o.width||I+L<0||I>o.height,C=b.isVisible()&&!x,T=b.fill(),R=n(b.getAbsoluteOpacity()),A;return C||(M<Y?A="below-minimum-size":x?A="outside-viewport":A="renderer-hidden"),{objectId:y.objectId??p,kind:w,text:b.text(),visible:C,renderedFontPx:M,ink:typeof T=="string"?T:"",background:S,opacity:R,...C?{screenBox:{x:n(P),y:n(I),width:n(v),height:n(L)}}:{},...A?{hiddenReason:A}:{}}}),m=t.labelGroup.find(p=>p.getAttr("rowLabel")===!0).filter(p=>p instanceof vp).map(p=>{let y=p.getClientRect({skipShadow:!0,skipStroke:!0}),b=y.x+y.width<0||y.x>o.width||y.y+y.height<0||y.y>o.height,S=p.fill();return{text:p.text(),visible:p.isVisible()&&!b,renderedFontPx:n(p.fontSize()*e),ink:typeof S=="string"?S:"",...b?{}:{screenBox:{x:n(y.x),y:n(y.y),width:n(y.width),height:n(y.height)}}}}),g=t.sections.filter(p=>p.blockPoly.opacity()>.05);return{viewport:o,projection:t.viewMode,...t.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:t.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:t.canvasBackground,effectiveScale:n(e),rung:t.getRung(),minimumVisibleLabelPx:Y,totalLabelledBookableUnits:s.length,visibleLabels:a,hiddenLabels:s.length-a,totalBookableUnits:s.length+u.reduce((p,y)=>p+y.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 y=p.blockPoly.fill();return typeof y!="string"||!lo(t.canvasBackground,y)}).length,tintedSectionShells:g.filter(p=>{let y=p.blockPoly.fill();return typeof y=="string"&&jr(t.canvasBackground,y)}).length,visibleCategoryDetailOutlines:t.sections.filter(p=>p.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:t.sections.filter(p=>p.subLabel.opacity()>.05).length,visibleSectionGADetails:[...t.gaById.values()].filter(p=>p.sectionId!=null&&p.polygon.opacity()>.05).length},labels:s,gaAreas:u,hierarchyLabels:h,freeTextLabels:f,rowLabels:m}}import{Circle as wp}from"konva/lib/shapes/Circle";import{Ellipse as kp}from"konva/lib/shapes/Ellipse";import{Line as Rl}from"konva/lib/shapes/Line";import{Arrow as Lp}from"konva/lib/shapes/Arrow";import{Path as xp}from"konva/lib/shapes/Path";import{Rect as Ot}from"konva/lib/shapes/Rect";import{Text as Xo}from"konva/lib/shapes/Text";import{Image as El}from"konva/lib/shapes/Image";function Fl(t,e){if(!e.url||e.visible===!1)return;let i=new window.Image;t.trackAssetImage(i,e.url,"Buyer background image",()=>{let o=i.naturalWidth||4,n=i.naturalHeight||3,r=e.crop??{x:0,y:0,width:1,height:1},s=Math.max(0,Math.min(.99,r.x)),a=Math.max(0,Math.min(.99,r.y)),l={x:s,y:a,width:Math.max(.01,Math.min(1-s,r.width)),height:Math.max(.01,Math.min(1-a,r.height))},c=e.width,d=c*(n*l.height/(o*l.width)),h=new El({image:i,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:d/2,width:c,height:d,rotation:e.rotation??0,crop:{x:l.x*o,y:l.y*n,width:l.width*o,height:l.height*n},opacity:e.opacity,listening:!1});t.bgLayer.add(h),h.moveToBottom(),t.bgLayer.batchDraw()})}function _l(t,e){let i=new window.Image,o=new El({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(o):t.bgLayer.add(o),e.role&&t.landmarkBoxes.push(z(nt({x:e.x+e.width/2,y:e.y+e.height/2},e.width,e.height,e.rotation??0))),t.trackAssetImage(i,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let n=o.getLayer();n&&n.batchDraw()})}function Bl(t,e){if(e.shape==="round")t.bgLayer.add(new wp({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,listening:!1}));else{let o=e.width??80,n=e.height??50;t.bgLayer.add(new Ot({x:e.center.x,y:e.center.y,width:o,height:n,offsetX:o/2,offsetY:n/2,rotation:e.rotation,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,cornerRadius:4,listening:!1}))}let i=Dt(t,t.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,"#cbd5e1",12,!0);t.freeTextById.set(e.id,{node:i,background:"#232c40",kind:"table"})}var Cp=8,Pp=6;function Ol(t,e){let i=e.background?.color??t.canvasBackground,o=e.color??J(i,t.theme.textColor??Qs),n=e.semanticKind==="icon"?Yn(e.iconKey):void 0;if(n){let d=e.fontSize/24,h=new xp({x:e.position.x,y:e.position.y,data:n,rotation:e.rotation,scaleX:d,scaleY:d,stroke:o,strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});t.iconNodeById.set(e.id,{node:h,fontSize:e.fontSize}),t.bgLayer.add(h);return}let r=e.background?.padding??0,s=e.opacity??1,a=wn(e),l=new Xo({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:Lo(e.bold,e.italic,"600"),fill:o,fontFamily:e.fontFamily??t.labelFont(),...e.width!=null?{width:e.width}:{},align:e.align??"left",lineHeight:e.lineHeight??1.2,letterSpacing:e.letterSpacing??0,textDecoration:e.underline?"underline":"",padding:r,opacity:s,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;if(e.background){let d=l.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),h=Math.max(Cp,e.fontSize*.35),u=Math.max(Pp,e.fontSize*.28);c=new Ot({x:e.position.x,y:e.position.y,offsetX:-(d.x-h),offsetY:-(d.y-u),width:d.width+h*2,height:d.height+u*2,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 Dl(t,e){let i=e.fill??t.theme.decorFill??js,o=e.role==="stage",n=e.role==="reference-focal",r=!!e.role&&!o,s=vn(e),a=se(t.canvasBackground),l=n?a.focalFill:i,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(o?de(l,.28):n?a.focalStroke:c?"#9aa3b5":void 0),h=e.stroke?.width??(o?1:n||c?2:0),u=e.opacity!=null?K(e.opacity,.1,1):1,f=0,m=0,g=null;if(c&&e.points&&e.points.length>=2){f=e.points.reduce((S,w)=>S+w.x,0)/e.points.length,m=e.points.reduce((S,w)=>S+w.y,0)/e.points.length;let p=Un(e),y=$n(h),b=new Lp({points:e.points.flatMap(S=>[S.x,S.y]),closed:!1,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,stroke:d,fill:d,strokeWidth:h,opacity:u,lineCap:p.lineCap,lineJoin:p.lineJoin,pointerAtBeginning:p.startEnding==="arrow",pointerAtEnding:p.endEnding==="arrow",...y,listening:!1,name:"buyer-shape-open-path"});b.setAttr("shapeObjectId",e.id),t.bgLayer.add(b)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let p=o?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,ve(l,.3),1,de(l,.12)]}:{fill:l};f=e.x+e.width/2,m=e.y+e.height/2,g={x:e.x,y:e.y,width:e.width,height:e.height},t.bgLayer.add(new Ot({x:f,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:d,strokeWidth:h,cornerRadius:K(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:u,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){f=e.x+e.width/2,m=e.y+e.height/2,g={x:e.x,y:e.y,width:e.width,height:e.height};let p=o?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,ve(l,.3),1,de(l,.12)]}:{fill:l};t.bgLayer.add(new kp({x:f,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...p,stroke:d,strokeWidth:h,opacity:u,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let p=e.points.flatMap(S=>[S.x,S.y]),y=z(e.points);f=e.points.reduce((S,w)=>S+w.x,0)/e.points.length,m=e.points.reduce((S,w)=>S+w.y,0)/e.points.length,g=y;let b=o?{fillLinearGradientStartPoint:{x:0,y:y.y},fillLinearGradientEndPoint:{x:0,y:y.y+y.height},fillLinearGradientColorStops:[0,ve(l,.3),1,de(l,.12)]}:{fill:l};t.bgLayer.add(new Rl({points:p,closed:!0,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,...b,stroke:d,strokeWidth:h,opacity:u,listening:!1}))}g&&e.role&&t.landmarkBoxes.push(g);for(let p of gn(e))t.bgLayer.add(new Rl({points:p.points.flatMap(y=>[y.x,y.y]),closed:p.closed,x:f,y:m,offsetX:f,offsetY:m,rotation:e.rotation??0,stroke:p.ink??mn,fill:p.fill,strokeWidth:2,opacity:u*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:p,spec:y}=Tp(t,f,m,e.label,l,g,e.labelStyle);t.primaryFocalLabels.set(p,y),t.freeTextById.set(e.id,{node:p,background:l,kind:"stage"})}else if(r){let p=n||s,y=Dt(t,t.bgLayer,e.label,f,m,p?J(l,"#e6e9f0"):"#9aa3b5",p?18:12,!1);p&&t.primaryFocalLabels.set(y,{targetPx:18,trackingRatio:0,ink:String(y.fill()??""),plateInk:String(y.fill()??""),plate:new Ot({width:0,height:0,opacity:0,listening:!1})}),t.freeTextById.set(e.id,{node:y,background:l,kind:"decor"})}else{let p=Dt(t,t.bgLayer,e.label,f,m,"#cbd5e1",16,!0);t.freeTextById.set(e.id,{node:p,background:l,kind:"decor"})}}var Ko=22,Al=Y,Ai=6,Ip=.5;function Tp(t,e,i,o,n,r,s){let a=s?.size??Ko,l=s?.color??t.theme.textColor??"#e6e9f0",c=s?.color??J(n,l),d=r?r.x+r.width/2:e,h=r?r.y+r.height/2:i,u=Mp(t.canvasBackground,n),f=new Ot({x:d,y:h,width:0,height:0,cornerRadius:4,fill:u,opacity:0,listening:!1,perfectDrawEnabled:!1});t.bgLayer.add(f);let m=new Xo({x:d,y:h,text:o,fontSize:a,fontStyle:Lo(s?.bold??!0,s?.italic,"normal"),letterSpacing:a*(4/Ko),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/Ko,ink:c,plateInk:s?.color??J(u,l),plate:f}}}function Mp(t,e){return Q(e,X(t)?"#ffffff":"#000000",.34)}function Nl(t,e,i,o,n=0){let r=Math.max(i,1e-4),s=n>0&&r>n?r/n:1,l=Math.min(e.targetPx,Math.max(Al,e.targetPx*Ip)*s)/r,c=y=>{t.letterSpacing(y*e.trackingRatio),o(t,y)};c(l);let d=e.bounds;if(!d){t.rotation(0),e.plate.opacity(0),t.fill(e.ink);return}let h=d.height>d.width;t.rotation(h?90:0);let u={width:(h?d.height:d.width)-Ai*2,height:(h?d.width:d.height)-Ai*2},f=Math.min(1,u.width/Math.max(t.width(),1e-6),u.height/Math.max(t.height(),1e-6));if(f<1&&(l=Math.max(Al/r,l*f),c(l)),t.width()<=u.width&&t.height()<=u.height){e.plate.opacity(0),t.fill(e.ink);return}let g=(h?t.height():t.width())+Ai*2,p=(h?t.width():t.height())+Ai;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 Hl(t,e){let i=t.catColor.get(e.categoryKey)??"#6e7bff",o=t.canvasBackground,n=Fn(i,o,Ne),r=t.theme.textColor??"#e6e9f0",s=J(n,r),a=$e(e.points,e.holes,{fill:i,opacity:Ne,stroke:i,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",u=>{t.isGhostClick(u)||t.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{t.container.style.cursor="pointer"}),a.on("mouseleave",()=>{t.container.style.cursor="default"}),t.bgLayer.add(a);let l=Yt(e.points,e.holes),c=t.sections.find(u=>j(l,u.outline,u.holes)),d=Dt(t,t.bgLayer,e.displayLabel??e.label,l.x,l.y-8,s,jt,!1),h=Dt(t,t.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,s,Qt,!1);t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:d,background:n,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:n,kind:"ga-capacity",categoryKey:e.categoryKey}),t.gaById.set(e.id,{label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:a,effectiveBackground:n,strokeColor:i,labelPoint:l,labelNode:d,capacityNode:h,...c?{sectionId:c.logicalId}:{}})}function Dt(t,e,i,o,n,r,s,a){let l=new Xo({x:o,y:n,text:i,fontSize:s,fontStyle:a?"700":"500",fontFamily:t.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function Gl(t,e){let i=[],o=e.canvasBackground,n=new Map,r=(c,d)=>{let h=n.get(c)??[];h.push(d),n.set(c,h)};for(let c of e.seats){if(c.kind==="booth")continue;let d=c.logicalRowId??c.rowId;r(d,c),d!==c.rowId&&r(c.rowId,c)}let s=c=>c.logicalSeatIndex??Number(c.id.split(":").pop()??0);for(let c of t.objects){if(c.type!=="row")continue;let d=c.segmentedRow?.repeatLabelOnComponents===!0;if(c.segmentedRow&&!d&&c.segmentedRow.componentIndex!==0)continue;let h=d?c.labelPresentation:c.segmentedRow?.labelPresentation??c.labelPresentation;if(h?.visible===!1||h?.positionPreset==="none")continue;let u=c.segmentedRow&&!d?c.segmentedRow.groupId:c.id,f=(n.get(u)??[]).slice().sort((R,A)=>s(R)-s(A));if(!f.length)continue;let m=f[0],g=f[f.length-1],p=h?.labelStyle,y=h?.style==="pill"?It(o):null,b=y?y.plate:o,S=he(b,p?.color,e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Je),w=p?.size??An,k=h?.rotation??0,v=e.objectFilteredOut(c)?.15:1,L=f.reduce((R,A)=>R??e.seatSection.get(A.id),void 0),I=c.segmentedRow?.displayLabel??c.displayLabel??bt(c.label,L?.label);if(!I)continue;let M=L?[...new Set([L.id,L.logicalId,L.zone].filter(R=>!!R))]:void 0,x=(R,A,_)=>i.push({text:I,x:R,y:A,rotation:k,fontSize:w,ink:S,opacity:v,...y?{pill:y}:{},...M?.length?{focusKeys:M}:{},..._?{automaticAway:_}:{}});if(h?.position){x(h.position.x,h.position.y);continue}let C=e.seatR+12,T=h?.positionPreset??"start";if(T==="start"||T==="both"){let R=c.rotation*Math.PI/180,A={x:-Math.cos(R),y:-Math.sin(R)};x(m.x+A.x*C,m.y+A.y*C,A)}if(T==="end"||T==="both"){let R=(c.rotation+c.curve)*Math.PI/180,A={x:Math.cos(R),y:Math.sin(R)};x(g.x+A.x*C,g.y+A.y*C,A)}}let a=(e.seatR+12)*2.2,l=[];for(let c of i){let d=l.find(h=>h.text===c.text&&Math.hypot(h.x-c.x,h.y-c.y)<=a);if(d){d.x=(d.x+c.x)/2,d.y=(d.y+c.y)/2;continue}l.push(c)}return l}function Yo(t,e,i=ie){let o=t.rotation()*Math.PI/180,n=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),s=(t.width()*n+t.height()*r)/2+i,a=(t.width()*r+t.height()*n)/2+i;return{x:e.x-s,y:e.y-a,width:s*2,height:a*2}}function Vl(t,e,i,o){let n={x:e.x,y:e.y},r=e.automaticAway;if(!r)return n;let s={x:-r.y,y:r.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=[{x:0,y:0}];for(let u=1;u<=4;u++){let f=a*u;l.push({x:s.x*f,y:s.y*f},{x:-s.x*f,y:-s.y*f},{x:r.x*f,y:r.y*f},{x:(r.x+s.x)*f,y:(r.y+s.y)*f},{x:(r.x-s.x)*f,y:(r.y-s.y)*f})}let c=n,d=1/0,h=1/0;for(let u of l){let f={x:n.x+u.x,y:n.y+u.y},m=Yo(t,f),p=(o?ni(o,m,{mode:"overlap"}).length:0)+i.collisionCount(m),y=Math.hypot(u.x,u.y);if((p<d||p===d&&y<h)&&(c=f,d=p,h=y),p===0)break}return c}var Ei=class{constructor(){this.generationCount=0;this.promises=[];this.errors=[];this.cancels=new Set}get generation(){return this.generationCount}get failures(){return this.errors}pending(){return this.promises.slice()}track(e,i,o,n,r){let s=this.generationCount;/^https?:\/\//i.test(i)&&(e.crossOrigin="anonymous");let a=new Promise(l=>{let c=!1,d=()=>{c||(c=!0,this.cancels.delete(h),l())},h=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}d()};this.cancels.add(h),e.onload=()=>{if(!r.exportMode){s===this.generationCount&&n(),d();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.generationCount&&n()}).catch(()=>{s===this.generationCount&&this.errors.push(`${o} could not be decoded.`)}).finally(d)},e.onerror=()=>{s===this.generationCount&&this.errors.push(`${o} could not be loaded.`),d()},e.src=i});this.promises.push(a)}cancelAll(){this.generationCount++;for(let e of[...this.cancels])e();this.cancels.clear(),this.promises=[],this.errors=[]}};function Wl(t,e){let i=e,o=i._cache instanceof Map?i._cache:null,n=i._canvasCache??o?.get("canvas");if(!n){e.isCached?.()&&e.clearCache();return}let r=[n.scene,n.filter,n.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&t.Util.releaseCanvas(...r),i._canvasCache&&(i._canvasCache=void 0),o?.delete("canvas")}function zl(t,e){let i=0,o=0,n=r=>{i||(i=r),o+=1;let s=r-i;s>=1e3&&(t(Math.round(o*1e3/s)),o=0,i=r),e(requestAnimationFrame(n))};e(requestAnimationFrame(n))}function Rp(t){return t<0?0:t>1?1:t}function Kl(t){let e=t.now??(()=>typeof performance<"u"?performance.now():Date.now()),i=t.budgetMs??8,o=t.reducedMotion===!0,n=t.chunks.length>1?Math.min(30,Math.max(0,840/(t.chunks.length-1))):0,r=0,s=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},h=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},u=p=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,p()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,p()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,p()},16)}},f=()=>{a||s||(a=!0,h(),t.done())},m=p=>{for(let y=c.length-1;y>=0;y--){let b=c[y],S=o?1:Rp((p-b.startedAt)/160);t.fade(b.work,S),S>=1&&c.splice(y,1)}return c.length>0},g=()=>{if(s)return;let p=e(),y=p;for(;r<t.chunks.length&&(r===0||e()-y<i);){let S=t.chunks[r++];if(t.build(S.work),t.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:p+(r-1)*n}),e()-y>=i)break}let b=m(p);t.draw(),r<t.chunks.length||b?u(g):f()};return u(g),{cancel(){if(!a){s=!0,h();for(let p of c)t.fade(p.work,1);c.length=0}},finishNow(){if(!(s||a)){for(;r<t.chunks.length;){let p=t.chunks[r++];t.build(p.work)}for(let p of t.chunks)t.fade(p.work,1);c.length=0,t.draw(),f()}},get done(){return a}}}var Ap={width:40,height:30,rotation:0};function Xl(t,e){let i=1/0,o=1/0,n=-1/0,r=-1/0;for(let s of t){if(s.kind==="booth"){let l=e.boothDims.get(s.rowId)??Ap;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<o&&(o=s.y+m.y),s.x+m.x>n&&(n=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,h=l.height/2,u=Math.abs(d*Math.cos(c))+Math.abs(h*Math.sin(c)),f=Math.abs(d*Math.sin(c))+Math.abs(h*Math.cos(c));s.x-u<i&&(i=s.x-u),s.y-f<o&&(o=s.y-f),s.x+u>n&&(n=s.x+u),s.y+f>r&&(r=s.y+f);continue}let a=e.seatR+(s.accessible&&s.wheelchairSpaceType!=="no-seat"?2.75:0);s.x-a<i&&(i=s.x-a),s.y-a<o&&(o=s.y-a),s.x+a>n&&(n=s.x+a),s.y+a>r&&(r=s.y+a)}return isFinite(i)?{x:i,y:o,width:n-i,height:r-o}:null}function Yl(t){let e=new Map,i=[];for(let n of t.seats){let r=t.sectionIdOf(n.id);if(r==null){i.push(n);continue}let s=e.get(r);s?s.push(n):e.set(r,[n])}let o=[...e.entries()].flatMap(([n,r])=>{let s=t.sections.find(a=>a.id===n);return s?[{chunk:{id:n,work:{seats:r,group:s.liftGroupSeat}},distance:Math.hypot(s.centroid.x-t.viewportCentre.x,s.centroid.y-t.viewportCentre.y)}]:[]}).sort((n,r)=>n.distance-r.distance).map(n=>n.chunk);return i.length&&t.looseGroup&&o.push({id:"",work:{seats:i,group:t.looseGroup}}),o}function Nt(t){return{th:ci*Math.PI/180*t.isoT,sg:1-(1-kt)*t.isoT}}function Ul(t,e){let{th:i,sg:o}=Nt(e),n=e.centre,r=t.x-n.x,s=t.y-n.y,a=r*Math.cos(i)-s*Math.sin(i),l=(r*Math.sin(i)+s*Math.cos(i))*o;return{x:n.x+a,y:n.y+l}}function $l(t,e){let{th:i,sg:o}=Nt(e),n=e.centre,r=t.x-n.x,a=(t.y-n.y)/o,l=r*Math.cos(i)+a*Math.sin(i),c=-r*Math.sin(i)+a*Math.cos(i);return{x:n.x+l,y:n.y+c}}function ql(t,e){let{th:i,sg:o}=Nt(e),n=t*e.isoT;return{x:-(n/o)*Math.sin(i),y:-(n/o)*Math.cos(i)}}function Uo(t,e,i){let o=zn(e);t.offset(i),t.position(ue(e,i)),t.rotation(o.rotationDeg),t.scale({x:o.scaleX,y:o.scaleY}),t.skewX(o.skewX),t.skewY(0)}function Ht(t){t.position({x:0,y:0}),t.offset({x:0,y:0}),t.scale({x:1,y:1}),t.rotation(0),t.skewX(0),t.skewY(0)}function Zl(t,e){let i=Math.hypot(e.x-t.surfaceFocal.x,e.y-t.surfaceFocal.y),o=Math.max(0,i-t.frontDistanceWorld);return t.liftWorld+o*Math.tan(t.rakeDeg*Math.PI/180)}function jl(t,e,i){return t.perspectiveAffine?ue(t.perspectiveAffine,e):ue(i,e)}function qe(t,e){return e?ue(e,t):t}function Ql(t,e){let i=0;for(let h of t.seats){let u=Math.max(0,(h.eyeHeightM??re)-re);i=Math.max(i,u*Qe)}for(let h of t.objects)h.type==="section"&&(i=Math.max(i,Xt(h,{floorBaseHeightM:t.floorBaseHeightMFor(h.id)}).height*Qe));let o=Gn(t.bounds,i),n=ri(o,o.target),r=Vn(n);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let s=1/0,a=1/0,l=-1/0,c=-1/0;for(let h of t.seats){let u=Math.max(0,(h.eyeHeightM??re)-re),f=ke(o,h,u*Qe),m={x:f.x,y:f.y};e.seatProjected.set(h.id,m),e.seatLocal.set(h.id,ue(r,m)),e.seatDepth.set(h.id,f.depth),e.seatScale.set(h.id,f.scale),s=Math.min(s,f.x),a=Math.min(a,f.y),l=Math.max(l,f.x),c=Math.max(c,f.y)}for(let h of[{x:t.bounds.x,y:t.bounds.y},{x:t.bounds.x+t.bounds.width,y:t.bounds.y},{x:t.bounds.x+t.bounds.width,y:t.bounds.y+t.bounds.height},{x:t.bounds.x,y:t.bounds.y+t.bounds.height}]){let u=ke(o,h,0);s=Math.min(s,u.x),a=Math.min(a,u.y),l=Math.max(l,u.x),c=Math.max(c,u.y)}let d=Math.max(24,t.seatR*3);return{camera:o,baseAffine:n,baseInverse:r,bounds:Number.isFinite(s)?{x:s-d,y:a-d,width:Math.max(1,l-s+d*2),height:Math.max(1,c-a+d*2)}:null}}function Jl(t,e,i){let o=i?[...i].map(n=>t.seatById.get(n)).filter(n=>!!n):e?t.seats:[...t.perspectiveAppliedSeats].map(n=>t.seatById.get(n)).filter(n=>!!n);for(let n of o){if(e&&t.perspectiveAppliedSeats.has(n.id))continue;let r=e?t.perspectiveSeatProjected.get(n.id)??n:n,s=e?t.perspectiveSeatScale.get(n.id)??1:1,a=t.circleById.get(n.id);a?.position(r),a?.scale({x:s,y:s});let l=t.accessRingById.get(n.id);l?.position(r),l?.scale({x:s,y:s});let c=t.accessGlyphById.get(n.id);if(c){let h=t.seatR*1.5/Re;c.position(r),c.scale({x:h*s,y:h*s})}let d=t.boothLabelById.get(n.id);d?.position(r),d?.scale({x:s,y:s}),e&&t.perspectiveAppliedSeats.add(n.id)}e||t.perspectiveAppliedSeats.clear()}function Fi(t,e=!0){let i=e?[t.bgLayer,t.seatLayer,t.overlayLayer]:[t.bgLayer,t.overlayLayer];for(let o of i)o.position({x:0,y:0}),o.offset({x:0,y:0}),o.scale({x:1,y:1}),o.rotation(0),o.skewX(0),o.skewY(0)}function ec(t,e=!0){for(let i of t.sections()){Ht(i.rootGroupBg),Ht(i.liftGroupBg),e&&Ht(i.liftGroupSeat),i.rootGroupBg.zIndex(i.bgZIndex),e&&i.liftGroupSeat.zIndex(i.seatZIndex);let o=t.labelLiftGroups.get(i.id);o&&e&&Ht(o),i.perspectiveAffine=void 0,i.perspectiveCorrection=void 0,i.perspectiveDepth=void 0}}function tc(t,e=!0){let i=t.perspectiveCamera(),o=t.perspectiveBaseAffine(),n=t.perspectiveBaseInverse();if(!i||!o||!n)return;let r=t.seats().length>2500&&t.sections().length>0;t.cached()&&!r&&(t.seatLayer.clearCache(),t.seatLayer.listening(!0),t.setCached(!1)),Fi(t,e),ec(t,e);for(let a of[t.bgLayer,t.overlayLayer])Uo(a,o,i.target);t.perspectiveAppliedSeats.clear(),r||t.applyExactSeatAnchors(!0);for(let a of t.sections()){let l=h=>Zl(a,h),c=ri(i,a.centroid,l),d=Wn(n,c);a.perspectiveAffine=c,a.perspectiveCorrection=d,a.perspectiveDepth=ke(i,a.centroid,l(a.centroid)).depth,Uo(a.liftGroupBg,d,a.centroid);for(let h=0;h<a.sideFaces.length;h++){let u=a.outline[h],f=a.outline[(h+1)%a.outline.length],m=qe(ke(i,u,0),n),g=qe(ke(i,f,0),n),p=qe(ke(i,f,l(f)),n),y=qe(ke(i,u,l(u)),n);a.sideFaces[h].points([m.x,m.y,g.x,g.y,p.x,p.y,y.x,y.y]),a.sideFaces[h].opacity(.9)}}let s=[...t.sections()].sort((a,l)=>(l.perspectiveDepth??0)-(a.perspectiveDepth??0));for(let a of s)a.rootGroupBg.moveToTop(),a.liftGroupSeat.moveToTop();t.unsectionedSeatGroup()?.moveToTop(),t.syncSeatOverlayPositions(),r||t.updateSeatGroupVisibility(),t.bgLayer.batchDraw(),t.seatLayer.batchDraw(),t.overlayLayer.batchDraw()}function ic(t){if(ec(t),t.applyExactSeatAnchors(!1),t.isoT()===0)Fi(t);else{let{th:i,sg:o}=Nt(t.isoState()),n=Math.cos(i),r=o*Math.sin(i),s=-Math.sin(i),a=o*Math.cos(i),l=Math.sqrt(n*n+r*r),c=n*a-r*s,d=Math.atan2(r,n)*180/Math.PI,h=l,u=c/l,f=(n*s+r*a)/c,m=t.isoCentre();for(let g of[t.bgLayer,t.seatLayer,t.overlayLayer])g.position({x:m.x,y:m.y}),g.offset({x:m.x,y:m.y}),g.rotation(d),g.scaleX(h),g.scaleY(u),g.skewX(f),g.skewY(0)}t.applyUprightLabels(),t.applyElevation(),t.updateSeatGroupVisibility(),t.bgLayer.batchDraw(),t.seatLayer.batchDraw(),t.overlayLayer.batchDraw()}var oc=(t,e)=>t.length===e.length&&t.every(i=>e.some(o=>Math.abs(i.x-o.x)<.001&&Math.abs(i.y-o.y)<.001));function nc(t,e){let o=(t?.floors?.length?t.floors.flatMap(c=>c.objects):t?.objects??[]).filter(c=>c.type==="section"),n=e.logicalSectionId??e.id,r=c=>(c.elevation??0)===(e.elevation??0)&&JSON.stringify(c.geometry??null)===JSON.stringify(e.geometry??null),s=o.find(c=>c.id===n),a=n!==e.id&&!!s&&r(s)&&(s.holes??[]).some(c=>oc(c,e.outline)),l=o.filter(c=>c.id!==e.id&&c.logicalSectionId===e.id&&r(c));return{hidden:a,holes:(e.holes??[]).filter(c=>!l.some(d=>oc(c,d.outline)))}}import{Group as rc}from"konva/lib/Group";import{Line as Ep}from"konva/lib/shapes/Line";import{Rect as Fp}from"konva/lib/shapes/Rect";import{Text as $o}from"konva/lib/shapes/Text";function sc(t,e){let i=Yt(e.outline,e.holes),o=se(t.canvasBackground),n=[],r=new Map,s=0,a=z(e.outline),l=t.seatIndex?ni(t.seatIndex,a).map(E=>t.seatById.get(E)).filter(E=>!!E):t.seats;for(let E of l)t.seatSection.has(E.id)||j(E,e.outline,e.holes)&&(n.push(E.id),r.set(E.categoryKey,(r.get(E.categoryKey)??0)+1),(t.statusById.get(E.id)??"free")==="free"&&s++);let c=e.color??Zt([...r].map(([E,H])=>({hex:t.catColor.get(E)??"#6e7bff",w:H})),"#3a4358"),d=fn(e.elevation),h=Xt(e,{floorBaseHeightM:t.floorBaseHeightMFor(e.id)}),u=h.height*Qe,f=new rc({listening:!1});t.bgLayer.add(f);let m=new rc({listening:!1});f.add(m);let g=new lt({listening:!0});t.seatLayer.add(g);let p=[];if(u>0){let E=ve(t.zoneColor.get(e.zone??"")??c,.42);for(let H=0;H<e.outline.length;H++){let G=new Ep({points:[],closed:!0,fill:E,stroke:D("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});p.push(G),f.add(G)}}m.moveToTop();let y=m,b=nc(t.chartDoc,e),S=e.color??t.zoneColor.get(e.zone??"")??"#3a4358",w=$e(e.outline,b.holes,{visible:!b.hidden,stroke:D(S,.5),strokeWidth:1,fill:D(S,.08),listening:!1},e.outlinePath);y.add(w);let k=$e(e.outline,b.holes,{visible:!b.hidden,fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Ge,opacity:0,listening:!1},e.outlinePath);y.add(k);let v=e.labelPresentation?.labelStyle,L=v?.color,P=o.sectionInk,I=(v?.size??18)/18,M=new Fp({x:e.labelPresentation?.position?.x??i.x,y:e.labelPresentation?.position?.y??i.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});y.add(M);let x=new $o({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*I,fontStyle:Ve,fontFamily:t.labelFont(),fill:he(o.sectionFill,L,P),listening:!1,perfectDrawEnabled:!1});x.offsetX(x.width()/2),x.offsetY(x.height()/2),y.add(x);let C=new $o({x:i.x,y:i.y,text:"",fontSize:12,fontStyle:Ve,fontFamily:t.labelFont(),fill:he(o.sectionFill,L,P),opacity:0,listening:!1,perfectDrawEnabled:!1});y.add(C);let T=new $o({x:i.x,y:i.y,text:B("map.seatsLeft",{count:s}),fontSize:12,fontStyle:Tr,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});T.offsetX(T.width()/2),y.add(T);let R={id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:i,labelAnchors:[...e.labelPresentation?.position?[e.labelPresentation.position]:[],...Vs(e.outline,e.holes??[],i)],memberCategoryKeys:new Set(n.map(E=>t.seatById.get(E)?.categoryKey).filter(Boolean)),shellCategoryColor:t.dominantSellableColor(n),shellFill:o.sectionFill,shellStroke:o.sectionStroke,...e.labelPresentation?.position&&!j(e.labelPresentation.position,e.outline,e.holes)?{externalLabel:{position:e.labelPresentation.position,rotation:e.labelPresentation.rotation??0}}:{},labelArea:un(e.outline,e.holes),zone:e.zone,memberIds:n,total:n.length,free:s,baseFill:c,outlineTint:S,outlinePoly:w,blockPoly:k,namePlate:M,nameLabel:x,numberLabel:C,subLabel:T,preferredInk:P,...L?{explicitInk:L}:{},labelScale:I,nameLabelFits:!1,numberLabelFits:!1,subLabelFits:!0,elevation:d,liftWorld:u,rakeDeg:h.rake,surfaceFocal:n.length?{...t.seatById.get(n[0])?.focalPoint??t.isoCentre}:{...t.chartDoc?.focalPoint??t.isoCentre},frontDistanceWorld:0,rootGroupBg:f,bgZIndex:f.zIndex(),seatZIndex:g.zIndex(),liftGroupBg:m,liftGroupSeat:g,sideFaces:p},A=n.map(E=>t.seatById.get(E)).filter(E=>!!E),_=A.length?A:e.outline;return R.frontDistanceWorld=Math.min(..._.map(E=>Math.hypot(E.x-R.surfaceFocal.x,E.y-R.surfaceFocal.y))),R}function ac(t,e,i){if(!e?.length)return;let o=new Set(e),n=t.seats.filter(h=>!o.has(h.categoryKey)||t.seatInClosedSection(h.id)?!1:(t.statusById.get(h.id)??"free")==="free"||t.ownedHold.has(h.id));if(!n.length)return;let r=To(n.map(h=>h.id),t.seatSection);r&&t.focusSection(r);let s=Math.max(24,t.seatR*3),a=n.map(h=>t.renderedSeatPoint(h)),l=t.clusterLabels.boundsForSeats(n.map((h,u)=>({...h,...a[u]})),s),c=ct(a,s);if(l?.singleBlock&&(!t.hasSections||r!=null)){let h=t.clusterLabels.diveTarget(l.bounds,l.anchor);if(h){t.focusRegion(h,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),maxScale:dt(t)});return}}let d={x:c.x+c.width/2,y:c.y+c.height/2};Io({stage:t.stage,box:c,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(d)})||t.focusRegion(c,{animate:i?.animate,durationMs:t.cameraGlideMs})}function dt(t){let e=ml(Math.max(t.seatR,t.markerR));return Math.max(e,At(t.markerR))}function lc(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return!1;let o=cc(t,i);if(!o.length)return!1;t.clearSectionFocus();let n=Math.max(24,t.seatR*3),r=ct(o.map(a=>t.renderedSeatPoint(a)),n),s={x:r.x+r.width/2,y:r.y+r.height/2};return Io({stage:t.stage,box:r,bounds:t.zoomBounds(),viewport:t.framingViewport(),centreScreen:t.worldToScreen(s)})||t.focusRegion(r,{durationMs:t.cameraGlideMs,maxScale:dt(t)}),!0}function cc(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 dc(t,e,i){let o=i===void 0?t.accessFilter:i;if(!o||!t.sections.some(r=>r.id===e||r.logicalId===e))return!1;let n=t.sectionMembers(e).filter(r=>{if((t.statusById.get(r)??"free")!=="free")return!1;let s=t.seatById.get(r);return s!=null&&Pe(s,o)==="match"});return n.length&&qo(t,n)||t.focusSection(e),!0}function hc(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let o=cc(t,i);if(!o.length)return null;let n=Math.max(24,t.seatR*3),r=ct(o.map(l=>t.renderedSeatPoint(l)),n),s=t.getWorldBounds(),a=s.width>0&&s.height>0&&r.width>=s.width*Mt&&r.height>=s.height*Mt;return{spaces:o.length,sections:jo(t,i),wholeVenue:a}}function qo(t,e,i){let o=e.map(d=>t.seatById.get(d)).filter(d=>d!=null);if(!o.length)return!1;let n=t.seatPitch>0?t.seatPitch:t.seatR*2,r=ct(o.map(d=>t.renderedSeatPoint(d)),Math.max(24,t.seatR*3,n*4)),s=t.getWorldBounds();if(s.width>0&&s.height>0&&r.width>=s.width*Mt&&r.height>=s.height*Mt)return!1;let a=To(o.map(d=>d.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=Math.max(Math.min(t.seatLabelTargetScale(),t.zoomBounds().max),l);return t.focusRegion(r,{animate:i?.animate,durationMs:t.cameraGlideMs,minScale:c,maxScale:Math.max(dt(t),c)}),!0}function uc(t,e,i=!0,o){let n=t.sectionBounds(e);if(!n)return;let r=t.sectionMembers(e).map(d=>t.seatById.get(d)).filter(d=>d!=null),s=r.filter(d=>(t.statusById.get(d.id)??"free")==="free"||t.ownedHold.has(d.id)),a=(s.length?s:r).map(d=>t.renderedSeatPoint(d)),l=t.focusedRowLabelGutter(e),c=t.narrowSeatDetailFocus(a,n,o,l);t.focusRegion(c?.bounds??n,{animate:i,minScale:c?.minScale,maxScale:dt(t),focusPaddingPx:l})}function Zo(t,e){if(!t.accessFilter)return 0;let i=t.accessFreeBySection.get(e.id);if(i!==void 0)return i;let o=pc(t,e,t.accessFilter);return t.accessFreeBySection.set(e.id,o),o}function pc(t,e,i){return ya(e.memberIds,i,o=>t.statusById.get(o)??"free",o=>t.seatById.get(o))}function jo(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return[];let o=i===t.accessFilter,n=new Map;for(let r of t.sections){if(t.isSectionClosed(r))continue;let s=o?Zo(t,r):pc(t,r,i);if(s<=0)continue;let a=n.get(r.logicalId);a?a.free+=s:n.set(r.logicalId,{id:r.logicalId,label:r.label,free:s})}return[...n.values()]}var Np=1800,Vt=class Vt{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=xo;this.effSelection=st;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.rowBandPreview=null;this.rowBandZoomAnchor=null;this.catOrder=[];this.selection=new Set;this.selectedSeatById=new Map;this.selectionMarkers=new Map;this.momentsCache=null;this.breathCache=null;this.ownedCache=null;this.beaconsCache=null;this.hoverCardCache=null;this.ownedHold=new Set;this.seatMarks=new Pi;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.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.zoneColor=new Map;this.hasSections=!1;this.hasBoothText=!1;this.isoT=0;this.isoTarget=0;this.isoRaf=0;this.viewMode="flat";this.perspectiveCamera=null;this.perspectiveBaseAffine=null;this.perspectiveBaseInverse=null;this.perspectiveSeatLocal=new Map;this.perspectiveSeatProjected=new Map;this.perspectiveSeatDepth=new Map;this.perspectiveSeatScale=new Map;this.perspectiveAppliedSeats=new Set;this.perspectiveBounds=null;this.isoCentre={x:0,y:0};this.glideRaf=0;this.labelsVisible=!1;this.labelFadeRaf=0;this.glideInProgress=!1;this.destroyed=!1;this.lodScale=0;this.reducedMotion=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.cameraGlideMs=pl();this.fitScale=1;this.fitPose="";this.viewportInsets={...Go};this.fitClearanceBottom=0;this.seatR=pe;this.markerR=pe;this.seatPitch=0;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 Ei;this.seatReveal=null;this.seatRevealPending=!1;this.revealWorldRect=null;this.progressiveSeatFloor=800;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.zoomSettleRaf=0;this.readingFocusedFrame=!1;this.marquee=null;this.marqueeCur=null;this.organizerStatus=!0;this.onKeyDown=e=>{if(this.opts.manageMode){if((e.metaKey||e.ctrlKey)&&(e.key==="a"||e.key==="A")){e.preventDefault(),this.opts.onMarquee?.(this.selectAllSelectable());return}if(e.key==="Escape"&&this.selection.size){e.preventDefault(),this.clearSelection(),this.opts.onMarquee?.([]);return}}let i=e.key==="ArrowLeft"?{x:-1,y:0}:e.key==="ArrowRight"?{x:1,y:0}:e.key==="ArrowUp"?{x:0,y:-1}:e.key==="ArrowDown"?{x:0,y:1}:null;if(i){e.preventDefault();let o=this.focusedId?this.nearestSeat(this.focusedId,i):this.seats[0]?.id??null;o&&this.focusSeat(o);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let o=this.seatById.get(this.focusedId);o&&this.opts.onFocusSeat?.(o)}};this.focusRingLinger=null;this.cameraHostCache=null;this.projectionHostCache=null;this.seatAnchorContextCache=null;this.interactionHostCache=null;this.movingLabelTimer=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...i},this.exportMode=i.exportMode===!0,this.loadingReveal=i.loadingReveal??"progressive",this.onSeatsRevealed=i.onSeatsRevealed,this.currency=i.currency;let o=_i.pixelRatio;if(this.exportMode&&(this.dpr=1),_i.pixelRatio=this.dpr,this.stage=new _p({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Ri(this.pointerHost),this.exportMode||(e.style.touchAction="none",this.gestures.attach(),e.tabIndex<0&&(e.tabIndex=0),e.setAttribute("role","application"),e.getAttribute("aria-label")||e.setAttribute("aria-label",B("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Qo({listening:!this.exportMode}),this.seatLayer=new Qo({listening:!this.exportMode}),this.overlayLayer=new Qo({listening:!1}),this.labelGroup=new Gt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.rowLabelGroup=new Gt({listening:!1}),this.labelGroup.add(this.rowLabelGroup),this.fgDecorGroup=new Gt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new xi({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:()=>At(this.markerR),pickableScale:()=>Ho(this.markerR),categoryLabel:n=>this.catByKey.get(n)?.label??"",categoryColor:n=>this.categoryDisplayColor(n),categoryPriceLabel:n=>this.categoryPriceLabel(n),categoryFilter:()=>this.categoryFilter,viewMode:()=>this.viewMode,seatsPickable:()=>this.seatsPickable(),screenToWorld:n=>this.screenToWorld(n),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(n,r)=>this.focusRegion(n,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new fc({radius:pe+2,stroke:"#ffffff",strokeWidth:2,opacity:Do,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new fc({radius:pe+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&&(_i.pixelRatio=o),!this.exportMode){this.wireInteraction();let n=this.opts.onFps;n&&zl(n,r=>{this.rafId=r})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}setRowBandPreview(e){this.rowBandPreview?.clear(),this.rowBandPreview=e?new Bt: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 bi({overlayLayer:this.overlayLayer,seatLayer:this.seatLayer,stage:this.stage,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,isCached:()=>this.cached,isExportMode:()=>this.exportMode,labelFont:()=>this.labelFont(),viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),seatPoint:e=>this.renderedSeatPoint(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,selectionFocusDims:e=>this.selectionFocusDims(e),categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.categoryPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,i)=>this.nearestSeatToScreen(e,i)})),this.momentsCache}get breath(){return this.breathCache||(this.breathCache=new Si({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}get hoverCard(){return this.hoverCardCache||(this.hoverCardCache=new Li({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,ge,!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.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})),this.hoverCardCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new vi({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>wo(this.effSelection),labelFont:()=>this.labelFont(),stageScale:()=>this.stage.scaleX(),worldToScreen:e=>this.worldToScreen(e),activate:e=>this.activateBeacon(e)})),this.beaconsCache}activateBeacon(e){let i=e.kind==="section"?e.id:this.seatSection.get(e.seatId)?.logicalId??null;if(i&&this.focusOwnedSeatsIn(i)){this.focusSeat(e.seatId,{move:!1,transient:!0});return}if(i){let o=this.sectionTapAnchor(i,this.renderedSeatPoint(this.seatById.get(e.seatId)??{x:0,y:0}));this.opts.onSectionTap?this.opts.onSectionTap(i,o):this.focusSection(i,{anchor:o})}this.focusSeat(e.seatId,{move:!i,transient:!0})}focusedFrameScaleForBounds(){if(this.readingFocusedFrame||!this.focusedSectionId)return 0;this.readingFocusedFrame=!0;try{return this.sectionBounds(this.focusedSectionId)?this.sectionFrameScale(this.focusedSectionId):0}finally{this.readingFocusedFrame=!1}}focusOwnedSeatsIn(e){let i=this.getSelection().map(o=>o.id).filter(o=>{let n=this.seatSection.get(o);return!!n&&(n.logicalId===e||n.id===e)});return i.length>0&&this.focusSeats(i)}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(Is({rung:this.getRung(),sections:this.sections,zones:this.zones,ownedSeatIds:i=>this.ownedSeatIds(i),sectionName:i=>i.nameLabel.text()||i.logicalId,sectionAnchor:i=>this.ownedAnchor(i),sectionCentre:i=>i.centroid})),this.breath.syncBeacons(e.breathingRings())}ownedSeatIds(e){return e.memberIds.filter(i=>this.selection.has(i)||this.ownedHold.has(i))}ownedAnchor(e){let i=this.ownedSeatIds(e).map(r=>this.seatById.get(r)).filter(r=>r!=null).map(r=>this.renderedSeatPoint(r));if(!i.length)return{x:e.nameLabel.x(),y:e.nameLabel.y()};let o=0,n=0;for(let r of i)o+=r.x,n+=r.y;return{x:o/i.length,y:n/i.length}}get owned(){return this.ownedCache||(this.ownedCache=new ki({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>this.ownedAnchor(e),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,i){return this.owned.anchorFor(e)??i}ownedSeatPoints(e){let i=[];for(let o of e.memberIds){if(!this.selection.has(o)&&!this.ownedHold.has(o))continue;let n=this.seatById.get(o);n&&i.push(this.renderedSeatPoint(n))}return i}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),dismissFocusRing:()=>this.dismissFocusRing(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),constrainPan:(e,i)=>this.constrainPan(e,i),marqueeActive:()=>!!this.marquee,marqueeShouldStart:e=>!!(this.opts.manageMode&&this.opts.marqueeSelect&&e.pointerType!=="touch"&&e.button===0&&this.getRung()==="seats"),beginMarquee:e=>this.beginMarquee(e),updateMarquee:e=>this.updateMarquee(e),finishMarquee:()=>this.finishMarquee(),cancelMarquee:()=>this.cancelMarquee(),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 Bt:null,this.rowBandZoomAnchor=null;let o=e===this.chartDoc;if(o||(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=i?.floorId??Ut(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let s of e.floors)for(let a of s.objects)this.objectFloor.set(a.id,s.id),a.type==="section"&&a.logicalSectionId&&this.objectFloor.set(a.logicalSectionId,s.id);let n=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.seatLabelPool.clear(),this.rowLabelGroup=new Gt({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 s of this.selectionMarkers.values())s.destroy();this.selectionMarkers.clear(),this.beaconsCache?.clear(),this.breathCache?.syncBeacons([]),this.breathCache?.sync(this.selectionMarkers),o||this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.selectionFocusKeep=null,o||this.statusById.clear(),this.accessFreeBySection.clear(),this.seatAnchorContextCache=null,o||(this.selection.clear(),this.selectedSeatById.clear()),this.seatById.clear(),this.seatIndex=null,this.cached=!1,o||(this.accessFilter=null,this.categoryFilter=null,this.categoryHighlight=null,this.commercialLimitedFilter=!1),this.sections=[],this.zones=[],this.landmarkBoxes=[],this.seatSection.clear(),this.focusedSectionId=null,this.focusBackdrop=null,this.catPrice.clear(),this.zoneColor.clear(),this.lodScale=0,this.hasBoothText=!1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.isoT=0,this.isoTarget=0,this.viewMode="flat",this.perspectiveCamera=null,this.perspectiveBaseAffine=null,this.perspectiveBaseInverse=null,this.perspectiveSeatLocal.clear(),this.perspectiveSeatProjected.clear(),this.perspectiveSeatDepth.clear(),this.perspectiveSeatScale.clear(),this.perspectiveAppliedSeats.clear(),this.perspectiveBounds=null,this.resetLayerTransforms(),this.hasSections=n.objects.some(s=>s.type==="section");for(let s of e.zones??[])s.color&&this.zoneColor.set(s.id,s.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=si(this.theme.seatScale)*pe,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(s=>s.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((s,a)=>{this.cbHueByKey.set(s,fi[a%fi.length])});for(let s of e.categories){this.catColor.set(s.key,s.color),this.catByKey.set(s.key,s);let a=this.categoryPriceRanges===null?void 0:this.categoryPriceRanges?.[s.key]?.min??s.price;typeof a=="number"&&this.catPrice.set(s.key,a)}for(let s of n.objects)s.type==="booth"&&this.boothDims.set(s.id,{width:s.width,height:s.height,rotation:s.rotation,...s.points&&s.points.length>=3?{points:s.points.map(a=>({x:a.x,y:a.y}))}:{}});if(this.seats=Oe(n,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()}),!o){let s=n===e?this.seats:Oe(e);this.canonicalSeatIds=new Set(s.map(a=>a.id))}for(let s of this.seats)this.seatById.set(s.id,s),this.statusById.has(s.id)||this.statusById.set(s.id,"free");this.seatIndex=Hn(this.seats,{seatRadius:this.seatR}),this.seatPitch=Za(this.seats),this.markerR=ja(this.seatR,this.seatPitch),this.clusterLabels.rebuild(),this.bounds=Sn(n,{freeText:"exclude"}),this.isoCentre={x:this.bounds.x+this.bounds.width/2,y:this.bounds.y+this.bounds.height/2},this.buildPerspectiveProjection(n),this.renderBackground(n),this.unsectionedSeatGroup=new Gt({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.seatRevealWanted();this.seatRevealPending=r,this.revealWorldRect=r?Xl(this.seats,{seatR:this.seatR,boothDims:this.boothDims}):null,r||this.renderSeats(),this.buildRowLabelPlan(n),this.overlayLayer.add(this.labelGroup),this.overlayLayer.add(this.fgDecorGroup),this.overlayLayer.add(this.hoverRing),this.overlayLayer.add(this.focusRing),this.mountCachePending=!r,this.zoomToFit(),r&&this.startSeatReveal()}seatRevealWanted(){return this.loadingReveal==="progressive"&&!this.exportMode&&this.sections.length>1&&this.seats.length>=this.progressiveSeatFloor}startSeatReveal(){this.cancelSeatReveal();let e=Yl({seats:this.seats,sections:this.sections,sectionIdOf:i=>this.seatSection.get(i)?.id??null,looseGroup:this.unsectionedSeatGroup,viewportCentre:this.viewportCentreInChartSpace()});this.seatReveal=Kl({chunks:e,build:i=>this.renderSeats(i.seats),fade:(i,o)=>i.group.opacity(o),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.afterViewChange(),this.fitPose&&Xe(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){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:mt(e)};if(this.floorOverview&&e.floors.length>=2)return e.floorOverview==="combined"?xn(e):Ln(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...bn(e),referenceImage:void 0,backgroundImage:mt(e)};let i=e.floors.find(o=>o.id===this.activeFloorId)??e.floors[0];return{...e,objects:i.objects,focalPoint:i.focalPoint,referenceImage:void 0,backgroundImage:mt(i),floors:void 0}}floorBaseHeightMFor(e){let i=this.chartDoc?.floors;if(!i?.length)return 0;let o=this.stacked&&e?this.objectFloor.get(e)??this.activeFloorId:this.activeFloorId;return i.find(n=>n.id===o)?.baseHeightM??0}setStacked(e){!this.chartDoc||e===this.stacked||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.stacked=e,e&&(this.floorOverview=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isStacked(){return this.stacked}setFloorOverview(e){!this.chartDoc||e===this.floorOverview||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.floorOverview=e,e&&(this.stacked=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isFloorOverview(){return this.floorOverview}get separatedFloorOverview(){return this.floorOverview&&this.chartDoc?.floorOverview!=="combined"}setFloorLabelStyle(e){e===this.floorLabelStyle||!this.chartDoc||(this.floorLabelStyle=e,this.floorOverview&&this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}getFloorLabelStyle(){return this.floorLabelStyle}setActiveFloor(e){!this.chartDoc||e===this.activeFloorId&&!this.floorOverview&&!this.stacked||(this.floorOverview=!1,this.stacked=!1,this.setChart(this.chartDoc,{floorId:e}))}getFloors(){return this.chartDoc?Ut(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let o=!1,n=this.hasSections?new Set:null;for(let r of e){if(!this.canonicalSeatIds.has(r))continue;let s=this.statusById.get(r);if(s===i)continue;this.statusById.set(r,i);let a=this.circleById.get(r);if(a&&(this.paintSeat(a,r),o=!0),n){let l=this.seatSection.get(r);l&&(this.accessFreeBySection.delete(l.id),s==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),n.add(l))}}if(n&&n.size){for(let r of n)this.refreshSectionFill(r);this.bgLayer.batchDraw()}o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ee&&this.updateLabels())}setSeatCategories(e){let i=!1,o=new Set;for(let[r,s]of Object.entries(e)){let a=this.seatById.get(r);if(!a||!this.catColor.has(s)||a.categoryKey===s)continue;a.categoryKey=s;let l=this.circleById.get(r);l&&(this.paintSeat(l,r),i=!0);let c=this.seatSection.get(r);c&&o.add(c)}if(!i)return;let n=new Map((this.chartDoc?Ut(this.chartDoc):[]).flatMap(r=>r.objects).filter(r=>r.type==="section").map(r=>[r.id,r]));for(let r of o){if(!n.get(r.id)?.color){let a=new Map;for(let l of r.memberIds){let c=this.seatById.get(l)?.categoryKey;c&&a.set(c,(a.get(c)??0)+1)}r.baseFill=Zt([...a].map(([l,c])=>({hex:this.catColor.get(l)??"#6e7bff",w:c})),"#3a4358")}r.shellCategoryColor=this.dominantSellableColor(r.memberIds),this.refreshSectionFill(r)}o.size&&this.bgLayer.batchDraw(),this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ee&&this.updateLabels()}setOwnedHold(e){let i=new Set((e??[]).filter(n=>this.statusById.has(n))),o=new Set([...this.ownedHold,...i]);this.ownedHold=i;for(let n of o){let r=this.circleById.get(n);r&&this.paintSeat(r,n),this.syncSelectionMarker(n)}o.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ee&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;let o=this.selectionFocusId;this.selectionFocusId=i,this.selectionFocusKeep=Va({focusedId:i,seats:this.seats,seatId:s=>s.id,seatPoint:s=>this.renderedSeatPoint(s),sectionOf:s=>this.seatSection.get(s)?.logicalId??null,seatPitch:this.seatPitch,seatRadius:this.seatR});let r=o!=null&&i!=null&&Wa(o,i,s=>this.seatSection.get(s)?.logicalId??null)?[o,i]:this.seats.map(s=>s.id);for(let s of r){let a=this.circleById.get(s);a&&this.paintSeat(a,s)}o&&this.syncSelectionMarker(o),i&&this.syncSelectionMarker(i);for(let[s,a]of this.selectionMarkers)a.opacity(this.selectionFocusDims(s)?.2:1);this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.updateLabels(),this.overlayLayer.batchDraw()}setSeatMarks(e){let i=this.seatMarks.merge(e,this.statusById);for(let o of i){let n=this.circleById.get(o);n&&this.paintSeat(n,o)}i.size&&(this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}getSeatMark(e){return this.seatMarks.get(e)}getStatus(e){return this.statusById.get(e)??"free"}getSelection(){let e=[];for(let i of this.selection){let o=this.seatById.get(i)??this.selectedSeatById.get(i);o&&e.push(o)}return e}clearSelection(){let e=[...this.selection];for(let i of e)this.setSelected(i,!1,!0);this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let i=[];for(let o of e){if(this.selection.has(o)||!this.isSelectable(o))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(o,!0,!0);let n=this.seatById.get(o);n&&i.push(n)}return i.length&&this.overlayLayer.batchDraw(),i}setManageInteraction(e){this.marquee&&this.cancelMarquee(),this.gestures.resetPan();let i=e.organizerStatus!==!1,o=i!==this.organizerStatus;this.organizerStatus=i,this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let n=[...this.selection].filter(r=>!this.isSelectable(r));n.length&&this.deselect(n),!e.manageMode&&this.selection.size&&this.clearSelection(),this.clusterLabels.syncCursor(!1),o&&this.repaintSectionsAndSeats(),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[i,o]of Object.entries(e??{}))Number.isFinite(o)&&this.sectionHeat.set(i,Math.max(0,Math.min(1,o)));for(let i of this.sections)this.refreshSectionHeat(i);this.bgLayer.batchDraw()}deselect(e){let i=!1;for(let o of e)this.selection.has(o)&&(this.setSelected(o,!1,!0),i=!0);i&&(this.overlayLayer.batchDraw(),this.effScale()>ee&&this.updateLabels())}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let i of this.seats)this.isSelectable(i.id)&&e.push(i.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let i=new Set(e),o=[];for(let n of this.seats)i.has(n.label)&&this.isSelectable(n.id)&&o.push(n.id);return this.selectMany(o)}setEvidenceSelection(e){return!this.seatById.has(e)||!this.isSelectable(e)?!1:(this.selection.size&&this.clearSelection(),this.setSelected(e,!0),this.overlayLayer.batchDraw(),this.selection.has(e))}getSelectableInSection(e){let i=[],o=new Set;for(let n of this.sections)if(!(n.id!==e&&n.logicalId!==e&&n.zone!==e))for(let r of n.memberIds){if(o.has(r)||(o.add(r),!this.isSelectable(r)))continue;let s=this.seatById.get(r);s&&i.push(s)}return i}selectMany(e){let i=e.filter(n=>!this.selection.has(n));if(!i.length)return this.getSelection();let o=this.selection.size+i.length<=dr;for(let n of i)if(o)this.setSelected(n,!0,!0);else{this.selection.add(n);let r=this.circleById.get(n);r&&this.paintSeat(r,n)}return this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}beginMarquee(e){let i=this.screenToWorld(e),o=this.stage.scaleX()||1,n=new Bp({x:i.x,y:i.y,width:0,height:0,stroke:this.effSelection,strokeWidth:1.5/o,dash:[5/o,4/o],fill:"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.overlayLayer.add(n),this.marquee={start:i,rect:n},this.marqueeCur=i,this.overlayLayer.batchDraw()}updateMarquee(e){if(!this.marquee)return;let i=this.screenToWorld(e),{start:o,rect:n}=this.marquee;n.setAttrs({x:Math.min(o.x,i.x),y:Math.min(o.y,i.y),width:Math.abs(i.x-o.x),height:Math.abs(i.y-o.y)}),this.marqueeCur=i,this.overlayLayer.batchDraw()}cancelMarquee(){this.marquee&&(this.marquee.rect.destroy(),this.marquee=null,this.marqueeCur=null,this.overlayLayer.batchDraw())}finishMarquee(){let e=this.marquee;if(this.marquee=null,!e)return;e.rect.destroy(),this.overlayLayer.batchDraw();let i=this.marqueeCur??e.start;this.marqueeCur=null;let o=Math.min(e.start.x,i.x),n=Math.max(e.start.x,i.x),r=Math.min(e.start.y,i.y),s=Math.max(e.start.y,i.y),a=this.stage.scaleX()||1;if((n-o)*a<4&&(s-r)*a<4)return;let l=[];for(let c of this.seats){let d=this.renderedSeatPoint(c);d.x<o||d.x>n||d.y<r||d.y>s||this.isSelectable(c.id)&&l.push(c.id)}this.selectMany(l),this.opts.onMarquee?.(this.getSelection())}flashSeat(e,i="#f43f5e"){let o=this.seatById.get(e);o&&Ma(this.flashHost,e,this.renderedSeatPoint(o),i)}flashSection(e,i="#22a06b"){Ra(this.flashHost,this.sections.filter(o=>o.id===e||o.zone===e),i)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,i)=>this.projectedSectionPoint(e,i),isoLiftLocal:e=>this.isoLiftLocal(e)}}nearestSeat(e,i){let o=this.seatById.get(e);if(!o)return null;let n=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(o.id)??o:o,r=null,s=1/0;for(let a of this.seats){if(a.id===e)continue;let l=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(a.id)??a:a,c=l.x-n.x,d=l.y-n.y,h=c*i.x+d*i.y;if(h<=.5)continue;let u=Math.abs(c*i.y-d*i.x),f=h+u*2.5;f<s&&(s=f,r=a.id)}return r}focusSeat(e,i){let o=this.seatById.get(e);if(!o)return;this.focusedId=e,this.focusRing.radius(this.seatR+3),this.focusRing.position(this.renderedSeatPoint(o));let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;this.focusRing.scale({x:n,y:n}),this.focusRing.visible(!0),this.clearFocusRingLinger(),i?.transient&&(this.focusRingLinger=setTimeout(()=>{this.focusRingLinger=null,this.dismissFocusRing()},Np)),i?.move!==!1&&this.ensureVisible(o),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(o)}clearFocusRingLinger(){this.focusRingLinger&&clearTimeout(this.focusRingLinger),this.focusRingLinger=null}dismissFocusRing(){this.clearFocusRingLinger(),this.focusRing.visible()&&(this.focusRing.visible(!1),this.overlayLayer.batchDraw())}ensureVisible(e){let i=this.stage.width(),o=this.stage.height(),n=Math.max(this.stage.scaleX(),Ae*1.2),r=this.worldToScreen(e),s=70,a=r.x<s||r.x>i-s||r.y<s||r.y>o-s;if(this.stage.scaleX()<n||a){let l=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?ue(this.perspectiveBaseAffine,l):this.isoT===0?l:this.isoForward(l);this.stage.scale({x:n,y:n}),this.stage.position({x:i/2-c.x*n,y:o/2-c.y*n}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=al(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}setFitClearance(e){let i=Math.max(0,e||0);i!==this.fitClearanceBottom&&(this.fitClearanceBottom=i,this.fitPose&&Xe(this.stage)===this.fitPose&&this.zoomToFit())}framingViewport(){return ll(this.stage.width(),this.stage.height(),this.viewportInsets)}constrainPan(e,i){let o=this.viewMode==="perspective"?this.perspectiveBounds:null;return sl(e,this.stage.scaleX(),o??this.bounds,this.framingViewport(),i)}framingWorldRect(){return hl(this.framingViewport(),e=>this.screenToWorld(e))}zoomToFit(){el(this.cameraHost)}isSeatRevealPending(){return this.seatRevealPending||this.seatReveal!==null}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,fitClearanceBottom:()=>this.fitClearanceBottom,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),viewMode:()=>this.viewMode,zones:()=>this.zones,markerR:()=>this.markerR,bounds:()=>this.bounds,perspectiveBounds:()=>this.perspectiveBounds,fitScale:()=>this.fitScale,setFitScale:e=>{this.fitScale=e},setFitPose:e=>{this.fitPose=e},revealWorldRect:()=>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 cl(this.stage)}setCameraPose(e){this.cancelGlide(),dl(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()*Vt.ZOOM_STEP,_t(this.framingViewport()))}zoomOut(){this.dismissFocusRing(),this.rowBandPreview&&this.releaseSectionFocusDim(),this.zoomAbout(this.stage.scaleX()/Vt.ZOOM_STEP,_t(this.framingViewport()))}zoomOutLevel(){this.dismissFocusRing();let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e,{maxScale:this.diveCeiling(),focusPaddingPx:this.focusedRowLabelGutter(e)}),"section"):"venue":this.getRung()==="seats"&&(this.setRung("sections"),this.getRung()!=="seats")?"sections":(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let i of this.gaById.values())e+=i.capacity;return e}worldToScreen(e){let i=this.stage.scaleX(),o=e.id,n=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let a=n?this.perspectiveSeatProjected.get(n.id)??ue(this.perspectiveBaseAffine,e):ue(this.perspectiveBaseAffine,e);return{x:a.x*i+this.stage.x(),y:a.y*i+this.stage.y()}}let r=n?this.renderedSeatPoint(n):e,s=this.isoT===0?r:this.isoForward(r);return{x:s.x*i+this.stage.x(),y:s.y*i+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let i=e===null?null:[...e];if(!this.sameAccessFilter(i)){this.accessFilter=i,this.accessFreeBySection.clear();for(let o of this.sections)this.refreshSectionFill(o);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale());for(let o of this.seats){let n=this.circleById.get(o.id);n&&this.paintSeat(n,o.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let i=this.accessFilter;return i===null||e===null?i===e:i.length===e.length&&i.every((o,n)=>o===e[n])}setCommercialLimitedFilter(e){if(this.commercialLimitedFilter!==e){this.commercialLimitedFilter=e;for(let i of this.seats){let o=this.circleById.get(i.id);o&&this.paintSeat(o,i.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setCategoryFilter(e){let i=e===null?null:new Set(e);if(!la(i,this.categoryFilter)){this.categoryFilter=i,this.lodScale=0,this.updateLOD();for(let o of this.seats){let n=this.circleById.get(o.id);n&&this.paintSeat(n,o.id)}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(){Cl({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=>xl(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<te,effScale:()=>this.effScale(),labelLegible:e=>me(e,this.effScale())})}setGAStates(e){Pl(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,seatPitch:this.seatPitch,cameraGlideMs:this.cameraGlideMs,seatInClosedSection:e=>this.seatInClosedSection(e),isSectionClosed:e=>this.isSectionClosed(e),renderedSeatPoint:e=>this.renderedSeatPoint(e),sectionMembers:e=>this.sectionMembers(e),sectionBounds:e=>this.sectionBounds(e),focusedRowLabelGutter:e=>this.focusedRowLabelGutter(e),seatLabelTargetScale:()=>this.seatLabelTargetScale(),zoomBounds:()=>this.zoomBounds(),rowBandDetailScale:()=>this.rowBandPreview&&this.viewMode==="flat"?this.rowBandPreview.detailScale:0,framingViewport:()=>this.framingViewport(),worldToScreen:e=>this.worldToScreen(e),getWorldBounds:()=>this.getWorldBounds(),narrowSeatDetailFocus:(e,i,o,n)=>this.narrowSeatDetailFocus(e,i,o,n),focusSection:(e,i)=>this.focusSection(e,i),markSectionFocus:(e,i)=>this.markSectionFocus(e,i),clearSectionFocus:()=>this.clearSectionFocus(),focusRegion:(e,i)=>this.focusRegion(e,i)}}focusCategories(e,i){ac(this.focusFramingContext,e,i)}diveCeiling(){return dt(this.focusFramingContext)}focusAccessibleSeats(e){return lc(this.focusFramingContext,e)}focusAccessibleSection(e,i){return dc(this.focusFramingContext,e,i)}accessibleSpread(e){return hc(this.focusFramingContext,e)}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let a=this.viewMode==="isometric"&&this.isoT>0;this.viewMode=e,this.isoTarget=1,this.isoT=1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.applyPerspective(a),this.zoomToFit();return}let i=e==="isometric"?1:0,o=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=i,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),o){this.isoT=i,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=i,this.applyIso(),this.afterViewChange();return}let n=this.isoT;if(n===i){this.applyIso(),this.afterViewChange();return}let r=performance.now(),s=a=>{if(this.destroyed)return;let l=Math.min(1,(a-r)/hr),c=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2;this.isoT=n+(this.isoTarget-n)*c,this.applyIso(),this.scheduleViewChange(),l<1?this.isoRaf=requestAnimationFrame(s):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(s)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),i=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,i)}return this.stage.scaleX()*(1-(1-kt)*this.isoT)}isoForward(e){return Ul(e,this.isoState)}isoInverse(e){return $l(e,this.isoState)}buildPerspectiveProjection(e){let i=Ql({seats:this.seats,objects:e.objects,bounds:this.bounds,seatR:this.seatR,floorBaseHeightMFor:o=>this.floorBaseHeightMFor(o)},{seatLocal:this.perspectiveSeatLocal,seatProjected:this.perspectiveSeatProjected,seatDepth:this.perspectiveSeatDepth,seatScale:this.perspectiveSeatScale});this.perspectiveCamera=i.camera,this.perspectiveBaseAffine=i.baseAffine,this.perspectiveBaseInverse=i.baseInverse,this.perspectiveBounds=i.bounds}projectedSectionPoint(e,i){return jl(e,i,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return qe(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return ql(e,this.isoState)}get projectionHost(){return this.projectionHostCache??={bgLayer:this.bgLayer,seatLayer:this.seatLayer,overlayLayer:this.overlayLayer,labelLiftGroups:this.labelLiftGroups,perspectiveAppliedSeats:this.perspectiveAppliedSeats,seats:()=>this.seats,sections:()=>this.sections,unsectionedSeatGroup:()=>this.unsectionedSeatGroup,cached:()=>this.cached,setCached:e=>{this.cached=e},isoT:()=>this.isoT,isoState:()=>this.isoState,isoCentre:()=>this.isoCentre,perspectiveCamera:()=>this.perspectiveCamera,perspectiveBaseAffine:()=>this.perspectiveBaseAffine,perspectiveBaseInverse:()=>this.perspectiveBaseInverse,applyExactSeatAnchors:(e,i)=>this.applyExactSeatAnchors(e,i),applyUprightLabels:()=>this.applyUprightLabels(),applyElevation:()=>this.applyElevation(),syncSeatOverlayPositions:()=>this.syncSeatOverlayPositions(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility()}}resetLayerTransforms(e=!0){Fi(this.projectionHost,e)}get seatAnchorContext(){return this.seatAnchorContextCache??={seats:this.seats,seatById:this.seatById,seatR:this.seatR,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,perspectiveAppliedSeats:this.perspectiveAppliedSeats,circleById:this.circleById,accessRingById:this.accessRingById,accessGlyphById:this.accessGlyphById,boothLabelById:this.boothLabelById}}applyExactSeatAnchors(e,i){Jl(this.seatAnchorContext,e,i)}applyPerspective(e=!0){tc(this.projectionHost,e)}applyIso(){ic(this.projectionHost)}applyUprightLabels(){let e=ci*this.isoT,i=1/(1-(1-kt)*this.isoT),o=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let n of o){let r=n.find("Text");for(let s of r){let a=s.getAttr("uprightBase");a==null&&(a=s.rotation(),s.setAttr("uprightBase",a)),s.rotation(a-e),s.scaleX(1),s.scaleY(i),s.skewX(0)}}}applyElevation(){let e=this.isoT;for(let i of this.sections){if(i.liftWorld<=0)continue;let o=this.isoLiftLocal(i.liftWorld);i.liftGroupBg?.position(o),i.liftGroupSeat.position(o),this.labelLiftGroups.get(i.id)?.position(o);let n=.9*e;for(let r=0;r<i.sideFaces.length;r++){let s=i.sideFaces[r],a=i.outline[r],l=i.outline[(r+1)%i.outline.length];s.points([a.x,a.y,l.x,l.y,l.x+o.x,l.y+o.y,a.x+o.x,a.y+o.y]),s.opacity(n)}}this.syncSeatOverlayPositions()}destroy(){this.movingLabelTimer&&(clearTimeout(this.movingLabelTimer),this.movingLabelTimer=null),this.rowBandPreview?.clear(),this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.rafId&&cancelAnimationFrame(this.rafId),this.isoRaf&&cancelAnimationFrame(this.isoRaf),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.zoomSettleRaf&&cancelAnimationFrame(this.zoomSettleRaf),this.breathCache?.destroy(),this.momentsCache?.destroy(),this.beaconsCache?.clear(),this.hoverCardCache?.destroy(),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),this.clusterLabels.destroy(),this.container.removeEventListener("keydown",this.onKeyDown),this.stage.destroy()}labelFont(){return this.exportMode?this.theme.fontFamily?.toLowerCase().includes("jetbrains")?"JetBrains Mono, monospace":"Inter, sans-serif":this.theme.fontFamily||"Inter, sans-serif"}seatContainer(e){return this.seatSection.get(e)?.liftGroupSeat??this.unsectionedSeatGroup??this.seatLayer}sectionMatchesFocus(e){let i=this.focusedSectionId;return i==null||e.id===i||e.logicalId===i||e.zone===i}selectionFocusDims(e){return this.selectionFocusId?!(this.selectionFocusKeep?.has(e)??e===this.selectionFocusId):!1}focusedSeatOpacity(e,i){if(!this.focusedSectionId||!this.focusDimOverlay)return i;let o=this.seatSection.get(e);return i*(o&&this.sectionMatchesFocus(o)?1:xe)}sectionScreenBounds(e){return Ws({viewMode:this.viewMode,isoT:this.isoT,stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y(),projectedSectionPoint:(i,o)=>this.projectedSectionPoint(i,o),isoLiftLocal:i=>this.isoLiftLocal(i),isoForward:i=>this.isoForward(i)},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=te,i=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,o=96,n=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>=-o&&c.y+c.height>=-o&&c.x<=n+o&&c.y<=r+o,a&&this.viewMode==="perspective"&&!i&&this.applyExactSeatAnchors(!0,s.memberIds)}s.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(s.id)?.setViewportCulled(!a)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!i&&(this.unsectionedSeatIds||(this.unsectionedSeatIds=this.seats.filter(s=>!this.seatSection.has(s.id)).map(s=>s.id)),this.applyExactSeatAnchors(!0,this.unsectionedSeatIds))}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(let o of i.memberIds){let n=this.seatById.get(o);n&&e.push(n)}for(let i of this.seats)this.seatSection.has(i.id)||e.push(i);return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}renderedSeatPoint(e){if(this.viewMode==="perspective")return this.perspectiveSeatLocal.get(e.id)??e;let i=this.seatSection.get(e.id);if(!i||i.liftWorld<=0||this.isoT===0)return e;let o=this.isoLiftLocal(i.liftWorld);return{x:e.x+o.x,y:e.y+o.y}}seatLabelContainer(e){let i=this.seatSection.get(e);if(!i)return this.labelGroup;let o=this.labelLiftGroups.get(i.id);return o||(o=new lt({listening:!1}),o.setViewportCulled(i.liftGroupSeat.isViewportCulled()),o.position(this.viewMode==="perspective"?{x:0,y:0}:this.isoLiftLocal(i.liftWorld)),this.labelGroup.add(o),this.labelLiftGroups.set(i.id,o)),o}syncSeatOverlayPositions(){if(this.hoveredId){let e=this.seatById.get(this.hoveredId);if(e){this.hoverRing.position(this.renderedSeatPoint(e));let i=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.hoverRing.scale({x:i,y:i})}}if(this.focusedId){let e=this.seatById.get(this.focusedId);if(e){this.focusRing.position(this.renderedSeatPoint(e));let i=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.focusRing.scale({x:i,y:i})}}for(let[e,i]of this.selectionMarkers){let o=this.seatById.get(e);if(o){i.position(this.renderedSeatPoint(o));let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(o.id)??1:1;i.scale({x:n,y:n})}}}renderSeats(e=this.seats){oa({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,colorblind:this.colorblind,canvasBackground:this.canvasBackground,setHasBoothText:()=>{this.hasBoothText=!0},circleById:this.circleById,glyphMarkers:this.glyphMarkers,boothDims:this.boothDims,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,accessRingById:this.accessRingById,catByKey:this.catByKey,perspectiveSeatDepth:this.perspectiveSeatDepth,seatContainer:i=>this.seatContainer(i),buildAccessGlyph:(i,o)=>this.buildAccessGlyph(i,o),paintSeat:(i,o)=>this.paintSeat(i,o),labelFont:()=>this.labelFont()});for(let i of e)this.selection.has(i.id)&&this.syncSelectionMarker(i.id)}buildAccessGlyph(e,i){let o=this.seatR*1.5/Re,n=new Dp({x:e.x,y:e.y,data:Jt(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:ti(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Sl(n),n}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[i,o]of this.accessGlyphById){let n=this.viewMode==="perspective"?this.perspectiveSeatScale.get(i)??1:1,r=this.seatR*1.5/Re*n,a=this.accessGlyphFilterEmphasized(i)?or:ir,l=Math.max(r,a/(Re*Math.max(e,.001)));o.scale({x:l,y:l}),o.visible(this.accessGlyphShouldShow(i))}}accessGlyphFilterEmphasized(e){let i=this.seatById.get(e),o=this.accessFilter;return!!i&&o!==null&&!!i.accessibility?.length&&Ce(i,o)}accessGlyphShouldShow(e){return!this.accessGlyphById.has(e)||!this.accessMarkerEligible(e)?!1:!(this.selection.has(e)||this.ownedHold.has(e))}accessRingShouldShow(e){return this.accessRingById.has(e)&&this.accessMarkerEligible(e)}accessMarkerEligible(e){let i=this.statusById.get(e)??"free";return!(i==="booked"||i==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryPriceLabel(e){if(this.categoryPriceRanges===null)return null;let i=this.categoryPriceRanges?.[e];if(i&&i.max>i.min)return`${We(i.min,this.currency)}\u2013${We(i.max,this.currency)}`;let o=this.catPrice.get(e);return typeof o=="number"?We(o,this.currency):null}setCategoryPriceRanges(e){if(JSON.stringify(e)!==JSON.stringify(this.categoryPriceRanges)&&(this.categoryPriceRanges=e==null?e:Object.fromEntries(Object.entries(e).filter(([,i])=>Number.isFinite(i.min)&&Number.isFinite(i.max)&&i.min>=0&&i.max>=i.min).map(([i,o])=>[i,{min:o.min,max:o.max}])),!!this.chartDoc)){if(this.catPrice.clear(),this.categoryPriceRanges!==null)for(let i of this.chartDoc.categories){let o=this.categoryPriceRanges?.[i.key]?.min??i.price;typeof o=="number"&&this.catPrice.set(i.key,o)}this.hoverCardCache?.hide(),this.clusterLabels.rebuild();for(let i of this.zones)i.back.destroy(),i.label.destroy(),i.sub?.destroy();this.zones.length=0,this.renderZones(this.chartDoc),this.updateLOD(),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw()}}categoryDisplayColor(e){return this.colorblind?this.cbHueByKey.get(e)??fi[0]:this.catColor.get(e)??"#6e7bff"}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??Ue}seatLabelInk(e,i){let o=i.fill();return he(typeof o=="string"?o:"",e.labelStyle?.color,this.theme.seatLabelColor??Ue,Je)}get seatPaintContext(){return this.seatPaintCache||(this.seatPaintCache={organizer:()=>this.opts.manageMode===!0&&this.organizerStatus,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),boothWidth:e=>this.boothDims.get(e)?.width,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,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){za(this.seatPaintContext,e,i),this.rowBandPreview?.repaint()}seatInClosedSection(e){if(!this.closedSections.size)return!1;let i=this.seatSection.get(e);return!!i&&(this.closedSections.has(i.id)||this.closedSections.has(i.logicalId)||i.zone!=null&&this.closedSections.has(i.zone))}setColorblindSafe(e){if(e!==this.colorblind){this.colorblind=e;for(let i of this.seats){let o=this.circleById.get(i.id);o&&this.paintSeat(o,i.id)}for(let i of this.sections)i.shellCategoryColor=this.dominantSellableColor(i.memberIds),this.refreshSectionFill(i);this.bgLayer.batchDraw(),this.updateLabels(),this.clusterLabels.rebuild(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setDimmedSections(e){let i=new Set(e??[]);if(!(i.size===this.dimmedSections.size&&[...i].every(o=>this.dimmedSections.has(o)))){this.dimmedSections=i;for(let o of this.seats){let n=this.circleById.get(o.id);n&&this.paintSeat(n,o.id)}this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setClosedSections(e){let i=new Set(e??[]);i.size===this.closedSections.size&&[...i].every(o=>this.closedSections.has(o))||(this.closedSections=i,this.repaintSectionsAndSeats())}focusSection(e,i){this.markSectionFocus(e,i?.anchor??null)&&this.focusSectionCamera(e,!0,i?.anchor)}markSectionFocus(e,i){return this.sections.some(o=>o.id===e||o.logicalId===e)?(this.focusedSectionId=e,this.focusAnchor=i,this.focusRoams=!1,this.sectionDimEnabled()&&this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),!0):!1}focusSeats(e,i){return qo(this.focusFramingContext,e,i)}focusSectionCamera(e,i=!0,o){if(this.rowBandPreview&&this.viewMode==="flat"&&!this.exportMode){let n=this.sectionBounds(e);if(n){let r=Math.min(this.sectionFrameScale(e),this.zoomBounds().max*.85);this.focusRegion(n,{animate:i,maxScale:r});return}}uc(this.focusFramingContext,e,i,o)}releaseSectionFocusDim(){this.cameraGestures+=1,this.focusRoams=!0,this.dropFocusDim()}dropFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}sectionDimEnabled(){return this.sectionFocusDim??this.stage.width()>=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()>=le}atVenueFit(){return this.fitPose!==""&&Xe(this.stage)===this.fitPose}canZoomIn(){return this.stage.scaleX()<this.zoomBounds().max*(1-1e-6)}seatsPickable(){return this.rowBandPreview?.active?!1:this.focusedSectionId||this.separatedFloorOverview?!0:this.effScale()>=Ho(this.markerR)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let i=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=Aa(this.focusBackdropHost,i),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=Ea(this.focusBackdropHost,i);for(let o of this.selectionMarkers.values())o.moveToTop();this.beaconsCache?.raise(),this.hoverRing.moveToTop(),this.focusRing.moveToTop()}}get focusBackdropHost(){return{bgLayer:this.bgLayer,overlayLayer:this.overlayLayer,bounds:this.bounds,canvasBackground:this.canvasBackground,viewMode:this.viewMode,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,i)=>this.projectedSectionPoint(e,i),isoLiftLocal:e=>this.isoLiftLocal(e),focusedRowLabelCutouts:()=>{let e=this.focusedSectionId;return e?this.rowLabelGroup.find(i=>i.getAttr("rowLabel")===!0).filter(i=>i.getAttr("focusKeys")?.includes(e)).map(i=>{let o=i.getClientRect({relativeTo:this.overlayLayer,skipShadow:!0,skipStroke:!0}),n=2;return[{x:o.x-n,y:o.y-n},{x:o.x+o.width+n,y:o.y-n},{x:o.x+o.width+n,y:o.y+o.height+n},{x:o.x-n,y:o.y+o.height+n}]}):[]}}}repaintSectionsAndSeats(){for(let e of this.seats){let i=this.circleById.get(e.id);i&&this.paintSeat(i,e.id)}for(let e of this.sections)this.refreshSectionFill(e);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){let e=this.screenToWorld({x:0,y:0}),i=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,i.x),y:Math.min(e.y,i.y),width:Math.abs(i.x-e.x),height:Math.abs(i.y-e.y)}}getWorldBounds(){let e=1/0,i=1/0,o=-1/0,n=-1/0,r=(s,a)=>{s<e&&(e=s),a<i&&(i=a),s>o&&(o=s),a>n&&(n=a)};for(let s of this.seats)r(s.x,s.y);for(let s of this.sections)for(let a of s.outline)r(a.x,a.y);for(let s of this.gaById.values())for(let a of s.points)r(a.x,a.y);return Number.isFinite(e)?{x:e,y:i,width:Math.max(1,o-e),height:Math.max(1,n-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(i=>{let o=this.isSectionClosed(i)||i.free<=0,n=i.memberIds.some(a=>this.selection.has(a)),r=n||i.memberIds.some(a=>this.ownedHold.has(a)),s=this.focusedSectionId===i.id||this.focusedSectionId===i.logicalId;return{id:i.logicalId,label:i.label,outline:i.outline.map(a=>({...a})),...this.objectFloor.get(i.id)?{floorId:this.objectFloor.get(i.id)}:{},state:n?"selected":o?"inactive":"available",active:s,paint:{fill:i.shellFill,stroke:i.shellStroke},owned:r}});return{sections:e,seats:e.length?[]:this.seats.map(i=>({x:i.x,y:i.y,categoryKey:i.categoryKey,state:this.selection.has(i.id)?"selected":this.statusById.get(i.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let i=this.worldToScreen(e),o={x:this.stage.x(),y:this.stage.y()};this.stage.position(this.constrainPan({x:o.x+this.stage.width()/2-i.x,y:o.y+this.stage.height()/2-i.y},o)),this.afterViewChange(),this.stage.batchDraw()}panScreenBy(e,i){if(Math.abs(e.x)<.5&&Math.abs(e.y)<.5)return;this.cancelGlide();let o=this.stage.x(),n=this.stage.y(),r=this.constrainPan({x:o+e.x,y:n+e.y},{x:o,y:n}),s=r.x-o,a=r.y-n;if(Math.abs(s)<.5&&Math.abs(a)<.5)return;if(i?.animate===!1||this.reducedMotion||typeof requestAnimationFrame!="function"){this.stage.position({x:r.x,y:r.y}),this.afterViewChange(),this.stage.batchDraw();return}let l=performance.now(),c=Math.max(180,Math.min(1200,this.cameraGlideMs));this.glideInProgress=!0;let d=h=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let u=Math.min(1,(h-l)/c),f=u<.5?4*u*u*u:1-Math.pow(-2*u+2,3)/2;if(this.stage.position({x:o+s*f,y:n+a*f}),this.scheduleViewChange(),this.stage.batchDraw(),u<1){this.glideRaf=requestAnimationFrame(d);return}this.glideRaf=0,this.glideInProgress=!1,this.settleView()};this.glideRaf=requestAnimationFrame(d)}getCameraGestureCount(){return this.cameraGestures}setCategoryHighlight(e){if(this.categoryHighlight!==e){this.categoryHighlight=e;for(let i of this.seats){let o=this.circleById.get(i.id);o&&this.paintSeat(o,i.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}renderBackground(e){let i=mt(e);i&&this.renderBackgroundImage(i);for(let o of e.objects)o.type==="decorImage"&&this.renderDecorImage(o);for(let o of e.objects)o.type==="section"&&this.renderSection(o);for(let o of e.objects)o.type==="shape"?this.renderShape(o):o.type==="gaArea"?this.renderGA(o):o.type==="table"?this.renderTable(o):o.type==="text"&&this.renderText(o);this.renderZones(e)}trackAssetImage(e,i,o,n){this.assets.track(e,i,o,n,{exportMode:this.exportMode})}cancelAssetLoads(){this.assets.cancelAll()}renderBackgroundImage(e){Fl(this.objectDrawContext,e)}get objectDrawContext(){return{bgLayer:this.bgLayer,fgDecorGroup:this.fgDecorGroup,container:this.container,opts:this.opts,theme:this.theme,canvasBackground:this.canvasBackground,catColor:this.catColor,sections:this.sections,freeTextById:this.freeTextById,gaById:this.gaById,iconNodeById:this.iconNodeById,primaryFocalLabels:this.primaryFocalLabels,landmarkBoxes:this.landmarkBoxes,labelFont:()=>this.labelFont(),trackAssetImage:(e,i,o,n)=>this.trackAssetImage(e,i,o,n),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){_l(this.objectDrawContext,e)}renderTable(e){Bl(this.objectDrawContext,e)}renderText(e){Ol(this.objectDrawContext,e)}renderShape(e){Dl(this.objectDrawContext,e)}renderGA(e){Hl(this.objectDrawContext,e)}renderSection(e){let i=sc(this.sectionBuildContext,e);for(let o of i.memberIds)this.seatSection.set(o,i);this.unsectionedSeatIds=null,this.refreshSectionFill(i),this.refreshSectionHeat(i),this.sections.push(i)}get sectionBuildContext(){return{bgLayer:this.bgLayer,seatLayer:this.seatLayer,canvasBackground:this.canvasBackground,seats:this.seats,seatById:this.seatById,seatSection:this.seatSection,seatIndex:this.seatIndex,statusById:this.statusById,catColor:this.catColor,zoneColor:this.zoneColor,chartDoc:this.chartDoc,isoCentre:this.isoCentre,labelFont:()=>this.labelFont(),floorBaseHeightMFor:e=>this.floorBaseHeightMFor(e),dominantSellableColor:e=>this.dominantSellableColor(e)}}refreshSectionHeat(e){ga(this.sectionLodPaintContext,e)}refreshSectionFill(e){ba(this.sectionLodPaintContext,e)}isSectionClosed(e){return Ro(this.sectionLodPaintContext,e)}dominantSellableColor(e){let i=Ur(e,o=>this.seatById.get(o)?.categoryKey,o=>this.catByKey.get(o)?.notForSale===!0);return i?this.categoryDisplayColor(i):null}sectionAccessibleFree(e){return Zo(this.focusFramingContext,e)}accessibleSections(e){return jo(this.focusFramingContext,e)}get sectionLodPaintContext(){return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:e=>e.memberIds.some(i=>this.selection.has(i)||this.ownedHold.has(i)),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:e=>this.sectionAccessibleFree(e),selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.separatedFloorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,viewMode:this.viewMode,glideInProgress:this.glideInProgress,reducedMotion:this.reducedMotion,isoT:this.isoT,seatCount:this.seats.length,lodScale:this.lodScale,fitScale:this.fitScale,setLodScale:e=>{this.lodScale=e},worldToScreen:e=>this.worldToScreen(e)}}renderZones(e){Ys({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,derivedFloorGroups:this.chartDoc?.floorOverview==="combined"&&!this.chartDoc.zones?.length,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let i=this.stage.scaleX(),o={x:(e.x-this.stage.x())/i,y:(e.y-this.stage.y())/i};return this.viewMode==="perspective"&&this.perspectiveBaseInverse?ue(this.perspectiveBaseInverse,o):this.isoT===0?o:this.isoInverse(o)}sectionAt(e){if(!this.sections.length)return null;let i=this.screenToWorld(e),o=this.sections.find(n=>{if(this.viewMode==="perspective"&&n.perspectiveAffine)return j(i,n.outline.map(s=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,s))),n.holes.map(s=>s.map(a=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,a)))));let r=n.liftWorld>0?this.isoLiftLocal(n.liftWorld):{x:0,y:0};return j({x:i.x-r.x,y:i.y-r.y},n.outline,n.holes)});return o?o.logicalId:null}pressLandsOnChart(e){if(this.sectionAt(e)||Ti(this.selectionMarkers,e))return!0;let i=this.screenToWorld(e);for(let o of this.gaById.values())if(j(i,o.points,[]))return!0;return this.owned.badgeAt(i)||this.clusterLabels.clusterAt(i)||this.nearestSeatToScreen(e,ge,!0)?!0:(this.stacked||this.floorOverview)&&this.deckFloorAt()!==null}sectionInteractive(e){let i=this.sections.filter(o=>o.id===e||o.logicalId===e||o.zone===e);return i.length?i.some(o=>!this.isSectionClosed(o)&&o.free>0?!0:o.memberIds.some(n=>this.selection.has(n)||this.ownedHold.has(n))):!0}sectionMembers(e){return[...new Set(this.sections.filter(i=>i.id===e||i.logicalId===e||i.zone===e).flatMap(i=>i.memberIds))]}isSelectable(e){return this.seatInClosedSection(e)||!(this.opts.selectableStatuses??["free"]).includes(this.statusById.get(e)??"free")?!1:!this.hiddenByAccessFilter(e)}hiddenByAccessFilter(e){if(!this.accessFilter||this.selection.has(e))return!1;let i=this.seatById.get(e);return i?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()>ee&&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?$i(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){let o=$i(getComputedStyle(i).backgroundColor);if(o)return o;i=i.parentElement}}return xo}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:X(this.canvasBackground)?Zs:st}setSelected(e,i,o=!1){let n=this.circleById.get(e);if(i){this.selection.add(e);let r=this.seatById.get(e);r&&this.selectedSeatById.set(e,r)}else this.selection.delete(e),this.selectedSeatById.delete(e),this.selectionFocusId===e&&this.setSelectionFocus(null),this.focusedId===e&&(this.focusedId=null,this.focusRing.visible(!1),this.overlayLayer.batchDraw());n&&(this.paintSeat(n,e),!o&&!this.cached&&this.seatLayer.batchDraw()),this.syncSelectionMarker(e)}syncSelectionMarker(e){this.moments.syncMarker(e,this.selection.has(e)||this.ownedHold.has(e),this.selectionMarkers),this.hasSections&&(this.owned.sync(this.effScale(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){return Ks({sections:this.sections,viewMode:this.viewMode,isoT:this.isoT,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,projectedSectionPoint:(i,o)=>this.projectedSectionPoint(i,o),isoLiftLocal:i=>this.isoLiftLocal(i),isoForward:i=>this.isoForward(i),renderedSeatPoint:i=>this.renderedSeatPoint(i),labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(i,o,n)=>this.resolveAutomaticRowLabelPosition(i,o,n),rowLabelBox:(i,o)=>this.rowLabelBox(i,o)},e)}sectionFrameScale(e){let i=this.sectionBounds(e);return i?Math.min(at(this.stage,i,this.zoomBounds(),Ft(this.framingViewport(),this.focusedRowLabelGutter(e))),Rt(this.zoomBounds(),this.diveCeiling())):this.stage.scaleX()}focusedRowLabelGutter(e){let i=0;for(let o of this.rowLabelPlan){if(!o.focusKeys?.includes(e))continue;let n=new Op({text:o.text,fontSize:vt,fontStyle:"700",fontFamily:this.labelFont()});i=Math.max(i,n.width(),n.height()),n.destroy()}return i>0?Math.ceil(i+Y+ie*2+6):0}deckFloorAt(){return ra(this.screenPickingHost)}nearestSeatToScreen(e,i,o=!1){return na(this.screenPickingHost,e,i,{includeUnavailable:o})}get screenPickingHost(){return{seats:this.seats,stage:this.stage,seatR:this.seatR,viewMode:this.viewMode,selection:this.selection,objectFloor:this.objectFloor,perspectiveSeatScale:this.perspectiveSeatScale,renderedSeatPoint:e=>this.renderedSeatPoint(e),screenToWorld:e=>this.screenToWorld(e),worldToScreen:e=>this.worldToScreen(e),isSelectable:e=>this.isSelectable(e)}}wireInteraction(){Xa(this.interactionHost)}handleSeatTap(e){Ya(this.interactionHost,e)}get interactionHost(){return this.interactionHostCache??={stage:this.stage,seatLayer:this.seatLayer,overlayLayer:this.overlayLayer,hoverRing:this.hoverRing,clusterLabels:this.clusterLabels,container:this.container,attachHoverCard:()=>this.hoverCard.attach(),moved:()=>this.moved,isGhostClick:e=>this.isGhostClick(e),cached:()=>this.cached,reducedMotion:()=>this.reducedMotion,stacked:()=>this.stacked,floorOverview:()=>this.separatedFloorOverview,viewMode:()=>this.viewMode,focusedSectionId:()=>this.focusedSectionId,sectionCount:()=>this.sections.length,selectionMarkers:()=>this.selectionMarkers,dismissFocusRing:()=>this.dismissFocusRing(),seat:e=>this.seatById.get(e),seatMark:e=>this.seatMarks.get(e),seatSection:e=>this.seatSection.get(e),objectFloor:e=>this.objectFloor.get(e),perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,setHoveredId:e=>{this.hoveredId=e},seatsPickable:()=>this.seatsPickable(),handleSeatTap:e=>this.handleSeatTap(e),seatStatus:e=>this.statusById.get(e)??"free",hasSeatMark:e=>this.seatMarks.has(e),isOwnedHold:e=>this.ownedHold.has(e),isSelected:e=>this.selection.has(e),isSelectable:e=>this.isSelectable(e),hiddenByAccessFilter:e=>this.hiddenByAccessFilter(e),seatInClosedSection:e=>this.seatInClosedSection(e),toggleSeat:e=>this.toggleSeat(e),nudgeSeat:e=>this.moments.nudge(e),renderedSeatPoint:e=>this.renderedSeatPoint(e),nearestSeatToScreen:(e,i,o)=>this.nearestSeatToScreen(e,i,o),sectionAt:e=>this.sectionAt(e),sectionInteractive:e=>this.sectionInteractive(e),sectionMatchesFocus:e=>this.sectionMatchesFocus(e),navigateGroupAt:e=>Us({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),ownedBadgeAt:e=>this.owned.badgeAt(e),focusOwnedSeats:e=>this.focusOwnedSeatsIn(e),pressLandsOnChart:e=>this.pressLandsOnChart(e),destroyed:()=>this.destroyed,deckFloorAt:()=>this.deckFloorAt(),screenToWorld:e=>this.screenToWorld(e),effScale:()=>this.effScale(),focusSeats:(e,i)=>this.focusSeats(e,i),focusSection:(e,i)=>this.focusSection(e,i),zoomAbout:(e,i,o)=>this.zoomAbout(e,i,o),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),onHover:this.opts.onHover,onSectionTap:(e,i)=>{if(this.rowBandPreview?.active&&e===this.focusedSectionId){let o=i?this.worldToScreen(i):_t(this.framingViewport());this.zoomAbout(Math.max(this.rowBandPreview.detailScale*1.08,this.stage.scaleX()*1.5),o)}else this.opts.onSectionTap?this.opts.onSectionTap(e,i):this.focusSection(e,{anchor:i})},onBackdropTap:this.opts.onBackdropTap,onDeckTap:this.opts.onDeckTap}}zoomBounds(){return Et(this.cameraHost)}zoomAbout(e,i,o="now"){this.rowBandPreview&&this.focusRoams&&this.viewMode==="flat"&&(this.rowBandZoomAnchor=i),tl(this.cameraHost,e,i,o)}cancelZoomSettle(){il(this.cameraHost)}focusRegion(e,i){ol(this.cameraHost,e,i)}applyLabelVisibility(e){let i=e!==this.labelsVisible;if(this.labelsVisible=e,!i||!e)return;if(this.labelFadeRaf&&(cancelAnimationFrame(this.labelFadeRaf),this.labelFadeRaf=0),this.reducedMotion){this.labelGroup.opacity(1);return}let o=performance.now();this.labelGroup.opacity(0);let n=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let s=Math.min(1,(r-o)/90);this.labelGroup.opacity(s),this.stage.batchDraw(),this.labelFadeRaf=s<1?requestAnimationFrame(n):0};this.labelFadeRaf=requestAnimationFrame(n)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){if(this.rowBandPreview?.active)return"sections";let e=this.effScale();return e>=te?"seats":this.zones.length&&e<He?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,viewMode:this.viewMode,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(e),isoLiftLocal:e=>this.isoLiftLocal(e),seats:this.seats,sections:this.sections,zones:this.zones,seatSection:this.seatSection,statusById:this.statusById,selection:this.selection,circleById:this.circleById,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,seatLabelRungOpen:()=>this.seatLabelRungOpen,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,freeTextById:this.freeTextById,gaById:this.gaById,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,seatR:this.seatR,canvasBackground:this.canvasBackground,effSelection:this.effSelection,categoryFilter:this.categoryFilter,focusedSectionId:this.focusedSectionId,focusBackdrop:this.focusBackdrop,isSelectable:e=>this.isSelectable(e),seatViewportCulled:e=>this.seatViewportCulled(e),focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),Ml(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let i=e==="sections"?(ye+te)/2:Math.max(this.rowBandPreview?.active?this.rowBandPreview.detailScale*1.08:0,this.seatRungScale()),o=this.framingViewport(),n=o.width,r=o.height,s=_t(this.framingWorldRect()),a=s.x,l=s.y;if(e==="sections"&&this.sections.length>0){let u=this.sections.map(p=>{let y=z(p.outline);return{x:y.x+y.width/2,y:y.y+y.height/2}}),f=n/(i*2),m=r/(i*2);if(!u.some(p=>Math.abs(p.x-s.x)<=f&&Math.abs(p.y-s.y)<=m)){let p=u.reduce((y,b)=>{let S=(b.x-s.x)**2+(b.y-s.y)**2;return S<y.distance?{point:b,distance:S}:y},{point:u[0],distance:1/0});a=p.point.x,l=p.point.y}}let c=e==="seats"?this.seats.filter(u=>u.kind!=="booth"):[];if(c.length>0){let u=c[0],f=1/0;for(let m of c){let g=m.x-s.x,p=m.y-s.y,y=g*g+p*p;y<f&&(u=m,f=y)}a=u.x,l=u.y}let d=n/(i*1.12),h=r/(i*1.12);this.focusRegion({x:a-d/2,y:l-h/2,width:d,height:h})}seatRungScale(){return fl(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,i,o,n=0){let r=Ft(this.framingViewport(),n);return gl({stageWidth:r.width,stageHeight:r.height,fullBounds:i,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}seatLabelTargetScale(){return nl({seats:this.seats,seatR:this.seatR,labelFont:()=>this.labelFont(),seatLabelScale:e=>this.seatLabelScale(e)})}releaseFocusOnPullBack(){this.rowBandPreview&&this.viewMode==="flat"&&this.focusedSectionId&&this.effScale()>=Math.min(te,this.sectionFrameScale(this.focusedSectionId)*.85)||Ua({focusedSectionId:this.focusedSectionId,roaming:this.focusRoams,floorOverview:this.separatedFloorOverview,effScale:this.effScale()})&&(this.clearSectionFocus(),this.opts.onFocusedSectionChange?.(null))}afterViewChange(){this.releaseFocusOnPullBack(),this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.cancelZoomSettle(),this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){let e=this.rowBandZoomAnchor;if(this.rowBandZoomAnchor=null,!this.focusRoams||this.separatedFloorOverview)return;let i=!!this.rowBandPreview&&this.viewMode==="flat"&&!this.exportMode;if(!this.focusedSectionId&&(!i||this.effScale()<te))return;let n=(i&&e?this.sectionAt(e):null)??zs({sections:this.sections.map(r=>({logicalId:r.logicalId,members:r.memberIds.length,bounds:this.sectionScreenBounds(r)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!n||n===this.focusedSectionId||(this.focusedSectionId=n,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(n))}scheduleViewChange(){this.exportMode||(this.refreshLabelsWhileMoving(),!this.viewChangeRaf&&(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()})))}refreshLabelsWhileMoving(){this.movingLabelTimer||!this.seats.length||this.effScale()<=ee||(this.movingLabelTimer=setTimeout(()=>{this.movingLabelTimer=null,!(this.destroyed||this.exportMode)&&this.updateLabels()},cr))}sizeLabel(e,i,o){e.fontSize(Math.max(1,i)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(o)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),Le+.01,ee):this.effScale(),i=Math.max(e,1e-4);for(let[r,s]of this.primaryFocalLabels)Nl(r,s,i,(a,l)=>{this.sizeLabel(a,l,a.y())},this.fitScale);this.hasSections?(ka(this.sectionLodPaintContext,e),this.rowBandPreview?.sync(this.chartDoc,this.sections,this.focusedSectionId,e,this.seatR,this.seatById,this.circleById,!this.exportMode&&this.viewMode==="flat"&&e>=Math.min(te,this.focusedSectionId?this.sectionFrameScale(this.focusedSectionId)*.85:te),()=>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),this.seatGlyphDetail=ia(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail);let o=!this.exportMode&&!this.rowBandPreview?.active&&e<te;if(this.rowBandPreview?.active&&this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null),this.viewMode==="perspective"&&this.hasSections&&this.seats.length>2500&&o){this.seatLayer.listening(!1);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.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(){Wl(_i,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()<te?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){this.cancelSeatReveal(!0);let e=this.assets.generation,i=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assets.pending(),...i?[i.ready.then(()=>{}),i.load("700 24px Inter").then(()=>{}),i.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assets.generation)throw new Error("The chart changed while its export assets were loading.");if(this.assets.failures.length)throw new Error(`Export stopped because ${this.assets.failures.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(s=>s.getClientRect({relativeTo:this.stage})).filter(s=>s.width>0&&s.height>0);if(!e.length)return this.bounds;let i=Math.min(...e.map(s=>s.x)),o=Math.min(...e.map(s=>s.y)),n=Math.max(...e.map(s=>s.x+s.width)),r=Math.max(...e.map(s=>s.y+s.height));return{x:i,y:o,width:Math.max(1,n-i),height:Math.max(1,r-o)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),i=this.stage.height(),o=Math.max(12,Math.min(36,Math.min(e,i)*.025)),n=()=>{let r=this.exportSceneBounds(),s=Math.max(1,e-o*2),a=Math.max(1,i-o*2),l=Math.min(s/r.width,a/r.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-r.width*l)/2-r.x*l,y:(i-r.height*l)/2-r.y*l}),this.afterViewChange()};n(),n()}captureCanvas(){if(!this.exportMode)throw new Error("captureCanvas() is available only on a renderer created with exportMode.");this.forceDraw();let e;try{e=this.stage.toCanvas({pixelRatio:1,imageSmoothingEnabled:!0})}catch(n){let r=n instanceof Error?n.message:String(n);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${r}`)}let i=document.createElement("canvas");i.width=this.stage.width(),i.height=this.stage.height();let o=i.getContext("2d");if(!o)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");o.fillStyle=this.canvasBackground,o.fillRect(0,0,i.width,i.height);try{o.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ee):this.effScale();for(let{node:i,backdrop:o,kind:n,showAt:r}of this.freeTextById.values()){if(n==="ga-label"||n==="ga-capacity")continue;let s=n==="free-text"&&this.nodeBelongsToFocusedSection(i),a=n==="direct-landmark";if(a){let d=Number(i.getAttr("directLandmarkBaseFontSize"))||i.fontSize();i.setAttr("directLandmarkBaseFontSize",d),i.fontSize(Math.max(d,Y/e))}let l=r==="detail"&&!this.exportMode&&e<ye,c=a||s||!l&&me(i.fontSize(),e);if(i.visible(c),o?.visible(c),!this.exportMode&&n==="free-text"){let d=Math.min(1,Nr/Math.max(i.fontSize()*e,1e-6));i.scale({x:d,y:d}),o?.scale({x:d,y:d})}}for(let{node:i,fontSize:o}of this.iconNodeById.values())i.visible(this.nodeBelongsToFocusedSection(i)||me(o,e))}nodeBelongsToFocusedSection(e){let i=this.focusedSectionId;if(!i)return!1;this.focusMembershipKey!==i&&(this.focusMembership.clear(),this.focusMembershipKey=i);let o=this.focusMembership.get(e);if(o!==void 0)return o;let n=this.sections.filter(s=>s.id===i||s.logicalId===i||s.zone===i),r=!1;if(n.length){let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),a={x:s.x+s.width/2,y:s.y+s.height/2};r=n.some(l=>j(a,l.outline,l.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.rowLabelPlan=Gl(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,o=ie){return Yo(e,i,o)}resolveAutomaticRowLabelPosition(e,i,o){return Vl(e,i,o,this.seatIndex)}objectFilteredOut(e){let i=e.categoryKey;return i?!!(this.categoryHighlight&&i!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(i)):!1}updateLabels(){Ja(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,fitScale:()=>this.fitScale,focusedFrameScale:()=>this.focusedFrameScaleForBounds(),otherSectionCount:()=>this.sections.filter(e=>e.id!==this.focusedSectionId&&e.logicalId!==this.focusedSectionId).length,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),labelGroup:this.labelGroup,rowLabelGroup:this.rowLabelGroup,seatLabelPool:this.seatLabelPool,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,setSeatLabelRungOpen:e=>{this.seatLabelRungOpen=e},visibleSeatCandidates:()=>this.visibleSeatCandidates(),worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,renderedSeatPoint:e=>this.renderedSeatPoint(e),viewMode:this.viewMode,perspectiveSeatScale:this.perspectiveSeatScale,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),hasSelectionMarker:e=>this.selection.has(e)||this.ownedHold.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,i,o)=>this.resolveAutomaticRowLabelPosition(e,i,o),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),isoT:this.isoT,applyUprightLabels:()=>this.applyUprightLabels(),overlayLayer:this.overlayLayer}}handleResize(){this.gestures.invalidateRect();let e=Il({width:this.container.clientWidth,height:this.container.clientHeight,stageWidth:this.stage.width(),stageHeight:this.stage.height()});if(e==="hidden"){this.hiddenPose??=this.getCameraPose();return}let i=this.hiddenPose;if(this.hiddenPose=null,e==="unchanged"){i&&this.setCameraPose(i);return}let o={width:this.stage.width(),height:this.stage.height()};this.stage.size(e),i&&this.setCameraPose(i);let r=!(this.fitPose===""||Xe(this.stage)===this.fitPose)&&e.width===o.width;r&&this.stage.position({x:this.stage.x()+(e.width-o.width)/2,y:this.stage.y()+(e.height-o.height)/2}),this.refitCurrentView(r)}};Vt.ZOOM_STEP=1.4;var Jo=Vt;function mc(t,e){return new Jo(t,e)}function gc(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 en(t,e){let i=t.renderer;if(!i?.focusAccessibleSeats)return!1;let o=e===void 0?t.accessFilter:e;if(!o)return!1;let n=vc(t,o);n&&t.setFloor(n);let r=i.focusAccessibleSeats(o);return r&&t.emitSectionFocus(null),r}function yc(t,e){let i=t.renderer;if(!i?.accessibleSpread)return null;let o=e===void 0?t.accessFilter:e;return o?i.accessibleSpread(o):null}function bc(t,e,i,o){let n=t.renderer;n&&(t.accessFilter&&(i?.accessibleLeft??0)>0&&n.focusAccessibleSection?.(e,t.accessFilter)||(n.focusSection?n.focusSection(e,o?{anchor:o}:void 0):n.focusRegion?.(e)))}function Sc(t,e){let i=e===void 0?t.accessFilter:e;if(!i)return null;let o=vc(t,i);o&&t.setFloor(o);let n=t.renderer,r=n?.accessibleSections?.(i)??[];if(!r.length)return null;let s=t.accessStepAt?r.findIndex(l=>l.id===t.accessStepAt):-1,a=r[(s+1)%r.length];return t.accessStepAt=a.id,n?.focusAccessibleSection?.(a.id,i)||n?.focusSection?.(a.id),t.emitSectionFocus(t.sectionSummary(a.id)),{...a,index:r.indexOf(a),total:r.length}}function vc(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let o=new Set(e),n=l=>o.size===0?!!l.accessible:!!l.accessibility?.some(c=>o.has(c)),r=l=>l.some(c=>c.type==="row"&&(c.overrides??[]).some(n)),s=t.getActiveFloorId(),a=i.floors.find(l=>l.id===s);return a&&r(a.objects)?null:i.floors.find(l=>r(l.objects))?.id??null}function wc(t,e){return t.accessFilter?Pe(e,t.accessFilter)==="other":!1}function kc(t,e){let i=t.renderer;if(!i)return;let o=i.getFocusedSection?.()??null;if(i.clearSectionFocus?.(),e?.length){t.emitSectionFocus(null),t.bandReturnPose||(t.bandReturnPose=i.getCameraPose?.()??null,t.bandReturnSection=t.bandReturnPose?o:null);let r=Hp(t,e);r&&t.setFloor(r),i.focusCategories?i.focusCategories(e):i.zoomToFit();return}let n=t.bandReturnPose!=null;t.bandReturnPose=null,t.bandReturnSection=null,!(t.accessFilter&&en(t))&&(i.clearSectionFocus?.(),t.emitSectionFocus(null),n&&i.zoomToFit())}function Hp(t,e){let i=t.doc;if(!i?.floors||i.floors.length<2)return null;let o=new Set(e),n=a=>a.some(l=>l.type==="row"&&(o.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||l.type==="gaArea"&&o.has(l.categoryKey)),r=t.getActiveFloorId(),s=i.floors.find(a=>a.id===r);return s&&n(s.objects)?null:i.floors.find(a=>n(a.objects))?.id??null}function Lc(t,e,i){let o=new Map,n=new Map,r=new Map,s=new Map,a=[],l=new Map(yn(t).map(h=>[h.id,h])),c=qt(t),d=new Map(c.sections.map(h=>[h.id,h.label]));for(let h of e){o.set(h.label,h.id),n.set(h.label,h),r.set(h.id,h),a.push(h.id);let u=l.get(h.rowId),f=u&&"label"in u&&typeof u.label=="string"?u.label:void 0,m=u?.type==="row"?u.segmentedRow:void 0,g=m?.displayLabel??(u&&"displayLabel"in u&&typeof u.displayLabel=="string"&&u.displayLabel?u.displayLabel:f),p=i.get(h.rowId),y=u?.type==="table"?"table":u?.type==="booth"?"booth":"seat",b=g,S=m?.displayType?.trim()||(u&&"displayType"in u&&typeof u.displayType=="string"&&u.displayType.trim()?u.displayType.trim():void 0),w=h.displayLabel??h.label,k=w.split("-"),v=p||h.kind==="booth"?void 0:g&&w.startsWith(`${g}-`)?w.slice(g.length+1):k[k.length-1]??w;s.set(h.id,{objectId:h.rowId,objectType:y,sectionLabel:d.get(c.objectToSection.get(h.rowId)??""),rowLabel:b,seatNumber:v,...S?{displayType:S,rowType:S}:{}})}return{labelToId:o,labelToSeat:n,seatById:r,seatContext:s,allIds:a}}function xc(t,e={}){let{baseMs:i=1e3,factor:o=2,maxMs:n=1/0,jitter:r=0,random:s=Math.random}=e,a=Math.min(i*o**Math.max(0,t),n);if(r<=0)return a;let l=Math.min(1,r);return a*(1-l+l*s())}function Cc(t,e,i){return gt(t).map(o=>{let n=t.categories.find(r=>r.key===o.categoryKey);return{id:o.id,label:o.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},capacity:Math.max(0,Math.floor(o.capacity)),available:$t(o).filter(r=>i(r)==="free").length,categoryKey:o.categoryKey,tiers:n?.tiers,price:n?.tiers?.[0]?.price??n?.price??0,currency:e}})}function Pc(t,e){let i={};for(let o of t)i[o.id]=e?{available:o.available,selected:e.get(o.id)??0}:{available:o.available};return i}function Ic(t){let e={};for(let[i,o]of t.seatById)t.groupedTableBySeatId.has(i)||t.closedMembers.has(i)||(t.statusOf(i)??"free")==="free"&&(e[o.categoryKey]=(e[o.categoryKey]??0)+1);for(let i of t.groupedTablesByLabel.values()){if(i.chairs.some(n=>t.closedMembers.has(n.id)))continue;let o=i.chairs[0];o&&(t.statusOf(o.id)??"free")==="free"&&(e[i.categoryKey]=(e[i.categoryKey]??0)+i.maxOccupancy)}for(let i of t.gaAreas??[])e[i.categoryKey]=(e[i.categoryKey]??0)+i.available;return e}function Gp(t){return t.accessibility?.length?t.accessibility:t.accessible?["wheelchair"]:[]}function Tc(t,e){let i=new Set,o=new Map;for(let n of t){let r=Gp(n);if(!r.length)continue;let s=e(n.id)==="free";for(let a of r)i.add(a),s&&o.set(a,(o.get(a)??0)+1)}return i.size?Kt.filter(n=>i.has(n.key)).map(n=>({key:n.key,count:o.get(n.key)??0})):[]}var k0=5e3,L0={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function Vp(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 Mc(t){let e=new Set(t.holdLabels),i=t.selection.filter(n=>!e.has(n)&&t.statusOf(n)!=="free");if(!Vp(t))return{lost:i,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let o=[...t.holdLabels];return{lost:i,holdLapsed:!0,lapsedLabels:o,recoverable:o.filter(n=>t.statusOf(n)==="free")}}function x0(t){return t.lost.length>0||t.holdLapsed}function C0(t){return!t.lapsedLabels.length||!t.recoverable.length?"none":t.recoverable.length===t.lapsedLabels.length?"all":"partial"}function Rc(t,e,i=Date.now()){return e&&i<t+5e3}function Ac(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 Ec(t){if(!t?.zones?.length)return[];let e=new Set(qt(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 Fc(t){let e=t.doc;if(!e?.objects?.length)return null;let i=e.focalPoint??{x:0,y:0},o=Oe(e).filter(s=>!t.groupedObjectIds.has(s.rowId)),n=new Set;for(let s of o)t.heldLabels.has(s.label)||t.tierApplies(s)&&(t.accessFilter&&!Ce(s,t.accessFilter)||t.statusOfLabel(s.label)==="free"&&n.add(s.label));let r=jn(o,n,{qty:t.qty,categoryKey:t.categoryKey,zoneId:t.zoneId,focal:i,preferPremium:!0});return r.labels.length!==t.qty?null:r.labels.every(s=>t.isPremium(s))?[...r.labels]:null}var tn=["background","rowLabelColor","textColor","selectionColor"];function _c(t,e){return!t||!e?!t&&!e:tn.every(i=>t[i]===e[i])}function ht(t){let e=t??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function Bi(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function Bc(t,e,i){let o=Cn(e,i);o==="all"?t.setFloorOverview?.(!0):o&&t.setActiveFloor?.(o)}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 Oc(t,e){return!e||t.eventConfigurationId===e.id&&t.eventConfigurationVersion===e.version?t:{...t,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var Oi=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,i){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let o=this.ref;this.pending=e.eventConfiguration(i).then(n=>{if(n.reference.id!==o.id||n.reference.version!==o.version||n.configuration.id!==o.id||n.configuration.version!==o.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return n.configuration})}return this.pending}};async function Dc(t,e,i){if(!t.renderer)return null;let n=e??t.getSelection().map(l=>l.label),r=t.hold_?.items??[],s=[...new Set([...r.map(l=>l.label),...n])];if(!s.length)return null;let a=t.ticketIssue(s);if(a)throw new Me(a);if(t.hold_&&t.holdCovers(s))return t.hold_;try{let l=s.map(d=>{let h=r.find(m=>m.label===d);if(h&&(h.objectType==="ga"||h.quantity!=null||h.tierId!=null))return{label:d,tierId:h.tierId,...h.quantity!=null?{quantity:h.quantity}:{}};let u=t.labelToSeat.get(d),f=u?t.toSeat(u):null;return{label:d,...f?.tierId?{tierId:f.tierId}:{},...t.tableQuantityRequest(f)}}),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 Nc(t,e){if(t.closed||!e||!t.api.resume)return null;let i=await t.api.resume(t.key,e);if(t.closed)return null;let o=[...new Set(i.items.map(n=>n.label))];return o.length?(t.setHold({holdId:i.holdId,labels:o,expiresAt:i.expiresAt,items:i.items},"restored"),t.hold_):null}async function Hc(t,e){let i=t.hold_;if(!i||!t.api.extend)return null;try{let o=await t.api.extend(t.key,i.holdId,e);return t.hold_?.holdId!==i.holdId||t.setHold({holdId:i.holdId,labels:i.labels,expiresAt:o.expiresAt,items:i.items}),t.hold_}catch{return null}}async function Gc(t,e,i,o){let n=t.renderer;if(!n)return null;if(!t.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let r=i??t.getSelection().map(c=>c.label);if(!r.length)return null;let s=t.ticketIssue(r);if(s)throw new 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(h=>{let u=t.labelToSeat.get(h),f=u?t.toSeat(u):null;return{label:h,...f?.tierId?{tierId:f.tierId}:{},...t.tableQuantityRequest(f)}}),o,c);a=d.holdId,t.setHold({holdId:a,labels:[...r],expiresAt:d.expiresAt,items:d.items})}await t.api.book(t.key,r,a,e)}catch(c){let{status:d,conflicts:h,reason:u}=ht(c);if(t.clearHold(),d===409&&u==="event_closed")t.opts.onSalesClosed?.();else if(d===409&&h?.length){let f=new Set(h.map(p=>p.label)),m=t.idsForLabels(f);m.length&&(n.setStatus(m,"booked"),n.deselect(m),t.resetTableQuantitiesForLabels(f));let g=r.filter(p=>!f.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&&(n.setStatus(l,"booked"),n.deselect(l)),t.clearHold(),t.resetTableQuantitiesForLabels(r),t.emitSelectionChange(),t.opts.onBook?.(e),r}async function Vc(t){let e=t.hold_;if(!e)return!0;try{let o=await t.api.release(t.key,e.labels,e.holdId);if(!t.releaseConfirmed(o,e.labels))return await t.resnapshot(),!1}catch(o){return t.emitError(o),!1}if(t.hold_?.holdId!==e.holdId)return!0;t.clearHold(),t.resetTableQuantitiesForLabels(e.labels);let i=t.idsForLabels(e.labels);return i.length&&(t.renderer?.deselect(i),t.renderer?.setStatus(i,"free")),!0}async function Wc(t,e){let i=t.hold_;if(!i)return!0;let o=e.filter(a=>i.labels.includes(a));if(!o.length)return!0;try{let a=await t.api.release(t.key,o,i.holdId);if(!t.releaseConfirmed(a,o))return await t.resnapshot(),!1}catch(a){return t.emitError(a),!1}if(t.hold_?.holdId!==i.holdId)return!0;let n=i.labels.filter(a=>!o.includes(a)),r=i.items?.filter(a=>!o.includes(a.label));n.length?t.setHold({...i,labels:n,items:r}):t.clearHold(),t.resetTableQuantitiesForLabels(o);let s=t.idsForLabels(o);return s.length&&(t.renderer?.deselect(s),t.renderer?.setStatus(s,"free")),!0}function zc(t,e){let i=t?.released;return!Array.isArray(i)||e.every(o=>i.includes(o))}function Kc(t,e){let i=t.hold_;if(!i||i.labels.length!==e.length||!e.every(r=>i.labels.includes(r)))return!1;let o=new Map((i.items??[]).map(r=>[r.label,r.tierId])),n=new Map((i.items??[]).map(r=>[r.label,r.quantity??1]));return e.every(r=>{let s=t.labelToSeat.get(r),a=s?t.toSeat(s):null,l=a?.tierId??null;return(a?.objectType!=="table"||(a.bookingMode!=="variable"||t.confirmedVariableTables.has(r))&&(!n.has(r)||n.get(r)===a.quantity))&&(!o.has(r)||o.get(r)===l)})}function Xc(t,e){let{status:i,conflicts:o}=ht(e);if(i!==409||!o?.length)return;let n=t.renderer;if(!n)return;let r=t.idsForLabels(o.map(s=>s.label));r.length&&(n.deselect(r),n.setStatus(r,"held"),t.resetTableQuantitiesForLabels(o.map(s=>s.label))),t.emitSelectionChange()}function Yc(t,e,i="created"){for(let r of e.items??[])t.groupedTablesByLabel.has(r.label)&&r.quantity!=null&&(t.tableQuantities.set(r.label,r.quantity),t.groupedTablesByLabel.get(r.label)?.mode==="variable"&&t.confirmedVariableTables.add(r.label));let o={...e,seats:t.seatsForLabels(e.labels)};t.hold_=o,t.renderer?.setOwnedHold?.(t.idsForLabels(o.labels)),t.expiryTimer&&clearTimeout(t.expiryTimer);let n=Math.max(0,o.expiresAt-Date.now());t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},n),i==="restored"?t.opts.onHoldRestored?.(o):t.opts.onHold?.(o)}function Uc(t){t.hold_=null,t.renderer?.setOwnedHold?.(null),t.expiryTimer&&(clearTimeout(t.expiryTimer),t.expiryTimer=null)}async function $c(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(Rc(e.expiresAt,e.labels.some(i=>t.statusOf(i)==="held"))){t.expiryTimer=setTimeout(()=>{t.expireActiveHold()},1e3);return}t.clearHold(),t.opts.onHoldExpired?.()}}}function qc(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t??null}function Zc(t,e,i,o){if(i!=null&&!Array.isArray(i))throw new TypeError("picker: `selectionValidators` must be an array");let n=[],r=0,s=!1,a=!1;for(let c of i??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");r=Math.max(r,Number(c.minimum))}else if(c?.type==="consecutiveSeats")s=!0;else if(c?.type==="noOrphanSeats")a=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(r&&n.push({type:"minimumSelectedPlaces",minimum:r}),s&&n.push({type:"consecutiveSeats"}),a&&n.push({type:"noOrphanSeats"}),t!=null&&r>t)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let l=Math.max(0,Math.floor(e??t??Math.max(o,r)));if(t!=null&&l<t)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&l<r)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:n,maxSelection:t??l}}function zp(t){let e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Kp(t){if(t.length<=1)return!1;let e=t[0]?.objectId,i=t[0]?.categoryKey;if(!e||t.some(n=>n.objectId!==e||n.categoryKey!==i))return!0;let o=t.map(n=>zp(n.id)).sort((n,r)=>n-r);return o.some((n,r)=>n<0||r>0&&n!==o[r-1]+1)}function jc(t,e,i,o,n){let r=o.find(l=>l.type==="minimumSelectedPlaces")?.minimum??0,s=i??r,a=[];return i!=null&&e!==i&&a.push("numberOfPlacesToSelect"),r&&e<r&&a.push("minimumSelectedPlaces"),o.some(l=>l.type==="consecutiveSeats")&&Kp(t)&&a.push("consecutiveSeats"),o.some(l=>l.type==="noOrphanSeats")&&n()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:s,remaining:Math.max(0,s-e),seats:t,violations:a}}function Qc(t){let{id:e,doc:i,seatById:o,groupedTableBySeatId:n}=t,r=v=>v.type==="section"&&(v.id===e||v.logicalSectionId===e),s=i.floors?.find(v=>v.objects.some(r)),a=(s?.objects??i.objects).find(r);if(!a)return null;let l=t.sectionMembers(e),c=new Map,d=new Map,h=new Set,u=0,f=0;for(let v of l){let L=o.get(v);if(!L)continue;t.matchesAccessFilter&&t.statusOf(v)==="free"&&t.matchesAccessFilter(L)&&(f+=1);let P=n.get(v);if(P){if(h.has(P.label))continue;h.add(P.label),c.set(P.categoryKey,(c.get(P.categoryKey)??0)+P.maxOccupancy),t.statusOf(P.chairs[0]?.id??v)==="free"&&(u+=P.maxOccupancy,d.set(P.categoryKey,(d.get(P.categoryKey)??0)+P.maxOccupancy))}else c.set(L.categoryKey,(c.get(L.categoryKey)??0)+1),t.statusOf(v)==="free"&&(u++,d.set(L.categoryKey,(d.get(L.categoryKey)??0)+1))}let m=[...c.entries()].map(([v,L])=>{let P=i.categories.find(T=>T.key===v),I=P?.tiers?.map(T=>T.price).filter(Number.isFinite)??[],M=I.length?I:typeof P?.price=="number"&&Number.isFinite(P.price)?[P.price]:[],x=M.length?Math.min(...M):void 0,C=M.length?Math.max(...M):void 0;return{key:v,count:L,label:P?.label??v,color:P?.color??"#6e7bff",...x!==void 0?{price:x,priceMin:x,priceMax:C}:{}}}).sort((v,L)=>(v.priceMin??1/0)-(L.priceMin??1/0)||v.key.localeCompare(L.key)),g=m.flatMap(v=>v.priceMin===void 0?[]:[v.priceMin]),p=m.flatMap(v=>v.priceMax===void 0?[]:[v.priceMax]),y=a.zone?i.zones?.find(v=>v.id===a.zone):void 0,b=v=>{let L=null,P=0;for(let[I,M]of v)(M>P||M===P&&L!=null&&I<L)&&(L=I,P=M);return L},S=b(d)??b(c),k=(S?m.find(v=>v.key===S)?.color:void 0)??y?.color??a.color??"#6e7bff";return{id:e,...S?{dominantCategoryKey:S}:{},...t.matchesAccessFilter?{accessibleLeft:f}:{},label:a.displayLabel??a.label,zoneLabel:y?.label??"",...s?{floorLabel:s.name}:{},...a.entrance&&a.entrance.trim()?{entrance:a.entrance.trim()}:{},color:k,seatsLeft:u,...g.length?{priceMin:Math.min(...g),priceMax:Math.max(...p)}:{},categories:m}}var Di=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,i=!1){if(!i){if(this.inFlight)return this.inFlight;if(this.now()-this.lastSettledAt<this.windowMs)return Promise.resolve()}let o=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===o&&(this.inFlight=null)});return this.inFlight=o,o}markSettled(){this.lastSettledAt=this.now()}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};function Jc(t,e){return t?.source==="socket"&&e.source==="http"?t:e}function ed(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 $p=!0,qp=!0,Zp=10,jp=15e3,td=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new Oi;this.hidden=new Set;this.mapTheme=null;this.closedSections=new Set;this.labelToId=new Map;this.labelToSeat=new Map;this.expandedSeats=[];this.seatTiers=new Map;this.seatById=new Map;this.seatContext=new Map;this.allIds=[];this.groupedTablesByObject=new Map;this.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.connectFallback=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.detachVisibility=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.snapshots=new Di;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=qc(e.numberOfPlacesToSelect);let i=Zc(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Zp);this.selectionValidators=i.validators,this.maxSelection=i.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(o=>typeof o=="string"&&!!o))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=Tn(this._doc,this.hidden);if(!this.mapTheme)return e;let i={...e.theme??{}};for(let o of tn){let n=this.mapTheme[o];n&&(i[o]=n)}return{...e,theme:i}}setMapTheme(e){return _c(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let i=e.getSelection().map(a=>a.id),o=this.getActiveFloorId(),n=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,s=e.getCameraPose?.();return e.setChart(this.visibleDoc(),o?{floorId:o}:void 0),this.applyRowBandPreview(e),n&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),i.length&&e.select?.(i),r&&e.focusSection?.(r),s&&e.setCameraPose&&e.setCameraPose(s),e.settleView?.(),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let i=e.filter(n=>typeof n=="string");if(i.length===this.hidden.size&&i.every(n=>this.hidden.has(n)))return!1;this.hidden=new Set(i);let o=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),this.renderer&&this.applyRowBandPreview(this.renderer),o&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let i=(e??[]).filter(o=>typeof o=="string");return i.length===this.closedSections.size&&i.every(o=>this.closedSections.has(o))?!1:(this.closedSections=new Set(i),this.renderer?.setClosedSections?.(i),!0)}isSectionClosed(e){return this.closedSections.has(e)}currentHold(){return this.hold_}getRenderer(){return this.renderer}seatByLabel(e){return this.labelToSeat.get(e)}getExpandedSeats(){return this.expandedSeats}loadEventConfiguration(){return this.eventConfiguration.load(this.api,this.key)}idForLabel(e){return this.labelToId.get(e)}idsForLabel(e){let i=this.groupedTablesByLabel.get(e);if(i)return i.chairs.map(n=>n.id);let o=this.labelToId.get(e);return o?[o]:[]}idsForLabels(e){return[...new Set([...e].flatMap(i=>this.idsForLabel(i)))]}tableSelection(e){let i=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return i?this.toTableSeat(i):null}lineItemDisplay(e){if(e.objectType==="ga"){let n=this.visibleDoc(),r=gt(n).find(s=>s.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}if(e.objectType==="table"){let n=this.groupedTablesByLabel.get(e.label);return{...n?.displayLabel&&n.displayLabel!==n.label?{displayLabel:n.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}let i=this.labelToSeat.get(e.label),o=i?this.seatContext.get(i.id):void 0;return{...i?.displayLabel?{displayLabel:i.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}async render(e){if(this.renderer)return null;let i=performance.now(),o={},n=x=>Math.round((performance.now()-x)*100)/100;this.closed=!1;let r=performance.now(),s=(async()=>this.api.chart(this.key))().then(x=>({ok:!0,res:x,elapsed:n(r)}),x=>({ok:!1,error:x,elapsed:n(r)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(x=>({ok:!0,objects:x,elapsed:n(a)}),()=>({ok:!1,elapsed:n(a)})),c=await s;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=Oc(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let h=performance.now();try{let x=Qn(d.doc,d.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(x.map(C=>[C.objectId,C])),this.groupedTablesByLabel=new Map(x.map(C=>[C.label,C])),this.groupedTableBySeatId=new Map(x.flatMap(C=>C.chairs.map(T=>[T.id,C]))),this.tableQuantities=new Map(x.map(C=>[C.label,C.mode==="whole"?C.capacity:C.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=x.reduce((C,T)=>C+Math.max(0,T.chairs.length-1),0)}catch(x){return this.emitError(x),null}this.expandedSeats=Oe(d.doc,{deriveRestrictedView:d.doc.derivedRestrictedView===!0});let u=Lc(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=u.labelToId,this.labelToSeat=u.labelToSeat,this.seatById=u.seatById,this.seatContext=u.seatContext,this.allIds=u.allIds;for(let x of this.groupedTablesByLabel.values()){let C=x.chairs[0];C&&(this.labelToId.set(x.label,C.id),this.labelToSeat.set(x.label,C))}o.normalizeBuyerModel=n(h);let f=d.event.currency??this.opts.currency;this.currency=f??"USD";let m=performance.now(),g=mc(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:f,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=n(i),this.opts.onSeatsRevealed?.()},onSelect:x=>{this.handleRendererSelect(x)},onDeselect:x=>{this.handleRendererDeselect(x)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(x,C)=>{this.opts.onHover?.(x),this.opts.onSeatHover&&this.opts.onSeatHover(x?this.describeSeat(x,C):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(x,C)=>this.previewSection(x,C),onBackdropTap:()=>this.overview(),hostCardOpen:()=>this.opts.hostCardOpen?.()??!1,onFocusedSectionChange:x=>this.opts.onSectionFocus?.(x==null||this.isSectionClosed(x)?null:this.sectionSummary(x)),onDeckTap:x=>this.handleDeckTap(x),onFps:this.opts.onFps});if(o.createRenderer=n(m),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,y="free",b=[],S,w=await l;if(w.ok){let x=w.objects;this.hidden=new Set(x.hidden??[]),b=(x.closed??[]).filter(C=>typeof C=="string"),p=x.seats,y=x.default??"free",S=typeof x.fetchedAt=="number"?x.fetchedAt:void 0}if(o.loadStatuses=w.elapsed,this.closed)return g.destroy(),this.renderer=null,null;let k=performance.now();this.opts.categoryPriceRanges&&g.setCategoryPriceRanges?.(this.opts.categoryPriceRanges()),g.setChart(this.visibleDoc()),this.applyRowBandPreview(g),Bc(g,d.doc,e.clientWidth),this.opts.colorblindSafe&&g.setColorblindSafe?.(!0),o.buildScene=n(k),this.closedSections=new Set(b);let v=performance.now();b.length&&g.setClosedSections?.(b),this.seatsBuilt=!0;let L=this.pendingSnapshot;this.pendingSnapshot=null;let P=ed(L,p?{seats:p,default:y,fetchedAt:S}:null);P&&this.applySeatsMap(P.seats,P.default,P.source,P.fetchedAt),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=n(v);let I=performance.now();g.forceDraw(),o.firstPaint=n(I);let M=performance.now();return w.ok&&(S===void 0||Date.now()-S<250)&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),o.startRealtime=n(M),o.controllerTotal=n(i),{doc:d.doc,salesClosed:!!d.event.salesClosed,eventName:d.event.name,venue:d.event.venue,startsAt:d.event.startsAt,timezone:d.event.timezone??null,currency:f,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],i=new Set;for(let o of this.renderer.getSelection()){let n=this.groupedTableBySeatId.get(o.id);n?i.has(n.label)||(i.add(n.label),e.push(this.toTableSeat(n))):e.push(this.toSeat(o))}return e}seatDetails(e){let i=this.seatById.get(e);return i?this.describeSeat(i):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let i=new Set;for(let o of e){let n=this.groupedTableBySeatId.get(o)??this.groupedTablesByLabel.get(o);if(n)n.chairs.forEach(r=>i.add(r.id)),this.hold_?.labels.includes(n.label)||(this.tableQuantities.set(n.label,n.mode==="whole"?n.capacity:n.minOccupancy),n.mode==="variable"&&this.confirmedVariableTables.delete(n.label));else{let r=this.seatById.has(o)?o:this.labelToId.get(o);r&&i.add(r)}}this.renderer?.deselect([...i]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let i=new Set(this.getSelection().map(s=>s.label)),o=new Set,n=[];for(let s of e){let a=this.groupedTableBySeatId.get(s)??this.groupedTablesByLabel.get(s);if(a)this.tableTierResolution(a).kind==="invalid"?n.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let l=this.seatById.has(s)?s:this.labelToId.get(s);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?n.push(c.label):o.add(l)}}if(n.length&&this.emitError(new Me(eo(n))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let r=this.getSelection().filter(s=>!i.has(s.label));return r.length&&this.emitSelectionChange(),r}selectCategories(e){let i=new Set(e);return this.select([...this.seatById.values()].filter(o=>i.has(o.categoryKey)).map(o=>o.id))}deselectCategories(e){let i=new Set(e);this.deselect(this.getSelection().filter(o=>i.has(o.categoryKey)).map(o=>o.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(o=>typeof o=="string"&&!!o))],this.rebuildSelectableSeatIds();let i=this.renderer?.getSelection().filter(o=>!this.isSelectableByPolicy(o.id)).map(o=>o.id)??[];i.length&&this.deselect(i)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let i=this.getSelection(),o=e??i.reduce((n,r)=>n+(r.quantity??1),0);return jc(i,o,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let i=new Set(e.getSelection().map(o=>o.id));return i.size>0&&Ji(this.seatById.values(),o=>e.getStatus(o),i).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let i of this.selectableObjectRefs){let o=this.groupedTableBySeatId.get(i)??this.groupedTablesByLabel.get(i);if(o){o.chairs.forEach(r=>e.add(r.id));continue}let n=this.seatById.has(i)?i:this.labelToId.get(i);n&&e.add(n)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,i){let o=this.groupedTablesByLabel.get(e);if(!o)return!1;let n=o.mode==="whole"?o.capacity:Math.floor(i);if(!Number.isInteger(n)||n<o.minOccupancy||n>o.maxOccupancy)return!1;let r=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,n),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,i,o){let n=this.groupedTablesByLabel.get(e),r=this.hold_;if(!n||n.mode!=="variable"||!r?.labels.includes(e))return null;let s=Math.floor(i);if(!Number.isInteger(s)||s<n.minOccupancy||s>n.maxOccupancy)return null;if((r.items??[]).filter(d=>d.label!==e).reduce((d,h)=>d+(h.quantity??1),0)+s>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(r.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?s:d.quantity}));if(!l.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,l,o,r.holdId);return this.tableQuantities.set(e,s),this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}setNarrowLayout(e){this.narrowLayout!==e&&(this.narrowLayout=e,this.renderer&&this.applyRowBandPreview(this.renderer))}rowBandsWanted(){return $p&&!!this.opts.sectionPreview&&this.doc?.theme?.sectionDetail!=="seats"&&(qp||!this.narrowLayout)}applyRowBandPreview(e){if(!this.opts.sectionPreview)return;let i=this.rowBandsWanted();e.setRowBandPreview?.(i),i&&e.setSectionFocusDim?.(!1)}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,i)=>e+(i.quantity??1),0)}handleRendererSelect(e){let i=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(i?i.chairs.map(n=>n.id):[e.id]),this.emitSelectionChange();return}if((i?this.tableTierResolution(i):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(i?i.chairs.map(n=>n.id):[e.id]),this.emitError(new Me(eo([i?.label??e.label]))),this.emitSelectionChange();return}if(i){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(i.chairs.map(n=>n.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(i.chairs.map(n=>n.id)),this.opts.onSelect?.(i.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(i)),this.emitSelectionChange();return}if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect([e.id]),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.opts.onSelect?.(e),this.emitSelectionChange()}handleRendererDeselect(e){let i=this.groupedTableBySeatId.get(e.id),o=i?.label??e.label;if(this.opts.retapKeepsSelection&&!i&&(this.hold_?.labels.includes(o)||this.isSelectableByPolicy(e.id))){this.renderer?.select?.([e.id]),this.opts.onSeatRetap?.(this.toSeat(e));return}if(this.hold_?.labels.includes(o)){this.opts.onDeselect?.(i?{...e,label:o}:e);return}i?(this.renderer?.deselect(i.chairs.map(n=>n.id)),this.hold_?.labels.includes(i.label)||(this.tableQuantities.set(i.label,i.mode==="whole"?i.capacity:i.minOccupancy),i.mode==="variable"&&this.confirmedVariableTables.delete(i.label)),this.opts.onDeselect?.(i.chairs[0]??e)):this.opts.onDeselect?.(e),this.emitSelectionChange()}resetUnheldTableQuantities(){for(let e of this.groupedTablesByLabel.values())this.hold_?.labels.includes(e.label)||(this.tableQuantities.set(e.label,e.mode==="whole"?e.capacity:e.minOccupancy),e.mode==="variable"&&this.confirmedVariableTables.delete(e.label))}resetTableQuantitiesForLabels(e){for(let i of e){let o=this.groupedTablesByLabel.get(i);o&&(this.tableQuantities.set(i,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(i))}}tableQuantityRequest(e){if(e?.objectType!=="table")return{};if(e.bookingMode==="variable"&&!this.confirmedVariableTables.has(e.label))throw new Error("picker: confirm a variable table guest quantity before holding");return{quantity:e.quantity}}hold(e,i){return Dc(this,e,i)}resumeHold(e){return Nc(this,e)}extendHold(e){return Hc(this,e)}categoryAvailability(){return Ic({seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,groupedTablesByLabel:this.groupedTablesByLabel,closedMembers:this.closedMemberIds(),statusOf:e=>this.getStatus(e),gaAreas:this.getGAAreas()})}closedMemberIds(){let e=new Set,i=this.renderer;if(!i||!this.closedSections.size)return e;for(let o of this.closedSections)for(let n of i.sectionMembers?.(o)??[])e.add(n);return e}getGAAreas(){let e=this.visibleDoc();return e?Cc(e,this.currency,i=>this.statusOf(i)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Pc(this.getGAAreas(),this.gaSelected))}async holdGA(e,i,o={}){let n=this.visibleDoc();if(!n||!Number.isFinite(i)||i<1)return null;let r=gt(n).find(d=>d.id===e);if(!r)return null;let s=$t(r).filter(d=>!this.hold_?.labels.includes(d)&&this.statusOf(d)==="free").slice(0,Math.floor(i));if(s.length!==Math.floor(i))return null;let a=new Map;for(let d of this.hold_?.items??[])a.set(d.label,{label:d.label,tierId:d.tierId,quantity:d.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let d of this.hold_.seats)a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{}});for(let d of this.getSelection())a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{},...this.tableQuantityRequest(d)});for(let d of s)a.set(d,{label:d,...o.tierId?{tierId:o.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,o.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}hasPremiumSeats(){for(let e of this.labelToSeat.values())if(e.commercial?.premium)return!0;return!1}getBestAvailableZones(){return Ec(this.visibleDoc())}pickPremiumBlock(e,i,o){return Fc({doc:this.visibleDoc(),qty:e,categoryKey:i,zoneId:o,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:n=>this.seatTierResolution(n).kind!=="invalid",statusOfLabel:n=>this.getStatus(this.labelToId.get(n)??"")??"free",isPremium:n=>!!this.labelToSeat.get(n)?.commercial?.premium})}async bestAvailable(e,i,o={}){let n=this.renderer;if(!n)return null;if(o.preferPremium){let r=this.pickPremiumBlock(e,i,o.zoneId);if(r){if(this.hold_&&!await this.release())return null;try{let s=r.map(d=>{let h=this.labelToSeat.get(d),u=h?this.toSeat(h):null;return{label:d,...u?.tierId?{tierId:u.tierId}:{}}}),a=await this.api.hold(this.key,s,o.ttlMs);n.clearSelection();let l=this.idsForLabels(r);l.length&&n.setStatus(l,"held"),this.setHold({holdId:a.holdId,labels:[...r],expiresAt:a.expiresAt,items:a.items});let c=r.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(s){let{status:a,reason:l}=ht(s);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),s}}}if(this.hold_&&!await this.release())return null;try{let r=await this.api.bestAvailable(this.key,e,i,o.zoneId,o.ttlMs);n.clearSelection();let s=this.idsForLabels(r.labels);s.length&&n.setStatus(s,"held"),this.setHold({holdId:r.holdId,labels:[...r.labels],expiresAt:r.expiresAt,items:r.items});let a=r.labels.map(l=>this.labelToSeat.get(l)).filter(l=>!!l).map(l=>this.toSeat(l));return this.opts.onSelectionChange?.(a),this.hold_}catch(r){let{status:s,reason:a}=ht(r);throw s===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),r}}book(e,i,o){return Gc(this,e,i,o)}release(){return Vc(this)}releaseLabels(e){return Wc(this,e)}releaseConfirmed(e,i){return zc(e,i)}setStatus(e,i){this.renderer?.setStatus(e,i)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let i=new Set(e.categories.filter(n=>n.notForSale).map(n=>n.key));if(!i.size)return[];let o=[];for(let[n,r]of this.seatById)i.has(r.categoryKey)&&o.push(n);return o}flashSeat(e,i){this.renderer?.flashSeat(e,i)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let i=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&i&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}setViewportInsets(e){this.viewportInsets=e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:null,this.renderer?.setViewportInsets?.(this.viewportInsets)}setFitClearance(e){this.fitClearance=Math.max(0,e||0),this.renderer?.setFitClearance?.(this.fitClearance)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}seatScreenRadius(){let e=this.renderer?.getCameraPose?.()?.scale??0;return si(this._doc?.theme?.seatScale)*pe*e}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){gc(this.pickerFocusContext,e)}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}get pickerFocusContext(){let e=this;return{renderer:e.renderer,doc:e._doc,get accessFilter(){return e.accessFilter},set accessFilter(i){e.accessFilter=i},get accessStepAt(){return e.accessStepAt},set accessStepAt(i){e.accessStepAt=i},get bandReturnPose(){return e.bandReturnPose},set bandReturnPose(i){e.bandReturnPose=i},get bandReturnSection(){return e.bandReturnSection},set bandReturnSection(i){e.bandReturnSection=i},getActiveFloorId:()=>e.getActiveFloorId(),setFloor:i=>e.setFloor(i),sectionSummary:i=>e.sectionSummary(i),emitSectionFocus:i=>{e.opts.onSectionFocus?.(i)}}}focusAccessibilityFilter(e){return en(this.pickerFocusContext,e)}accessibilitySpread(e){return yc(this.pickerFocusContext,e)}focusNextAccessibleSection(e){return Sc(this.pickerFocusContext,e)}accessibilityFilterDims(e){return wc(this.pickerFocusContext,e)}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let i=this.renderer;!i?.setActiveFloor||e===i.getActiveFloorId?.()&&!i.isFloorOverview?.()||(i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let i=this.renderer;!i?.setStacked||e===i.isStacked?.()||(i.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let i=this.renderer;!i?.setFloorOverview||e===i.isFloorOverview?.()||(i.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let i=this.renderer;i&&(i.setViewMode?.("flat"),i.setFloorOverview?.(!1),i.setStacked?.(!1),i.setActiveFloor?.(e),this.resnapshot(),this.emitSelectionChange(),this.opts.onDeckTap?.(e))}setViewMode(e){this.renderer?.setViewMode?.(e)}getViewMode(){return this.renderer?.getViewMode?.()??"flat"}getRung(){return this.renderer?.getRung?.()??"seats"}getFocusedSection(){return this.renderer?.getFocusedSection?.()??null}seatsRevealed(){let e=this.renderer;return e?.seatsRevealed?e.seatsRevealed():this.getRung()==="seats"||!!this.getFocusedSection()}atVenueFit(){return this.renderer?.atVenueFit?.()}canZoomIn(){return this.renderer?.canZoomIn?.()}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){kc(this.pickerFocusContext,e)}getViewport(){let e=this.renderer;return!e?.getVisibleWorldRect||!e.getWorldBounds?null:{visible:e.getVisibleWorldRect(),bounds:e.getWorldBounds()}}getMinimapSnapshot(){return this.renderer?.getMinimapSnapshot?.()??{sections:[],seats:[]}}panToWorld(e){this.renderer?.panToWorld?.(e)}clearSectionFocus(){this.renderer?.clearSectionFocus?.(),this.opts.onSectionFocus?.(null)}getRenderedQualityEvidence(){return this.renderer?.getRenderedQualityEvidence()??null}focusSection(e,i){this.handleSectionTap(e,i)}focusSeats(e,i){let o=this.renderer;if(!o?.focusSeats?.(e,i))return!1;let n=o.getFocusedSection?.()??null;return this.opts.onSectionFocus?.(n?this.sectionSummary(n):null),!0}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}previewSection(e,i){this.handleSectionTap(e,i)}handleSectionTap(e,i){if(!this.renderer)return;let o=this.isSectionClosed(e)?null:this.sectionSummary(e);bc(this.pickerFocusContext,e,o,i),this.opts.onSectionFocus?.(o)}sectionSummary(e){return!this.renderer||!this._doc?null:Qc({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=>Ce(i,this.accessFilter)}:{}})}clearConnectFallback(){this.connectFallback&&(clearTimeout(this.connectFallback),this.connectFallback=null)}destroy(){if(this.closed=!0,this.seatsBuilt=!1,this.pendingSnapshot=null,this.clearConnectFallback(),this.detachVisibility?.(),this.detachVisibility=null,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null),this.realtime){try{this.realtime.stop()}catch{}this.realtime=null}if(this.ws){try{this.ws.close()}catch{}this.ws=null}this.renderer?.destroy(),this.renderer=null}toSeat(e){let i=this.groupedTableBySeatId.get(e.id);if(i)return this.toTableSeat(i);let o=e.commercial?{commercial:e.commercial}:void 0,n=e.displayLabel?{displayLabel:e.displayLabel}:void 0,r=e.accessibility?.length?{accessibility:e.accessibility}:void 0,s=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,a=this.seatContext.get(e.id),l=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!l)return{id:e.id,label:e.label,...n,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...r,...s};let d=c.tier;return{id:e.id,label:e.label,...n,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...o,...r,...s}}toTableSeat(e){let i=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(s=>ai(this._doc,this.tableTierSeat(e),s.id).kind==="resolved"),n=this.tableTierResolution(e),r=n.kind==="resolved"?n.tier:void 0;return{id:i?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:i?this.seatContext.get(i.id)?.sectionLabel:void 0,rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:r?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:r?.id}:{},objectType:"table",bookingMode:e.mode,quantity:this.tableQuantities.get(e.label)??(e.mode==="whole"?e.capacity:e.minOccupancy),capacity:e.capacity,minOccupancy:e.minOccupancy,maxOccupancy:e.maxOccupancy,physicalSeatIds:e.chairs.map(s=>s.id)}}describeSeat(e,i){let o=this._doc?.categories.find(n=>n.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:o?.label??e.categoryKey,categoryColor:o?.color??"#6e7bff",status:this.renderer?.getStatus(e.id)??"free",mark:this.renderer?.getSeatMark?.(e.id)??null,...i?.interaction?{interaction:i.interaction}:{},...i?.unavailable?{unavailable:!0}:{},...i?.filteredOut?{filteredOut:!0}:{},currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(i=>i.key===e)?.price??0}tiersFor(e){let i=this._doc?.categories.find(o=>o.key===e)?.tiers;return i&&i.length?i:void 0}tiersForSeat(e){if(!this._doc)return;let i=qn(this._doc,e);return i.length?i:void 0}seatTierResolution(e){return this._doc?ai(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 ai(this._doc,this.tableTierSeat(e),this.seatTiers.get(i))}setSeatTier(e,i){let o=this.seatById.get(e);if(!o)return;let n=this.tiersForSeat(o);if(n){if(i==null)this.seatTiers.delete(e);else if(n.some(r=>r.id===i))this.seatTiers.set(e,i);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let i=[];for(let o of e){let n=this.labelToSeat.get(o);n&&i.push(this.toSeat(n))}return i}emitSelectionChange(){let e=this.getSelection();this.opts.onSelectionChange?.(e),this.emitSelectionValidity(),this.emitOrphanHint()}emitSelectionValidity(){let e=this.getSelectionValidity();e&&(this.opts.onSelectionValidityChange?.(e),e.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(e.seats):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(e),this.lastSelectionValidity=e.isValid)}ticketIssue(e){if(!this._doc)return null;let i=e?this.seatsForLabels(e):this.getSelection();return Zn(this._doc,i.map(o=>({label:o.label,...o.tierId?{tierId:o.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let i=this.ticketIssue();if(i){this.hintShown=!0,this.opts.onHint(i.code==="companion_pair_required"?B("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=this.selectionValidators.some(s=>s.type==="noOrphanSeats"),n=new Set(e.getSelection().map(s=>s.id));(o&&n.size?Ji(this.seatById.values(),s=>e.getStatus(s),n):[]).length>0?(this.hintShown=!0,this.opts.onHint(B("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}setSectionFocusDim(e){this.renderer?.setSectionFocusDim?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){return Kc(this,e)}handle409Conflicts(e){Xc(this,e)}setHold(e,i="created"){Yc(this,e,i)}clearHold(){Uc(this)}expireActiveHold(){return $c(this)}applySeatsMap(e,i="free",o="http",n){o==="socket"&&(this.socketVersion+=1);let r=this.renderer;if(!r||!this.seatsBuilt){this.pendingSnapshot=Jc(this.pendingSnapshot,{seats:e,default:i,source:o,...n===void 0?{}:{fetchedAt:n}});return}let s=this.seatsMapDiffers(e,i);this.lastSnapshotAt=n??Date.now(),this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=i;let a=Bi(i);this.allIds.length&&r.setStatus(this.allIds,a),r.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let l={free:[],held:[],booked:[],not_for_sale:[]};for(let[d,h]of Object.entries(e))l[Bi(h)].push(...this.idsForLabel(d));["free","held","booked","not_for_sale"].forEach(d=>{d!==a&&l[d].length&&r.setStatus(l[d],d)});let c=this.notForSaleCategorySeatIds();c.length&&r.setStatus(c,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:s})}snapshotIsFresh(e=5e3){return this.lastSnapshotAt>0&&Date.now()-this.lastSnapshotAt<e}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(i=>this.statusOf(i)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let i=this.socketVersion,o=await this.api.objects(this.key);this.socketVersion===i&&this.applySeatsMap(o.seats,o.default??"free","http",o.fetchedAt)},e)}resync(e){return e?.reason==="connect"&&this.snapshotIsFresh()?Promise.resolve():this.resnapshot()}applyProjection(e){this.applySeatsMap(e.exceptions,e.default,"socket")}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,i=Mc({selection:this.getSelection().map(o=>o.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:o=>this.statusOf(o)});if(i.lost.length&&this.deselect(i.lost),i.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(i.lapsedLabels);let o=this.idsForLabels(i.lapsedLabels);o.length&&this.renderer?.deselect(o),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(i),i}getAccessNeeds(){return Tc(this.seatById.values(),e=>this.getStatus(e)??"free")}attachVisibility(){this.detachVisibility||(this.detachVisibility=Ac(()=>{this.closed||this.refreshAvailability().then(()=>{this.closed||this.renderer?.forceDraw()})}))}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applyProjection(e),resync:e=>this.resync(e),onSections:(e,i)=>{let o=this.syncHidden(e),n=this.syncClosed(i);o&&this.resnapshot(),(o||n)&&this.opts.onStatusChange?.({changed:!0})}}}seatsMapDiffers(e,i){if(this.lastSnapshotAt===0||i!==this.liveDefault)return!0;let o=Object.entries(e);if(o.length!==this.liveStatuses.size)return!0;for(let[n,r]of o)if(this.liveStatuses.get(n)!==r)return!0;return!1}applyStatusChanges(e){this.socketVersion+=1;let i=this.renderer;if(!i)return;let o=e.some(n=>this.liveStatuses.get(n.label)!==n.status);for(let n of e){this.liveStatuses.set(n.label,n.status);let r=this.idsForLabel(n.label);if(!r.length)continue;let s=Bi(n.status);this.opts.flashOnLiveChange&&s!=="free"&&r.some(a=>i.getStatus(a)==="free")&&!this.hold_?.labels.includes(n.label)&&r.forEach(a=>i.flashSeat(a,s==="held"?"#f4b740":"#f43f5e")),i.setStatus(r,s)}this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&i.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.({changed:o})}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let o=null;try{o=this.api.createRealtime(this.key,this.realtimeSink())}catch{o=null}if(o){this.realtime=o,o.start();return}}if(this.realtime)return;let i;try{let o=this.api.socketProtocols?.(this.key);i=o&&o.length?new WebSocket(e,o):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=i,i.onopen=()=>{if(this.attempt=0,!this.snapshotIsFresh()){this.resnapshot();return}this.clearConnectFallback(),this.connectFallback=setTimeout(()=>{this.connectFallback=null,this.resnapshot()},2500)},i.onmessage=o=>{this.clearConnectFallback();let n;try{n=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(!this.renderer||!n||typeof n!="object")return;let s=n;Array.isArray(s.hidden)&&this.syncHidden(s.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.({changed:!0})),Array.isArray(s.closed)&&this.syncClosed(s.closed)&&this.opts.onStatusChange?.({changed:!0}),s.type!=="hidden"&&(s.seats&&typeof s.seats=="object"?this.applySeatsMap(s.seats):Array.isArray(s.changes)&&this.applyStatusChanges(s.changes))},i.onclose=()=>{this.ws===i&&(this.ws=null),this.scheduleReconnect()},i.onerror=()=>{try{i.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),i=xc(e,{baseMs:1e3,maxMs:jp,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}};var Qp=5,Jp=-1.1,on=35;function nn(t,e){let i=t-re,o=Math.atan2(Qp-i,e)*180/Math.PI,n=Math.atan2(Jp-i,e)*180/Math.PI;return n<-on&&(o+=-on-n,n=-on),{topPitch:o,basePitch:n}}var oe=2048,be=1024,zt=pn,O=Math.PI*2,ef=be/180,pt=t=>(t+180)/360*oe,$=t=>(90-t)/180*be;function sd(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 ad(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 Ni=96,an=360/Ni,tf=.6,rn=[17,23,42];function sn(t,e,i=1){let o=Math.max(0,Math.min(.58,e)),n=Math.round(t[0]+(rn[0]-t[0])*o),r=Math.round(t[1]+(rn[1]-t[1])*o),s=Math.round(t[2]+(rn[2]-t[2])*o);return`rgba(${n},${r},${s},${i})`}function id(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 ae(t,e,i){let o=(1-Math.abs(2*i-1))*e,n=(t%360+360)%360/60,r=o*(1-Math.abs(n%2-1)),s=0,a=0,l=0;n<1?[s,a,l]=[o,r,0]:n<2?[s,a,l]=[r,o,0]:n<3?[s,a,l]=[0,o,r]:n<4?[s,a,l]=[0,r,o]:n<5?[s,a,l]=[r,0,o]:[s,a,l]=[o,0,r];let c=i-o/2;return[Math.round((s+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var od=new Map;function nd(t){if(!t)return null;let e=od.get(t);if(e)return e;let i=2166136261;for(let r=0;r<t.length;r++)i^=t.charCodeAt(r),i=Math.imul(i,16777619);let o=(i>>>0)%360,n=ae(o,.3,.42);return od.set(t,n),n}function of(t,e,i,o){let n=new Array(Ni).fill(null),r=0,s=t.sectionId;for(let a of e){if(a.id===t.id)continue;let l=a.sectionId;if(!l||s&&l===s)continue;let c=a.x-t.x,d=a.y-t.y,h=Math.hypot(c,d)*zt;if(h<1.5||h>95)continue;let u=a.eyeHeightM??re,f=u-o;Math.abs(f)>r&&(r=Math.abs(f));let m=Math.atan2(f,h)*180/Math.PI,g=Math.atan2(u-re-o,h)*180/Math.PI,y=((Math.atan2(c,-d)-i)*180/Math.PI+540)%360-180,b=Math.min(Ni-1,Math.max(0,Math.floor((y+180)/an))),S=m>34&&h<16,w=n[b];w?(m>w.top&&(w.top=m),g<w.base&&(w.base=g),h<w.nearM&&(w.nearM=h,w.tint=nd(a.categoryKey)),w.overhead=w.overhead||S):n[b]={top:m,base:g,nearM:h,overhead:S,tint:nd(a.categoryKey)}}return{bins:n,maxDelta:r}}function nf(t,e,i,o){for(let n=0;n<Ni;n++){let r=e[n];if(!r)continue;let s=-180+n*an,a=i(s),l=i(s+an);if(!(l>a))continue;let c=Math.min(72,r.top),d=Math.min(r.base,-4),h=o(c),u=o(d);if(u<=h)continue;let f=r.nearM/95,m=r.tint,g=m?id([44,54,80],m,.34):[44,54,80],p=m?id([24,30,48],m,.28):[24,30,48],y=t.createLinearGradient(0,h,0,u);y.addColorStop(0,sn(g,f)),y.addColorStop(.24,sn(p,f)),y.addColorStop(1,sn([10,13,22],f)),t.fillStyle=y,t.fillRect(a,h,l-a+1,u-h),t.fillStyle=`rgba(150,165,205,${.35*(1-f*.55)})`,t.fillRect(a,h,l-a+1,1.5);let S=Math.min(u,o(0))-h;if(S>8){let k=1-f*.4;for(let v=1;v<6;v++){let L=h+S*v/6;t.fillStyle=`rgba(0,0,0,${.16*k})`,t.fillRect(a,L,l-a+1,1.5),t.fillStyle=`rgba(120,134,170,${.1*k})`,t.fillRect(a,L+1.5,l-a+1,1.2)}}if(r.overhead){let w=o(Math.min(86,c+12)),k=t.createLinearGradient(0,w,0,h);k.addColorStop(0,"rgba(3,4,8,0.9)"),k.addColorStop(1,"rgba(3,4,8,0)"),t.fillStyle=k,t.fillRect(a,w,l-a+1,h-w),t.fillStyle="rgba(120,130,160,0.14)",t.fillRect(a,h-1.5,l-a+1,1.5)}}}function rf(t,e,i){let n=new Array(72).fill(!1),r=new Array(72).fill(1/0),s=new Set,a=0;for(let y of i){a++,y.sectionId&&s.add(y.sectionId);let b=y.x-e.x,S=y.y-e.y,w=Math.hypot(b,S)*zt;if(w<.5)continue;let k=Math.atan2(b,-S),v=Math.floor((k+Math.PI)/O*72);v<0?v=0:v>=72&&(v=71),n[v]=!0,w<r[v]&&(r[v]=w)}let l=0,c=[];for(let y=0;y<72;y++)n[y]&&(l++,c.push(r[y]));let d=l/72*360;c.sort((y,b)=>y-b);let h=c.length?c[c.length>>1]:0,u=c.length?c[Math.floor(c.length*.15)]??h:0,f=c.length?c[Math.floor(c.length*.85)]??h:0,m=u>.5?f/u:1,g=sd(`${a}|${[...s].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return d>=300&&h>11&&m>1.35?p="sport":d>=285?p="arena":p="proscenium",{mode:p,seed:g,voidRadiusM:h,aspect:m}}var sf=5;function af(t,e,i){switch(i){case 1:t.beginPath(),t.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,O),t.fill();break;case 2:t.beginPath(),t.ellipse(0,-e*1.02,e*.42,e*.42,0,0,O),t.fill(),t.beginPath(),t.ellipse(0,-e*.2,e*.98,e*1.02,0,0,O),t.fill();break;case 3:t.beginPath(),t.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,O),t.fill(),t.beginPath(),t.ellipse(0,-e*.52,e*1.22,e*.24,0,0,O),t.fill();break;case 4:t.beginPath(),t.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,O),t.fill(),t.beginPath(),t.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,O),t.fill(),t.beginPath(),t.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,O),t.fill();break;default:break}}function lf(t,e,i,o,n){let r=o*.44,s=o*n.shoulderK,a=o*.66,l=o*1.68,c=o*5.4,d=`rgba(${n.clothing[0]},${n.clothing[1]},${n.clothing[2]},${n.alpha})`,h=`rgba(${n.tone[0]},${n.tone[1]},${n.tone[2]},${n.alpha})`;t.save(),t.translate(e,i);let u=n.lean*o;t.fillStyle=d,t.beginPath(),t.moveTo(-r,a),t.quadraticCurveTo(-r*1.18,l-u-o*.6,-s,l-u),t.quadraticCurveTo(-s*1.05,l+o*1.2,-s*.94,c),t.lineTo(s*.94,c),t.quadraticCurveTo(s*1.05,l+o*1.2,s,l+u),t.quadraticCurveTo(r*1.18,l+u-o*.6,r,a),t.closePath(),t.fill(),t.fillStyle=h,t.fillRect(-r*.82,o*.5,r*1.64,o*.9),t.save(),t.rotate(n.tilt),t.translate(n.turn*o,0),t.fillStyle=h,o>=18?(t.beginPath(),t.moveTo(-o*.9,-o*.15),t.quadraticCurveTo(-o*.96,-o*1.12,0,-o*1.06),t.quadraticCurveTo(o*.96,-o*1.12,o*.9,-o*.15),t.quadraticCurveTo(o*.86,o*.55,o*.36,o*.98),t.quadraticCurveTo(0,o*1.14,-o*.36,o*.98),t.quadraticCurveTo(-o*.86,o*.55,-o*.9,-o*.15),t.closePath(),t.fill(),o>=22&&(t.beginPath(),t.ellipse(-o*.9,o*.18,o*.13,o*.22,0,0,O),t.ellipse(o*.9,o*.18,o*.13,o*.22,0,0,O),t.fill())):(t.beginPath(),t.ellipse(0,0,o*.9,o*1.06,0,0,O),t.fill()),af(t,o,n.hair),n.rim>.01&&(t.strokeStyle=`rgba(245,205,150,${(.5*n.rim).toFixed(3)})`,t.lineWidth=Math.max(1,o*.14),t.beginPath(),t.ellipse(0,-o*.06,o*.86,o*1,0,Math.PI*1.12,Math.PI*1.9),t.stroke()),t.restore(),n.rim>.01&&(t.strokeStyle=`rgba(240,200,150,${(.28*n.rim).toFixed(3)})`,t.lineWidth=Math.max(1,o*.12),t.beginPath(),t.moveTo(-s*.8,l-o*.05),t.quadraticCurveTo(-r,l-o*.75,0,l-o*.82),t.quadraticCurveTo(r,l-o*.75,s*.8,l-o*.05),t.stroke()),t.restore()}function cf(t,e,i,o,n,r,s){t.fillStyle=`rgba(${n[0]},${n[1]},${n[2]},${s})`,t.beginPath(),t.moveTo(e-o*1.72,i+o*4),t.quadraticCurveTo(e-o*1.78,i+o*1.55,e-o*.46,i+o*1.02),t.lineTo(e-o*.4,i+o*.62),t.lineTo(e+o*.4,i+o*.62),t.lineTo(e+o*.46,i+o*1.02),t.quadraticCurveTo(e+o*1.78,i+o*1.55,e+o*1.72,i+o*4),t.closePath(),t.fill(),t.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${s})`,t.beginPath(),t.ellipse(e,i,o*.9,o*1.05,0,0,O),t.fill()}function cn(t,e,i,o,n){let r=o*.1,s=i-o*.9,a=i-o*.74,l=i-o*.46,c=o*.13,d=o*.09,h=`rgba(${n.tone[0]},${n.tone[1]},${n.tone[2]},${n.alpha})`,u=t.createRadialGradient(e,i,1,e,i,o*.24);u.addColorStop(0,"rgba(0,0,0,0.4)"),u.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.scale(1,.28),t.fillStyle=u,t.beginPath(),t.ellipse(e,i/.28,o*.24,o*.24,0,0,O),t.fill(),t.restore(),t.fillStyle=h,t.beginPath(),t.moveTo(e-d,l),t.lineTo(e-d*.7,i),t.lineTo(e-d*.1,i),t.lineTo(e-d*.1,l+o*.02),t.lineTo(e+d*.1,l+o*.02),t.lineTo(e+d*.1,i),t.lineTo(e+d*.7,i),t.lineTo(e+d,l),t.closePath(),t.fill(),t.beginPath(),t.moveTo(e-c,a),t.quadraticCurveTo(e-c*.9,l-o*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-o*.12,e+c,a),t.quadraticCurveTo(e,a-o*.05,e-c,a),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=h,t.lineWidth=o*.055;let f=a+o*.02;n.pose===1?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e-c*1.5,i-o*1.02),t.moveTo(e+c*.8,f),t.lineTo(e+c*1.5,i-o*1.02),t.stroke()):n.pose===2?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e+d*1.4,l-o*.02),t.moveTo(e+c*.8,f),t.lineTo(e-d*.4,l-o*.06),t.stroke(),t.fillStyle=h,t.beginPath(),t.ellipse(e+d*1.5,l-o*.04,o*.07,o*.09,-.5,0,O),t.fill()):n.pose===3?(t.beginPath(),t.moveTo(e-c*.8,f),t.lineTo(e-c*.2,s+r*.6),t.moveTo(e+c*.8,f),t.lineTo(e+c*1.1,l),t.stroke(),t.lineWidth=o*.02,t.beginPath(),t.moveTo(e-c*.2,s+r*.9),t.lineTo(e-c*.2,i-o*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,f),t.lineTo(e-c*.95,l+o*.02),t.moveTo(e+c*.85,f),t.lineTo(e+c*.95,l+o*.02),t.stroke()),t.fillStyle=h,t.fillRect(e-r*.34,s+r*.6,r*.68,r*.9),t.beginPath(),t.ellipse(e,s,r*.86,r*1.05,0,0,O),t.fill(),n.rimStrength>.01&&(t.strokeStyle=`rgba(${n.rim[0]},${n.rim[1]},${n.rim[2]},${(.6*n.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,o*.02),t.beginPath(),t.moveTo(e-c,a),t.lineTo(e-r*.6,s+r*.4),t.moveTo(e-r*.7,s),t.ellipse(e,s,r*.84,r*1.02,0,Math.PI*1.05,Math.PI*1.55),t.stroke())}function Hi(t,e,i,o,n,r,s,a,l){t.save(),t.globalCompositeOperation="lighter";let c=t.createLinearGradient(0,i,0,n);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),t.fillStyle=c,t.beginPath(),t.moveTo(e-r,i),t.lineTo(o-s,n),t.lineTo(o+s,n),t.lineTo(e+r,i),t.closePath(),t.fill(),t.restore()}function dn(t,e,i,o,n){let r=t.createRadialGradient(e,i,0,e,i,o*3);r.addColorStop(0,`rgba(${n},0.9)`),r.addColorStop(.4,`rgba(${n},0.35)`),r.addColorStop(1,`rgba(${n},0)`),t.fillStyle=r,t.beginPath(),t.arc(e,i,o*3,0,O),t.fill(),t.fillStyle=`rgba(${n},1)`,t.beginPath(),t.arc(e,i,o,0,O),t.fill()}function kk(t,e,i){let o=document.createElement("canvas");o.width=oe,o.height=be;let n=o.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.hypot(r,s),l=Math.max(2,a*zt),c=t.eyeHeightM??re,d=rf(t,e,i),h=ad(d.seed),u=210+h()*150,f=ae(220+(h()-.5)*60,.55,.82),m=`${f[0]},${f[1]},${f[2]}`,g=n.createLinearGradient(0,0,0,be);g.addColorStop(0,"#080b12"),g.addColorStop(.42,"#12182c"),g.addColorStop(.5,"#1c2440"),g.addColorStop(.56,"#151b2c"),g.addColorStop(.78,"#171e30"),g.addColorStop(1,"#131829"),n.fillStyle=g,n.fillRect(0,0,oe,be);let p=n.createLinearGradient(0,$(-6),0,be);p.addColorStop(0,"rgba(30, 37, 56, 0)"),p.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),p.addColorStop(1,"rgba(22, 28, 44, 0.12)"),n.fillStyle=p,n.fillRect(0,$(-6),oe,be-$(-6));let y=Math.atan2(r,-s),b=of(t,i,y,c),S=b.maxDelta>=tf;S&&nf(n,b.bins,pt,$);let w=Math.max(.3,Math.min(1,1-(l-6)/60)),k=nn(c,l),v=Math.min(80,Math.atan2(4,l)*180/Math.PI),L=Math.min(45,k.topPitch),P=k.basePitch;d.mode==="sport"?uf(n,l,c,d,w,u,m,h):d.mode==="arena"?hf(n,l,c,d,w,m,h):df(n,v,L,P,w,u,m,h);let I=d.mode==="sport"?34:24+Math.floor(h()*8);n.fillStyle=`rgba(${m},0.8)`;for(let x=0;x<I;x++){let C=(x+.5)/I*oe,T=$(d.mode==="sport"?58:54+x*7%3*6);n.beginPath(),n.arc(C,T,d.mode==="sport"?2.6:3.2,0,O),n.fill()}pf(n,t,i,e,y,c,r,s,S,d);let M=n.createLinearGradient(0,0,0,be);return M.addColorStop(0,"rgba(0,0,0,0.85)"),M.addColorStop(.12,"rgba(0,0,0,0)"),M.addColorStop(.9,"rgba(0,0,0,0)"),M.addColorStop(1,"rgba(0,0,0,0.55)"),n.fillStyle=M,n.fillRect(0,0,oe,be),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function df(t,e,i,o,n,r,s,a){let l=pt(-e),c=pt(e),d=$(i),h=$(o),u=c-l,f=h-d,m=$(Math.min(50,i+10)),g=u*(1.1+(1-n)*.5),p=t.createRadialGradient(oe/2,(d+h)/2,8,oe/2,(d+h)/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-u*.6,d-f*1.2,u*2.2,f*3.4);let y=ae(r,.62,.55),b=ae(r+40,.7,.5),S=ae(r+70,.78,.52);t.save(),t.beginPath(),t.rect(l,d,u,f),t.clip();let w=t.createLinearGradient(0,d,0,h);w.addColorStop(0,`rgb(${y[0]},${y[1]},${y[2]})`),w.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),w.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),t.globalAlpha=.8,t.fillStyle=w,t.fillRect(l,d,u,f),t.globalAlpha=1;let k=t.createRadialGradient(oe/2,(d+h)/2,u*.12,oe/2,(d+h)/2,u*.62);k.addColorStop(0,"rgba(6,8,14,0)"),k.addColorStop(.7,"rgba(6,8,14,0.15)"),k.addColorStop(1,"rgba(5,6,11,0.92)"),t.fillStyle=k,t.fillRect(l,d,u,f),t.restore();let v=3+Math.floor(a()*3),L=f*.46,P=h-f*.08;for(let _=0;_<v;_++){let E=(_+1)/(v+1),H=l+u*(.22+E*.56+(a()-.5)*.06);cn(t,H,P,L*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:ae(r+20,.5,.7),rimStrength:.7})}t.fillStyle="#05070d",t.fillRect(l-u*.5,m,u*.5,h-m),t.fillRect(c,m,u*.5,h-m);let I=u*.055+3,M=I*1.35;t.fillStyle="#03050a",t.beginPath(),t.moveTo(l,h),t.lineTo(l-I,h),t.lineTo(l-M,m),t.lineTo(l+u*.012,m),t.closePath(),t.fill(),t.beginPath(),t.moveTo(c,h),t.lineTo(c+I,h),t.lineTo(c+M,m),t.lineTo(c-u*.012,m),t.closePath(),t.fill(),t.fillRect(l-M,m,u+M*2,(h-m)*.12);let x=f*.14,C=m+(h-m)*.12;t.fillStyle="rgba(4,6,12,0.96)";let T=7;t.beginPath(),t.moveTo(l-M,C);for(let _=0;_<=T;_++){let E=l-M+(u+M*2)*_/T;t.quadraticCurveTo(E-(u+M*2)/T/2,C+x,E,C)}t.lineTo(c+M,C),t.lineTo(c+M,m),t.lineTo(l-M,m),t.closePath(),t.fill(),t.fillStyle=`rgba(${s},0.12)`,t.fillRect(l-1.5,C,1.5,h-C),t.fillRect(c,C,1.5,h-C),t.fillStyle="#0b0f18",t.fillRect(l-I,h-f*.05,u+I*2,f*.05+3);let R=t.createLinearGradient(0,h-f*.05,0,h+f*.12);R.addColorStop(0,`rgba(255,206,140,${(.5*n).toFixed(3)})`),R.addColorStop(1,"rgba(255,206,140,0)"),t.fillStyle=R,t.fillRect(l-I,h-f*.05,u+I*2,f*.2);let A=3+Math.floor(a()*2);for(let _=0;_<A;_++){let E=(_+1)/(A+1),H=l+u*(E+(a()-.5)*.08),G=$(Math.min(62,i+26)),Z=(a()-.5)*u*.16;Hi(t,H,G,H+Z,h,4,u*.09,s,.16*(.7+n*.5)),dn(t,H,G,2.4,s)}}function hf(t,e,i,o,n,r,s){let a=Math.min(e*.6,Math.max(3,o.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=oe/2,d=1.2,h=Math.max(e*.45,e-a),u=e+a,f=Math.atan2(d-i,h)*180/Math.PI,m=Math.atan2(d-i,u)*180/Math.PI,g=Math.atan2(-i,h)*180/Math.PI,p=$(f),y=$(m),b=$(g),S=pt(l)-c,w=Math.max(6,(p-y)/2),k=(p+y)/2,v=t.createRadialGradient(c,b,4,c,b,S*2.6);v.addColorStop(0,`rgba(255,206,150,${(.2*n).toFixed(3)})`),v.addColorStop(.5,"rgba(150,140,190,0.08)"),v.addColorStop(1,"rgba(40,44,60,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=v,t.fillRect(c-S*2.6,y-w,S*5.2,b-y+w+40),t.restore(),t.fillStyle="#0c1019",t.beginPath(),t.moveTo(c-S,k),t.ellipse(c,k,S,w,0,Math.PI,0,!1),t.lineTo(c+S,b),t.ellipse(c,b,S,w,0,0,Math.PI,!1),t.closePath(),t.fill();let L=t.createLinearGradient(0,k,0,b);L.addColorStop(0,`rgba(${r},0.14)`),L.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=L,t.fillRect(c-S,k,S*2,b-k);let P=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],I=P[Math.floor(s()*P.length)],M=s()<.5?-1:1,x=W=>c+W.u*M*S*.84,C=W=>k+W.v*w*.8,T=I.find(W=>W.lead)??I[0],R=x(T),A=t.createLinearGradient(0,k-w,0,k+w);A.addColorStop(0,"#3d4a72"),A.addColorStop(1,"#232b47"),t.fillStyle=A,t.beginPath(),t.ellipse(c,k,S,w,0,0,O),t.fill();let _=t.createRadialGradient(R,k,2,R,k,S);_.addColorStop(0,`rgba(255,214,160,${(.5*n).toFixed(3)})`),_.addColorStop(1,"rgba(255,214,160,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=_,t.beginPath(),t.ellipse(c,k,S,w,0,0,O),t.fill(),t.restore(),t.strokeStyle=`rgba(${r},0.7)`,t.lineWidth=2,t.beginPath(),t.ellipse(c,k,S,w,0,0,O),t.stroke();let E=Math.max(24,(b-y)*1.3),H=I.length>=3?3:2;for(let W=0;W<H;W++){let Se=(-.62+W*.52+(s()-.5)*.12)*-M,Be=c+Se*S*.7,ft=k-w*(.45+s()*.18),je=S*(.07+s()*.04),Xi=E*(.26+s()*.12);t.fillStyle="#0a0e18",t.fillRect(Be-je/2,ft-Xi,je,Xi),t.fillStyle=`rgba(${r},0.3)`,t.fillRect(Be-je/2,ft-Xi,je,1.5)}if(I.length>=3){let W=c-T.u*M*S*.4;t.fillStyle="#0b0f1a",t.beginPath(),t.ellipse(W,k-w*.34,S*.08,w*.1,0,0,O),t.fill(),t.strokeStyle=`rgba(${r},0.35)`,t.lineWidth=1,t.stroke()}for(let W of[...I].sort((Se,Be)=>Se.v-Be.v)){let Se=.82+(W.v+1)*.14;cn(t,x(W),C(W),E*Se*(W.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:W.pose,rim:ae(40,.72,.8),rimStrength:W.lead?1.4:.9})}let G=$(Math.min(60,m+34)),Z=w*1.1+6;t.strokeStyle="rgba(60,68,92,0.85)",t.lineWidth=3,t.beginPath(),t.ellipse(c,G,S*1.15,Z,0,0,O),t.stroke();let N=4+Math.floor(s()*3);for(let W=0;W<N;W++){let Se=W/N*O,Be=c+Math.cos(Se)*S*1.15,ft=G+Math.sin(Se)*Z;if(Math.sin(Se)>-.2){let je=c+(s()-.5)*S*.8;Hi(t,Be,ft,je,k,3,S*.32,r,.2*(.7+n*.4))}dn(t,Be,ft,3,r)}let F=$(Math.min(52,m+24)),V=Math.max(60,S*.4),ne=Math.max(24,V*.34);t.strokeStyle="rgba(70,78,102,0.6)",t.lineWidth=1.5,t.beginPath(),t.moveTo(c-V*.3,F-ne/2),t.lineTo(c-V*.16,F-ne*2.2),t.moveTo(c+V*.3,F-ne/2),t.lineTo(c+V*.16,F-ne*2.2),t.stroke(),t.fillStyle="#0d1220",t.fillRect(c-V/2,F-ne/2,V,ne);let Vi=t.createLinearGradient(0,F-ne*.3,0,F+ne*.42);Vi.addColorStop(0,`rgba(${r},0.5)`),Vi.addColorStop(1,"rgba(255,214,160,0.32)"),t.fillStyle=Vi,t.fillRect(c-V*.42,F-ne*.3,V*.84,ne*.72),t.fillStyle="rgba(255,214,160,0.55)",t.fillRect(c-V/2,F+ne/2-2,V,2);let Wi=t.createRadialGradient(c,F,4,c,F,V*1.1);Wi.addColorStop(0,`rgba(${r},0.2)`),Wi.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=Wi,t.fillRect(c-V*1.1,F-V*.8,V*2.2,V*1.6);let zi=t.createRadialGradient(c,(G+k)/2,6,c,(G+k)/2,S*1.5);zi.addColorStop(0,`rgba(${r},${(.1*(.6+n*.5)).toFixed(3)})`),zi.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=zi,t.fillRect(c-S*1.5,G-40,S*3,k-G+80),t.restore();let cd=c+Math.sign(R-c||1)*S*.5;Hi(t,cd,G-Z*.4,R,C(T),2.5,S*.16,"255,224,178",.42*(.7+n*.4));let Ki=t.createRadialGradient(R,C(T),1,R,C(T),S*.2);Ki.addColorStop(0,`rgba(255,228,185,${(.4*n).toFixed(3)})`),Ki.addColorStop(1,"rgba(255,228,185,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=Ki,t.beginPath(),t.ellipse(R,C(T),S*.2,w*.24,0,0,O),t.fill(),t.restore()}function uf(t,e,i,o,n,r,s,a){let l=oe/2,c=Math.max(10,o.voidRadiusM),d=Math.max(2,e-c),h=e+c,u=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),f=Math.atan2(-i,d)*180/Math.PI,m=Math.atan2(-i,h)*180/Math.PI,g=$(f),p=$(m),y=pt(u)-l,b=(g+p)/2,S=Math.max(10,(g-p)/2),w=t.createRadialGradient(l,b,4,l,b,y);w.addColorStop(0,"#e8f0fb"),w.addColorStop(.7,"#b9c9e2"),w.addColorStop(1,"#8fa3c4"),t.save(),t.beginPath(),t.ellipse(l,b,y,S,0,0,O),t.clip(),t.fillStyle=w,t.fillRect(l-y,b-S,y*2,S*2),t.strokeStyle="rgba(90,120,170,0.5)",t.lineWidth=3,t.beginPath(),t.moveTo(l,b-S),t.lineTo(l,b+S),t.moveTo(l-y*.5,b-S),t.lineTo(l-y*.5,b+S),t.moveTo(l+y*.5,b-S),t.lineTo(l+y*.5,b+S),t.stroke(),t.strokeStyle="rgba(180,90,110,0.45)",t.beginPath(),t.ellipse(l,b,S*.9,S*.5,0,0,O),t.stroke(),t.restore(),t.strokeStyle="rgba(210,225,245,0.6)",t.lineWidth=2.5,t.beginPath(),t.ellipse(l,b,y,S,0,0,O),t.stroke(),t.fillStyle="rgba(20,26,40,0.8)";for(let x=0;x<5;x++){let C=l+(a()-.5)*y*1.4,T=b+(a()-.5)*S*1.1,R=Math.max(2,S*.06);t.beginPath(),t.ellipse(C,T,R*.6,R,0,0,O),t.fill()}let k=t.createRadialGradient(l,b,4,l,b,y*1.4);k.addColorStop(0,"rgba(200,220,255,0.12)"),k.addColorStop(1,"rgba(200,220,255,0)"),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=k,t.fillRect(l-y*1.4,p-S,y*2.8,g-p+S*2),t.restore();let v=$(Math.min(66,m+60)),L=Math.max(80,y*.7),P=L*.5,I=t.createRadialGradient(l,v,4,l,v,L*1.6);I.addColorStop(0,`rgba(${s},0.3)`),I.addColorStop(1,`rgba(${s},0)`),t.save(),t.globalCompositeOperation="lighter",t.fillStyle=I,t.fillRect(l-L*1.6,v-L*1.2,L*3.2,L*2.4),t.restore(),t.fillStyle="#080b12",t.beginPath(),t.moveTo(l-L/2,v-P/2),t.lineTo(l+L/2,v-P/2),t.lineTo(l+L*.6,v),t.lineTo(l+L/2,v+P/2),t.lineTo(l-L/2,v+P/2),t.lineTo(l-L*.6,v),t.closePath(),t.fill();let M=r;for(let x=0;x<3;x++){let C=ae(M+x*30,.5,.5);t.fillStyle=`rgba(${C[0]},${C[1]},${C[2]},0.75)`;let T=L*.26;t.fillRect(l-L*.42+x*(T+L*.06),v-P*.32,T,P*.64)}t.fillStyle=`rgba(${s},0.9)`;for(let x=0;x<8;x++){let C=l-L*.6+L*1.2*x/7;t.beginPath(),t.arc(C,v+P*.62,2.4,0,O),t.fill()}}function pf(t,e,i,o,n,r,s,a,l,c){let d=e.sectionId,h=!1,u=[];for(let g of i){if(g.id===e.id)continue;let p=g.x-e.x,y=g.y-e.y,b=Math.hypot(p,y)*zt;if(d&&g.sectionId===d&&b<3&&p*s+y*a>0&&(h=!0),b<.3||b>32)continue;let w=((Math.atan2(p,-y)-n)*180/Math.PI+540)%360-180,k=l?(g.eyeHeightM??re)-r:0,v=Math.atan2(k-.28,b)*180/Math.PI;if(v>10&&b>5)continue;let L=0;for(let M=0;M<g.id.length;M++)L=L*31+g.id.charCodeAt(M)&65535;let P=.9+(L&15)/40,I=Math.min(78,Math.atan2(.16,b)*180/Math.PI*ef*P);I<1.2||u.push({hx:pt(w),hy:$(v),r:I,d:b,hash:L})}u.sort((g,p)=>p.d-g.d);let f=[];{let g=[...u].sort((b,S)=>b.hy-S.hy),p=[],y=()=>{if(!p.length)return;let b=p.reduce((k,v)=>k+v.d,0)/p.length,S=p.reduce((k,v)=>k+v.hy,0)/p.length,w=p.reduce((k,v)=>k+v.r,0)/p.length;f.push({figs:p.sort((k,v)=>v.d-k.d),d:b,hy:S,r:w}),p=[]};for(let b of g){let S=p[p.length-1];S&&Math.abs(b.hy-S.hy)>Math.max(5,(S.r+b.r)/2*1.7)&&y(),p.push(b)}y()}f.sort((g,p)=>p.d-g.d);let m=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let g of f){if(g.figs.length>=3&&g.r>=1.6&&g.r<26){let p=[],y=[...g.figs].sort((w,k)=>w.hx-k.hx),b=[];for(let w of y){let k=b[b.length-1];k&&w.hx-k.hx>Math.max(14,w.r*7)&&(b.length>=3&&p.push(b),b=[]),b.push(w)}b.length>=3&&p.push(b);let S=Math.min(.42,.5*(1-g.d/42));if(S>.05){t.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let w of p){let k=w[0].hx-g.r*1.6,v=w[w.length-1].hx+g.r*1.6;t.beginPath(),t.roundRect(k,g.hy+g.r*.8,v-k,g.r*2.4,g.r*.8),t.fill()}}}for(let p of g.figs){let y=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),b=Math.round((1-Math.min(1,p.d/16))*10),S=[14+(p.hash>>4&6)+b,17+(p.hash>>4&6)+b,25+(p.hash>>4&6)+b],w=m[p.hash%m.length],k=[w[0]+b,w[1]+b,w[2]+b];if(p.r>=13){let v=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;lf(t,p.hx,p.hy,p.r,{tone:S,clothing:k,alpha:y,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%sf,rim:v,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?cf(t,p.hx,p.hy,p.r,k,S,y):(t.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${y.toFixed(3)})`,t.beginPath(),t.arc(p.hx,p.hy,p.r,0,O),t.fill(),t.beginPath(),t.ellipse(p.hx,p.hy+p.r*1.4,p.r*1.85,p.r*.95,0,Math.PI,0,!0),t.fill())}}if(h){let g=$(-34);t.fillStyle="rgba(6, 8, 14, 0.92)",t.fillRect(0,g,oe,be-g),t.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let y=0;y<p;y++){let b=(y+.5)/p*oe;t.beginPath(),t.ellipse(b,g+6,oe/p*.42,22,0,Math.PI,0,!0),t.fill()}}}var ce=480,ut=270,ln=50,Ze=30,rd=t=>(t+ln)/(2*ln)*ce,Wt=t=>(Ze-t)/(2*Ze)*ut;function Lk(t,e,i){let o=document.createElement("canvas");o.width=ce,o.height=ut;let n=o.getContext("2d"),r=e.x-t.x,s=e.y-t.y,a=Math.max(2,Math.hypot(r,s)*zt),l=ad(sd(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=ae(220+(l()-.5)*60,.55,.82),h=`${d[0]},${d[1]},${d[2]}`,u=n.createLinearGradient(0,0,0,ut);u.addColorStop(0,"#080b12"),u.addColorStop(.44,"#151c32"),u.addColorStop(.5,"#1d2644"),u.addColorStop(.58,"#161c2e"),u.addColorStop(1,"#131829"),n.fillStyle=u,n.fillRect(0,0,ce,ut);let f=t.eyeHeightM??re,m=nn(f,a),g=Math.min(ln-2,Math.atan2(4,a)*180/Math.PI),p=Math.min(Ze-2,m.topPitch),y=Math.max(-Ze+2,m.basePitch),b=rd(-g),S=rd(g),w=Wt(p),k=Wt(y),v=S-b,L=k-w,P=Math.max(.35,Math.min(1,1-(a-6)/60)),I=Wt(Math.min(Ze-1,p+8)),M=n.createRadialGradient(ce/2,(w+k)/2,4,ce/2,(w+k)/2,v*1.15);M.addColorStop(0,"rgba(255,214,150,0.34)"),M.addColorStop(.28,"rgba(150,150,230,0.3)"),M.addColorStop(.6,"rgba(99,102,241,0.12)"),M.addColorStop(1,"rgba(99,102,241,0)"),n.fillStyle=M,n.fillRect(b-v*.6,w-L*1.2,v*2.2,L*3.4);let x=ae(c,.62,.55),C=ae(c+40,.7,.5),T=ae(c+70,.78,.52);n.save(),n.beginPath(),n.rect(b,w,v,L),n.clip();let R=n.createLinearGradient(0,w,0,k);R.addColorStop(0,`rgb(${x[0]},${x[1]},${x[2]})`),R.addColorStop(.5,`rgb(${C[0]},${C[1]},${C[2]})`),R.addColorStop(1,`rgb(${T[0]},${T[1]},${T[2]})`),n.globalAlpha=.8,n.fillStyle=R,n.fillRect(b,w,v,L),n.globalAlpha=1;let A=n.createRadialGradient(ce/2,(w+k)/2,v*.12,ce/2,(w+k)/2,v*.6);A.addColorStop(0,"rgba(6,8,14,0)"),A.addColorStop(.7,"rgba(6,8,14,0.15)"),A.addColorStop(1,"rgba(5,6,11,0.9)"),n.fillStyle=A,n.fillRect(b,w,v,L),n.restore();let _=3,E=k-L*.08;for(let N=0;N<_;N++){let F=(N+1)/(_+1);cn(n,b+v*(.24+F*.52),E,L*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:ae(c+20,.5,.7),rimStrength:.7})}n.fillStyle="#05070d",n.fillRect(b-v*.5,I,v*.5,k-I),n.fillRect(S,I,v*.5,k-I);let H=v*.05+2,G=H*1.35;n.fillStyle="#03050a",n.beginPath(),n.moveTo(b,k),n.lineTo(b-H,k),n.lineTo(b-G,I),n.lineTo(b+v*.012,I),n.closePath(),n.fill(),n.beginPath(),n.moveTo(S,k),n.lineTo(S+H,k),n.lineTo(S+G,I),n.lineTo(S-v*.012,I),n.closePath(),n.fill(),n.fillRect(b-G,I,v+G*2,(k-I)*.13),n.fillStyle=`rgba(${h},0.12)`,n.fillRect(b-1.2,I,1.2,k-I),n.fillRect(S,I,1.2,k-I),n.fillStyle="#0b0f18",n.fillRect(b-H,k-L*.05,v+H*2,L*.05+2);let Z=n.createLinearGradient(0,k-L*.05,0,k+L*.14);Z.addColorStop(0,`rgba(255,206,140,${(.5*P).toFixed(3)})`),Z.addColorStop(1,"rgba(255,206,140,0)"),n.fillStyle=Z,n.fillRect(b-H,k-L*.05,v+H*2,L*.22);for(let N=0;N<3;N++){let F=(N+1)/4,V=b+v*F,ne=Wt(Math.min(Ze-1,p+20));Hi(n,V,ne,V+(l()-.5)*v*.14,k,3,v*.09,h,.17*P),dn(n,V,ne,1.8,h)}n.fillStyle=`rgba(${h},0.75)`;for(let N=0;N<8;N++)n.beginPath(),n.arc((N+.5)/8*ce,Wt(Ze-4-N%2*3),2.2,0,O),n.fill();n.fillStyle="rgba(10,13,20,0.9)",n.fillRect(0,ut-26,ce,26),n.fillStyle="rgba(30,37,54,0.9)";for(let N=0;N<9;N++){let F=N*(ce/9)+ce/18;n.beginPath(),n.ellipse(F,ut-22,ce/9*.4,15,0,Math.PI,0,!0),n.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var ld=new Set(["en"]),Gi=new Map;async function ff(t){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(Jn(`i18n/${t}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-YBKNUI3J.js"),i=e[t];return i?await i():null}async function Ik(t,e){let i=fs(t,e);if(i==="en"||ld.has(i))return it(i),i;if(!ps.includes(i))return it("en"),"en";try{let o=Gi.get(i);o||(o=ff(i),Gi.set(i,o));let n=await o;return Gi.delete(i),n?(it(i,n),ld.add(i),i):(it("en"),"en")}catch{return Gi.delete(i),it("en"),"en"}}export{bf as ACCESSIBILITY_RING_COLOR,Kt as ACCESSIBILITY_TYPES,im as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,tm as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,gf as CHART_STORAGE_KEY,Rm as CURRENCY_CHOICES,Mm as DEFAULT_CURRENCY,L0 as EMPTY_AVAILABILITY_REFRESH,If as EVENT_CONFIGURATION_EXPORT_SCHEMA,Pf as EVENT_CONFIGURATION_SCHEMA,jf as FLOOR_STACK_GAP_RATIO,em as FLOOR_STACK_MIN_SURFACE_PX,k0 as HOLD_CLOCK_SKEW_MS,to as LABEL_FADE_MS,Lf as LABEL_STYLE_MAX_SIZE,kf as LABEL_STYLE_MIN_SIZE,Sm as LEGIBILITY_HYSTERESIS_PX,Nm as LOCALE_NAMES,rm as MAX_EVENT_INVENTORY,nm as MAX_GA_CAPACITY,_n as MIN_POINTER_TARGET_PX,td as PickerController,Me as PickerSelectionError,mm as RENDERED_QUALITY_REPORT_VERSION,vf as SEAT_COMMERCIAL_MARKS,hm as SEAT_TYPE_ICON_BODY,Yi as SEAT_TYPE_ICON_VIEWBOX,mf as STAGE_LABEL_STYLE_MAX_SIZE,$d as SUPPORTED_LOCALES,xf as SURROUNDINGS_SHAPE_ROLES,Jo as SeatmapRenderer,Of as TABLE_SEAT_OFFSET,Bf as TIER_HEIGHT_M,ps as TRANSLATED_LOCALES,In as UNGROUPED_ID,Tc as accessNeedsFor,hd as accessibilityLabelKey,yf as accessibilityMeta,Sf as accessibilityRingColor,yn as allObjects,Tn as applyHidden,Ac as attachVisibilityCatchUp,om as automaticRoundTableRadius,Ef as canTransitionEventConfiguration,Rf as canonicalEventConfigurationJson,Sn as chartBounds,kn as combinedFloorZoneId,bt as compactRowLabel,qt as computeSections,mc as createRenderer,tr as crossesThreshold,Yd as currencyExponent,Em as currencySymbol,Xf as expandBooth,Oe as expandChart,Gf as expandRow,Hf as expandRowSlots,Kf as expandTable,Wf as expandTableSlots,qf as floorObjects,Qf as floorStackPlacements,Ut as floorsOf,zm as formatDate,Am as formatMinor,We as formatMoney,Ud as fromMinorUnits,gt as gaAreasOf,lm as gaInventorySegments,sm as gaUnitLabel,$t as gaUnitLabels,kk as generateSeatPanorama,Lk as generateSeatThumb,Hm as getLocale,cm as growJoinedGAInventory,fm as hiddenObjectIds,Vp as holdHasLapsed,C0 as holdRecoveryShape,oo as hysteresisScale,Cn as initialFloorMode,Af as inspectEventConfigurationCompatibility,gm as inspectRenderedQualityEvidence,dm as isGaUnitLabel,Vm as isLocaleLoaded,pm as isSectionHidden,Cf as layerOf,xn as layoutCombinedFloorPlan,Ln as layoutFloorStack,Ik as loadLocale,Gm as localeDirection,Jf as mainFloorId,_f as migrateLegacyEventConfigurations,Uf as objectCenter,$f as owningSectionForObject,Mf as parseEventConfigurationExport,Tf as parseEventConfigurationVersion,Yf as pointInPolygon,j as pointInPolygonWithHoles,Yt as polygonLabelPoint,Mc as reconcileAvailability,x0 as refreshChangedSomething,io as renderedPx,Ff as resolveEventConfigurationRollback,fs as resolveLocale,Nf as rowInventoryCount,Df as rowSeatPositions,wf as seatCommercialMeta,er as seatNoteRowModel,Pn as seatTypeIconBody,um as seatTypeIconSvg,Xt as sectionGeometry,it as setLocale,us as setMoneyLocale,Wm as setStringOverrides,Rc as shouldWaitForHoldExpiry,bn as stackFloors,B as t,gs as tCount,zf as tableInventoryCount,Vf as tableSeatCountsBySide,Zf as translateObject,am as validGAInventorySegments,vm as zoomTowardPoint};