@seatlayer/core 0.72.1 → 0.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{categoryInventory-Bt-0psga.d.ts → categoryInventory-Bcmnr6ZH.d.ts} +1 -1
- package/dist/{categoryInventory-BU1j8Q70.d.cts → categoryInventory-DueSAIBX.d.cts} +1 -1
- package/dist/{chunk-O5UWBFUT.js → chunk-3L4M7L5I.js} +1 -1
- package/dist/chunk-5JB4VW6B.js +1 -0
- package/dist/{chunk-YW2WGLRM.js → chunk-BAWUBGWY.js} +1 -1
- package/dist/{chunk-5U25QLSS.js → chunk-HDY2MYYH.js} +1 -1
- package/dist/chunk-JLYR66MT.js +1 -0
- package/dist/{chunk-KCFEFP6H.js → chunk-KN7GLEAI.js} +1 -1
- package/dist/{chunk-KPSJDH3N.js → chunk-N5NRM4NW.js} +1 -1
- package/dist/chunk-QLDV5ZGA.js +1 -0
- package/dist/{chunk-AM2LRFAY.js → chunk-UX67GDLV.js} +1 -1
- package/dist/{chunk-ALE2T36W.js → chunk-YFV4DSSX.js} +1 -1
- package/dist/{chunk-NKYPEBW3.js → chunk-ZMYRXJOA.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +11 -4
- package/dist/core/chart-ops/index.d.ts +11 -4
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +11 -4
- package/dist/core/inventory/index.d.ts +11 -4
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +5 -5
- package/dist/core/layout/index.d.ts +5 -5
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.cjs +1 -1
- package/dist/core/quality/index.d.cts +3 -3
- package/dist/core/quality/index.d.ts +3 -3
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.cjs +1 -1
- package/dist/core/render-assets/index.d.cts +1 -1
- package/dist/core/render-assets/index.d.ts +1 -1
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/{eventConfigurations-DfVUGyCg.d.ts → eventConfigurations-C7YAqkFR.d.ts} +1 -1
- package/dist/{eventConfigurations-3uSorYVC.d.cts → eventConfigurations-DwXdrjqj.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +102 -13
- package/dist/index.d.ts +102 -13
- package/dist/index.js +1 -1
- package/dist/{labeling-BiWB-8aq.d.ts → labeling-BUCj-kHU.d.ts} +1 -1
- package/dist/{labeling-9RWWmJhZ.d.cts → labeling-iugoy25P.d.cts} +1 -1
- package/dist/{layout-B6iOoPOv.d.cts → layout-DPJX6D9k.d.cts} +3 -3
- package/dist/{layout-B7URbtDR.d.ts → layout-Dv3R0Mpw.d.ts} +3 -3
- package/dist/{renderedQuality-C5dQiq97.d.ts → renderedQuality-CSHrmnHf.d.cts} +10 -2
- package/dist/{renderedQuality-BZsq3wDe.d.cts → renderedQuality-CfonzUpl.d.ts} +10 -2
- package/dist/{renderer-6sFRupj0.d.ts → renderer-C5avrVLy.d.ts} +11 -2
- package/dist/{renderer-CBOo1OZk.d.cts → renderer-Dn4Plcv9.d.cts} +11 -2
- package/dist/{sections-DU6YDYoZ.d.cts → sections-DhJ7TukF.d.cts} +1 -1
- package/dist/{sections-Cn_sk1Sx.d.ts → sections-uV7vqDHj.d.ts} +1 -1
- package/dist/{segmentedRowModel-CKmyHvKv.d.cts → segmentedRowModel-DWOjcPrU.d.cts} +1 -1
- package/dist/{segmentedRowModel-DbP7pWUk.d.ts → segmentedRowModel-DgSEzAYd.d.ts} +1 -1
- package/dist/{ticketRestrictions-CvS2oQ8v.d.ts → ticketRestrictions-DIh61MqE.d.ts} +2 -2
- package/dist/{ticketRestrictions-DkenahW2.d.cts → ticketRestrictions-JT87K45q.d.cts} +2 -2
- package/dist/{types-D6-wLa-m.d.cts → types-Dx4jA8aI.d.cts} +22 -4
- package/dist/{types-D6-wLa-m.d.ts → types-Dx4jA8aI.d.ts} +22 -4
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +1 -1
- package/dist/view3d/index.d.cts +3 -3
- package/dist/view3d/index.d.ts +3 -3
- package/dist/view3d/index.js +1 -1
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4F7VBQCF.js +0 -1
- package/dist/chunk-HXYWP6NX.js +0 -1
- package/dist/chunk-XLGYWT5G.js +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Td,b as Cd,c as po,d as Id,e as Pd,f as fo,h as xo,k as At,m as Mo,n as ye,o as re,p as Ao,q as Ro,r as Rt,s as Eo}from"./chunk-NKYPEBW3.js";import{a as Dd,b as Hd}from"./chunk-O5UWBFUT.js";import{b as Xo}from"./chunk-FOYQOIWG.js";import{a as Jc,b as ed,c as td,d as id,e as od,f as rd,g as sd,h as nd,i as ad}from"./chunk-ALE2T36W.js";import{c as Go,e as No}from"./chunk-BLPBTW6I.js";import{b as xt,f as Lo,h as Mt,i as To,k as Co}from"./chunk-UL5OIGIF.js";import{a as yi,b as gi,d as Wo,e as Et,g as Vo,h as zo,k as Ko}from"./chunk-4F7VBQCF.js";import{a as fe,b as vo,c as Ce,d as Lt,e as Tt,f as Ie,g as U,m as me,n as we,q as Ct,r as It,t as wo,u as Pt,v as $,w as mi}from"./chunk-FMZ6HLDH.js";import{A as Do,B as Ho,b as Io,c as Po,e as Ze,i as Bo,j as Fo,p as Oo}from"./chunk-HXYWP6NX.js";import{a as xd,b as Md,c as Ad,d as Rd,e as Ed,f as wt,g as _d,h as $e,i as Bd,j as mo,k as kt,l as Fd,m as Od,n as yo}from"./chunk-AM2LRFAY.js";import{a as zc,b as Kc,c as ro,d as Xc,e as Yc,f as gt,g as Uc,h as $c,i as qc,j as Zc,k as Qc,l as jc,q as ko,t as qe,x as _o}from"./chunk-YW2WGLRM.js";import{Aa as kd,Ba as co,Ca as Ld,Da as ho,Ea as De,Fa as uo,W as ao,X as Oe,Y as ld,ea as ee,fa as lo,ga as bt,ka as cd,la as dd,ma as hd,na as ud,oa as pd,pa as fd,qa as md,ra as yd,s as so,sa as gd,ta as bd,u as no,ua as Sd,va as ie,w as G,wa as St,xa as vd,ya as wd,za as vt}from"./chunk-KCFEFP6H.js";import{C as _,c as ui,h as pi,m as go,o as bo,t as Y,u as ve,v as ue,w as pe,x as fi,z as So}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";import{Konva as ei}from"konva/lib/Core";import{Stage as bc}from"konva/lib/Stage";import{Layer as Yi}from"konva/lib/Layer";import{Group as ut}from"konva/lib/Group";import{Circle as Dn}from"konva/lib/shapes/Circle";import{Group as Pi}from"konva/lib/Group";import{Circle as Re}from"konva/lib/shapes/Circle";import{Line as xi}from"konva/lib/shapes/Line";import{Rect as Mi}from"konva/lib/shapes/Rect";import{Text as Ur}from"konva/lib/shapes/Text";var Qe=9,Pe=.9,se=.55*Pe,ne=U/fe,je=4,xe=14,Yo=10,Uo=14,ge=.45*Pe,be=.9*Pe,$o=(ge+be)/2,qo=Math.max(Pe*1.1,be),ke=8,Zo=700,Q=2,Qo=U,_t=.85,jo=U,Je=64,He=.55*ge,bi=700,Jo=2500,Bt=-11.5,et=.58,er=320,tr=650,ir=420,or=1,Ft=1,rr=2,Si=16,Ge=12,sr=[.85,.72,.62],Ot=15,Dt=12,nr=.01,ar=10,lr=6,cr=12,dr=8,hr=8,ur=.6,pr=.6,fr=[0,18,-18,36,-36,54,-54],Ne="600",Ht="500",ce=640,mr="700",tt=.02,yr=14,gr=.34,br=.92,vi=7,Sr=3,vr=6;function wi(i){return Math.min(1,Math.max(Ge/Si,i/900))}function Gt(i,e){return Math.max(Ge,i*wi(e))}var wr=.1;var ma="#e5e7eb",ya="#c7cbd1",ga="#595f69",ba="#d1d5db",Sa="#b8bdc4",va="#273142",wa="#526078",ka="#f1f5f9",La="#374151",Ta="#64748b",Ca="#111827",Nt="#6b7280",it="#374151";var kr="#4b5563",Lr=.4,Me=.16,Tr="rgba(244,246,248,0.06)",Wt=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Cr(i,e,t){let o=new Map;for(let n of i){let l=e(n);!l||t(l)||o.set(l,(o.get(l)??0)+1)}let r=null,s=0;for(let[n,l]of o)(l>s||l===s&&r!=null&&n<r)&&(r=n,s=l);return r}function ae(i){return Y(i)?{sectionFill:ma,sectionStroke:ya,sectionInk:ga,focalFill:ba,focalStroke:Sa}:{sectionFill:va,sectionStroke:wa,sectionInk:ka,focalFill:La,focalStroke:Ta}}function ki(i,e){let t=i.sectionFill,o=So(ue(t,.2),.85);switch(e){case"closed":return ue(t,.12);case"sold-out":return o;case"nearly-gone":return pe(t,o,.4);default:return t}}var Ir=.28,Pr=.32,Ia=.55,Pa=.7;function xr(i,e,t){let o=ae(i),r=ki(o,e);if(!t||e==="sold-out"||e==="closed")return{fill:r,stroke:o.sectionStroke};let s=Y(i);return{fill:pe(r,t,s?Pr:Ir),stroke:_(t,s?Pa:Ia)}}var xa=.03;function Mr(i,e){let t=ae(i);return!["normal","nearly-gone","sold-out","closed"].map(r=>ki(t,r).toLowerCase()).includes(e.trim().toLowerCase())&&Li(i,e)}function Li(i,e){let t=ui(e);if(!t)return!1;let o=ae(i),r=Math.max(Ir,Pr)+xa;return["normal","nearly-gone","sold-out","closed"].some(s=>{let n=ui(ki(o,s));return n?Math.max(Math.abs(n[0]-t[0]),Math.abs(n[1]-t[1]),Math.abs(n[2]-t[2]))/255<=r:!1})}var Ma="#f8fafc",Aa="#f4f6fb",Ra="#111827",Ea=.72;function Ar(i){let e=Y(i),t=e?Ma:Ca,o=e?Ra:Aa,r=pe(o,t,1-Ea);return{plate:t,ink:o,subInk:go(r,t)>=bo?r:o}}function Rr(i){return i?.35:.3}function Er(i){if(i<=0||i>=1)return 1;let e=1.25-1;if(i<.45){let o=i/.45;return 1+e*(1-(1-o)**2)}let t=(i-.45)/(1-.45);return 1+e*Math.cos(t*Math.PI*1.5)*(1-t)**2}function Ti(i){let e=i<=0?0:i>=1?1:i,t=1-(1-e)**3;return{radiusScale:1+(2.5-1)*t,opacity:.55*(1-e)}}var Br;function Fr(i){Br=i}function _a(i){return typeof i=="number"?i:i instanceof Date?i.getTime():Date.parse(i)}var _r=new Map;function Ba(i,e){let t=i??Br,o=`${t??""}|${JSON.stringify(e)}`,r=_r.get(o);return r||(r=new Intl.DateTimeFormat(t,e),_r.set(o,r)),r}var Fa={dateStyle:"medium",timeStyle:"short"};function Or(i,e={}){let{locale:t,...o}=e,r=_a(i);if(!Number.isFinite(r))return"";let s=Object.keys(o).length?o:Fa;return Ba(t,s).format(r)}var Xd="USD",Yd=["USD","EUR","GBP","CAD","AUD","INR","AED","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL"],Hr;function Gr(i){Hr=i}var Dr=new Map;function Vt(i,e,t,o){let r=o??Hr,s=`${r??""}|${i}|${e??"auto"}|${t??"auto"}`,n=Dr.get(s);return n||(n=new Intl.NumberFormat(r,{style:"currency",currency:i,minimumFractionDigits:e,maximumFractionDigits:t}),Dr.set(s,n)),n}function ot(i,e="USD",t,o){if(typeof t=="object"){let s=t;try{return Vt(e,s.minimumFractionDigits,s.maximumFractionDigits,s.locale).format(i)}catch(n){if(s.fallback)return s.fallback(i,e);throw n}}let r=t??(Number.isInteger(i)?0:void 0);return Vt(e,r,r,o).format(i)}function Oa(i="USD"){try{return Vt(i,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function Da(i,e="USD"){return i/10**Oa(e)}function Ud(i,e="USD",t){return ot(Da(i,e),e,void 0,t)}function $d(i="USD"){return Vt(i,0,0).formatToParts(0).find(t=>t.type==="currency")?.value??i}var rt={"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.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","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.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.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.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.holdReassurance":"Yours for {time} \u2014 you won\u2019t be charged yet.","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.findTogetherInstead":"Find seats together instead","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours.","picker.accessExpiredTitle":"Your access session has ended","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.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.addTime":"Add time","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.change":"Change","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.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","picker.accessFreeCount":"{count} free","picker.accessNoneLeft":"None left","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.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.fitToScreen":"Fit to screen","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.heldTicketsReleased":"Held tickets released. Choose your new seats.","picker.heldTicketsRestored":"Your held tickets have been restored.","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.liveAvailability":"Live availability \u2014 seats update in real time","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.moreSelectedCount":"{count} more selected","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.notChargedYet":"You won\u2019t be charged yet.","picker.notForSale":"Not for sale","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.releaseHeldTickets":"Release held tickets and choose different seats","picker.releasingEllipsis":"Releasing\u2026","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.seatsHeldForNeedMoreTime":"Your seats are held for <b>{time}</b>. Need more time?","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsJustTakenInCategory.one":"{count} seat just taken in {label} \xB7 {left} left","picker.seatsJustTakenInCategory.other":"{count} seats just taken in {label} \xB7 {left} left","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSecured":"Seats secured","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.securedCount":"{count} secured","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.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.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 Ha=["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"],eh={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"},Nr=["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"],Ga=new Set(["ar","fa","he"]),Ci={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"},Ii=new Map(Ha.map(i=>[i.toLowerCase(),i]));function Na(i){let e=i.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let t=Ii.get(e)??Ci[e];if(t)return t;let o=e.split("-");if(o.length>=2){let r=`${o[0]}-${o[1]}`,s=Ii.get(r)??Ci[r];if(s)return s}return Ii.get(o[0])??Ci[o[0]]}var Ae={en:rt},zt={},le="en";function Wr(i,e){let t=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let o of[i,e,...t]){if(!o)continue;let r=Na(o);if(r)return r}return"en"}function th(){return le}function ih(i=le){return Ga.has(i)?"rtl":"ltr"}function oh(i){return!!Ae[i]}function We(i,e){e&&(Ae[i]={...Ae[i],...e}),le=Ae[i]?i:"en",Gr(le),Fr(le),typeof document<"u"&&(document.documentElement.lang=le)}function rh(i){zt=i}var Vr=/\{(\w+)\}/g;function X(i,e){let t=zt[i]??Ae[le]?.[i]??rt[i]??i;return e?t.replace(Vr,(o,r)=>String(e[r]??`{${r}}`)):t}function sh(i,e,t){let o=new Intl.PluralRules(le).select(e);return(zt[`${i}.${o}`]??Ae[le]?.[`${i}.${o}`]??rt[`${i}.${o}`]??zt[`${i}.other`]??Ae[le]?.[`${i}.other`]??rt[`${i}.other`]??i).replace(Vr,(n,l)=>String({count:e,...t}[l]??`{${l}}`))}function nh(i,e){return Or(i,{...e??{dateStyle:"medium",timeStyle:"short"},locale:le})}function Kr(i,e,t,o=!1){let r=i.displayLabel?.trim()||i.label;return o?{title:r,detail:X("map.statusTaken"),sellable:!1}:e==="booked"?{title:r,detail:X("map.statusTaken"),sellable:!1}:e==="held"?{title:r,detail:X("map.statusHeld"),sellable:!1}:{title:r,detail:t()??"",sellable:!0}}var Ve=32,zr=70;function Xr(i,e){let t=Ve+6,o=i.y-zr;return{x:Math.min(Math.max(i.x,t),Math.max(t,e.width-t)),y:o>=t?o:Math.min(i.y+zr,e.height-t)}}var Ka=220,Xa=.08,Kt=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.host=e}syncMarker(e,t,o){let r=o.get(e);if(o.delete(e),!t){this.retire(r);return}r?.destroy();let s=this.host,n=s.seat(e);if(!n)return;let l=s.seatShape(e)?.fill(),a=$(typeof l=="string"?l:"",s.selectionColor(),Pt),c=s.selectionFocusId()===e,d=s.boothDims(n.rowId),h=s.seatRadius(),u=s.seatPoint(n),m=new Pi({name:"selection-ring",x:u.x,y:u.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:s.selectionFocusId()&&!c?.2:1});if(s.viewMode()==="perspective"){let p=s.perspectiveSeatScale(e);m.scale({x:p,y:p})}m.setAttrs({seatId:e,ringColor:a});let y={name:"selection-halo",stroke:_(s.categoryColor(n.categoryKey),Rr(Y(s.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let p=h*1.2;m.add(new Mi({...y,width:d.width+p*2,height:d.height+p*2,offsetX:(d.width+p*2)/2,offsetY:(d.height+p*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else m.add(new Re({...y,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let f={stroke:a,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(m.add(new Mi({...f,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)m.add(new Mi({...f,width:d.width+10,height:d.height+10,offsetX:(d.width+10)/2,offsetY:(d.height+10)/2,cornerRadius:7,strokeWidth:2,opacity:.55}));else{let p=Math.max(0,d.width/2-14),g=-Math.max(0,d.height/2-14);m.add(new Re({x:p,y:g,radius:10,fill:a,listening:!1})),m.add(new xi({x:p,y:g,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:Y(a)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else m.add(new Re({...f,radius:Math.max(1,h-1.25),strokeWidth:Math.min(2.5,Math.max(1.8,h*.22))})),c?m.add(new Re({...f,radius:h+2,strokeWidth:2,opacity:.55})):m.add(new xi({points:[-h*.52,0,-h*.12,h*.4,h*.6,-h*.46],stroke:"#ffffff",strokeWidth:Math.max(2.6,h*.34),lineCap:"round",lineJoin:"round",shadowColor:"#0b1220",shadowBlur:1.5,shadowOpacity:.55,listening:!1}));o.set(e,m),this.host.overlayLayer.add(m)}retire(e){let t=this.host;if(!e)return;if(t.reducedMotion()||t.isDestroyed()||typeof document<"u"&&document.hidden){e.destroy();return}let o=performance.now(),r=s=>{if(t.isDestroyed()||!e.getLayer()){e.destroy();return}let n=Math.min(1,(s-o)/160);e.opacity(1-n),t.overlayLayer.batchDraw(),n<1?requestAnimationFrame(r):(e.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(r)}play(e){let t=this.host;if(t.reducedMotion()||t.isDestroyed()||typeof document<"u"&&document.hidden)return;let o=t.seat(e);if(!o)return;let r=t.seatRadius(),s=t.seatPoint(o);this.pulses.get(e)?.destroy();let n=new Re({name:"selection-pulse",x:s.x,y:s.y,radius:r,stroke:t.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Ti(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,n),this.pulseHome().add(n);let l=t.isCached()?void 0:t.seatShape(e),a=performance.now(),c=()=>{l?.scale({x:1,y:1}),n.destroy(),this.pulses.get(e)===n&&this.pulses.delete(e),t.overlayLayer.batchDraw(),l&&!t.isCached()&&t.seatLayer.batchDraw()},d=h=>{if(t.isDestroyed()){c();return}n.getLayer()||this.pulseHome().add(n);let u=h-a,m=Ti(u/420);if(n.radius(r*m.radiusScale),n.opacity(m.opacity),l){let y=Er(u/320);l.scale({x:y,y})}t.overlayLayer.batchDraw(),l&&!t.isCached()&&t.seatLayer.batchDraw(),u<420?requestAnimationFrame(d):c()};queueMicrotask(()=>{t.isDestroyed()||requestAnimationFrame(d)})}nudge(e){let t=this.host;if(t.reducedMotion()||t.isDestroyed()||t.isCached()||typeof document<"u"&&document.hidden)return;let o=t.seatShape(e);if(!o)return;let r=performance.now(),s=()=>{o.scale({x:1,y:1}),t.seatLayer.batchDraw()},n=l=>{if(t.isDestroyed()||t.isCached()||!o.getLayer()){s();return}let a=l-r,c=Math.min(1,a/Ka),d=1+Xa*Math.sin(Math.PI*c);o.scale({x:d,y:d}),t.seatLayer.batchDraw(),c<1?requestAnimationFrame(n):s()};requestAnimationFrame(n)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Pi({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 t=this.host;if(t.isExportMode()||t.isDestroyed())return;let o=t.nearestSeat(e,xe),r=o?t.seat(o):void 0;if(!r){this.hideLoupe();return}let s=Kr(r,t.seatStatus(r.id),()=>t.priceLabel(r),t.seatClosed(r.id)),n=Xr(e,{width:t.stage.width(),height:t.stage.height()}),l=1/(t.stage.scaleX()||1),a=this.loupe??this.buildLoupe();a.seatId=r.id,a.group.position(t.screenToWorld(n)),a.group.scale({x:l,y:l}),a.group.opacity(s.sellable?1:.75),a.group.visible(!0),a.disc.fill(t.categoryColor(r.categoryKey)),a.title.text(s.title),a.title.offsetX(a.title.width()/2),a.detail.text(s.detail),a.detail.offsetX(a.detail.width()/2),t.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,t=e.canvasBackground(),o=$(t,ae(t).sectionInk),r=new Pi({name:"touch-loupe",listening:!1,visible:!1});r.add(new xi({points:[-7,Ve-4,0,Ve+12,7,Ve-4],closed:!0,fill:t,stroke:_(o,.25),strokeWidth:1,listening:!1})),r.add(new Re({radius:Ve,fill:t,stroke:_(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let s=new Re({y:-15,radius:6,fill:"#6e7bff",listening:!1}),n=new Ur({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),l=new Ur({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:_(o,.72),listening:!1,perfectDrawEnabled:!1});return r.add(s),r.add(n),r.add(l),e.overlayLayer.add(r),r.moveToTop(),this.loupe={group:r,title:n,detail:l,disc:s,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}};function $r(i,e){let t=i.width(),o=i.height(),r=1/0,s=1/0,n=-1/0,l=-1/0;for(let a of e){let c=a.getClientRect();if(!(!(c.width>1)||!(c.height>1))){if(c.x<-8||c.y<-8||c.x+c.width>t+8||c.y+c.height>o+8)return null;c.x<r&&(r=c.x),c.y<s&&(s=c.y),c.x+c.width>n&&(n=c.x+c.width),c.y+c.height>l&&(l=c.y+c.height)}}return isFinite(r)?{x:r,y:s,width:n-r,height:l-s}:null}var qr=8,Ya=.5;function Qr(i,e,t){let o=t??{x:0,y:0,width:i.width(),height:i.height()},r=$r(i,e);if(!r)return 0;Zr(i,r,o);let s=Math.min((o.width-2*qr)/r.width,(o.height-2*qr)/r.height);if(!(Math.max(r.width-o.width,r.height-o.height)>Ya)||!(s>0))return 1;let l=o.x+o.width/2,a=o.y+o.height/2;i.scale({x:i.scaleX()*s,y:i.scaleY()*s}),i.position({x:l+(i.x()-l)*s,y:a+(i.y()-a)*s});let c=$r(i,e);return c&&Zr(i,c,o),s}function Zr(i,e,t){let o=t.x+t.width/2-(e.x+e.width/2),r=t.y+t.height/2-(e.y+e.height/2);return o===0&&r===0?!1:(i.position({x:i.x()+o,y:i.y()+r}),!0)}function Ai(i){return`${i.x()},${i.y()},${i.scaleX()}`}import{Group as Ua}from"konva/lib/Group";import{Circle as jr}from"konva/lib/shapes/Circle";import{Line as $a}from"konva/lib/shapes/Line";import{Text as qa}from"konva/lib/shapes/Text";var Za=6;function Qa(i){return Y(i)?"#0b1220":"#ffffff"}function Jr(i){let{points:e}=i;if(!e.length)return null;let t=i.categoryColor??"#6e7bff",o=0,r=0;for(let s of e)o+=s.x,r+=s.y;return{count:e.length,centroid:{x:o/e.length,y:r/e.length},fill:t,ink:Qa(t)}}var Xt=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let t of this.host.sections()){if(t.logicalId!==e&&t.id!==e)continue;let o=Jr({points:this.host.ownedPoints(t),categoryColor:null});if(o)return o.centroid}return null}badgeAt(e){for(let t of this.badges)if(Math.hypot(e.x-t.centre.x,e.y-t.centre.y)<=t.radius)return t.id;return null}sync(e){if(this.group?.destroy(),this.group=null,this.badges=[],e>=be){this.host.overlayLayer.batchDraw();return}let t=Math.max(this.host.stageScale(),1e-4),o=new Ua({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let n=this.host.ownedPoints(s),l=Jr({points:n,categoryColor:this.host.sectionColor(s)});if(!l)continue;let a=Math.max(Za/2/t,1);for(let y of n)o.add(new jr({name:"owned-seat-dot",x:y.x,y:y.y,radius:a,fill:l.fill,stroke:_("#ffffff",.55),strokeWidth:Math.max(.5,a*.28),shadowColor:l.fill,shadowBlur:a*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(r.has(s.logicalId))continue;r.add(s.logicalId);let c=this.host.sections().filter(y=>y.logicalId===s.logicalId).reduce((y,f)=>y+this.host.ownedPoints(f).length,0),d=this.host.labelAnchor(s),h=11/t,u={x:d.x,y:d.y-h*2.1};o.add(new jr({name:"owned-section-badge",x:u.x,y:u.y,radius:h,fill:l.fill,stroke:_(l.ink,.35),strokeWidth:1/t,listening:!1,perfectDrawEnabled:!1})),o.add(new $a({x:u.x-h*.62,y:u.y,points:[-h*.22,0,-h*.02,h*.2,h*.34,-h*.26],stroke:l.ink,strokeWidth:Math.max(.6,h*.16),lineCap:"round",lineJoin:"round",listening:!1}));let m=new qa({x:u.x+h*.12,y:u.y-h*.5,text:String(c),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});o.add(m),this.badges.push({id:s.logicalId,centre:u,radius:h*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};function N(i){let e=ko(i);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 ze(i,e,t,o){let r=o*Math.PI/180,s=Math.cos(r),n=Math.sin(r);return[{x:-e/2,y:-t/2},{x:e/2,y:-t/2},{x:e/2,y:t/2},{x:-e/2,y:t/2}].map(l=>({x:i.x+l.x*s-l.y*n,y:i.y+l.x*n+l.y*s}))}function Yt(i,e,t,o,r,s){let n=o*Math.PI/180,l=Math.cos(n),a=Math.sin(n);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let h=e*(d/6-.5),u=t*(c/4-.5),m={x:i.x+h*l-u*a,y:i.y+h*a+u*l};if(!ie(m,r,s))return!1}return!0}function es(i,e,t){let o=N(i),r=[t];for(let n=1;n<12;n+=1)for(let l=1;l<12;l+=1){let a={x:o.x+o.width*l/12,y:o.y+o.height*n/12};ie(a,i,e)&&r.push(a)}let s=[i,...e];return r.map(n=>({point:n,room:so(n,s)})).sort((n,l)=>l.room-n.room).map(n=>n.point).filter((n,l,a)=>l===a.findIndex(c=>Math.abs(c.x-n.x)<1e-6&&Math.abs(c.y-n.y)<1e-6))}function ts(i,e){let{stageScale:t,stageX:o,stageY:r}=i;if(i.viewMode==="perspective"&&e.perspectiveAffine)return N(e.outline.map(n=>{let l=i.projectedSectionPoint(e,n);return{x:l.x*t+o,y:l.y*t+r}}));let s=e.liftWorld>0?i.isoLiftLocal(e.liftWorld):{x:0,y:0};return N(e.outline.map(n=>{let l={x:n.x+s.x,y:n.y+s.y},a=i.isoT===0?l:i.isoForward(l);return{x:a.x*t+o,y:a.y*t+r}}))}function ja(i,e){let t=i.width*i.height;if(t<=0)return 0;let o=Math.max(0,Math.min(i.x+i.width,e.width)-Math.max(i.x,0)),r=Math.max(0,Math.min(i.y+i.height,e.height)-Math.max(i.y,0));return o*r/t}function is(i){let{current:e,viewport:t}=i,o=new Map;for(let l of i.sections){let a=ja(l.bounds,t)*l.members;a<=0||o.set(l.logicalId,(o.get(l.logicalId)??0)+a)}if(!o.size)return e;let r=null,s=0;for(let[l,a]of o)a>s&&(s=a,r=l);if(!r||r===e)return e;let n=e!=null?o.get(e)??0:0;return s>n*1.35?r:e}import{Text as el}from"konva/lib/shapes/Text";function Ja(i,e){return i.x<e.x+e.width&&e.x<i.x+i.width&&i.y<e.y+e.height&&e.y<i.y+i.height}var Ke=class{constructor(){this.cells=new Map}insert(e){for(let t of this.keys(e)){let o=this.cells.get(t);o?o.push(e):this.cells.set(t,[e])}}collisionCount(e){let t=new Set,o=0;for(let r of this.keys(e))for(let s of this.cells.get(r)??[])t.has(s)||(t.add(s),Ja(e,s)&&o++);return o}keys(e){let t=Math.floor(e.x/Je),o=Math.floor((e.x+Math.max(0,e.width))/Je),r=Math.floor(e.y/Je),s=Math.floor((e.y+Math.max(0,e.height))/Je),n=[];for(let l=r;l<=s;l++)for(let a=t;a<=o;a++)n.push(`${a}:${l}`);return n}};function os(i,e){let t=i.sections.filter(y=>y.id===e||y.logicalId===e),o=t.map(y=>{if(i.viewMode==="perspective"&&y.perspectiveAffine)return N(y.outline.map(g=>i.projectedSectionPoint(y,g)));let f=y.liftWorld>0?i.isoLiftLocal(y.liftWorld):{x:0,y:0},p=y.outline.map(g=>{let b={x:g.x+f.x,y:g.y+f.y};return i.isoT===0?b:i.isoForward(b)});return N(p)});if(!o.length)return null;let r=Math.min(...o.map(y=>y.x)),s=Math.min(...o.map(y=>y.y)),n=Math.max(...o.map(y=>y.x+y.width)),l=Math.max(...o.map(y=>y.y+y.height)),a=new Set(t.flatMap(y=>y.memberIds));for(let y of a){let f=i.seatById.get(y);if(!f)continue;let p=i.renderedSeatPoint(f);r=Math.min(r,p.x-i.seatR),s=Math.min(s,p.y-i.seatR),n=Math.max(n,p.x+i.seatR),l=Math.max(l,p.y+i.seatR)}let c=y=>{[y.x,y.y,y.width,y.height].every(Number.isFinite)&&(r=Math.min(r,y.x),s=Math.min(s,y.y),n=Math.max(n,y.x+y.width),l=Math.max(l,y.y+y.height))},d=y=>{let f={x:y.x+y.width/2,y:y.y+y.height/2};return t.some(p=>ie(f,p.outline,p.holes))};for(let{node:y,backdrop:f}of i.freeTextById.values()){let p=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});d(p)&&(c(p),f&&c(f.getClientRect({relativeTo:i.bgLayer,skipShadow:!0})))}for(let{node:y}of i.iconNodeById.values()){let f=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});d(f)&&c(f)}let h=new Ke;for(let{node:y}of i.freeTextById.values()){let f=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:f.x-Q,y:f.y-Q,width:f.width+Q*2,height:f.height+Q*2})}for(let y of i.rowLabelPlan){let f=(y.focusKeys??[]).some(S=>S===e||t.some(v=>S===v.id||S===v.logicalId)),p=new el({text:y.text,fontSize:y.fontSize,fontStyle:"700",fontFamily:i.labelFont(),rotation:y.rotation,listening:!1});p.offsetX(p.width()/2),p.offsetY(p.height()/2);let g=i.resolveAutomaticRowLabelPosition(p,y,h),b=i.rowLabelBox(p,g);f&&c(b),h.insert(b),p.destroy()}let u=Math.max(n-r,l-s),m=Math.max(i.seatR*2,Math.min(24,u*.025));return{x:r-m,y:s-m,width:Math.max(1,n-r+m*2),height:Math.max(1,l-s+m*2)}}import{Rect as tl}from"konva/lib/shapes/Rect";import{Text as rs}from"konva/lib/shapes/Text";function ss(i,e){if(!e.zones?.length||!i.sections.length)return;let t=Ar(i.canvasBackground),o=new Map;for(let r of i.sections)r.zone&&(o.get(r.zone)??o.set(r.zone,[]).get(r.zone)).push(r);for(let r of e.zones){let s=o.get(r.id);if(!s||!s.length)continue;let n=s[0];for(let m of s)m.centroid.y<n.centroid.y&&(n=m);let l=n.centroid.x,a=n.centroid.y,c=1/0;for(let m of s)for(let y of m.memberIds){let f=i.seatById.get(y),p=f&&i.catPrice.get(f.categoryKey);typeof p=="number"&&p<c&&(c=p)}let d=new tl({x:l,y:a,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:t.plate,stroke:_(r.color??n.outlineTint,ur),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(d);let h=new rs({x:l,y:a,text:r.label.toUpperCase(),fontSize:Ot,fontStyle:Ne,letterSpacing:.5,fontFamily:i.labelFont(),fill:t.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});h.offsetX(h.width()/2),h.offsetY(h.height()/2),i.bgLayer.add(h);let u=null;isFinite(c)&&(u=new rs({x:l,y:a,text:X("map.fromPrice",{price:ot(c,i.currency)}),fontSize:Dt,fontStyle:Ht,fontFamily:i.labelFont(),fill:t.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),u.offsetX(u.width()/2),i.bgLayer.add(u)),i.zones.push({id:r.id,anchor:{x:l,y:a},back:d,background:t.plate,name:r.label.toUpperCase(),label:h,sub:u})}}import{Circle as ll}from"konva/lib/shapes/Circle";import{Line as cl}from"konva/lib/shapes/Line";import{Rect as dl}from"konva/lib/shapes/Rect";import{Text as hl}from"konva/lib/shapes/Text";function Se(i,e){return e.length===0?!!i.accessible:!!i.accessibility?.some(t=>e.includes(t))}function Ri(i,e){return Se(i,e)?"match":i.accessibility?.includes("companion")?"companion":"other"}var ns=.35,as=.7,st="#0b1220",nt="#ffffff",ls="#0b1220",cs="#232c40",ds="#8b93a7";function Ei(i,e,t="normal"){let o=i?"bold":t;return e?`italic ${o}`.trim():o}var _i="#f7f8fb";import{Shape as ol}from"konva/lib/Shape";import{Circle as rl}from"konva/lib/shapes/Circle";import{Rect as sl}from"konva/lib/shapes/Rect";var il={M:2,L:2,Q:4,C:6,Z:0},Bi=new Map;function Fi(i){let e=Bi.get(i);if(e)return e;let t=Mt(i);if(!t)return Bi.set(i,[]),[];let o=t.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],r=[],s=0;for(;s<o.length;){let n=o[s++],l=il[n];if(l===void 0||s+l>o.length)throw new Error(`Invalid path data for seat glyph "${i}".`);let a=o.slice(s,s+l).map(Number);if(a.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${i}".`);s+=l,n==="M"||n==="L"?r.push({command:n,points:a}):n==="Q"?r.push({command:n,points:a}):n==="C"?r.push({command:n,points:a}):r.push({command:"Z",points:[]})}return Bi.set(i,r),r}function hs(i,e,t,o=0,r=0){let s=Fi(e),n=Lo(e).bounds;if(!s.length||!n||!(t>0))return!1;let l=To(n,t);i.save(),i.translate(o,r),i.scale(l.scale,l.scale),i.translate(-l.centreX,-l.centreY);for(let a of s)a.command==="M"?i.moveTo(a.points[0],a.points[1]):a.command==="L"?i.lineTo(a.points[0],a.points[1]):a.command==="Q"?i.quadraticCurveTo(a.points[0],a.points[1],a.points[2],a.points[3]):a.command==="C"?i.bezierCurveTo(a.points[0],a.points[1],a.points[2],a.points[3],a.points[4],a.points[5]):i.closePath();return i.restore(),!0}function us(i,e){i.beginPath(),i.arc(0,0,e,0,Math.PI*2,!1),i.closePath()}var at=class extends ol{_sceneFunc(e){let t=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,r=Fi(o),s=this.attrs.seatGlyphDetail,n;if(s===void 0){let l=this.getAbsoluteScale(),a=Math.max(Math.abs(l.x),Math.abs(l.y)),c=Number.isFinite(a)&&a>0?a:1;n=t*2*c>=16}else n=s;if(!r.length||!n){us(e,t),e.fillStrokeShape(this);return}e.beginPath(),hs(e,o,t),e.fillStrokeShape(this)}_hitFunc(e){us(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 nl(i,e){return i==="circle"||!Mt(i)?null:new at({x:e.x,y:e.y,seatRadius:e.radius,seatGlyph:i,...e.detail===void 0?{}:{seatGlyphDetail:e.detail},...e.fill?{fill:e.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function ps(i){let{x:e,y:t,radius:o}=i;return i.wheelchairBay?new sl({x:e,y:t,width:o*2,height:o*2,offsetX:o,offsetY:o,cornerRadius:2,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):nl(i.glyph,{x:e,y:t,radius:o,detail:i.detail,fill:i.fill})??new rl({x:e,y:t,radius:o,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function al(i,e){return i*2*e>=16}function fs(i,e,t,o){let r=al(e,t);if(r===o||!i.length)return r;for(let s of i)s.setAttr("seatGlyphDetail",r);return r}function ms(i){let e=[...i.seats].sort((t,o)=>(i.perspectiveSeatDepth.get(o.id)??0)-(i.perspectiveSeatDepth.get(t.id)??0));for(let t of e){if(t.kind==="booth"){ul(i,t);continue}let o=i.seatContainer(t.id),r=ps({x:t.x,y:t.y,radius:i.seatR,detail:i.seatGlyphDetail,glyph:Co(t.glyph,i.catByKey.get(t.categoryKey)),wheelchairBay:t.wheelchairSpaceType==="no-seat"});if(r instanceof at&&i.glyphMarkers.push(r),r.setAttr("seatId",t.id),i.circleById.set(t.id,r),i.paintSeat(r,t.id),o.add(r),t.accessible){if(t.wheelchairSpaceType!=="no-seat"){let s=new ll({x:t.x,y:t.y,radius:i.seatR+1.5,stroke:gt(t.accessibility),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});i.accessRingById.set(t.id,s),o.add(s)}if(t.accessibility?.includes("wheelchair")&&Ct(t.accessibility)){let s=i.buildAccessGlyph(t,typeof r.fill()=="string"?r.fill():"");i.accessGlyphById.set(t.id,s),o.add(s)}}}}function ul(i,e){let t=i.seatContainer(e.id),o=i.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},r=e.x,s=e.y,n;o.points&&o.points.length>=3?(n=new cl({x:e.x,y:e.y,points:o.points.flatMap(a=>[a.x,a.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),r=e.x+o.points.reduce((a,c)=>a+c.x,0)/o.points.length,s=e.y+o.points.reduce((a,c)=>a+c.y,0)/o.points.length):n=new dl({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}),n.setAttr("seatId",e.id),i.circleById.set(e.id,n),t.add(n);let l=new hl({x:r,y:s,text:e.displayLabel??e.label,fontSize:Ce,fontStyle:"600",fontFamily:i.labelFont(),fill:i.theme.seatLabelColor??st,listening:!1,perfectDrawEnabled:!1});l.offsetX(l.width()/2),l.offsetY(l.height()/2),l.visible(!1),i.setHasBoothText(),i.boothLabelById.set(e.id,l),t.add(l),i.paintSeat(n,e.id)}function ys(i,e,t,o){let r=null,s=1/0,n=i.stage.scaleX()||1;for(let l of i.seats){if(!o?.includeUnavailable&&!i.selection.has(l.id)&&!i.isSelectable(l.id))continue;let a=i.worldToScreen(l),c=i.viewMode==="perspective"?i.perspectiveSeatScale.get(l.id)??1:1,d=i.seatR*n*c+t,h=Math.hypot(a.x-e.x,a.y-e.y);h<=d&&h<s&&(s=h,r=l.id)}return r}function gs(i){if(!i.objectFloor.size)return null;let e=i.stage.getPointerPosition();if(!e)return null;let t=i.screenToWorld(e),o=null,r=1/0;for(let s of i.seats){let n=i.renderedSeatPoint(s),l=n.x-t.x,a=n.y-t.y,c=l*l+a*a;c<r&&(r=c,o=s.rowId)}return o?i.objectFloor.get(o)??null:null}import{Circle as pl}from"konva/lib/shapes/Circle";import{Line as fl}from"konva/lib/shapes/Line";function bs(i,e,t,o){let r=i.seatRadius(),s=new pl({x:t.x,y:t.y,radius:r,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),n=i.viewMode()==="perspective"?i.perspectiveSeatScale(e):1;s.scale({x:n,y:n}),i.overlayLayer.add(s);let l=performance.now(),a=620,c=d=>{if(!s.getLayer())return;let h=Math.min(1,(d-l)/a);s.radius(r*(1+h*1.8)),s.opacity(.9*(1-h)),i.overlayLayer.batchDraw(),h<1?requestAnimationFrame(c):(s.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(c)}function Ss(i,e,t){for(let o of e){let r=i.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(h=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,h))):o.outline.map(h=>{let u=o.liftWorld>0?i.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:h.x+u.x,y:h.y+u.y}}),s=r.reduce((h,u)=>({x:h.x+u.x,y:h.y+u.y}),{x:0,y:0});s.x/=r.length,s.y/=r.length;let n=new fl({x:s.x,y:s.y,points:r.flatMap(h=>[h.x-s.x,h.y-s.y]),closed:!0,stroke:t,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:t,shadowBlur:14,shadowOpacity:.7});i.overlayLayer.add(n),i.overlayLayer.batchDraw();let l=()=>{n.getLayer()&&(n.destroy(),i.overlayLayer.batchDraw())};if(i.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(l,520);continue}let a=performance.now(),c=820,d=h=>{if(i.isDestroyed()||!n.getLayer())return;let u=Math.min(1,(h-a)/c),y=1+(1-Math.pow(1-u,3))*.04;n.scale({x:y,y}),n.opacity(.92*(1-u)),i.overlayLayer.batchDraw(),u<1?requestAnimationFrame(d):l()};requestAnimationFrame(d)}}import{Group as bl}from"konva/lib/Group";import{Shape as Sl}from"konva/lib/Shape";import{Group as ml}from"konva/lib/Group";import{Shape as yl}from"konva/lib/Shape";function gl(i,e,t){let o=e.length,r={x:(e[o-1].x+e[0].x)/2,y:(e[o-1].y+e[0].y)/2};i.moveTo(r.x,r.y);for(let s=0;s<o;s+=1){let n=e[s],l=e[(s+1)%o],a=e[(s-1+o)%o],c=Math.min(Math.hypot(n.x-a.x,n.y-a.y)/2,Math.hypot(l.x-n.x,l.y-n.y)/2);i.arcTo(n.x,n.y,l.x,l.y,Math.max(0,Math.min(t,c)))}i.closePath()}function Ee(i,e,t,o){let r=qe(i)>0,s=t.cornerRadius&&t.cornerRadius>0?t.cornerRadius:0;return new yl({...t,sceneFunc(n,l){n.beginPath();let a=d=>{if(d.length){if(s>0&&d.length>=3)return gl(n,d,s);n.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h+=1)n.lineTo(d[h].x,d[h].y);n.closePath()}};o?(d=>{n.moveTo(d.start.x,d.start.y);let h=d.start;for(let u of d.segments)u.kind==="line"?n.lineTo(u.end.x,u.end.y):u.kind==="arc"?n.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):n.bezierCurveTo(u.control1.x,u.control1.y,u.control2.x,u.control2.y,u.end.x,u.end.y),h=u.end;n.closePath()})(o):a(i);for(let d of e??[]){let h=qe(d)>0;a(h===r?[...d].reverse():d)}n.fillStrokeShape(l)},perfectDrawEnabled:!1})}var lt=class extends ml{constructor(){super(...arguments);this.viewportCulled=!1}setViewportCulled(t){t!==this.viewportCulled&&(this.viewportCulled=t,t||super._clearSelfAndDescendantCache())}isViewportCulled(){return this.viewportCulled}drawScene(...t){return this.viewportCulled?this:super.drawScene(...t)}drawHit(...t){return this.viewportCulled?this:super.drawHit(...t)}_clearSelfAndDescendantCache(t){if(!this.viewportCulled){super._clearSelfAndDescendantCache(t);return}this._clearCache(t)}};function vs(i,e){if(!e.length)return null;let t=new bl({listening:!1});for(let o of e){let r=i.viewMode==="perspective"&&o.perspectiveAffine,s=r?o.outline.map(l=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,l))):o.outline,n=r?o.holes.map(l=>l.map(a=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,a)))):o.holes;t.add(Ee(s,n,{fill:Tr,stroke:_("#ffffff",.1),strokeWidth:1,listening:!1},r?void 0:o.outlinePath))}return i.bgLayer.add(t),t.moveToTop(),t}function ws(i,e){let{bounds:t}=i,r=Math.max(t.width,t.height,1)*4+1e3,s=[{x:t.x-r,y:t.y-r},{x:t.x+t.width+r,y:t.y-r},{x:t.x+t.width+r,y:t.y+t.height+r},{x:t.x-r,y:t.y+t.height+r}],n=new Sl({fill:i.canvasBackground,opacity:1-Me,listening:!1,perfectDrawEnabled:!1,sceneFunc:(l,a)=>{let c=d=>{if(d.length){l.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h++)l.lineTo(d[h].x,d[h].y);l.closePath()}};l.beginPath(),c(s);for(let d of e){let h=i.viewMode==="perspective"&&d.perspectiveAffine?d.outline.map(u=>i.perspectiveLocalPoint(i.projectedSectionPoint(d,u))):d.outline.map(u=>{let m=d.liftWorld>0?i.isoLiftLocal(d.liftWorld):{x:0,y:0};return{x:u.x+m.x,y:u.y+m.y}});c(qe(h)>0?[...h].reverse():h)}l.fillStrokeShape(a)}});return i.overlayLayer.add(n),n.moveToTop(),n}import{Rect as Hn}from"konva/lib/shapes/Rect";import{Line as Sc}from"konva/lib/shapes/Line";import{Text as Gn}from"konva/lib/shapes/Text";import{Path as vc}from"konva/lib/shapes/Path";var Ut=1.12;function ks(i,e,t,o){if(e.width<=0||e.height<=0)return i.scaleX();let r=o??{x:0,y:0,width:i.width(),height:i.height()},s=Math.min(r.width/(e.width*Ut),r.height/(e.height*Ut));return G(s,t.min,t.max)}function Ls(i,e,t,o){let r=G(e,o.min,o.max),s=i.scaleX();if(r===s)return!1;let n=(t.x-i.x())/s,l=(t.y-i.y())/s;return i.scale({x:r,y:r}),i.position({x:t.x-n*r,y:t.y-l*r}),!0}function Ts(i,e,t,o,r){let s=r??{x:0,y:0,width:i.width(),height:i.height()},n=Math.min(s.width/(e.width*Ut),s.height/(e.height*Ut)),l=G(Math.max(n,o??t.min),t.min,t.max);i.scale({x:l,y:l}),i.position({x:s.x+s.width/2-(e.x+e.width/2)*l,y:s.y+s.height/2-(e.y+e.height/2)*l})}import{Text as vl}from"konva/lib/shapes/Text";function Cs(i){let e=Ce,t=new vl({fontSize:fe,fontStyle:"600",fontFamily:i.labelFont(),listening:!1}),o=i.seatR*2-3;for(let r of i.seats){if(r.kind==="booth"){e=Math.min(e,Ce);continue}let s=fe*i.seatLabelScale(r);t.fontSize(s),t.text(It(r.displayLabel??r.label));let n=t.width()>o?Math.max(je,s*o/t.width()):s;e=Math.min(e,n)}return t.destroy(),U/Math.max(je,e)}var Oi={top:0,right:0,bottom:0,left:0};function Is(i){let e=t=>typeof t=="number"&&Number.isFinite(t)&&t>0?t:0;return i?{top:e(i.top),right:e(i.right),bottom:e(i.bottom),left:e(i.left)}:{...Oi}}var wl=.7;function Ps(i,e,t){let{top:o,right:r,bottom:s,left:n}=t,l=(u,m,y)=>{let f=u+m,p=y*wl;if(f<=p||f<=0)return[u,m];let g=p/f;return[u*g,m*g]},[a,c]=l(n,r,i),[d,h]=l(o,s,e);return{x:a,y:d,width:Math.max(1,i-a-c),height:Math.max(1,e-d-h)}}function xs(i){return{x:i.x(),y:i.y(),scale:i.scaleX()}}function Ms(i,e){return!Number.isFinite(e.x)||!Number.isFinite(e.y)||!(e.scale>0)?!1:(i.scale({x:e.scale,y:e.scale}),i.position({x:e.x,y:e.y}),!0)}function $t(i){return{x:i.x+i.width/2,y:i.y+i.height/2}}function As(i,e){let t=e({x:i.x,y:i.y}),o=e({x:i.x+i.width,y:i.y+i.height});return{x:Math.min(t.x,o.x),y:Math.min(t.y,o.y),width:Math.abs(o.x-t.x),height:Math.abs(o.y-t.y)}}function Es(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?ir:tr}function _s(i){return Math.max(i*1.05,qo,se*1.3)}function Di(i,e){let t=1/0,o=-1/0,r=1/0,s=-1/0;for(let n of i)t=Math.min(t,n.x),o=Math.max(o,n.x),r=Math.min(r,n.y),s=Math.max(s,n.y);return t-=e,o+=e,r-=e,s+=e,{x:t,y:r,width:Math.max(40,o-t),height:Math.max(40,s-r)}}function Bs(i){let{stageWidth:e,stageHeight:t,fullBounds:o,visibleBounds:r,seatPoints:s,minScale:n}=i;if(!s.length)return null;let l=1.12;if(Math.min(e/(o.width*l),t/(o.height*l))>=n)return null;let c=i.tapAnchor??{x:r.x+r.width/2,y:r.y+r.height/2},d=s[0],h=1/0;for(let f of s){let p=(f.x-c.x)**2+(f.y-c.y)**2;p<h&&(d=f,h=p)}let u=e/(n*l),m=t/(n*l),y=Di(s,0);return{bounds:{x:Rs(d.x,u,y.x,y.width),y:Rs(d.y,m,y.y,y.height),width:u,height:m},minScale:n}}function Rs(i,e,t,o){return o<=e?t+o/2-e/2:Math.min(Math.max(i-e/2,t),t+o-e)}var Gs=.5,D=Math.SQRT1_2,kl="#f3f4f6",Fs=4;function Ll(i){let e=i.fraction;return typeof e!="number"||!Number.isFinite(e)?Gs:Math.min(1,Math.max(0,e))}function Tl(i){return i==="booked"||i==="not_for_sale"?it:Nt}function Os(i,e){return Number.parseInt(i.slice(e,e+2),16)}function Ds(i){let e=i.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,t,o,r]=e.toLowerCase();return`#${t}${t}${o}${o}${r}${r}`}function Cl(i,e,t){let o=Ds(i),r=Ds(e);if(!o||!r)return i;let s=Math.min(1,Math.max(0,t)),n="#";for(let l=1;l<7;l+=2){let a=Math.round(Os(o,l)*(1-s)+Os(r,l)*s);n+=a.toString(16).padStart(2,"0")}return n}function Hs(i,e,t,o){let r=t*4,s=e*D,n=-e*D,l=o*D*2*r,a=o*-D*2*r,c=s+r*D,d=n+r*D,h=s-r*D,u=n-r*D;i.beginPath(),i.moveTo(c,d),i.lineTo(h,u),i.lineTo(h+l,u+a),i.lineTo(c+l,d+a),i.closePath(),i.clip()}function Il(i,e){let t=e*4,o=Math.max(e*.45,1);i.beginPath();for(let r=-Fs;r<=Fs;r++){let s=r*o*2,n=s+o,l=s*D,a=-s*D,c=n*D,d=-n*D;i.moveTo(l+t*D,a+t*D),i.lineTo(l-t*D,a-t*D),i.lineTo(c-t*D,d-t*D),i.lineTo(c+t*D,d+t*D),i.closePath()}i.clip()}function qt(i,e){i._sceneFunc(e)}function Ns(i){let e=this,t=e.attrs,o=t.markRadius||1,r=t.fill,s=e.getStage(),n=Math.abs((s?s.scaleX():1)*(e.scaleX()||1))||1;if(o*2*n<16){t.fill=t.markMidtone??r,qt(e,i),t.fill=r;return}let a=(1-2*(t.markFraction??Gs))*o;i.save(),Hs(i,a,o,1),t.fill=t.markBase??r,qt(e,i),i.restore(),i.save(),Hs(i,a,o,-1),t.fill=t.markFill??r,qt(e,i),t.markHatch&&(Il(i,o),t.fill=kl,qt(e,i)),i.restore(),t.fill=r}function Pl(i,e,t,o,r,s){let n=Ll(e),l=Tl(t),a=i.attrs;a.markFraction=n,a.markBase=o,a.markFill=l,a.markMidtone=Cl(o,l,1-n),a.markHatch=s,a.markRadius=r>0?r:1,i.fill(a.markMidtone),i.stroke(""),i.strokeWidth(0),i.dash([]),i.opacity(1),i.sceneFunc(Ns)}function xl(i){i.setAttr("sceneFunc",void 0)}function Hi(i){return i.attrs.sceneFunc===Ns}var Zt=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,t){let o=new Set;for(let[r,s]of Object.entries(e))t.has(r)&&(s&&s.kind==="partial"?(this.marks.set(r,s),o.add(r)):this.marks.delete(r)&&o.add(r));return o}paint(e,t,o,r,s,n,l){let a=l?void 0:this.marks.get(t);if(!a){Hi(e)&&xl(e);return}Pl(e,a,o,r,s,n)}};function Qt(i){let e=i.getClientRect({skipTransform:!0,skipShadow:!0});!Number.isFinite(e.width)||!Number.isFinite(e.height)||(i.offsetX(e.x+e.width/2),i.offsetY(e.y+e.height/2))}var Ws=.85,Ml=[2,2],Al=1,Vs=.6;function Rl(i){return Y(i)?"#334155":"#e2e8f0"}function zs(i,e,t){return i==="held"?{fill:Nt,stroke:Rl(e),strokeWidth:Al,dash:[...Ml],opacity:1,scale:1}:i==="booked"||i==="not_for_sale"?t?{fill:"rgba(0,0,0,0)",stroke:it,strokeWidth:1.5,dash:[],opacity:.9,scale:Ws}:{fill:it,stroke:"",strokeWidth:0,dash:[],opacity:i==="booked"?.45:.6,scale:Ws}:null}var Gi=1e6;function El(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}var jt=class{constructor(e,t=El()){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.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||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 t=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,t)&&this.applyPointerMove(t)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId)};this.onTouchStart=e=>{e.preventDefault();for(let t=0;t<e.changedTouches.length;t+=1){let o=e.changedTouches.item(t);o&&this.beginPointer(Gi+o.identifier,this.toLocal(o.clientX,o.clientY),"touch",0)}};this.onTouchMove=e=>{e.preventDefault();let t=null;for(let o=0;o<e.changedTouches.length;o+=1){let r=e.changedTouches.item(o);if(!r)continue;let s=this.toLocal(r.clientX,r.clientY);this.updatePointer(Gi+r.identifier,s)&&(t=s)}t&&this.applyPointerMove(t)};this.onTouchEnd=e=>{e.preventDefault();for(let t=0;t<e.changedTouches.length;t+=1){let o=e.changedTouches.item(t);o&&this.endPointer(Gi+o.identifier)}};this.host=e,this.useWebKitTouchEvents=t}get moved(){return this.movedPx}attach(){let{container:e}=this.host;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;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<Zo}toLocal(e,t){let o=this.host.container.getBoundingClientRect();return{x:e-o.left,y:t-o.top}}beginPointer(e,t,o,r){if(this.host.cancelGlide(),this.pointers.set(e,t),this.pointers.size===1)this.movedPx=0,this.singleTouch=o==="touch",this.singleTouch&&this.host.touchProbeStart?.(t),this.pinch=null,this.panStart=t,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:o,button:r})?(this.host.beginMarquee(t),this.panLast=null):this.panLast=t;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[s,n]=[...this.pointers.values()],l={x:(s.x+n.x)/2,y:(s.y+n.y)/2},a=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(n.x-s.x,n.y-s.y),startScale:a,worldMid:{x:(l.x-this.host.stage.x())/a,y:(l.y-this.host.stage.y())/a}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=ke+1}}updatePointer(e,t){return this.pointers.has(e)?(this.pointers.set(e,t),this.pointers.size===1&&this.panStart?this.movedPx=Math.max(this.movedPx,Math.hypot(t.x-this.panStart.x,t.y-this.panStart.y)):this.pointers.size>=2&&(this.movedPx=ke+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>ke?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[t,o]=[...this.pointers.values()],r=Math.hypot(o.x-t.x,o.y-t.y);if(this.pinch.startDist<1)return;let s={x:(t.x+o.x)/2,y:(t.y+o.y)/2},{min:n,max:l}=this.host.zoomBounds(),a=G(this.pinch.startScale*(r/this.pinch.startDist),n,l);this.host.stage.scale({x:a,y:a}),this.host.stage.position({x:s.x-this.pinch.worldMid.x*a,y:s.y-this.pinch.worldMid.y*a}),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=ke)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}this.host.stage.position({x:this.host.stage.x()+(e.x-this.panLast.x),y:this.host.stage.y()+(e.y-this.panLast.y)}),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 _l}from"konva/lib/shapes/Circle";import{Group as Bl}from"konva/lib/Group";import{Text as Fl}from"konva/lib/shapes/Text";var Ks=13,Ol=15,Dl=.3,Hl=.08;function $s(i,e,t){return!!(i&&t!==i||e&&!e.has(t))}function Gl(i,e){return!e||i.available==null?`cap ${i.capacity}`:i.available<=0?X("map.soldOut"):X("map.seatsLeft",{count:i.available})}function Nl(i,e){return e&&i.available!=null&&i.available<=0}function qs(i){for(let e of i.gaById.values()){let t=i.filteredOut(e.categoryKey),o=i.overviewHidden(e),r=Nl(e,i.pickerMode),s=i.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:i.dimmed(e.categoryKey)?Ie*Hl:r?Ie*Dl:Ie),e.polygon.listening(!i.exportMode&&!o&&!t&&!r),e.polygon.stroke(s>0?i.selectionColor:e.strokeColor),e.polygon.strokeWidth(s>0?3:1.5),Wl(i,e,r,s,o,i.dimmed(e.categoryKey))}}function Wl(i,e,t,o,r,s){if(e.capacityNode){let n=Gl(e,i.pickerMode);e.capacityNode.text()!==n&&(e.capacityNode.text(n),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(t?.75:1)}Vl(i,e,r||s),o>0&&!r?Kl(i,e,o):e.chip&&e.chip.visible(!1)}var Ni=9,Xs=.86;function Vl(i,e,t){let{labelNode:o,capacityNode:r}=e;if(!o&&!r)return;let s=Math.max(i.effScale(),1e-4);if(t){o?.visible(!1),r?.visible(!1);return}if(!i.pickerMode){o?.visible(i.labelLegible(o.fontSize())),r?.visible(i.labelLegible(r.fontSize()));return}let n=zl(e,s),l=Ys(o,Lt,n.width*Xs,s),a=Ys(r,Tt,n.width*Xs,s),c=l!=null,d=a!=null&&c&&l+a+Ni<=n.height;Us(o,c?l:null,e.labelPoint.y-Ni/s,s),Us(r,d?a:null,e.labelPoint.y+Ni/s,s)}function zl(i,e){let t=1/0,o=-1/0,r=1/0,s=-1/0;for(let n of i.points)n.x<t&&(t=n.x),n.x>o&&(o=n.x),n.y<r&&(r=n.y),n.y>s&&(s=n.y);return Number.isFinite(t)?{width:(o-t)*e,height:(s-r)*e}:{width:0,height:0}}function Ys(i,e,t,o){if(!i||!i.text())return null;i.fontSize(e/o);let r=i.width()*o;if(r<=t||r<=0)return e;let s=e*(t/r);return s>=U?s:null}function Us(i,e,t,o){if(i){if(e==null){i.visible(!1);return}i.fontSize(e/o),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t),i.visible(!0)}}function Kl(i,e,t){if(!e.chip){let o=new Bl({x:e.labelPoint.x,y:e.labelPoint.y-Ks-16,listening:!1}),r=new _l({radius:Ks,fill:i.selectionColor,listening:!1,perfectDrawEnabled:!1}),s=new Fl({text:String(t),fontSize:Ol,fontStyle:"800",fontFamily:i.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});o.add(r),o.add(s),i.bgLayer.add(o),e.chip=o,e.chipText=s}e.chipText&&e.chipText.text()!==String(t)&&e.chipText.text(String(t)),e.chipText&&(e.chipText.offsetX(e.chipText.width()/2),e.chipText.offsetY(e.chipText.height()/2)),e.chip.visible(!0),e.chip.moveToTop()}function Zs(i,e){let t=!1;for(let[o,r]of Object.entries(e)){let s=i.get(o);s&&(r.available!==void 0&&s.available!==r.available&&(s.available=r.available,t=!0),r.selected!==void 0&&s.selected!==r.selected&&(s.selected=r.selected,t=!0))}return t}function Qs(i,e){return i===null||e===null?i===e:i.size===e.size&&[...i].every(t=>e.has(t))}function js(i,e){let t=null;for(let o of i){let r=e.get(o)?.logicalId;if(!r||t!=null&&t!==r)return null;t=r}return t}function Js(i,e){if(!e?.size)return!1;for(let t of i)if(e.has(t))return!1;return!0}import{Rect as en}from"konva/lib/shapes/Rect";import{Text as Xl}from"konva/lib/shapes/Text";function tn(i){let e=i.effScale(),t=i.stage.scaleX(),o={width:i.stage.width(),height:i.stage.height()},r=f=>Math.round(f*100)/100,s=new Map(i.overlayLayer.find(".selection-ring").map(f=>[String(f.getAttr("seatId")??""),String(f.getAttr("ringColor")??i.effSelection)])),n=i.seats.map(f=>{let p=i.circleById.get(f.id),g=i.boothLabelById.get(f.id)??i.seatLabelById.get(f.id),b=i.viewMode==="perspective"?i.perspectiveSeatScale.get(f.id)??1:1,S=(i.viewMode==="perspective"?t:e)*b,v=f.kind==="booth"?Ce:fe*i.seatLabelScale(f),w=i.viewMode==="perspective"&&f.kind!=="booth"?e*b:S,k=r((g?.fontSize()??v)*w),T=i.worldToScreen(f),C=g?g.width()*t*b:0,L=g?g.height()*(i.viewMode==="perspective"&&f.kind==="booth"?t:e)*b:0,I=T.x-C/2<0||T.x+C/2>o.width||T.y-L/2<0||T.y+L/2>o.height,M=i.focusedSeatOpacity(f.id,p?.getAbsoluteOpacity()??0),x=i.seatSection.get(f.id),A=!!g?.isVisible()&&M>=.5&&!I,P;A||(M<.5?P="dimmed-or-unavailable":k<U?P="below-minimum-size":I?P="outside-viewport":g?P="renderer-hidden":P="clutter-or-fit");let H=p instanceof en?p.width()*t*b:i.seatR*2*S,E=p instanceof en?p.height()*(i.viewMode==="perspective"?t:e)*b:i.seatR*2*S,j=2*(i.seatR*S+xe),V=p?.fill(),z=g?.fill(),J=i.accessGlyphById.get(f.id),F=J?.getAbsoluteScale();return{seatId:f.id,label:f.label,kind:f.kind==="booth"?"booth":"seat",markerShape:f.kind==="booth"?"booth":f.wheelchairSpaceType==="no-seat"?"square":"circle",...f.wheelchairSpaceType?{wheelchairSpaceType:f.wheelchairSpaceType}:{},categoryKey:f.categoryKey,...x?{sectionId:x.id}:{},...x?.zone?{zoneId:x.zone}:{},status:i.statusById.get(f.id)??"free",selected:i.selection.has(f.id),visible:A,renderedFontPx:k,fill:typeof V=="string"?V:"",ink:typeof z=="string"?z:p?i.seatLabelInk(f,p):i.seatPreferredLabelInk(f),...s.has(f.id)?{selectionRingColor:s.get(f.id)}:{},opacity:r(M),...J?{accessibilityMarker:{glyphVisible:J.isVisible(),glyphWidthPx:r(we*Math.abs(F?.x??0)),emphasizedByFilter:i.accessGlyphFilterEmphasized(f.id)}}:{},pointerTarget:{active:!i.cached&&!i.seatViewportCulled(f.id)&&!!p?.isVisible()&&!!p?.isListening()&&i.isSelectable(f.id),directWidthPx:r(H),directHeightPx:r(E),effectiveMinimumPx:r(Math.max(Math.min(H,E),j))},screenCenter:{x:r(T.x),y:r(T.y)},...A?{screenBox:{x:r(T.x-C/2),y:r(T.y-L/2),width:r(C),height:r(L)}}:{},...P?{hiddenReason:P}:{}}}),l=n.filter(f=>f.visible).length,a=(f,p,g,b,S,v)=>{let w=ze({x:b.x(),y:b.y()},b.width(),b.height(),b.rotation()),k=v&&v.liftWorld>0?i.isoLiftLocal(v.liftWorld):{x:0,y:0},T=N(w.map(A=>i.worldToScreen({x:A.x+k.x,y:A.y+k.y}))),C=r(b.opacity()),L=b.fill(),I=T.x+T.width<0||T.x>o.width||T.y+T.height<0||T.y>o.height,M=b.isVisible()&&C>.05&&!I,x=v?Yt({x:b.x(),y:b.y()},b.width(),b.height(),b.rotation(),v.outline,v.holes):void 0;return{id:f,kind:p,role:g,label:b.text(),visible:M,renderedFontPx:r(b.fontSize()*t),opacity:C,fill:S,ink:typeof L=="string"?L:"",...x==null?{}:{fitsContainer:x},...M?{screenBox:{x:r(T.x),y:r(T.y),width:r(T.width),height:r(T.height)}}:{}}},c=f=>{let p=f.namePlate.fill();if(f.namePlate.opacity()>.05&&typeof p=="string"&&p)return p;let g=f.blockPoly.fill();return typeof g=="string"?g:f.baseFill},d=[...i.sections.map(f=>a(f.id,"section","name",f.nameLabel,c(f),f)),...i.sections.map(f=>a(`${f.id}:availability`,"section","availability",f.subLabel,c(f),f)),...i.zones.flatMap(f=>[a(f.id,"zone","name",f.label,f.background),...f.sub?[a(`${f.id}:price`,"zone","price",f.sub,f.background)]:[]])],h=[...i.gaById].map(([f,p])=>{let g=p.points.map(I=>i.worldToScreen(I)),b=Math.min(...g.map(I=>I.x)),S=Math.min(...g.map(I=>I.y)),v=Math.max(...g.map(I=>I.x)),w=Math.max(...g.map(I=>I.y)),k=v<0||b>o.width||w<0||S>o.height,T=r(p.polygon.opacity()),C=T>=.1&&!k,L=p.polygon.fill();return{areaId:f,label:p.label,capacity:p.capacity,categoryKey:p.categoryKey,...p.sectionId?{sectionId:p.sectionId}:{},visible:C,interactive:p.polygon.listening(),opacity:T,fill:typeof L=="string"?L:"",effectiveBackground:p.effectiveBackground,...C?{screenBox:{x:r(b),y:r(S),width:r(v-b),height:r(w-S)}}:{}}}),u=[...i.freeTextById].map(([f,p])=>{let{node:g,background:b,kind:S}=p,v=i.worldToScreen({x:g.x(),y:g.y()}),w=g.width()*t,k=g.height()*e,T=v.x-g.offsetX()*t,C=v.y-g.offsetY()*e,L=r(g.fontSize()*e),I=T+w<0||T>o.width||C+k<0||C>o.height,M=g.isVisible()&&!I,x=g.fill(),A=r(g.getAbsoluteOpacity()),P;return M||(L<U?P="below-minimum-size":I?P="outside-viewport":P="renderer-hidden"),{objectId:p.objectId??f,kind:S,text:g.text(),visible:M,renderedFontPx:L,ink:typeof x=="string"?x:"",background:b,opacity:A,...M?{screenBox:{x:r(T),y:r(C),width:r(w),height:r(k)}}:{},...P?{hiddenReason:P}:{}}}),m=i.labelGroup.find(f=>f.getAttr("rowLabel")===!0).filter(f=>f instanceof Xl).map(f=>{let p=f.getClientRect({skipShadow:!0,skipStroke:!0}),g=p.x+p.width<0||p.x>o.width||p.y+p.height<0||p.y>o.height,b=f.fill();return{text:f.text(),visible:f.isVisible()&&!g,renderedFontPx:r(f.fontSize()*e),ink:typeof b=="string"?b:"",...g?{}:{screenBox:{x:r(p.x),y:r(p.y),width:r(p.width),height:r(p.height)}}}}),y=i.sections.filter(f=>f.blockPoly.opacity()>.05);return{viewport:o,projection:i.viewMode,...i.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:i.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:i.canvasBackground,effectiveScale:r(e),rung:i.getRung(),minimumVisibleLabelPx:U,totalLabelledBookableUnits:n.length,visibleLabels:l,hiddenLabels:n.length-l,totalBookableUnits:n.length+h.reduce((f,p)=>f+p.capacity,0),selectionRingSeatIds:i.overlayLayer.find(".selection-ring").map(f=>String(f.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:i.effSelection,focusedSectionId:i.focusedSectionId,focusBackdropVisible:!!i.focusBackdrop?.isVisible(),categoryFilterKeys:i.categoryFilter?[...i.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:y.length,categoryPaintedSectionShells:y.filter(f=>{let p=f.blockPoly.fill();return typeof p!="string"||!Li(i.canvasBackground,p)}).length,tintedSectionShells:y.filter(f=>{let p=f.blockPoly.fill();return typeof p=="string"&&Mr(i.canvasBackground,p)}).length,visibleCategoryDetailOutlines:i.sections.filter(f=>f.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:i.sections.filter(f=>f.subLabel.opacity()>.05).length,visibleSectionGADetails:[...i.gaById.values()].filter(f=>f.sectionId!=null&&f.polygon.opacity()>.05).length},labels:n,gaAreas:h,hierarchyLabels:d,freeTextLabels:u,rowLabels:m}}import{Circle as Yl}from"konva/lib/shapes/Circle";import{Ellipse as Ul}from"konva/lib/shapes/Ellipse";import{Line as on}from"konva/lib/shapes/Line";import{Arrow as $l}from"konva/lib/shapes/Arrow";import{Path as ql}from"konva/lib/shapes/Path";import{Rect as ct}from"konva/lib/shapes/Rect";import{Text as Vi}from"konva/lib/shapes/Text";import{Image as rn}from"konva/lib/shapes/Image";function sn(i,e){if(!e.url||e.visible===!1)return;let t=new window.Image;i.trackAssetImage(t,e.url,"Buyer background image",()=>{let o=t.naturalWidth||4,r=t.naturalHeight||3,s=e.crop??{x:0,y:0,width:1,height:1},n=Math.max(0,Math.min(.99,s.x)),l=Math.max(0,Math.min(.99,s.y)),a={x:n,y:l,width:Math.max(.01,Math.min(1-n,s.width)),height:Math.max(.01,Math.min(1-l,s.height))},c=e.width,d=c*(r*a.height/(o*a.width)),h=new rn({image:t,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:d/2,width:c,height:d,rotation:e.rotation??0,crop:{x:a.x*o,y:a.y*r,width:a.width*o,height:a.height*r},opacity:e.opacity,listening:!1});i.bgLayer.add(h),h.moveToBottom(),i.bgLayer.batchDraw()})}function nn(i,e){let t=new window.Image,o=new rn({image:t,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:G(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?i.fgDecorGroup.add(o):i.bgLayer.add(o),e.role&&i.landmarkBoxes.push(N(ze({x:e.x+e.width/2,y:e.y+e.height/2},e.width,e.height,e.rotation??0))),i.trackAssetImage(t,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let r=o.getLayer();r&&r.batchDraw()})}function an(i,e){if(e.shape==="round")i.bgLayer.add(new Yl({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,r=e.height??50;i.bgLayer.add(new ct({x:e.center.x,y:e.center.y,width:o,height:r,offsetX:o/2,offsetY:r/2,rotation:e.rotation,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,cornerRadius:4,listening:!1}))}let t=dt(i,i.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,"#cbd5e1",12,!0);i.freeTextById.set(e.id,{node:t,background:"#232c40",kind:"table"})}var Zl=8,Ql=6;function ln(i,e){let t=e.background?.color??i.canvasBackground,o=e.color??$(t,i.theme.textColor??ds),r=e.semanticKind==="icon"?Oo(e.iconKey):void 0;if(r){let d=e.fontSize/24,h=new ql({x:e.position.x,y:e.position.y,data:r,rotation:e.rotation,scaleX:d,scaleY:d,stroke:o,strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});i.iconNodeById.set(e.id,{node:h,fontSize:e.fontSize}),i.bgLayer.add(h);return}let s=e.background?.padding??0,n=e.opacity??1,l=Po(e),a=new Vi({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:Ei(e.bold,e.italic,"600"),fill:o,fontFamily:e.fontFamily??i.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:s,opacity:n,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;if(e.background){let d=a.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),h=Math.max(Zl,e.fontSize*.35),u=Math.max(Ql,e.fontSize*.28);c=new ct({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:n*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),i.bgLayer.add(c)}i.freeTextById.set(e.id,{node:a,backdrop:c,background:t,kind:l?"direct-landmark":"free-text"}),i.bgLayer.add(a)}function cn(i,e){let t=e.fill??i.theme.decorFill??cs,o=e.role==="stage",r=e.role==="reference-focal",s=!!e.role&&!o,n=Io(e),l=ae(i.canvasBackground),a=r?l.focalFill:t,c=e.kind==="line"||e.kind==="polyline",d=e.stroke?.color??(o?ve(a,.28):r?l.focalStroke:c?"#9aa3b5":void 0),h=e.stroke?.width??(o?1:r||c?2:0),u=e.opacity!=null?G(e.opacity,.1,1):1,m=0,y=0,f=null;if(c&&e.points&&e.points.length>=2){m=e.points.reduce((S,v)=>S+v.x,0)/e.points.length,y=e.points.reduce((S,v)=>S+v.y,0)/e.points.length;let p=Do(e),g=Ho(h),b=new $l({points:e.points.flatMap(S=>[S.x,S.y]),closed:!1,x:m,y,offsetX:m,offsetY:y,rotation:e.rotation??0,stroke:d,fill:d,strokeWidth:h,opacity:u,lineCap:p.lineCap,lineJoin:p.lineJoin,pointerAtBeginning:p.startEnding==="arrow",pointerAtEnding:p.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path"});b.setAttr("shapeObjectId",e.id),i.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,ue(a,.3),1,ve(a,.12)]}:{fill:a};m=e.x+e.width/2,y=e.y+e.height/2,f={x:e.x,y:e.y,width:e.width,height:e.height},i.bgLayer.add(new ct({x:m,y,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:d,strokeWidth:h,cornerRadius:G(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:u,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){m=e.x+e.width/2,y=e.y+e.height/2,f={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,ue(a,.3),1,ve(a,.12)]}:{fill:a};i.bgLayer.add(new Ul({x:m,y,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...p,stroke:d,strokeWidth:h,opacity:u,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let p=e.points.flatMap(S=>[S.x,S.y]),g=N(e.points);m=e.points.reduce((S,v)=>S+v.x,0)/e.points.length,y=e.points.reduce((S,v)=>S+v.y,0)/e.points.length,f=g;let b=o?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,ue(a,.3),1,ve(a,.12)]}:{fill:a};i.bgLayer.add(new on({points:p,closed:!0,x:m,y,offsetX:m,offsetY:y,rotation:e.rotation??0,...b,stroke:d,strokeWidth:h,opacity:u,listening:!1}))}f&&e.role&&i.landmarkBoxes.push(f);for(let p of No(e))i.bgLayer.add(new on({points:p.points.flatMap(g=>[g.x,g.y]),closed:p.closed,x:m,y,offsetX:m,offsetY:y,rotation:e.rotation??0,stroke:p.ink??Go,fill:p.fill,strokeWidth:2,opacity:u*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:p,spec:g}=Jl(i,m,y,e.label,a,f,e.labelStyle);i.primaryFocalLabels.set(p,g),i.freeTextById.set(e.id,{node:p,background:a,kind:"stage"})}else if(s){let p=r||n,g=dt(i,i.bgLayer,e.label,m,y,p?$(a,"#e6e9f0"):"#9aa3b5",p?18:12,!1);p&&i.primaryFocalLabels.set(g,{targetPx:18,trackingRatio:0,ink:String(g.fill()??""),plateInk:String(g.fill()??""),plate:new ct({width:0,height:0,opacity:0,listening:!1})}),i.freeTextById.set(e.id,{node:g,background:a,kind:"decor"})}else{let p=dt(i,i.bgLayer,e.label,m,y,"#cbd5e1",16,!0);i.freeTextById.set(e.id,{node:p,background:a,kind:"decor"})}}var Wi=22,jl=U,Jt=6;function Jl(i,e,t,o,r,s,n){let l=n?.size??Wi,a=n?.color??i.theme.textColor??"#e6e9f0",c=n?.color??$(r,a),d=s?s.x+s.width/2:e,h=s?s.y+s.height/2:t,u=ec(i.canvasBackground,r),m=new ct({x:d,y:h,width:0,height:0,cornerRadius:4,fill:u,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(m);let y=new Vi({x:d,y:h,text:o,fontSize:l,fontStyle:Ei(n?.bold??!0,n?.italic,"normal"),letterSpacing:l*(4/Wi),fontFamily:n?.fontFamily??i.labelFont(),fill:c,textDecoration:n?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return y.offsetX(y.width()/2),y.offsetY(y.height()/2),i.bgLayer.add(y),{node:y,spec:{targetPx:l,...s?{bounds:s}:{},trackingRatio:4/Wi,ink:c,plateInk:n?.color??$(u,a),plate:m}}}function ec(i,e){return pe(e,Y(i)?"#ffffff":"#000000",.34)}function dn(i,e,t,o){let r=Math.max(t,1e-4),s=e.targetPx/r,n=m=>{i.letterSpacing(m*e.trackingRatio),o(i,m)};n(s);let l=e.bounds;if(!l){e.plate.opacity(0),i.fill(e.ink);return}let a={width:l.width-Jt*2,height:l.height-Jt*2},c=Math.min(1,a.width/Math.max(i.width(),1e-6),a.height/Math.max(i.height(),1e-6));if(c<1&&(s=Math.max(jl/r,s*c),n(s)),i.width()<=a.width&&i.height()<=a.height){e.plate.opacity(0),i.fill(e.ink);return}let h=i.width()+Jt*2,u=i.height()+Jt;e.plate.size({width:h,height:u}),e.plate.offset({x:h/2,y:u/2}),e.plate.opacity(1),i.fill(e.plateInk)}function hn(i,e){let t=i.catColor.get(e.categoryKey)??"#6e7bff",o=i.canvasBackground,r=wo(t,o,Ie),s=i.theme.textColor??"#e6e9f0",n=$(r,s),l=Ee(e.points,e.holes,{fill:t,opacity:Ie,stroke:t,strokeWidth:1.5,cornerRadius:e.cornerRadius});l.setAttr("gaId",e.id),l.on("click tap",u=>{i.isGhostClick(u)||i.opts.onGAClick?.(e.id)}),l.on("mouseenter",()=>{i.container.style.cursor="pointer"}),l.on("mouseleave",()=>{i.container.style.cursor="default"}),i.bgLayer.add(l);let a=St(e.points,e.holes),c=i.sections.find(u=>ie(a,u.outline,u.holes)),d=dt(i,i.bgLayer,e.displayLabel??e.label,a.x,a.y-8,n,Lt,!1),h=dt(i,i.bgLayer,`cap ${e.capacity}`,a.x,a.y+10,n,Tt,!1);i.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:d,background:r,kind:"ga-label",categoryKey:e.categoryKey}),i.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:r,kind:"ga-capacity",categoryKey:e.categoryKey}),i.gaById.set(e.id,{label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:l,effectiveBackground:r,strokeColor:t,labelPoint:a,labelNode:d,capacityNode:h,...c?{sectionId:c.logicalId}:{}})}function dt(i,e,t,o,r,s,n,l){let a=new Vi({x:o,y:r,text:t,fontSize:n,fontStyle:l?"700":"500",fontFamily:i.labelFont(),fill:s,listening:!1,perfectDrawEnabled:!1});return a.offsetX(a.width()/2),a.offsetY(a.height()/2),e.add(a),a}var un=/^[\p{L}\p{N}]{1,4}$/u,tc=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function pn(i,e){let t=e?.trim();if(!t)return i;let o=i.toLocaleLowerCase("en-US"),r=t.toLocaleLowerCase("en-US");if(o.startsWith(`${r} `)){let n=i.slice(t.length).trim();if(un.test(n))return n}let s=tc.exec(i);if(s){let n=s[1].toLocaleLowerCase("en-US"),l=s[2].trim();if((r.startsWith(n)||n.startsWith(r))&&un.test(l))return l}return i}function fn(i,e){let t=[],o=e.canvasBackground,r=new Map,s=(c,d)=>{let h=r.get(c)??[];h.push(d),r.set(c,h)};for(let c of e.seats){if(c.kind==="booth")continue;let d=c.logicalRowId??c.rowId;s(d,c),d!==c.rowId&&s(c.rowId,c)}let n=c=>c.logicalSeatIndex??Number(c.id.split(":").pop()??0);for(let c of i.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,m=(r.get(u)??[]).slice().sort((x,A)=>n(x)-n(A));if(!m.length)continue;let y=m[0],f=m[m.length-1],p=h?.labelStyle,g=$(o,p?.color??e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Pt),b=p?.size??vo,S=h?.rotation??0,v=e.objectFilteredOut(c)?.15:1,w=m.reduce((x,A)=>x??e.seatSection.get(A.id),void 0),T=c.segmentedRow?.displayLabel??c.displayLabel??pn(c.label,w?.label),C=w?[...new Set([w.id,w.logicalId,w.zone].filter(x=>!!x))]:void 0,L=(x,A,P)=>t.push({text:T,x,y:A,rotation:S,fontSize:b,ink:g,opacity:v,...C?.length?{focusKeys:C}:{},...P?{automaticAway:P}:{}});if(h?.position){L(h.position.x,h.position.y);continue}let I=e.seatR+12,M=h?.positionPreset??"start";if(M==="start"||M==="both"){let x=c.rotation*Math.PI/180,A={x:-Math.cos(x),y:-Math.sin(x)};L(y.x+A.x*I,y.y+A.y*I,A)}if(M==="end"||M==="both"){let x=(c.rotation+c.curve)*Math.PI/180,A={x:Math.cos(x),y:Math.sin(x)};L(f.x+A.x*I,f.y+A.y*I,A)}}let l=(e.seatR+12)*2.2,a=[];for(let c of t){let d=a.find(h=>h.text===c.text&&Math.hypot(h.x-c.x,h.y-c.y)<=l);if(d){d.x=(d.x+c.x)/2,d.y=(d.y+c.y)/2;continue}a.push(c)}return a}function zi(i,e,t=Q){let o=i.rotation()*Math.PI/180,r=Math.abs(Math.cos(o)),s=Math.abs(Math.sin(o)),n=(i.width()*r+i.height()*s)/2+t,l=(i.width()*s+i.height()*r)/2+t;return{x:e.x-n,y:e.y-l,width:n*2,height:l*2}}function mn(i,e,t,o){let r={x:e.x,y:e.y},s=e.automaticAway;if(!s)return r;let n={x:-s.y,y:s.x},l=Math.max(7,Math.min(16,e.fontSize*.75)),a=[{x:0,y:0}];for(let u=1;u<=4;u++){let m=l*u;a.push({x:n.x*m,y:n.y*m},{x:-n.x*m,y:-n.y*m},{x:s.x*m,y:s.y*m},{x:(s.x+n.x)*m,y:(s.y+n.y)*m},{x:(s.x-n.x)*m,y:(s.y-n.y)*m})}let c=r,d=1/0,h=1/0;for(let u of a){let m={x:r.x+u.x,y:r.y+u.y},y=zi(i,m),p=(o?At(o,y,{mode:"overlap"}).length:0)+t.collisionCount(y),g=Math.hypot(u.x,u.y);if((p<d||p===d&&g<h)&&(c=m,d=p,h=g),p===0)break}return c}function yn(i,e){let t=i.sectionHeat.get(e.id)??i.sectionHeat.get(e.logicalId)??(e.zone?i.sectionHeat.get(e.zone):void 0);if(t==null||t<=0){e.outlinePoly.stroke(_(e.outlineTint,.5)),e.outlinePoly.fill(_(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=pe("#f4b740","#ef4444",t);e.outlinePoly.stroke(_(o,.72+t*.25)),e.outlinePoly.fill(_(o,.08+t*.13)),e.outlinePoly.strokeWidth(2+t*3.5),e.outlinePoly.shadowColor(o),e.outlinePoly.shadowBlur(4+t*12),e.outlinePoly.shadowOpacity(.25+t*.45)}function Xi(i,e){return i.closedSections.has(e.id)||i.closedSections.has(e.logicalId)||e.zone!=null&&i.closedSections.has(e.zone)}function gn(i,e,t,o){if(!e)return 0;let r=0;for(let s of i){if(t(s)!=="free")continue;let n=o(s);n&&Se(n,e)&&(r+=1)}return r}function bn(i,e){return Xi(i,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*wr?"nearly-gone":"normal"}function Sn(i,e){let t=bn(i,e),o=i.accessFilterActive&&i.sectionAccessibleFree(e)<=0,r=xr(i.canvasBackground,t,o?null:e.shellCategoryColor);e.shellFill=r.fill,e.shellStroke=r.stroke,e.blockPoly.fill(r.fill),e.blockPoly.stroke(r.stroke),e.subLabel.text(t==="sold-out"?X("map.soldOut"):X("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function ic(i,e){return pe(e,Y(i)?"#ffffff":"#000000",gr)}function oc(i,e,t=0){let o=yr-t;return!e||i.length<=o?i:`${i.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function rc(i,e){return i.accessFilterActive&&i.sectionAccessibleFree(e)>0}function sc(i,e,t){let o=rc(i,e),r=oc(e.label,t,o?2:0),s=o?`\u267F ${r}`:r;e.nameLabel.text()!==s&&e.nameLabel.text(s),e.nameLabel.fontStyle(t?mr:Ne),e.nameLabel.letterSpacing(t?e.nameLabel.fontSize()*tt:0)}function nc(i,e,t){let o=i.stageWidth<ce,r=e.nameLabel.opacity();if(!o||r<=.05||!e.nameLabel.visible()){e.namePlate.opacity(0),e.subLabel.opacity(0);return}let s=e.nameLabel.rotation(),n=s===0&&bn(i,e)==="sold-out",l=vi/t,a=Sr/t,c=n?2/t:0,d={x:e.nameLabel.x(),y:e.nameLabel.y()},h=e.nameLabel.height(),u=0;n?(_e(e.subLabel,Ge/t,d.y),u=e.subLabel.height(),e.subLabel.rotation(0),e.subLabel.x(d.x),e.subLabel.y(d.y+h/2+c+u/2),e.subLabel.opacity(r)):e.subLabel.opacity(0);let m=n?c+u:0,y=Math.max(e.nameLabel.width(),n?e.subLabel.width():0)+l*2,f=h+m+a*2;e.namePlate.position({x:d.x,y:d.y+m/2}),e.namePlate.rotation(s),e.namePlate.size({width:y,height:f}),e.namePlate.offset({x:y/2,y:f/2}),e.namePlate.cornerRadius(vr/t),e.namePlate.opacity(r*br)}function vn(i,e){let t,o;i.reducedMotion?(t=e<=ge?1:0,o=e<=He?1:0):(t=G((be-e)/(be-ge),0,1),o=G((ge-e)/(ge-He),0,1)),(i.floorOverview||i.focusedSectionId)&&(t=0,o=0);let r=!i.floorOverview&&!i.focusedSectionId&&e<se;r&&(t=1),i.zones.length||(o=0);let s=i.viewMode==="perspective"&&i.glideInProgress&&i.seatCount>2500;i.seatLayer.opacity(r||s?0:1-t);let n=i.stageScaleX,l=!i.glideInProgress&&(i.lodScale===0||Math.abs(e-i.lodScale)/(i.lodScale||1)>.08);l&&i.setLodScale(e);let a=i.focusedSectionId,c=i.stageWidth<ce,d=ae(i.canvasBackground),h=G((t-.2)/.8,0,1);for(let m of i.sections){let y=i.hasFocusDimOverlay?1:a&&m.id!==a&&m.logicalId!==a&&m.zone!==a?Me:1,f=Math.min(y,Js(m.memberCategoryKeys,i.categoryFilter)?Me:1);m.outlinePoly.opacity(r?0:(1-t)*f),m.blockPoly.opacity(or*t*f);let p=i.sectionIsOwned(m);m.blockPoly.stroke(p?i.selectionColor:m.shellStroke||d.sectionStroke),m.blockPoly.strokeWidth((p?rr:Ft)/Math.max(n,1e-4));let g=m.blockPoly.fill(),b=typeof g=="string"?g:m.baseFill,S=c?ic(i.canvasBackground,b):null;S&&m.namePlate.fill(S);let v=$(S??b,m.preferredInk);m.nameLabel.fill(v),m.subLabel.fill(v),sc(i,m,c),l&&h>.01&&cc(i,m,n),m.nameLabel.opacity(m.nameLabelFits?h*(1-o)*f:0),m.subLabel.opacity(0)}let u=o*(1-i.isoT);for(let m of i.zones)m.back.opacity(u),m.label.opacity(u),m.sub&&m.sub.opacity(i.stageWidth<ce?0:u),l&&hc(i,m,n);if(!i.glideInProgress&&(h>.01||u>.01)){lc(i,n),ac(i.sections);for(let m of i.zones){let y=m.label.opacity();m.back.opacity(y),m.sub&&m.sub.opacity(i.stageWidth<ce?0:y)}}for(let m of i.sections)nc(i,m,n);i.bgLayer.batchDraw()}function ac(i){let e=new Map;for(let t of i)(e.get(t.logicalId)??e.set(t.logicalId,[]).get(t.logicalId)).push(t);for(let t of e.values()){if(t.length<2)continue;let o=t.filter(r=>r.nameLabel.opacity()>.05).sort((r,s)=>{let n=N(r.outline),l=N(s.outline);return l.width*l.height-n.width*n.height});for(let r of o.slice(1))r.nameLabel.opacity(0)}}function lc(i,e){let o=[],r=a=>{let c=i.worldToScreen({x:a.x(),y:a.y()}),d=N(ze({x:0,y:0},a.width()*e,a.height()*e,a.rotation()));return{x:c.x-d.width/2,y:c.y-d.height/2,w:d.width,h:d.height}};for(let a of i.zones){if(a.label.opacity()<=.05)continue;let c=a.back.getAbsolutePosition(),d=a.back.width()*e,h=a.back.height()*e;o.push({node:a.label,tier:0,section:!1,zone:a,box:{x:c.x-d/2,y:c.y-h/2,w:d,h}})}for(let a of i.sections)a.nameLabel.opacity()>.05&&o.push({node:a.nameLabel,tier:1,section:!0,area:a.labelArea,box:r(a.nameLabel)});let s=i.landmarks.map(a=>{let c=i.worldToScreen({x:a.x,y:a.y}),d=i.worldToScreen({x:a.x+a.width,y:a.y+a.height});return{x:Math.min(c.x,d.x),y:Math.min(c.y,d.y),w:Math.abs(d.x-c.x),h:Math.abs(d.y-c.y)}});if(o.length<2&&!s.length)return;o.sort((a,c)=>a.tier-c.tier||(c.area??0)-(a.area??0)||a.box.y-c.box.y||a.box.x-c.box.x);let n=[...s],l=a=>n.some(c=>a.x<c.x+c.w+4&&c.x<a.x+a.w+4&&a.y<c.y+c.h+4&&c.y<a.y+a.h+4);for(let a of o){if(!l(a.box)){n.push(a.box);continue}let c=!1;if(a.zone)for(let d of fr){if(d===0)continue;let h={...a.box,y:a.box.y+d};if(!l(h)){Ki(a.zone,0,d/e),n.push(h),c=!0;break}}if(a.section){let d=a.node.fontSize(),h=a.node.y(),u=a.node.letterSpacing()>0;for(let m of sr){let y=d*m;if(y*e<Ge)break;_e(a.node,y,h),u&&(a.node.letterSpacing(a.node.fontSize()*tt),a.node.offsetX(a.node.width()/2));let f=r(a.node);if(!l(f)){n.push(f),c=!0;break}}c||(_e(a.node,d,h),u&&(a.node.letterSpacing(a.node.fontSize()*tt),a.node.offsetX(a.node.width()/2)))}c||a.node.opacity(0)}}function _e(i,e,t){i.fontSize(Math.max(1,e)),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t)}function cc(i,e,t){e.subLabelFits=!1;let o=i.stageWidth<ce,r=o?vi*2:0,s=Gt(Si*e.labelScale,i.stageWidth),n=Ge;for(let l=s;l>=n;l-=1)for(let a of[0,-90]){e.nameLabel.rotation(a),_e(e.nameLabel,l/t,e.nameLabel.y()),o&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*tt),e.nameLabel.offsetX(e.nameLabel.width()/2));for(let c of e.labelAnchors){e.nameLabel.position(c);let d=(8+r)/t;if(Yt(c,e.nameLabel.width()+d,e.nameLabel.height()+d,a,e.outline,e.holes)){e.nameLabelFits=!0;return}}}e.nameLabel.position(e.centroid),e.nameLabel.rotation(0),e.nameLabelFits=!1}function dc(i,e,t){let o=r=>(i.text(r),i.width());if(!(o(e)<=t)){for(let r=e.length-1;r>=1;r-=1)if(o(`${e.slice(0,r).trimEnd()}\u2026`)<=t)return;o("\u2026")}}function hc(i,e,t){let o=wi(i.stageWidth),r=e.sub!=null&&i.stageWidth>=ce,s=i.stageWidth<ce,n=(s?ar:cr)*o/t,l=(s?lr:dr)*o/t,a=r?3*o/t:0;if(e.label.text(e.name),_e(e.label,Gt(Ot,i.stageWidth)/t,e.anchor.y),s){let b=i.stageWidth*pr/t-n*2;dc(e.label,e.name,Math.max(b,1)),_e(e.label,e.label.fontSize(),e.anchor.y)}e.label.x(e.anchor.x),r&&(_e(e.sub,Gt(Dt,i.stageWidth)/t,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*nr),e.sub.offsetX(e.sub.width()/2),e.sub.x(e.anchor.x));let c=Math.max(e.label.width(),r?e.sub.width():0)+n*2,d=e.label.height()+(r?a+e.sub.height():0)+l*2;e.label.y(e.anchor.y-(r?(a+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+a)/2),e.back.position(e.anchor),e.back.size({width:c,height:d}),e.back.offset({x:c/2,y:d/2}),e.back.cornerRadius(hr*o/t),e.back.strokeWidth(1/t);let h=e.back.getAbsolutePosition(),u=6,m=c*t;if(m>i.stageWidth-u*2){e.label.opacity(0),e.back.opacity(0),e.sub&&e.sub.opacity(0);return}let y=m/2,p=(G(h.x,u+y,i.stageWidth-u-y)-h.x)/t;Math.abs(p)>.001&&Ki(e,p,0);let g=62+d*t/2;h.y<g&&Ki(e,0,(g-h.y)/t)}function Ki(i,e,t){i.label.x(i.label.x()+e),i.label.y(i.label.y()+t),i.sub&&(i.sub.x(i.sub.x()+e),i.sub.y(i.sub.y()+t)),i.back.x(i.back.x()+e),i.back.y(i.back.y()+t)}function wn(i,e){let t=e,o=t._cache.get("canvas");if(!o)return;let r=[o.scene,o.filter,o.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&i.Util.releaseCanvas(...r),t._cache.delete("canvas")}function kn(i,e){let t=0,o=0,r=s=>{t||(t=s),o+=1;let n=s-t;n>=1e3&&(i(Math.round(o*1e3/n)),o=0,t=s),e(requestAnimationFrame(r))};e(requestAnimationFrame(r))}import{Group as uc}from"konva/lib/Group";import{Line as Ln}from"konva/lib/shapes/Line";import{Rect as pc}from"konva/lib/shapes/Rect";import{Text as Tn}from"konva/lib/shapes/Text";function fc(i,e){return i>=ne||e&&i>=_t}function mc(i){return i.effectiveScale<_t?!1:i.focusActive||i.stageWidth<ce}function yc(i,e,t){return t&&e>=_t?Math.max(i,jo/Math.max(e,1e-4)):i}function gc(i,e){return Math.max(1,i*2-(e?1:3))}function Cn(i){let e=i.exportMode?Math.max(i.effScale(),ne):i.effScale(),t=mc({effectiveScale:e,focusActive:i.focusedSectionId!=null,stageWidth:i.stage.width()}),o=fc(e,t),r=l=>{let a=l.getClientRect({skipShadow:!0,skipStroke:!0});return a.x>=0&&a.y>=0&&a.x+a.width<=i.stage.width()&&a.y+a.height<=i.stage.height()};for(let[l,a]of i.boothLabelById){let c=i.circleById.get(l);a.visible(me(a.fontSize(),e)&&!!c?.isVisible()&&i.focusedSeatOpacity(l,c?.getAbsoluteOpacity()??1)>=.5&&r(a))}i.labelGroup.destroyChildren(),i.labelLiftGroups.clear(),i.seatLabelById.clear();let s=0;if(o)for(let l of i.visibleSeatCandidates()){if(l.kind==="booth")continue;let a=i.worldToScreen(l);if(a.x<-20||a.x>i.stage.width()+20||a.y<-20||a.y>i.stage.height()+20||i.accessGlyphById.has(l.id)&&i.accessGlyphShouldShow(l.id))continue;let c=i.circleById.get(l.id);if(!c?.isVisible()||i.focusedSeatOpacity(l.id,c.getAbsoluteOpacity())<.5)continue;let d=i.statusById.get(l.id)??"free",h=i.renderedSeatPoint(l),u=i.viewMode==="perspective"?i.perspectiveSeatScale.get(l.id)??1:1;if(!i.hasSeatMark(l.id)&&(d==="booked"||d==="held"&&!i.ownedHold.has(l.id)&&!i.opts.manageMode)){let g=new uc({x:h.x,y:h.y,listening:!1});if(g.scale({x:u,y:u}),d==="held"?(g.add(new pc({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),g.add(new Ln({points:[-2.4,-.8,-2.4,-2.7,-1.2,-4,0,-4.35,1.2,-4,2.4,-2.7,2.4,-.8],stroke:"#ffffff",strokeWidth:1.2,lineCap:"round",lineJoin:"round",listening:!1}))):(g.opacity(Vs),g.add(new Ln({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1}))),Qt(g),i.seatLabelContainer(l.id).add(g),++s>=bi)break;continue}let y=yc(fe*i.seatLabelScale(l),e,t),f=new Tn({x:h.x,y:h.y,text:It(l.displayLabel??l.label),fontSize:y,fontStyle:"600",fontFamily:i.labelFont(),fill:c?i.seatLabelInk(l,c):i.seatPreferredLabelInk(l),listening:!1,perfectDrawEnabled:!1}),p=gc(i.seatR,t);if(f.width()>p&&f.fontSize(Math.max(je,y*p/f.width())),f.width()>p+.01){f.destroy();continue}if(!me(f.fontSize(),e)){f.destroy();continue}if(f.offsetX(f.width()/2),f.offsetY(f.height()/2),f.scale({x:u,y:u}),i.seatLabelContainer(l.id).add(f),!r(f)){f.destroy();continue}if(i.seatLabelById.set(l.id,f),++s>=bi)break}let n=new Ke;for(let{node:l}of i.freeTextById.values()){if(!l.isVisible())continue;let a=l.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});n.insert({x:a.x-Q,y:a.y-Q,width:a.width+Q*2,height:a.height+Q*2})}for(let l of i.rowLabelPlan){let a=i.focusedSectionId!=null&&l.focusKeys?.includes(i.focusedSectionId),c=a?Math.max(l.fontSize,Qo/Math.max(e,1e-4)):l.fontSize;if(!a&&!me(c,e))continue;let d=i.worldToScreen({x:l.x,y:l.y});if(d.x<-40||d.x>i.stage.width()+40||d.y<-40||d.y>i.stage.height()+40)continue;let h=new Tn({x:l.x,y:l.y,text:l.text,fontSize:c,fontStyle:"700",fontFamily:i.labelFont(),fill:l.ink,rotation:l.rotation,opacity:l.opacity,shadowColor:"#05070c",shadowBlur:l.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:l.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});h.offsetX(h.width()/2),h.offsetY(h.height()/2);let u=i.resolveAutomaticRowLabelPosition(h,l,n);h.position(u),h.setAttr("rowLabel",!0),i.labelGroup.add(h);let m=h.getClientRect({skipShadow:!0,skipStroke:!0}),y=6,f=m.x<y?y-m.x:m.x+m.width>i.stage.width()-y?i.stage.width()-y-m.x-m.width:0,p=m.y<y?y-m.y:m.y+m.height>i.stage.height()-y?i.stage.height()-y-m.y-m.height:0,g=u;if(f||p){let S=i.labelGroup.getAbsoluteTransform(),v=S.point(u);g=S.copy().invert().point({x:v.x+f,y:v.y+p}),h.position(g)}let b=i.rowLabelBox(h,g);if(l.automaticAway&&n.collisionCount(b)>0){h.destroy();continue}n.insert(b)}i.isoT>0&&i.viewMode!=="perspective"&&i.applyUprightLabels(),i.overlayLayer.batchDraw()}function In(i){let e=i.now??(()=>typeof performance<"u"?performance.now():Date.now()),t=i.budgetMs??8,o=i.reducedMotion===!0,r=i.chunks.length>1?Math.min(30,Math.max(0,840/(i.chunks.length-1))):0,s=0,n=!1,l=!1,a=null,c=[],d=typeof globalThis<"u"?globalThis:{},h=()=>{a&&(a.kind==="idle"?d.cancelIdleCallback?.(a.id):a.kind==="frame"?d.cancelAnimationFrame?.(a.id):clearTimeout(a.id),a=null)},u=p=>{if(!c.length&&typeof d.requestIdleCallback=="function"){a={kind:"idle",id:d.requestIdleCallback(()=>{a=null,p()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){a={kind:"frame",id:d.requestAnimationFrame(()=>{a=null,p()})};return}a={kind:"timer",id:setTimeout(()=>{a=null,p()},16)}},m=()=>{l||n||(l=!0,h(),i.done())},y=p=>{for(let g=c.length-1;g>=0;g--){let b=c[g],S=o?1:Math.min(1,(p-b.startedAt)/160);i.fade(b.work,S),S>=1&&c.splice(g,1)}return c.length>0},f=()=>{if(n)return;let p=e(),g=p;for(;s<i.chunks.length&&(s===0||e()-g<t);){let S=i.chunks[s++];if(i.build(S.work),i.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:p+(s-1)*r}),e()-g>=t)break}let b=y(p);i.draw(),s<i.chunks.length||b?u(f):m()};return u(f),{cancel(){if(!l){n=!0,h();for(let p of c)i.fade(p.work,1);c.length=0}},finishNow(){if(!(n||l)){for(;s<i.chunks.length;){let p=i.chunks[s++];i.build(p.work)}for(let p of i.chunks)i.fade(p.work,1);c.length=0,i.draw(),m()}},get done(){return l}}}function ht(i){return{th:Bt*Math.PI/180*i.isoT,sg:1-(1-et)*i.isoT}}function Pn(i,e){let{th:t,sg:o}=ht(e),r=e.centre,s=i.x-r.x,n=i.y-r.y,l=s*Math.cos(t)-n*Math.sin(t),a=(s*Math.sin(t)+n*Math.cos(t))*o;return{x:r.x+l,y:r.y+a}}function xn(i,e){let{th:t,sg:o}=ht(e),r=e.centre,s=i.x-r.x,l=(i.y-r.y)/o,a=s*Math.cos(t)+l*Math.sin(t),c=-s*Math.sin(t)+l*Math.cos(t);return{x:r.x+a,y:r.y+c}}function Mn(i,e){let{th:t,sg:o}=ht(e),r=i*e.isoT;return{x:-(r/o)*Math.sin(t),y:-(r/o)*Math.cos(t)}}function An(i,e,t){let o=Eo(e);i.offset(t),i.position(re(e,t)),i.rotation(o.rotationDeg),i.scale({x:o.scaleX,y:o.scaleY}),i.skewX(o.skewX),i.skewY(0)}function Rn(i){i.position({x:0,y:0}),i.offset({x:0,y:0}),i.scale({x:1,y:1}),i.rotation(0),i.skewX(0),i.skewY(0)}function En(i,e){let t=Math.hypot(e.x-i.surfaceFocal.x,e.y-i.surfaceFocal.y),o=Math.max(0,t-i.frontDistanceWorld);return i.liftWorld+o*Math.tan(i.rakeDeg*Math.PI/180)}function _n(i,e,t){return i.perspectiveAffine?re(i.perspectiveAffine,e):re(t,e)}function Bn(i,e){return e?re(e,i):i}function Fn(i,e){let t=0;for(let h of i.seats){let u=Math.max(0,(h.eyeHeightM??ee)-ee);t=Math.max(t,u*Oe)}for(let h of i.objects)h.type==="section"&&(t=Math.max(t,bt(h,{floorBaseHeightM:i.floorBaseHeightMFor(h.id)}).height*Oe));let o=Mo(i.bounds,t),r=Rt(o,o.target),s=Ao(r);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let n=1/0,l=1/0,a=-1/0,c=-1/0;for(let h of i.seats){let u=Math.max(0,(h.eyeHeightM??ee)-ee),m=ye(o,h,u*Oe),y={x:m.x,y:m.y};e.seatProjected.set(h.id,y),e.seatLocal.set(h.id,re(s,y)),e.seatDepth.set(h.id,m.depth),e.seatScale.set(h.id,m.scale),n=Math.min(n,m.x),l=Math.min(l,m.y),a=Math.max(a,m.x),c=Math.max(c,m.y)}for(let h of[{x:i.bounds.x,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y+i.bounds.height},{x:i.bounds.x,y:i.bounds.y+i.bounds.height}]){let u=ye(o,h,0);n=Math.min(n,u.x),l=Math.min(l,u.y),a=Math.max(a,u.x),c=Math.max(c,u.y)}let d=Math.max(24,i.seatR*3);return{camera:o,baseAffine:r,baseInverse:s,bounds:Number.isFinite(n)?{x:n-d,y:l-d,width:Math.max(1,a-n+d*2),height:Math.max(1,c-l+d*2)}:null}}function On(i,e,t){let o=t?[...t].map(r=>i.seatById.get(r)).filter(r=>!!r):e?i.seats:[...i.perspectiveAppliedSeats].map(r=>i.seatById.get(r)).filter(r=>!!r);for(let r of o){if(e&&i.perspectiveAppliedSeats.has(r.id))continue;let s=e?i.perspectiveSeatProjected.get(r.id)??r:r,n=e?i.perspectiveSeatScale.get(r.id)??1:1,l=i.circleById.get(r.id);l?.position(s),l?.scale({x:n,y:n});let a=i.accessRingById.get(r.id);a?.position(s),a?.scale({x:n,y:n});let c=i.accessGlyphById.get(r.id);if(c){let h=i.seatR*1.5/we;c.position(s),c.scale({x:h*n,y:h*n})}let d=i.boothLabelById.get(r.id);d?.position(s),d?.scale({x:n,y:n}),e&&i.perspectiveAppliedSeats.add(r.id)}e||i.perspectiveAppliedSeats.clear()}function Ui(i){return i?.getAttr?.("seatId")??void 0}var Nn=Object.freeze([]),pt=class pt{constructor(e,t={}){this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;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.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=_i;this.effSelection=nt;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.catOrder=[];this.selection=new Set;this.selectionMarkers=new Map;this.momentsCache=null;this.ownedCache=null;this.ownedHold=new Set;this.seatMarks=new Zt;this.selectionFocusId=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;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.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.objectFloor=new Map;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.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=Es();this.fitScale=1;this.fitPose="";this.viewportInsets={...Oi};this.seatR=Qe;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.assetGeneration=0;this.assetPromises=[];this.assetErrors=[];this.assetCancels=new Set;this.seatReveal=null;this.seatRevealPending=!1;this.progressiveSeatFloor=800;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.marquee=null;this.marqueeCur=null;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 t=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(t){e.preventDefault();let o=this.focusedId?this.nearestSeat(this.focusedId,t):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.seatAnchorContextCache=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...t},this.exportMode=t.exportMode===!0,this.loadingReveal=t.loadingReveal??"progressive",this.onSeatsRevealed=t.onSeatsRevealed,this.currency=t.currency;let o=ei.pixelRatio;if(this.exportMode&&(this.dpr=1),ei.pixelRatio=this.dpr,this.stage=new bc({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new jt(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",X("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Yi({listening:!this.exportMode}),this.seatLayer=new Yi({listening:!this.exportMode}),this.overlayLayer=new Yi({listening:!1}),this.labelGroup=new ut({listening:!1}),this.overlayLayer.add(this.labelGroup),this.fgDecorGroup=new ut({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.hoverRing=new Dn({radius:Qe+2,stroke:"#ffffff",strokeWidth:2,opacity:.85,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new Dn({radius:Qe+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&&(ei.pixelRatio=o),!this.exportMode){this.wireInteraction();let r=this.opts.onFps;r&&kn(r,s=>{this.rafId=s})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get moments(){return this.momentsCache||(this.momentsCache=new Kt({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,categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>{let t=this.catPrice.get(e.categoryKey);return typeof t=="number"?ot(t,this.currency):null},seatClosed:e=>this.seatInClosedSection(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,t)=>this.nearestSeatToScreen(e,t)})),this.momentsCache}get owned(){return this.ownedCache||(this.ownedCache=new Xt({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>({x:e.nameLabel.x(),y:e.nameLabel.y()}),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,t){return this.owned.anchorFor(e)??t}ownedSeatPoints(e){let t=[];for(let o of e.memberIds){if(!this.selection.has(o)&&!this.ownedHold.has(o))continue;let r=this.seatById.get(o);r&&t.push(this.renderedSeatPoint(r))}return t}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),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,t){if(e!==this.chartDoc&&(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=t?.floorId??vt(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let s of e.floors)for(let n of s.objects)this.objectFloor.set(n.id,s.id),n.type==="section"&&n.logicalSectionId&&this.objectFloor.set(n.logicalSectionId,s.id);let o=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),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.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.primaryFocalLabels.clear(),this.gaById.clear();for(let s of this.selectionMarkers.values())s.destroy();this.selectionMarkers.clear(),this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.statusById.clear(),this.seatAnchorContextCache=null,this.selection.clear(),this.seatById.clear(),this.seatIndex=null,this.cached=!1,this.accessFilter=null,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=o.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=_o(this.theme.seatScale)*Qe,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,n)=>{this.cbHueByKey.set(s,Wt[n%Wt.length])});for(let s of e.categories)this.catColor.set(s.key,s.color),this.catByKey.set(s.key,s),typeof s.price=="number"&&this.catPrice.set(s.key,s.price);for(let s of o.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(n=>({x:n.x,y:n.y}))}:{}});this.seats=De(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()});for(let s of this.seats)this.seatById.set(s.id,s),this.statusById.set(s.id,"free");this.seatIndex=xo(this.seats,{seatRadius:this.seatR}),this.bounds=uo(o,{freeText:"exclude"}),this.isoCentre={x:this.bounds.x+this.bounds.width/2,y:this.bounds.y+this.bounds.height/2},this.buildPerspectiveProjection(o),this.renderBackground(o),this.unsectionedSeatGroup=new ut({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.seatRevealWanted();this.seatRevealPending=r,r||this.renderSeats(),this.buildRowLabelPlan(o),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=this.viewportCentreInChartSpace(),t=new Map,o=[];for(let s of this.seats){let n=this.seatSection.get(s.id);if(!n){o.push(s);continue}let l=t.get(n.id);l?l.push(s):t.set(n.id,[s])}let r=[...t.entries()].map(([s,n])=>{let l=this.sections.find(a=>a.id===s);return{id:s,work:{seats:n,group:l.liftGroupSeat},distance:Math.hypot(l.centroid.x-e.x,l.centroid.y-e.y)}}).sort((s,n)=>s.distance-n.distance);o.length&&this.unsectionedSeatGroup&&r.push({id:"",work:{seats:o,group:this.unsectionedSeatGroup},distance:1/0}),this.seatReveal=In({chunks:r.map(s=>({id:s.id,work:s.work})),build:s=>this.renderSeats(s.seats),fade:(s,n)=>s.group.opacity(n),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.updateLOD(),this.fitPose&&Ai(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 t=this.seatReveal;this.seatRevealPending=!1,t&&(this.seatReveal=null,e?t.finishNow():t.cancel())}floorView(e){if(!e.floors?.length)return{...e,referenceImage:void 0,backgroundImage:Ze(e)};if(this.floorOverview&&e.floors.length>=2)return po(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...ho(e),referenceImage:void 0,backgroundImage:Ze(e)};let t=e.floors.find(o=>o.id===this.activeFloorId)??e.floors[0];return{...e,objects:t.objects,focalPoint:t.focalPoint,referenceImage:void 0,backgroundImage:Ze(t),floors:void 0}}floorBaseHeightMFor(e){let t=this.chartDoc?.floors;if(!t?.length)return 0;let o=this.stacked&&e?this.objectFloor.get(e)??this.activeFloorId:this.activeFloorId;return t.find(r=>r.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}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?vt(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,t){let o=!1,r=this.hasSections?new Set:null;for(let s of e){if(!this.statusById.has(s))continue;let n=this.statusById.get(s);this.statusById.set(s,t);let l=this.circleById.get(s);if(l&&(this.paintSeat(l,s),o=!0),r){let a=this.seatSection.get(s);a&&(n==="free"!=(t==="free")&&(a.free+=t==="free"?1:-1),r.add(a))}}if(r&&r.size){for(let s of r)this.refreshSectionFill(s);this.bgLayer.batchDraw()}o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ne&&this.updateLabels())}setSeatCategories(e){let t=!1,o=new Set;for(let[s,n]of Object.entries(e)){let l=this.seatById.get(s);if(!l||!this.catColor.has(n)||l.categoryKey===n)continue;l.categoryKey=n;let a=this.circleById.get(s);a&&(this.paintSeat(a,s),t=!0);let c=this.seatSection.get(s);c&&o.add(c)}if(!t)return;let r=new Map((this.chartDoc?vt(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of o){if(!r.get(s.id)?.color){let l=new Map;for(let a of s.memberIds){let c=this.seatById.get(a)?.categoryKey;c&&l.set(c,(l.get(c)??0)+1)}s.baseFill=fi([...l].map(([a,c])=>({hex:this.catColor.get(a)??"#6e7bff",w:c})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}o.size&&this.bgLayer.batchDraw(),this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ne&&this.updateLabels()}setOwnedHold(e){let t=new Set((e??[]).filter(r=>this.statusById.has(r))),o=new Set([...this.ownedHold,...t]);this.ownedHold=t;for(let r of o){let s=this.circleById.get(r);s&&this.paintSeat(s,r),this.syncSelectionMarker(r)}o.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ne&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let t=e&&this.selection.has(e)?e:null;if(t===this.selectionFocusId)return;let o=this.selectionFocusId;this.selectionFocusId=t;for(let r of this.seats){let s=this.circleById.get(r.id);s&&this.paintSeat(s,r.id)}o&&this.syncSelectionMarker(o),t&&this.syncSelectionMarker(t);for(let[r,s]of this.selectionMarkers)s.opacity(!t||r===t?1:.2);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}setSeatMarks(e){let t=this.seatMarks.merge(e,this.statusById);for(let o of t){let r=this.circleById.get(o);r&&this.paintSeat(r,o)}t.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 t of this.selection){let o=this.seatById.get(t);o&&e.push(o)}return e}clearSelection(){let e=[...this.selection];for(let t of e)this.setSelected(t,!1,!0);this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let t=[];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 r=this.seatById.get(o);r&&t.push(r)}return t.length&&this.overlayLayer.batchDraw(),t}setManageInteraction(e){this.marquee&&this.cancelMarquee(),this.gestures.resetPan(),this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let t=[...this.selection].filter(o=>!this.isSelectable(o));t.length&&this.deselect(t),!e.manageMode&&this.selection.size&&this.clearSelection(),this.container.style.cursor="default",this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[t,o]of Object.entries(e??{}))Number.isFinite(o)&&this.sectionHeat.set(t,Math.max(0,Math.min(1,o)));for(let t of this.sections)this.refreshSectionHeat(t);this.bgLayer.batchDraw()}deselect(e){let t=!1;for(let o of e)this.selection.has(o)&&(this.setSelected(o,!1,!0),t=!0);t&&this.overlayLayer.batchDraw()}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let t of this.seats)this.isSelectable(t.id)&&e.push(t.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let t=new Set(e),o=[];for(let r of this.seats)t.has(r.label)&&this.isSelectable(r.id)&&o.push(r.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 t=[],o=new Set;for(let r of this.sections)if(!(r.id!==e&&r.logicalId!==e&&r.zone!==e))for(let s of r.memberIds){if(o.has(s)||(o.add(s),!this.isSelectable(s)))continue;let n=this.seatById.get(s);n&&t.push(n)}return t}selectMany(e){let t=e.filter(r=>!this.selection.has(r));if(!t.length)return this.getSelection();let o=this.selection.size+t.length<=Jo;for(let r of t)if(o)this.setSelected(r,!0,!0);else{this.selection.add(r);let s=this.circleById.get(r);s&&this.paintSeat(s,r)}return this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}beginMarquee(e){let t=this.screenToWorld(e),o=this.stage.scaleX()||1,r=new Hn({x:t.x,y:t.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(r),this.marquee={start:t,rect:r},this.marqueeCur=t,this.overlayLayer.batchDraw()}updateMarquee(e){if(!this.marquee)return;let t=this.screenToWorld(e),{start:o,rect:r}=this.marquee;r.setAttrs({x:Math.min(o.x,t.x),y:Math.min(o.y,t.y),width:Math.abs(t.x-o.x),height:Math.abs(t.y-o.y)}),this.marqueeCur=t,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 t=this.marqueeCur??e.start;this.marqueeCur=null;let o=Math.min(e.start.x,t.x),r=Math.max(e.start.x,t.x),s=Math.min(e.start.y,t.y),n=Math.max(e.start.y,t.y),l=this.stage.scaleX()||1;if((r-o)*l<4&&(n-s)*l<4){this.selection.size&&(this.clearSelection(),this.opts.onMarquee?.([]));return}let a=[];for(let c of this.seats){let d=this.renderedSeatPoint(c);d.x<o||d.x>r||d.y<s||d.y>n||this.isSelectable(c.id)&&a.push(c.id)}this.selectMany(a),this.opts.onMarquee?.(this.getSelection())}flashSeat(e,t="#f43f5e"){let o=this.seatById.get(e);o&&bs(this.flashHost,e,this.renderedSeatPoint(o),t)}flashSection(e,t="#22a06b"){Ss(this.flashHost,this.sections.filter(o=>o.id===e||o.zone===e),t)}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,t)=>this.projectedSectionPoint(e,t),isoLiftLocal:e=>this.isoLiftLocal(e)}}nearestSeat(e,t){let o=this.seatById.get(e);if(!o)return null;let r=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(o.id)??o:o,s=null,n=1/0;for(let l of this.seats){if(l.id===e)continue;let a=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(l.id)??l:l,c=a.x-r.x,d=a.y-r.y,h=c*t.x+d*t.y;if(h<=.5)continue;let u=Math.abs(c*t.y-d*t.x),m=h+u*2.5;m<n&&(n=m,s=l.id)}return s}focusSeat(e){let t=this.seatById.get(e);if(!t)return;this.focusedId=e,this.focusRing.radius(this.seatR+3),this.focusRing.position(this.renderedSeatPoint(t));let o=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;this.focusRing.scale({x:o,y:o}),this.focusRing.visible(!0),this.ensureVisible(t),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(t)}ensureVisible(e){let t=this.stage.width(),o=this.stage.height(),r=Math.max(this.stage.scaleX(),Pe*1.2),s=this.worldToScreen(e),n=70,l=s.x<n||s.x>t-n||s.y<n||s.y>o-n;if(this.stage.scaleX()<r||l){let a=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?re(this.perspectiveBaseAffine,a):this.isoT===0?a:this.isoForward(a);this.stage.scale({x:r,y:r}),this.stage.position({x:t/2-c.x*r,y:o/2-c.y*r}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=Is(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}framingViewport(){return Ps(this.stage.width(),this.stage.height(),this.viewportInsets)}framingWorldRect(){return As(this.framingViewport(),e=>this.screenToWorld(e))}zoomToFit(){let e=this.framingViewport(),t=e.width,o=e.height,r=this.viewMode==="perspective"&&this.perspectiveBounds?this.perspectiveBounds:this.bounds;if(this.fitScale=Math.min(t/r.width,o/r.height)||1,this.opts.portraitFitCrop&&!this.exportMode){let n=t/r.width<=o/r.height,l=r.height*this.fitScale;n&&l<.55*o&&(this.fitScale=Math.min(this.fitScale*1.3,.62*o/r.height))}let s=this.fitScale;if(this.stage.scale({x:s,y:s}),this.stage.position({x:e.x+(t-r.width*s)/2-r.x*s,y:e.y+(o-r.height*s)/2-r.y*s}),this.settleView(),!this.exportMode){let n=Qr(this.stage,[this.bgLayer,this.seatLayer],e);n>0&&n!==1&&(this.fitScale*=n),n>0&&this.afterViewChange(),this.fitPose=Ai(this.stage)}this.stage.batchDraw()}refitCurrentView(){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 xs(this.stage)}setCameraPose(e){this.cancelGlide(),Ms(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.zoomAbout(this.stage.scaleX()*pt.ZOOM_STEP,$t(this.framingViewport()))}zoomOut(){this.zoomAbout(this.stage.scaleX()/pt.ZOOM_STEP,$t(this.framingViewport()))}zoomOutLevel(){let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e),"section"):"venue":this.getRung()==="seats"?(this.setRung("sections"),"sections"):(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let t of this.gaById.values())e+=t.capacity;return e}worldToScreen(e){let t=this.stage.scaleX(),o=e.id,r=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let l=r?this.perspectiveSeatProjected.get(r.id)??re(this.perspectiveBaseAffine,e):re(this.perspectiveBaseAffine,e);return{x:l.x*t+this.stage.x(),y:l.y*t+this.stage.y()}}let s=r?this.renderedSeatPoint(r):e,n=this.isoT===0?s:this.isoForward(s);return{x:n.x*t+this.stage.x(),y:n.y*t+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let t=e===null?null:[...e];if(!this.sameAccessFilter(t)){this.accessFilter=t;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 r=this.circleById.get(o.id);r&&this.paintSeat(r,o.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let t=this.accessFilter;return t===null||e===null?t===e:t.length===e.length&&t.every((o,r)=>o===e[r])}setCommercialLimitedFilter(e){if(this.commercialLimitedFilter!==e){this.commercialLimitedFilter=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setCategoryFilter(e){let t=e===null?null:new Set(e);if(!Qs(t,this.categoryFilter)){this.categoryFilter=t;for(let o of this.seats){let r=this.circleById.get(o.id);r&&this.paintSeat(r,o.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}applyGAFilterState(){this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){qs({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=>$s(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<se,effScale:()=>this.effScale(),labelLegible:e=>me(e,this.effScale())})}setGAStates(e){Zs(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,t){this.setGAStates({[e]:t})}focusCategories(e,t){if(!e?.length){this.focusRegion(this.bounds,{animate:t?.animate,durationMs:this.cameraGlideMs});return}let o=new Set(e),r=this.seats.filter(d=>!o.has(d.categoryKey)||this.seatInClosedSection(d.id)?!1:(this.statusById.get(d.id)??"free")==="free"||this.ownedHold.has(d.id));if(!r.length)return;let s=js(r.map(d=>d.id),this.seatSection);s&&this.focusSection(s);let n=Math.max(24,this.seatR*3),l=r.map(d=>this.renderedSeatPoint(d)),a=Di(l,n),c=this.narrowSeatDetailFocus(l,a);this.focusRegion(c?.bounds??a,{animate:t?.animate,durationMs:this.cameraGlideMs,minScale:c?.minScale})}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let l=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(l),this.zoomToFit();return}let t=e==="isometric"?1:0,o=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=t,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),o){this.isoT=t,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=t,this.applyIso(),this.afterViewChange();return}let r=this.isoT;if(r===t){this.applyIso(),this.afterViewChange();return}let s=performance.now(),n=l=>{if(this.destroyed)return;let a=Math.min(1,(l-s)/er),c=a<.5?4*a*a*a:1-Math.pow(-2*a+2,3)/2;this.isoT=r+(this.isoTarget-r)*c,this.applyIso(),this.scheduleViewChange(),a<1?this.isoRaf=requestAnimationFrame(n):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(n)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}isoParams(){return ht(this.isoState)}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),t=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,t)}return this.stage.scaleX()*(1-(1-et)*this.isoT)}isoForward(e){return Pn(e,this.isoState)}isoInverse(e){return xn(e,this.isoState)}buildPerspectiveProjection(e){let t=Fn({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=t.camera,this.perspectiveBaseAffine=t.baseAffine,this.perspectiveBaseInverse=t.baseInverse,this.perspectiveBounds=t.bounds}setContainerAffine(e,t,o){An(e,t,o)}resetContainerTransform(e){Rn(e)}sectionSurfaceHeight(e,t){return En(e,t)}projectedSectionPoint(e,t){return _n(e,t,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return Bn(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return Mn(e,this.isoState)}resetLayerTransforms(e=!0){let t=e?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let o of t)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)}resetSectionProjection(e=!0){for(let t of this.sections){this.resetContainerTransform(t.rootGroupBg),this.resetContainerTransform(t.liftGroupBg),e&&this.resetContainerTransform(t.liftGroupSeat),t.rootGroupBg.zIndex(t.bgZIndex),e&&t.liftGroupSeat.zIndex(t.seatZIndex);let o=this.labelLiftGroups.get(t.id);o&&e&&this.resetContainerTransform(o),t.perspectiveAffine=void 0,t.perspectiveCorrection=void 0,t.perspectiveDepth=void 0}}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,t){On(this.seatAnchorContext,e,t)}applyPerspective(e=!0){let t=this.perspectiveCamera,o=this.perspectiveBaseAffine,r=this.perspectiveBaseInverse;if(!t||!o||!r)return;let s=this.seats.length>2500&&this.sections.length>0;this.cached&&!s&&(this.seatLayer.clearCache(),this.seatLayer.listening(!0),this.cached=!1),this.resetLayerTransforms(e),this.resetSectionProjection(e);for(let l of[this.bgLayer,this.overlayLayer])this.setContainerAffine(l,o,t.target);this.perspectiveAppliedSeats.clear(),s||this.applyExactSeatAnchors(!0);for(let l of this.sections){let a=h=>this.sectionSurfaceHeight(l,h),c=Rt(t,l.centroid,a),d=Ro(r,c);l.perspectiveAffine=c,l.perspectiveCorrection=d,l.perspectiveDepth=ye(t,l.centroid,a(l.centroid)).depth,this.setContainerAffine(l.liftGroupBg,d,l.centroid);for(let h=0;h<l.sideFaces.length;h++){let u=l.outline[h],m=l.outline[(h+1)%l.outline.length],y=this.perspectiveLocalPoint(ye(t,u,0)),f=this.perspectiveLocalPoint(ye(t,m,0)),p=this.perspectiveLocalPoint(ye(t,m,a(m))),g=this.perspectiveLocalPoint(ye(t,u,a(u)));l.sideFaces[h].points([y.x,y.y,f.x,f.y,p.x,p.y,g.x,g.y]),l.sideFaces[h].opacity(.9)}}let n=[...this.sections].sort((l,a)=>(a.perspectiveDepth??0)-(l.perspectiveDepth??0));for(let l of n)l.rootGroupBg.moveToTop(),l.liftGroupSeat.moveToTop();this.unsectionedSeatGroup?.moveToTop(),this.syncSeatOverlayPositions(),s||this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyIso(){if(this.resetSectionProjection(),this.applyExactSeatAnchors(!1),this.isoT===0)this.resetLayerTransforms();else{let{th:t,sg:o}=this.isoParams(),r=Math.cos(t),s=o*Math.sin(t),n=-Math.sin(t),l=o*Math.cos(t),a=Math.sqrt(r*r+s*s),c=r*l-s*n,d=Math.atan2(s,r)*180/Math.PI,h=a,u=c/a,m=(r*n+s*l)/c,y=this.isoCentre;for(let f of[this.bgLayer,this.seatLayer,this.overlayLayer])f.position({x:y.x,y:y.y}),f.offset({x:y.x,y:y.y}),f.rotation(d),f.scaleX(h),f.scaleY(u),f.skewX(m),f.skewY(0)}this.applyUprightLabels(),this.applyElevation(),this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyUprightLabels(){let e=Bt*this.isoT,t=1/(1-(1-et)*this.isoT),o=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let r of o){let s=r.find("Text");for(let n of s){let l=n.getAttr("uprightBase");l==null&&(l=n.rotation(),n.setAttr("uprightBase",l)),n.rotation(l-e),n.scaleX(1),n.scaleY(t),n.skewX(0)}}}applyElevation(){let e=this.isoT;for(let t of this.sections){if(t.liftWorld<=0)continue;let o=this.isoLiftLocal(t.liftWorld);t.liftGroupBg?.position(o),t.liftGroupSeat.position(o),this.labelLiftGroups.get(t.id)?.position(o);let r=.9*e;for(let s=0;s<t.sideFaces.length;s++){let n=t.sideFaces[s],l=t.outline[s],a=t.outline[(s+1)%t.outline.length];n.points([l.x,l.y,a.x,a.y,a.x+o.x,a.y+o.y,l.x+o.x,l.y+o.y]),n.opacity(r)}}this.syncSeatOverlayPositions()}destroy(){this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.rafId&&cancelAnimationFrame(this.rafId),this.isoRaf&&cancelAnimationFrame(this.isoRaf),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),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 t=this.focusedSectionId;return t==null||e.id===t||e.logicalId===t||e.zone===t}focusedSeatOpacity(e,t){if(!this.focusedSectionId||!this.focusDimOverlay)return t;let o=this.seatSection.get(e);return t*(o&&this.sectionMatchesFocus(o)?1:Me)}sectionScreenBounds(e){return ts({viewMode:this.viewMode,isoT:this.isoT,stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y(),projectedSectionPoint:(t,o)=>this.projectedSectionPoint(t,o),isoLiftLocal:t=>this.isoLiftLocal(t),isoForward:t=>this.isoForward(t)},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=se,t=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,o=96,r=this.stage.width(),s=this.stage.height();for(let n of this.sections){let l=!0;if(e){let c=this.sectionScreenBounds(n);l=c.x+c.width>=-o&&c.y+c.height>=-o&&c.x<=r+o&&c.y<=s+o,l&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,n.memberIds)}n.liftGroupSeat.setViewportCulled(!l),this.labelLiftGroups.get(n.id)?.setViewportCulled(!l)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,this.seats.filter(n=>!this.seatSection.has(n.id)).map(n=>n.id))}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let t of this.sections)if(!t.liftGroupSeat.isViewportCulled())for(let o of t.memberIds){let r=this.seatById.get(o);r&&e.push(r)}for(let t of this.seats)this.seatSection.has(t.id)||e.push(t);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 t=this.seatSection.get(e.id);if(!t||t.liftWorld<=0||this.isoT===0)return e;let o=this.isoLiftLocal(t.liftWorld);return{x:e.x+o.x,y:e.y+o.y}}seatLabelContainer(e){let t=this.seatSection.get(e);if(!t)return this.labelGroup;let o=this.labelLiftGroups.get(t.id);return o||(o=new lt({listening:!1}),o.setViewportCulled(t.liftGroupSeat.isViewportCulled()),o.position(this.viewMode==="perspective"?{x:0,y:0}:this.isoLiftLocal(t.liftWorld)),this.labelGroup.add(o),this.labelLiftGroups.set(t.id,o)),o}syncSeatOverlayPositions(){if(this.hoveredId){let e=this.seatById.get(this.hoveredId);if(e){this.hoverRing.position(this.renderedSeatPoint(e));let t=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.hoverRing.scale({x:t,y:t})}}if(this.focusedId){let e=this.seatById.get(this.focusedId);if(e){this.focusRing.position(this.renderedSeatPoint(e));let t=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.focusRing.scale({x:t,y:t})}}for(let[e,t]of this.selectionMarkers){let o=this.seatById.get(e);if(o){t.position(this.renderedSeatPoint(o));let r=this.viewMode==="perspective"?this.perspectiveSeatScale.get(o.id)??1:1;t.scale({x:r,y:r})}}}renderSeats(e=this.seats){ms({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,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:t=>this.seatContainer(t),buildAccessGlyph:(t,o)=>this.buildAccessGlyph(t,o),paintSeat:(t,o)=>this.paintSeat(t,o),labelFont:()=>this.labelFont()})}buildAccessGlyph(e,t){let o=this.seatR*1.5/we,r=new vc({x:e.x,y:e.y,data:Ct(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:mi(t),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Qt(r),r}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[t,o]of this.accessGlyphById){let r=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1,s=this.seatR*1.5/we*r,l=this.accessGlyphFilterEmphasized(t)?Uo:Yo,a=Math.max(s,l/(we*Math.max(e,.001)));o.scale({x:a,y:a}),o.visible(this.accessGlyphShouldShow(t))}}accessGlyphFilterEmphasized(e){let t=this.seatById.get(e),o=this.accessFilter;return!!t&&o!==null&&!!t.accessibility?.includes("wheelchair")&&(o.length===0||o.includes("wheelchair"))&&Se(t,o)}accessGlyphShouldShow(e){return this.accessGlyphById.has(e)&&this.accessGlyphEligible(e)}accessGlyphEligible(e){let t=this.statusById.get(e)??"free";return!(t==="booked"||t==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryDisplayColor(e){return this.colorblind?this.cbHueByKey.get(e)??Wt[0]:this.catColor.get(e)??"#6e7bff"}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??st}seatLabelInk(e,t){let o=t.fill();return $(typeof o=="string"?o:"",this.seatPreferredLabelInk(e))}paintSeat(e,t){let o=this.seatById.get(t),r=this.statusById.get(t)??"free",s=this.selection.has(t),n=this.categoryDisplayColor(o.categoryKey),l=this.boothLabelById.get(t);e.dash(Nn),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let a=r==="held"&&this.ownedHold.has(t),c=a?null:zs(r,this.canvasBackground,this.colorblind);if(c?(e.fill(c.fill),e.stroke(c.stroke),e.strokeWidth(c.strokeWidth),e.dash(c.dash),e.opacity(c.opacity),c.scale!==1&&e.scale({x:c.scale,y:c.scale})):a?(e.fill(ve(n,this.effSelection===nt?.24:.1)),e.stroke(this.effSelection),e.strokeWidth(3)):e.fill(s&&this.effSelection===nt?ve(n,.28):n),this.seatMarks.paint(e,t,r,n,this.seatR,this.colorblind,this.seatInClosedSection(t)),Hi(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&r==="free"&&(e.stroke(gt(o.accessibility)),e.strokeWidth(s?3:2),e.dash([3,2])),l&&(l.text(r==="booked"?"SOLD":r==="held"?"HELD":o.label),l.fontSize(r==="free"?10:Math.min(10,Math.max(6,this.boothDims.get(o.rowId)?.width??40)/6)),l.fontStyle(r==="free"?"600":"800"),l.fill(r==="free"?this.theme.seatLabelColor??st:"#ffffff"),l.offsetX(l.width()/2),l.offsetY(l.height()/2)),this.accessFilter&&r==="free"&&!s){let u=Ri(o,this.accessFilter);u==="other"?e.opacity(ns):u==="companion"&&e.opacity(as)}if(this.categoryHighlight&&r==="free"&&!s&&o.categoryKey!==this.categoryHighlight&&e.opacity(.25),this.categoryFilter&&r==="free"&&!s&&!this.categoryFilter.has(o.categoryKey)&&e.opacity(.22),this.commercialLimitedFilter&&r==="free"&&!s&&(o.commercial?.restrictedView||o.commercial?.obstructedView)&&e.opacity(.22),this.dimmedSections.size){let u=this.seatSection.get(t);(u?this.dimmedSections.has(u.id)||this.dimmedSections.has(u.logicalId)||u.zone!=null&&this.dimmedSections.has(u.zone):this.dimmedSections.has(mo))&&e.opacity(.18)}this.closedSections.size&&this.seatInClosedSection(t)&&(e.fill(kr),e.stroke(""),e.strokeWidth(0),e.dash(Nn),e.opacity(Lr),e.scale({x:1,y:1})),this.selectionFocusId&&t!==this.selectionFocusId&&e.opacity(Math.min(e.opacity(),.16));let d=this.boothLabelById.get(t)??this.seatLabelById.get(t);d&&(d.fill(this.seatLabelInk(o,e)),d.visible(me(d.fontSize(),this.effScale())&&e.opacity()>=.5));let h=this.accessGlyphById.get(t);if(h){let u=e.fill();h.fill(mi(typeof u=="string"?u:"")),h.opacity(e.opacity()),h.visible(this.accessGlyphShouldShow(t))}this.accessRingById.get(t)?.opacity(e.opacity())}seatInClosedSection(e){if(!this.closedSections.size)return!1;let t=this.seatSection.get(e);return!!t&&(this.closedSections.has(t.id)||this.closedSections.has(t.logicalId)||t.zone!=null&&this.closedSections.has(t.zone))}setColorblindSafe(e){if(e!==this.colorblind){this.colorblind=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}for(let t of this.sections)t.shellCategoryColor=this.dominantSellableColor(t.memberIds),this.refreshSectionFill(t);this.bgLayer.batchDraw(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setDimmedSections(e){let t=new Set(e??[]);if(!(t.size===this.dimmedSections.size&&[...t].every(o=>this.dimmedSections.has(o)))){this.dimmedSections=t;for(let o of this.seats){let r=this.circleById.get(o.id);r&&this.paintSeat(r,o.id)}this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setClosedSections(e){let t=new Set(e??[]);t.size===this.closedSections.size&&[...t].every(o=>this.closedSections.has(o))||(this.closedSections=t,this.repaintSectionsAndSeats())}focusSection(e,t){this.sections.some(o=>o.id===e||o.logicalId===e)&&(this.focusedSectionId=e,this.focusAnchor=t?.anchor??null,this.focusRoams=!1,this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),this.focusSectionCamera(e,!0,t?.anchor))}focusSectionCamera(e,t=!0,o){let r=this.sectionBounds(e);if(!r)return;let s=this.sectionMembers(e).map(c=>this.seatById.get(c)).filter(c=>c!=null),n=s.filter(c=>(this.statusById.get(c.id)??"free")==="free"||this.ownedHold.has(c.id)),l=(n.length?n:s).map(c=>this.renderedSeatPoint(c)),a=this.narrowSeatDetailFocus(l,r,o);this.focusRegion(a?.bounds??r,{animate:t,minScale:a?.minScale})}releaseSectionFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusRoams=!0,this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}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.focusedSectionId||this.floorOverview?!0:this.effScale()>=$o}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let t=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=vs(this.focusBackdropHost,t),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=ws(this.focusBackdropHost,t);for(let o of this.selectionMarkers.values())o.moveToTop();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,t)=>this.projectedSectionPoint(e,t),isoLiftLocal:e=>this.isoLiftLocal(e)}}repaintSectionsAndSeats(){for(let e of this.seats){let t=this.circleById.get(e.id);t&&this.paintSeat(t,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}),t=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y)}}getWorldBounds(){let e=1/0,t=1/0,o=-1/0,r=-1/0,s=(n,l)=>{n<e&&(e=n),l<t&&(t=l),n>o&&(o=n),l>r&&(r=l)};for(let n of this.seats)s(n.x,n.y);for(let n of this.sections)for(let l of n.outline)s(l.x,l.y);for(let n of this.gaById.values())for(let l of n.points)s(l.x,l.y);return Number.isFinite(e)?{x:e,y:t,width:Math.max(1,o-e),height:Math.max(1,r-t)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(t=>{let o=this.isSectionClosed(t)||t.free<=0,r=t.memberIds.some(l=>this.selection.has(l)),s=r||t.memberIds.some(l=>this.ownedHold.has(l)),n=this.focusedSectionId===t.id||this.focusedSectionId===t.logicalId;return{id:t.logicalId,label:t.label,outline:t.outline.map(l=>({...l})),...this.objectFloor.get(t.id)?{floorId:this.objectFloor.get(t.id)}:{},state:r?"selected":o?"inactive":"available",active:n,paint:{fill:t.shellFill,stroke:t.shellStroke},owned:s}});return{sections:e,seats:e.length?[]:this.seats.map(t=>({x:t.x,y:t.y,categoryKey:t.categoryKey,state:this.selection.has(t.id)?"selected":this.statusById.get(t.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let t=this.worldToScreen(e);this.stage.position({x:this.stage.x()+this.stage.width()/2-t.x,y:this.stage.y()+this.stage.height()/2-t.y}),this.afterViewChange(),this.stage.batchDraw()}setCategoryHighlight(e){if(this.categoryHighlight!==e){this.categoryHighlight=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}renderBackground(e){let t=Ze(e);t&&this.renderBackgroundImage(t);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,t,o,r){let s=this.assetGeneration;/^https?:\/\//i.test(t)&&(e.crossOrigin="anonymous");let n=new Promise(l=>{let a=!1,c=()=>{a||(a=!0,this.assetCancels.delete(d),l())},d=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}c()};this.assetCancels.add(d),e.onload=()=>{if(!this.exportMode){s===this.assetGeneration&&r(),c();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.assetGeneration&&r()}).catch(()=>{s===this.assetGeneration&&this.assetErrors.push(`${o} could not be decoded.`)}).finally(c)},e.onerror=()=>{s===this.assetGeneration&&this.assetErrors.push(`${o} could not be loaded.`),c()},e.src=t});this.assetPromises.push(n)}cancelAssetLoads(){this.assetGeneration++;for(let e of[...this.assetCancels])e();this.assetCancels.clear(),this.assetPromises=[],this.assetErrors=[]}renderBackgroundImage(e){sn(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,t,o,r)=>this.trackAssetImage(e,t,o,r),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){nn(this.objectDrawContext,e)}renderTable(e){an(this.objectDrawContext,e)}renderText(e){ln(this.objectDrawContext,e)}renderShape(e){cn(this.objectDrawContext,e)}renderGA(e){hn(this.objectDrawContext,e)}renderSection(e){let t=St(e.outline,e.holes),o=ae(this.canvasBackground),r=[],s=new Map,n=0,l=N(e.outline),a=this.seatIndex?At(this.seatIndex,l).map(P=>this.seatById.get(P)).filter(P=>!!P):this.seats;for(let P of a)this.seatSection.has(P.id)||ie(P,e.outline,e.holes)&&(r.push(P.id),s.set(P.categoryKey,(s.get(P.categoryKey)??0)+1),(this.statusById.get(P.id)??"free")==="free"&&n++);let c=e.color??fi([...s].map(([P,H])=>({hex:this.catColor.get(P)??"#6e7bff",w:H})),"#3a4358"),d=lo(e.elevation),h=bt(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),u=h.height*Oe,m=new ut({listening:!1});this.bgLayer.add(m);let y=new ut({listening:!1});m.add(y);let f=new lt({listening:!0});this.seatLayer.add(f);let p=[];if(u>0){let P=ue(this.zoneColor.get(e.zone??"")??c,.42);for(let H=0;H<e.outline.length;H++){let E=new Sc({points:[],closed:!0,fill:P,stroke:_("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});p.push(E),m.add(E)}}y.moveToTop();let g=y,b=e.color??this.zoneColor.get(e.zone??"")??"#3a4358",S=Ee(e.outline,e.holes,{stroke:_(b,.5),strokeWidth:1,fill:_(b,.08),listening:!1},e.outlinePath);g.add(S);let v=Ee(e.outline,e.holes,{fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Ft,opacity:0,listening:!1},e.outlinePath);g.add(v);let w=e.labelPresentation?.labelStyle,k=w?.color??o.sectionInk,T=(w?.size??18)/18,C=new Hn({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});g.add(C);let L=new Gn({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*T,fontStyle:Ne,fontFamily:this.labelFont(),fill:$(o.sectionFill,k),listening:!1,perfectDrawEnabled:!1});L.offsetX(L.width()/2),L.offsetY(L.height()/2),g.add(L);let I=new Gn({x:t.x,y:t.y,text:X("map.seatsLeft",{count:n}),fontSize:12,fontStyle:Ht,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});I.offsetX(I.width()/2),g.add(I);let M={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:t,labelAnchors:es(e.outline,e.holes??[],t),memberCategoryKeys:new Set(r.map(P=>this.seatById.get(P)?.categoryKey).filter(Boolean)),shellCategoryColor:this.dominantSellableColor(r),shellFill:o.sectionFill,shellStroke:o.sectionStroke,labelArea:no(e.outline,e.holes),zone:e.zone,memberIds:r,total:r.length,free:n,baseFill:c,outlineTint:b,outlinePoly:S,blockPoly:v,namePlate:C,nameLabel:L,subLabel:I,preferredInk:k,labelScale:T,nameLabelFits:!1,subLabelFits:!0,elevation:d,liftWorld:u,rakeDeg:h.rake,surfaceFocal:r.length?{...this.seatById.get(r[0])?.focalPoint??this.isoCentre}:{...this.chartDoc?.focalPoint??this.isoCentre},frontDistanceWorld:0,rootGroupBg:m,bgZIndex:m.zIndex(),seatZIndex:f.zIndex(),liftGroupBg:y,liftGroupSeat:f,sideFaces:p},x=r.map(P=>this.seatById.get(P)).filter(P=>!!P),A=x.length?x:e.outline;M.frontDistanceWorld=Math.min(...A.map(P=>Math.hypot(P.x-M.surfaceFocal.x,P.y-M.surfaceFocal.y)));for(let P of r)this.seatSection.set(P,M);this.refreshSectionFill(M),this.refreshSectionHeat(M),this.sections.push(M)}refreshSectionHeat(e){yn(this.sectionLodPaintContext,e)}refreshSectionFill(e){Sn(this.sectionLodPaintContext,e)}isSectionClosed(e){return Xi(this.sectionLodPaintContext,e)}dominantSellableColor(e){let t=Cr(e,o=>this.seatById.get(o)?.categoryKey,o=>this.catByKey.get(o)?.notForSale===!0);return t?this.categoryDisplayColor(t):null}sectionAccessibleFree(e){return gn(e.memberIds,this.accessFilter,t=>this.statusById.get(t)??"free",t=>this.seatById.get(t))}get sectionLodPaintContext(){return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:e=>e.memberIds.some(t=>this.selection.has(t)||this.ownedHold.has(t)),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.floorOverview,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,setLodScale:e=>{this.lodScale=e},worldToScreen:e=>this.worldToScreen(e)}}renderZones(e){ss({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let t=this.stage.scaleX(),o={x:(e.x-this.stage.x())/t,y:(e.y-this.stage.y())/t};return this.viewMode==="perspective"&&this.perspectiveBaseInverse?re(this.perspectiveBaseInverse,o):this.isoT===0?o:this.isoInverse(o)}sectionAt(e){if(!this.sections.length)return null;let t=this.screenToWorld(e),o=this.sections.find(r=>{if(this.viewMode==="perspective"&&r.perspectiveAffine)return ie(t,r.outline.map(n=>this.perspectiveLocalPoint(this.projectedSectionPoint(r,n))),r.holes.map(n=>n.map(l=>this.perspectiveLocalPoint(this.projectedSectionPoint(r,l)))));let s=r.liftWorld>0?this.isoLiftLocal(r.liftWorld):{x:0,y:0};return ie({x:t.x-s.x,y:t.y-s.y},r.outline,r.holes)});return o?o.logicalId:null}sectionMembers(e){return[...new Set(this.sections.filter(t=>t.id===e||t.logicalId===e||t.zone===e).flatMap(t=>t.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 t=this.seatById.get(e);return t?Ri(t,this.accessFilter)==="other":!1}toggleSeat(e){if(this.selection.has(e)){this.setSelected(e,!1);let t=this.seatById.get(e);t&&this.opts.onDeselect?.(t)}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 t=this.seatById.get(e);t&&this.opts.onSelect?.(t)}this.overlayLayer.batchDraw()}resolveCanvasBackground(){let e=this.theme.background?pi(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let t=this.container;for(;t;){let o=pi(getComputedStyle(t).backgroundColor);if(o)return o;t=t.parentElement}}return _i}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:Y(this.canvasBackground)?ls:nt}setSelected(e,t,o=!1){let r=this.circleById.get(e);t?this.selection.add(e):(this.selectionFocusId===e&&this.setSelectionFocus(null),this.selection.delete(e)),r&&(this.paintSeat(r,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())}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){return os({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:(t,o)=>this.projectedSectionPoint(t,o),isoLiftLocal:t=>this.isoLiftLocal(t),isoForward:t=>this.isoForward(t),renderedSeatPoint:t=>this.renderedSeatPoint(t),labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(t,o,r)=>this.resolveAutomaticRowLabelPosition(t,o,r),rowLabelBox:(t,o)=>this.rowLabelBox(t,o)},e)}sectionFrameScale(e){let t=this.sectionBounds(e);return t?ks(this.stage,t,this.zoomBounds(),this.framingViewport()):this.stage.scaleX()}handleSeatTap(e){if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let o=this.objectFloor.get(this.seatById.get(e)?.rowId??"");if(o){this.opts.onDeckTap(o);return}}if(this.effScale()<ne&&this.sections.length){let o=this.seatSection.get(e);if(o){let r=this.focusedSectionId===o.logicalId,s=this.sectionFrameScale(o.logicalId)>this.stage.scaleX()*1.02;if(!r&&s){let n=this.seatById.get(e),l=n?this.renderedSeatPoint(n):void 0;this.opts.onSectionTap?this.opts.onSectionTap(o.logicalId,l):this.focusSection(o.logicalId,{anchor:l});return}}}if(!(this.selection.has(e)||this.isSelectable(e))){let o=this.seatById.get(e)??null;o&&(this.opts.onHover?.(o,{mark:this.seatMarks.get(e)??null,interaction:"press",unavailable:!0,...this.hiddenByAccessFilter(e)?{filteredOut:!0}:{}}),this.moments.nudge(e));return}this.seatMarks.has(e)&&this.opts.onHover?.(this.seatById.get(e)??null,{mark:this.seatMarks.get(e),interaction:"press"}),this.toggleSeat(e)}deckFloorAt(){return gs(this.screenPickingHost)}nearestSeatToScreen(e,t,o=!1){return ys(this.screenPickingHost,e,t,{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(){this.seatLayer.on("click tap",e=>{if(this.moved>ke||this.isGhostClick(e))return;let t=Ui(e.target);t&&this.handleSeatTap(t)}),this.seatLayer.on("mouseover",e=>{let t=Ui(e.target);if(!t)return;let o=this.seatById.get(t);if(!o)return;this.hoveredId=t,this.hoverRing.position(this.renderedSeatPoint(o));let r=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1;this.hoverRing.scale({x:r,y:r}),this.hoverRing.visible(!0),this.overlayLayer.batchDraw(),this.container.style.cursor="pointer",this.opts.onHover?.(o,{mark:this.seatMarks.get(t),interaction:"hover"})}),this.seatLayer.on("mouseout",()=>{this.hoveredId=null,this.hoverRing.visible(!1),this.overlayLayer.batchDraw(),this.container.style.cursor="default",this.opts.onHover?.(null,{mark:null})}),this.stage.on("wheel",e=>{e.evt.preventDefault(),this.releaseSectionFocusDim();let t=this.container.getBoundingClientRect(),o={x:e.evt.clientX-t.left,y:e.evt.clientY-t.top},r=Math.exp(-e.evt.deltaY*.002);this.zoomAbout(this.stage.scaleX()*G(r,.5,2),o)}),this.stage.on("click tap",e=>{if(this.moved>ke||this.isGhostClick(e))return;let t=this.stage.getPointerPosition();if(!t)return;if(!this.cached){if(Ui(e.target))return;if(this.seatsRevealed()){let r=this.focusedSectionId,s=this.nearestSeatToScreen(t,xe),n=s?this.seatSection.get(s):null;if(s&&(!r||n&&this.sectionMatchesFocus(n))){this.handleSeatTap(s);return}let l=s?null:this.nearestSeatToScreen(t,xe,!0),a=l?this.seatSection.get(l):null;if(l&&(!r||a&&this.sectionMatchesFocus(a))){this.handleSeatTap(l);return}if(r&&this.opts.onBackdropTap&&!this.floorOverview){let d=this.sectionAt(t);if(d&&d!==r){let h=this.sectionTapAnchor(d,this.screenToWorld(t));this.opts.onSectionTap?this.opts.onSectionTap(d,h):this.focusSection(d,{anchor:h})}else d||this.opts.onBackdropTap();return}if(r)return;let c=this.sections.length?this.sectionAt(t):null;if(!c||this.effScale()>=ne||this.sectionFrameScale(c)<=this.stage.scaleX()*1.02)return}}if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let r=this.floorOverview?this.sectionAt(t):null,s=(r?this.objectFloor.get(r):null)??this.deckFloorAt();if(s){this.opts.onDeckTap(s);return}}if(this.sections.length){let r=this.screenToWorld(t),s=this.owned.badgeAt(r)??this.sectionAt(t);if(s){let n=this.sectionTapAnchor(s,r);this.opts.onSectionTap?this.opts.onSectionTap(s,n):this.focusSection(s,{anchor:n});return}}let o=Math.max(Pe*1.2,this.stage.scaleX()*2.5);this.zoomAbout(o,t)})}zoomBounds(){let e=.5*this.fitScale;return this.zones.length&&(e=Math.min(e,He*.9)),{min:e,max:Math.max(10*this.fitScale,4)}}zoomAbout(e,t){Ls(this.stage,e,t,this.zoomBounds())&&(this.afterViewChange(),this.stage.batchDraw())}zoomToBounds(e,t){Ts(this.stage,e,this.zoomBounds(),t,this.framingViewport()),this.settleView(),this.stage.batchDraw()}focusRegion(e,t){let o=typeof e=="string"?this.sectionBounds(e):e;if(!o)return;if(this.cancelGlide(),t?.animate===!1||this.reducedMotion){this.zoomToBounds(o,t?.minScale);return}let r=this.framingViewport(),s=r.width,n=r.height,{min:l,max:a}=this.zoomBounds(),c=1.12,d=Math.min(s/(o.width*c),n/(o.height*c)),h=G(Math.max(d,t?.minScale??l),l,a),u=r.x+s/2-(o.x+o.width/2)*h,m=r.y+n/2-(o.y+o.height/2)*h,y=this.stage.scaleX(),f=this.stage.x(),p=this.stage.y();if(Math.abs(h-y)<1e-4&&Math.abs(u-f)<.5&&Math.abs(m-p)<.5){this.settleView();return}let g=performance.now(),b=Math.max(180,Math.min(1200,t?.durationMs??this.cameraGlideMs));this.glideInProgress=!0;let S=v=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let w=Math.min(1,(v-g)/b),k=w<.5?4*w*w*w:1-Math.pow(-2*w+2,3)/2,T=y+(h-y)*k;this.stage.scale({x:T,y:T}),this.stage.position({x:f+(u-f)*k,y:p+(m-p)*k}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),w<1?this.glideRaf=requestAnimationFrame(S):(this.glideRaf=0,this.glideInProgress=!1,this.settleView())};this.glideRaf=requestAnimationFrame(S)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){let e=this.effScale();return e>=se?"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,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,t)=>this.focusedSeatOpacity(e,t),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),tn(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let t=e==="sections"?(ge+se)/2:this.seatRungScale(),o=this.framingViewport(),r=o.width,s=o.height,n=$t(this.framingWorldRect()),l=n.x,a=n.y;if(e==="sections"&&this.sections.length>0){let u=this.sections.map(p=>{let g=N(p.outline);return{x:g.x+g.width/2,y:g.y+g.height/2}}),m=r/(t*2),y=s/(t*2);if(!u.some(p=>Math.abs(p.x-n.x)<=m&&Math.abs(p.y-n.y)<=y)){let p=u.reduce((g,b)=>{let S=(b.x-n.x)**2+(b.y-n.y)**2;return S<g.distance?{point:b,distance:S}:g},{point:u[0],distance:1/0});l=p.point.x,a=p.point.y}}let c=e==="seats"?this.seats.filter(u=>u.kind!=="booth"):[];if(c.length>0){let u=c[0],m=1/0;for(let y of c){let f=y.x-n.x,p=y.y-n.y,g=f*f+p*p;g<m&&(u=y,m=g)}l=u.x,a=u.y}let d=r/(t*1.12),h=s/(t*1.12);this.focusRegion({x:l-d/2,y:a-h/2,width:d,height:h})}seatRungScale(){return _s(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,t,o){let r=this.framingViewport();return Bs({stageWidth:r.width,stageHeight:r.height,fullBounds:t,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}seatLabelTargetScale(){return Cs({seats:this.seats,seatR:this.seatR,labelFont:()=>this.labelFont(),seatLabelScale:e=>this.seatLabelScale(e)})}afterViewChange(){this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){if(!this.focusRoams||!this.focusedSectionId||this.floorOverview)return;let e=is({sections:this.sections.map(t=>({logicalId:t.logicalId,members:t.memberIds.length,bounds:this.sectionScreenBounds(t)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!e||e===this.focusedSectionId||(this.focusedSectionId=e,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(e))}scheduleViewChange(){this.exportMode||this.viewChangeRaf||(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()}))}sizeLabel(e,t,o){e.fontSize(Math.max(1,t)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(o)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),be+.01,ne):this.effScale(),t=Math.max(e,1e-4);for(let[s,n]of this.primaryFocalLabels)dn(s,n,t,(l,a)=>{this.sizeLabel(l,a,l.y())});this.hasSections?(vn(this.sectionLodPaintContext,e),this.owned.sync(e)):this.primaryFocalLabels.size&&this.bgLayer.batchDraw(),this.paintGAStateForView(),this.updateAccessGlyphs(e),this.seatGlyphDetail=fs(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail);let o=!this.exportMode&&e<se;if(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)return;this.updateSeatGroupVisibility();let e=G(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.rebuildSeatCache(),this.seatLayer.batchDraw()}releaseSeatLayerBitmap(){wn(ei,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<se?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.assetGeneration,t=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assetPromises.slice(),...t?[t.ready.then(()=>{}),t.load("700 24px Inter").then(()=>{}),t.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assetGeneration)throw new Error("The chart changed while its export assets were loading.");if(this.assetErrors.length)throw new Error(`Export stopped because ${this.assetErrors.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(n=>n.getClientRect({relativeTo:this.stage})).filter(n=>n.width>0&&n.height>0);if(!e.length)return this.bounds;let t=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y)),r=Math.max(...e.map(n=>n.x+n.width)),s=Math.max(...e.map(n=>n.y+n.height));return{x:t,y:o,width:Math.max(1,r-t),height:Math.max(1,s-o)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),t=this.stage.height(),o=Math.max(12,Math.min(36,Math.min(e,t)*.025)),r=()=>{let s=this.exportSceneBounds(),n=Math.max(1,e-o*2),l=Math.max(1,t-o*2),a=Math.min(n/s.width,l/s.height)||1;this.fitScale=a,this.stage.scale({x:a,y:a}),this.stage.position({x:(e-s.width*a)/2-s.x*a,y:(t-s.height*a)/2-s.y*a}),this.afterViewChange()};r(),r()}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(r){let s=r instanceof Error?r.message:String(r);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${s}`)}let t=document.createElement("canvas");t.width=this.stage.width(),t.height=this.stage.height();let o=t.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,t.width,t.height);try{o.drawImage(e,0,0)}finally{e.width=1,e.height=1}return t}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),ne):this.effScale();for(let{node:t,backdrop:o,kind:r}of this.freeTextById.values()){if(r==="ga-label"||r==="ga-capacity")continue;let s=r==="free-text"&&this.nodeBelongsToFocusedSection(t),n=r==="direct-landmark";if(n){let a=Number(t.getAttr("directLandmarkBaseFontSize"))||t.fontSize();t.setAttr("directLandmarkBaseFontSize",a),t.fontSize(Math.max(a,U/e))}let l=n||s||me(t.fontSize(),e);t.visible(l),o?.visible(l)}for(let{node:t,fontSize:o}of this.iconNodeById.values())t.visible(this.nodeBelongsToFocusedSection(t)||me(o,e))}nodeBelongsToFocusedSection(e){let t=this.focusedSectionId;if(!t)return!1;let o=this.sections.filter(n=>n.id===t||n.logicalId===t||n.zone===t);if(!o.length)return!1;let r=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),s={x:r.x+r.width/2,y:r.y+r.height/2};return o.some(n=>ie(s,n.outline,n.holes))}buildRowLabelPlan(e){this.rowLabelPlan=fn(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:t=>this.objectFilteredOut(t)})}rowLabelBox(e,t,o=Q){return zi(e,t,o)}resolveAutomaticRowLabelPosition(e,t,o){return mn(e,t,o,this.seatIndex)}objectFilteredOut(e){let t=e.categoryKey;return t?!!(this.categoryHighlight&&t!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(t)):!1}updateLabels(){Cn(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,t)=>this.focusedSeatOpacity(e,t),labelGroup:this.labelGroup,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,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),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,t,o)=>this.resolveAutomaticRowLabelPosition(e,t,o),rowLabelBox:(e,t)=>this.rowLabelBox(e,t),isoT:this.isoT,applyUprightLabels:()=>this.applyUprightLabels(),overlayLayer:this.overlayLayer}}handleResize(){let e=this.container.clientWidth||1,t=this.container.clientHeight||1;e===this.stage.width()&&t===this.stage.height()||(this.stage.size({width:e,height:t}),this.refitCurrentView())}};pt.ZOOM_STEP=1.4;var $i=pt;function Wn(i,e){return new $i(i,e)}function Vn(i,e,t){let o=new Map,r=new Map,s=new Map,n=new Map,l=[],a=new Map(co(i).map(h=>[h.id,h])),c=kt(i),d=new Map([...c.sections,...c.ungrouped?[c.ungrouped]:[]].map(h=>[h.id,h.label]));for(let h of e){o.set(h.label,h.id),r.set(h.label,h),s.set(h.id,h),l.push(h.id);let u=a.get(h.rowId),m=u&&"label"in u&&typeof u.label=="string"?u.label:void 0,y=u?.type==="row"?u.segmentedRow:void 0,f=y?.displayLabel??(u&&"displayLabel"in u&&typeof u.displayLabel=="string"&&u.displayLabel?u.displayLabel:m),p=t.get(h.rowId),g=u?.type==="table"?"table":u?.type==="booth"?"booth":"seat",b=f,S=y?.displayType?.trim()||(u&&"displayType"in u&&typeof u.displayType=="string"&&u.displayType.trim()?u.displayType.trim():void 0),v=h.displayLabel??h.label,w=v.split("-"),k=p||h.kind==="booth"?void 0:f&&v.startsWith(`${f}-`)?v.slice(f.length+1):w[w.length-1]??v;n.set(h.id,{objectId:h.rowId,objectType:g,sectionLabel:d.get(c.objectToSection.get(h.rowId)??""),rowLabel:b,seatNumber:k,...S?{displayType:S,rowType:S}:{}})}return{labelToId:o,labelToSeat:r,seatById:s,seatContext:n,allIds:l}}function zn(i,e={}){let{baseMs:t=1e3,factor:o=2,maxMs:r=1/0,jitter:s=0,random:n=Math.random}=e,l=Math.min(t*o**Math.max(0,i),r);if(s<=0)return l;let a=Math.min(1,s);return l*(1-a+a*n())}function Kn(i,e,t){return $e(i).map(o=>{let r=i.categories.find(s=>s.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:wt(o).filter(s=>t(s)==="free").length,categoryKey:o.categoryKey,tiers:r?.tiers,price:r?.tiers?.[0]?.price??r?.price??0,currency:e}})}function Xn(i,e){let t={};for(let o of i)t[o.id]=e?{available:o.available,selected:e.get(o.id)??0}:{available:o.available};return t}function Yn(i){let e={};for(let[t,o]of i.seatById)i.groupedTableBySeatId.has(t)||i.closedMembers.has(t)||(i.statusOf(t)??"free")==="free"&&(e[o.categoryKey]=(e[o.categoryKey]??0)+1);for(let t of i.groupedTablesByLabel.values()){if(t.chairs.some(r=>i.closedMembers.has(r.id)))continue;let o=t.chairs[0];o&&(i.statusOf(o.id)??"free")==="free"&&(e[t.categoryKey]=(e[t.categoryKey]??0)+t.maxOccupancy)}for(let t of i.gaAreas??[])e[t.categoryKey]=(e[t.categoryKey]??0)+t.available;return e}function wc(i){return i.accessibility?.length?i.accessibility:i.accessible?["wheelchair"]:[]}function Un(i,e){let t=new Set,o=new Map;for(let r of i){let s=wc(r);if(!s.length)continue;let n=e(r.id)==="free";for(let l of s)t.add(l),n&&o.set(l,(o.get(l)??0)+1)}return t.size?ro.filter(r=>t.has(r.key)).map(r=>({key:r.key,count:o.get(r.key)??0})):[]}var Cm=5e3,Im={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function kc(i){if(!i.holdActive||i.holdLabels.length===0)return!1;let e=i.now??Date.now();return i.holdExpiresAt!=null&&e>=i.holdExpiresAt+5e3||i.serverHoldActive===!1?!0:!i.holdLabels.some(t=>i.statusOf(t)==="held")}function $n(i){let e=new Set(i.holdLabels),t=i.selection.filter(r=>!e.has(r)&&i.statusOf(r)!=="free");if(!kc(i))return{lost:t,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let o=[...i.holdLabels];return{lost:t,holdLapsed:!0,lapsedLabels:o,recoverable:o.filter(r=>i.statusOf(r)==="free")}}function Pm(i){return i.lost.length>0||i.holdLapsed}function xm(i){return!i.lapsedLabels.length||!i.recoverable.length?"none":i.recoverable.length===i.lapsedLabels.length?"all":"partial"}function qn(i,e,t=Date.now()){return e&&t<i+5e3}function Zn(i){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let e=()=>{document.visibilityState==="visible"&&i()};return document.addEventListener("visibilitychange",e),()=>{typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",e)}}function Qn(i){if(!i?.zones?.length)return[];let e=new Set(kt(i).sections.filter(t=>t.seatCount>0&&!!t.zone).map(t=>t.zone));return i.zones.filter(t=>e.has(t.id)).map(t=>({id:t.id,label:t.label}))}function jn(i){let e=i.doc;if(!e?.objects?.length)return null;let t=e.focalPoint??{x:0,y:0},o=De(e).filter(n=>!i.groupedObjectIds.has(n.rowId)),r=new Set;for(let n of o)i.heldLabels.has(n.label)||i.tierApplies(n)&&(i.accessFilter&&!Se(n,i.accessFilter)||i.statusOfLabel(n.label)==="free"&&r.add(n.label));let s=zo(o,r,{qty:i.qty,categoryKey:i.categoryKey,zoneId:i.zoneId,focal:t,preferPremium:!0});return s.labels.length!==i.qty?null:s.labels.every(n=>i.isPremium(n))?[...s.labels]:null}var qi=["background","rowLabelColor","textColor","selectionColor"];function Jn(i,e){return!i||!e?!i&&!e:qi.every(t=>i[t]===e[t])}function ft(i){let e=i??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function ti(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function ea(i,e,t){let o=fo(e,t);o==="all"?i.setFloorOverview?.(!0):o&&i.setActiveFloor?.(o)}var Le=class extends Error{constructor(t){super(t.message);this.status=422;this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function ta(i,e){return!e||i.eventConfigurationId===e.id&&i.eventConfigurationVersion===e.version?i:{...i,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var ii=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,t){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let o=this.ref;this.pending=e.eventConfiguration(t).then(r=>{if(r.reference.id!==o.id||r.reference.version!==o.version||r.configuration.id!==o.id||r.configuration.version!==o.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return r.configuration})}return this.pending}};function ia(i){if(i!=null&&(!Number.isInteger(i)||i<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return i??null}function oa(i,e,t,o){if(t!=null&&!Array.isArray(t))throw new TypeError("picker: `selectionValidators` must be an array");let r=[],s=0,n=!1,l=!1;for(let c of t??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");s=Math.max(s,Number(c.minimum))}else if(c?.type==="consecutiveSeats")n=!0;else if(c?.type==="noOrphanSeats")l=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(s&&r.push({type:"minimumSelectedPlaces",minimum:s}),n&&r.push({type:"consecutiveSeats"}),l&&r.push({type:"noOrphanSeats"}),i!=null&&s>i)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let a=Math.max(0,Math.floor(e??i??Math.max(o,s)));if(i!=null&&a<i)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&a<s)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:r,maxSelection:i??a}}function Lc(i){let e=Number(i.slice(i.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Tc(i){if(i.length<=1)return!1;let e=i[0]?.objectId,t=i[0]?.categoryKey;if(!e||i.some(r=>r.objectId!==e||r.categoryKey!==t))return!0;let o=i.map(r=>Lc(r.id)).sort((r,s)=>r-s);return o.some((r,s)=>r<0||s>0&&r!==o[s-1]+1)}function ra(i,e,t,o,r){let s=o.find(a=>a.type==="minimumSelectedPlaces")?.minimum??0,n=t??s,l=[];return t!=null&&e!==t&&l.push("numberOfPlacesToSelect"),s&&e<s&&l.push("minimumSelectedPlaces"),o.some(a=>a.type==="consecutiveSeats")&&Tc(i)&&l.push("consecutiveSeats"),o.some(a=>a.type==="noOrphanSeats")&&r()&&l.push("noOrphanSeats"),{isValid:l.length===0,count:e,required:n,remaining:Math.max(0,n-e),seats:i,violations:l}}function sa(i){let{id:e,doc:t,seatById:o,groupedTableBySeatId:r}=i,s=t.objects.find(v=>v.type==="section"&&v.id===e);if(!s)return null;let n=i.sectionMembers(e),l=new Map,a=new Map,c=new Set,d=0,h=0;for(let v of n){let w=o.get(v);if(!w)continue;i.matchesAccessFilter&&i.statusOf(v)==="free"&&i.matchesAccessFilter(w)&&(h+=1);let k=r.get(v);if(k){if(c.has(k.label))continue;c.add(k.label),l.set(k.categoryKey,(l.get(k.categoryKey)??0)+k.maxOccupancy),i.statusOf(k.chairs[0]?.id??v)==="free"&&(d+=k.maxOccupancy,a.set(k.categoryKey,(a.get(k.categoryKey)??0)+k.maxOccupancy))}else l.set(w.categoryKey,(l.get(w.categoryKey)??0)+1),i.statusOf(v)==="free"&&(d++,a.set(w.categoryKey,(a.get(w.categoryKey)??0)+1))}let u=[...l.entries()].map(([v,w])=>{let k=t.categories.find(I=>I.key===v),T=k?.tiers?.length?k.tiers.map(I=>I.price):[k?.price??0],C=Math.min(...T),L=Math.max(...T);return{key:v,count:w,label:k?.label??v,color:k?.color??"#6e7bff",price:C,priceMin:C,priceMax:L}}).sort((v,w)=>v.price-w.price),m=u.map(v=>v.priceMin),y=u.map(v=>v.priceMax),f=s.zone?t.zones?.find(v=>v.id===s.zone):void 0,p=v=>{let w=null,k=0;for(let[T,C]of v)(C>k||C===k&&w!=null&&T<w)&&(w=T,k=C);return w},g=p(a)??p(l),S=(g?u.find(v=>v.key===g)?.color:void 0)??f?.color??s.color??"#6e7bff";return{id:e,...g?{dominantCategoryKey:g}:{},...i.matchesAccessFilter?{accessibleLeft:h}:{},label:s.displayLabel??s.label,zoneLabel:f?.label??"",...s.entrance&&s.entrance.trim()?{entrance:s.entrance.trim()}:{},color:S,seatsLeft:d,priceMin:m.length?Math.min(...m):0,priceMax:y.length?Math.max(...y):0,categories:u}}var oi=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,t=!1){if(!t){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}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};var Cc=10,Ic=15e3,na=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new ii;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.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 oi;this.accessFilter=null;this.viewportInsets=null;this.hintShown=!1;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=ia(e.numberOfPlacesToSelect);let t=oa(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Cc);this.selectionValidators=t.validators,this.maxSelection=t.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=yo(this._doc,this.hidden);if(!this.mapTheme)return e;let t={...e.theme??{}};for(let o of qi){let r=this.mapTheme[o];r&&(t[o]=r)}return{...e,theme:t}}setMapTheme(e){return Jn(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let t=e.getSelection().map(l=>l.id),o=this.getActiveFloorId(),r=e.isFloorOverview?.()??!1,s=e.getFocusedSection?.()??null,n=e.getCameraPose?.();return e.setChart(this.visibleDoc(),o?{floorId:o}:void 0),r&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),t.length&&e.select?.(t),s&&e.focusSection?.(s),n&&e.setCameraPose&&e.setCameraPose(n),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let t=e.filter(r=>typeof r=="string");if(t.length===this.hidden.size&&t.every(r=>this.hidden.has(r)))return!1;this.hidden=new Set(t);let o=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),o&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let t=(e??[]).filter(o=>typeof o=="string");return t.length===this.closedSections.size&&t.every(o=>this.closedSections.has(o))?!1:(this.closedSections=new Set(t),this.renderer?.setClosedSections?.(t),!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 t=this.groupedTablesByLabel.get(e);if(t)return t.chairs.map(r=>r.id);let o=this.labelToId.get(e);return o?[o]:[]}idsForLabels(e){return[...new Set([...e].flatMap(t=>this.idsForLabel(t)))]}tableSelection(e){let t=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return t?this.toTableSeat(t):null}lineItemDisplay(e){if(e.objectType==="ga"){let r=this.visibleDoc(),s=$e(r).find(n=>n.id===e.objectId);return{...s?.displayLabel?{displayLabel:s.displayLabel}:{},...s?.displayType?{displayType:s.displayType}:{}}}if(e.objectType==="table"){let r=this.groupedTablesByLabel.get(e.label);return{...r?.displayLabel&&r.displayLabel!==r.label?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}let t=this.labelToSeat.get(e.label),o=t?this.seatContext.get(t.id):void 0;return{...t?.displayLabel?{displayLabel:t.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}async render(e){if(this.renderer)return null;let t=performance.now(),o={},r=C=>Math.round((performance.now()-C)*100)/100;this.closed=!1;let s=performance.now(),n=(async()=>this.api.chart(this.key))().then(C=>({ok:!0,res:C,elapsed:r(s)}),C=>({ok:!1,error:C,elapsed:r(s)})),l=performance.now(),a=(async()=>this.api.objects(this.key))().then(C=>({ok:!0,objects:C,elapsed:r(l)}),()=>({ok:!1,elapsed:r(l)})),c=await n;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=ta(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let h=performance.now();try{let C=Ko(d.doc,d.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(C.map(L=>[L.objectId,L])),this.groupedTablesByLabel=new Map(C.map(L=>[L.label,L])),this.groupedTableBySeatId=new Map(C.flatMap(L=>L.chairs.map(I=>[I.id,L]))),this.tableQuantities=new Map(C.map(L=>[L.label,L.mode==="whole"?L.capacity:L.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=C.reduce((L,I)=>L+Math.max(0,I.chairs.length-1),0)}catch(C){return this.emitError(C),null}this.expandedSeats=De(d.doc);let u=Vn(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 C of this.groupedTablesByLabel.values()){let L=C.chairs[0];L&&(this.labelToId.set(C.label,L.id),this.labelToSeat.set(C.label,L))}o.normalizeBuyerModel=r(h);let m=d.event.currency??this.opts.currency;this.currency=m??"USD";let y=performance.now(),f=Wn(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:m,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=r(t),this.opts.onSeatsRevealed?.()},onSelect:C=>{this.handleRendererSelect(C)},onDeselect:C=>{this.handleRendererDeselect(C)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(C,L)=>{this.opts.onHover?.(C),this.opts.onSeatHover&&this.opts.onSeatHover(C?this.describeSeat(C,L):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(C,L)=>this.handleSectionTap(C,L),onBackdropTap:()=>this.overview(),onFocusedSectionChange:C=>this.opts.onSectionFocus?.(this.isSectionClosed(C)?null:this.sectionSummary(C)),onDeckTap:C=>this.handleDeckTap(C),onFps:this.opts.onFps});if(o.createRenderer=r(y),this.closed)return f.destroy(),null;this.renderer=f,this.viewportInsets&&f.setViewportInsets?.(this.viewportInsets);let p=null,g="free",b=[],S=await a;if(S.ok){let C=S.objects;this.hidden=new Set(C.hidden??[]),b=(C.closed??[]).filter(L=>typeof L=="string"),p=C.seats,g=C.default??"free"}if(o.loadStatuses=S.elapsed,this.closed)return f.destroy(),this.renderer=null,null;let v=performance.now();f.setChart(this.visibleDoc()),ea(f,d.doc,e.clientWidth),this.opts.colorblindSafe&&f.setColorblindSafe?.(!0),o.buildScene=r(v),this.closedSections=new Set(b);let w=performance.now();b.length&&f.setClosedSections?.(b),p&&this.applySeatsMap(p,g),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=r(w);let k=performance.now();f.forceDraw(),o.firstPaint=r(k);let T=performance.now();return this.attachVisibility(),this.connect(),o.startRealtime=r(T),o.controllerTotal=r(t),{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:m,mode:d.event.mode??"live",locale:d.event.locale??null,posterUrl:d.event.posterUrl??null,chartDelivery:d.chartDelivery,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],t=new Set;for(let o of this.renderer.getSelection()){let r=this.groupedTableBySeatId.get(o.id);r?t.has(r.label)||(t.add(r.label),e.push(this.toTableSeat(r))):e.push(this.toSeat(o))}return e}seatDetails(e){let t=this.seatById.get(e);return t?this.describeSeat(t):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let t=new Set;for(let o of e){let r=this.groupedTableBySeatId.get(o)??this.groupedTablesByLabel.get(o);if(r)r.chairs.forEach(s=>t.add(s.id)),this.hold_?.labels.includes(r.label)||(this.tableQuantities.set(r.label,r.mode==="whole"?r.capacity:r.minOccupancy),r.mode==="variable"&&this.confirmedVariableTables.delete(r.label));else{let s=this.seatById.has(o)?o:this.labelToId.get(o);s&&t.add(s)}}this.renderer?.deselect([...t]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let t=new Set(this.getSelection().map(n=>n.label)),o=new Set,r=[];for(let n of e){let l=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(l)this.tableTierResolution(l).kind==="invalid"?r.push(l.label):l.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let a=this.seatById.has(n)?n:this.labelToId.get(n);if(!a||!this.isSelectableByPolicy(a))continue;let c=this.seatById.get(a);c&&this.seatTierResolution(c).kind==="invalid"?r.push(c.label):o.add(a)}}if(r.length&&this.emitError(new Le(gi(r))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let s=this.getSelection().filter(n=>!t.has(n.label));return s.length&&this.emitSelectionChange(),s}selectCategories(e){let t=new Set(e);return this.select([...this.seatById.values()].filter(o=>t.has(o.categoryKey)).map(o=>o.id))}deselectCategories(e){let t=new Set(e);this.deselect(this.getSelection().filter(o=>t.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 t=this.renderer?.getSelection().filter(o=>!this.isSelectableByPolicy(o.id)).map(o=>o.id)??[];t.length&&this.deselect(t)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let t=this.getSelection(),o=e??t.reduce((r,s)=>r+(s.quantity??1),0);return ra(t,o,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let t=new Set(e.getSelection().map(o=>o.id));return t.size>0&&yi(this.seatById.values(),o=>e.getStatus(o),t).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let t of this.selectableObjectRefs){let o=this.groupedTableBySeatId.get(t)??this.groupedTablesByLabel.get(t);if(o){o.chairs.forEach(s=>e.add(s.id));continue}let r=this.seatById.has(t)?t:this.labelToId.get(t);r&&e.add(r)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,t){let o=this.groupedTablesByLabel.get(e);if(!o)return!1;let r=o.mode==="whole"?o.capacity:Math.floor(t);if(!Number.isInteger(r)||r<o.minOccupancy||r>o.maxOccupancy)return!1;let s=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,r),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,s),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,t,o){let r=this.groupedTablesByLabel.get(e),s=this.hold_;if(!r||r.mode!=="variable"||!s?.labels.includes(e))return null;let n=Math.floor(t);if(!Number.isInteger(n)||n<r.minOccupancy||n>r.maxOccupancy)return null;if((s.items??[]).filter(d=>d.label!==e).reduce((d,h)=>d+(h.quantity??1),0)+n>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let a=(s.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?n:d.quantity}));if(!a.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,a,o,s.holdId);return this.tableQuantities.set(e,n),this.setHold({holdId:c.holdId,labels:a.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,t)=>e+(t.quantity??1),0)}handleRendererSelect(e){let t=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(t?t.chairs.map(r=>r.id):[e.id]),this.emitSelectionChange();return}if((t?this.tableTierResolution(t):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(t?t.chairs.map(r=>r.id):[e.id]),this.emitError(new Le(gi([t?.label??e.label]))),this.emitSelectionChange();return}if(t){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(t.chairs.map(r=>r.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(t.chairs.map(r=>r.id)),this.opts.onSelect?.(t.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(t)),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 t=this.groupedTableBySeatId.get(e.id);t?(this.renderer?.deselect(t.chairs.map(o=>o.id)),this.hold_?.labels.includes(t.label)||(this.tableQuantities.set(t.label,t.mode==="whole"?t.capacity:t.minOccupancy),t.mode==="variable"&&this.confirmedVariableTables.delete(t.label)),this.opts.onDeselect?.(t.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 t of e){let o=this.groupedTablesByLabel.get(t);o&&(this.tableQuantities.set(t,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(t))}}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}}async hold(e,t){if(!this.renderer)return null;let r=e??this.getSelection().map(a=>a.label),s=(this.hold_?.items??[]).filter(a=>a.objectType==="ga"),n=[...new Set([...s.map(a=>a.label),...r])];if(!n.length)return null;let l=this.ticketIssue(n);if(l)throw new Le(l);if(this.hold_&&this.holdCovers(n))return this.hold_;try{let a=n.map(d=>{let h=s.find(y=>y.label===d);if(h)return{label:d,tierId:h.tierId,quantity:h.quantity};let u=this.labelToSeat.get(d),m=u?this.toSeat(u):null;return{label:d,...m?.tierId?{tierId:m.tierId}:{},...this.tableQuantityRequest(m)}}),c=await this.api.hold(this.key,a,t,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:n,expiresAt:c.expiresAt,items:c.items}),this.hold_}catch(a){throw this.handle409Conflicts(a),a}}async resumeHold(e){if(this.closed||!e||!this.api.resume)return null;let t=await this.api.resume(this.key,e);if(this.closed)return null;let o=[...new Set(t.items.map(r=>r.label))];return o.length?(this.setHold({holdId:t.holdId,labels:o,expiresAt:t.expiresAt,items:t.items},"restored"),this.hold_):null}async extendHold(e){let t=this.hold_;if(!t||!this.api.extend)return null;try{let o=await this.api.extend(this.key,t.holdId,e);return this.hold_?.holdId!==t.holdId?this.hold_:(this.setHold({holdId:t.holdId,labels:t.labels,expiresAt:o.expiresAt,items:t.items}),this.hold_)}catch{return null}}categoryAvailability(){return Yn({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,t=this.renderer;if(!t||!this.closedSections.size)return e;for(let o of this.closedSections)for(let r of t.sectionMembers?.(o)??[])e.add(r);return e}getGAAreas(){let e=this.visibleDoc();return e?Kn(e,this.currency,t=>this.statusOf(t)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Xn(this.getGAAreas(),this.gaSelected))}async holdGA(e,t,o={}){let r=this.visibleDoc();if(!r||!Number.isFinite(t)||t<1)return null;let s=$e(r).find(d=>d.id===e);if(!s)return null;let n=wt(s).filter(d=>!this.hold_?.labels.includes(d)&&this.statusOf(d)==="free").slice(0,Math.floor(t));if(n.length!==Math.floor(t))return null;let l=new Map;for(let d of this.hold_?.items??[])l.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)l.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{}});for(let d of this.getSelection())l.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{},...this.tableQuantityRequest(d)});for(let d of n)l.set(d,{label:d,...o.tierId?{tierId:o.tierId}:{}});let a=[...l.values()],c=await this.api.hold(this.key,a,o.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:a.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 Qn(this.visibleDoc())}pickPremiumBlock(e,t,o){return jn({doc:this.visibleDoc(),qty:e,categoryKey:t,zoneId:o,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:r=>this.seatTierResolution(r).kind!=="invalid",statusOfLabel:r=>this.getStatus(this.labelToId.get(r)??"")??"free",isPremium:r=>!!this.labelToSeat.get(r)?.commercial?.premium})}async bestAvailable(e,t,o={}){let r=this.renderer;if(!r)return null;if(o.preferPremium){let s=this.pickPremiumBlock(e,t,o.zoneId);if(s){if(this.hold_&&!await this.release())return null;try{let n=s.map(d=>{let h=this.labelToSeat.get(d),u=h?this.toSeat(h):null;return{label:d,...u?.tierId?{tierId:u.tierId}:{}}}),l=await this.api.hold(this.key,n,o.ttlMs);r.clearSelection();let a=this.idsForLabels(s);a.length&&r.setStatus(a,"held"),this.setHold({holdId:l.holdId,labels:[...s],expiresAt:l.expiresAt,items:l.items});let c=s.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(n){let{status:l,reason:a}=ft(n);if(l===409&&a==="event_closed")throw this.opts.onSalesClosed?.(),n}}}if(this.hold_&&!await this.release())return null;try{let s=await this.api.bestAvailable(this.key,e,t,o.zoneId,o.ttlMs);r.clearSelection();let n=this.idsForLabels(s.labels);n.length&&r.setStatus(n,"held"),this.setHold({holdId:s.holdId,labels:[...s.labels],expiresAt:s.expiresAt,items:s.items});let l=s.labels.map(a=>this.labelToSeat.get(a)).filter(a=>!!a).map(a=>this.toSeat(a));return this.opts.onSelectionChange?.(l),this.hold_}catch(s){let{status:n,reason:l}=ft(s);throw n===409&&l==="event_closed"&&this.opts.onSalesClosed?.(),s}}async book(e,t,o){let r=this.renderer;if(!r)return null;if(!this.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let s=t??this.getSelection().map(c=>c.label);if(!s.length)return null;let n=this.ticketIssue(s);if(n)throw new Le(n);let l;try{if(this.hold_&&this.holdCovers(s))l=this.hold_.holdId;else{let c=this.hold_?.holdId,d=await this.api.hold(this.key,s.map(h=>{let u=this.labelToSeat.get(h),m=u?this.toSeat(u):null;return{label:h,...m?.tierId?{tierId:m.tierId}:{},...this.tableQuantityRequest(m)}}),o,c);l=d.holdId,this.setHold({holdId:l,labels:[...s],expiresAt:d.expiresAt,items:d.items})}await this.api.book(this.key,s,l,e)}catch(c){let{status:d,conflicts:h,reason:u}=ft(c);if(this.clearHold(),d===409&&u==="event_closed")this.opts.onSalesClosed?.();else if(d===409&&h?.length){let m=new Set(h.map(p=>p.label)),y=this.idsForLabels(m);y.length&&(r.setStatus(y,"booked"),r.deselect(y),this.resetTableQuantitiesForLabels(m));let f=s.filter(p=>!m.has(p));f.length&&l&&this.api.release(this.key,f,l).catch(()=>{}),this.emitSelectionChange()}else l&&this.api.release(this.key,s,l).catch(()=>{});throw c}let a=this.idsForLabels(s);return a.length&&(r.setStatus(a,"booked"),r.deselect(a)),this.clearHold(),this.resetTableQuantitiesForLabels(s),this.emitSelectionChange(),this.opts.onBook?.(e),s}async release(){let e=this.hold_;if(!e)return!0;try{let o=await this.api.release(this.key,e.labels,e.holdId);if(!this.releaseConfirmed(o,e.labels))return await this.resnapshot(),!1}catch(o){return this.emitError(o),!1}if(this.hold_?.holdId!==e.holdId)return!0;this.clearHold(),this.resetTableQuantitiesForLabels(e.labels);let t=this.idsForLabels(e.labels);return t.length&&(this.renderer?.deselect(t),this.renderer?.setStatus(t,"free")),!0}async releaseLabels(e){let t=this.hold_;if(!t)return!0;let o=e.filter(l=>t.labels.includes(l));if(!o.length)return!0;try{let l=await this.api.release(this.key,o,t.holdId);if(!this.releaseConfirmed(l,o))return await this.resnapshot(),!1}catch(l){return this.emitError(l),!1}if(this.hold_?.holdId!==t.holdId)return!0;let r=t.labels.filter(l=>!o.includes(l)),s=t.items?.filter(l=>!o.includes(l.label));r.length?this.setHold({...t,labels:r,items:s}):this.clearHold(),this.resetTableQuantitiesForLabels(o);let n=this.idsForLabels(o);return n.length&&(this.renderer?.deselect(n),this.renderer?.setStatus(n,"free")),!0}releaseConfirmed(e,t){let o=e?.released;return!Array.isArray(o)||t.every(r=>o.includes(r))}setStatus(e,t){this.renderer?.setStatus(e,t)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let t=new Set(e.categories.filter(r=>r.notForSale).map(r=>r.key));if(!t.size)return[];let o=[];for(let[r,s]of this.seatById)t.has(s.categoryKey)&&o.push(r);return o}flashSeat(e,t){this.renderer?.flashSeat(e,t)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let t=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&t&&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)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){this.accessFilter=e===null?null:[...e],this.renderer?.setAccessibilityFilter?.(e);let t=this.renderer?.getFocusedSection?.()??null;t&&this.opts.onSectionFocus?.(this.sectionSummary(t))}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let t=this.renderer;!t?.setActiveFloor||e===t.getActiveFloorId?.()&&!t.isFloorOverview?.()||(t.setFloorOverview?.(!1),t.setStacked?.(!1),t.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let t=this.renderer;!t?.setStacked||e===t.isStacked?.()||(t.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let t=this.renderer;!t?.setFloorOverview||e===t.isFloorOverview?.()||(t.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let t=this.renderer;t&&(t.setViewMode?.("flat"),t.setFloorOverview?.(!1),t.setStacked?.(!1),t.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()}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){let t=this.renderer;if(t){if(t.clearSectionFocus?.(),this.opts.onSectionFocus?.(null),e?.length){let o=this.floorForCategories(e);o&&this.setFloor(o)}t.focusCategories?t.focusCategories(e):t.zoomToFit()}}floorForCategories(e){let t=this._doc;if(!t?.floors||t.floors.length<2)return null;let o=new Set(e),r=l=>l.some(a=>a.type==="row"&&(o.has(a.categoryKey)||(a.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||a.type==="gaArea"&&o.has(a.categoryKey)),s=this.getActiveFloorId(),n=t.floors.find(l=>l.id===s);return n&&r(n.objects)?null:t.floors.find(l=>r(l.objects))?.id??null}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,t){this.handleSectionTap(e,t)}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}handleSectionTap(e,t){let o=this.renderer;if(o){if(o.focusSection?o.focusSection(e,t?{anchor:t}:void 0):o.focusRegion?.(e),this.isSectionClosed(e)){this.opts.onSectionFocus?.(null);return}this.opts.onSectionFocus?.(this.sectionSummary(e))}}sectionSummary(e){return!this.renderer||!this._doc?null:sa({id:e,doc:this._doc,sectionMembers:t=>this.renderer?.sectionMembers?.(t)??[],statusOf:t=>this.renderer?.getStatus(t)??"free",seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,...this.accessFilter?{matchesAccessFilter:t=>Se(t,this.accessFilter)}:{}})}destroy(){if(this.closed=!0,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 t=this.groupedTableBySeatId.get(e.id);if(t)return this.toTableSeat(t);let o=e.commercial?{commercial:e.commercial}:void 0,r=e.displayLabel?{displayLabel:e.displayLabel}:void 0,s=e.accessibility?.length?{accessibility:e.accessibility}:void 0,n=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,l=this.seatContext.get(e.id),a=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!a)return{id:e.id,label:e.label,...r,...l,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...s,...n};let d=c.tier;return{id:e.id,label:e.label,...r,...l,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:a,tierId:d.id,...o,...s,...n}}toTableSeat(e){let t=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(n=>Et(this._doc,this.tableTierSeat(e),n.id).kind==="resolved"),r=this.tableTierResolution(e),s=r.kind==="resolved"?r.tier:void 0;return{id:t?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:t?this.seatContext.get(t.id)?.sectionLabel:void 0,rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:s?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:s?.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(n=>n.id)}}describeSeat(e,t){let o=this._doc?.categories.find(r=>r.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,...t?.interaction?{interaction:t.interaction}:{},...t?.unavailable?{unavailable:!0}:{},...t?.filteredOut?{filteredOut:!0}:{},currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(t=>t.key===e)?.price??0}tiersFor(e){let t=this._doc?.categories.find(o=>o.key===e)?.tiers;return t&&t.length?t:void 0}tiersForSeat(e){if(!this._doc)return;let t=Wo(this._doc,e);return t.length?t:void 0}seatTierResolution(e){return this._doc?Et(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(t=>t.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let t=e.chairs[0]?.id??"";return Et(this._doc,this.tableTierSeat(e),this.seatTiers.get(t))}setSeatTier(e,t){let o=this.seatById.get(e);if(!o)return;let r=this.tiersForSeat(o);if(r){if(t==null)this.seatTiers.delete(e);else if(r.some(s=>s.id===t))this.seatTiers.set(e,t);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let t=[];for(let o of e){let r=this.labelToSeat.get(o);r&&t.push(this.toSeat(r))}return t}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 t=e?this.seatsForLabels(e):this.getSelection();return Vo(this._doc,t.map(o=>({label:o.label,...o.tierId?{tierId:o.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let t=this.ticketIssue();if(t){this.hintShown=!0,this.opts.onHint(t.code==="companion_pair_required"?X("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=new Set(e.getSelection().map(s=>s.id));(o.size?yi(this.seatById.values(),s=>e.getStatus(s),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(X("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){let t=this.hold_;if(!t||t.labels.length!==e.length||!e.every(s=>t.labels.includes(s)))return!1;let o=new Map((t.items??[]).map(s=>[s.label,s.tierId])),r=new Map((t.items??[]).map(s=>[s.label,s.quantity??1]));return e.every(s=>{let n=this.labelToSeat.get(s),l=n?this.toSeat(n):null,a=l?.tierId??null;return(l?.objectType!=="table"||(l.bookingMode!=="variable"||this.confirmedVariableTables.has(s))&&(!r.has(s)||r.get(s)===l.quantity))&&(!o.has(s)||o.get(s)===a)})}handle409Conflicts(e){let{status:t,conflicts:o}=ft(e);if(t!==409||!o?.length)return;let r=this.renderer;if(!r)return;let s=this.idsForLabels(o.map(n=>n.label));s.length&&(r.deselect(s),r.setStatus(s,"held"),this.resetTableQuantitiesForLabels(o.map(n=>n.label))),this.emitSelectionChange()}setHold(e,t="created"){for(let s of e.items??[])this.groupedTablesByLabel.has(s.label)&&s.quantity!=null&&(this.tableQuantities.set(s.label,s.quantity),this.groupedTablesByLabel.get(s.label)?.mode==="variable"&&this.confirmedVariableTables.add(s.label));let o={...e,seats:this.seatsForLabels(e.labels)};this.hold_=o,this.renderer?.setOwnedHold?.(this.idsForLabels(o.labels)),this.expiryTimer&&clearTimeout(this.expiryTimer);let r=Math.max(0,o.expiresAt-Date.now());this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},r),t==="restored"?this.opts.onHoldRestored?.(o):this.opts.onHold?.(o)}clearHold(){this.hold_=null,this.renderer?.setOwnedHold?.(null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null)}async expireActiveHold(){let e=this.hold_;if(e){try{let t=await this.api.objects(this.key);if(this.hold_?.holdId!==e.holdId)return;this.applySeatsMap(t.seats,t.default??"free")}catch{this.hold_?.holdId===e.holdId&&(this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},2e3));return}if(this.hold_?.holdId===e.holdId){if(qn(e.expiresAt,e.labels.some(t=>this.statusOf(t)==="held"))){this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},1e3);return}this.clearHold(),this.opts.onHoldExpired?.()}}}applySeatsMap(e,t="free"){let o=this.renderer;if(!o)return;this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=t;let r=ti(t);this.allIds.length&&o.setStatus(this.allIds,r),o.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let s={free:[],held:[],booked:[],not_for_sale:[]};for(let[l,a]of Object.entries(e))s[ti(a)].push(...this.idsForLabel(l));["free","held","booked","not_for_sale"].forEach(l=>{l!==r&&s[l].length&&o.setStatus(s[l],l)});let n=this.notForSaleCategorySeatIds();n.length&&o.setStatus(n,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(t=>this.statusOf(t)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let t=await this.api.objects(this.key);this.applySeatsMap(t.seats,t.default??"free")},e)}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,t=$n({selection:this.getSelection().map(o=>o.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:o=>this.statusOf(o)});if(t.lost.length&&this.deselect(t.lost),t.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(t.lapsedLabels);let o=this.idsForLabels(t.lapsedLabels);o.length&&this.renderer?.deselect(o),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(t),t}getAccessNeeds(){return Un(this.seatById.values(),e=>this.getStatus(e)??"free")}attachVisibility(){this.detachVisibility||(this.detachVisibility=Zn(()=>{this.closed||this.refreshAvailability().then(()=>{this.closed||this.renderer?.forceDraw()})}))}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applySeatsMap(e.exceptions,e.default),resync:()=>this.resnapshot(),onSections:(e,t)=>{let o=this.syncHidden(e),r=this.syncClosed(t);o&&this.resnapshot(),(o||r)&&this.opts.onStatusChange?.()}}}applyStatusChanges(e){let t=this.renderer;if(t){for(let o of e){this.liveStatuses.set(o.label,o.status);let r=this.idsForLabel(o.label);if(!r.length)continue;let s=ti(o.status);this.opts.flashOnLiveChange&&s!=="free"&&r.some(n=>t.getStatus(n)==="free")&&!this.hold_?.labels.includes(o.label)&&r.forEach(n=>t.flashSeat(n,s==="held"?"#f4b740":"#f43f5e")),t.setStatus(r,s)}this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&t.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}}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 t;try{let o=this.api.socketProtocols?.(this.key);t=o&&o.length?new WebSocket(e,o):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=t,t.onopen=()=>{this.attempt=0,this.resnapshot()},t.onmessage=o=>{let r;try{r=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(!this.renderer||!r||typeof r!="object")return;let n=r;Array.isArray(n.hidden)&&this.syncHidden(n.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.()),Array.isArray(n.closed)&&this.syncClosed(n.closed)&&this.opts.onStatusChange?.(),n.type!=="hidden"&&(n.seats&&typeof n.seats=="object"?this.applySeatsMap(n.seats):Array.isArray(n.changes)&&this.applyStatusChanges(n.changes))},t.onclose=()=>{this.ws===t&&(this.ws=null),this.scheduleReconnect()},t.onerror=()=>{try{t.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=zn(e,{baseMs:1e3,maxMs:Ic,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}};var Pc=5,xc=-1.1,Zi=35;function Qi(i,e){let t=i-ee,o=Math.atan2(Pc-t,e)*180/Math.PI,r=Math.atan2(xc-t,e)*180/Math.PI;return r<-Zi&&(o+=-Zi-r,r=-Zi),{topPitch:o,basePitch:r}}var q=2048,de=1024,yt=ao,R=Math.PI*2,Mc=de/180,Ye=i=>(i+180)/360*q,W=i=>(90-i)/180*de;function ha(i){let e=2166136261;for(let t=0;t<i.length;t++)e^=i.charCodeAt(t),e=Math.imul(e,16777619);return e>>>0}function ua(i){let e=i>>>0;return()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}var ri=96,eo=360/ri,Ac=.6,ji=[17,23,42];function Ji(i,e,t=1){let o=Math.max(0,Math.min(.58,e)),r=Math.round(i[0]+(ji[0]-i[0])*o),s=Math.round(i[1]+(ji[1]-i[1])*o),n=Math.round(i[2]+(ji[2]-i[2])*o);return`rgba(${r},${s},${n},${t})`}function aa(i,e,t){return[Math.round(i[0]+(e[0]-i[0])*t),Math.round(i[1]+(e[1]-i[1])*t),Math.round(i[2]+(e[2]-i[2])*t)]}function te(i,e,t){let o=(1-Math.abs(2*t-1))*e,r=(i%360+360)%360/60,s=o*(1-Math.abs(r%2-1)),n=0,l=0,a=0;r<1?[n,l,a]=[o,s,0]:r<2?[n,l,a]=[s,o,0]:r<3?[n,l,a]=[0,o,s]:r<4?[n,l,a]=[0,s,o]:r<5?[n,l,a]=[s,0,o]:[n,l,a]=[o,0,s];let c=t-o/2;return[Math.round((n+c)*255),Math.round((l+c)*255),Math.round((a+c)*255)]}var la=new Map;function ca(i){if(!i)return null;let e=la.get(i);if(e)return e;let t=2166136261;for(let s=0;s<i.length;s++)t^=i.charCodeAt(s),t=Math.imul(t,16777619);let o=(t>>>0)%360,r=te(o,.3,.42);return la.set(i,r),r}function Rc(i,e,t,o){let r=new Array(ri).fill(null),s=0,n=i.sectionId;for(let l of e){if(l.id===i.id)continue;let a=l.sectionId;if(!a||n&&a===n)continue;let c=l.x-i.x,d=l.y-i.y,h=Math.hypot(c,d)*yt;if(h<1.5||h>95)continue;let u=l.eyeHeightM??ee,m=u-o;Math.abs(m)>s&&(s=Math.abs(m));let y=Math.atan2(m,h)*180/Math.PI,f=Math.atan2(u-ee-o,h)*180/Math.PI,g=((Math.atan2(c,-d)-t)*180/Math.PI+540)%360-180,b=Math.min(ri-1,Math.max(0,Math.floor((g+180)/eo))),S=y>34&&h<16,v=r[b];v?(y>v.top&&(v.top=y),f<v.base&&(v.base=f),h<v.nearM&&(v.nearM=h,v.tint=ca(l.categoryKey)),v.overhead=v.overhead||S):r[b]={top:y,base:f,nearM:h,overhead:S,tint:ca(l.categoryKey)}}return{bins:r,maxDelta:s}}function Ec(i,e,t,o){for(let r=0;r<ri;r++){let s=e[r];if(!s)continue;let n=-180+r*eo,l=t(n),a=t(n+eo);if(!(a>l))continue;let c=Math.min(72,s.top),d=Math.min(s.base,-4),h=o(c),u=o(d);if(u<=h)continue;let m=s.nearM/95,y=s.tint,f=y?aa([44,54,80],y,.34):[44,54,80],p=y?aa([24,30,48],y,.28):[24,30,48],g=i.createLinearGradient(0,h,0,u);g.addColorStop(0,Ji(f,m)),g.addColorStop(.24,Ji(p,m)),g.addColorStop(1,Ji([10,13,22],m)),i.fillStyle=g,i.fillRect(l,h,a-l+1,u-h),i.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,i.fillRect(l,h,a-l+1,1.5);let S=Math.min(u,o(0))-h;if(S>8){let w=1-m*.4;for(let k=1;k<6;k++){let T=h+S*k/6;i.fillStyle=`rgba(0,0,0,${.16*w})`,i.fillRect(l,T,a-l+1,1.5),i.fillStyle=`rgba(120,134,170,${.1*w})`,i.fillRect(l,T+1.5,a-l+1,1.2)}}if(s.overhead){let v=o(Math.min(86,c+12)),w=i.createLinearGradient(0,v,0,h);w.addColorStop(0,"rgba(3,4,8,0.9)"),w.addColorStop(1,"rgba(3,4,8,0)"),i.fillStyle=w,i.fillRect(l,v,a-l+1,h-v),i.fillStyle="rgba(120,130,160,0.14)",i.fillRect(l,h-1.5,a-l+1,1.5)}}}function _c(i,e,t){let r=new Array(72).fill(!1),s=new Array(72).fill(1/0),n=new Set,l=0;for(let g of t){l++,g.sectionId&&n.add(g.sectionId);let b=g.x-e.x,S=g.y-e.y,v=Math.hypot(b,S)*yt;if(v<.5)continue;let w=Math.atan2(b,-S),k=Math.floor((w+Math.PI)/R*72);k<0?k=0:k>=72&&(k=71),r[k]=!0,v<s[k]&&(s[k]=v)}let a=0,c=[];for(let g=0;g<72;g++)r[g]&&(a++,c.push(s[g]));let d=a/72*360;c.sort((g,b)=>g-b);let h=c.length?c[c.length>>1]:0,u=c.length?c[Math.floor(c.length*.15)]??h:0,m=c.length?c[Math.floor(c.length*.85)]??h:0,y=u>.5?m/u:1,f=ha(`${l}|${[...n].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return d>=300&&h>11&&y>1.35?p="sport":d>=285?p="arena":p="proscenium",{mode:p,seed:f,voidRadiusM:h,aspect:y}}var Bc=5;function Fc(i,e,t){switch(t){case 1:i.beginPath(),i.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,R),i.fill();break;case 2:i.beginPath(),i.ellipse(0,-e*1.02,e*.42,e*.42,0,0,R),i.fill(),i.beginPath(),i.ellipse(0,-e*.2,e*.98,e*1.02,0,0,R),i.fill();break;case 3:i.beginPath(),i.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,R),i.fill(),i.beginPath(),i.ellipse(0,-e*.52,e*1.22,e*.24,0,0,R),i.fill();break;case 4:i.beginPath(),i.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,R),i.fill(),i.beginPath(),i.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,R),i.fill(),i.beginPath(),i.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,R),i.fill();break;default:break}}function Oc(i,e,t,o,r){let s=o*.44,n=o*r.shoulderK,l=o*.66,a=o*1.68,c=o*5.4,d=`rgba(${r.clothing[0]},${r.clothing[1]},${r.clothing[2]},${r.alpha})`,h=`rgba(${r.tone[0]},${r.tone[1]},${r.tone[2]},${r.alpha})`;i.save(),i.translate(e,t);let u=r.lean*o;i.fillStyle=d,i.beginPath(),i.moveTo(-s,l),i.quadraticCurveTo(-s*1.18,a-u-o*.6,-n,a-u),i.quadraticCurveTo(-n*1.05,a+o*1.2,-n*.94,c),i.lineTo(n*.94,c),i.quadraticCurveTo(n*1.05,a+o*1.2,n,a+u),i.quadraticCurveTo(s*1.18,a+u-o*.6,s,l),i.closePath(),i.fill(),i.fillStyle=h,i.fillRect(-s*.82,o*.5,s*1.64,o*.9),i.save(),i.rotate(r.tilt),i.translate(r.turn*o,0),i.fillStyle=h,o>=18?(i.beginPath(),i.moveTo(-o*.9,-o*.15),i.quadraticCurveTo(-o*.96,-o*1.12,0,-o*1.06),i.quadraticCurveTo(o*.96,-o*1.12,o*.9,-o*.15),i.quadraticCurveTo(o*.86,o*.55,o*.36,o*.98),i.quadraticCurveTo(0,o*1.14,-o*.36,o*.98),i.quadraticCurveTo(-o*.86,o*.55,-o*.9,-o*.15),i.closePath(),i.fill(),o>=22&&(i.beginPath(),i.ellipse(-o*.9,o*.18,o*.13,o*.22,0,0,R),i.ellipse(o*.9,o*.18,o*.13,o*.22,0,0,R),i.fill())):(i.beginPath(),i.ellipse(0,0,o*.9,o*1.06,0,0,R),i.fill()),Fc(i,o,r.hair),r.rim>.01&&(i.strokeStyle=`rgba(245,205,150,${(.5*r.rim).toFixed(3)})`,i.lineWidth=Math.max(1,o*.14),i.beginPath(),i.ellipse(0,-o*.06,o*.86,o*1,0,Math.PI*1.12,Math.PI*1.9),i.stroke()),i.restore(),r.rim>.01&&(i.strokeStyle=`rgba(240,200,150,${(.28*r.rim).toFixed(3)})`,i.lineWidth=Math.max(1,o*.12),i.beginPath(),i.moveTo(-n*.8,a-o*.05),i.quadraticCurveTo(-s,a-o*.75,0,a-o*.82),i.quadraticCurveTo(s,a-o*.75,n*.8,a-o*.05),i.stroke()),i.restore()}function Dc(i,e,t,o,r,s,n){i.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${n})`,i.beginPath(),i.moveTo(e-o*1.72,t+o*4),i.quadraticCurveTo(e-o*1.78,t+o*1.55,e-o*.46,t+o*1.02),i.lineTo(e-o*.4,t+o*.62),i.lineTo(e+o*.4,t+o*.62),i.lineTo(e+o*.46,t+o*1.02),i.quadraticCurveTo(e+o*1.78,t+o*1.55,e+o*1.72,t+o*4),i.closePath(),i.fill(),i.fillStyle=`rgba(${s[0]},${s[1]},${s[2]},${n})`,i.beginPath(),i.ellipse(e,t,o*.9,o*1.05,0,0,R),i.fill()}function io(i,e,t,o,r){let s=o*.1,n=t-o*.9,l=t-o*.74,a=t-o*.46,c=o*.13,d=o*.09,h=`rgba(${r.tone[0]},${r.tone[1]},${r.tone[2]},${r.alpha})`,u=i.createRadialGradient(e,t,1,e,t,o*.24);u.addColorStop(0,"rgba(0,0,0,0.4)"),u.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.scale(1,.28),i.fillStyle=u,i.beginPath(),i.ellipse(e,t/.28,o*.24,o*.24,0,0,R),i.fill(),i.restore(),i.fillStyle=h,i.beginPath(),i.moveTo(e-d,a),i.lineTo(e-d*.7,t),i.lineTo(e-d*.1,t),i.lineTo(e-d*.1,a+o*.02),i.lineTo(e+d*.1,a+o*.02),i.lineTo(e+d*.1,t),i.lineTo(e+d*.7,t),i.lineTo(e+d,a),i.closePath(),i.fill(),i.beginPath(),i.moveTo(e-c,l),i.quadraticCurveTo(e-c*.9,a-o*.12,e-d,a),i.lineTo(e+d,a),i.quadraticCurveTo(e+c*.9,a-o*.12,e+c,l),i.quadraticCurveTo(e,l-o*.05,e-c,l),i.closePath(),i.fill(),i.lineCap="round",i.lineJoin="round",i.strokeStyle=h,i.lineWidth=o*.055;let m=l+o*.02;r.pose===1?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e-c*1.5,t-o*1.02),i.moveTo(e+c*.8,m),i.lineTo(e+c*1.5,t-o*1.02),i.stroke()):r.pose===2?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e+d*1.4,a-o*.02),i.moveTo(e+c*.8,m),i.lineTo(e-d*.4,a-o*.06),i.stroke(),i.fillStyle=h,i.beginPath(),i.ellipse(e+d*1.5,a-o*.04,o*.07,o*.09,-.5,0,R),i.fill()):r.pose===3?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e-c*.2,n+s*.6),i.moveTo(e+c*.8,m),i.lineTo(e+c*1.1,a),i.stroke(),i.lineWidth=o*.02,i.beginPath(),i.moveTo(e-c*.2,n+s*.9),i.lineTo(e-c*.2,t-o*.02),i.stroke()):(i.beginPath(),i.moveTo(e-c*.85,m),i.lineTo(e-c*.95,a+o*.02),i.moveTo(e+c*.85,m),i.lineTo(e+c*.95,a+o*.02),i.stroke()),i.fillStyle=h,i.fillRect(e-s*.34,n+s*.6,s*.68,s*.9),i.beginPath(),i.ellipse(e,n,s*.86,s*1.05,0,0,R),i.fill(),r.rimStrength>.01&&(i.strokeStyle=`rgba(${r.rim[0]},${r.rim[1]},${r.rim[2]},${(.6*r.rimStrength).toFixed(3)})`,i.lineWidth=Math.max(1,o*.02),i.beginPath(),i.moveTo(e-c,l),i.lineTo(e-s*.6,n+s*.4),i.moveTo(e-s*.7,n),i.ellipse(e,n,s*.84,s*1.02,0,Math.PI*1.05,Math.PI*1.55),i.stroke())}function si(i,e,t,o,r,s,n,l,a){i.save(),i.globalCompositeOperation="lighter";let c=i.createLinearGradient(0,t,0,r);c.addColorStop(0,`rgba(${l},${a})`),c.addColorStop(.5,`rgba(${l},${(a*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${l},0)`),i.fillStyle=c,i.beginPath(),i.moveTo(e-s,t),i.lineTo(o-n,r),i.lineTo(o+n,r),i.lineTo(e+s,t),i.closePath(),i.fill(),i.restore()}function oo(i,e,t,o,r){let s=i.createRadialGradient(e,t,0,e,t,o*3);s.addColorStop(0,`rgba(${r},0.9)`),s.addColorStop(.4,`rgba(${r},0.35)`),s.addColorStop(1,`rgba(${r},0)`),i.fillStyle=s,i.beginPath(),i.arc(e,t,o*3,0,R),i.fill(),i.fillStyle=`rgba(${r},1)`,i.beginPath(),i.arc(e,t,o,0,R),i.fill()}function gy(i,e,t){let o=document.createElement("canvas");o.width=q,o.height=de;let r=o.getContext("2d"),s=e.x-i.x,n=e.y-i.y,l=Math.hypot(s,n),a=Math.max(2,l*yt),c=i.eyeHeightM??ee,d=_c(i,e,t),h=ua(d.seed),u=210+h()*150,m=te(220+(h()-.5)*60,.55,.82),y=`${m[0]},${m[1]},${m[2]}`,f=r.createLinearGradient(0,0,0,de);f.addColorStop(0,"#080b12"),f.addColorStop(.42,"#12182c"),f.addColorStop(.5,"#1c2440"),f.addColorStop(.56,"#151b2c"),f.addColorStop(.78,"#171e30"),f.addColorStop(1,"#131829"),r.fillStyle=f,r.fillRect(0,0,q,de);let p=r.createLinearGradient(0,W(-6),0,de);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)"),r.fillStyle=p,r.fillRect(0,W(-6),q,de-W(-6));let g=Math.atan2(s,-n),b=Rc(i,t,g,c),S=b.maxDelta>=Ac;S&&Ec(r,b.bins,Ye,W);let v=Math.max(.3,Math.min(1,1-(a-6)/60)),w=Qi(c,a),k=Math.min(80,Math.atan2(4,a)*180/Math.PI),T=Math.min(45,w.topPitch),C=w.basePitch;d.mode==="sport"?Nc(r,a,c,d,v,u,y,h):d.mode==="arena"?Gc(r,a,c,d,v,y,h):Hc(r,k,T,C,v,u,y,h);let L=d.mode==="sport"?34:24+Math.floor(h()*8);r.fillStyle=`rgba(${y},0.8)`;for(let M=0;M<L;M++){let x=(M+.5)/L*q,A=W(d.mode==="sport"?58:54+M*7%3*6);r.beginPath(),r.arc(x,A,d.mode==="sport"?2.6:3.2,0,R),r.fill()}Wc(r,i,t,e,g,c,s,n,S,d);let I=r.createLinearGradient(0,0,0,de);return I.addColorStop(0,"rgba(0,0,0,0.85)"),I.addColorStop(.12,"rgba(0,0,0,0)"),I.addColorStop(.9,"rgba(0,0,0,0)"),I.addColorStop(1,"rgba(0,0,0,0.55)"),r.fillStyle=I,r.fillRect(0,0,q,de),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(a)}}function Hc(i,e,t,o,r,s,n,l){let a=Ye(-e),c=Ye(e),d=W(t),h=W(o),u=c-a,m=h-d,y=W(Math.min(50,t+10)),f=u*(1.1+(1-r)*.5),p=i.createRadialGradient(q/2,(d+h)/2,8,q/2,(d+h)/2,f);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)"),i.fillStyle=p,i.fillRect(a-u*.6,d-m*1.2,u*2.2,m*3.4);let g=te(s,.62,.55),b=te(s+40,.7,.5),S=te(s+70,.78,.52);i.save(),i.beginPath(),i.rect(a,d,u,m),i.clip();let v=i.createLinearGradient(0,d,0,h);v.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),v.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),v.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),i.globalAlpha=.8,i.fillStyle=v,i.fillRect(a,d,u,m),i.globalAlpha=1;let w=i.createRadialGradient(q/2,(d+h)/2,u*.12,q/2,(d+h)/2,u*.62);w.addColorStop(0,"rgba(6,8,14,0)"),w.addColorStop(.7,"rgba(6,8,14,0.15)"),w.addColorStop(1,"rgba(5,6,11,0.92)"),i.fillStyle=w,i.fillRect(a,d,u,m),i.restore();let k=3+Math.floor(l()*3),T=m*.46,C=h-m*.08;for(let E=0;E<k;E++){let j=(E+1)/(k+1),V=a+u*(.22+j*.56+(l()-.5)*.06);io(i,V,C,T*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:te(s+20,.5,.7),rimStrength:.7})}i.fillStyle="#05070d",i.fillRect(a-u*.5,y,u*.5,h-y),i.fillRect(c,y,u*.5,h-y);let L=u*.055+3,I=L*1.35;i.fillStyle="#03050a",i.beginPath(),i.moveTo(a,h),i.lineTo(a-L,h),i.lineTo(a-I,y),i.lineTo(a+u*.012,y),i.closePath(),i.fill(),i.beginPath(),i.moveTo(c,h),i.lineTo(c+L,h),i.lineTo(c+I,y),i.lineTo(c-u*.012,y),i.closePath(),i.fill(),i.fillRect(a-I,y,u+I*2,(h-y)*.12);let M=m*.14,x=y+(h-y)*.12;i.fillStyle="rgba(4,6,12,0.96)";let A=7;i.beginPath(),i.moveTo(a-I,x);for(let E=0;E<=A;E++){let j=a-I+(u+I*2)*E/A;i.quadraticCurveTo(j-(u+I*2)/A/2,x+M,j,x)}i.lineTo(c+I,x),i.lineTo(c+I,y),i.lineTo(a-I,y),i.closePath(),i.fill(),i.fillStyle=`rgba(${n},0.12)`,i.fillRect(a-1.5,x,1.5,h-x),i.fillRect(c,x,1.5,h-x),i.fillStyle="#0b0f18",i.fillRect(a-L,h-m*.05,u+L*2,m*.05+3);let P=i.createLinearGradient(0,h-m*.05,0,h+m*.12);P.addColorStop(0,`rgba(255,206,140,${(.5*r).toFixed(3)})`),P.addColorStop(1,"rgba(255,206,140,0)"),i.fillStyle=P,i.fillRect(a-L,h-m*.05,u+L*2,m*.2);let H=3+Math.floor(l()*2);for(let E=0;E<H;E++){let j=(E+1)/(H+1),V=a+u*(j+(l()-.5)*.08),z=W(Math.min(62,t+26)),J=(l()-.5)*u*.16;si(i,V,z,V+J,h,4,u*.09,n,.16*(.7+r*.5)),oo(i,V,z,2.4,n)}}function Gc(i,e,t,o,r,s,n){let l=Math.min(e*.6,Math.max(3,o.voidRadiusM)),a=Math.min(55,Math.atan2(l,e)*180/Math.PI),c=q/2,d=1.2,h=Math.max(e*.45,e-l),u=e+l,m=Math.atan2(d-t,h)*180/Math.PI,y=Math.atan2(d-t,u)*180/Math.PI,f=Math.atan2(-t,h)*180/Math.PI,p=W(m),g=W(y),b=W(f),S=Ye(a)-c,v=Math.max(6,(p-g)/2),w=(p+g)/2,k=i.createRadialGradient(c,b,4,c,b,S*2.6);k.addColorStop(0,`rgba(255,206,150,${(.2*r).toFixed(3)})`),k.addColorStop(.5,"rgba(150,140,190,0.08)"),k.addColorStop(1,"rgba(40,44,60,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=k,i.fillRect(c-S*2.6,g-v,S*5.2,b-g+v+40),i.restore(),i.fillStyle="#0c1019",i.beginPath(),i.moveTo(c-S,w),i.ellipse(c,w,S,v,0,Math.PI,0,!1),i.lineTo(c+S,b),i.ellipse(c,b,S,v,0,0,Math.PI,!1),i.closePath(),i.fill();let T=i.createLinearGradient(0,w,0,b);T.addColorStop(0,`rgba(${s},0.14)`),T.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=T,i.fillRect(c-S,w,S*2,b-w);let C=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],L=C[Math.floor(n()*C.length)],I=n()<.5?-1:1,M=B=>c+B.u*I*S*.84,x=B=>w+B.v*v*.8,A=L.find(B=>B.lead)??L[0],P=M(A),H=i.createLinearGradient(0,w-v,0,w+v);H.addColorStop(0,"#3d4a72"),H.addColorStop(1,"#232b47"),i.fillStyle=H,i.beginPath(),i.ellipse(c,w,S,v,0,0,R),i.fill();let E=i.createRadialGradient(P,w,2,P,w,S);E.addColorStop(0,`rgba(255,214,160,${(.5*r).toFixed(3)})`),E.addColorStop(1,"rgba(255,214,160,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=E,i.beginPath(),i.ellipse(c,w,S,v,0,0,R),i.fill(),i.restore(),i.strokeStyle=`rgba(${s},0.7)`,i.lineWidth=2,i.beginPath(),i.ellipse(c,w,S,v,0,0,R),i.stroke();let j=Math.max(24,(b-g)*1.3),V=L.length>=3?3:2;for(let B=0;B<V;B++){let he=(-.62+B*.52+(n()-.5)*.12)*-I,Te=c+he*S*.7,Ue=w-v*(.45+n()*.18),Fe=S*(.07+n()*.04),hi=j*(.26+n()*.12);i.fillStyle="#0a0e18",i.fillRect(Te-Fe/2,Ue-hi,Fe,hi),i.fillStyle=`rgba(${s},0.3)`,i.fillRect(Te-Fe/2,Ue-hi,Fe,1.5)}if(L.length>=3){let B=c-A.u*I*S*.4;i.fillStyle="#0b0f1a",i.beginPath(),i.ellipse(B,w-v*.34,S*.08,v*.1,0,0,R),i.fill(),i.strokeStyle=`rgba(${s},0.35)`,i.lineWidth=1,i.stroke()}for(let B of[...L].sort((he,Te)=>he.v-Te.v)){let he=.82+(B.v+1)*.14;io(i,M(B),x(B),j*he*(B.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:B.pose,rim:te(40,.72,.8),rimStrength:B.lead?1.4:.9})}let z=W(Math.min(60,y+34)),J=v*1.1+6;i.strokeStyle="rgba(60,68,92,0.85)",i.lineWidth=3,i.beginPath(),i.ellipse(c,z,S*1.15,J,0,0,R),i.stroke();let F=4+Math.floor(n()*3);for(let B=0;B<F;B++){let he=B/F*R,Te=c+Math.cos(he)*S*1.15,Ue=z+Math.sin(he)*J;if(Math.sin(he)>-.2){let Fe=c+(n()-.5)*S*.8;si(i,Te,Ue,Fe,w,3,S*.32,s,.2*(.7+r*.4))}oo(i,Te,Ue,3,s)}let K=W(Math.min(52,y+24)),O=Math.max(60,S*.4),Z=Math.max(24,O*.34);i.strokeStyle="rgba(70,78,102,0.6)",i.lineWidth=1.5,i.beginPath(),i.moveTo(c-O*.3,K-Z/2),i.lineTo(c-O*.16,K-Z*2.2),i.moveTo(c+O*.3,K-Z/2),i.lineTo(c+O*.16,K-Z*2.2),i.stroke(),i.fillStyle="#0d1220",i.fillRect(c-O/2,K-Z/2,O,Z);let ai=i.createLinearGradient(0,K-Z*.3,0,K+Z*.42);ai.addColorStop(0,`rgba(${s},0.5)`),ai.addColorStop(1,"rgba(255,214,160,0.32)"),i.fillStyle=ai,i.fillRect(c-O*.42,K-Z*.3,O*.84,Z*.72),i.fillStyle="rgba(255,214,160,0.55)",i.fillRect(c-O/2,K+Z/2-2,O,2);let li=i.createRadialGradient(c,K,4,c,K,O*1.1);li.addColorStop(0,`rgba(${s},0.2)`),li.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=li,i.fillRect(c-O*1.1,K-O*.8,O*2.2,O*1.6);let ci=i.createRadialGradient(c,(z+w)/2,6,c,(z+w)/2,S*1.5);ci.addColorStop(0,`rgba(${s},${(.1*(.6+r*.5)).toFixed(3)})`),ci.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=ci,i.fillRect(c-S*1.5,z-40,S*3,w-z+80),i.restore();let fa=c+Math.sign(P-c||1)*S*.5;si(i,fa,z-J*.4,P,x(A),2.5,S*.16,"255,224,178",.42*(.7+r*.4));let di=i.createRadialGradient(P,x(A),1,P,x(A),S*.2);di.addColorStop(0,`rgba(255,228,185,${(.4*r).toFixed(3)})`),di.addColorStop(1,"rgba(255,228,185,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=di,i.beginPath(),i.ellipse(P,x(A),S*.2,v*.24,0,0,R),i.fill(),i.restore()}function Nc(i,e,t,o,r,s,n,l){let a=q/2,c=Math.max(10,o.voidRadiusM),d=Math.max(2,e-c),h=e+c,u=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),m=Math.atan2(-t,d)*180/Math.PI,y=Math.atan2(-t,h)*180/Math.PI,f=W(m),p=W(y),g=Ye(u)-a,b=(f+p)/2,S=Math.max(10,(f-p)/2),v=i.createRadialGradient(a,b,4,a,b,g);v.addColorStop(0,"#e8f0fb"),v.addColorStop(.7,"#b9c9e2"),v.addColorStop(1,"#8fa3c4"),i.save(),i.beginPath(),i.ellipse(a,b,g,S,0,0,R),i.clip(),i.fillStyle=v,i.fillRect(a-g,b-S,g*2,S*2),i.strokeStyle="rgba(90,120,170,0.5)",i.lineWidth=3,i.beginPath(),i.moveTo(a,b-S),i.lineTo(a,b+S),i.moveTo(a-g*.5,b-S),i.lineTo(a-g*.5,b+S),i.moveTo(a+g*.5,b-S),i.lineTo(a+g*.5,b+S),i.stroke(),i.strokeStyle="rgba(180,90,110,0.45)",i.beginPath(),i.ellipse(a,b,S*.9,S*.5,0,0,R),i.stroke(),i.restore(),i.strokeStyle="rgba(210,225,245,0.6)",i.lineWidth=2.5,i.beginPath(),i.ellipse(a,b,g,S,0,0,R),i.stroke(),i.fillStyle="rgba(20,26,40,0.8)";for(let M=0;M<5;M++){let x=a+(l()-.5)*g*1.4,A=b+(l()-.5)*S*1.1,P=Math.max(2,S*.06);i.beginPath(),i.ellipse(x,A,P*.6,P,0,0,R),i.fill()}let w=i.createRadialGradient(a,b,4,a,b,g*1.4);w.addColorStop(0,"rgba(200,220,255,0.12)"),w.addColorStop(1,"rgba(200,220,255,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=w,i.fillRect(a-g*1.4,p-S,g*2.8,f-p+S*2),i.restore();let k=W(Math.min(66,y+60)),T=Math.max(80,g*.7),C=T*.5,L=i.createRadialGradient(a,k,4,a,k,T*1.6);L.addColorStop(0,`rgba(${n},0.3)`),L.addColorStop(1,`rgba(${n},0)`),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=L,i.fillRect(a-T*1.6,k-T*1.2,T*3.2,T*2.4),i.restore(),i.fillStyle="#080b12",i.beginPath(),i.moveTo(a-T/2,k-C/2),i.lineTo(a+T/2,k-C/2),i.lineTo(a+T*.6,k),i.lineTo(a+T/2,k+C/2),i.lineTo(a-T/2,k+C/2),i.lineTo(a-T*.6,k),i.closePath(),i.fill();let I=s;for(let M=0;M<3;M++){let x=te(I+M*30,.5,.5);i.fillStyle=`rgba(${x[0]},${x[1]},${x[2]},0.75)`;let A=T*.26;i.fillRect(a-T*.42+M*(A+T*.06),k-C*.32,A,C*.64)}i.fillStyle=`rgba(${n},0.9)`;for(let M=0;M<8;M++){let x=a-T*.6+T*1.2*M/7;i.beginPath(),i.arc(x,k+C*.62,2.4,0,R),i.fill()}}function Wc(i,e,t,o,r,s,n,l,a,c){let d=e.sectionId,h=!1,u=[];for(let f of t){if(f.id===e.id)continue;let p=f.x-e.x,g=f.y-e.y,b=Math.hypot(p,g)*yt;if(d&&f.sectionId===d&&b<3&&p*n+g*l>0&&(h=!0),b<.3||b>32)continue;let v=((Math.atan2(p,-g)-r)*180/Math.PI+540)%360-180,w=a?(f.eyeHeightM??ee)-s:0,k=Math.atan2(w-.28,b)*180/Math.PI;if(k>10&&b>5)continue;let T=0;for(let I=0;I<f.id.length;I++)T=T*31+f.id.charCodeAt(I)&65535;let C=.9+(T&15)/40,L=Math.min(78,Math.atan2(.16,b)*180/Math.PI*Mc*C);L<1.2||u.push({hx:Ye(v),hy:W(k),r:L,d:b,hash:T})}u.sort((f,p)=>p.d-f.d);let m=[];{let f=[...u].sort((b,S)=>b.hy-S.hy),p=[],g=()=>{if(!p.length)return;let b=p.reduce((w,k)=>w+k.d,0)/p.length,S=p.reduce((w,k)=>w+k.hy,0)/p.length,v=p.reduce((w,k)=>w+k.r,0)/p.length;m.push({figs:p.sort((w,k)=>k.d-w.d),d:b,hy:S,r:v}),p=[]};for(let b of f){let S=p[p.length-1];S&&Math.abs(b.hy-S.hy)>Math.max(5,(S.r+b.r)/2*1.7)&&g(),p.push(b)}g()}m.sort((f,p)=>p.d-f.d);let y=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let f of m){if(f.figs.length>=3&&f.r>=1.6&&f.r<26){let p=[],g=[...f.figs].sort((v,w)=>v.hx-w.hx),b=[];for(let v of g){let w=b[b.length-1];w&&v.hx-w.hx>Math.max(14,v.r*7)&&(b.length>=3&&p.push(b),b=[]),b.push(v)}b.length>=3&&p.push(b);let S=Math.min(.42,.5*(1-f.d/42));if(S>.05){i.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let v of p){let w=v[0].hx-f.r*1.6,k=v[v.length-1].hx+f.r*1.6;i.beginPath(),i.roundRect(w,f.hy+f.r*.8,k-w,f.r*2.4,f.r*.8),i.fill()}}}for(let p of f.figs){let g=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),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],v=y[p.hash%y.length],w=[v[0]+b,v[1]+b,v[2]+b];if(p.r>=13){let k=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;Oc(i,p.hx,p.hy,p.r,{tone:S,clothing:w,alpha:g,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%Bc,rim:k,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?Dc(i,p.hx,p.hy,p.r,w,S,g):(i.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,i.beginPath(),i.arc(p.hx,p.hy,p.r,0,R),i.fill(),i.beginPath(),i.ellipse(p.hx,p.hy+p.r*1.4,p.r*1.85,p.r*.95,0,Math.PI,0,!0),i.fill())}}if(h){let f=W(-34);i.fillStyle="rgba(6, 8, 14, 0.92)",i.fillRect(0,f,q,de-f),i.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let g=0;g<p;g++){let b=(g+.5)/p*q;i.beginPath(),i.ellipse(b,f+6,q/p*.42,22,0,Math.PI,0,!0),i.fill()}}}var oe=480,Xe=270,to=50,Be=30,da=i=>(i+to)/(2*to)*oe,mt=i=>(Be-i)/(2*Be)*Xe;function by(i,e,t){let o=document.createElement("canvas");o.width=oe,o.height=Xe;let r=o.getContext("2d"),s=e.x-i.x,n=e.y-i.y,l=Math.max(2,Math.hypot(s,n)*yt),a=ua(ha(`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+a()*150,d=te(220+(a()-.5)*60,.55,.82),h=`${d[0]},${d[1]},${d[2]}`,u=r.createLinearGradient(0,0,0,Xe);u.addColorStop(0,"#080b12"),u.addColorStop(.44,"#151c32"),u.addColorStop(.5,"#1d2644"),u.addColorStop(.58,"#161c2e"),u.addColorStop(1,"#131829"),r.fillStyle=u,r.fillRect(0,0,oe,Xe);let m=i.eyeHeightM??ee,y=Qi(m,l),f=Math.min(to-2,Math.atan2(4,l)*180/Math.PI),p=Math.min(Be-2,y.topPitch),g=Math.max(-Be+2,y.basePitch),b=da(-f),S=da(f),v=mt(p),w=mt(g),k=S-b,T=w-v,C=Math.max(.35,Math.min(1,1-(l-6)/60)),L=mt(Math.min(Be-1,p+8)),I=r.createRadialGradient(oe/2,(v+w)/2,4,oe/2,(v+w)/2,k*1.15);I.addColorStop(0,"rgba(255,214,150,0.34)"),I.addColorStop(.28,"rgba(150,150,230,0.3)"),I.addColorStop(.6,"rgba(99,102,241,0.12)"),I.addColorStop(1,"rgba(99,102,241,0)"),r.fillStyle=I,r.fillRect(b-k*.6,v-T*1.2,k*2.2,T*3.4);let M=te(c,.62,.55),x=te(c+40,.7,.5),A=te(c+70,.78,.52);r.save(),r.beginPath(),r.rect(b,v,k,T),r.clip();let P=r.createLinearGradient(0,v,0,w);P.addColorStop(0,`rgb(${M[0]},${M[1]},${M[2]})`),P.addColorStop(.5,`rgb(${x[0]},${x[1]},${x[2]})`),P.addColorStop(1,`rgb(${A[0]},${A[1]},${A[2]})`),r.globalAlpha=.8,r.fillStyle=P,r.fillRect(b,v,k,T),r.globalAlpha=1;let H=r.createRadialGradient(oe/2,(v+w)/2,k*.12,oe/2,(v+w)/2,k*.6);H.addColorStop(0,"rgba(6,8,14,0)"),H.addColorStop(.7,"rgba(6,8,14,0.15)"),H.addColorStop(1,"rgba(5,6,11,0.9)"),r.fillStyle=H,r.fillRect(b,v,k,T),r.restore();let E=3,j=w-T*.08;for(let F=0;F<E;F++){let K=(F+1)/(E+1);io(r,b+k*(.24+K*.52),j,T*.46*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:te(c+20,.5,.7),rimStrength:.7})}r.fillStyle="#05070d",r.fillRect(b-k*.5,L,k*.5,w-L),r.fillRect(S,L,k*.5,w-L);let V=k*.05+2,z=V*1.35;r.fillStyle="#03050a",r.beginPath(),r.moveTo(b,w),r.lineTo(b-V,w),r.lineTo(b-z,L),r.lineTo(b+k*.012,L),r.closePath(),r.fill(),r.beginPath(),r.moveTo(S,w),r.lineTo(S+V,w),r.lineTo(S+z,L),r.lineTo(S-k*.012,L),r.closePath(),r.fill(),r.fillRect(b-z,L,k+z*2,(w-L)*.13),r.fillStyle=`rgba(${h},0.12)`,r.fillRect(b-1.2,L,1.2,w-L),r.fillRect(S,L,1.2,w-L),r.fillStyle="#0b0f18",r.fillRect(b-V,w-T*.05,k+V*2,T*.05+2);let J=r.createLinearGradient(0,w-T*.05,0,w+T*.14);J.addColorStop(0,`rgba(255,206,140,${(.5*C).toFixed(3)})`),J.addColorStop(1,"rgba(255,206,140,0)"),r.fillStyle=J,r.fillRect(b-V,w-T*.05,k+V*2,T*.22);for(let F=0;F<3;F++){let K=(F+1)/4,O=b+k*K,Z=mt(Math.min(Be-1,p+20));si(r,O,Z,O+(a()-.5)*k*.14,w,3,k*.09,h,.17*C),oo(r,O,Z,1.8,h)}r.fillStyle=`rgba(${h},0.75)`;for(let F=0;F<8;F++)r.beginPath(),r.arc((F+.5)/8*oe,mt(Be-4-F%2*3),2.2,0,R),r.fill();r.fillStyle="rgba(10,13,20,0.9)",r.fillRect(0,Xe-26,oe,26),r.fillStyle="rgba(30,37,54,0.9)";for(let F=0;F<9;F++){let K=F*(oe/9)+oe/18;r.beginPath(),r.ellipse(K,Xe-22,oe/9*.4,15,0,Math.PI,0,!0),r.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(l)}}var pa=new Set(["en"]),ni=new Map;async function Vc(i){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(Xo(`i18n/${i}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-VULFUGJH.js"),t=e[i];return t?await t():null}async function ky(i,e){let t=Wr(i,e);if(t==="en"||pa.has(t))return We(t),t;if(!Nr.includes(t))return We("en"),"en";try{let o=ni.get(t);o||(o=Vc(t),ni.set(t,o));let r=await o;return ni.delete(t),r?(We(t,r),pa.add(t),t):(We("en"),"en")}catch{return ni.delete(t),We("en"),"en"}}export{Yc as ACCESSIBILITY_RING_COLOR,ro as ACCESSIBILITY_TYPES,Kc as CHART_STORAGE_KEY,Yd as CURRENCY_CHOICES,Xd as DEFAULT_CURRENCY,Im as EMPTY_AVAILABILITY_REFRESH,ed as EVENT_CONFIGURATION_EXPORT_SCHEMA,Jc as EVENT_CONFIGURATION_SCHEMA,Td as FLOOR_STACK_GAP_RATIO,Pd as FLOOR_STACK_MIN_SURFACE_PX,Cm as HOLD_CLOCK_SKEW_MS,Zc as LABEL_STYLE_MAX_SIZE,qc as LABEL_STYLE_MIN_SIZE,eh as LOCALE_NAMES,Md as MAX_EVENT_INVENTORY,xd as MAX_GA_CAPACITY,na as PickerController,Le as PickerSelectionError,Dd as RENDERED_QUALITY_REPORT_VERSION,Uc as SEAT_COMMERCIAL_MARKS,zc as STAGE_LABEL_STYLE_MAX_SIZE,Ha as SUPPORTED_LOCALES,Qc as SURROUNDINGS_SHAPE_ROLES,$i as SeatmapRenderer,cd as TABLE_SEAT_OFFSET,ld as TIER_HEIGHT_M,Nr as TRANSLATED_LOCALES,mo as UNGROUPED_ID,Un as accessNeedsFor,Xc as accessibilityMeta,gt as accessibilityRingColor,co as allObjects,yo as applyHidden,Zn as attachVisibilityCatchUp,sd as canTransitionEventConfiguration,od as canonicalEventConfigurationJson,uo as chartBounds,pn as compactRowLabel,kt as computeSections,Wn as createRenderer,Oa as currencyExponent,$d as currencySymbol,bd as expandBooth,De as expandChart,pd as expandRow,ud as expandRowSlots,gd as expandTable,md as expandTableSlots,kd as floorObjects,Cd as floorStackPlacements,vt as floorsOf,nh as formatDate,Ud as formatMinor,ot as formatMoney,Da as fromMinorUnits,$e as gaAreasOf,Ed as gaInventorySegments,Ad as gaUnitLabel,wt as gaUnitLabels,gy as generateSeatPanorama,by as generateSeatThumb,th as getLocale,_d as growJoinedGAInventory,Od as hiddenObjectIds,kc as holdHasLapsed,xm as holdRecoveryShape,fo as initialFloorMode,rd as inspectEventConfigurationCompatibility,Hd as inspectRenderedQualityEvidence,Bd as isGaUnitLabel,oh as isLocaleLoaded,Fd as isSectionHidden,jc as layerOf,po as layoutFloorStack,ky as loadLocale,ih as localeDirection,Id as mainFloorId,ad as migrateLegacyEventConfigurations,vd as objectCenter,wd as owningSectionForObject,id as parseEventConfigurationExport,td as parseEventConfigurationVersion,Sd as pointInPolygon,ie as pointInPolygonWithHoles,St as polygonLabelPoint,$n as reconcileAvailability,Pm as refreshChangedSomething,nd as resolveEventConfigurationRollback,Wr as resolveLocale,hd as rowInventoryCount,dd as rowSeatPositions,$c as seatCommercialMeta,bt as sectionGeometry,We as setLocale,Gr as setMoneyLocale,rh as setStringOverrides,qn as shouldWaitForHoldExpiry,ho as stackFloors,X as t,sh as tCount,yd as tableInventoryCount,fd as tableSeatCountsBySide,Ld as translateObject,Rd as validGAInventorySegments};
|
|
1
|
+
import{a as cd,b as hd,c as _o,d as dd,e as ud,f as Fo,h as qo,k as Gt,m as Zo,n as ye,o as ae,p as Qo,q as jo,r as Ht,s as Jo}from"./chunk-ZMYRXJOA.js";import{a as kd,b as Vo,c as Ld}from"./chunk-3L4M7L5I.js";import{b as ur}from"./chunk-FOYQOIWG.js";import{a as Gh,b as Hh,c as Nh,d as Wh,e as Vh,f as Kh,g as zh,h as Xh,i as Yh}from"./chunk-YFV4DSSX.js";import{c as nr,e as ar}from"./chunk-BLPBTW6I.js";import{b as Ot,f as zo,h as Dt,i as Xo,k as Yo}from"./chunk-UL5OIGIF.js";import{a as xi,b as Ci,d as lr,e as Nt,g as cr,h as hr,k as dr}from"./chunk-JLYR66MT.js";import{a as fe,b as No,c as Me,d as At,e as Et,f as Re,g as G,m as me,n as xe,q as _t,r as Ft,t as Wo,u as Bt,v as U,w as Ti}from"./chunk-FMZ6HLDH.js";import{A as rr,B as sr,b as Uo,c as $o,e as st,i as tr,j as ir,p as or}from"./chunk-QLDV5ZGA.js";import{a as pd,b as fd,c as md,d as yd,e as gd,f as Mt,g as bd,h as ot,i as Sd,j as Bo,k as Rt,l as vd,m as wd,n as Oo}from"./chunk-UX67GDLV.js";import{a as Ph,b as Mh,c as xo,d as Rh,e as Ah,f as xt,g as Eh,h as _h,i as Fh,j as Bh,k as Oh,l as Dh,q as Ko,t as rt,x as er}from"./chunk-BAWUBGWY.js";import{Aa as ad,Ba as Ro,Ca as ld,Da as Ao,Ea as ze,Fa as Eo,W as Po,X as Ke,Y as Uh,ea as ee,fa as Mo,ga as Ct,ka as $h,la as qh,ma as Zh,na as Qh,oa as jh,pa as Jh,qa as ed,ra as td,s as Co,sa as id,ta as od,u as Io,ua as rd,va as oe,w as N,wa as It,xa as sd,ya as nd,za as Pt}from"./chunk-KN7GLEAI.js";import{C as F,c as wi,h as ki,m as Do,o as Go,t as W,u as Te,v as ue,w as pe,x as Li,z as Ho}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var Td=1,Ii=150;function Pi(i,e){return!Number.isFinite(i)||!Number.isFinite(e)?0:Math.max(0,i*e)}function pr(i,e,t,o=1){if(!Number.isFinite(i))return t;let r=Math.max(0,o);return t?i>=e-r:i>=e+r}function Mi(i,e,t,o=1){if(!Number.isFinite(i)||!(t>0))return i;let r=Math.max(0,o)/t;return e?i*(1+r):i*(1-r)}function xd(i){let{point:e,camera:t,scale:o,nextScale:r}=i;if(!Number.isFinite(o)||o<=0||!Number.isFinite(r))return{...t};let s=(e.x-t.x)/o,n=(e.y-t.y)/o;return{x:e.x-s*r,y:e.y-n*r}}import{Konva as ci}from"konva/lib/Core";import{Stage as oh}from"konva/lib/Stage";import{Layer as po}from"konva/lib/Layer";import{Group as vt}from"konva/lib/Group";import{Circle as fa}from"konva/lib/shapes/Circle";import{Group as Gi}from"konva/lib/Group";import{Circle as Ge}from"konva/lib/shapes/Circle";import{Line as Hi}from"konva/lib/shapes/Line";import{Rect as Ni}from"konva/lib/shapes/Rect";import{Text as us}from"konva/lib/shapes/Text";var ge=9,Ae=.9,le=.55*Ae,re=G/fe,nt=4,Ee=14,fr=10,mr=14,be=.45*Ae,Se=.9*Ae,_e=(be+Se)/2,yr=Math.max(Ae*1.1,Se),Ce=8,gr=700,Q=2,br=G,Wt=.85,Sr=G,at=64,Xe=.55*be,Ri=700,vr=2500,Vt=-11.5,lt=.58,wr=320,kr=650,Lr=420,Tr=1,Fe=1,xr=2,Ye=16,ve=12,Cr=[.85,.72,.62],Kt=15,zt=12,Ir=.01,Pr=10,Mr=6,Rr=12,Ar=8,Er=8,_r=.6,Fr=.6,Br=[0,18,-18,36,-36,54,-54],we="600",Xt="500",se=640,Yt="700",Be=.02,Or=14,Dr=.34,Ut=.92,ct=7,$t=3,Gr=6;function Ai(i){return Math.min(1,Math.max(ve/Ye,i/900))}function Ue(i,e){return Math.max(ve,i*Ai(e))}var Hr=.1,$e=1.02,Ya=3,Ua=8,Ei=Ua**(1/Ya);function Nr(i,e,t=Ei){if(!(i>0)||!(e>0)||!(t>1)||i>=e)return null;let o=Math.min(i*t,e);return o/i<$e?e:o}var $a="#e5e7eb",qa="#c7cbd1",Za="#595f69",Qa="#d1d5db",ja="#b8bdc4",Ja="#273142",el="#526078",tl="#f1f5f9",il="#374151",ol="#64748b",rl="#111827",qt="#6b7280",ht="#374151";var Wr="#4b5563",Vr=.4,Oe=.16,Kr="rgba(244,246,248,0.06)",Zt=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function zr(i,e,t){let o=new Map;for(let n of i){let l=e(n);!l||t(l)||o.set(l,(o.get(l)??0)+1)}let r=null,s=0;for(let[n,l]of o)(l>s||l===s&&r!=null&&n<r)&&(r=n,s=l);return r}function te(i){return W(i)?{sectionFill:$a,sectionStroke:qa,sectionInk:Za,focalFill:Qa,focalStroke:ja}:{sectionFill:Ja,sectionStroke:el,sectionInk:tl,focalFill:il,focalStroke:ol}}function _i(i,e){let t=i.sectionFill,o=Ho(ue(t,.2),.85);switch(e){case"closed":return ue(t,.12);case"sold-out":return o;case"nearly-gone":return pe(t,o,.4);default:return t}}var Xr=.28,Yr=.32,sl=.55,nl=.7;function Ur(i,e,t){let o=te(i),r=_i(o,e);if(!t||e==="sold-out"||e==="closed")return{fill:r,stroke:o.sectionStroke};let s=W(i);return{fill:pe(r,t,s?Yr:Xr),stroke:F(t,s?nl:sl)}}var al=.03;function $r(i,e){let t=te(i);return!["normal","nearly-gone","sold-out","closed"].map(r=>_i(t,r).toLowerCase()).includes(e.trim().toLowerCase())&&Fi(i,e)}function Fi(i,e){let t=wi(e);if(!t)return!1;let o=te(i),r=Math.max(Xr,Yr)+al;return["normal","nearly-gone","sold-out","closed"].some(s=>{let n=wi(_i(o,s));return n?Math.max(Math.abs(n[0]-t[0]),Math.abs(n[1]-t[1]),Math.abs(n[2]-t[2]))/255<=r:!1})}var ll="#f8fafc",cl="#f4f6fb",hl="#111827",dl=.72;function qr(i){let e=W(i),t=e?ll:rl,o=e?hl:cl,r=pe(o,t,1-dl);return{plate:t,ink:o,subInk:Do(r,t)>=Go?r:o}}function Zr(i){return i?.35:.3}function Qr(i){if(i<=0||i>=1)return 1;let e=1.25-1;if(i<.45){let o=i/.45;return 1+e*(1-(1-o)**2)}let t=(i-.45)/(1-.45);return 1+e*Math.cos(t*Math.PI*1.5)*(1-t)**2}function Bi(i){let e=i<=0?0:i>=1?1:i,t=1-(1-e)**3;return{radiusScale:1+(2.5-1)*t,opacity:.55*(1-e)}}var Jr;function es(i){Jr=i}function ul(i){return typeof i=="number"?i:i instanceof Date?i.getTime():Date.parse(i)}var jr=new Map;function pl(i,e){let t=i??Jr,o=`${t??""}|${JSON.stringify(e)}`,r=jr.get(o);return r||(r=new Intl.DateTimeFormat(t,e),jr.set(o,r)),r}var fl={dateStyle:"medium",timeStyle:"short"};function ts(i,e={}){let{locale:t,...o}=e,r=ul(i);if(!Number.isFinite(r))return"";let s=Object.keys(o).length?o:fl;return pl(t,s).format(r)}var _d="USD",Fd=["USD","EUR","GBP","CAD","AUD","INR","AED","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL"],os;function rs(i){os=i}var is=new Map;function Qt(i,e,t,o){let r=o??os,s=`${r??""}|${i}|${e??"auto"}|${t??"auto"}`,n=is.get(s);return n||(n=new Intl.NumberFormat(r,{style:"currency",currency:i,minimumFractionDigits:e,maximumFractionDigits:t}),is.set(s,n)),n}function dt(i,e="USD",t,o){if(typeof t=="object"){let s=t;try{return Qt(e,s.minimumFractionDigits,s.maximumFractionDigits,s.locale).format(i)}catch(n){if(s.fallback)return s.fallback(i,e);throw n}}let r=t??(Number.isInteger(i)?0:void 0);return Qt(e,r,r,o).format(i)}function ml(i="USD"){try{return Qt(i,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function yl(i,e="USD"){return i/10**ml(e)}function Bd(i,e="USD",t){return dt(yl(i,e),e,void 0,t)}function Od(i="USD"){return Qt(i,0,0).formatToParts(0).find(t=>t.type==="currency")?.value??i}var ut={"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.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","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.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.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.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.holdReassurance":"Yours for {time} \u2014 you won\u2019t be charged yet.","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.findTogetherInstead":"Find seats together instead","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours.","picker.accessExpiredTitle":"Your access session has ended","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.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.addTime":"Add time","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.change":"Change","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.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","picker.accessFreeCount":"{count} free","picker.accessNoneLeft":"None left","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.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.fitToScreen":"Fit to screen","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.heldTicketsReleased":"Held tickets released. Choose your new seats.","picker.heldTicketsRestored":"Your held tickets have been restored.","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.liveAvailability":"Live availability \u2014 seats update in real time","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.moreSelectedCount":"{count} more selected","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.notChargedYet":"You won\u2019t be charged yet.","picker.notForSale":"Not for sale","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.releaseHeldTickets":"Release held tickets and choose different seats","picker.releasingEllipsis":"Releasing\u2026","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.seatsHeldForNeedMoreTime":"Your seats are held for <b>{time}</b>. Need more time?","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsJustTakenInCategory.one":"{count} seat just taken in {label} \xB7 {left} left","picker.seatsJustTakenInCategory.other":"{count} seats just taken in {label} \xB7 {left} left","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSecured":"Seats secured","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.securedCount":"{count} secured","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.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.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 gl=["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"],Vd={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"},ss=["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"],bl=new Set(["ar","fa","he"]),Oi={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"},Di=new Map(gl.map(i=>[i.toLowerCase(),i]));function Sl(i){let e=i.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let t=Di.get(e)??Oi[e];if(t)return t;let o=e.split("-");if(o.length>=2){let r=`${o[0]}-${o[1]}`,s=Di.get(r)??Oi[r];if(s)return s}return Di.get(o[0])??Oi[o[0]]}var De={en:ut},jt={},ce="en";function ns(i,e){let t=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let o of[i,e,...t]){if(!o)continue;let r=Sl(o);if(r)return r}return"en"}function Kd(){return ce}function zd(i=ce){return bl.has(i)?"rtl":"ltr"}function Xd(i){return!!De[i]}function qe(i,e){e&&(De[i]={...De[i],...e}),ce=De[i]?i:"en",rs(ce),es(ce),typeof document<"u"&&(document.documentElement.lang=ce)}function Yd(i){jt=i}var as=/\{(\w+)\}/g;function $(i,e){let t=jt[i]??De[ce]?.[i]??ut[i]??i;return e?t.replace(as,(o,r)=>String(e[r]??`{${r}}`)):t}function Ud(i,e,t){let o=new Intl.PluralRules(ce).select(e);return(jt[`${i}.${o}`]??De[ce]?.[`${i}.${o}`]??ut[`${i}.${o}`]??jt[`${i}.other`]??De[ce]?.[`${i}.other`]??ut[`${i}.other`]??i).replace(as,(n,l)=>String({count:e,...t}[l]??`{${l}}`))}function $d(i,e){return ts(i,{...e??{dateStyle:"medium",timeStyle:"short"},locale:ce})}function cs(i,e,t,o=!1){let r=i.displayLabel?.trim()||i.label;return o?{title:r,detail:$("map.statusTaken"),sellable:!1}:e==="booked"?{title:r,detail:$("map.statusTaken"),sellable:!1}:e==="held"?{title:r,detail:$("map.statusHeld"),sellable:!1}:{title:r,detail:t()??"",sellable:!0}}var Ze=32,ls=70;function hs(i,e){let t=Ze+6,o=i.y-ls;return{x:Math.min(Math.max(i.x,t),Math.max(t,e.width-t)),y:o>=t?o:Math.min(i.y+ls,e.height-t)}}var Ll=220,Tl=.08,Jt=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.host=e}syncMarker(e,t,o){let r=o.get(e);if(o.delete(e),!t){this.retire(r);return}r?.destroy();let s=this.host,n=s.seat(e);if(!n)return;let l=s.seatShape(e)?.fill(),a=U(typeof l=="string"?l:"",s.selectionColor(),Bt),c=s.selectionFocusId()===e,h=s.boothDims(n.rowId),d=s.seatRadius(),u=s.seatPoint(n),f=new Gi({name:"selection-ring",x:u.x,y:u.y,rotation:h?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:s.selectionFocusId()&&!c?.2:1});if(s.viewMode()==="perspective"){let p=s.perspectiveSeatScale(e);f.scale({x:p,y:p})}f.setAttrs({seatId:e,ringColor:a});let y={name:"selection-halo",stroke:F(s.categoryColor(n.categoryKey),Zr(W(s.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(h){let p=d*1.2;f.add(new Ni({...y,width:h.width+p*2,height:h.height+p*2,offsetX:(h.width+p*2)/2,offsetY:(h.height+p*2)/2,cornerRadius:8,strokeWidth:Math.max(2,d*.5)}))}else f.add(new Ge({...y,radius:d*1.6,strokeWidth:Math.max(2,d*.55)}));let m={stroke:a,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(h)if(f.add(new Ni({...m,width:h.width,height:h.height,offsetX:h.width/2,offsetY:h.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)f.add(new Ni({...m,width:h.width+10,height:h.height+10,offsetX:(h.width+10)/2,offsetY:(h.height+10)/2,cornerRadius:7,strokeWidth:2,opacity:.55}));else{let p=Math.max(0,h.width/2-14),g=-Math.max(0,h.height/2-14);f.add(new Ge({x:p,y:g,radius:10,fill:a,listening:!1})),f.add(new Hi({x:p,y:g,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:W(a)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else f.add(new Ge({...m,radius:Math.max(1,d-1.25),strokeWidth:Math.min(2.5,Math.max(1.8,d*.22))})),c?f.add(new Ge({...m,radius:d+2,strokeWidth:2,opacity:.55})):f.add(new Hi({points:[-d*.52,0,-d*.12,d*.4,d*.6,-d*.46],stroke:"#ffffff",strokeWidth:Math.max(2.6,d*.34),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 t=this.host;if(!e)return;if(t.reducedMotion()||t.isDestroyed()||typeof document<"u"&&document.hidden){e.destroy();return}let o=performance.now(),r=s=>{if(t.isDestroyed()||!e.getLayer()){e.destroy();return}let n=Math.min(1,(s-o)/160);e.opacity(1-n),t.overlayLayer.batchDraw(),n<1?requestAnimationFrame(r):(e.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(r)}play(e){let t=this.host;if(t.reducedMotion()||t.isDestroyed()||typeof document<"u"&&document.hidden)return;let o=t.seat(e);if(!o)return;let r=t.seatRadius(),s=t.seatPoint(o);this.pulses.get(e)?.destroy();let n=new Ge({name:"selection-pulse",x:s.x,y:s.y,radius:r,stroke:t.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Bi(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,n),this.pulseHome().add(n);let l=t.isCached()?void 0:t.seatShape(e),a=performance.now(),c=()=>{l?.scale({x:1,y:1}),n.destroy(),this.pulses.get(e)===n&&this.pulses.delete(e),t.overlayLayer.batchDraw(),l&&!t.isCached()&&t.seatLayer.batchDraw()},h=d=>{if(t.isDestroyed()){c();return}n.getLayer()||this.pulseHome().add(n);let u=d-a,f=Bi(u/420);if(n.radius(r*f.radiusScale),n.opacity(f.opacity),l){let y=Qr(u/320);l.scale({x:y,y})}t.overlayLayer.batchDraw(),l&&!t.isCached()&&t.seatLayer.batchDraw(),u<420?requestAnimationFrame(h):c()};queueMicrotask(()=>{t.isDestroyed()||requestAnimationFrame(h)})}nudge(e){let t=this.host;if(t.reducedMotion()||t.isDestroyed()||t.isCached()||typeof document<"u"&&document.hidden)return;let o=t.seatShape(e);if(!o)return;let r=performance.now(),s=()=>{o.scale({x:1,y:1}),t.seatLayer.batchDraw()},n=l=>{if(t.isDestroyed()||t.isCached()||!o.getLayer()){s();return}let a=l-r,c=Math.min(1,a/Ll),h=1+Tl*Math.sin(Math.PI*c);o.scale({x:h,y:h}),t.seatLayer.batchDraw(),c<1?requestAnimationFrame(n):s()};requestAnimationFrame(n)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Gi({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 t=this.host;if(t.isExportMode()||t.isDestroyed())return;let o=t.nearestSeat(e,Ee),r=o?t.seat(o):void 0;if(!r){this.hideLoupe();return}let s=cs(r,t.seatStatus(r.id),()=>t.priceLabel(r),t.seatClosed(r.id)),n=hs(e,{width:t.stage.width(),height:t.stage.height()}),l=1/(t.stage.scaleX()||1),a=this.loupe??this.buildLoupe();a.seatId=r.id,a.group.position(t.screenToWorld(n)),a.group.scale({x:l,y:l}),a.group.opacity(s.sellable?1:.75),a.group.visible(!0),a.disc.fill(t.categoryColor(r.categoryKey)),a.title.text(s.title),a.title.offsetX(a.title.width()/2),a.detail.text(s.detail),a.detail.offsetX(a.detail.width()/2),t.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,t=e.canvasBackground(),o=U(t,te(t).sectionInk),r=new Gi({name:"touch-loupe",listening:!1,visible:!1});r.add(new Hi({points:[-7,Ze-4,0,Ze+12,7,Ze-4],closed:!0,fill:t,stroke:F(o,.25),strokeWidth:1,listening:!1})),r.add(new Ge({radius:Ze,fill:t,stroke:F(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let s=new Ge({y:-15,radius:6,fill:"#6e7bff",listening:!1}),n=new us({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),l=new us({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:F(o,.72),listening:!1,perfectDrawEnabled:!1});return r.add(s),r.add(n),r.add(l),e.overlayLayer.add(r),r.moveToTop(),this.loupe={group:r,title:n,detail:l,disc:s,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}};function ps(i,e){let t=i.width(),o=i.height(),r=1/0,s=1/0,n=-1/0,l=-1/0;for(let a of e){let c=a.getClientRect();if(!(!(c.width>1)||!(c.height>1))){if(c.x<-8||c.y<-8||c.x+c.width>t+8||c.y+c.height>o+8)return null;c.x<r&&(r=c.x),c.y<s&&(s=c.y),c.x+c.width>n&&(n=c.x+c.width),c.y+c.height>l&&(l=c.y+c.height)}}return isFinite(r)?{x:r,y:s,width:n-r,height:l-s}:null}var fs=8,xl=.5;function ys(i,e,t){let o=t??{x:0,y:0,width:i.width(),height:i.height()},r=ps(i,e);if(!r)return 0;ms(i,r,o);let s=Math.min((o.width-2*fs)/r.width,(o.height-2*fs)/r.height);if(!(Math.max(r.width-o.width,r.height-o.height)>xl)||!(s>0))return 1;let l=o.x+o.width/2,a=o.y+o.height/2;i.scale({x:i.scaleX()*s,y:i.scaleY()*s}),i.position({x:l+(i.x()-l)*s,y:a+(i.y()-a)*s});let c=ps(i,e);return c&&ms(i,c,o),s}function ms(i,e,t){let o=t.x+t.width/2-(e.x+e.width/2),r=t.y+t.height/2-(e.y+e.height/2);return o===0&&r===0?!1:(i.position({x:i.x()+o,y:i.y()+r}),!0)}function Wi(i){return`${i.x()},${i.y()},${i.scaleX()}`}import{Group as Cl}from"konva/lib/Group";import{Circle as gs}from"konva/lib/shapes/Circle";import{Line as Il}from"konva/lib/shapes/Line";import{Text as Pl}from"konva/lib/shapes/Text";var Ml=6;function Rl(i){return W(i)?"#0b1220":"#ffffff"}function bs(i){let{points:e}=i;if(!e.length)return null;let t=i.categoryColor??"#6e7bff",o=0,r=0;for(let s of e)o+=s.x,r+=s.y;return{count:e.length,centroid:{x:o/e.length,y:r/e.length},fill:t,ink:Rl(t)}}var ei=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let t of this.host.sections()){if(t.logicalId!==e&&t.id!==e)continue;let o=bs({points:this.host.ownedPoints(t),categoryColor:null});if(o)return o.centroid}return null}badgeAt(e){for(let t of this.badges)if(Math.hypot(e.x-t.centre.x,e.y-t.centre.y)<=t.radius)return t.id;return null}sync(e){if(this.group?.destroy(),this.group=null,this.badges=[],e>=Se){this.host.overlayLayer.batchDraw();return}let t=Math.max(this.host.stageScale(),1e-4),o=new Cl({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let n=this.host.ownedPoints(s),l=bs({points:n,categoryColor:this.host.sectionColor(s)});if(!l)continue;let a=Math.max(Ml/2/t,1);for(let y of n)o.add(new gs({name:"owned-seat-dot",x:y.x,y:y.y,radius:a,fill:l.fill,stroke:F("#ffffff",.55),strokeWidth:Math.max(.5,a*.28),shadowColor:l.fill,shadowBlur:a*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(r.has(s.logicalId))continue;r.add(s.logicalId);let c=this.host.sections().filter(y=>y.logicalId===s.logicalId).reduce((y,m)=>y+this.host.ownedPoints(m).length,0),h=this.host.labelAnchor(s),d=11/t,u={x:h.x,y:h.y-d*2.1};o.add(new gs({name:"owned-section-badge",x:u.x,y:u.y,radius:d,fill:l.fill,stroke:F(l.ink,.35),strokeWidth:1/t,listening:!1,perfectDrawEnabled:!1})),o.add(new Il({x:u.x-d*.62,y:u.y,points:[-d*.22,0,-d*.02,d*.2,d*.34,-d*.26],stroke:l.ink,strokeWidth:Math.max(.6,d*.16),lineCap:"round",lineJoin:"round",listening:!1}));let f=new Pl({x:u.x+d*.12,y:u.y-d*.5,text:String(c),fontSize:d,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});o.add(f),this.badges.push({id:s.logicalId,centre:u,radius:d*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};function V(i){let e=Ko(i);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 Qe(i,e,t,o){let r=o*Math.PI/180,s=Math.cos(r),n=Math.sin(r);return[{x:-e/2,y:-t/2},{x:e/2,y:-t/2},{x:e/2,y:t/2},{x:-e/2,y:t/2}].map(l=>({x:i.x+l.x*s-l.y*n,y:i.y+l.x*n+l.y*s}))}function ti(i,e,t,o,r,s){let n=o*Math.PI/180,l=Math.cos(n),a=Math.sin(n);for(let c=0;c<=4;c++)for(let h=0;h<=6;h++){let d=e*(h/6-.5),u=t*(c/4-.5),f={x:i.x+d*l-u*a,y:i.y+d*a+u*l};if(!oe(f,r,s))return!1}return!0}function Ss(i,e,t){let o=V(i),r=[t];for(let n=1;n<12;n+=1)for(let l=1;l<12;l+=1){let a={x:o.x+o.width*l/12,y:o.y+o.height*n/12};oe(a,i,e)&&r.push(a)}let s=[i,...e];return r.map(n=>({point:n,room:Co(n,s)})).sort((n,l)=>l.room-n.room).map(n=>n.point).filter((n,l,a)=>l===a.findIndex(c=>Math.abs(c.x-n.x)<1e-6&&Math.abs(c.y-n.y)<1e-6))}function vs(i,e){let{stageScale:t,stageX:o,stageY:r}=i;if(i.viewMode==="perspective"&&e.perspectiveAffine)return V(e.outline.map(n=>{let l=i.projectedSectionPoint(e,n);return{x:l.x*t+o,y:l.y*t+r}}));let s=e.liftWorld>0?i.isoLiftLocal(e.liftWorld):{x:0,y:0};return V(e.outline.map(n=>{let l={x:n.x+s.x,y:n.y+s.y},a=i.isoT===0?l:i.isoForward(l);return{x:a.x*t+o,y:a.y*t+r}}))}function Al(i,e){let t=i.width*i.height;if(t<=0)return 0;let o=Math.max(0,Math.min(i.x+i.width,e.width)-Math.max(i.x,0)),r=Math.max(0,Math.min(i.y+i.height,e.height)-Math.max(i.y,0));return o*r/t}function ws(i){let{current:e,viewport:t}=i,o=new Map;for(let l of i.sections){let a=Al(l.bounds,t)*l.members;a<=0||o.set(l.logicalId,(o.get(l.logicalId)??0)+a)}if(!o.size)return e;let r=null,s=0;for(let[l,a]of o)a>s&&(s=a,r=l);if(!r||r===e)return e;let n=e!=null?o.get(e)??0:0;return s>n*1.35?r:e}import{Text as _l}from"konva/lib/shapes/Text";function El(i,e){return i.x<e.x+e.width&&e.x<i.x+i.width&&i.y<e.y+e.height&&e.y<i.y+i.height}var je=class{constructor(){this.cells=new Map}insert(e){for(let t of this.keys(e)){let o=this.cells.get(t);o?o.push(e):this.cells.set(t,[e])}}collisionCount(e){let t=new Set,o=0;for(let r of this.keys(e))for(let s of this.cells.get(r)??[])t.has(s)||(t.add(s),El(e,s)&&o++);return o}keys(e){let t=Math.floor(e.x/at),o=Math.floor((e.x+Math.max(0,e.width))/at),r=Math.floor(e.y/at),s=Math.floor((e.y+Math.max(0,e.height))/at),n=[];for(let l=r;l<=s;l++)for(let a=t;a<=o;a++)n.push(`${a}:${l}`);return n}};function ks(i,e){let t=i.sections.filter(y=>y.id===e||y.logicalId===e),o=t.map(y=>{if(i.viewMode==="perspective"&&y.perspectiveAffine)return V(y.outline.map(g=>i.projectedSectionPoint(y,g)));let m=y.liftWorld>0?i.isoLiftLocal(y.liftWorld):{x:0,y:0},p=y.outline.map(g=>{let b={x:g.x+m.x,y:g.y+m.y};return i.isoT===0?b:i.isoForward(b)});return V(p)});if(!o.length)return null;let r=Math.min(...o.map(y=>y.x)),s=Math.min(...o.map(y=>y.y)),n=Math.max(...o.map(y=>y.x+y.width)),l=Math.max(...o.map(y=>y.y+y.height)),a=new Set(t.flatMap(y=>y.memberIds));for(let y of a){let m=i.seatById.get(y);if(!m)continue;let p=i.renderedSeatPoint(m);r=Math.min(r,p.x-i.seatR),s=Math.min(s,p.y-i.seatR),n=Math.max(n,p.x+i.seatR),l=Math.max(l,p.y+i.seatR)}let c=y=>{[y.x,y.y,y.width,y.height].every(Number.isFinite)&&(r=Math.min(r,y.x),s=Math.min(s,y.y),n=Math.max(n,y.x+y.width),l=Math.max(l,y.y+y.height))},h=y=>{let m={x:y.x+y.width/2,y:y.y+y.height/2};return t.some(p=>oe(m,p.outline,p.holes))};for(let{node:y,backdrop:m}of i.freeTextById.values()){let p=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});h(p)&&(c(p),m&&c(m.getClientRect({relativeTo:i.bgLayer,skipShadow:!0})))}for(let{node:y}of i.iconNodeById.values()){let m=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});h(m)&&c(m)}let d=new je;for(let{node:y}of i.freeTextById.values()){let m=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});d.insert({x:m.x-Q,y:m.y-Q,width:m.width+Q*2,height:m.height+Q*2})}for(let y of i.rowLabelPlan){let m=(y.focusKeys??[]).some(S=>S===e||t.some(v=>S===v.id||S===v.logicalId)),p=new _l({text:y.text,fontSize:y.fontSize,fontStyle:"700",fontFamily:i.labelFont(),rotation:y.rotation,listening:!1});p.offsetX(p.width()/2),p.offsetY(p.height()/2);let g=i.resolveAutomaticRowLabelPosition(p,y,d),b=i.rowLabelBox(p,g);m&&c(b),d.insert(b),p.destroy()}let u=Math.max(n-r,l-s),f=Math.max(i.seatR*2,Math.min(24,u*.025));return{x:r-f,y:s-f,width:Math.max(1,n-r+f*2),height:Math.max(1,l-s+f*2)}}import{Rect as Fl}from"konva/lib/shapes/Rect";import{Text as Ls}from"konva/lib/shapes/Text";function Ts(i,e){if(!e.zones?.length||!i.sections.length)return;let t=qr(i.canvasBackground),o=new Map;for(let r of i.sections)r.zone&&(o.get(r.zone)??o.set(r.zone,[]).get(r.zone)).push(r);for(let r of e.zones){let s=o.get(r.id);if(!s||!s.length)continue;let n=s[0];for(let f of s)f.centroid.y<n.centroid.y&&(n=f);let l=n.centroid.x,a=n.centroid.y,c=1/0;for(let f of s)for(let y of f.memberIds){let m=i.seatById.get(y),p=m&&i.catPrice.get(m.categoryKey);typeof p=="number"&&p<c&&(c=p)}let h=new Fl({x:l,y:a,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:t.plate,stroke:F(r.color??n.outlineTint,_r),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(h);let d=new Ls({x:l,y:a,text:r.label.toUpperCase(),fontSize:Kt,fontStyle:we,letterSpacing:.5,fontFamily:i.labelFont(),fill:t.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});d.offsetX(d.width()/2),d.offsetY(d.height()/2),i.bgLayer.add(d);let u=null;isFinite(c)&&(u=new Ls({x:l,y:a,text:$("map.fromPrice",{price:dt(c,i.currency)}),fontSize:zt,fontStyle:Xt,fontFamily:i.labelFont(),fill:t.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),u.offsetX(u.width()/2),i.bgLayer.add(u)),i.zones.push({id:r.id,anchor:{x:l,y:a},back:h,background:t.plate,name:r.label.toUpperCase(),label:d,sub:u})}}import{Circle as Wl}from"konva/lib/shapes/Circle";import{Line as Vl}from"konva/lib/shapes/Line";import{Rect as Kl}from"konva/lib/shapes/Rect";import{Text as zl}from"konva/lib/shapes/Text";function ke(i,e){return e.length===0?!!i.accessible:!!i.accessibility?.some(t=>e.includes(t))}function Vi(i,e){return ke(i,e)?"match":i.accessibility?.includes("companion")?"companion":"other"}var xs=.35,Cs=.7,pt="#0b1220",ft="#ffffff",Is="#0b1220",Ps="#232c40",Ms="#8b93a7";function Ki(i,e,t="normal"){let o=i?"bold":t;return e?`italic ${o}`.trim():o}var zi="#f7f8fb";import{Shape as Ol}from"konva/lib/Shape";import{Circle as Dl}from"konva/lib/shapes/Circle";import{Rect as Gl}from"konva/lib/shapes/Rect";var Bl={M:2,L:2,Q:4,C:6,Z:0},Xi=new Map;function Yi(i){let e=Xi.get(i);if(e)return e;let t=Dt(i);if(!t)return Xi.set(i,[]),[];let o=t.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],r=[],s=0;for(;s<o.length;){let n=o[s++],l=Bl[n];if(l===void 0||s+l>o.length)throw new Error(`Invalid path data for seat glyph "${i}".`);let a=o.slice(s,s+l).map(Number);if(a.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${i}".`);s+=l,n==="M"||n==="L"?r.push({command:n,points:a}):n==="Q"?r.push({command:n,points:a}):n==="C"?r.push({command:n,points:a}):r.push({command:"Z",points:[]})}return Xi.set(i,r),r}function Rs(i,e,t,o=0,r=0){let s=Yi(e),n=zo(e).bounds;if(!s.length||!n||!(t>0))return!1;let l=Xo(n,t);i.save(),i.translate(o,r),i.scale(l.scale,l.scale),i.translate(-l.centreX,-l.centreY);for(let a of s)a.command==="M"?i.moveTo(a.points[0],a.points[1]):a.command==="L"?i.lineTo(a.points[0],a.points[1]):a.command==="Q"?i.quadraticCurveTo(a.points[0],a.points[1],a.points[2],a.points[3]):a.command==="C"?i.bezierCurveTo(a.points[0],a.points[1],a.points[2],a.points[3],a.points[4],a.points[5]):i.closePath();return i.restore(),!0}function As(i,e){i.beginPath(),i.arc(0,0,e,0,Math.PI*2,!1),i.closePath()}var mt=class extends Ol{_sceneFunc(e){let t=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,r=Yi(o),s=this.attrs.seatGlyphDetail,n;if(s===void 0){let l=this.getAbsoluteScale(),a=Math.max(Math.abs(l.x),Math.abs(l.y)),c=Number.isFinite(a)&&a>0?a:1;n=t*2*c>=16}else n=s;if(!r.length||!n){As(e,t),e.fillStrokeShape(this);return}e.beginPath(),Rs(e,o,t),e.fillStrokeShape(this)}_hitFunc(e){As(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 Hl(i,e){return i==="circle"||!Dt(i)?null:new mt({x:e.x,y:e.y,seatRadius:e.radius,seatGlyph:i,...e.detail===void 0?{}:{seatGlyphDetail:e.detail},...e.fill?{fill:e.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Es(i){let{x:e,y:t,radius:o}=i;return i.wheelchairBay?new Gl({x:e,y:t,width:o*2,height:o*2,offsetX:o,offsetY:o,cornerRadius:2,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):Hl(i.glyph,{x:e,y:t,radius:o,detail:i.detail,fill:i.fill})??new Dl({x:e,y:t,radius:o,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Nl(i,e){return i*2*e>=16}function _s(i,e,t,o){let r=Nl(e,t);if(r===o||!i.length)return r;for(let s of i)s.setAttr("seatGlyphDetail",r);return r}function Fs(i){let e=[...i.seats].sort((t,o)=>(i.perspectiveSeatDepth.get(o.id)??0)-(i.perspectiveSeatDepth.get(t.id)??0));for(let t of e){if(t.kind==="booth"){Xl(i,t);continue}let o=i.seatContainer(t.id),r=Es({x:t.x,y:t.y,radius:i.seatR,detail:i.seatGlyphDetail,glyph:Yo(t.glyph,i.catByKey.get(t.categoryKey)),wheelchairBay:t.wheelchairSpaceType==="no-seat"});if(r instanceof mt&&i.glyphMarkers.push(r),r.setAttr("seatId",t.id),i.circleById.set(t.id,r),i.paintSeat(r,t.id),o.add(r),t.accessible){if(t.wheelchairSpaceType!=="no-seat"){let s=new Wl({x:t.x,y:t.y,radius:i.seatR+1.5,stroke:xt(t.accessibility),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});i.accessRingById.set(t.id,s),o.add(s)}if(t.accessibility?.includes("wheelchair")&&_t(t.accessibility)){let s=i.buildAccessGlyph(t,typeof r.fill()=="string"?r.fill():"");i.accessGlyphById.set(t.id,s),o.add(s)}}}}function Xl(i,e){let t=i.seatContainer(e.id),o=i.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},r=e.x,s=e.y,n;o.points&&o.points.length>=3?(n=new Vl({x:e.x,y:e.y,points:o.points.flatMap(a=>[a.x,a.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),r=e.x+o.points.reduce((a,c)=>a+c.x,0)/o.points.length,s=e.y+o.points.reduce((a,c)=>a+c.y,0)/o.points.length):n=new Kl({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}),n.setAttr("seatId",e.id),i.circleById.set(e.id,n),t.add(n);let l=new zl({x:r,y:s,text:e.displayLabel??e.label,fontSize:Me,fontStyle:"600",fontFamily:i.labelFont(),fill:i.theme.seatLabelColor??pt,listening:!1,perfectDrawEnabled:!1});l.offsetX(l.width()/2),l.offsetY(l.height()/2),l.visible(!1),i.setHasBoothText(),i.boothLabelById.set(e.id,l),t.add(l),i.paintSeat(n,e.id)}function Bs(i,e,t,o){let r=null,s=1/0,n=i.stage.scaleX()||1;for(let l of i.seats){if(!o?.includeUnavailable&&!i.selection.has(l.id)&&!i.isSelectable(l.id))continue;let a=i.worldToScreen(l),c=i.viewMode==="perspective"?i.perspectiveSeatScale.get(l.id)??1:1,h=i.seatR*n*c+t,d=Math.hypot(a.x-e.x,a.y-e.y);d<=h&&d<s&&(s=d,r=l.id)}return r}function Os(i){if(!i.objectFloor.size)return null;let e=i.stage.getPointerPosition();if(!e)return null;let t=i.screenToWorld(e),o=null,r=1/0;for(let s of i.seats){let n=i.renderedSeatPoint(s),l=n.x-t.x,a=n.y-t.y,c=l*l+a*a;c<r&&(r=c,o=s.rowId)}return o?i.objectFloor.get(o)??null:null}import{Circle as ic}from"konva/lib/shapes/Circle";import{Group as Qs}from"konva/lib/Group";import{Rect as oc}from"konva/lib/shapes/Rect";import{Text as rc}from"konva/lib/shapes/Text";var Le=1.12;function Je(i,e,t,o){if(e.width<=0||e.height<=0)return i.scaleX();let r=o??{x:0,y:0,width:i.width(),height:i.height()},s=Math.min(r.width/(e.width*Le),r.height/(e.height*Le));return N(s,t.min,t.max)}function Ds(i){let{stage:e,box:t,bounds:o,viewport:r,centreScreen:s}=i,n=i.ratio??$e,l=e.scaleX(),a=Je(e,t,o,r)/Math.max(l,1e-4);if(a>=n||a<=1/n)return!1;let c=s.x-(r.x+r.width/2),h=s.y-(r.y+r.height/2);return Math.hypot(c,h)<=Math.min(r.width,r.height)*.02}function Gs(i,e,t,o){let r=N(e,o.min,o.max),s=i.scaleX();if(r===s)return!1;let n=(t.x-i.x())/s,l=(t.y-i.y())/s;return i.scale({x:r,y:r}),i.position({x:t.x-n*r,y:t.y-l*r}),!0}function Hs(i,e,t,o,r){let s=r??{x:0,y:0,width:i.width(),height:i.height()},n=Math.min(s.width/(e.width*Le),s.height/(e.height*Le)),l=N(Math.max(n,o??t.min),t.min,t.max);i.scale({x:l,y:l}),i.position({x:s.x+s.width/2-(e.x+e.width/2)*l,y:s.y+s.height/2-(e.y+e.height/2)*l})}function Ns(i,e){return i===null||e===null?i===e:i.size===e.size&&[...i].every(t=>e.has(t))}function Ws(i,e){let t=null;for(let o of i){let r=e.get(o)?.logicalId;if(!r||t!=null&&t!==r)return null;t=r}return t}function Vs(i,e){if(!e?.size)return!1;for(let t of i)if(e.has(t))return!1;return!0}function Ks(i,e){let t=i.sectionHeat.get(e.id)??i.sectionHeat.get(e.logicalId)??(e.zone?i.sectionHeat.get(e.zone):void 0);if(t==null||t<=0){e.outlinePoly.stroke(F(e.outlineTint,.5)),e.outlinePoly.fill(F(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=pe("#f4b740","#ef4444",t);e.outlinePoly.stroke(F(o,.72+t*.25)),e.outlinePoly.fill(F(o,.08+t*.13)),e.outlinePoly.strokeWidth(2+t*3.5),e.outlinePoly.shadowColor(o),e.outlinePoly.shadowBlur(4+t*12),e.outlinePoly.shadowOpacity(.25+t*.45)}function $i(i,e){return i.closedSections.has(e.id)||i.closedSections.has(e.logicalId)||e.zone!=null&&i.closedSections.has(e.zone)}function zs(i,e,t,o){if(!e)return 0;let r=0;for(let s of i){if(t(s)!=="free")continue;let n=o(s);n&&ke(n,e)&&(r+=1)}return r}function Xs(i,e){return $i(i,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Hr?"nearly-gone":"normal"}function Ys(i,e){let t=Xs(i,e),o=i.accessFilterActive&&i.sectionAccessibleFree(e)<=0,r=Ur(i.canvasBackground,t,o?null:e.shellCategoryColor);e.shellFill=r.fill,e.shellStroke=r.stroke,e.blockPoly.fill(r.fill),e.blockPoly.stroke(r.stroke),e.subLabel.text(t==="sold-out"?$("map.soldOut"):$("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function qi(i,e){return pe(e,W(i)?"#ffffff":"#000000",Dr)}function Zi(i,e,t=0){let o=Or-t;return!e||i.length<=o?i:`${i.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function Yl(i,e){return i.accessFilterActive&&i.sectionAccessibleFree(e)>0}function Ul(i,e,t){let o=Yl(i,e),r=Zi(e.label,t,o?2:0),s=o?`\u267F ${r}`:r;e.nameLabel.text()!==s&&e.nameLabel.text(s),e.nameLabel.fontStyle(t?Yt:we),e.nameLabel.letterSpacing(t?e.nameLabel.fontSize()*Be:0)}function $l(i,e,t){let o=i.stageWidth<se,r=e.nameLabel.opacity();if(!o||r<=.05||!e.nameLabel.visible()){e.namePlate.opacity(0),e.subLabel.opacity(0);return}let s=e.nameLabel.rotation(),n=s===0&&Xs(i,e)==="sold-out",l=ct/t,a=$t/t,c=n?2/t:0,h={x:e.nameLabel.x(),y:e.nameLabel.y()},d=e.nameLabel.height(),u=0;n?(He(e.subLabel,ve/t,h.y),u=e.subLabel.height(),e.subLabel.rotation(0),e.subLabel.x(h.x),e.subLabel.y(h.y+d/2+c+u/2),e.subLabel.opacity(r)):e.subLabel.opacity(0);let f=n?c+u:0,y=Math.max(e.nameLabel.width(),n?e.subLabel.width():0)+l*2,m=d+f+a*2;e.namePlate.position({x:h.x,y:h.y+f/2}),e.namePlate.rotation(s),e.namePlate.size({width:y,height:m}),e.namePlate.offset({x:y/2,y:m/2}),e.namePlate.cornerRadius(Gr/t),e.namePlate.opacity(r*Ut)}function Us(i,e){let t,o;i.reducedMotion?(t=e<=be?1:0,o=e<=Xe?1:0):(t=N((Se-e)/(Se-be),0,1),o=N((be-e)/(be-Xe),0,1)),(i.floorOverview||i.focusedSectionId)&&(t=0,o=0);let r=!i.floorOverview&&!i.focusedSectionId&&e<le;r&&(t=1),i.zones.length||(o=0);let s=i.viewMode==="perspective"&&i.glideInProgress&&i.seatCount>2500;i.seatLayer.opacity(r||s?0:1-t);let n=i.stageScaleX,l=!i.glideInProgress&&(i.lodScale===0||Math.abs(e-i.lodScale)/(i.lodScale||1)>.08);l&&i.setLodScale(e);let a=i.focusedSectionId,c=i.stageWidth<se,h=te(i.canvasBackground),d=N((t-.2)/.8,0,1);for(let f of i.sections){let y=i.hasFocusDimOverlay?1:a&&f.id!==a&&f.logicalId!==a&&f.zone!==a?Oe:1,m=Math.min(y,Vs(f.memberCategoryKeys,i.categoryFilter)?Oe:1);f.outlinePoly.opacity(r?0:(1-t)*m),f.blockPoly.opacity(Tr*t*m);let p=i.sectionIsOwned(f);f.blockPoly.stroke(p?i.selectionColor:f.shellStroke||h.sectionStroke),f.blockPoly.strokeWidth((p?xr:Fe)/Math.max(n,1e-4));let g=f.blockPoly.fill(),b=typeof g=="string"?g:f.baseFill,S=c?qi(i.canvasBackground,b):null;S&&f.namePlate.fill(S);let v=U(S??b,f.preferredInk);f.nameLabel.fill(v),f.subLabel.fill(v),Ul(i,f,c),l&&d>.01&&Ql(i,f,n),f.nameLabel.opacity(f.nameLabelFits?d*(1-o)*m:0),f.subLabel.opacity(0)}let u=o*(1-i.isoT);for(let f of i.zones)f.back.opacity(u),f.label.opacity(u),f.sub&&f.sub.opacity(i.stageWidth<se?0:u),l&&Jl(i,f,n);if(!i.glideInProgress&&(d>.01||u>.01)){Zl(i,n),ql(i.sections);for(let f of i.zones){let y=f.label.opacity();f.back.opacity(y),f.sub&&f.sub.opacity(i.stageWidth<se?0:y)}}for(let f of i.sections)$l(i,f,n);i.bgLayer.batchDraw()}function ql(i){let e=new Map;for(let t of i)(e.get(t.logicalId)??e.set(t.logicalId,[]).get(t.logicalId)).push(t);for(let t of e.values()){if(t.length<2)continue;let o=t.filter(r=>r.nameLabel.opacity()>.05).sort((r,s)=>{let n=V(r.outline),l=V(s.outline);return l.width*l.height-n.width*n.height});for(let r of o.slice(1))r.nameLabel.opacity(0)}}function Zl(i,e){let o=[],r=a=>{let c=i.worldToScreen({x:a.x(),y:a.y()}),h=V(Qe({x:0,y:0},a.width()*e,a.height()*e,a.rotation()));return{x:c.x-h.width/2,y:c.y-h.height/2,w:h.width,h:h.height}};for(let a of i.zones){if(a.label.opacity()<=.05)continue;let c=a.back.getAbsolutePosition(),h=a.back.width()*e,d=a.back.height()*e;o.push({node:a.label,tier:0,section:!1,zone:a,box:{x:c.x-h/2,y:c.y-d/2,w:h,h:d}})}for(let a of i.sections)a.nameLabel.opacity()>.05&&o.push({node:a.nameLabel,tier:1,section:!0,area:a.labelArea,box:r(a.nameLabel)});let s=i.landmarks.map(a=>{let c=i.worldToScreen({x:a.x,y:a.y}),h=i.worldToScreen({x:a.x+a.width,y:a.y+a.height});return{x:Math.min(c.x,h.x),y:Math.min(c.y,h.y),w:Math.abs(h.x-c.x),h:Math.abs(h.y-c.y)}});if(o.length<2&&!s.length)return;o.sort((a,c)=>a.tier-c.tier||(c.area??0)-(a.area??0)||a.box.y-c.box.y||a.box.x-c.box.x);let n=[...s],l=a=>n.some(c=>a.x<c.x+c.w+4&&c.x<a.x+a.w+4&&a.y<c.y+c.h+4&&c.y<a.y+a.h+4);for(let a of o){if(!l(a.box)){n.push(a.box);continue}let c=!1;if(a.zone)for(let h of Br){if(h===0)continue;let d={...a.box,y:a.box.y+h};if(!l(d)){Ui(a.zone,0,h/e),n.push(d),c=!0;break}}if(a.section){let h=a.node.fontSize(),d=a.node.y(),u=a.node.letterSpacing()>0;for(let f of Cr){let y=h*f;if(y*e<ve)break;He(a.node,y,d),u&&(a.node.letterSpacing(a.node.fontSize()*Be),a.node.offsetX(a.node.width()/2));let m=r(a.node);if(!l(m)){n.push(m),c=!0;break}}c||(He(a.node,h,d),u&&(a.node.letterSpacing(a.node.fontSize()*Be),a.node.offsetX(a.node.width()/2)))}c||a.node.opacity(0)}}function He(i,e,t){i.fontSize(Math.max(1,e)),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t)}function Ql(i,e,t){e.subLabelFits=!1;let o=i.stageWidth<se,r=o?ct*2:0,s=Ue(Ye*e.labelScale,i.stageWidth),n=ve;for(let l=s;l>=n;l-=1)for(let a of[0,-90]){e.nameLabel.rotation(a),He(e.nameLabel,l/t,e.nameLabel.y()),o&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Be),e.nameLabel.offsetX(e.nameLabel.width()/2));for(let c of e.labelAnchors){e.nameLabel.position(c);let h=(8+r)/t;if(ti(c,e.nameLabel.width()+h,e.nameLabel.height()+h,a,e.outline,e.holes)){e.nameLabelFits=!0;return}}}e.nameLabel.position(e.centroid),e.nameLabel.rotation(0),e.nameLabelFits=!1}function jl(i,e,t){let o=r=>(i.text(r),i.width());if(!(o(e)<=t)){for(let r=e.length-1;r>=1;r-=1)if(o(`${e.slice(0,r).trimEnd()}\u2026`)<=t)return;o("\u2026")}}function Jl(i,e,t){let o=Ai(i.stageWidth),r=e.sub!=null&&i.stageWidth>=se,s=i.stageWidth<se,n=(s?Pr:Rr)*o/t,l=(s?Mr:Ar)*o/t,a=r?3*o/t:0;if(e.label.text(e.name),He(e.label,Ue(Kt,i.stageWidth)/t,e.anchor.y),s){let b=i.stageWidth*Fr/t-n*2;jl(e.label,e.name,Math.max(b,1)),He(e.label,e.label.fontSize(),e.anchor.y)}e.label.x(e.anchor.x),r&&(He(e.sub,Ue(zt,i.stageWidth)/t,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*Ir),e.sub.offsetX(e.sub.width()/2),e.sub.x(e.anchor.x));let c=Math.max(e.label.width(),r?e.sub.width():0)+n*2,h=e.label.height()+(r?a+e.sub.height():0)+l*2;e.label.y(e.anchor.y-(r?(a+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+a)/2),e.back.position(e.anchor),e.back.size({width:c,height:h}),e.back.offset({x:c/2,y:h/2}),e.back.cornerRadius(Er*o/t),e.back.strokeWidth(1/t);let d=e.back.getAbsolutePosition(),u=6,f=c*t;if(f>i.stageWidth-u*2){e.label.opacity(0),e.back.opacity(0),e.sub&&e.sub.opacity(0);return}let y=f/2,p=(N(d.x,u+y,i.stageWidth-u-y)-d.x)/t;Math.abs(p)>.001&&Ui(e,p,0);let g=62+h*t/2;d.y<g&&Ui(e,0,(g-d.y)/t)}function Ui(i,e,t){i.label.x(i.label.x()+e),i.label.y(i.label.y()+t),i.sub&&(i.sub.x(i.sub.x()+e),i.sub.y(i.sub.y()+t)),i.back.x(i.back.x()+e),i.back.y(i.back.y()+t)}function ec(i,e){if(!i.length)return null;let t=1/0,o=1/0,r=-1/0,s=-1/0;for(let n of i)!Number.isFinite(n.x)||!Number.isFinite(n.y)||(n.x<t&&(t=n.x),n.y<o&&(o=n.y),n.x>r&&(r=n.x),n.y>s&&(s=n.y));return!Number.isFinite(t)||!Number.isFinite(o)?null:{x:t-e,y:o-e,width:r-t+e*2,height:s-o+e*2}}function Ji(i,e=0){let t=new Map;for(let r of i){let s=`${r.rowId}|${r.categoryKey}`,n=t.get(s);n||(n={categoryKey:r.categoryKey,points:[]},t.set(s,n)),n.points.push({x:r.x,y:r.y})}let o=[];for(let[r,s]of t){let n=ec(s.points,e);n&&o.push({id:r,categoryKey:s.categoryKey,seatCount:s.points.length,bounds:n})}return o}function Qi(i,e){let t=Math.max(0,Math.max(i.x-(e.x+e.width),e.x-(i.x+i.width))),o=Math.max(0,Math.max(i.y-(e.y+e.height),e.y-(i.y+i.height)));return Math.hypot(t,o)}function ji(i,e){let t=Math.min(i.x,e.x),o=Math.min(i.y,e.y);return{x:t,y:o,width:Math.max(i.x+i.width,e.x+e.width)-t,height:Math.max(i.y+i.height,e.y+e.height)-o}}function $s(i){if(!i.length)return 0;let e=[...i].sort((o,r)=>o-r),t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2}function tc(i){if(!i.length)return 0;let e=$s(i.map(o=>Math.min(o.bounds.width,o.bounds.height)));if(i.length<2)return e;let t=[];for(let o=0;o<i.length;o+=1){let r=1/0;for(let s=0;s<i.length;s+=1)o!==s&&(r=Math.min(r,Qi(i[o].bounds,i[s].bounds)));Number.isFinite(r)&&t.push(r)}return $s(t)+e}function eo(i,e){if(!i.length)return[];let t=tc(i)*(e?.gapRows??2),o=e?.minRows??2,r=e?.minSeats??12,s=new Map;for(let l of i){let a=s.get(l.categoryKey);a?a.push(l):s.set(l.categoryKey,[l])}let n=[];for(let[l,a]of s){let c=[...a].sort((u,f)=>u.bounds.y-f.bounds.y||u.bounds.x-f.bounds.x||u.id.localeCompare(f.id)),h=[];for(let u of c){let f=h.find(y=>Qi(y.bounds,u.bounds)<=t);f?(f.bounds=ji(f.bounds,u.bounds),f.rowIds.push(u.id),f.seatCount+=u.seatCount):h.push({categoryKey:l,bounds:{...u.bounds},rowIds:[u.id],seatCount:u.seatCount})}let d=!0;for(;d&&h.length>1;){d=!1;e:for(let u=0;u<h.length;u+=1)for(let f=u+1;f<h.length;f+=1)if(!(Qi(h[u].bounds,h[f].bounds)>t)){h[u].bounds=ji(h[u].bounds,h[f].bounds),h[u].rowIds.push(...h[f].rowIds),h[u].seatCount+=h[f].seatCount,h.splice(f,1),d=!0;break e}}for(let u of h)u.rowIds.length<o&&u.seatCount<r||(u.rowIds.sort(),n.push(u))}return n.sort((l,a)=>l.bounds.y-a.bounds.y||l.bounds.x-a.bounds.x||l.categoryKey.localeCompare(a.categoryKey)),n}function qs(i){let e=null;for(let t of i)e=e?ji(e,t.bounds):{...t.bounds};return e}function Zs(i,e){let t=null,o=1/0;for(let r of i){let{x:s,y:n,width:l,height:a}=r.bounds;if(e.x<s||e.x>s+l||e.y<n||e.y>n+a)continue;let c=l*a;c<o&&(t=r,o=c)}return t}function en(i){return i*.3}function js(i){return en(i)*2+i*.42}var ii=class{constructor(e){this.host=e;this.group=null;this.labels=[];this.revealed=!1;this.visible=!1;this.fadeRaf=0;this.lastFontKey=""}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.syncCursor(!1),this.host.hasSections()||this.host.exportMode)return;let e=eo(Ji(this.host.seats(),this.host.seatR()));if(!e.length)return;let t=this.host.canvasBackground(),o=te(t),r=qi(t,t),s=U(r,o.sectionInk),n=new Qs({listening:!1,opacity:0,visible:!1});for(let l of e){let a=this.host.categoryLabel(l.categoryKey);if(!a)continue;let c={x:l.bounds.x+l.bounds.width/2,y:l.bounds.y+l.bounds.height/2},h=new Qs({listening:!1}),d=new oc({...c,width:0,height:0,fill:r,stroke:o.sectionStroke,strokeWidth:Fe,opacity:Ut,listening:!1,perfectDrawEnabled:!1}),u=new ic({...c,radius:0,fill:this.host.categoryColor(l.categoryKey),listening:!1,perfectDrawEnabled:!1}),f=this.host.categoryPriceLabel(l.categoryKey),y=new rc({...c,text:a,fontSize:Ye,fontStyle:we,fontFamily:this.host.labelFont(),fill:s,listening:!1,perfectDrawEnabled:!1});h.add(d),h.add(u),h.add(y),n.add(h),this.labels.push({cluster:l,pill:h,plate:d,swatch:u,text:y,label:a,price:f})}if(!this.labels.length){n.destroy();return}this.group=n,this.host.labelLayer.add(n)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let t=this.host.seatR()*2,o=this.host.exportMode||this.host.viewMode()!=="flat"||this.host.seatsPickable()&&e<_e;return this.revealed=o||pr(Pi(t,e),Pi(t,_e),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 t=this.clusterAt(this.host.screenToWorld(e));if(!t)return!1;let o=this.host.seatR()*2,r={x:t.bounds.x-o,y:t.bounds.y-o,width:t.bounds.width+o*2,height:t.bounds.height+o*2},s=this.host.stage;if(Je(s,r,this.host.zoomBounds(),this.host.framingViewport())<=s.scaleX()*$e)return!1;let l=this.diveTarget(r);return l?(this.host.focusRegion(l,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,t){let o=this.host.stage,r=this.host.framingViewport(),s=this.host.zoomBounds(),n=Je(o,e,s,r),l=Math.min(this.host.readableScale(),s.max);if(n>=l)return e;let a=r.width/(l*Le),c=r.height/(l*Le);if(!(a>0)||!(c>0))return null;let h=t??{x:e.x+e.width/2,y:e.y+e.height/2};return{x:h.x-a/2,y:h.y-c/2,width:a,height:c}}glideTowardTap(e){if(this.host.viewMode()!=="flat")return!1;let t=this.host.stage.scaleX(),o=Nr(t,this.host.pickableScale());if(o==null||o<=t*$e)return!1;let r=this.host.screenToWorld(e),s=this.host.framingViewport(),n=s.width/(o*Le),l=s.height/(o*Le);return!(n>0)||!(l>0)?!1:(this.host.focusRegion({x:r.x-n/2,y:r.y-l/2,width:n,height:l}),!0)}syncCursor(e){if(this.host.exportMode)return;let t=this.host.viewMode()==="flat"&&!this.host.seatsPickable()?"zoom-in":e?"pointer":"default";for(let o of[this.host.stage.container(),this.host.stage.content])o&&o.style.cursor!==t&&(o.style.cursor=t)}clusterAt(e){let t=Zs(this.all,e);if(t)return t;if(!this.visible)return null;for(let o of this.labels){let r=o.plate.width()/2,s=o.plate.height()/2;if(Math.abs(e.x-o.text.x())<=r&&Math.abs(e.y-o.text.y())<=s)return o.cluster}return null}size(e,t){let o=Math.max(e,1e-4),r=t<se,s=`${o.toFixed(4)}|${t}`;if(s===this.lastFontKey)return!1;this.lastFontKey=s;let n=Ue(Ye,t),l=ct/o,a=$t/o;for(let c of this.labels){let{text:h,plate:d,swatch:u,cluster:f}=c,y=Zi(c.label,r);h.text(c.price?`${y} \xB7 ${c.price}`:y),h.fontStyle(r?Yt:we);let m=n,p=0;for(;h.fontSize(Math.max(1,m/o)),h.letterSpacing(h.fontSize()*Be),p=js(h.fontSize())+h.width()+l*2,!(p<=f.bounds.width||m<=ve);)m=Math.max(ve,m-1);let g={x:f.bounds.x+f.bounds.width/2,y:f.bounds.y+f.bounds.height/2},b=h.height()+a*2,S=p-l*2,v=g.x-S/2;u.radius(en(h.fontSize())),u.position({x:v+u.radius(),y:g.y}),h.offsetX(0),h.offsetY(h.height()/2),h.position({x:v+js(h.fontSize()),y:g.y}),d.size({width:p,height:b}),d.offset({x:p/2,y:b/2}),d.cornerRadius(b/2),d.strokeWidth(Fe/o),d.position(g)}return!0}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),t=!1;for(let o of this.labels){let r=e&&!e.has(o.cluster.categoryKey)?.22:1;o.pill.opacity()!==r&&(o.pill.opacity(r),t=!0)}t&&this.host.labelLayer.batchDraw()}boundsForSeats(e,t){if(!e.length)return null;let o=Ji(e,this.host.seatR()),r=eo(o);r.length||(r=o.map(l=>({categoryKey:l.categoryKey,bounds:l.bounds,rowIds:[l.id],seatCount:l.seatCount})));let s=qs(r);if(!s)return null;let n=r.reduce((l,a)=>a.seatCount>l.seatCount?a:l,r[0]);return{bounds:{x:s.x-t,y:s.y-t,width:s.width+t*2,height:s.height+t*2},anchor:{x:n.bounds.x+n.bounds.width/2,y:n.bounds.y+n.bounds.height/2}}}applyVisibility(e){let t=this.group;if(!t||e===this.visible)return;if(this.visible=e,this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),t.visible(!0),this.host.reducedMotion()){t.opacity(e?1:0),t.visible(e),this.host.labelLayer.batchDraw();return}let o=t.opacity(),r=e?1:0,s=performance.now(),n=l=>{if(this.host.destroyed()||!this.group){this.fadeRaf=0;return}let a=Math.min(1,(l-s)/150);t.opacity(o+(r-o)*a),a>=1&&t.visible(r>0),this.host.labelLayer.batchDraw(),this.fadeRaf=a<1?requestAnimationFrame(n):0};this.fadeRaf=requestAnimationFrame(n)}};import{Circle as sc}from"konva/lib/shapes/Circle";import{Line as nc}from"konva/lib/shapes/Line";function tn(i,e,t,o){let r=i.seatRadius(),s=new sc({x:t.x,y:t.y,radius:r,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),n=i.viewMode()==="perspective"?i.perspectiveSeatScale(e):1;s.scale({x:n,y:n}),i.overlayLayer.add(s);let l=performance.now(),a=620,c=h=>{if(!s.getLayer())return;let d=Math.min(1,(h-l)/a);s.radius(r*(1+d*1.8)),s.opacity(.9*(1-d)),i.overlayLayer.batchDraw(),d<1?requestAnimationFrame(c):(s.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(c)}function on(i,e,t){for(let o of e){let r=i.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(d=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,d))):o.outline.map(d=>{let u=o.liftWorld>0?i.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:d.x+u.x,y:d.y+u.y}}),s=r.reduce((d,u)=>({x:d.x+u.x,y:d.y+u.y}),{x:0,y:0});s.x/=r.length,s.y/=r.length;let n=new nc({x:s.x,y:s.y,points:r.flatMap(d=>[d.x-s.x,d.y-s.y]),closed:!0,stroke:t,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:t,shadowBlur:14,shadowOpacity:.7});i.overlayLayer.add(n),i.overlayLayer.batchDraw();let l=()=>{n.getLayer()&&(n.destroy(),i.overlayLayer.batchDraw())};if(i.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(l,520);continue}let a=performance.now(),c=820,h=d=>{if(i.isDestroyed()||!n.getLayer())return;let u=Math.min(1,(d-a)/c),y=1+(1-Math.pow(1-u,3))*.04;n.scale({x:y,y}),n.opacity(.92*(1-u)),i.overlayLayer.batchDraw(),u<1?requestAnimationFrame(h):l()};requestAnimationFrame(h)}}import{Group as hc}from"konva/lib/Group";import{Shape as dc}from"konva/lib/Shape";import{Group as ac}from"konva/lib/Group";import{Shape as lc}from"konva/lib/Shape";function cc(i,e,t){let o=e.length,r={x:(e[o-1].x+e[0].x)/2,y:(e[o-1].y+e[0].y)/2};i.moveTo(r.x,r.y);for(let s=0;s<o;s+=1){let n=e[s],l=e[(s+1)%o],a=e[(s-1+o)%o],c=Math.min(Math.hypot(n.x-a.x,n.y-a.y)/2,Math.hypot(l.x-n.x,l.y-n.y)/2);i.arcTo(n.x,n.y,l.x,l.y,Math.max(0,Math.min(t,c)))}i.closePath()}function Ne(i,e,t,o){let r=rt(i)>0,s=t.cornerRadius&&t.cornerRadius>0?t.cornerRadius:0;return new lc({...t,sceneFunc(n,l){n.beginPath();let a=h=>{if(h.length){if(s>0&&h.length>=3)return cc(n,h,s);n.moveTo(h[0].x,h[0].y);for(let d=1;d<h.length;d+=1)n.lineTo(h[d].x,h[d].y);n.closePath()}};o?(h=>{n.moveTo(h.start.x,h.start.y);let d=h.start;for(let u of h.segments)u.kind==="line"?n.lineTo(u.end.x,u.end.y):u.kind==="arc"?n.arc(u.center.x,u.center.y,u.radius,Math.atan2(d.y-u.center.y,d.x-u.center.x),Math.atan2(u.end.y-u.center.y,u.end.x-u.center.x),!u.clockwise):n.bezierCurveTo(u.control1.x,u.control1.y,u.control2.x,u.control2.y,u.end.x,u.end.y),d=u.end;n.closePath()})(o):a(i);for(let h of e??[]){let d=rt(h)>0;a(d===r?[...h].reverse():h)}n.fillStrokeShape(l)},perfectDrawEnabled:!1})}var yt=class extends ac{constructor(){super(...arguments);this.viewportCulled=!1}setViewportCulled(t){t!==this.viewportCulled&&(this.viewportCulled=t,t||super._clearSelfAndDescendantCache())}isViewportCulled(){return this.viewportCulled}drawScene(...t){return this.viewportCulled?this:super.drawScene(...t)}drawHit(...t){return this.viewportCulled?this:super.drawHit(...t)}_clearSelfAndDescendantCache(t){if(!this.viewportCulled){super._clearSelfAndDescendantCache(t);return}this._clearCache(t)}};function rn(i,e){if(!e.length)return null;let t=new hc({listening:!1});for(let o of e){let r=i.viewMode==="perspective"&&o.perspectiveAffine,s=r?o.outline.map(l=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,l))):o.outline,n=r?o.holes.map(l=>l.map(a=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,a)))):o.holes;t.add(Ne(s,n,{fill:Kr,stroke:F("#ffffff",.1),strokeWidth:1,listening:!1},r?void 0:o.outlinePath))}return i.bgLayer.add(t),t.moveToTop(),t}function sn(i,e){let{bounds:t}=i,r=Math.max(t.width,t.height,1)*4+1e3,s=[{x:t.x-r,y:t.y-r},{x:t.x+t.width+r,y:t.y-r},{x:t.x+t.width+r,y:t.y+t.height+r},{x:t.x-r,y:t.y+t.height+r}],n=new dc({fill:i.canvasBackground,opacity:1-Oe,listening:!1,perfectDrawEnabled:!1,sceneFunc:(l,a)=>{let c=h=>{if(h.length){l.moveTo(h[0].x,h[0].y);for(let d=1;d<h.length;d++)l.lineTo(h[d].x,h[d].y);l.closePath()}};l.beginPath(),c(s);for(let h of e){let d=i.viewMode==="perspective"&&h.perspectiveAffine?h.outline.map(u=>i.perspectiveLocalPoint(i.projectedSectionPoint(h,u))):h.outline.map(u=>{let f=h.liftWorld>0?i.isoLiftLocal(h.liftWorld):{x:0,y:0};return{x:u.x+f.x,y:u.y+f.y}});c(rt(d)>0?[...d].reverse():d)}l.fillStrokeShape(a)}});return i.overlayLayer.add(n),n.moveToTop(),n}import{Rect as ma}from"konva/lib/shapes/Rect";import{Line as rh}from"konva/lib/shapes/Line";import{Text as ya}from"konva/lib/shapes/Text";import{Path as sh}from"konva/lib/shapes/Path";import{Text as uc}from"konva/lib/shapes/Text";function nn(i){let e=Me,t=new uc({fontSize:fe,fontStyle:"600",fontFamily:i.labelFont(),listening:!1}),o=i.seatR*2-3;for(let r of i.seats){if(r.kind==="booth"){e=Math.min(e,Me);continue}let s=fe*i.seatLabelScale(r);t.fontSize(s),t.text(Ft(r.displayLabel??r.label));let n=t.width()>o?Math.max(nt,s*o/t.width()):s;e=Math.min(e,n)}return t.destroy(),G/Math.max(nt,e)}var to={top:0,right:0,bottom:0,left:0};function an(i){let e=t=>typeof t=="number"&&Number.isFinite(t)&&t>0?t:0;return i?{top:e(i.top),right:e(i.right),bottom:e(i.bottom),left:e(i.left)}:{...to}}var pc=.7;function ln(i,e,t){let{top:o,right:r,bottom:s,left:n}=t,l=(u,f,y)=>{let m=u+f,p=y*pc;if(m<=p||m<=0)return[u,f];let g=p/m;return[u*g,f*g]},[a,c]=l(n,r,i),[h,d]=l(o,s,e);return{x:a,y:h,width:Math.max(1,i-a-c),height:Math.max(1,e-h-d)}}function cn(i){return{x:i.x(),y:i.y(),scale:i.scaleX()}}function hn(i,e){return!Number.isFinite(e.x)||!Number.isFinite(e.y)||!(e.scale>0)?!1:(i.scale({x:e.scale,y:e.scale}),i.position({x:e.x,y:e.y}),!0)}function oi(i){return{x:i.x+i.width/2,y:i.y+i.height/2}}function dn(i,e){let t=e({x:i.x,y:i.y}),o=e({x:i.x+i.width,y:i.y+i.height});return{x:Math.min(t.x,o.x),y:Math.min(t.y,o.y),width:Math.abs(o.x-t.x),height:Math.abs(o.y-t.y)}}function pn(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?Lr:kr}function fn(i){return Math.max(i*1.05,yr,le*1.3)}function io(i,e){let t=1/0,o=-1/0,r=1/0,s=-1/0;for(let n of i)t=Math.min(t,n.x),o=Math.max(o,n.x),r=Math.min(r,n.y),s=Math.max(s,n.y);return t-=e,o+=e,r-=e,s+=e,{x:t,y:r,width:Math.max(40,o-t),height:Math.max(40,s-r)}}function mn(i){let{stageWidth:e,stageHeight:t,fullBounds:o,visibleBounds:r,seatPoints:s,minScale:n}=i;if(!s.length)return null;let l=1.12;if(Math.min(e/(o.width*l),t/(o.height*l))>=n)return null;let c=i.tapAnchor??{x:r.x+r.width/2,y:r.y+r.height/2},h=s[0],d=1/0;for(let m of s){let p=(m.x-c.x)**2+(m.y-c.y)**2;p<d&&(h=m,d=p)}let u=e/(n*l),f=t/(n*l),y=io(s,0);return{bounds:{x:un(h.x,u,y.x,y.width),y:un(h.y,f,y.y,y.height),width:u,height:f},minScale:n}}function un(i,e,t,o){return o<=e?t+o/2-e/2:Math.min(Math.max(i-e/2,t),t+o-e)}var vn=.5,H=Math.SQRT1_2,fc="#f3f4f6",yn=4;function mc(i){let e=i.fraction;return typeof e!="number"||!Number.isFinite(e)?vn:Math.min(1,Math.max(0,e))}function yc(i){return i==="booked"||i==="not_for_sale"?ht:qt}function gn(i,e){return Number.parseInt(i.slice(e,e+2),16)}function bn(i){let e=i.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,t,o,r]=e.toLowerCase();return`#${t}${t}${o}${o}${r}${r}`}function gc(i,e,t){let o=bn(i),r=bn(e);if(!o||!r)return i;let s=Math.min(1,Math.max(0,t)),n="#";for(let l=1;l<7;l+=2){let a=Math.round(gn(o,l)*(1-s)+gn(r,l)*s);n+=a.toString(16).padStart(2,"0")}return n}function Sn(i,e,t,o){let r=t*4,s=e*H,n=-e*H,l=o*H*2*r,a=o*-H*2*r,c=s+r*H,h=n+r*H,d=s-r*H,u=n-r*H;i.beginPath(),i.moveTo(c,h),i.lineTo(d,u),i.lineTo(d+l,u+a),i.lineTo(c+l,h+a),i.closePath(),i.clip()}function bc(i,e){let t=e*4,o=Math.max(e*.45,1);i.beginPath();for(let r=-yn;r<=yn;r++){let s=r*o*2,n=s+o,l=s*H,a=-s*H,c=n*H,h=-n*H;i.moveTo(l+t*H,a+t*H),i.lineTo(l-t*H,a-t*H),i.lineTo(c-t*H,h-t*H),i.lineTo(c+t*H,h+t*H),i.closePath()}i.clip()}function ri(i,e){i._sceneFunc(e)}function wn(i){let e=this,t=e.attrs,o=t.markRadius||1,r=t.fill,s=e.getStage(),n=Math.abs((s?s.scaleX():1)*(e.scaleX()||1))||1;if(o*2*n<16){t.fill=t.markMidtone??r,ri(e,i),t.fill=r;return}let a=(1-2*(t.markFraction??vn))*o;i.save(),Sn(i,a,o,1),t.fill=t.markBase??r,ri(e,i),i.restore(),i.save(),Sn(i,a,o,-1),t.fill=t.markFill??r,ri(e,i),t.markHatch&&(bc(i,o),t.fill=fc,ri(e,i)),i.restore(),t.fill=r}function Sc(i,e,t,o,r,s){let n=mc(e),l=yc(t),a=i.attrs;a.markFraction=n,a.markBase=o,a.markFill=l,a.markMidtone=gc(o,l,1-n),a.markHatch=s,a.markRadius=r>0?r:1,i.fill(a.markMidtone),i.stroke(""),i.strokeWidth(0),i.dash([]),i.opacity(1),i.sceneFunc(wn)}function vc(i){i.setAttr("sceneFunc",void 0)}function oo(i){return i.attrs.sceneFunc===wn}var si=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,t){let o=new Set;for(let[r,s]of Object.entries(e))t.has(r)&&(s&&s.kind==="partial"?(this.marks.set(r,s),o.add(r)):this.marks.delete(r)&&o.add(r));return o}paint(e,t,o,r,s,n,l){let a=l?void 0:this.marks.get(t);if(!a){oo(e)&&vc(e);return}Sc(e,a,o,r,s,n)}};function ni(i){let e=i.getClientRect({skipTransform:!0,skipShadow:!0});!Number.isFinite(e.width)||!Number.isFinite(e.height)||(i.offsetX(e.x+e.width/2),i.offsetY(e.y+e.height/2))}var kn=.85,wc=[2,2],kc=1,Ln=.6;function Lc(i){return W(i)?"#334155":"#e2e8f0"}function Tn(i,e,t){return i==="held"?{fill:qt,stroke:Lc(e),strokeWidth:kc,dash:[...wc],opacity:1,scale:1}:i==="booked"||i==="not_for_sale"?t?{fill:"rgba(0,0,0,0)",stroke:ht,strokeWidth:1.5,dash:[],opacity:.9,scale:kn}:{fill:ht,stroke:"",strokeWidth:0,dash:[],opacity:i==="booked"?.45:.6,scale:kn}:null}var ro=1e6;function Tc(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}var ai=class{constructor(e,t=Tc()){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.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||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 t=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,t)&&this.applyPointerMove(t)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId)};this.onTouchStart=e=>{e.preventDefault();for(let t=0;t<e.changedTouches.length;t+=1){let o=e.changedTouches.item(t);o&&this.beginPointer(ro+o.identifier,this.toLocal(o.clientX,o.clientY),"touch",0)}};this.onTouchMove=e=>{e.preventDefault();let t=null;for(let o=0;o<e.changedTouches.length;o+=1){let r=e.changedTouches.item(o);if(!r)continue;let s=this.toLocal(r.clientX,r.clientY);this.updatePointer(ro+r.identifier,s)&&(t=s)}t&&this.applyPointerMove(t)};this.onTouchEnd=e=>{e.preventDefault();for(let t=0;t<e.changedTouches.length;t+=1){let o=e.changedTouches.item(t);o&&this.endPointer(ro+o.identifier)}};this.host=e,this.useWebKitTouchEvents=t}get moved(){return this.movedPx}attach(){let{container:e}=this.host;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;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<gr}toLocal(e,t){let o=this.host.container.getBoundingClientRect();return{x:e-o.left,y:t-o.top}}beginPointer(e,t,o,r){if(this.host.cancelGlide(),this.pointers.set(e,t),this.pointers.size===1)this.movedPx=0,this.singleTouch=o==="touch",this.singleTouch&&this.host.touchProbeStart?.(t),this.pinch=null,this.panStart=t,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:o,button:r})?(this.host.beginMarquee(t),this.panLast=null):this.panLast=t;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[s,n]=[...this.pointers.values()],l={x:(s.x+n.x)/2,y:(s.y+n.y)/2},a=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(n.x-s.x,n.y-s.y),startScale:a,worldMid:{x:(l.x-this.host.stage.x())/a,y:(l.y-this.host.stage.y())/a}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=Ce+1}}updatePointer(e,t){return this.pointers.has(e)?(this.pointers.set(e,t),this.pointers.size===1&&this.panStart?this.movedPx=Math.max(this.movedPx,Math.hypot(t.x-this.panStart.x,t.y-this.panStart.y)):this.pointers.size>=2&&(this.movedPx=Ce+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>Ce?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[t,o]=[...this.pointers.values()],r=Math.hypot(o.x-t.x,o.y-t.y);if(this.pinch.startDist<1)return;let s={x:(t.x+o.x)/2,y:(t.y+o.y)/2},{min:n,max:l}=this.host.zoomBounds(),a=N(this.pinch.startScale*(r/this.pinch.startDist),n,l);this.host.stage.scale({x:a,y:a}),this.host.stage.position({x:s.x-this.pinch.worldMid.x*a,y:s.y-this.pinch.worldMid.y*a}),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=Ce)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}this.host.stage.position({x:this.host.stage.x()+(e.x-this.panLast.x),y:this.host.stage.y()+(e.y-this.panLast.y)}),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 xc}from"konva/lib/shapes/Circle";import{Group as Cc}from"konva/lib/Group";import{Text as Ic}from"konva/lib/shapes/Text";var xn=13,Pc=15,Mc=.3,Rc=.08;function Mn(i,e,t){return!!(i&&t!==i||e&&!e.has(t))}function Ac(i,e){return!e||i.available==null?`cap ${i.capacity}`:i.available<=0?$("map.soldOut"):$("map.seatsLeft",{count:i.available})}function Ec(i,e){return e&&i.available!=null&&i.available<=0}function Rn(i){for(let e of i.gaById.values()){let t=i.filteredOut(e.categoryKey),o=i.overviewHidden(e),r=Ec(e,i.pickerMode),s=i.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:i.dimmed(e.categoryKey)?Re*Rc:r?Re*Mc:Re),e.polygon.listening(!i.exportMode&&!o&&!t&&!r),e.polygon.stroke(s>0?i.selectionColor:e.strokeColor),e.polygon.strokeWidth(s>0?3:1.5),_c(i,e,r,s,o,i.dimmed(e.categoryKey))}}function _c(i,e,t,o,r,s){if(e.capacityNode){let n=Ac(e,i.pickerMode);e.capacityNode.text()!==n&&(e.capacityNode.text(n),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(t?.75:1)}Fc(i,e,r||s),o>0&&!r?Oc(i,e,o):e.chip&&e.chip.visible(!1)}var so=9,Cn=.86;function Fc(i,e,t){let{labelNode:o,capacityNode:r}=e;if(!o&&!r)return;let s=Math.max(i.effScale(),1e-4);if(t){o?.visible(!1),r?.visible(!1);return}if(!i.pickerMode){o?.visible(i.labelLegible(o.fontSize())),r?.visible(i.labelLegible(r.fontSize()));return}let n=Bc(e,s),l=In(o,At,n.width*Cn,s),a=In(r,Et,n.width*Cn,s),c=l!=null,h=a!=null&&c&&l+a+so<=n.height;Pn(o,c?l:null,e.labelPoint.y-so/s,s),Pn(r,h?a:null,e.labelPoint.y+so/s,s)}function Bc(i,e){let t=1/0,o=-1/0,r=1/0,s=-1/0;for(let n of i.points)n.x<t&&(t=n.x),n.x>o&&(o=n.x),n.y<r&&(r=n.y),n.y>s&&(s=n.y);return Number.isFinite(t)?{width:(o-t)*e,height:(s-r)*e}:{width:0,height:0}}function In(i,e,t,o){if(!i||!i.text())return null;i.fontSize(e/o);let r=i.width()*o;if(r<=t||r<=0)return e;let s=e*(t/r);return s>=G?s:null}function Pn(i,e,t,o){if(i){if(e==null){i.visible(!1);return}i.fontSize(e/o),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t),i.visible(!0)}}function Oc(i,e,t){if(!e.chip){let o=new Cc({x:e.labelPoint.x,y:e.labelPoint.y-xn-16,listening:!1}),r=new xc({radius:xn,fill:i.selectionColor,listening:!1,perfectDrawEnabled:!1}),s=new Ic({text:String(t),fontSize:Pc,fontStyle:"800",fontFamily:i.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});o.add(r),o.add(s),i.bgLayer.add(o),e.chip=o,e.chipText=s}e.chipText&&e.chipText.text()!==String(t)&&e.chipText.text(String(t)),e.chipText&&(e.chipText.offsetX(e.chipText.width()/2),e.chipText.offsetY(e.chipText.height()/2)),e.chip.visible(!0),e.chip.moveToTop()}function An(i,e){let t=!1;for(let[o,r]of Object.entries(e)){let s=i.get(o);s&&(r.available!==void 0&&s.available!==r.available&&(s.available=r.available,t=!0),r.selected!==void 0&&s.selected!==r.selected&&(s.selected=r.selected,t=!0))}return t}import{Rect as En}from"konva/lib/shapes/Rect";import{Text as Dc}from"konva/lib/shapes/Text";function _n(i){let e=i.effScale(),t=i.stage.scaleX(),o={width:i.stage.width(),height:i.stage.height()},r=m=>Math.round(m*100)/100,s=new Map(i.overlayLayer.find(".selection-ring").map(m=>[String(m.getAttr("seatId")??""),String(m.getAttr("ringColor")??i.effSelection)])),n=i.seats.map(m=>{let p=i.circleById.get(m.id),g=i.boothLabelById.get(m.id)??i.seatLabelById.get(m.id),b=i.viewMode==="perspective"?i.perspectiveSeatScale.get(m.id)??1:1,S=(i.viewMode==="perspective"?t:e)*b,v=m.kind==="booth"?Me:fe*i.seatLabelScale(m),w=i.viewMode==="perspective"&&m.kind!=="booth"?e*b:S,k=r((g?.fontSize()??v)*w),L=i.worldToScreen(m),x=g?g.width()*t*b:0,T=g?g.height()*(i.viewMode==="perspective"&&m.kind==="booth"?t:e)*b:0,I=L.x-x/2<0||L.x+x/2>o.width||L.y-T/2<0||L.y+T/2>o.height,P=i.focusedSeatOpacity(m.id,p?.getAbsoluteOpacity()??0),M=i.seatSection.get(m.id),R=!!g?.isVisible()&&P>=.5&&!I,C;R||(P<.5?C="dimmed-or-unavailable":k<G?C="below-minimum-size":I?C="outside-viewport":g?C="renderer-hidden":C=i.seatLabelDrops.get(m.id)??(i.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let A=p instanceof En?p.width()*t*b:i.seatR*2*S,_=p instanceof En?p.height()*(i.viewMode==="perspective"?t:e)*b:i.seatR*2*S,j=2*(i.seatR*S+Ee),z=p?.fill(),X=g?.fill(),J=i.accessGlyphById.get(m.id),O=J?.getAbsoluteScale();return{seatId:m.id,label:m.label,kind:m.kind==="booth"?"booth":"seat",markerShape:m.kind==="booth"?"booth":m.wheelchairSpaceType==="no-seat"?"square":"circle",...m.wheelchairSpaceType?{wheelchairSpaceType:m.wheelchairSpaceType}:{},categoryKey:m.categoryKey,...M?{sectionId:M.id}:{},...M?.zone?{zoneId:M.zone}:{},status:i.statusById.get(m.id)??"free",selected:i.selection.has(m.id),visible:R,renderedFontPx:k,fill:typeof z=="string"?z:"",ink:typeof X=="string"?X:p?i.seatLabelInk(m,p):i.seatPreferredLabelInk(m),...s.has(m.id)?{selectionRingColor:s.get(m.id)}:{},opacity:r(P),...J?{accessibilityMarker:{glyphVisible:J.isVisible(),glyphWidthPx:r(xe*Math.abs(O?.x??0)),emphasizedByFilter:i.accessGlyphFilterEmphasized(m.id)}}:{},pointerTarget:{active:!i.cached&&!i.seatViewportCulled(m.id)&&!!p?.isVisible()&&!!p?.isListening()&&i.isSelectable(m.id),directWidthPx:r(A),directHeightPx:r(_),effectiveMinimumPx:r(Math.max(Math.min(A,_),j))},screenCenter:{x:r(L.x),y:r(L.y)},...R?{screenBox:{x:r(L.x-x/2),y:r(L.y-T/2),width:r(x),height:r(T)}}:{},...C?{hiddenReason:C}:{}}}),l=n.filter(m=>m.visible).length,a=(m,p,g,b,S,v)=>{let w=Qe({x:b.x(),y:b.y()},b.width(),b.height(),b.rotation()),k=v&&v.liftWorld>0?i.isoLiftLocal(v.liftWorld):{x:0,y:0},L=V(w.map(R=>i.worldToScreen({x:R.x+k.x,y:R.y+k.y}))),x=r(b.opacity()),T=b.fill(),I=L.x+L.width<0||L.x>o.width||L.y+L.height<0||L.y>o.height,P=b.isVisible()&&x>.05&&!I,M=v?ti({x:b.x(),y:b.y()},b.width(),b.height(),b.rotation(),v.outline,v.holes):void 0;return{id:m,kind:p,role:g,label:b.text(),visible:P,renderedFontPx:r(b.fontSize()*t),opacity:x,fill:S,ink:typeof T=="string"?T:"",...M==null?{}:{fitsContainer:M},...P?{screenBox:{x:r(L.x),y:r(L.y),width:r(L.width),height:r(L.height)}}:{}}},c=m=>{let p=m.namePlate.fill();if(m.namePlate.opacity()>.05&&typeof p=="string"&&p)return p;let g=m.blockPoly.fill();return typeof g=="string"?g:m.baseFill},h=[...i.sections.map(m=>a(m.id,"section","name",m.nameLabel,c(m),m)),...i.sections.map(m=>a(`${m.id}:availability`,"section","availability",m.subLabel,c(m),m)),...i.zones.flatMap(m=>[a(m.id,"zone","name",m.label,m.background),...m.sub?[a(`${m.id}:price`,"zone","price",m.sub,m.background)]:[]])],d=[...i.gaById].map(([m,p])=>{let g=p.points.map(I=>i.worldToScreen(I)),b=Math.min(...g.map(I=>I.x)),S=Math.min(...g.map(I=>I.y)),v=Math.max(...g.map(I=>I.x)),w=Math.max(...g.map(I=>I.y)),k=v<0||b>o.width||w<0||S>o.height,L=r(p.polygon.opacity()),x=L>=.1&&!k,T=p.polygon.fill();return{areaId:m,label:p.label,capacity:p.capacity,categoryKey:p.categoryKey,...p.sectionId?{sectionId:p.sectionId}:{},visible:x,interactive:p.polygon.listening(),opacity:L,fill:typeof T=="string"?T:"",effectiveBackground:p.effectiveBackground,...x?{screenBox:{x:r(b),y:r(S),width:r(v-b),height:r(w-S)}}:{}}}),u=[...i.freeTextById].map(([m,p])=>{let{node:g,background:b,kind:S}=p,v=i.worldToScreen({x:g.x(),y:g.y()}),w=g.width()*t,k=g.height()*e,L=v.x-g.offsetX()*t,x=v.y-g.offsetY()*e,T=r(g.fontSize()*e),I=L+w<0||L>o.width||x+k<0||x>o.height,P=g.isVisible()&&!I,M=g.fill(),R=r(g.getAbsoluteOpacity()),C;return P||(T<G?C="below-minimum-size":I?C="outside-viewport":C="renderer-hidden"),{objectId:p.objectId??m,kind:S,text:g.text(),visible:P,renderedFontPx:T,ink:typeof M=="string"?M:"",background:b,opacity:R,...P?{screenBox:{x:r(L),y:r(x),width:r(w),height:r(k)}}:{},...C?{hiddenReason:C}:{}}}),f=i.labelGroup.find(m=>m.getAttr("rowLabel")===!0).filter(m=>m instanceof Dc).map(m=>{let p=m.getClientRect({skipShadow:!0,skipStroke:!0}),g=p.x+p.width<0||p.x>o.width||p.y+p.height<0||p.y>o.height,b=m.fill();return{text:m.text(),visible:m.isVisible()&&!g,renderedFontPx:r(m.fontSize()*e),ink:typeof b=="string"?b:"",...g?{}:{screenBox:{x:r(p.x),y:r(p.y),width:r(p.width),height:r(p.height)}}}}),y=i.sections.filter(m=>m.blockPoly.opacity()>.05);return{viewport:o,projection:i.viewMode,...i.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:i.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:i.canvasBackground,effectiveScale:r(e),rung:i.getRung(),minimumVisibleLabelPx:G,totalLabelledBookableUnits:n.length,visibleLabels:l,hiddenLabels:n.length-l,totalBookableUnits:n.length+d.reduce((m,p)=>m+p.capacity,0),selectionRingSeatIds:i.overlayLayer.find(".selection-ring").map(m=>String(m.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:i.effSelection,focusedSectionId:i.focusedSectionId,focusBackdropVisible:!!i.focusBackdrop?.isVisible(),categoryFilterKeys:i.categoryFilter?[...i.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:y.length,categoryPaintedSectionShells:y.filter(m=>{let p=m.blockPoly.fill();return typeof p!="string"||!Fi(i.canvasBackground,p)}).length,tintedSectionShells:y.filter(m=>{let p=m.blockPoly.fill();return typeof p=="string"&&$r(i.canvasBackground,p)}).length,visibleCategoryDetailOutlines:i.sections.filter(m=>m.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:i.sections.filter(m=>m.subLabel.opacity()>.05).length,visibleSectionGADetails:[...i.gaById.values()].filter(m=>m.sectionId!=null&&m.polygon.opacity()>.05).length},labels:n,gaAreas:d,hierarchyLabels:h,freeTextLabels:u,rowLabels:f}}import{Circle as Gc}from"konva/lib/shapes/Circle";import{Ellipse as Hc}from"konva/lib/shapes/Ellipse";import{Line as Fn}from"konva/lib/shapes/Line";import{Arrow as Nc}from"konva/lib/shapes/Arrow";import{Path as Wc}from"konva/lib/shapes/Path";import{Rect as gt}from"konva/lib/shapes/Rect";import{Text as ao}from"konva/lib/shapes/Text";import{Image as Bn}from"konva/lib/shapes/Image";function On(i,e){if(!e.url||e.visible===!1)return;let t=new window.Image;i.trackAssetImage(t,e.url,"Buyer background image",()=>{let o=t.naturalWidth||4,r=t.naturalHeight||3,s=e.crop??{x:0,y:0,width:1,height:1},n=Math.max(0,Math.min(.99,s.x)),l=Math.max(0,Math.min(.99,s.y)),a={x:n,y:l,width:Math.max(.01,Math.min(1-n,s.width)),height:Math.max(.01,Math.min(1-l,s.height))},c=e.width,h=c*(r*a.height/(o*a.width)),d=new Bn({image:t,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:h/2,width:c,height:h,rotation:e.rotation??0,crop:{x:a.x*o,y:a.y*r,width:a.width*o,height:a.height*r},opacity:e.opacity,listening:!1});i.bgLayer.add(d),d.moveToBottom(),i.bgLayer.batchDraw()})}function Dn(i,e){let t=new window.Image,o=new Bn({image:t,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:N(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?i.fgDecorGroup.add(o):i.bgLayer.add(o),e.role&&i.landmarkBoxes.push(V(Qe({x:e.x+e.width/2,y:e.y+e.height/2},e.width,e.height,e.rotation??0))),i.trackAssetImage(t,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let r=o.getLayer();r&&r.batchDraw()})}function Gn(i,e){if(e.shape==="round")i.bgLayer.add(new Gc({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,r=e.height??50;i.bgLayer.add(new gt({x:e.center.x,y:e.center.y,width:o,height:r,offsetX:o/2,offsetY:r/2,rotation:e.rotation,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,cornerRadius:4,listening:!1}))}let t=bt(i,i.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,"#cbd5e1",12,!0);i.freeTextById.set(e.id,{node:t,background:"#232c40",kind:"table"})}var Vc=8,Kc=6;function Hn(i,e){let t=e.background?.color??i.canvasBackground,o=e.color??U(t,i.theme.textColor??Ms),r=e.semanticKind==="icon"?or(e.iconKey):void 0;if(r){let h=e.fontSize/24,d=new Wc({x:e.position.x,y:e.position.y,data:r,rotation:e.rotation,scaleX:h,scaleY:h,stroke:o,strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});i.iconNodeById.set(e.id,{node:d,fontSize:e.fontSize}),i.bgLayer.add(d);return}let s=e.background?.padding??0,n=e.opacity??1,l=$o(e),a=new ao({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:Ki(e.bold,e.italic,"600"),fill:o,fontFamily:e.fontFamily??i.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:s,opacity:n,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;if(e.background){let h=a.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),d=Math.max(Vc,e.fontSize*.35),u=Math.max(Kc,e.fontSize*.28);c=new gt({x:e.position.x,y:e.position.y,offsetX:-(h.x-d),offsetY:-(h.y-u),width:h.width+d*2,height:h.height+u*2,rotation:e.rotation,fill:e.background.color,opacity:n*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),i.bgLayer.add(c)}i.freeTextById.set(e.id,{node:a,backdrop:c,background:t,kind:l?"direct-landmark":"free-text"}),i.bgLayer.add(a)}function Nn(i,e){let t=e.fill??i.theme.decorFill??Ps,o=e.role==="stage",r=e.role==="reference-focal",s=!!e.role&&!o,n=Uo(e),l=te(i.canvasBackground),a=r?l.focalFill:t,c=e.kind==="line"||e.kind==="polyline",h=e.stroke?.color??(o?Te(a,.28):r?l.focalStroke:c?"#9aa3b5":void 0),d=e.stroke?.width??(o?1:r||c?2:0),u=e.opacity!=null?N(e.opacity,.1,1):1,f=0,y=0,m=null;if(c&&e.points&&e.points.length>=2){f=e.points.reduce((S,v)=>S+v.x,0)/e.points.length,y=e.points.reduce((S,v)=>S+v.y,0)/e.points.length;let p=rr(e),g=sr(d),b=new Nc({points:e.points.flatMap(S=>[S.x,S.y]),closed:!1,x:f,y,offsetX:f,offsetY:y,rotation:e.rotation??0,stroke:h,fill:h,strokeWidth:d,opacity:u,lineCap:p.lineCap,lineJoin:p.lineJoin,pointerAtBeginning:p.startEnding==="arrow",pointerAtEnding:p.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path"});b.setAttr("shapeObjectId",e.id),i.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,ue(a,.3),1,Te(a,.12)]}:{fill:a};f=e.x+e.width/2,y=e.y+e.height/2,m={x:e.x,y:e.y,width:e.width,height:e.height},i.bgLayer.add(new gt({x:f,y,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:h,strokeWidth:d,cornerRadius:N(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,y=e.y+e.height/2,m={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,ue(a,.3),1,Te(a,.12)]}:{fill:a};i.bgLayer.add(new Hc({x:f,y,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...p,stroke:h,strokeWidth:d,opacity:u,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let p=e.points.flatMap(S=>[S.x,S.y]),g=V(e.points);f=e.points.reduce((S,v)=>S+v.x,0)/e.points.length,y=e.points.reduce((S,v)=>S+v.y,0)/e.points.length,m=g;let b=o?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,ue(a,.3),1,Te(a,.12)]}:{fill:a};i.bgLayer.add(new Fn({points:p,closed:!0,x:f,y,offsetX:f,offsetY:y,rotation:e.rotation??0,...b,stroke:h,strokeWidth:d,opacity:u,listening:!1}))}m&&e.role&&i.landmarkBoxes.push(m);for(let p of ar(e))i.bgLayer.add(new Fn({points:p.points.flatMap(g=>[g.x,g.y]),closed:p.closed,x:f,y,offsetX:f,offsetY:y,rotation:e.rotation??0,stroke:p.ink??nr,fill:p.fill,strokeWidth:2,opacity:u*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:p,spec:g}=Xc(i,f,y,e.label,a,m,e.labelStyle);i.primaryFocalLabels.set(p,g),i.freeTextById.set(e.id,{node:p,background:a,kind:"stage"})}else if(s){let p=r||n,g=bt(i,i.bgLayer,e.label,f,y,p?U(a,"#e6e9f0"):"#9aa3b5",p?18:12,!1);p&&i.primaryFocalLabels.set(g,{targetPx:18,trackingRatio:0,ink:String(g.fill()??""),plateInk:String(g.fill()??""),plate:new gt({width:0,height:0,opacity:0,listening:!1})}),i.freeTextById.set(e.id,{node:g,background:a,kind:"decor"})}else{let p=bt(i,i.bgLayer,e.label,f,y,"#cbd5e1",16,!0);i.freeTextById.set(e.id,{node:p,background:a,kind:"decor"})}}var no=22,zc=G,li=6;function Xc(i,e,t,o,r,s,n){let l=n?.size??no,a=n?.color??i.theme.textColor??"#e6e9f0",c=n?.color??U(r,a),h=s?s.x+s.width/2:e,d=s?s.y+s.height/2:t,u=Yc(i.canvasBackground,r),f=new gt({x:h,y:d,width:0,height:0,cornerRadius:4,fill:u,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(f);let y=new ao({x:h,y:d,text:o,fontSize:l,fontStyle:Ki(n?.bold??!0,n?.italic,"normal"),letterSpacing:l*(4/no),fontFamily:n?.fontFamily??i.labelFont(),fill:c,textDecoration:n?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return y.offsetX(y.width()/2),y.offsetY(y.height()/2),i.bgLayer.add(y),{node:y,spec:{targetPx:l,...s?{bounds:s}:{},trackingRatio:4/no,ink:c,plateInk:n?.color??U(u,a),plate:f}}}function Yc(i,e){return pe(e,W(i)?"#ffffff":"#000000",.34)}function Wn(i,e,t,o){let r=Math.max(t,1e-4),s=e.targetPx/r,n=f=>{i.letterSpacing(f*e.trackingRatio),o(i,f)};n(s);let l=e.bounds;if(!l){e.plate.opacity(0),i.fill(e.ink);return}let a={width:l.width-li*2,height:l.height-li*2},c=Math.min(1,a.width/Math.max(i.width(),1e-6),a.height/Math.max(i.height(),1e-6));if(c<1&&(s=Math.max(zc/r,s*c),n(s)),i.width()<=a.width&&i.height()<=a.height){e.plate.opacity(0),i.fill(e.ink);return}let d=i.width()+li*2,u=i.height()+li;e.plate.size({width:d,height:u}),e.plate.offset({x:d/2,y:u/2}),e.plate.opacity(1),i.fill(e.plateInk)}function Vn(i,e){let t=i.catColor.get(e.categoryKey)??"#6e7bff",o=i.canvasBackground,r=Wo(t,o,Re),s=i.theme.textColor??"#e6e9f0",n=U(r,s),l=Ne(e.points,e.holes,{fill:t,opacity:Re,stroke:t,strokeWidth:1.5,cornerRadius:e.cornerRadius});l.setAttr("gaId",e.id),l.on("click tap",u=>{i.isGhostClick(u)||i.opts.onGAClick?.(e.id)}),l.on("mouseenter",()=>{i.container.style.cursor="pointer"}),l.on("mouseleave",()=>{i.container.style.cursor="default"}),i.bgLayer.add(l);let a=It(e.points,e.holes),c=i.sections.find(u=>oe(a,u.outline,u.holes)),h=bt(i,i.bgLayer,e.displayLabel??e.label,a.x,a.y-8,n,At,!1),d=bt(i,i.bgLayer,`cap ${e.capacity}`,a.x,a.y+10,n,Et,!1);i.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:h,background:r,kind:"ga-label",categoryKey:e.categoryKey}),i.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:d,background:r,kind:"ga-capacity",categoryKey:e.categoryKey}),i.gaById.set(e.id,{label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:l,effectiveBackground:r,strokeColor:t,labelPoint:a,labelNode:h,capacityNode:d,...c?{sectionId:c.logicalId}:{}})}function bt(i,e,t,o,r,s,n,l){let a=new ao({x:o,y:r,text:t,fontSize:n,fontStyle:l?"700":"500",fontFamily:i.labelFont(),fill:s,listening:!1,perfectDrawEnabled:!1});return a.offsetX(a.width()/2),a.offsetY(a.height()/2),e.add(a),a}import{Text as Uc}from"konva/lib/shapes/Text";var $c=4;function Kn(i){return W(i)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function qc(i,e,t,o){let r=Math.max(0,Math.min(o,e/2,t/2));i.beginPath(),i.moveTo(r,0),i.arcTo(e,0,e,t,r),i.arcTo(e,t,0,t,r),i.arcTo(0,t,0,0,r),i.arcTo(0,0,e,0,r),i.closePath()}function zn(i,e){i.padding($c),i.shadowBlur(0),i.shadowOpacity(0),i.sceneFunc(function(o){let r=this.width(),s=this.height();o.save(),qc(o,r,s,Math.min(s/2,8)),o.setAttr("fillStyle",e.plate),o.fill(),o.setAttr("strokeStyle",e.stroke),o.setAttr("lineWidth",1),o.stroke(),o.restore(),Uc.prototype._sceneFunc.call(this,o)})}var Xn=/^[\p{L}\p{N}]{1,4}$/u,Zc=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function Yn(i,e){let t=e?.trim();if(!t)return i;let o=i.toLocaleLowerCase("en-US"),r=t.toLocaleLowerCase("en-US");if(o.startsWith(`${r} `)){let n=i.slice(t.length).trim();if(Xn.test(n))return n}let s=Zc.exec(i);if(s){let n=s[1].toLocaleLowerCase("en-US"),l=s[2].trim();if((r.startsWith(n)||n.startsWith(r))&&Xn.test(l))return l}return i}function Un(i,e){let t=[],o=e.canvasBackground,r=new Map,s=(c,h)=>{let d=r.get(c)??[];d.push(h),r.set(c,d)};for(let c of e.seats){if(c.kind==="booth")continue;let h=c.logicalRowId??c.rowId;s(h,c),h!==c.rowId&&s(c.rowId,c)}let n=c=>c.logicalSeatIndex??Number(c.id.split(":").pop()??0);for(let c of i.objects){if(c.type!=="row")continue;let h=c.segmentedRow?.repeatLabelOnComponents===!0;if(c.segmentedRow&&!h&&c.segmentedRow.componentIndex!==0)continue;let d=h?c.labelPresentation:c.segmentedRow?.labelPresentation??c.labelPresentation;if(d?.visible===!1||d?.positionPreset==="none")continue;let u=c.segmentedRow&&!h?c.segmentedRow.groupId:c.id,f=(r.get(u)??[]).slice().sort((C,A)=>n(C)-n(A));if(!f.length)continue;let y=f[0],m=f[f.length-1],p=d?.labelStyle,g=d?.style==="pill"?Kn(o):null,b=g?g.plate:o,S=U(b,p?.color??e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Bt),v=p?.size??No,w=d?.rotation??0,k=e.objectFilteredOut(c)?.15:1,L=f.reduce((C,A)=>C??e.seatSection.get(A.id),void 0),T=c.segmentedRow?.displayLabel??c.displayLabel??Yn(c.label,L?.label);if(!T)continue;let I=L?[...new Set([L.id,L.logicalId,L.zone].filter(C=>!!C))]:void 0,P=(C,A,_)=>t.push({text:T,x:C,y:A,rotation:w,fontSize:v,ink:S,opacity:k,...g?{pill:g}:{},...I?.length?{focusKeys:I}:{},..._?{automaticAway:_}:{}});if(d?.position){P(d.position.x,d.position.y);continue}let M=e.seatR+12,R=d?.positionPreset??"start";if(R==="start"||R==="both"){let C=c.rotation*Math.PI/180,A={x:-Math.cos(C),y:-Math.sin(C)};P(y.x+A.x*M,y.y+A.y*M,A)}if(R==="end"||R==="both"){let C=(c.rotation+c.curve)*Math.PI/180,A={x:Math.cos(C),y:Math.sin(C)};P(m.x+A.x*M,m.y+A.y*M,A)}}let l=(e.seatR+12)*2.2,a=[];for(let c of t){let h=a.find(d=>d.text===c.text&&Math.hypot(d.x-c.x,d.y-c.y)<=l);if(h){h.x=(h.x+c.x)/2,h.y=(h.y+c.y)/2;continue}a.push(c)}return a}function lo(i,e,t=Q){let o=i.rotation()*Math.PI/180,r=Math.abs(Math.cos(o)),s=Math.abs(Math.sin(o)),n=(i.width()*r+i.height()*s)/2+t,l=(i.width()*s+i.height()*r)/2+t;return{x:e.x-n,y:e.y-l,width:n*2,height:l*2}}function $n(i,e,t,o){let r={x:e.x,y:e.y},s=e.automaticAway;if(!s)return r;let n={x:-s.y,y:s.x},l=Math.max(7,Math.min(16,e.fontSize*.75)),a=[{x:0,y:0}];for(let u=1;u<=4;u++){let f=l*u;a.push({x:n.x*f,y:n.y*f},{x:-n.x*f,y:-n.y*f},{x:s.x*f,y:s.y*f},{x:(s.x+n.x)*f,y:(s.y+n.y)*f},{x:(s.x-n.x)*f,y:(s.y-n.y)*f})}let c=r,h=1/0,d=1/0;for(let u of a){let f={x:r.x+u.x,y:r.y+u.y},y=lo(i,f),p=(o?Gt(o,y,{mode:"overlap"}).length:0)+t.collisionCount(y),g=Math.hypot(u.x,u.y);if((p<h||p===h&&g<d)&&(c=f,h=p,d=g),p===0)break}return c}function qn(i,e){let t=e,o=t._cache.get("canvas");if(!o)return;let r=[o.scene,o.filter,o.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&i.Util.releaseCanvas(...r),t._cache.delete("canvas")}function Zn(i,e){let t=0,o=0,r=s=>{t||(t=s),o+=1;let n=s-t;n>=1e3&&(i(Math.round(o*1e3/n)),o=0,t=s),e(requestAnimationFrame(r))};e(requestAnimationFrame(r))}import{Group as Qc}from"konva/lib/Group";import{Line as Qn}from"konva/lib/shapes/Line";import{Rect as jc}from"konva/lib/shapes/Rect";import{Text as jn}from"konva/lib/shapes/Text";function Jc(i,e){return i>=re||e&&i>=Wt}function eh(i){return i.effectiveScale<Wt?!1:i.focusActive||i.stageWidth<se}function th(i,e,t){return t&&e>=Wt?Math.max(i,Sr/Math.max(e,1e-4)):i}function ih(i){let{authoredFontSize:e,measuredWidth:t,maxWidth:o,effectiveScale:r}=i;if(!(t>o)||!(t>0))return e;let s=G/Math.max(r,1e-4),n=e*o/t;return Math.max(Math.min(nt,s),n)}function co(i,e){let t=(e?1:3)*Math.min(1,i/ge);return Math.max(1,i*2-t)}function Jn(i){let e=new Map;for(let r of i){let s=e.get(r.rowId);s?s.push(r):e.set(r.rowId,[r])}let t=[];for(let r of e.values())if(!(r.length<2))for(let s=1;s<r.length;s+=1){let n=Math.hypot(r[s].x-r[s-1].x,r[s].y-r[s-1].y);n>0&&Number.isFinite(n)&&t.push(n)}if(!t.length)return 0;t.sort((r,s)=>r-s);let o=Math.floor(t.length/2);return t.length%2?t[o]:(t[o-1]+t[o])/2}function ea(i,e){return e>0?Math.min(i,e/2):i}function ho(i){let e=Math.max(i*2,1e-4);return Math.max(_e,Vo/e)}function uo(i){let e=co(i,!1),t=co(ge,!1),o=e>0?t/e:1;return re*Math.max(1,o)/Mi(1,!1,G)}function ta(i){return uo(i)*Ei}function ia(i){let e=i.exportMode?Math.max(i.effScale(),re):i.effScale(),t=eh({effectiveScale:e,focusActive:i.focusedSectionId!=null,stageWidth:i.stage.width()}),o=i.exportMode?e:Mi(e,i.labelsWereVisible(),G),r=Jc(o,t);i.onLabelVisibilityChange(r),i.setSeatLabelRungOpen(r);let s=a=>{let c=a.getClientRect({skipShadow:!0,skipStroke:!0});return c.x>=0&&c.y>=0&&c.x+c.width<=i.stage.width()&&c.y+c.height<=i.stage.height()};for(let[a,c]of i.boothLabelById){let h=i.circleById.get(a);c.visible(me(c.fontSize(),o)&&!!h?.isVisible()&&i.focusedSeatOpacity(a,h?.getAbsoluteOpacity()??1)>=.5&&s(c))}i.labelGroup.destroyChildren(),i.labelLiftGroups.clear(),i.seatLabelById.clear(),i.seatLabelDrops.clear();let n=0;if(r)for(let a of i.visibleSeatCandidates()){if(a.kind==="booth")continue;let c=i.worldToScreen(a);if(c.x<-20||c.x>i.stage.width()+20||c.y<-20||c.y>i.stage.height()+20||i.accessGlyphById.has(a.id)&&i.accessGlyphShouldShow(a.id))continue;let h=i.circleById.get(a.id);if(!h?.isVisible()||i.focusedSeatOpacity(a.id,h.getAbsoluteOpacity())<.5){i.seatLabelDrops.set(a.id,"dimmed-or-unavailable");continue}let d=i.statusById.get(a.id)??"free",u=i.renderedSeatPoint(a),f=i.viewMode==="perspective"?i.perspectiveSeatScale.get(a.id)??1:1;if(!i.hasSeatMark(a.id)&&(d==="booked"||d==="held"&&!i.ownedHold.has(a.id)&&!i.opts.manageMode)){let b=new Qc({x:u.x,y:u.y,listening:!1});if(b.scale({x:f,y:f}),d==="held"?(b.add(new jc({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),b.add(new Qn({points:[-2.4,-.8,-2.4,-2.7,-1.2,-4,0,-4.35,1.2,-4,2.4,-2.7,2.4,-.8],stroke:"#ffffff",strokeWidth:1.2,lineCap:"round",lineJoin:"round",listening:!1}))):(b.opacity(Ln),b.add(new Qn({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1}))),ni(b),i.seatLabelContainer(a.id).add(b),++n>=Ri)break;continue}let m=th(fe*i.seatLabelScale(a),e,t),p=new jn({x:u.x,y:u.y,text:Ft(a.displayLabel??a.label),fontSize:m,fontStyle:"600",fontFamily:i.labelFont(),fill:h?i.seatLabelInk(a,h):i.seatPreferredLabelInk(a),listening:!1,perfectDrawEnabled:!1}),g=co(i.seatR,t);if(p.fontSize(ih({authoredFontSize:m,measuredWidth:p.width(),maxWidth:g,effectiveScale:e})),p.width()>g+.01){i.seatLabelDrops.set(a.id,"label-overflows-marker"),p.destroy();continue}if(!me(p.fontSize(),e)){i.seatLabelDrops.set(a.id,"below-minimum-size"),p.destroy();continue}if(p.offsetX(p.width()/2),p.offsetY(p.height()/2),p.scale({x:f,y:f}),i.seatLabelContainer(a.id).add(p),!s(p)){i.seatLabelDrops.set(a.id,"outside-viewport"),p.destroy();continue}if(i.seatLabelById.set(a.id,p),++n>=Ri)break}let l=new je;for(let{node:a}of i.freeTextById.values()){if(!a.isVisible())continue;let c=a.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});l.insert({x:c.x-Q,y:c.y-Q,width:c.width+Q*2,height:c.height+Q*2})}for(let a of i.rowLabelPlan){let c=i.focusedSectionId!=null&&a.focusKeys?.includes(i.focusedSectionId),h=c?Math.max(a.fontSize,br/Math.max(e,1e-4)):a.fontSize;if(!c&&!me(h,o))continue;let d=i.worldToScreen({x:a.x,y:a.y});if(d.x<-40||d.x>i.stage.width()+40||d.y<-40||d.y>i.stage.height()+40)continue;let u=new jn({x:a.x,y:a.y,text:a.text,fontSize:h,fontStyle:"700",fontFamily:i.labelFont(),fill:a.ink,rotation:a.rotation,opacity:a.opacity,shadowColor:"#05070c",shadowBlur:a.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:a.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});a.pill&&zn(u,a.pill),u.offsetX(u.width()/2),u.offsetY(u.height()/2);let f=i.resolveAutomaticRowLabelPosition(u,a,l);u.position(f),u.setAttr("rowLabel",!0),i.labelGroup.add(u);let y=u.getClientRect({skipShadow:!0,skipStroke:!0}),m=6,p=y.x<m?m-y.x:y.x+y.width>i.stage.width()-m?i.stage.width()-m-y.x-y.width:0,g=y.y<m?m-y.y:y.y+y.height>i.stage.height()-m?i.stage.height()-m-y.y-y.height:0,b=f;if(p||g){let v=i.labelGroup.getAbsoluteTransform(),w=v.point(f);b=v.copy().invert().point({x:w.x+p,y:w.y+g}),u.position(b)}let S=i.rowLabelBox(u,b);if(a.automaticAway&&l.collisionCount(S)>0){u.destroy();continue}l.insert(S)}i.isoT>0&&i.viewMode!=="perspective"&&i.applyUprightLabels(),i.overlayLayer.batchDraw()}function oa(i){let e=i.now??(()=>typeof performance<"u"?performance.now():Date.now()),t=i.budgetMs??8,o=i.reducedMotion===!0,r=i.chunks.length>1?Math.min(30,Math.max(0,840/(i.chunks.length-1))):0,s=0,n=!1,l=!1,a=null,c=[],h=typeof globalThis<"u"?globalThis:{},d=()=>{a&&(a.kind==="idle"?h.cancelIdleCallback?.(a.id):a.kind==="frame"?h.cancelAnimationFrame?.(a.id):clearTimeout(a.id),a=null)},u=p=>{if(!c.length&&typeof h.requestIdleCallback=="function"){a={kind:"idle",id:h.requestIdleCallback(()=>{a=null,p()},{timeout:120})};return}if(typeof h.requestAnimationFrame=="function"){a={kind:"frame",id:h.requestAnimationFrame(()=>{a=null,p()})};return}a={kind:"timer",id:setTimeout(()=>{a=null,p()},16)}},f=()=>{l||n||(l=!0,d(),i.done())},y=p=>{for(let g=c.length-1;g>=0;g--){let b=c[g],S=o?1:Math.min(1,(p-b.startedAt)/160);i.fade(b.work,S),S>=1&&c.splice(g,1)}return c.length>0},m=()=>{if(n)return;let p=e(),g=p;for(;s<i.chunks.length&&(s===0||e()-g<t);){let S=i.chunks[s++];if(i.build(S.work),i.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:p+(s-1)*r}),e()-g>=t)break}let b=y(p);i.draw(),s<i.chunks.length||b?u(m):f()};return u(m),{cancel(){if(!l){n=!0,d();for(let p of c)i.fade(p.work,1);c.length=0}},finishNow(){if(!(n||l)){for(;s<i.chunks.length;){let p=i.chunks[s++];i.build(p.work)}for(let p of i.chunks)i.fade(p.work,1);c.length=0,i.draw(),f()}},get done(){return l}}}function St(i){return{th:Vt*Math.PI/180*i.isoT,sg:1-(1-lt)*i.isoT}}function ra(i,e){let{th:t,sg:o}=St(e),r=e.centre,s=i.x-r.x,n=i.y-r.y,l=s*Math.cos(t)-n*Math.sin(t),a=(s*Math.sin(t)+n*Math.cos(t))*o;return{x:r.x+l,y:r.y+a}}function sa(i,e){let{th:t,sg:o}=St(e),r=e.centre,s=i.x-r.x,l=(i.y-r.y)/o,a=s*Math.cos(t)+l*Math.sin(t),c=-s*Math.sin(t)+l*Math.cos(t);return{x:r.x+a,y:r.y+c}}function na(i,e){let{th:t,sg:o}=St(e),r=i*e.isoT;return{x:-(r/o)*Math.sin(t),y:-(r/o)*Math.cos(t)}}function aa(i,e,t){let o=Jo(e);i.offset(t),i.position(ae(e,t)),i.rotation(o.rotationDeg),i.scale({x:o.scaleX,y:o.scaleY}),i.skewX(o.skewX),i.skewY(0)}function la(i){i.position({x:0,y:0}),i.offset({x:0,y:0}),i.scale({x:1,y:1}),i.rotation(0),i.skewX(0),i.skewY(0)}function ca(i,e){let t=Math.hypot(e.x-i.surfaceFocal.x,e.y-i.surfaceFocal.y),o=Math.max(0,t-i.frontDistanceWorld);return i.liftWorld+o*Math.tan(i.rakeDeg*Math.PI/180)}function ha(i,e,t){return i.perspectiveAffine?ae(i.perspectiveAffine,e):ae(t,e)}function da(i,e){return e?ae(e,i):i}function ua(i,e){let t=0;for(let d of i.seats){let u=Math.max(0,(d.eyeHeightM??ee)-ee);t=Math.max(t,u*Ke)}for(let d of i.objects)d.type==="section"&&(t=Math.max(t,Ct(d,{floorBaseHeightM:i.floorBaseHeightMFor(d.id)}).height*Ke));let o=Zo(i.bounds,t),r=Ht(o,o.target),s=Qo(r);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let n=1/0,l=1/0,a=-1/0,c=-1/0;for(let d of i.seats){let u=Math.max(0,(d.eyeHeightM??ee)-ee),f=ye(o,d,u*Ke),y={x:f.x,y:f.y};e.seatProjected.set(d.id,y),e.seatLocal.set(d.id,ae(s,y)),e.seatDepth.set(d.id,f.depth),e.seatScale.set(d.id,f.scale),n=Math.min(n,f.x),l=Math.min(l,f.y),a=Math.max(a,f.x),c=Math.max(c,f.y)}for(let d of[{x:i.bounds.x,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y+i.bounds.height},{x:i.bounds.x,y:i.bounds.y+i.bounds.height}]){let u=ye(o,d,0);n=Math.min(n,u.x),l=Math.min(l,u.y),a=Math.max(a,u.x),c=Math.max(c,u.y)}let h=Math.max(24,i.seatR*3);return{camera:o,baseAffine:r,baseInverse:s,bounds:Number.isFinite(n)?{x:n-h,y:l-h,width:Math.max(1,a-n+h*2),height:Math.max(1,c-l+h*2)}:null}}function pa(i,e,t){let o=t?[...t].map(r=>i.seatById.get(r)).filter(r=>!!r):e?i.seats:[...i.perspectiveAppliedSeats].map(r=>i.seatById.get(r)).filter(r=>!!r);for(let r of o){if(e&&i.perspectiveAppliedSeats.has(r.id))continue;let s=e?i.perspectiveSeatProjected.get(r.id)??r:r,n=e?i.perspectiveSeatScale.get(r.id)??1:1,l=i.circleById.get(r.id);l?.position(s),l?.scale({x:n,y:n});let a=i.accessRingById.get(r.id);a?.position(s),a?.scale({x:n,y:n});let c=i.accessGlyphById.get(r.id);if(c){let d=i.seatR*1.5/xe;c.position(s),c.scale({x:d*n,y:d*n})}let h=i.boothLabelById.get(r.id);h?.position(s),h?.scale({x:n,y:n}),e&&i.perspectiveAppliedSeats.add(r.id)}e||i.perspectiveAppliedSeats.clear()}function fo(i){return i?.getAttr?.("seatId")??void 0}var ga=Object.freeze([]),wt=class wt{constructor(e,t={}){this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;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=zi;this.effSelection=ft;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.catOrder=[];this.selection=new Set;this.selectionMarkers=new Map;this.momentsCache=null;this.ownedCache=null;this.ownedHold=new Set;this.seatMarks=new si;this.selectionFocusId=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;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.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.objectFloor=new Map;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=pn();this.fitScale=1;this.fitPose="";this.viewportInsets={...to};this.seatR=ge;this.markerR=ge;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.assetGeneration=0;this.assetPromises=[];this.assetErrors=[];this.assetCancels=new Set;this.seatReveal=null;this.seatRevealPending=!1;this.progressiveSeatFloor=800;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.marquee=null;this.marqueeCur=null;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 t=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(t){e.preventDefault();let o=this.focusedId?this.nearestSeat(this.focusedId,t):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.seatAnchorContextCache=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...t},this.exportMode=t.exportMode===!0,this.loadingReveal=t.loadingReveal??"progressive",this.onSeatsRevealed=t.onSeatsRevealed,this.currency=t.currency;let o=ci.pixelRatio;if(this.exportMode&&(this.dpr=1),ci.pixelRatio=this.dpr,this.stage=new oh({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new ai(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",$("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new po({listening:!this.exportMode}),this.seatLayer=new po({listening:!this.exportMode}),this.overlayLayer=new po({listening:!1}),this.labelGroup=new vt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.fgDecorGroup=new vt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new ii({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:()=>uo(this.markerR),pickableScale:()=>ho(this.markerR),categoryLabel:r=>this.catByKey.get(r)?.label??"",categoryColor:r=>this.categoryDisplayColor(r),categoryPriceLabel:r=>this.categoryPriceLabel(r),categoryFilter:()=>this.categoryFilter,viewMode:()=>this.viewMode,seatsPickable:()=>this.seatsPickable(),screenToWorld:r=>this.screenToWorld(r),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(r,s)=>this.focusRegion(r,s),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new fa({radius:ge+2,stroke:"#ffffff",strokeWidth:2,opacity:.85,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new fa({radius:ge+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&&(ci.pixelRatio=o),!this.exportMode){this.wireInteraction();let r=this.opts.onFps;r&&Zn(r,s=>{this.rafId=s})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get moments(){return this.momentsCache||(this.momentsCache=new Jt({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,categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.categoryPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,t)=>this.nearestSeatToScreen(e,t)})),this.momentsCache}get owned(){return this.ownedCache||(this.ownedCache=new ei({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>({x:e.nameLabel.x(),y:e.nameLabel.y()}),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,t){return this.owned.anchorFor(e)??t}ownedSeatPoints(e){let t=[];for(let o of e.memberIds){if(!this.selection.has(o)&&!this.ownedHold.has(o))continue;let r=this.seatById.get(o);r&&t.push(this.renderedSeatPoint(r))}return t}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),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,t){if(e!==this.chartDoc&&(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=t?.floorId??Pt(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let s of e.floors)for(let n of s.objects)this.objectFloor.set(n.id,s.id),n.type==="section"&&n.logicalSectionId&&this.objectFloor.set(n.logicalSectionId,s.id);let o=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.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.primaryFocalLabels.clear(),this.gaById.clear();for(let s of this.selectionMarkers.values())s.destroy();this.selectionMarkers.clear(),this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.statusById.clear(),this.seatAnchorContextCache=null,this.selection.clear(),this.seatById.clear(),this.seatIndex=null,this.cached=!1,this.accessFilter=null,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=o.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=er(this.theme.seatScale)*ge,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,n)=>{this.cbHueByKey.set(s,Zt[n%Zt.length])});for(let s of e.categories)this.catColor.set(s.key,s.color),this.catByKey.set(s.key,s),typeof s.price=="number"&&this.catPrice.set(s.key,s.price);for(let s of o.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(n=>({x:n.x,y:n.y}))}:{}});this.seats=ze(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()});for(let s of this.seats)this.seatById.set(s.id,s),this.statusById.set(s.id,"free");this.seatIndex=qo(this.seats,{seatRadius:this.seatR}),this.markerR=ea(this.seatR,Jn(this.seats)),this.clusterLabels.rebuild(),this.bounds=Eo(o,{freeText:"exclude"}),this.isoCentre={x:this.bounds.x+this.bounds.width/2,y:this.bounds.y+this.bounds.height/2},this.buildPerspectiveProjection(o),this.renderBackground(o),this.unsectionedSeatGroup=new vt({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.seatRevealWanted();this.seatRevealPending=r,r||this.renderSeats(),this.buildRowLabelPlan(o),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=this.viewportCentreInChartSpace(),t=new Map,o=[];for(let s of this.seats){let n=this.seatSection.get(s.id);if(!n){o.push(s);continue}let l=t.get(n.id);l?l.push(s):t.set(n.id,[s])}let r=[...t.entries()].map(([s,n])=>{let l=this.sections.find(a=>a.id===s);return{id:s,work:{seats:n,group:l.liftGroupSeat},distance:Math.hypot(l.centroid.x-e.x,l.centroid.y-e.y)}}).sort((s,n)=>s.distance-n.distance);o.length&&this.unsectionedSeatGroup&&r.push({id:"",work:{seats:o,group:this.unsectionedSeatGroup},distance:1/0}),this.seatReveal=oa({chunks:r.map(s=>({id:s.id,work:s.work})),build:s=>this.renderSeats(s.seats),fade:(s,n)=>s.group.opacity(n),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.updateLOD(),this.fitPose&&Wi(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 t=this.seatReveal;this.seatRevealPending=!1,t&&(this.seatReveal=null,e?t.finishNow():t.cancel())}floorView(e){if(!e.floors?.length)return{...e,referenceImage:void 0,backgroundImage:st(e)};if(this.floorOverview&&e.floors.length>=2)return _o(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...Ao(e),referenceImage:void 0,backgroundImage:st(e)};let t=e.floors.find(o=>o.id===this.activeFloorId)??e.floors[0];return{...e,objects:t.objects,focalPoint:t.focalPoint,referenceImage:void 0,backgroundImage:st(t),floors:void 0}}floorBaseHeightMFor(e){let t=this.chartDoc?.floors;if(!t?.length)return 0;let o=this.stacked&&e?this.objectFloor.get(e)??this.activeFloorId:this.activeFloorId;return t.find(r=>r.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}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?Pt(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,t){let o=!1,r=this.hasSections?new Set:null;for(let s of e){if(!this.statusById.has(s))continue;let n=this.statusById.get(s);this.statusById.set(s,t);let l=this.circleById.get(s);if(l&&(this.paintSeat(l,s),o=!0),r){let a=this.seatSection.get(s);a&&(n==="free"!=(t==="free")&&(a.free+=t==="free"?1:-1),r.add(a))}}if(r&&r.size){for(let s of r)this.refreshSectionFill(s);this.bgLayer.batchDraw()}o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>re&&this.updateLabels())}setSeatCategories(e){let t=!1,o=new Set;for(let[s,n]of Object.entries(e)){let l=this.seatById.get(s);if(!l||!this.catColor.has(n)||l.categoryKey===n)continue;l.categoryKey=n;let a=this.circleById.get(s);a&&(this.paintSeat(a,s),t=!0);let c=this.seatSection.get(s);c&&o.add(c)}if(!t)return;let r=new Map((this.chartDoc?Pt(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of o){if(!r.get(s.id)?.color){let l=new Map;for(let a of s.memberIds){let c=this.seatById.get(a)?.categoryKey;c&&l.set(c,(l.get(c)??0)+1)}s.baseFill=Li([...l].map(([a,c])=>({hex:this.catColor.get(a)??"#6e7bff",w:c})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}o.size&&this.bgLayer.batchDraw(),this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>re&&this.updateLabels()}setOwnedHold(e){let t=new Set((e??[]).filter(r=>this.statusById.has(r))),o=new Set([...this.ownedHold,...t]);this.ownedHold=t;for(let r of o){let s=this.circleById.get(r);s&&this.paintSeat(s,r),this.syncSelectionMarker(r)}o.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>re&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let t=e&&this.selection.has(e)?e:null;if(t===this.selectionFocusId)return;let o=this.selectionFocusId;this.selectionFocusId=t;for(let r of this.seats){let s=this.circleById.get(r.id);s&&this.paintSeat(s,r.id)}o&&this.syncSelectionMarker(o),t&&this.syncSelectionMarker(t);for(let[r,s]of this.selectionMarkers)s.opacity(!t||r===t?1:.2);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}setSeatMarks(e){let t=this.seatMarks.merge(e,this.statusById);for(let o of t){let r=this.circleById.get(o);r&&this.paintSeat(r,o)}t.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 t of this.selection){let o=this.seatById.get(t);o&&e.push(o)}return e}clearSelection(){let e=[...this.selection];for(let t of e)this.setSelected(t,!1,!0);this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let t=[];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 r=this.seatById.get(o);r&&t.push(r)}return t.length&&this.overlayLayer.batchDraw(),t}setManageInteraction(e){this.marquee&&this.cancelMarquee(),this.gestures.resetPan(),this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let t=[...this.selection].filter(o=>!this.isSelectable(o));t.length&&this.deselect(t),!e.manageMode&&this.selection.size&&this.clearSelection(),this.clusterLabels.syncCursor(!1),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[t,o]of Object.entries(e??{}))Number.isFinite(o)&&this.sectionHeat.set(t,Math.max(0,Math.min(1,o)));for(let t of this.sections)this.refreshSectionHeat(t);this.bgLayer.batchDraw()}deselect(e){let t=!1;for(let o of e)this.selection.has(o)&&(this.setSelected(o,!1,!0),t=!0);t&&this.overlayLayer.batchDraw()}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let t of this.seats)this.isSelectable(t.id)&&e.push(t.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let t=new Set(e),o=[];for(let r of this.seats)t.has(r.label)&&this.isSelectable(r.id)&&o.push(r.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 t=[],o=new Set;for(let r of this.sections)if(!(r.id!==e&&r.logicalId!==e&&r.zone!==e))for(let s of r.memberIds){if(o.has(s)||(o.add(s),!this.isSelectable(s)))continue;let n=this.seatById.get(s);n&&t.push(n)}return t}selectMany(e){let t=e.filter(r=>!this.selection.has(r));if(!t.length)return this.getSelection();let o=this.selection.size+t.length<=vr;for(let r of t)if(o)this.setSelected(r,!0,!0);else{this.selection.add(r);let s=this.circleById.get(r);s&&this.paintSeat(s,r)}return this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}beginMarquee(e){let t=this.screenToWorld(e),o=this.stage.scaleX()||1,r=new ma({x:t.x,y:t.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(r),this.marquee={start:t,rect:r},this.marqueeCur=t,this.overlayLayer.batchDraw()}updateMarquee(e){if(!this.marquee)return;let t=this.screenToWorld(e),{start:o,rect:r}=this.marquee;r.setAttrs({x:Math.min(o.x,t.x),y:Math.min(o.y,t.y),width:Math.abs(t.x-o.x),height:Math.abs(t.y-o.y)}),this.marqueeCur=t,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 t=this.marqueeCur??e.start;this.marqueeCur=null;let o=Math.min(e.start.x,t.x),r=Math.max(e.start.x,t.x),s=Math.min(e.start.y,t.y),n=Math.max(e.start.y,t.y),l=this.stage.scaleX()||1;if((r-o)*l<4&&(n-s)*l<4){this.selection.size&&(this.clearSelection(),this.opts.onMarquee?.([]));return}let a=[];for(let c of this.seats){let h=this.renderedSeatPoint(c);h.x<o||h.x>r||h.y<s||h.y>n||this.isSelectable(c.id)&&a.push(c.id)}this.selectMany(a),this.opts.onMarquee?.(this.getSelection())}flashSeat(e,t="#f43f5e"){let o=this.seatById.get(e);o&&tn(this.flashHost,e,this.renderedSeatPoint(o),t)}flashSection(e,t="#22a06b"){on(this.flashHost,this.sections.filter(o=>o.id===e||o.zone===e),t)}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,t)=>this.projectedSectionPoint(e,t),isoLiftLocal:e=>this.isoLiftLocal(e)}}nearestSeat(e,t){let o=this.seatById.get(e);if(!o)return null;let r=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(o.id)??o:o,s=null,n=1/0;for(let l of this.seats){if(l.id===e)continue;let a=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(l.id)??l:l,c=a.x-r.x,h=a.y-r.y,d=c*t.x+h*t.y;if(d<=.5)continue;let u=Math.abs(c*t.y-h*t.x),f=d+u*2.5;f<n&&(n=f,s=l.id)}return s}focusSeat(e){let t=this.seatById.get(e);if(!t)return;this.focusedId=e,this.focusRing.radius(this.seatR+3),this.focusRing.position(this.renderedSeatPoint(t));let o=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;this.focusRing.scale({x:o,y:o}),this.focusRing.visible(!0),this.ensureVisible(t),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(t)}ensureVisible(e){let t=this.stage.width(),o=this.stage.height(),r=Math.max(this.stage.scaleX(),Ae*1.2),s=this.worldToScreen(e),n=70,l=s.x<n||s.x>t-n||s.y<n||s.y>o-n;if(this.stage.scaleX()<r||l){let a=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?ae(this.perspectiveBaseAffine,a):this.isoT===0?a:this.isoForward(a);this.stage.scale({x:r,y:r}),this.stage.position({x:t/2-c.x*r,y:o/2-c.y*r}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=an(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}framingViewport(){return ln(this.stage.width(),this.stage.height(),this.viewportInsets)}framingWorldRect(){return dn(this.framingViewport(),e=>this.screenToWorld(e))}zoomToFit(){let e=this.framingViewport(),t=e.width,o=e.height,r=this.viewMode==="perspective"&&this.perspectiveBounds?this.perspectiveBounds:this.bounds;if(this.fitScale=Math.min(t/r.width,o/r.height)||1,this.opts.portraitFitCrop&&!this.exportMode){let n=t/r.width<=o/r.height,l=r.height*this.fitScale;n&&l<.55*o&&(this.fitScale=Math.min(this.fitScale*1.3,.62*o/r.height))}let s=this.fitScale;if(this.stage.scale({x:s,y:s}),this.stage.position({x:e.x+(t-r.width*s)/2-r.x*s,y:e.y+(o-r.height*s)/2-r.y*s}),this.settleView(),!this.exportMode){let n=ys(this.stage,[this.bgLayer,this.seatLayer],e);n>0&&n!==1&&(this.fitScale*=n),n>0&&this.afterViewChange(),this.fitPose=Wi(this.stage)}this.stage.batchDraw()}refitCurrentView(){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 cn(this.stage)}setCameraPose(e){this.cancelGlide(),hn(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.zoomAbout(this.stage.scaleX()*wt.ZOOM_STEP,oi(this.framingViewport()))}zoomOut(){this.zoomAbout(this.stage.scaleX()/wt.ZOOM_STEP,oi(this.framingViewport()))}zoomOutLevel(){let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e),"section"):"venue":this.getRung()==="seats"?(this.setRung("sections"),"sections"):(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let t of this.gaById.values())e+=t.capacity;return e}worldToScreen(e){let t=this.stage.scaleX(),o=e.id,r=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let l=r?this.perspectiveSeatProjected.get(r.id)??ae(this.perspectiveBaseAffine,e):ae(this.perspectiveBaseAffine,e);return{x:l.x*t+this.stage.x(),y:l.y*t+this.stage.y()}}let s=r?this.renderedSeatPoint(r):e,n=this.isoT===0?s:this.isoForward(s);return{x:n.x*t+this.stage.x(),y:n.y*t+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let t=e===null?null:[...e];if(!this.sameAccessFilter(t)){this.accessFilter=t;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 r=this.circleById.get(o.id);r&&this.paintSeat(r,o.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let t=this.accessFilter;return t===null||e===null?t===e:t.length===e.length&&t.every((o,r)=>o===e[r])}setCommercialLimitedFilter(e){if(this.commercialLimitedFilter!==e){this.commercialLimitedFilter=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setCategoryFilter(e){let t=e===null?null:new Set(e);if(!Ns(t,this.categoryFilter)){this.categoryFilter=t;for(let o of this.seats){let r=this.circleById.get(o.id);r&&this.paintSeat(r,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(){Rn({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=>Mn(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<le,effScale:()=>this.effScale(),labelLegible:e=>me(e,this.effScale())})}setGAStates(e){An(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,t){this.setGAStates({[e]:t})}focusCategories(e,t){if(!e?.length){this.focusRegion(this.bounds,{animate:t?.animate,durationMs:this.cameraGlideMs});return}let o=new Set(e),r=this.seats.filter(f=>!o.has(f.categoryKey)||this.seatInClosedSection(f.id)?!1:(this.statusById.get(f.id)??"free")==="free"||this.ownedHold.has(f.id));if(!r.length)return;let s=Ws(r.map(f=>f.id),this.seatSection);s&&this.focusSection(s);let n=Math.max(24,this.seatR*3),l=r.map(f=>this.renderedSeatPoint(f)),a=this.clusterLabels.boundsForSeats(r.map((f,y)=>({...f,...l[y]})),n),c=a?.bounds??io(l,n);if(!this.hasSections&&a){let f=this.clusterLabels.diveTarget(c,a.anchor);f&&this.focusRegion(f,{animate:t?.animate,durationMs:this.cameraGlideMs});return}let h=this.narrowSeatDetailFocus(l,c,a?.anchor??null),d=h?.bounds??c,u={x:d.x+d.width/2,y:d.y+d.height/2};!h&&Ds({stage:this.stage,box:d,bounds:this.zoomBounds(),viewport:this.framingViewport(),centreScreen:this.worldToScreen(u)})||this.focusRegion(d,{animate:t?.animate,durationMs:this.cameraGlideMs,minScale:h?.minScale})}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let l=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(l),this.zoomToFit();return}let t=e==="isometric"?1:0,o=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=t,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),o){this.isoT=t,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=t,this.applyIso(),this.afterViewChange();return}let r=this.isoT;if(r===t){this.applyIso(),this.afterViewChange();return}let s=performance.now(),n=l=>{if(this.destroyed)return;let a=Math.min(1,(l-s)/wr),c=a<.5?4*a*a*a:1-Math.pow(-2*a+2,3)/2;this.isoT=r+(this.isoTarget-r)*c,this.applyIso(),this.scheduleViewChange(),a<1?this.isoRaf=requestAnimationFrame(n):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(n)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}isoParams(){return St(this.isoState)}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),t=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,t)}return this.stage.scaleX()*(1-(1-lt)*this.isoT)}isoForward(e){return ra(e,this.isoState)}isoInverse(e){return sa(e,this.isoState)}buildPerspectiveProjection(e){let t=ua({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=t.camera,this.perspectiveBaseAffine=t.baseAffine,this.perspectiveBaseInverse=t.baseInverse,this.perspectiveBounds=t.bounds}setContainerAffine(e,t,o){aa(e,t,o)}resetContainerTransform(e){la(e)}sectionSurfaceHeight(e,t){return ca(e,t)}projectedSectionPoint(e,t){return ha(e,t,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return da(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return na(e,this.isoState)}resetLayerTransforms(e=!0){let t=e?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let o of t)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)}resetSectionProjection(e=!0){for(let t of this.sections){this.resetContainerTransform(t.rootGroupBg),this.resetContainerTransform(t.liftGroupBg),e&&this.resetContainerTransform(t.liftGroupSeat),t.rootGroupBg.zIndex(t.bgZIndex),e&&t.liftGroupSeat.zIndex(t.seatZIndex);let o=this.labelLiftGroups.get(t.id);o&&e&&this.resetContainerTransform(o),t.perspectiveAffine=void 0,t.perspectiveCorrection=void 0,t.perspectiveDepth=void 0}}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,t){pa(this.seatAnchorContext,e,t)}applyPerspective(e=!0){let t=this.perspectiveCamera,o=this.perspectiveBaseAffine,r=this.perspectiveBaseInverse;if(!t||!o||!r)return;let s=this.seats.length>2500&&this.sections.length>0;this.cached&&!s&&(this.seatLayer.clearCache(),this.seatLayer.listening(!0),this.cached=!1),this.resetLayerTransforms(e),this.resetSectionProjection(e);for(let l of[this.bgLayer,this.overlayLayer])this.setContainerAffine(l,o,t.target);this.perspectiveAppliedSeats.clear(),s||this.applyExactSeatAnchors(!0);for(let l of this.sections){let a=d=>this.sectionSurfaceHeight(l,d),c=Ht(t,l.centroid,a),h=jo(r,c);l.perspectiveAffine=c,l.perspectiveCorrection=h,l.perspectiveDepth=ye(t,l.centroid,a(l.centroid)).depth,this.setContainerAffine(l.liftGroupBg,h,l.centroid);for(let d=0;d<l.sideFaces.length;d++){let u=l.outline[d],f=l.outline[(d+1)%l.outline.length],y=this.perspectiveLocalPoint(ye(t,u,0)),m=this.perspectiveLocalPoint(ye(t,f,0)),p=this.perspectiveLocalPoint(ye(t,f,a(f))),g=this.perspectiveLocalPoint(ye(t,u,a(u)));l.sideFaces[d].points([y.x,y.y,m.x,m.y,p.x,p.y,g.x,g.y]),l.sideFaces[d].opacity(.9)}}let n=[...this.sections].sort((l,a)=>(a.perspectiveDepth??0)-(l.perspectiveDepth??0));for(let l of n)l.rootGroupBg.moveToTop(),l.liftGroupSeat.moveToTop();this.unsectionedSeatGroup?.moveToTop(),this.syncSeatOverlayPositions(),s||this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyIso(){if(this.resetSectionProjection(),this.applyExactSeatAnchors(!1),this.isoT===0)this.resetLayerTransforms();else{let{th:t,sg:o}=this.isoParams(),r=Math.cos(t),s=o*Math.sin(t),n=-Math.sin(t),l=o*Math.cos(t),a=Math.sqrt(r*r+s*s),c=r*l-s*n,h=Math.atan2(s,r)*180/Math.PI,d=a,u=c/a,f=(r*n+s*l)/c,y=this.isoCentre;for(let m of[this.bgLayer,this.seatLayer,this.overlayLayer])m.position({x:y.x,y:y.y}),m.offset({x:y.x,y:y.y}),m.rotation(h),m.scaleX(d),m.scaleY(u),m.skewX(f),m.skewY(0)}this.applyUprightLabels(),this.applyElevation(),this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyUprightLabels(){let e=Vt*this.isoT,t=1/(1-(1-lt)*this.isoT),o=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let r of o){let s=r.find("Text");for(let n of s){let l=n.getAttr("uprightBase");l==null&&(l=n.rotation(),n.setAttr("uprightBase",l)),n.rotation(l-e),n.scaleX(1),n.scaleY(t),n.skewX(0)}}}applyElevation(){let e=this.isoT;for(let t of this.sections){if(t.liftWorld<=0)continue;let o=this.isoLiftLocal(t.liftWorld);t.liftGroupBg?.position(o),t.liftGroupSeat.position(o),this.labelLiftGroups.get(t.id)?.position(o);let r=.9*e;for(let s=0;s<t.sideFaces.length;s++){let n=t.sideFaces[s],l=t.outline[s],a=t.outline[(s+1)%t.outline.length];n.points([l.x,l.y,a.x,a.y,a.x+o.x,a.y+o.y,l.x+o.x,l.y+o.y]),n.opacity(r)}}this.syncSeatOverlayPositions()}destroy(){this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.rafId&&cancelAnimationFrame(this.rafId),this.isoRaf&&cancelAnimationFrame(this.isoRaf),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),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 t=this.focusedSectionId;return t==null||e.id===t||e.logicalId===t||e.zone===t}focusedSeatOpacity(e,t){if(!this.focusedSectionId||!this.focusDimOverlay)return t;let o=this.seatSection.get(e);return t*(o&&this.sectionMatchesFocus(o)?1:Oe)}sectionScreenBounds(e){return vs({viewMode:this.viewMode,isoT:this.isoT,stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y(),projectedSectionPoint:(t,o)=>this.projectedSectionPoint(t,o),isoLiftLocal:t=>this.isoLiftLocal(t),isoForward:t=>this.isoForward(t)},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=le,t=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,o=96,r=this.stage.width(),s=this.stage.height();for(let n of this.sections){let l=!0;if(e){let c=this.sectionScreenBounds(n);l=c.x+c.width>=-o&&c.y+c.height>=-o&&c.x<=r+o&&c.y<=s+o,l&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,n.memberIds)}n.liftGroupSeat.setViewportCulled(!l),this.labelLiftGroups.get(n.id)?.setViewportCulled(!l)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,this.seats.filter(n=>!this.seatSection.has(n.id)).map(n=>n.id))}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let t of this.sections)if(!t.liftGroupSeat.isViewportCulled())for(let o of t.memberIds){let r=this.seatById.get(o);r&&e.push(r)}for(let t of this.seats)this.seatSection.has(t.id)||e.push(t);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 t=this.seatSection.get(e.id);if(!t||t.liftWorld<=0||this.isoT===0)return e;let o=this.isoLiftLocal(t.liftWorld);return{x:e.x+o.x,y:e.y+o.y}}seatLabelContainer(e){let t=this.seatSection.get(e);if(!t)return this.labelGroup;let o=this.labelLiftGroups.get(t.id);return o||(o=new yt({listening:!1}),o.setViewportCulled(t.liftGroupSeat.isViewportCulled()),o.position(this.viewMode==="perspective"?{x:0,y:0}:this.isoLiftLocal(t.liftWorld)),this.labelGroup.add(o),this.labelLiftGroups.set(t.id,o)),o}syncSeatOverlayPositions(){if(this.hoveredId){let e=this.seatById.get(this.hoveredId);if(e){this.hoverRing.position(this.renderedSeatPoint(e));let t=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.hoverRing.scale({x:t,y:t})}}if(this.focusedId){let e=this.seatById.get(this.focusedId);if(e){this.focusRing.position(this.renderedSeatPoint(e));let t=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.focusRing.scale({x:t,y:t})}}for(let[e,t]of this.selectionMarkers){let o=this.seatById.get(e);if(o){t.position(this.renderedSeatPoint(o));let r=this.viewMode==="perspective"?this.perspectiveSeatScale.get(o.id)??1:1;t.scale({x:r,y:r})}}}renderSeats(e=this.seats){Fs({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,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:t=>this.seatContainer(t),buildAccessGlyph:(t,o)=>this.buildAccessGlyph(t,o),paintSeat:(t,o)=>this.paintSeat(t,o),labelFont:()=>this.labelFont()})}buildAccessGlyph(e,t){let o=this.seatR*1.5/xe,r=new sh({x:e.x,y:e.y,data:_t(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:Ti(t),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return ni(r),r}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[t,o]of this.accessGlyphById){let r=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1,s=this.seatR*1.5/xe*r,l=this.accessGlyphFilterEmphasized(t)?mr:fr,a=Math.max(s,l/(xe*Math.max(e,.001)));o.scale({x:a,y:a}),o.visible(this.accessGlyphShouldShow(t))}}accessGlyphFilterEmphasized(e){let t=this.seatById.get(e),o=this.accessFilter;return!!t&&o!==null&&!!t.accessibility?.includes("wheelchair")&&(o.length===0||o.includes("wheelchair"))&&ke(t,o)}accessGlyphShouldShow(e){return this.accessGlyphById.has(e)&&this.accessGlyphEligible(e)}accessGlyphEligible(e){let t=this.statusById.get(e)??"free";return!(t==="booked"||t==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryPriceLabel(e){let t=this.catPrice.get(e);return typeof t=="number"?dt(t,this.currency):null}categoryDisplayColor(e){return this.colorblind?this.cbHueByKey.get(e)??Zt[0]:this.catColor.get(e)??"#6e7bff"}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??pt}seatLabelInk(e,t){let o=t.fill();return U(typeof o=="string"?o:"",this.seatPreferredLabelInk(e))}paintSeat(e,t){let o=this.seatById.get(t),r=this.statusById.get(t)??"free",s=this.selection.has(t),n=this.categoryDisplayColor(o.categoryKey),l=this.boothLabelById.get(t);e.dash(ga),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let a=r==="held"&&this.ownedHold.has(t),c=a?null:Tn(r,this.canvasBackground,this.colorblind);if(c?(e.fill(c.fill),e.stroke(c.stroke),e.strokeWidth(c.strokeWidth),e.dash(c.dash),e.opacity(c.opacity),c.scale!==1&&e.scale({x:c.scale,y:c.scale})):a?(e.fill(Te(n,this.effSelection===ft?.24:.1)),e.stroke(this.effSelection),e.strokeWidth(3)):e.fill(s&&this.effSelection===ft?Te(n,.28):n),this.seatMarks.paint(e,t,r,n,this.seatR,this.colorblind,this.seatInClosedSection(t)),oo(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&r==="free"&&(e.stroke(xt(o.accessibility)),e.strokeWidth(s?3:2),e.dash([3,2])),l&&(l.text(r==="booked"?"SOLD":r==="held"?"HELD":o.label),l.fontSize(r==="free"?10:Math.min(10,Math.max(6,this.boothDims.get(o.rowId)?.width??40)/6)),l.fontStyle(r==="free"?"600":"800"),l.fill(r==="free"?this.theme.seatLabelColor??pt:"#ffffff"),l.offsetX(l.width()/2),l.offsetY(l.height()/2)),this.accessFilter&&r==="free"&&!s){let u=Vi(o,this.accessFilter);u==="other"?e.opacity(xs):u==="companion"&&e.opacity(Cs)}if(this.categoryHighlight&&r==="free"&&!s&&o.categoryKey!==this.categoryHighlight&&e.opacity(.25),this.categoryFilter&&r==="free"&&!s&&!this.categoryFilter.has(o.categoryKey)&&e.opacity(.22),this.commercialLimitedFilter&&r==="free"&&!s&&(o.commercial?.restrictedView||o.commercial?.obstructedView)&&e.opacity(.22),this.dimmedSections.size){let u=this.seatSection.get(t);(u?this.dimmedSections.has(u.id)||this.dimmedSections.has(u.logicalId)||u.zone!=null&&this.dimmedSections.has(u.zone):this.dimmedSections.has(Bo))&&e.opacity(.18)}this.closedSections.size&&this.seatInClosedSection(t)&&(e.fill(Wr),e.stroke(""),e.strokeWidth(0),e.dash(ga),e.opacity(Vr),e.scale({x:1,y:1})),this.selectionFocusId&&t!==this.selectionFocusId&&e.opacity(Math.min(e.opacity(),.16));let h=this.boothLabelById.get(t)??this.seatLabelById.get(t);h&&(h.fill(this.seatLabelInk(o,e)),h.visible(me(h.fontSize(),this.effScale())&&e.opacity()>=.5));let d=this.accessGlyphById.get(t);if(d){let u=e.fill();d.fill(Ti(typeof u=="string"?u:"")),d.opacity(e.opacity()),d.visible(this.accessGlyphShouldShow(t))}this.accessRingById.get(t)?.opacity(e.opacity())}seatInClosedSection(e){if(!this.closedSections.size)return!1;let t=this.seatSection.get(e);return!!t&&(this.closedSections.has(t.id)||this.closedSections.has(t.logicalId)||t.zone!=null&&this.closedSections.has(t.zone))}setColorblindSafe(e){if(e!==this.colorblind){this.colorblind=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}for(let t of this.sections)t.shellCategoryColor=this.dominantSellableColor(t.memberIds),this.refreshSectionFill(t);this.bgLayer.batchDraw(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setDimmedSections(e){let t=new Set(e??[]);if(!(t.size===this.dimmedSections.size&&[...t].every(o=>this.dimmedSections.has(o)))){this.dimmedSections=t;for(let o of this.seats){let r=this.circleById.get(o.id);r&&this.paintSeat(r,o.id)}this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setClosedSections(e){let t=new Set(e??[]);t.size===this.closedSections.size&&[...t].every(o=>this.closedSections.has(o))||(this.closedSections=t,this.repaintSectionsAndSeats())}focusSection(e,t){this.sections.some(o=>o.id===e||o.logicalId===e)&&(this.focusedSectionId=e,this.focusAnchor=t?.anchor??null,this.focusRoams=!1,this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),this.focusSectionCamera(e,!0,t?.anchor))}focusSectionCamera(e,t=!0,o){let r=this.sectionBounds(e);if(!r)return;let s=this.sectionMembers(e).map(c=>this.seatById.get(c)).filter(c=>c!=null),n=s.filter(c=>(this.statusById.get(c.id)??"free")==="free"||this.ownedHold.has(c.id)),l=(n.length?n:s).map(c=>this.renderedSeatPoint(c)),a=this.narrowSeatDetailFocus(l,r,o);this.focusRegion(a?.bounds??r,{animate:t,minScale:a?.minScale})}releaseSectionFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusRoams=!0,this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}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.focusedSectionId||this.floorOverview?!0:this.effScale()>=_e}seatsPickable(){return this.focusedSectionId||this.floorOverview?!0:this.effScale()>=ho(this.markerR)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let t=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=rn(this.focusBackdropHost,t),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=sn(this.focusBackdropHost,t);for(let o of this.selectionMarkers.values())o.moveToTop();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,t)=>this.projectedSectionPoint(e,t),isoLiftLocal:e=>this.isoLiftLocal(e)}}repaintSectionsAndSeats(){for(let e of this.seats){let t=this.circleById.get(e.id);t&&this.paintSeat(t,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}),t=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y)}}getWorldBounds(){let e=1/0,t=1/0,o=-1/0,r=-1/0,s=(n,l)=>{n<e&&(e=n),l<t&&(t=l),n>o&&(o=n),l>r&&(r=l)};for(let n of this.seats)s(n.x,n.y);for(let n of this.sections)for(let l of n.outline)s(l.x,l.y);for(let n of this.gaById.values())for(let l of n.points)s(l.x,l.y);return Number.isFinite(e)?{x:e,y:t,width:Math.max(1,o-e),height:Math.max(1,r-t)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(t=>{let o=this.isSectionClosed(t)||t.free<=0,r=t.memberIds.some(l=>this.selection.has(l)),s=r||t.memberIds.some(l=>this.ownedHold.has(l)),n=this.focusedSectionId===t.id||this.focusedSectionId===t.logicalId;return{id:t.logicalId,label:t.label,outline:t.outline.map(l=>({...l})),...this.objectFloor.get(t.id)?{floorId:this.objectFloor.get(t.id)}:{},state:r?"selected":o?"inactive":"available",active:n,paint:{fill:t.shellFill,stroke:t.shellStroke},owned:s}});return{sections:e,seats:e.length?[]:this.seats.map(t=>({x:t.x,y:t.y,categoryKey:t.categoryKey,state:this.selection.has(t.id)?"selected":this.statusById.get(t.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let t=this.worldToScreen(e);this.stage.position({x:this.stage.x()+this.stage.width()/2-t.x,y:this.stage.y()+this.stage.height()/2-t.y}),this.afterViewChange(),this.stage.batchDraw()}setCategoryHighlight(e){if(this.categoryHighlight!==e){this.categoryHighlight=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}renderBackground(e){let t=st(e);t&&this.renderBackgroundImage(t);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,t,o,r){let s=this.assetGeneration;/^https?:\/\//i.test(t)&&(e.crossOrigin="anonymous");let n=new Promise(l=>{let a=!1,c=()=>{a||(a=!0,this.assetCancels.delete(h),l())},h=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}c()};this.assetCancels.add(h),e.onload=()=>{if(!this.exportMode){s===this.assetGeneration&&r(),c();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.assetGeneration&&r()}).catch(()=>{s===this.assetGeneration&&this.assetErrors.push(`${o} could not be decoded.`)}).finally(c)},e.onerror=()=>{s===this.assetGeneration&&this.assetErrors.push(`${o} could not be loaded.`),c()},e.src=t});this.assetPromises.push(n)}cancelAssetLoads(){this.assetGeneration++;for(let e of[...this.assetCancels])e();this.assetCancels.clear(),this.assetPromises=[],this.assetErrors=[]}renderBackgroundImage(e){On(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,t,o,r)=>this.trackAssetImage(e,t,o,r),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){Dn(this.objectDrawContext,e)}renderTable(e){Gn(this.objectDrawContext,e)}renderText(e){Hn(this.objectDrawContext,e)}renderShape(e){Nn(this.objectDrawContext,e)}renderGA(e){Vn(this.objectDrawContext,e)}renderSection(e){let t=It(e.outline,e.holes),o=te(this.canvasBackground),r=[],s=new Map,n=0,l=V(e.outline),a=this.seatIndex?Gt(this.seatIndex,l).map(C=>this.seatById.get(C)).filter(C=>!!C):this.seats;for(let C of a)this.seatSection.has(C.id)||oe(C,e.outline,e.holes)&&(r.push(C.id),s.set(C.categoryKey,(s.get(C.categoryKey)??0)+1),(this.statusById.get(C.id)??"free")==="free"&&n++);let c=e.color??Li([...s].map(([C,A])=>({hex:this.catColor.get(C)??"#6e7bff",w:A})),"#3a4358"),h=Mo(e.elevation),d=Ct(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),u=d.height*Ke,f=new vt({listening:!1});this.bgLayer.add(f);let y=new vt({listening:!1});f.add(y);let m=new yt({listening:!0});this.seatLayer.add(m);let p=[];if(u>0){let C=ue(this.zoneColor.get(e.zone??"")??c,.42);for(let A=0;A<e.outline.length;A++){let _=new rh({points:[],closed:!0,fill:C,stroke:F("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});p.push(_),f.add(_)}}y.moveToTop();let g=y,b=e.color??this.zoneColor.get(e.zone??"")??"#3a4358",S=Ne(e.outline,e.holes,{stroke:F(b,.5),strokeWidth:1,fill:F(b,.08),listening:!1},e.outlinePath);g.add(S);let v=Ne(e.outline,e.holes,{fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Fe,opacity:0,listening:!1},e.outlinePath);g.add(v);let w=e.labelPresentation?.labelStyle,k=w?.color??o.sectionInk,L=(w?.size??18)/18,x=new ma({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});g.add(x);let T=new ya({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*L,fontStyle:we,fontFamily:this.labelFont(),fill:U(o.sectionFill,k),listening:!1,perfectDrawEnabled:!1});T.offsetX(T.width()/2),T.offsetY(T.height()/2),g.add(T);let I=new ya({x:t.x,y:t.y,text:$("map.seatsLeft",{count:n}),fontSize:12,fontStyle:Xt,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});I.offsetX(I.width()/2),g.add(I);let P={id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:t,labelAnchors:Ss(e.outline,e.holes??[],t),memberCategoryKeys:new Set(r.map(C=>this.seatById.get(C)?.categoryKey).filter(Boolean)),shellCategoryColor:this.dominantSellableColor(r),shellFill:o.sectionFill,shellStroke:o.sectionStroke,labelArea:Io(e.outline,e.holes),zone:e.zone,memberIds:r,total:r.length,free:n,baseFill:c,outlineTint:b,outlinePoly:S,blockPoly:v,namePlate:x,nameLabel:T,subLabel:I,preferredInk:k,labelScale:L,nameLabelFits:!1,subLabelFits:!0,elevation:h,liftWorld:u,rakeDeg:d.rake,surfaceFocal:r.length?{...this.seatById.get(r[0])?.focalPoint??this.isoCentre}:{...this.chartDoc?.focalPoint??this.isoCentre},frontDistanceWorld:0,rootGroupBg:f,bgZIndex:f.zIndex(),seatZIndex:m.zIndex(),liftGroupBg:y,liftGroupSeat:m,sideFaces:p},M=r.map(C=>this.seatById.get(C)).filter(C=>!!C),R=M.length?M:e.outline;P.frontDistanceWorld=Math.min(...R.map(C=>Math.hypot(C.x-P.surfaceFocal.x,C.y-P.surfaceFocal.y)));for(let C of r)this.seatSection.set(C,P);this.refreshSectionFill(P),this.refreshSectionHeat(P),this.sections.push(P)}refreshSectionHeat(e){Ks(this.sectionLodPaintContext,e)}refreshSectionFill(e){Ys(this.sectionLodPaintContext,e)}isSectionClosed(e){return $i(this.sectionLodPaintContext,e)}dominantSellableColor(e){let t=zr(e,o=>this.seatById.get(o)?.categoryKey,o=>this.catByKey.get(o)?.notForSale===!0);return t?this.categoryDisplayColor(t):null}sectionAccessibleFree(e){return zs(e.memberIds,this.accessFilter,t=>this.statusById.get(t)??"free",t=>this.seatById.get(t))}get sectionLodPaintContext(){return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:e=>e.memberIds.some(t=>this.selection.has(t)||this.ownedHold.has(t)),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.floorOverview,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,setLodScale:e=>{this.lodScale=e},worldToScreen:e=>this.worldToScreen(e)}}renderZones(e){Ts({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let t=this.stage.scaleX(),o={x:(e.x-this.stage.x())/t,y:(e.y-this.stage.y())/t};return this.viewMode==="perspective"&&this.perspectiveBaseInverse?ae(this.perspectiveBaseInverse,o):this.isoT===0?o:this.isoInverse(o)}sectionAt(e){if(!this.sections.length)return null;let t=this.screenToWorld(e),o=this.sections.find(r=>{if(this.viewMode==="perspective"&&r.perspectiveAffine)return oe(t,r.outline.map(n=>this.perspectiveLocalPoint(this.projectedSectionPoint(r,n))),r.holes.map(n=>n.map(l=>this.perspectiveLocalPoint(this.projectedSectionPoint(r,l)))));let s=r.liftWorld>0?this.isoLiftLocal(r.liftWorld):{x:0,y:0};return oe({x:t.x-s.x,y:t.y-s.y},r.outline,r.holes)});return o?o.logicalId:null}sectionMembers(e){return[...new Set(this.sections.filter(t=>t.id===e||t.logicalId===e||t.zone===e).flatMap(t=>t.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 t=this.seatById.get(e);return t?Vi(t,this.accessFilter)==="other":!1}toggleSeat(e){if(this.selection.has(e)){this.setSelected(e,!1);let t=this.seatById.get(e);t&&this.opts.onDeselect?.(t)}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 t=this.seatById.get(e);t&&this.opts.onSelect?.(t)}this.overlayLayer.batchDraw()}resolveCanvasBackground(){let e=this.theme.background?ki(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let t=this.container;for(;t;){let o=ki(getComputedStyle(t).backgroundColor);if(o)return o;t=t.parentElement}}return zi}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:W(this.canvasBackground)?Is:ft}setSelected(e,t,o=!1){let r=this.circleById.get(e);t?this.selection.add(e):(this.selectionFocusId===e&&this.setSelectionFocus(null),this.selection.delete(e)),r&&(this.paintSeat(r,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())}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:(t,o)=>this.projectedSectionPoint(t,o),isoLiftLocal:t=>this.isoLiftLocal(t),isoForward:t=>this.isoForward(t),renderedSeatPoint:t=>this.renderedSeatPoint(t),labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(t,o,r)=>this.resolveAutomaticRowLabelPosition(t,o,r),rowLabelBox:(t,o)=>this.rowLabelBox(t,o)},e)}sectionFrameScale(e){let t=this.sectionBounds(e);return t?Je(this.stage,t,this.zoomBounds(),this.framingViewport()):this.stage.scaleX()}handleSeatTap(e){if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let o=this.objectFloor.get(this.seatById.get(e)?.rowId??"");if(o){this.opts.onDeckTap(o);return}}if(this.effScale()<re&&this.sections.length){let o=this.seatSection.get(e);if(o){let r=this.focusedSectionId===o.logicalId,s=this.sectionFrameScale(o.logicalId)>this.stage.scaleX()*1.02;if(!r&&s){let n=this.seatById.get(e),l=n?this.renderedSeatPoint(n):void 0;this.opts.onSectionTap?this.opts.onSectionTap(o.logicalId,l):this.focusSection(o.logicalId,{anchor:l});return}}}if(!(this.selection.has(e)||this.isSelectable(e))){let o=this.seatById.get(e)??null;o&&(this.opts.onHover?.(o,{mark:this.seatMarks.get(e)??null,interaction:"press",unavailable:!0,...this.hiddenByAccessFilter(e)?{filteredOut:!0}:{}}),this.moments.nudge(e));return}this.seatMarks.has(e)&&this.opts.onHover?.(this.seatById.get(e)??null,{mark:this.seatMarks.get(e),interaction:"press"}),this.toggleSeat(e)}deckFloorAt(){return Os(this.screenPickingHost)}nearestSeatToScreen(e,t,o=!1){return Bs(this.screenPickingHost,e,t,{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(){this.seatLayer.on("click tap",e=>{if(this.moved>Ce||this.isGhostClick(e))return;let t=fo(e.target);t&&this.seatsPickable()&&this.handleSeatTap(t)}),this.seatLayer.on("mouseover",e=>{let t=fo(e.target);if(!t)return;let o=this.seatById.get(t);if(!o)return;this.hoveredId=t,this.hoverRing.position(this.renderedSeatPoint(o));let r=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1;this.hoverRing.scale({x:r,y:r}),this.hoverRing.visible(!0),this.overlayLayer.batchDraw(),this.clusterLabels.syncCursor(!0),this.opts.onHover?.(o,{mark:this.seatMarks.get(t),interaction:"hover"})}),this.seatLayer.on("mouseout",()=>{this.hoveredId=null,this.hoverRing.visible(!1),this.overlayLayer.batchDraw(),this.clusterLabels.syncCursor(!1),this.opts.onHover?.(null,{mark:null})}),this.stage.on("wheel",e=>{e.evt.preventDefault(),this.releaseSectionFocusDim();let t=this.container.getBoundingClientRect(),o={x:e.evt.clientX-t.left,y:e.evt.clientY-t.top},r=Math.exp(-e.evt.deltaY*.002);this.zoomAbout(this.stage.scaleX()*N(r,.5,2),o)}),this.stage.on("click tap",e=>{if(this.moved>Ce||this.isGhostClick(e))return;let t=this.stage.getPointerPosition();if(!t)return;if(!this.cached){if(fo(e.target)&&this.seatsPickable())return;if(this.seatsPickable()){let r=this.focusedSectionId,s=this.nearestSeatToScreen(t,Ee),n=s?this.seatSection.get(s):null;if(s&&(!r||n&&this.sectionMatchesFocus(n))){this.handleSeatTap(s);return}let l=s?null:this.nearestSeatToScreen(t,Ee,!0),a=l?this.seatSection.get(l):null;if(l&&(!r||a&&this.sectionMatchesFocus(a))){this.handleSeatTap(l);return}if(r&&this.opts.onBackdropTap&&!this.floorOverview){let h=this.sectionAt(t);if(h&&h!==r){let d=this.sectionTapAnchor(h,this.screenToWorld(t));this.opts.onSectionTap?this.opts.onSectionTap(h,d):this.focusSection(h,{anchor:d})}else h||this.opts.onBackdropTap();return}if(r)return;let c=this.sections.length?this.sectionAt(t):null;if(!c||this.effScale()>=re||this.sectionFrameScale(c)<=this.stage.scaleX()*1.02)return}}if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let r=this.floorOverview?this.sectionAt(t):null,s=(r?this.objectFloor.get(r):null)??this.deckFloorAt();if(s){this.opts.onDeckTap(s);return}}if(this.sections.length){let r=this.screenToWorld(t),s=this.owned.badgeAt(r)??this.sectionAt(t);if(s){let n=this.sectionTapAnchor(s,r);this.opts.onSectionTap?this.opts.onSectionTap(s,n):this.focusSection(s,{anchor:n});return}}if(this.clusterLabels.focusCluster(t)||this.clusterLabels.glideTowardTap(t))return;let o=Math.max(Ae*1.2,this.stage.scaleX()*2.5);this.zoomAbout(o,t)})}zoomBounds(){let e=.5*this.fitScale;return this.zones.length&&(e=Math.min(e,Xe*.9)),{min:e,max:Math.max(10*this.fitScale,4,ta(this.markerR))}}zoomAbout(e,t){Gs(this.stage,e,t,this.zoomBounds())&&(this.afterViewChange(),this.stage.batchDraw())}zoomToBounds(e,t){Hs(this.stage,e,this.zoomBounds(),t,this.framingViewport()),this.settleView(),this.stage.batchDraw()}focusRegion(e,t){let o=typeof e=="string"?this.sectionBounds(e):e;if(!o)return;if(this.cancelGlide(),t?.animate===!1||this.reducedMotion){this.zoomToBounds(o,t?.minScale);return}let r=this.framingViewport(),s=r.width,n=r.height,{min:l,max:a}=this.zoomBounds(),c=1.12,h=Math.min(s/(o.width*c),n/(o.height*c)),d=N(Math.max(h,t?.minScale??l),l,a),u=r.x+s/2-(o.x+o.width/2)*d,f=r.y+n/2-(o.y+o.height/2)*d,y=this.stage.scaleX(),m=this.stage.x(),p=this.stage.y();if(Math.abs(d-y)<1e-4&&Math.abs(u-m)<.5&&Math.abs(f-p)<.5){this.settleView();return}let g=performance.now(),b=Math.max(180,Math.min(1200,t?.durationMs??this.cameraGlideMs));this.glideInProgress=!0;let S=v=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let w=Math.min(1,(v-g)/b),k=w<.5?4*w*w*w:1-Math.pow(-2*w+2,3)/2,L=y+(d-y)*k;this.stage.scale({x:L,y:L}),this.stage.position({x:m+(u-m)*k,y:p+(f-p)*k}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),w<1?this.glideRaf=requestAnimationFrame(S):(this.glideRaf=0,this.glideInProgress=!1,this.settleView())};this.glideRaf=requestAnimationFrame(S)}applyLabelVisibility(e){let t=e!==this.labelsVisible;if(this.labelsVisible=e,!t||!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 r=s=>{if(this.destroyed){this.labelFadeRaf=0;return}let n=Math.min(1,(s-o)/150);this.labelGroup.opacity(n),this.stage.batchDraw(),this.labelFadeRaf=n<1?requestAnimationFrame(r):0};this.labelFadeRaf=requestAnimationFrame(r)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){let e=this.effScale();return e>=le?"seats":this.zones.length&&e<Xe?"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,t)=>this.focusedSeatOpacity(e,t),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),_n(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let t=e==="sections"?(be+le)/2:this.seatRungScale(),o=this.framingViewport(),r=o.width,s=o.height,n=oi(this.framingWorldRect()),l=n.x,a=n.y;if(e==="sections"&&this.sections.length>0){let u=this.sections.map(p=>{let g=V(p.outline);return{x:g.x+g.width/2,y:g.y+g.height/2}}),f=r/(t*2),y=s/(t*2);if(!u.some(p=>Math.abs(p.x-n.x)<=f&&Math.abs(p.y-n.y)<=y)){let p=u.reduce((g,b)=>{let S=(b.x-n.x)**2+(b.y-n.y)**2;return S<g.distance?{point:b,distance:S}:g},{point:u[0],distance:1/0});l=p.point.x,a=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 y of c){let m=y.x-n.x,p=y.y-n.y,g=m*m+p*p;g<f&&(u=y,f=g)}l=u.x,a=u.y}let h=r/(t*1.12),d=s/(t*1.12);this.focusRegion({x:l-h/2,y:a-d/2,width:h,height:d})}seatRungScale(){return fn(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,t,o){let r=this.framingViewport();return mn({stageWidth:r.width,stageHeight:r.height,fullBounds:t,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}seatLabelTargetScale(){return nn({seats:this.seats,seatR:this.seatR,labelFont:()=>this.labelFont(),seatLabelScale:e=>this.seatLabelScale(e)})}afterViewChange(){this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){if(!this.focusRoams||!this.focusedSectionId||this.floorOverview)return;let e=ws({sections:this.sections.map(t=>({logicalId:t.logicalId,members:t.memberIds.length,bounds:this.sectionScreenBounds(t)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!e||e===this.focusedSectionId||(this.focusedSectionId=e,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(e))}scheduleViewChange(){this.exportMode||this.viewChangeRaf||(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()}))}sizeLabel(e,t,o){e.fontSize(Math.max(1,t)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(o)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),Se+.01,re):this.effScale(),t=Math.max(e,1e-4);for(let[s,n]of this.primaryFocalLabels)Wn(s,n,t,(l,a)=>{this.sizeLabel(l,a,l.y())});this.hasSections?(Us(this.sectionLodPaintContext,e),this.owned.sync(e)):(this.clusterLabels.syncForCamera(e)||this.primaryFocalLabels.size)&&this.bgLayer.batchDraw(),this.clusterLabels.syncCursor(this.hoveredId!=null),this.paintGAStateForView(),this.updateAccessGlyphs(e),this.seatGlyphDetail=_s(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail);let o=!this.exportMode&&e<le;if(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)return;this.updateSeatGroupVisibility();let e=N(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.rebuildSeatCache(),this.seatLayer.batchDraw()}releaseSeatLayerBitmap(){qn(ci,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<le?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.assetGeneration,t=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assetPromises.slice(),...t?[t.ready.then(()=>{}),t.load("700 24px Inter").then(()=>{}),t.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assetGeneration)throw new Error("The chart changed while its export assets were loading.");if(this.assetErrors.length)throw new Error(`Export stopped because ${this.assetErrors.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(n=>n.getClientRect({relativeTo:this.stage})).filter(n=>n.width>0&&n.height>0);if(!e.length)return this.bounds;let t=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y)),r=Math.max(...e.map(n=>n.x+n.width)),s=Math.max(...e.map(n=>n.y+n.height));return{x:t,y:o,width:Math.max(1,r-t),height:Math.max(1,s-o)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),t=this.stage.height(),o=Math.max(12,Math.min(36,Math.min(e,t)*.025)),r=()=>{let s=this.exportSceneBounds(),n=Math.max(1,e-o*2),l=Math.max(1,t-o*2),a=Math.min(n/s.width,l/s.height)||1;this.fitScale=a,this.stage.scale({x:a,y:a}),this.stage.position({x:(e-s.width*a)/2-s.x*a,y:(t-s.height*a)/2-s.y*a}),this.afterViewChange()};r(),r()}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(r){let s=r instanceof Error?r.message:String(r);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${s}`)}let t=document.createElement("canvas");t.width=this.stage.width(),t.height=this.stage.height();let o=t.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,t.width,t.height);try{o.drawImage(e,0,0)}finally{e.width=1,e.height=1}return t}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),re):this.effScale();for(let{node:t,backdrop:o,kind:r}of this.freeTextById.values()){if(r==="ga-label"||r==="ga-capacity")continue;let s=r==="free-text"&&this.nodeBelongsToFocusedSection(t),n=r==="direct-landmark";if(n){let a=Number(t.getAttr("directLandmarkBaseFontSize"))||t.fontSize();t.setAttr("directLandmarkBaseFontSize",a),t.fontSize(Math.max(a,G/e))}let l=n||s||me(t.fontSize(),e);t.visible(l),o?.visible(l)}for(let{node:t,fontSize:o}of this.iconNodeById.values())t.visible(this.nodeBelongsToFocusedSection(t)||me(o,e))}nodeBelongsToFocusedSection(e){let t=this.focusedSectionId;if(!t)return!1;let o=this.sections.filter(n=>n.id===t||n.logicalId===t||n.zone===t);if(!o.length)return!1;let r=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),s={x:r.x+r.width/2,y:r.y+r.height/2};return o.some(n=>oe(s,n.outline,n.holes))}buildRowLabelPlan(e){this.rowLabelPlan=Un(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:t=>this.objectFilteredOut(t)})}rowLabelBox(e,t,o=Q){return lo(e,t,o)}resolveAutomaticRowLabelPosition(e,t,o){return $n(e,t,o,this.seatIndex)}objectFilteredOut(e){let t=e.categoryKey;return t?!!(this.categoryHighlight&&t!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(t)):!1}updateLabels(){ia(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,t)=>this.focusedSeatOpacity(e,t),labelGroup:this.labelGroup,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),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,t,o)=>this.resolveAutomaticRowLabelPosition(e,t,o),rowLabelBox:(e,t)=>this.rowLabelBox(e,t),isoT:this.isoT,applyUprightLabels:()=>this.applyUprightLabels(),overlayLayer:this.overlayLayer}}handleResize(){let e=this.container.clientWidth||1,t=this.container.clientHeight||1;e===this.stage.width()&&t===this.stage.height()||(this.stage.size({width:e,height:t}),this.refitCurrentView())}};wt.ZOOM_STEP=1.4;var mo=wt;function ba(i,e){return new mo(i,e)}function Sa(i,e,t){let o=new Map,r=new Map,s=new Map,n=new Map,l=[],a=new Map(Ro(i).map(d=>[d.id,d])),c=Rt(i),h=new Map([...c.sections,...c.ungrouped?[c.ungrouped]:[]].map(d=>[d.id,d.label]));for(let d of e){o.set(d.label,d.id),r.set(d.label,d),s.set(d.id,d),l.push(d.id);let u=a.get(d.rowId),f=u&&"label"in u&&typeof u.label=="string"?u.label:void 0,y=u?.type==="row"?u.segmentedRow:void 0,m=y?.displayLabel??(u&&"displayLabel"in u&&typeof u.displayLabel=="string"&&u.displayLabel?u.displayLabel:f),p=t.get(d.rowId),g=u?.type==="table"?"table":u?.type==="booth"?"booth":"seat",b=m,S=y?.displayType?.trim()||(u&&"displayType"in u&&typeof u.displayType=="string"&&u.displayType.trim()?u.displayType.trim():void 0),v=d.displayLabel??d.label,w=v.split("-"),k=p||d.kind==="booth"?void 0:m&&v.startsWith(`${m}-`)?v.slice(m.length+1):w[w.length-1]??v;n.set(d.id,{objectId:d.rowId,objectType:g,sectionLabel:h.get(c.objectToSection.get(d.rowId)??""),rowLabel:b,seatNumber:k,...S?{displayType:S,rowType:S}:{}})}return{labelToId:o,labelToSeat:r,seatById:s,seatContext:n,allIds:l}}function va(i,e={}){let{baseMs:t=1e3,factor:o=2,maxMs:r=1/0,jitter:s=0,random:n=Math.random}=e,l=Math.min(t*o**Math.max(0,i),r);if(s<=0)return l;let a=Math.min(1,s);return l*(1-a+a*n())}function wa(i,e,t){return ot(i).map(o=>{let r=i.categories.find(s=>s.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:Mt(o).filter(s=>t(s)==="free").length,categoryKey:o.categoryKey,tiers:r?.tiers,price:r?.tiers?.[0]?.price??r?.price??0,currency:e}})}function ka(i,e){let t={};for(let o of i)t[o.id]=e?{available:o.available,selected:e.get(o.id)??0}:{available:o.available};return t}function La(i){let e={};for(let[t,o]of i.seatById)i.groupedTableBySeatId.has(t)||i.closedMembers.has(t)||(i.statusOf(t)??"free")==="free"&&(e[o.categoryKey]=(e[o.categoryKey]??0)+1);for(let t of i.groupedTablesByLabel.values()){if(t.chairs.some(r=>i.closedMembers.has(r.id)))continue;let o=t.chairs[0];o&&(i.statusOf(o.id)??"free")==="free"&&(e[t.categoryKey]=(e[t.categoryKey]??0)+t.maxOccupancy)}for(let t of i.gaAreas??[])e[t.categoryKey]=(e[t.categoryKey]??0)+t.available;return e}function nh(i){return i.accessibility?.length?i.accessibility:i.accessible?["wheelchair"]:[]}function Ta(i,e){let t=new Set,o=new Map;for(let r of i){let s=nh(r);if(!s.length)continue;let n=e(r.id)==="free";for(let l of s)t.add(l),n&&o.set(l,(o.get(l)??0)+1)}return t.size?xo.filter(r=>t.has(r.key)).map(r=>({key:r.key,count:o.get(r.key)??0})):[]}var By=5e3,Oy={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function ah(i){if(!i.holdActive||i.holdLabels.length===0)return!1;let e=i.now??Date.now();return i.holdExpiresAt!=null&&e>=i.holdExpiresAt+5e3||i.serverHoldActive===!1?!0:!i.holdLabels.some(t=>i.statusOf(t)==="held")}function xa(i){let e=new Set(i.holdLabels),t=i.selection.filter(r=>!e.has(r)&&i.statusOf(r)!=="free");if(!ah(i))return{lost:t,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let o=[...i.holdLabels];return{lost:t,holdLapsed:!0,lapsedLabels:o,recoverable:o.filter(r=>i.statusOf(r)==="free")}}function Dy(i){return i.lost.length>0||i.holdLapsed}function Gy(i){return!i.lapsedLabels.length||!i.recoverable.length?"none":i.recoverable.length===i.lapsedLabels.length?"all":"partial"}function Ca(i,e,t=Date.now()){return e&&t<i+5e3}function Ia(i){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let e=()=>{document.visibilityState==="visible"&&i()};return document.addEventListener("visibilitychange",e),()=>{typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",e)}}function Pa(i){if(!i?.zones?.length)return[];let e=new Set(Rt(i).sections.filter(t=>t.seatCount>0&&!!t.zone).map(t=>t.zone));return i.zones.filter(t=>e.has(t.id)).map(t=>({id:t.id,label:t.label}))}function Ma(i){let e=i.doc;if(!e?.objects?.length)return null;let t=e.focalPoint??{x:0,y:0},o=ze(e).filter(n=>!i.groupedObjectIds.has(n.rowId)),r=new Set;for(let n of o)i.heldLabels.has(n.label)||i.tierApplies(n)&&(i.accessFilter&&!ke(n,i.accessFilter)||i.statusOfLabel(n.label)==="free"&&r.add(n.label));let s=hr(o,r,{qty:i.qty,categoryKey:i.categoryKey,zoneId:i.zoneId,focal:t,preferPremium:!0});return s.labels.length!==i.qty?null:s.labels.every(n=>i.isPremium(n))?[...s.labels]:null}var yo=["background","rowLabelColor","textColor","selectionColor"];function Ra(i,e){return!i||!e?!i&&!e:yo.every(t=>i[t]===e[t])}function kt(i){let e=i??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function hi(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function Aa(i,e,t){let o=Fo(e,t);o==="all"?i.setFloorOverview?.(!0):o&&i.setActiveFloor?.(o)}var Ie=class extends Error{constructor(t){super(t.message);this.status=422;this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function Ea(i,e){return!e||i.eventConfigurationId===e.id&&i.eventConfigurationVersion===e.version?i:{...i,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var di=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,t){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let o=this.ref;this.pending=e.eventConfiguration(t).then(r=>{if(r.reference.id!==o.id||r.reference.version!==o.version||r.configuration.id!==o.id||r.configuration.version!==o.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return r.configuration})}return this.pending}};function _a(i){if(i!=null&&(!Number.isInteger(i)||i<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return i??null}function Fa(i,e,t,o){if(t!=null&&!Array.isArray(t))throw new TypeError("picker: `selectionValidators` must be an array");let r=[],s=0,n=!1,l=!1;for(let c of t??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");s=Math.max(s,Number(c.minimum))}else if(c?.type==="consecutiveSeats")n=!0;else if(c?.type==="noOrphanSeats")l=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(s&&r.push({type:"minimumSelectedPlaces",minimum:s}),n&&r.push({type:"consecutiveSeats"}),l&&r.push({type:"noOrphanSeats"}),i!=null&&s>i)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let a=Math.max(0,Math.floor(e??i??Math.max(o,s)));if(i!=null&&a<i)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&a<s)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:r,maxSelection:i??a}}function lh(i){let e=Number(i.slice(i.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function ch(i){if(i.length<=1)return!1;let e=i[0]?.objectId,t=i[0]?.categoryKey;if(!e||i.some(r=>r.objectId!==e||r.categoryKey!==t))return!0;let o=i.map(r=>lh(r.id)).sort((r,s)=>r-s);return o.some((r,s)=>r<0||s>0&&r!==o[s-1]+1)}function Ba(i,e,t,o,r){let s=o.find(a=>a.type==="minimumSelectedPlaces")?.minimum??0,n=t??s,l=[];return t!=null&&e!==t&&l.push("numberOfPlacesToSelect"),s&&e<s&&l.push("minimumSelectedPlaces"),o.some(a=>a.type==="consecutiveSeats")&&ch(i)&&l.push("consecutiveSeats"),o.some(a=>a.type==="noOrphanSeats")&&r()&&l.push("noOrphanSeats"),{isValid:l.length===0,count:e,required:n,remaining:Math.max(0,n-e),seats:i,violations:l}}function Oa(i){let{id:e,doc:t,seatById:o,groupedTableBySeatId:r}=i,s=t.objects.find(v=>v.type==="section"&&v.id===e);if(!s)return null;let n=i.sectionMembers(e),l=new Map,a=new Map,c=new Set,h=0,d=0;for(let v of n){let w=o.get(v);if(!w)continue;i.matchesAccessFilter&&i.statusOf(v)==="free"&&i.matchesAccessFilter(w)&&(d+=1);let k=r.get(v);if(k){if(c.has(k.label))continue;c.add(k.label),l.set(k.categoryKey,(l.get(k.categoryKey)??0)+k.maxOccupancy),i.statusOf(k.chairs[0]?.id??v)==="free"&&(h+=k.maxOccupancy,a.set(k.categoryKey,(a.get(k.categoryKey)??0)+k.maxOccupancy))}else l.set(w.categoryKey,(l.get(w.categoryKey)??0)+1),i.statusOf(v)==="free"&&(h++,a.set(w.categoryKey,(a.get(w.categoryKey)??0)+1))}let u=[...l.entries()].map(([v,w])=>{let k=t.categories.find(I=>I.key===v),L=k?.tiers?.length?k.tiers.map(I=>I.price):[k?.price??0],x=Math.min(...L),T=Math.max(...L);return{key:v,count:w,label:k?.label??v,color:k?.color??"#6e7bff",price:x,priceMin:x,priceMax:T}}).sort((v,w)=>v.price-w.price),f=u.map(v=>v.priceMin),y=u.map(v=>v.priceMax),m=s.zone?t.zones?.find(v=>v.id===s.zone):void 0,p=v=>{let w=null,k=0;for(let[L,x]of v)(x>k||x===k&&w!=null&&L<w)&&(w=L,k=x);return w},g=p(a)??p(l),S=(g?u.find(v=>v.key===g)?.color:void 0)??m?.color??s.color??"#6e7bff";return{id:e,...g?{dominantCategoryKey:g}:{},...i.matchesAccessFilter?{accessibleLeft:d}:{},label:s.displayLabel??s.label,zoneLabel:m?.label??"",...s.entrance&&s.entrance.trim()?{entrance:s.entrance.trim()}:{},color:S,seatsLeft:h,priceMin:f.length?Math.min(...f):0,priceMax:y.length?Math.max(...y):0,categories:u}}var ui=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,t=!1){if(!t){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}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};var hh=10,dh=15e3,Da=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new di;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.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 ui;this.accessFilter=null;this.viewportInsets=null;this.hintShown=!1;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=_a(e.numberOfPlacesToSelect);let t=Fa(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,hh);this.selectionValidators=t.validators,this.maxSelection=t.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=Oo(this._doc,this.hidden);if(!this.mapTheme)return e;let t={...e.theme??{}};for(let o of yo){let r=this.mapTheme[o];r&&(t[o]=r)}return{...e,theme:t}}setMapTheme(e){return Ra(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let t=e.getSelection().map(l=>l.id),o=this.getActiveFloorId(),r=e.isFloorOverview?.()??!1,s=e.getFocusedSection?.()??null,n=e.getCameraPose?.();return e.setChart(this.visibleDoc(),o?{floorId:o}:void 0),r&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),t.length&&e.select?.(t),s&&e.focusSection?.(s),n&&e.setCameraPose&&e.setCameraPose(n),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let t=e.filter(r=>typeof r=="string");if(t.length===this.hidden.size&&t.every(r=>this.hidden.has(r)))return!1;this.hidden=new Set(t);let o=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),o&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let t=(e??[]).filter(o=>typeof o=="string");return t.length===this.closedSections.size&&t.every(o=>this.closedSections.has(o))?!1:(this.closedSections=new Set(t),this.renderer?.setClosedSections?.(t),!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 t=this.groupedTablesByLabel.get(e);if(t)return t.chairs.map(r=>r.id);let o=this.labelToId.get(e);return o?[o]:[]}idsForLabels(e){return[...new Set([...e].flatMap(t=>this.idsForLabel(t)))]}tableSelection(e){let t=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return t?this.toTableSeat(t):null}lineItemDisplay(e){if(e.objectType==="ga"){let r=this.visibleDoc(),s=ot(r).find(n=>n.id===e.objectId);return{...s?.displayLabel?{displayLabel:s.displayLabel}:{},...s?.displayType?{displayType:s.displayType}:{}}}if(e.objectType==="table"){let r=this.groupedTablesByLabel.get(e.label);return{...r?.displayLabel&&r.displayLabel!==r.label?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}let t=this.labelToSeat.get(e.label),o=t?this.seatContext.get(t.id):void 0;return{...t?.displayLabel?{displayLabel:t.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}async render(e){if(this.renderer)return null;let t=performance.now(),o={},r=x=>Math.round((performance.now()-x)*100)/100;this.closed=!1;let s=performance.now(),n=(async()=>this.api.chart(this.key))().then(x=>({ok:!0,res:x,elapsed:r(s)}),x=>({ok:!1,error:x,elapsed:r(s)})),l=performance.now(),a=(async()=>this.api.objects(this.key))().then(x=>({ok:!0,objects:x,elapsed:r(l)}),()=>({ok:!1,elapsed:r(l)})),c=await n;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let h=c.res;if(this.closed)return null;this._doc=Ea(h.doc,h.event.eventConfiguration),this.eventConfiguration.reset(h.event.eventConfiguration);let d=performance.now();try{let x=dr(h.doc,h.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(x.map(T=>[T.objectId,T])),this.groupedTablesByLabel=new Map(x.map(T=>[T.label,T])),this.groupedTableBySeatId=new Map(x.flatMap(T=>T.chairs.map(I=>[I.id,T]))),this.tableQuantities=new Map(x.map(T=>[T.label,T.mode==="whole"?T.capacity:T.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=x.reduce((T,I)=>T+Math.max(0,I.chairs.length-1),0)}catch(x){return this.emitError(x),null}this.expandedSeats=ze(h.doc);let u=Sa(h.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 T=x.chairs[0];T&&(this.labelToId.set(x.label,T.id),this.labelToSeat.set(x.label,T))}o.normalizeBuyerModel=r(d);let f=h.event.currency??this.opts.currency;this.currency=f??"USD";let y=performance.now(),m=ba(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:f,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=r(t),this.opts.onSeatsRevealed?.()},onSelect:x=>{this.handleRendererSelect(x)},onDeselect:x=>{this.handleRendererDeselect(x)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(x,T)=>{this.opts.onHover?.(x),this.opts.onSeatHover&&this.opts.onSeatHover(x?this.describeSeat(x,T):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(x,T)=>this.handleSectionTap(x,T),onBackdropTap:()=>this.overview(),onFocusedSectionChange:x=>this.opts.onSectionFocus?.(this.isSectionClosed(x)?null:this.sectionSummary(x)),onDeckTap:x=>this.handleDeckTap(x),onFps:this.opts.onFps});if(o.createRenderer=r(y),this.closed)return m.destroy(),null;this.renderer=m,this.viewportInsets&&m.setViewportInsets?.(this.viewportInsets);let p=null,g="free",b=[],S=await a;if(S.ok){let x=S.objects;this.hidden=new Set(x.hidden??[]),b=(x.closed??[]).filter(T=>typeof T=="string"),p=x.seats,g=x.default??"free"}if(o.loadStatuses=S.elapsed,this.closed)return m.destroy(),this.renderer=null,null;let v=performance.now();m.setChart(this.visibleDoc()),Aa(m,h.doc,e.clientWidth),this.opts.colorblindSafe&&m.setColorblindSafe?.(!0),o.buildScene=r(v),this.closedSections=new Set(b);let w=performance.now();b.length&&m.setClosedSections?.(b),p&&this.applySeatsMap(p,g),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=r(w);let k=performance.now();m.forceDraw(),o.firstPaint=r(k);let L=performance.now();return this.attachVisibility(),this.connect(),o.startRealtime=r(L),o.controllerTotal=r(t),{doc:h.doc,salesClosed:!!h.event.salesClosed,eventName:h.event.name,venue:h.event.venue,startsAt:h.event.startsAt,timezone:h.event.timezone??null,currency:f,mode:h.event.mode??"live",locale:h.event.locale??null,posterUrl:h.event.posterUrl??null,chartDelivery:h.chartDelivery,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],t=new Set;for(let o of this.renderer.getSelection()){let r=this.groupedTableBySeatId.get(o.id);r?t.has(r.label)||(t.add(r.label),e.push(this.toTableSeat(r))):e.push(this.toSeat(o))}return e}seatDetails(e){let t=this.seatById.get(e);return t?this.describeSeat(t):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let t=new Set;for(let o of e){let r=this.groupedTableBySeatId.get(o)??this.groupedTablesByLabel.get(o);if(r)r.chairs.forEach(s=>t.add(s.id)),this.hold_?.labels.includes(r.label)||(this.tableQuantities.set(r.label,r.mode==="whole"?r.capacity:r.minOccupancy),r.mode==="variable"&&this.confirmedVariableTables.delete(r.label));else{let s=this.seatById.has(o)?o:this.labelToId.get(o);s&&t.add(s)}}this.renderer?.deselect([...t]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let t=new Set(this.getSelection().map(n=>n.label)),o=new Set,r=[];for(let n of e){let l=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(l)this.tableTierResolution(l).kind==="invalid"?r.push(l.label):l.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let a=this.seatById.has(n)?n:this.labelToId.get(n);if(!a||!this.isSelectableByPolicy(a))continue;let c=this.seatById.get(a);c&&this.seatTierResolution(c).kind==="invalid"?r.push(c.label):o.add(a)}}if(r.length&&this.emitError(new Ie(Ci(r))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let s=this.getSelection().filter(n=>!t.has(n.label));return s.length&&this.emitSelectionChange(),s}selectCategories(e){let t=new Set(e);return this.select([...this.seatById.values()].filter(o=>t.has(o.categoryKey)).map(o=>o.id))}deselectCategories(e){let t=new Set(e);this.deselect(this.getSelection().filter(o=>t.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 t=this.renderer?.getSelection().filter(o=>!this.isSelectableByPolicy(o.id)).map(o=>o.id)??[];t.length&&this.deselect(t)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let t=this.getSelection(),o=e??t.reduce((r,s)=>r+(s.quantity??1),0);return Ba(t,o,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let t=new Set(e.getSelection().map(o=>o.id));return t.size>0&&xi(this.seatById.values(),o=>e.getStatus(o),t).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let t of this.selectableObjectRefs){let o=this.groupedTableBySeatId.get(t)??this.groupedTablesByLabel.get(t);if(o){o.chairs.forEach(s=>e.add(s.id));continue}let r=this.seatById.has(t)?t:this.labelToId.get(t);r&&e.add(r)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,t){let o=this.groupedTablesByLabel.get(e);if(!o)return!1;let r=o.mode==="whole"?o.capacity:Math.floor(t);if(!Number.isInteger(r)||r<o.minOccupancy||r>o.maxOccupancy)return!1;let s=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,r),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,s),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,t,o){let r=this.groupedTablesByLabel.get(e),s=this.hold_;if(!r||r.mode!=="variable"||!s?.labels.includes(e))return null;let n=Math.floor(t);if(!Number.isInteger(n)||n<r.minOccupancy||n>r.maxOccupancy)return null;if((s.items??[]).filter(h=>h.label!==e).reduce((h,d)=>h+(d.quantity??1),0)+n>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let a=(s.items??[]).map(h=>({label:h.label,tierId:h.tierId,quantity:h.label===e?n:h.quantity}));if(!a.some(h=>h.label===e))return null;let c=await this.api.hold(this.key,a,o,s.holdId);return this.tableQuantities.set(e,n),this.setHold({holdId:c.holdId,labels:a.map(h=>h.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,t)=>e+(t.quantity??1),0)}handleRendererSelect(e){let t=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(t?t.chairs.map(r=>r.id):[e.id]),this.emitSelectionChange();return}if((t?this.tableTierResolution(t):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(t?t.chairs.map(r=>r.id):[e.id]),this.emitError(new Ie(Ci([t?.label??e.label]))),this.emitSelectionChange();return}if(t){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(t.chairs.map(r=>r.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(t.chairs.map(r=>r.id)),this.opts.onSelect?.(t.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(t)),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 t=this.groupedTableBySeatId.get(e.id);t?(this.renderer?.deselect(t.chairs.map(o=>o.id)),this.hold_?.labels.includes(t.label)||(this.tableQuantities.set(t.label,t.mode==="whole"?t.capacity:t.minOccupancy),t.mode==="variable"&&this.confirmedVariableTables.delete(t.label)),this.opts.onDeselect?.(t.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 t of e){let o=this.groupedTablesByLabel.get(t);o&&(this.tableQuantities.set(t,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(t))}}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}}async hold(e,t){if(!this.renderer)return null;let r=e??this.getSelection().map(a=>a.label),s=(this.hold_?.items??[]).filter(a=>a.objectType==="ga"),n=[...new Set([...s.map(a=>a.label),...r])];if(!n.length)return null;let l=this.ticketIssue(n);if(l)throw new Ie(l);if(this.hold_&&this.holdCovers(n))return this.hold_;try{let a=n.map(h=>{let d=s.find(y=>y.label===h);if(d)return{label:h,tierId:d.tierId,quantity:d.quantity};let u=this.labelToSeat.get(h),f=u?this.toSeat(u):null;return{label:h,...f?.tierId?{tierId:f.tierId}:{},...this.tableQuantityRequest(f)}}),c=await this.api.hold(this.key,a,t,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:n,expiresAt:c.expiresAt,items:c.items}),this.hold_}catch(a){throw this.handle409Conflicts(a),a}}async resumeHold(e){if(this.closed||!e||!this.api.resume)return null;let t=await this.api.resume(this.key,e);if(this.closed)return null;let o=[...new Set(t.items.map(r=>r.label))];return o.length?(this.setHold({holdId:t.holdId,labels:o,expiresAt:t.expiresAt,items:t.items},"restored"),this.hold_):null}async extendHold(e){let t=this.hold_;if(!t||!this.api.extend)return null;try{let o=await this.api.extend(this.key,t.holdId,e);return this.hold_?.holdId!==t.holdId?this.hold_:(this.setHold({holdId:t.holdId,labels:t.labels,expiresAt:o.expiresAt,items:t.items}),this.hold_)}catch{return null}}categoryAvailability(){return La({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,t=this.renderer;if(!t||!this.closedSections.size)return e;for(let o of this.closedSections)for(let r of t.sectionMembers?.(o)??[])e.add(r);return e}getGAAreas(){let e=this.visibleDoc();return e?wa(e,this.currency,t=>this.statusOf(t)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(ka(this.getGAAreas(),this.gaSelected))}async holdGA(e,t,o={}){let r=this.visibleDoc();if(!r||!Number.isFinite(t)||t<1)return null;let s=ot(r).find(h=>h.id===e);if(!s)return null;let n=Mt(s).filter(h=>!this.hold_?.labels.includes(h)&&this.statusOf(h)==="free").slice(0,Math.floor(t));if(n.length!==Math.floor(t))return null;let l=new Map;for(let h of this.hold_?.items??[])l.set(h.label,{label:h.label,tierId:h.tierId,quantity:h.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let h of this.hold_.seats)l.set(h.label,{label:h.label,...h.tierId?{tierId:h.tierId}:{}});for(let h of this.getSelection())l.set(h.label,{label:h.label,...h.tierId?{tierId:h.tierId}:{},...this.tableQuantityRequest(h)});for(let h of n)l.set(h,{label:h,...o.tierId?{tierId:o.tierId}:{}});let a=[...l.values()],c=await this.api.hold(this.key,a,o.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:a.map(h=>h.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 Pa(this.visibleDoc())}pickPremiumBlock(e,t,o){return Ma({doc:this.visibleDoc(),qty:e,categoryKey:t,zoneId:o,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:r=>this.seatTierResolution(r).kind!=="invalid",statusOfLabel:r=>this.getStatus(this.labelToId.get(r)??"")??"free",isPremium:r=>!!this.labelToSeat.get(r)?.commercial?.premium})}async bestAvailable(e,t,o={}){let r=this.renderer;if(!r)return null;if(o.preferPremium){let s=this.pickPremiumBlock(e,t,o.zoneId);if(s){if(this.hold_&&!await this.release())return null;try{let n=s.map(h=>{let d=this.labelToSeat.get(h),u=d?this.toSeat(d):null;return{label:h,...u?.tierId?{tierId:u.tierId}:{}}}),l=await this.api.hold(this.key,n,o.ttlMs);r.clearSelection();let a=this.idsForLabels(s);a.length&&r.setStatus(a,"held"),this.setHold({holdId:l.holdId,labels:[...s],expiresAt:l.expiresAt,items:l.items});let c=s.map(h=>this.labelToSeat.get(h)).filter(h=>!!h).map(h=>this.toSeat(h));return this.opts.onSelectionChange?.(c),this.hold_}catch(n){let{status:l,reason:a}=kt(n);if(l===409&&a==="event_closed")throw this.opts.onSalesClosed?.(),n}}}if(this.hold_&&!await this.release())return null;try{let s=await this.api.bestAvailable(this.key,e,t,o.zoneId,o.ttlMs);r.clearSelection();let n=this.idsForLabels(s.labels);n.length&&r.setStatus(n,"held"),this.setHold({holdId:s.holdId,labels:[...s.labels],expiresAt:s.expiresAt,items:s.items});let l=s.labels.map(a=>this.labelToSeat.get(a)).filter(a=>!!a).map(a=>this.toSeat(a));return this.opts.onSelectionChange?.(l),this.hold_}catch(s){let{status:n,reason:l}=kt(s);throw n===409&&l==="event_closed"&&this.opts.onSalesClosed?.(),s}}async book(e,t,o){let r=this.renderer;if(!r)return null;if(!this.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let s=t??this.getSelection().map(c=>c.label);if(!s.length)return null;let n=this.ticketIssue(s);if(n)throw new Ie(n);let l;try{if(this.hold_&&this.holdCovers(s))l=this.hold_.holdId;else{let c=this.hold_?.holdId,h=await this.api.hold(this.key,s.map(d=>{let u=this.labelToSeat.get(d),f=u?this.toSeat(u):null;return{label:d,...f?.tierId?{tierId:f.tierId}:{},...this.tableQuantityRequest(f)}}),o,c);l=h.holdId,this.setHold({holdId:l,labels:[...s],expiresAt:h.expiresAt,items:h.items})}await this.api.book(this.key,s,l,e)}catch(c){let{status:h,conflicts:d,reason:u}=kt(c);if(this.clearHold(),h===409&&u==="event_closed")this.opts.onSalesClosed?.();else if(h===409&&d?.length){let f=new Set(d.map(p=>p.label)),y=this.idsForLabels(f);y.length&&(r.setStatus(y,"booked"),r.deselect(y),this.resetTableQuantitiesForLabels(f));let m=s.filter(p=>!f.has(p));m.length&&l&&this.api.release(this.key,m,l).catch(()=>{}),this.emitSelectionChange()}else l&&this.api.release(this.key,s,l).catch(()=>{});throw c}let a=this.idsForLabels(s);return a.length&&(r.setStatus(a,"booked"),r.deselect(a)),this.clearHold(),this.resetTableQuantitiesForLabels(s),this.emitSelectionChange(),this.opts.onBook?.(e),s}async release(){let e=this.hold_;if(!e)return!0;try{let o=await this.api.release(this.key,e.labels,e.holdId);if(!this.releaseConfirmed(o,e.labels))return await this.resnapshot(),!1}catch(o){return this.emitError(o),!1}if(this.hold_?.holdId!==e.holdId)return!0;this.clearHold(),this.resetTableQuantitiesForLabels(e.labels);let t=this.idsForLabels(e.labels);return t.length&&(this.renderer?.deselect(t),this.renderer?.setStatus(t,"free")),!0}async releaseLabels(e){let t=this.hold_;if(!t)return!0;let o=e.filter(l=>t.labels.includes(l));if(!o.length)return!0;try{let l=await this.api.release(this.key,o,t.holdId);if(!this.releaseConfirmed(l,o))return await this.resnapshot(),!1}catch(l){return this.emitError(l),!1}if(this.hold_?.holdId!==t.holdId)return!0;let r=t.labels.filter(l=>!o.includes(l)),s=t.items?.filter(l=>!o.includes(l.label));r.length?this.setHold({...t,labels:r,items:s}):this.clearHold(),this.resetTableQuantitiesForLabels(o);let n=this.idsForLabels(o);return n.length&&(this.renderer?.deselect(n),this.renderer?.setStatus(n,"free")),!0}releaseConfirmed(e,t){let o=e?.released;return!Array.isArray(o)||t.every(r=>o.includes(r))}setStatus(e,t){this.renderer?.setStatus(e,t)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let t=new Set(e.categories.filter(r=>r.notForSale).map(r=>r.key));if(!t.size)return[];let o=[];for(let[r,s]of this.seatById)t.has(s.categoryKey)&&o.push(r);return o}flashSeat(e,t){this.renderer?.flashSeat(e,t)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let t=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&t&&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)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){this.accessFilter=e===null?null:[...e],this.renderer?.setAccessibilityFilter?.(e);let t=this.renderer?.getFocusedSection?.()??null;t&&this.opts.onSectionFocus?.(this.sectionSummary(t))}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let t=this.renderer;!t?.setActiveFloor||e===t.getActiveFloorId?.()&&!t.isFloorOverview?.()||(t.setFloorOverview?.(!1),t.setStacked?.(!1),t.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let t=this.renderer;!t?.setStacked||e===t.isStacked?.()||(t.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let t=this.renderer;!t?.setFloorOverview||e===t.isFloorOverview?.()||(t.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let t=this.renderer;t&&(t.setViewMode?.("flat"),t.setFloorOverview?.(!1),t.setStacked?.(!1),t.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()}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){let t=this.renderer;if(t){if(t.clearSectionFocus?.(),this.opts.onSectionFocus?.(null),e?.length){let o=this.floorForCategories(e);o&&this.setFloor(o)}t.focusCategories?t.focusCategories(e):t.zoomToFit()}}floorForCategories(e){let t=this._doc;if(!t?.floors||t.floors.length<2)return null;let o=new Set(e),r=l=>l.some(a=>a.type==="row"&&(o.has(a.categoryKey)||(a.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||a.type==="gaArea"&&o.has(a.categoryKey)),s=this.getActiveFloorId(),n=t.floors.find(l=>l.id===s);return n&&r(n.objects)?null:t.floors.find(l=>r(l.objects))?.id??null}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,t){this.handleSectionTap(e,t)}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}handleSectionTap(e,t){let o=this.renderer;if(o){if(o.focusSection?o.focusSection(e,t?{anchor:t}:void 0):o.focusRegion?.(e),this.isSectionClosed(e)){this.opts.onSectionFocus?.(null);return}this.opts.onSectionFocus?.(this.sectionSummary(e))}}sectionSummary(e){return!this.renderer||!this._doc?null:Oa({id:e,doc:this._doc,sectionMembers:t=>this.renderer?.sectionMembers?.(t)??[],statusOf:t=>this.renderer?.getStatus(t)??"free",seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,...this.accessFilter?{matchesAccessFilter:t=>ke(t,this.accessFilter)}:{}})}destroy(){if(this.closed=!0,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 t=this.groupedTableBySeatId.get(e.id);if(t)return this.toTableSeat(t);let o=e.commercial?{commercial:e.commercial}:void 0,r=e.displayLabel?{displayLabel:e.displayLabel}:void 0,s=e.accessibility?.length?{accessibility:e.accessibility}:void 0,n=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,l=this.seatContext.get(e.id),a=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!a)return{id:e.id,label:e.label,...r,...l,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...s,...n};let h=c.tier;return{id:e.id,label:e.label,...r,...l,categoryKey:e.categoryKey,price:h.price,currency:this.currency,tiers:a,tierId:h.id,...o,...s,...n}}toTableSeat(e){let t=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(n=>Nt(this._doc,this.tableTierSeat(e),n.id).kind==="resolved"),r=this.tableTierResolution(e),s=r.kind==="resolved"?r.tier:void 0;return{id:t?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:t?this.seatContext.get(t.id)?.sectionLabel:void 0,rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:s?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:s?.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(n=>n.id)}}describeSeat(e,t){let o=this._doc?.categories.find(r=>r.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,...t?.interaction?{interaction:t.interaction}:{},...t?.unavailable?{unavailable:!0}:{},...t?.filteredOut?{filteredOut:!0}:{},currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(t=>t.key===e)?.price??0}tiersFor(e){let t=this._doc?.categories.find(o=>o.key===e)?.tiers;return t&&t.length?t:void 0}tiersForSeat(e){if(!this._doc)return;let t=lr(this._doc,e);return t.length?t:void 0}seatTierResolution(e){return this._doc?Nt(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(t=>t.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let t=e.chairs[0]?.id??"";return Nt(this._doc,this.tableTierSeat(e),this.seatTiers.get(t))}setSeatTier(e,t){let o=this.seatById.get(e);if(!o)return;let r=this.tiersForSeat(o);if(r){if(t==null)this.seatTiers.delete(e);else if(r.some(s=>s.id===t))this.seatTiers.set(e,t);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let t=[];for(let o of e){let r=this.labelToSeat.get(o);r&&t.push(this.toSeat(r))}return t}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 t=e?this.seatsForLabels(e):this.getSelection();return cr(this._doc,t.map(o=>({label:o.label,...o.tierId?{tierId:o.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let t=this.ticketIssue();if(t){this.hintShown=!0,this.opts.onHint(t.code==="companion_pair_required"?$("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=new Set(e.getSelection().map(s=>s.id));(o.size?xi(this.seatById.values(),s=>e.getStatus(s),o):[]).length>0?(this.hintShown=!0,this.opts.onHint($("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){let t=this.hold_;if(!t||t.labels.length!==e.length||!e.every(s=>t.labels.includes(s)))return!1;let o=new Map((t.items??[]).map(s=>[s.label,s.tierId])),r=new Map((t.items??[]).map(s=>[s.label,s.quantity??1]));return e.every(s=>{let n=this.labelToSeat.get(s),l=n?this.toSeat(n):null,a=l?.tierId??null;return(l?.objectType!=="table"||(l.bookingMode!=="variable"||this.confirmedVariableTables.has(s))&&(!r.has(s)||r.get(s)===l.quantity))&&(!o.has(s)||o.get(s)===a)})}handle409Conflicts(e){let{status:t,conflicts:o}=kt(e);if(t!==409||!o?.length)return;let r=this.renderer;if(!r)return;let s=this.idsForLabels(o.map(n=>n.label));s.length&&(r.deselect(s),r.setStatus(s,"held"),this.resetTableQuantitiesForLabels(o.map(n=>n.label))),this.emitSelectionChange()}setHold(e,t="created"){for(let s of e.items??[])this.groupedTablesByLabel.has(s.label)&&s.quantity!=null&&(this.tableQuantities.set(s.label,s.quantity),this.groupedTablesByLabel.get(s.label)?.mode==="variable"&&this.confirmedVariableTables.add(s.label));let o={...e,seats:this.seatsForLabels(e.labels)};this.hold_=o,this.renderer?.setOwnedHold?.(this.idsForLabels(o.labels)),this.expiryTimer&&clearTimeout(this.expiryTimer);let r=Math.max(0,o.expiresAt-Date.now());this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},r),t==="restored"?this.opts.onHoldRestored?.(o):this.opts.onHold?.(o)}clearHold(){this.hold_=null,this.renderer?.setOwnedHold?.(null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null)}async expireActiveHold(){let e=this.hold_;if(e){try{let t=await this.api.objects(this.key);if(this.hold_?.holdId!==e.holdId)return;this.applySeatsMap(t.seats,t.default??"free")}catch{this.hold_?.holdId===e.holdId&&(this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},2e3));return}if(this.hold_?.holdId===e.holdId){if(Ca(e.expiresAt,e.labels.some(t=>this.statusOf(t)==="held"))){this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},1e3);return}this.clearHold(),this.opts.onHoldExpired?.()}}}applySeatsMap(e,t="free"){let o=this.renderer;if(!o)return;this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=t;let r=hi(t);this.allIds.length&&o.setStatus(this.allIds,r),o.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let s={free:[],held:[],booked:[],not_for_sale:[]};for(let[l,a]of Object.entries(e))s[hi(a)].push(...this.idsForLabel(l));["free","held","booked","not_for_sale"].forEach(l=>{l!==r&&s[l].length&&o.setStatus(s[l],l)});let n=this.notForSaleCategorySeatIds();n.length&&o.setStatus(n,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(t=>this.statusOf(t)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let t=await this.api.objects(this.key);this.applySeatsMap(t.seats,t.default??"free")},e)}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,t=xa({selection:this.getSelection().map(o=>o.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:o=>this.statusOf(o)});if(t.lost.length&&this.deselect(t.lost),t.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(t.lapsedLabels);let o=this.idsForLabels(t.lapsedLabels);o.length&&this.renderer?.deselect(o),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(t),t}getAccessNeeds(){return Ta(this.seatById.values(),e=>this.getStatus(e)??"free")}attachVisibility(){this.detachVisibility||(this.detachVisibility=Ia(()=>{this.closed||this.refreshAvailability().then(()=>{this.closed||this.renderer?.forceDraw()})}))}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applySeatsMap(e.exceptions,e.default),resync:()=>this.resnapshot(),onSections:(e,t)=>{let o=this.syncHidden(e),r=this.syncClosed(t);o&&this.resnapshot(),(o||r)&&this.opts.onStatusChange?.()}}}applyStatusChanges(e){let t=this.renderer;if(t){for(let o of e){this.liveStatuses.set(o.label,o.status);let r=this.idsForLabel(o.label);if(!r.length)continue;let s=hi(o.status);this.opts.flashOnLiveChange&&s!=="free"&&r.some(n=>t.getStatus(n)==="free")&&!this.hold_?.labels.includes(o.label)&&r.forEach(n=>t.flashSeat(n,s==="held"?"#f4b740":"#f43f5e")),t.setStatus(r,s)}this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&t.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}}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 t;try{let o=this.api.socketProtocols?.(this.key);t=o&&o.length?new WebSocket(e,o):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=t,t.onopen=()=>{this.attempt=0,this.resnapshot()},t.onmessage=o=>{let r;try{r=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(!this.renderer||!r||typeof r!="object")return;let n=r;Array.isArray(n.hidden)&&this.syncHidden(n.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.()),Array.isArray(n.closed)&&this.syncClosed(n.closed)&&this.opts.onStatusChange?.(),n.type!=="hidden"&&(n.seats&&typeof n.seats=="object"?this.applySeatsMap(n.seats):Array.isArray(n.changes)&&this.applyStatusChanges(n.changes))},t.onclose=()=>{this.ws===t&&(this.ws=null),this.scheduleReconnect()},t.onerror=()=>{try{t.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=va(e,{baseMs:1e3,maxMs:dh,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}};var uh=5,ph=-1.1,go=35;function bo(i,e){let t=i-ee,o=Math.atan2(uh-t,e)*180/Math.PI,r=Math.atan2(ph-t,e)*180/Math.PI;return r<-go&&(o+=-go-r,r=-go),{topPitch:o,basePitch:r}}var q=2048,he=1024,Tt=Po,E=Math.PI*2,fh=he/180,tt=i=>(i+180)/360*q,K=i=>(90-i)/180*he;function Va(i){let e=2166136261;for(let t=0;t<i.length;t++)e^=i.charCodeAt(t),e=Math.imul(e,16777619);return e>>>0}function Ka(i){let e=i>>>0;return()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}var pi=96,wo=360/pi,mh=.6,So=[17,23,42];function vo(i,e,t=1){let o=Math.max(0,Math.min(.58,e)),r=Math.round(i[0]+(So[0]-i[0])*o),s=Math.round(i[1]+(So[1]-i[1])*o),n=Math.round(i[2]+(So[2]-i[2])*o);return`rgba(${r},${s},${n},${t})`}function Ga(i,e,t){return[Math.round(i[0]+(e[0]-i[0])*t),Math.round(i[1]+(e[1]-i[1])*t),Math.round(i[2]+(e[2]-i[2])*t)]}function ie(i,e,t){let o=(1-Math.abs(2*t-1))*e,r=(i%360+360)%360/60,s=o*(1-Math.abs(r%2-1)),n=0,l=0,a=0;r<1?[n,l,a]=[o,s,0]:r<2?[n,l,a]=[s,o,0]:r<3?[n,l,a]=[0,o,s]:r<4?[n,l,a]=[0,s,o]:r<5?[n,l,a]=[s,0,o]:[n,l,a]=[o,0,s];let c=t-o/2;return[Math.round((n+c)*255),Math.round((l+c)*255),Math.round((a+c)*255)]}var Ha=new Map;function Na(i){if(!i)return null;let e=Ha.get(i);if(e)return e;let t=2166136261;for(let s=0;s<i.length;s++)t^=i.charCodeAt(s),t=Math.imul(t,16777619);let o=(t>>>0)%360,r=ie(o,.3,.42);return Ha.set(i,r),r}function yh(i,e,t,o){let r=new Array(pi).fill(null),s=0,n=i.sectionId;for(let l of e){if(l.id===i.id)continue;let a=l.sectionId;if(!a||n&&a===n)continue;let c=l.x-i.x,h=l.y-i.y,d=Math.hypot(c,h)*Tt;if(d<1.5||d>95)continue;let u=l.eyeHeightM??ee,f=u-o;Math.abs(f)>s&&(s=Math.abs(f));let y=Math.atan2(f,d)*180/Math.PI,m=Math.atan2(u-ee-o,d)*180/Math.PI,g=((Math.atan2(c,-h)-t)*180/Math.PI+540)%360-180,b=Math.min(pi-1,Math.max(0,Math.floor((g+180)/wo))),S=y>34&&d<16,v=r[b];v?(y>v.top&&(v.top=y),m<v.base&&(v.base=m),d<v.nearM&&(v.nearM=d,v.tint=Na(l.categoryKey)),v.overhead=v.overhead||S):r[b]={top:y,base:m,nearM:d,overhead:S,tint:Na(l.categoryKey)}}return{bins:r,maxDelta:s}}function gh(i,e,t,o){for(let r=0;r<pi;r++){let s=e[r];if(!s)continue;let n=-180+r*wo,l=t(n),a=t(n+wo);if(!(a>l))continue;let c=Math.min(72,s.top),h=Math.min(s.base,-4),d=o(c),u=o(h);if(u<=d)continue;let f=s.nearM/95,y=s.tint,m=y?Ga([44,54,80],y,.34):[44,54,80],p=y?Ga([24,30,48],y,.28):[24,30,48],g=i.createLinearGradient(0,d,0,u);g.addColorStop(0,vo(m,f)),g.addColorStop(.24,vo(p,f)),g.addColorStop(1,vo([10,13,22],f)),i.fillStyle=g,i.fillRect(l,d,a-l+1,u-d),i.fillStyle=`rgba(150,165,205,${.35*(1-f*.55)})`,i.fillRect(l,d,a-l+1,1.5);let S=Math.min(u,o(0))-d;if(S>8){let w=1-f*.4;for(let k=1;k<6;k++){let L=d+S*k/6;i.fillStyle=`rgba(0,0,0,${.16*w})`,i.fillRect(l,L,a-l+1,1.5),i.fillStyle=`rgba(120,134,170,${.1*w})`,i.fillRect(l,L+1.5,a-l+1,1.2)}}if(s.overhead){let v=o(Math.min(86,c+12)),w=i.createLinearGradient(0,v,0,d);w.addColorStop(0,"rgba(3,4,8,0.9)"),w.addColorStop(1,"rgba(3,4,8,0)"),i.fillStyle=w,i.fillRect(l,v,a-l+1,d-v),i.fillStyle="rgba(120,130,160,0.14)",i.fillRect(l,d-1.5,a-l+1,1.5)}}}function bh(i,e,t){let r=new Array(72).fill(!1),s=new Array(72).fill(1/0),n=new Set,l=0;for(let g of t){l++,g.sectionId&&n.add(g.sectionId);let b=g.x-e.x,S=g.y-e.y,v=Math.hypot(b,S)*Tt;if(v<.5)continue;let w=Math.atan2(b,-S),k=Math.floor((w+Math.PI)/E*72);k<0?k=0:k>=72&&(k=71),r[k]=!0,v<s[k]&&(s[k]=v)}let a=0,c=[];for(let g=0;g<72;g++)r[g]&&(a++,c.push(s[g]));let h=a/72*360;c.sort((g,b)=>g-b);let d=c.length?c[c.length>>1]:0,u=c.length?c[Math.floor(c.length*.15)]??d:0,f=c.length?c[Math.floor(c.length*.85)]??d:0,y=u>.5?f/u:1,m=Va(`${l}|${[...n].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return h>=300&&d>11&&y>1.35?p="sport":h>=285?p="arena":p="proscenium",{mode:p,seed:m,voidRadiusM:d,aspect:y}}var Sh=5;function vh(i,e,t){switch(t){case 1:i.beginPath(),i.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,E),i.fill();break;case 2:i.beginPath(),i.ellipse(0,-e*1.02,e*.42,e*.42,0,0,E),i.fill(),i.beginPath(),i.ellipse(0,-e*.2,e*.98,e*1.02,0,0,E),i.fill();break;case 3:i.beginPath(),i.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,E),i.fill(),i.beginPath(),i.ellipse(0,-e*.52,e*1.22,e*.24,0,0,E),i.fill();break;case 4:i.beginPath(),i.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,E),i.fill(),i.beginPath(),i.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,E),i.fill(),i.beginPath(),i.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,E),i.fill();break;default:break}}function wh(i,e,t,o,r){let s=o*.44,n=o*r.shoulderK,l=o*.66,a=o*1.68,c=o*5.4,h=`rgba(${r.clothing[0]},${r.clothing[1]},${r.clothing[2]},${r.alpha})`,d=`rgba(${r.tone[0]},${r.tone[1]},${r.tone[2]},${r.alpha})`;i.save(),i.translate(e,t);let u=r.lean*o;i.fillStyle=h,i.beginPath(),i.moveTo(-s,l),i.quadraticCurveTo(-s*1.18,a-u-o*.6,-n,a-u),i.quadraticCurveTo(-n*1.05,a+o*1.2,-n*.94,c),i.lineTo(n*.94,c),i.quadraticCurveTo(n*1.05,a+o*1.2,n,a+u),i.quadraticCurveTo(s*1.18,a+u-o*.6,s,l),i.closePath(),i.fill(),i.fillStyle=d,i.fillRect(-s*.82,o*.5,s*1.64,o*.9),i.save(),i.rotate(r.tilt),i.translate(r.turn*o,0),i.fillStyle=d,o>=18?(i.beginPath(),i.moveTo(-o*.9,-o*.15),i.quadraticCurveTo(-o*.96,-o*1.12,0,-o*1.06),i.quadraticCurveTo(o*.96,-o*1.12,o*.9,-o*.15),i.quadraticCurveTo(o*.86,o*.55,o*.36,o*.98),i.quadraticCurveTo(0,o*1.14,-o*.36,o*.98),i.quadraticCurveTo(-o*.86,o*.55,-o*.9,-o*.15),i.closePath(),i.fill(),o>=22&&(i.beginPath(),i.ellipse(-o*.9,o*.18,o*.13,o*.22,0,0,E),i.ellipse(o*.9,o*.18,o*.13,o*.22,0,0,E),i.fill())):(i.beginPath(),i.ellipse(0,0,o*.9,o*1.06,0,0,E),i.fill()),vh(i,o,r.hair),r.rim>.01&&(i.strokeStyle=`rgba(245,205,150,${(.5*r.rim).toFixed(3)})`,i.lineWidth=Math.max(1,o*.14),i.beginPath(),i.ellipse(0,-o*.06,o*.86,o*1,0,Math.PI*1.12,Math.PI*1.9),i.stroke()),i.restore(),r.rim>.01&&(i.strokeStyle=`rgba(240,200,150,${(.28*r.rim).toFixed(3)})`,i.lineWidth=Math.max(1,o*.12),i.beginPath(),i.moveTo(-n*.8,a-o*.05),i.quadraticCurveTo(-s,a-o*.75,0,a-o*.82),i.quadraticCurveTo(s,a-o*.75,n*.8,a-o*.05),i.stroke()),i.restore()}function kh(i,e,t,o,r,s,n){i.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${n})`,i.beginPath(),i.moveTo(e-o*1.72,t+o*4),i.quadraticCurveTo(e-o*1.78,t+o*1.55,e-o*.46,t+o*1.02),i.lineTo(e-o*.4,t+o*.62),i.lineTo(e+o*.4,t+o*.62),i.lineTo(e+o*.46,t+o*1.02),i.quadraticCurveTo(e+o*1.78,t+o*1.55,e+o*1.72,t+o*4),i.closePath(),i.fill(),i.fillStyle=`rgba(${s[0]},${s[1]},${s[2]},${n})`,i.beginPath(),i.ellipse(e,t,o*.9,o*1.05,0,0,E),i.fill()}function Lo(i,e,t,o,r){let s=o*.1,n=t-o*.9,l=t-o*.74,a=t-o*.46,c=o*.13,h=o*.09,d=`rgba(${r.tone[0]},${r.tone[1]},${r.tone[2]},${r.alpha})`,u=i.createRadialGradient(e,t,1,e,t,o*.24);u.addColorStop(0,"rgba(0,0,0,0.4)"),u.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.scale(1,.28),i.fillStyle=u,i.beginPath(),i.ellipse(e,t/.28,o*.24,o*.24,0,0,E),i.fill(),i.restore(),i.fillStyle=d,i.beginPath(),i.moveTo(e-h,a),i.lineTo(e-h*.7,t),i.lineTo(e-h*.1,t),i.lineTo(e-h*.1,a+o*.02),i.lineTo(e+h*.1,a+o*.02),i.lineTo(e+h*.1,t),i.lineTo(e+h*.7,t),i.lineTo(e+h,a),i.closePath(),i.fill(),i.beginPath(),i.moveTo(e-c,l),i.quadraticCurveTo(e-c*.9,a-o*.12,e-h,a),i.lineTo(e+h,a),i.quadraticCurveTo(e+c*.9,a-o*.12,e+c,l),i.quadraticCurveTo(e,l-o*.05,e-c,l),i.closePath(),i.fill(),i.lineCap="round",i.lineJoin="round",i.strokeStyle=d,i.lineWidth=o*.055;let f=l+o*.02;r.pose===1?(i.beginPath(),i.moveTo(e-c*.8,f),i.lineTo(e-c*1.5,t-o*1.02),i.moveTo(e+c*.8,f),i.lineTo(e+c*1.5,t-o*1.02),i.stroke()):r.pose===2?(i.beginPath(),i.moveTo(e-c*.8,f),i.lineTo(e+h*1.4,a-o*.02),i.moveTo(e+c*.8,f),i.lineTo(e-h*.4,a-o*.06),i.stroke(),i.fillStyle=d,i.beginPath(),i.ellipse(e+h*1.5,a-o*.04,o*.07,o*.09,-.5,0,E),i.fill()):r.pose===3?(i.beginPath(),i.moveTo(e-c*.8,f),i.lineTo(e-c*.2,n+s*.6),i.moveTo(e+c*.8,f),i.lineTo(e+c*1.1,a),i.stroke(),i.lineWidth=o*.02,i.beginPath(),i.moveTo(e-c*.2,n+s*.9),i.lineTo(e-c*.2,t-o*.02),i.stroke()):(i.beginPath(),i.moveTo(e-c*.85,f),i.lineTo(e-c*.95,a+o*.02),i.moveTo(e+c*.85,f),i.lineTo(e+c*.95,a+o*.02),i.stroke()),i.fillStyle=d,i.fillRect(e-s*.34,n+s*.6,s*.68,s*.9),i.beginPath(),i.ellipse(e,n,s*.86,s*1.05,0,0,E),i.fill(),r.rimStrength>.01&&(i.strokeStyle=`rgba(${r.rim[0]},${r.rim[1]},${r.rim[2]},${(.6*r.rimStrength).toFixed(3)})`,i.lineWidth=Math.max(1,o*.02),i.beginPath(),i.moveTo(e-c,l),i.lineTo(e-s*.6,n+s*.4),i.moveTo(e-s*.7,n),i.ellipse(e,n,s*.84,s*1.02,0,Math.PI*1.05,Math.PI*1.55),i.stroke())}function fi(i,e,t,o,r,s,n,l,a){i.save(),i.globalCompositeOperation="lighter";let c=i.createLinearGradient(0,t,0,r);c.addColorStop(0,`rgba(${l},${a})`),c.addColorStop(.5,`rgba(${l},${(a*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${l},0)`),i.fillStyle=c,i.beginPath(),i.moveTo(e-s,t),i.lineTo(o-n,r),i.lineTo(o+n,r),i.lineTo(e+s,t),i.closePath(),i.fill(),i.restore()}function To(i,e,t,o,r){let s=i.createRadialGradient(e,t,0,e,t,o*3);s.addColorStop(0,`rgba(${r},0.9)`),s.addColorStop(.4,`rgba(${r},0.35)`),s.addColorStop(1,`rgba(${r},0)`),i.fillStyle=s,i.beginPath(),i.arc(e,t,o*3,0,E),i.fill(),i.fillStyle=`rgba(${r},1)`,i.beginPath(),i.arc(e,t,o,0,E),i.fill()}function Ig(i,e,t){let o=document.createElement("canvas");o.width=q,o.height=he;let r=o.getContext("2d"),s=e.x-i.x,n=e.y-i.y,l=Math.hypot(s,n),a=Math.max(2,l*Tt),c=i.eyeHeightM??ee,h=bh(i,e,t),d=Ka(h.seed),u=210+d()*150,f=ie(220+(d()-.5)*60,.55,.82),y=`${f[0]},${f[1]},${f[2]}`,m=r.createLinearGradient(0,0,0,he);m.addColorStop(0,"#080b12"),m.addColorStop(.42,"#12182c"),m.addColorStop(.5,"#1c2440"),m.addColorStop(.56,"#151b2c"),m.addColorStop(.78,"#171e30"),m.addColorStop(1,"#131829"),r.fillStyle=m,r.fillRect(0,0,q,he);let p=r.createLinearGradient(0,K(-6),0,he);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)"),r.fillStyle=p,r.fillRect(0,K(-6),q,he-K(-6));let g=Math.atan2(s,-n),b=yh(i,t,g,c),S=b.maxDelta>=mh;S&&gh(r,b.bins,tt,K);let v=Math.max(.3,Math.min(1,1-(a-6)/60)),w=bo(c,a),k=Math.min(80,Math.atan2(4,a)*180/Math.PI),L=Math.min(45,w.topPitch),x=w.basePitch;h.mode==="sport"?xh(r,a,c,h,v,u,y,d):h.mode==="arena"?Th(r,a,c,h,v,y,d):Lh(r,k,L,x,v,u,y,d);let T=h.mode==="sport"?34:24+Math.floor(d()*8);r.fillStyle=`rgba(${y},0.8)`;for(let P=0;P<T;P++){let M=(P+.5)/T*q,R=K(h.mode==="sport"?58:54+P*7%3*6);r.beginPath(),r.arc(M,R,h.mode==="sport"?2.6:3.2,0,E),r.fill()}Ch(r,i,t,e,g,c,s,n,S,h);let I=r.createLinearGradient(0,0,0,he);return I.addColorStop(0,"rgba(0,0,0,0.85)"),I.addColorStop(.12,"rgba(0,0,0,0)"),I.addColorStop(.9,"rgba(0,0,0,0)"),I.addColorStop(1,"rgba(0,0,0,0.55)"),r.fillStyle=I,r.fillRect(0,0,q,he),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(a)}}function Lh(i,e,t,o,r,s,n,l){let a=tt(-e),c=tt(e),h=K(t),d=K(o),u=c-a,f=d-h,y=K(Math.min(50,t+10)),m=u*(1.1+(1-r)*.5),p=i.createRadialGradient(q/2,(h+d)/2,8,q/2,(h+d)/2,m);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)"),i.fillStyle=p,i.fillRect(a-u*.6,h-f*1.2,u*2.2,f*3.4);let g=ie(s,.62,.55),b=ie(s+40,.7,.5),S=ie(s+70,.78,.52);i.save(),i.beginPath(),i.rect(a,h,u,f),i.clip();let v=i.createLinearGradient(0,h,0,d);v.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),v.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),v.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),i.globalAlpha=.8,i.fillStyle=v,i.fillRect(a,h,u,f),i.globalAlpha=1;let w=i.createRadialGradient(q/2,(h+d)/2,u*.12,q/2,(h+d)/2,u*.62);w.addColorStop(0,"rgba(6,8,14,0)"),w.addColorStop(.7,"rgba(6,8,14,0.15)"),w.addColorStop(1,"rgba(5,6,11,0.92)"),i.fillStyle=w,i.fillRect(a,h,u,f),i.restore();let k=3+Math.floor(l()*3),L=f*.46,x=d-f*.08;for(let _=0;_<k;_++){let j=(_+1)/(k+1),z=a+u*(.22+j*.56+(l()-.5)*.06);Lo(i,z,x,L*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:ie(s+20,.5,.7),rimStrength:.7})}i.fillStyle="#05070d",i.fillRect(a-u*.5,y,u*.5,d-y),i.fillRect(c,y,u*.5,d-y);let T=u*.055+3,I=T*1.35;i.fillStyle="#03050a",i.beginPath(),i.moveTo(a,d),i.lineTo(a-T,d),i.lineTo(a-I,y),i.lineTo(a+u*.012,y),i.closePath(),i.fill(),i.beginPath(),i.moveTo(c,d),i.lineTo(c+T,d),i.lineTo(c+I,y),i.lineTo(c-u*.012,y),i.closePath(),i.fill(),i.fillRect(a-I,y,u+I*2,(d-y)*.12);let P=f*.14,M=y+(d-y)*.12;i.fillStyle="rgba(4,6,12,0.96)";let R=7;i.beginPath(),i.moveTo(a-I,M);for(let _=0;_<=R;_++){let j=a-I+(u+I*2)*_/R;i.quadraticCurveTo(j-(u+I*2)/R/2,M+P,j,M)}i.lineTo(c+I,M),i.lineTo(c+I,y),i.lineTo(a-I,y),i.closePath(),i.fill(),i.fillStyle=`rgba(${n},0.12)`,i.fillRect(a-1.5,M,1.5,d-M),i.fillRect(c,M,1.5,d-M),i.fillStyle="#0b0f18",i.fillRect(a-T,d-f*.05,u+T*2,f*.05+3);let C=i.createLinearGradient(0,d-f*.05,0,d+f*.12);C.addColorStop(0,`rgba(255,206,140,${(.5*r).toFixed(3)})`),C.addColorStop(1,"rgba(255,206,140,0)"),i.fillStyle=C,i.fillRect(a-T,d-f*.05,u+T*2,f*.2);let A=3+Math.floor(l()*2);for(let _=0;_<A;_++){let j=(_+1)/(A+1),z=a+u*(j+(l()-.5)*.08),X=K(Math.min(62,t+26)),J=(l()-.5)*u*.16;fi(i,z,X,z+J,d,4,u*.09,n,.16*(.7+r*.5)),To(i,z,X,2.4,n)}}function Th(i,e,t,o,r,s,n){let l=Math.min(e*.6,Math.max(3,o.voidRadiusM)),a=Math.min(55,Math.atan2(l,e)*180/Math.PI),c=q/2,h=1.2,d=Math.max(e*.45,e-l),u=e+l,f=Math.atan2(h-t,d)*180/Math.PI,y=Math.atan2(h-t,u)*180/Math.PI,m=Math.atan2(-t,d)*180/Math.PI,p=K(f),g=K(y),b=K(m),S=tt(a)-c,v=Math.max(6,(p-g)/2),w=(p+g)/2,k=i.createRadialGradient(c,b,4,c,b,S*2.6);k.addColorStop(0,`rgba(255,206,150,${(.2*r).toFixed(3)})`),k.addColorStop(.5,"rgba(150,140,190,0.08)"),k.addColorStop(1,"rgba(40,44,60,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=k,i.fillRect(c-S*2.6,g-v,S*5.2,b-g+v+40),i.restore(),i.fillStyle="#0c1019",i.beginPath(),i.moveTo(c-S,w),i.ellipse(c,w,S,v,0,Math.PI,0,!1),i.lineTo(c+S,b),i.ellipse(c,b,S,v,0,0,Math.PI,!1),i.closePath(),i.fill();let L=i.createLinearGradient(0,w,0,b);L.addColorStop(0,`rgba(${s},0.14)`),L.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=L,i.fillRect(c-S,w,S*2,b-w);let x=[[{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}]],T=x[Math.floor(n()*x.length)],I=n()<.5?-1:1,P=B=>c+B.u*I*S*.84,M=B=>w+B.v*v*.8,R=T.find(B=>B.lead)??T[0],C=P(R),A=i.createLinearGradient(0,w-v,0,w+v);A.addColorStop(0,"#3d4a72"),A.addColorStop(1,"#232b47"),i.fillStyle=A,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.fill();let _=i.createRadialGradient(C,w,2,C,w,S);_.addColorStop(0,`rgba(255,214,160,${(.5*r).toFixed(3)})`),_.addColorStop(1,"rgba(255,214,160,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=_,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.fill(),i.restore(),i.strokeStyle=`rgba(${s},0.7)`,i.lineWidth=2,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.stroke();let j=Math.max(24,(b-g)*1.3),z=T.length>=3?3:2;for(let B=0;B<z;B++){let de=(-.62+B*.52+(n()-.5)*.12)*-I,Pe=c+de*S*.7,it=w-v*(.45+n()*.18),Ve=S*(.07+n()*.04),vi=j*(.26+n()*.12);i.fillStyle="#0a0e18",i.fillRect(Pe-Ve/2,it-vi,Ve,vi),i.fillStyle=`rgba(${s},0.3)`,i.fillRect(Pe-Ve/2,it-vi,Ve,1.5)}if(T.length>=3){let B=c-R.u*I*S*.4;i.fillStyle="#0b0f1a",i.beginPath(),i.ellipse(B,w-v*.34,S*.08,v*.1,0,0,E),i.fill(),i.strokeStyle=`rgba(${s},0.35)`,i.lineWidth=1,i.stroke()}for(let B of[...T].sort((de,Pe)=>de.v-Pe.v)){let de=.82+(B.v+1)*.14;Lo(i,P(B),M(B),j*de*(B.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:B.pose,rim:ie(40,.72,.8),rimStrength:B.lead?1.4:.9})}let X=K(Math.min(60,y+34)),J=v*1.1+6;i.strokeStyle="rgba(60,68,92,0.85)",i.lineWidth=3,i.beginPath(),i.ellipse(c,X,S*1.15,J,0,0,E),i.stroke();let O=4+Math.floor(n()*3);for(let B=0;B<O;B++){let de=B/O*E,Pe=c+Math.cos(de)*S*1.15,it=X+Math.sin(de)*J;if(Math.sin(de)>-.2){let Ve=c+(n()-.5)*S*.8;fi(i,Pe,it,Ve,w,3,S*.32,s,.2*(.7+r*.4))}To(i,Pe,it,3,s)}let Y=K(Math.min(52,y+24)),D=Math.max(60,S*.4),Z=Math.max(24,D*.34);i.strokeStyle="rgba(70,78,102,0.6)",i.lineWidth=1.5,i.beginPath(),i.moveTo(c-D*.3,Y-Z/2),i.lineTo(c-D*.16,Y-Z*2.2),i.moveTo(c+D*.3,Y-Z/2),i.lineTo(c+D*.16,Y-Z*2.2),i.stroke(),i.fillStyle="#0d1220",i.fillRect(c-D/2,Y-Z/2,D,Z);let yi=i.createLinearGradient(0,Y-Z*.3,0,Y+Z*.42);yi.addColorStop(0,`rgba(${s},0.5)`),yi.addColorStop(1,"rgba(255,214,160,0.32)"),i.fillStyle=yi,i.fillRect(c-D*.42,Y-Z*.3,D*.84,Z*.72),i.fillStyle="rgba(255,214,160,0.55)",i.fillRect(c-D/2,Y+Z/2-2,D,2);let gi=i.createRadialGradient(c,Y,4,c,Y,D*1.1);gi.addColorStop(0,`rgba(${s},0.2)`),gi.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=gi,i.fillRect(c-D*1.1,Y-D*.8,D*2.2,D*1.6);let bi=i.createRadialGradient(c,(X+w)/2,6,c,(X+w)/2,S*1.5);bi.addColorStop(0,`rgba(${s},${(.1*(.6+r*.5)).toFixed(3)})`),bi.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=bi,i.fillRect(c-S*1.5,X-40,S*3,w-X+80),i.restore();let Xa=c+Math.sign(C-c||1)*S*.5;fi(i,Xa,X-J*.4,C,M(R),2.5,S*.16,"255,224,178",.42*(.7+r*.4));let Si=i.createRadialGradient(C,M(R),1,C,M(R),S*.2);Si.addColorStop(0,`rgba(255,228,185,${(.4*r).toFixed(3)})`),Si.addColorStop(1,"rgba(255,228,185,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=Si,i.beginPath(),i.ellipse(C,M(R),S*.2,v*.24,0,0,E),i.fill(),i.restore()}function xh(i,e,t,o,r,s,n,l){let a=q/2,c=Math.max(10,o.voidRadiusM),h=Math.max(2,e-c),d=e+c,u=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),f=Math.atan2(-t,h)*180/Math.PI,y=Math.atan2(-t,d)*180/Math.PI,m=K(f),p=K(y),g=tt(u)-a,b=(m+p)/2,S=Math.max(10,(m-p)/2),v=i.createRadialGradient(a,b,4,a,b,g);v.addColorStop(0,"#e8f0fb"),v.addColorStop(.7,"#b9c9e2"),v.addColorStop(1,"#8fa3c4"),i.save(),i.beginPath(),i.ellipse(a,b,g,S,0,0,E),i.clip(),i.fillStyle=v,i.fillRect(a-g,b-S,g*2,S*2),i.strokeStyle="rgba(90,120,170,0.5)",i.lineWidth=3,i.beginPath(),i.moveTo(a,b-S),i.lineTo(a,b+S),i.moveTo(a-g*.5,b-S),i.lineTo(a-g*.5,b+S),i.moveTo(a+g*.5,b-S),i.lineTo(a+g*.5,b+S),i.stroke(),i.strokeStyle="rgba(180,90,110,0.45)",i.beginPath(),i.ellipse(a,b,S*.9,S*.5,0,0,E),i.stroke(),i.restore(),i.strokeStyle="rgba(210,225,245,0.6)",i.lineWidth=2.5,i.beginPath(),i.ellipse(a,b,g,S,0,0,E),i.stroke(),i.fillStyle="rgba(20,26,40,0.8)";for(let P=0;P<5;P++){let M=a+(l()-.5)*g*1.4,R=b+(l()-.5)*S*1.1,C=Math.max(2,S*.06);i.beginPath(),i.ellipse(M,R,C*.6,C,0,0,E),i.fill()}let w=i.createRadialGradient(a,b,4,a,b,g*1.4);w.addColorStop(0,"rgba(200,220,255,0.12)"),w.addColorStop(1,"rgba(200,220,255,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=w,i.fillRect(a-g*1.4,p-S,g*2.8,m-p+S*2),i.restore();let k=K(Math.min(66,y+60)),L=Math.max(80,g*.7),x=L*.5,T=i.createRadialGradient(a,k,4,a,k,L*1.6);T.addColorStop(0,`rgba(${n},0.3)`),T.addColorStop(1,`rgba(${n},0)`),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=T,i.fillRect(a-L*1.6,k-L*1.2,L*3.2,L*2.4),i.restore(),i.fillStyle="#080b12",i.beginPath(),i.moveTo(a-L/2,k-x/2),i.lineTo(a+L/2,k-x/2),i.lineTo(a+L*.6,k),i.lineTo(a+L/2,k+x/2),i.lineTo(a-L/2,k+x/2),i.lineTo(a-L*.6,k),i.closePath(),i.fill();let I=s;for(let P=0;P<3;P++){let M=ie(I+P*30,.5,.5);i.fillStyle=`rgba(${M[0]},${M[1]},${M[2]},0.75)`;let R=L*.26;i.fillRect(a-L*.42+P*(R+L*.06),k-x*.32,R,x*.64)}i.fillStyle=`rgba(${n},0.9)`;for(let P=0;P<8;P++){let M=a-L*.6+L*1.2*P/7;i.beginPath(),i.arc(M,k+x*.62,2.4,0,E),i.fill()}}function Ch(i,e,t,o,r,s,n,l,a,c){let h=e.sectionId,d=!1,u=[];for(let m of t){if(m.id===e.id)continue;let p=m.x-e.x,g=m.y-e.y,b=Math.hypot(p,g)*Tt;if(h&&m.sectionId===h&&b<3&&p*n+g*l>0&&(d=!0),b<.3||b>32)continue;let v=((Math.atan2(p,-g)-r)*180/Math.PI+540)%360-180,w=a?(m.eyeHeightM??ee)-s:0,k=Math.atan2(w-.28,b)*180/Math.PI;if(k>10&&b>5)continue;let L=0;for(let I=0;I<m.id.length;I++)L=L*31+m.id.charCodeAt(I)&65535;let x=.9+(L&15)/40,T=Math.min(78,Math.atan2(.16,b)*180/Math.PI*fh*x);T<1.2||u.push({hx:tt(v),hy:K(k),r:T,d:b,hash:L})}u.sort((m,p)=>p.d-m.d);let f=[];{let m=[...u].sort((b,S)=>b.hy-S.hy),p=[],g=()=>{if(!p.length)return;let b=p.reduce((w,k)=>w+k.d,0)/p.length,S=p.reduce((w,k)=>w+k.hy,0)/p.length,v=p.reduce((w,k)=>w+k.r,0)/p.length;f.push({figs:p.sort((w,k)=>k.d-w.d),d:b,hy:S,r:v}),p=[]};for(let b of m){let S=p[p.length-1];S&&Math.abs(b.hy-S.hy)>Math.max(5,(S.r+b.r)/2*1.7)&&g(),p.push(b)}g()}f.sort((m,p)=>p.d-m.d);let y=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let m of f){if(m.figs.length>=3&&m.r>=1.6&&m.r<26){let p=[],g=[...m.figs].sort((v,w)=>v.hx-w.hx),b=[];for(let v of g){let w=b[b.length-1];w&&v.hx-w.hx>Math.max(14,v.r*7)&&(b.length>=3&&p.push(b),b=[]),b.push(v)}b.length>=3&&p.push(b);let S=Math.min(.42,.5*(1-m.d/42));if(S>.05){i.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let v of p){let w=v[0].hx-m.r*1.6,k=v[v.length-1].hx+m.r*1.6;i.beginPath(),i.roundRect(w,m.hy+m.r*.8,k-w,m.r*2.4,m.r*.8),i.fill()}}}for(let p of m.figs){let g=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),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],v=y[p.hash%y.length],w=[v[0]+b,v[1]+b,v[2]+b];if(p.r>=13){let k=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;wh(i,p.hx,p.hy,p.r,{tone:S,clothing:w,alpha:g,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%Sh,rim:k,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?kh(i,p.hx,p.hy,p.r,w,S,g):(i.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,i.beginPath(),i.arc(p.hx,p.hy,p.r,0,E),i.fill(),i.beginPath(),i.ellipse(p.hx,p.hy+p.r*1.4,p.r*1.85,p.r*.95,0,Math.PI,0,!0),i.fill())}}if(d){let m=K(-34);i.fillStyle="rgba(6, 8, 14, 0.92)",i.fillRect(0,m,q,he-m),i.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let g=0;g<p;g++){let b=(g+.5)/p*q;i.beginPath(),i.ellipse(b,m+6,q/p*.42,22,0,Math.PI,0,!0),i.fill()}}}var ne=480,et=270,ko=50,We=30,Wa=i=>(i+ko)/(2*ko)*ne,Lt=i=>(We-i)/(2*We)*et;function Pg(i,e,t){let o=document.createElement("canvas");o.width=ne,o.height=et;let r=o.getContext("2d"),s=e.x-i.x,n=e.y-i.y,l=Math.max(2,Math.hypot(s,n)*Tt),a=Ka(Va(`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+a()*150,h=ie(220+(a()-.5)*60,.55,.82),d=`${h[0]},${h[1]},${h[2]}`,u=r.createLinearGradient(0,0,0,et);u.addColorStop(0,"#080b12"),u.addColorStop(.44,"#151c32"),u.addColorStop(.5,"#1d2644"),u.addColorStop(.58,"#161c2e"),u.addColorStop(1,"#131829"),r.fillStyle=u,r.fillRect(0,0,ne,et);let f=i.eyeHeightM??ee,y=bo(f,l),m=Math.min(ko-2,Math.atan2(4,l)*180/Math.PI),p=Math.min(We-2,y.topPitch),g=Math.max(-We+2,y.basePitch),b=Wa(-m),S=Wa(m),v=Lt(p),w=Lt(g),k=S-b,L=w-v,x=Math.max(.35,Math.min(1,1-(l-6)/60)),T=Lt(Math.min(We-1,p+8)),I=r.createRadialGradient(ne/2,(v+w)/2,4,ne/2,(v+w)/2,k*1.15);I.addColorStop(0,"rgba(255,214,150,0.34)"),I.addColorStop(.28,"rgba(150,150,230,0.3)"),I.addColorStop(.6,"rgba(99,102,241,0.12)"),I.addColorStop(1,"rgba(99,102,241,0)"),r.fillStyle=I,r.fillRect(b-k*.6,v-L*1.2,k*2.2,L*3.4);let P=ie(c,.62,.55),M=ie(c+40,.7,.5),R=ie(c+70,.78,.52);r.save(),r.beginPath(),r.rect(b,v,k,L),r.clip();let C=r.createLinearGradient(0,v,0,w);C.addColorStop(0,`rgb(${P[0]},${P[1]},${P[2]})`),C.addColorStop(.5,`rgb(${M[0]},${M[1]},${M[2]})`),C.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),r.globalAlpha=.8,r.fillStyle=C,r.fillRect(b,v,k,L),r.globalAlpha=1;let A=r.createRadialGradient(ne/2,(v+w)/2,k*.12,ne/2,(v+w)/2,k*.6);A.addColorStop(0,"rgba(6,8,14,0)"),A.addColorStop(.7,"rgba(6,8,14,0.15)"),A.addColorStop(1,"rgba(5,6,11,0.9)"),r.fillStyle=A,r.fillRect(b,v,k,L),r.restore();let _=3,j=w-L*.08;for(let O=0;O<_;O++){let Y=(O+1)/(_+1);Lo(r,b+k*(.24+Y*.52),j,L*.46*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:ie(c+20,.5,.7),rimStrength:.7})}r.fillStyle="#05070d",r.fillRect(b-k*.5,T,k*.5,w-T),r.fillRect(S,T,k*.5,w-T);let z=k*.05+2,X=z*1.35;r.fillStyle="#03050a",r.beginPath(),r.moveTo(b,w),r.lineTo(b-z,w),r.lineTo(b-X,T),r.lineTo(b+k*.012,T),r.closePath(),r.fill(),r.beginPath(),r.moveTo(S,w),r.lineTo(S+z,w),r.lineTo(S+X,T),r.lineTo(S-k*.012,T),r.closePath(),r.fill(),r.fillRect(b-X,T,k+X*2,(w-T)*.13),r.fillStyle=`rgba(${d},0.12)`,r.fillRect(b-1.2,T,1.2,w-T),r.fillRect(S,T,1.2,w-T),r.fillStyle="#0b0f18",r.fillRect(b-z,w-L*.05,k+z*2,L*.05+2);let J=r.createLinearGradient(0,w-L*.05,0,w+L*.14);J.addColorStop(0,`rgba(255,206,140,${(.5*x).toFixed(3)})`),J.addColorStop(1,"rgba(255,206,140,0)"),r.fillStyle=J,r.fillRect(b-z,w-L*.05,k+z*2,L*.22);for(let O=0;O<3;O++){let Y=(O+1)/4,D=b+k*Y,Z=Lt(Math.min(We-1,p+20));fi(r,D,Z,D+(a()-.5)*k*.14,w,3,k*.09,d,.17*x),To(r,D,Z,1.8,d)}r.fillStyle=`rgba(${d},0.75)`;for(let O=0;O<8;O++)r.beginPath(),r.arc((O+.5)/8*ne,Lt(We-4-O%2*3),2.2,0,E),r.fill();r.fillStyle="rgba(10,13,20,0.9)",r.fillRect(0,et-26,ne,26),r.fillStyle="rgba(30,37,54,0.9)";for(let O=0;O<9;O++){let Y=O*(ne/9)+ne/18;r.beginPath(),r.ellipse(Y,et-22,ne/9*.4,15,0,Math.PI,0,!0),r.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(l)}}var za=new Set(["en"]),mi=new Map;async function Ih(i){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(ur(`i18n/${i}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-VULFUGJH.js"),t=e[i];return t?await t():null}async function Eg(i,e){let t=ns(i,e);if(t==="en"||za.has(t))return qe(t),t;if(!ss.includes(t))return qe("en"),"en";try{let o=mi.get(t);o||(o=Ih(t),mi.set(t,o));let r=await o;return mi.delete(t),r?(qe(t,r),za.add(t),t):(qe("en"),"en")}catch{return mi.delete(t),qe("en"),"en"}}export{Ah as ACCESSIBILITY_RING_COLOR,xo as ACCESSIBILITY_TYPES,Mh as CHART_STORAGE_KEY,Fd as CURRENCY_CHOICES,_d as DEFAULT_CURRENCY,Oy as EMPTY_AVAILABILITY_REFRESH,Hh as EVENT_CONFIGURATION_EXPORT_SCHEMA,Gh as EVENT_CONFIGURATION_SCHEMA,cd as FLOOR_STACK_GAP_RATIO,ud as FLOOR_STACK_MIN_SURFACE_PX,By as HOLD_CLOCK_SKEW_MS,Ii as LABEL_FADE_MS,Bh as LABEL_STYLE_MAX_SIZE,Fh as LABEL_STYLE_MIN_SIZE,Td as LEGIBILITY_HYSTERESIS_PX,Vd as LOCALE_NAMES,fd as MAX_EVENT_INVENTORY,pd as MAX_GA_CAPACITY,Vo as MIN_POINTER_TARGET_PX,Da as PickerController,Ie as PickerSelectionError,kd as RENDERED_QUALITY_REPORT_VERSION,Eh as SEAT_COMMERCIAL_MARKS,Ph as STAGE_LABEL_STYLE_MAX_SIZE,gl as SUPPORTED_LOCALES,Oh as SURROUNDINGS_SHAPE_ROLES,mo as SeatmapRenderer,$h as TABLE_SEAT_OFFSET,Uh as TIER_HEIGHT_M,ss as TRANSLATED_LOCALES,Bo as UNGROUPED_ID,Ta as accessNeedsFor,Rh as accessibilityMeta,xt as accessibilityRingColor,Ro as allObjects,Oo as applyHidden,Ia as attachVisibilityCatchUp,zh as canTransitionEventConfiguration,Vh as canonicalEventConfigurationJson,Eo as chartBounds,Yn as compactRowLabel,Rt as computeSections,ba as createRenderer,pr as crossesThreshold,ml as currencyExponent,Od as currencySymbol,od as expandBooth,ze as expandChart,jh as expandRow,Qh as expandRowSlots,id as expandTable,ed as expandTableSlots,ad as floorObjects,hd as floorStackPlacements,Pt as floorsOf,$d as formatDate,Bd as formatMinor,dt as formatMoney,yl as fromMinorUnits,ot as gaAreasOf,gd as gaInventorySegments,md as gaUnitLabel,Mt as gaUnitLabels,Ig as generateSeatPanorama,Pg as generateSeatThumb,Kd as getLocale,bd as growJoinedGAInventory,wd as hiddenObjectIds,ah as holdHasLapsed,Gy as holdRecoveryShape,Mi as hysteresisScale,Fo as initialFloorMode,Kh as inspectEventConfigurationCompatibility,Ld as inspectRenderedQualityEvidence,Sd as isGaUnitLabel,Xd as isLocaleLoaded,vd as isSectionHidden,Dh as layerOf,_o as layoutFloorStack,Eg as loadLocale,zd as localeDirection,dd as mainFloorId,Yh as migrateLegacyEventConfigurations,sd as objectCenter,nd as owningSectionForObject,Wh as parseEventConfigurationExport,Nh as parseEventConfigurationVersion,rd as pointInPolygon,oe as pointInPolygonWithHoles,It as polygonLabelPoint,xa as reconcileAvailability,Dy as refreshChangedSomething,Pi as renderedPx,Xh as resolveEventConfigurationRollback,ns as resolveLocale,Zh as rowInventoryCount,qh as rowSeatPositions,_h as seatCommercialMeta,Ct as sectionGeometry,qe as setLocale,rs as setMoneyLocale,Yd as setStringOverrides,Ca as shouldWaitForHoldExpiry,Ao as stackFloors,$ as t,Ud as tCount,td as tableInventoryCount,Jh as tableSeatCountsBySide,ld as translateObject,yd as validGAInventorySegments,xd as zoomTowardPoint};
|