@seatlayer/core 0.71.1 → 0.71.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as fi,b as Fo,d as mi,f as Oo,g as At,i as Do,k as Go}from"./chunk-652LV66L.js";import{b as Lo,e as Rt,g as To,h as ye,i as ne,j as Co,k as Po,l as Et,m as Io}from"./chunk-WXWJZ5DO.js";import{a as rd,b as ad}from"./chunk-MR2O5WC7.js";import{b as Ho}from"./chunk-FOYQOIWG.js";import{a as Cc,b as Pc,c as Ic,d as xc,e as Mc,f as Rc,g as Ec,h as Ac,i as _c}from"./chunk-UHPX2P7O.js";import{a as fe,b as go,c as Te,d as Lt,e as Tt,f as Ce,g as Z,m as me,n as ve,q as Ct,r as Pt,t as bo,u as It,v as X,w as pi}from"./chunk-GXMGOWKB.js";import{b as De,f as xo,g as Mo,m as Ro,x as Eo,y as Ao}from"./chunk-JBGLFOJO.js";import{a as Qc,b as jc,c as Jc,d as ed,e as td,f as wt,g as id,h as qe,i as od,j as uo,k as kt,l as sd,m as nd,n as po}from"./chunk-A27USMF7.js";import{c as _o,e as Bo}from"./chunk-T2LWVOQ3.js";import{a as mc,b as yc,c as gc,d as bc,e as gt,f as Sc,g as vc,h as wc,i as kc,j as Lc,k as Tc,p as So,s as Ze}from"./chunk-AWPHGLTU.js";import{b as xt,f as vo,h as Mt,i as wo,k as ko}from"./chunk-UL5OIGIF.js";import{Aa as $c,Ba as no,Ca as qc,Da as ro,Ea as ao,Fa as lo,Ga as co,Ha as Zc,Ia as $e,Ja as ho,W as oo,X as Oe,Y as Bc,ea as ee,fa as so,ga as bt,ka as Fc,la as Oc,ma as Dc,na as Gc,oa as Hc,pa as Nc,qa as Wc,ra as Vc,s as to,sa as zc,ta as Kc,u as io,ua as Xc,va as ie,w as G,wa as St,xa as Yc,ya as Uc,za as vt}from"./chunk-X3K36XZM.js";import{B,c as di,h as hi,l as fo,n as mo,s as U,t as Se,u as ue,v as pe,w as ui,y as yo}from"./chunk-CXF32VPG.js";import"./chunk-CRCGO52K.js";import{Konva as Jt}from"konva/lib/Core";import{Stage as Yl}from"konva/lib/Stage";import{Layer as Vi}from"konva/lib/Layer";import{Group as ut}from"konva/lib/Group";import{Circle as kr}from"konva/lib/shapes/Circle";import{Group as Ci}from"konva/lib/Group";import{Circle as Re}from"konva/lib/shapes/Circle";import{Line as Pi}from"konva/lib/shapes/Line";import{Rect as Ii}from"konva/lib/shapes/Rect";import{Text as Ns}from"konva/lib/shapes/Text";var Qe=9,Pe=.9,re=.55*Pe,ae=Z/fe,je=4,Ie=14,No=10,Wo=14,ge=.45*Pe,be=.9*Pe,Vo=(ge+be)/2,zo=Math.max(Pe*1.1,be),we=8,Ko=700,Q=2,Xo=Z,_t=.85,Yo=Z,Je=64,Ge=.55*ge,yi=700,Uo=2500,Bt=-11.5,et=.58,$o=320,qo=650,Zo=420,Qo=1,Ft=1,jo=2,gi=16,He=12,Jo=[.85,.72,.62],Ot=15,Dt=12,es=.01,ts=10,is=6,os=12,ss=8,ns=8,rs=.6,as=.6,ls=[0,18,-18,36,-36,54,-54],Ne="600",Gt="500",oe=640,cs="700",tt=.02,ds=14,hs=.34,us=.92,bi=7,ps=3,fs=6;function Si(i){return Math.min(1,Math.max(He/gi,i/900))}function Ht(i,e){return Math.max(He,i*Si(e))}var ms=.1;var Yr="#e5e7eb",Ur="#c7cbd1",$r="#595f69",qr="#d1d5db",Zr="#b8bdc4",Qr="#273142",jr="#526078",Jr="#f1f5f9",ea="#374151",ta="#64748b",ia="#111827",Nt="#6b7280",it="#374151";var ys="#4b5563",gs=.4,xe=.16,bs="rgba(244,246,248,0.06)",Wt=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function le(i){return U(i)?{sectionFill:Yr,sectionStroke:Ur,sectionInk:$r,focalFill:qr,focalStroke:Zr}:{sectionFill:Qr,sectionStroke:jr,sectionInk:Jr,focalFill:ea,focalStroke:ta}}function vi(i,e){let t=i.sectionFill,o=yo(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 Ss=.28,vs=.32,oa=.55,sa=.7;function ws(i,e,t){let o=le(i),s=vi(o,e);if(!t||e==="sold-out"||e==="closed")return{fill:s,stroke:o.sectionStroke};let n=U(i);return{fill:pe(s,t,n?vs:Ss),stroke:B(t,n?sa:oa)}}var na=.03;function ks(i,e){let t=le(i);return!["normal","nearly-gone","sold-out","closed"].map(s=>vi(t,s).toLowerCase()).includes(e.trim().toLowerCase())&&wi(i,e)}function wi(i,e){let t=di(e);if(!t)return!1;let o=le(i),s=Math.max(Ss,vs)+na;return["normal","nearly-gone","sold-out","closed"].some(n=>{let r=di(vi(o,n));return r?Math.max(Math.abs(r[0]-t[0]),Math.abs(r[1]-t[1]),Math.abs(r[2]-t[2]))/255<=s:!1})}var ra="#f8fafc",aa="#f4f6fb",la="#111827",ca=.72;function Ls(i){let e=U(i),t=e?ra:ia,o=e?la:aa,s=pe(o,t,1-ca);return{plate:t,ink:o,subInk:fo(s,t)>=mo?s:o}}function Ts(i){return i?.35:.3}function Cs(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 ki(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 Is;function xs(i){Is=i}function da(i){return typeof i=="number"?i:i instanceof Date?i.getTime():Date.parse(i)}var Ps=new Map;function ha(i,e){let t=i??Is,o=`${t??""}|${JSON.stringify(e)}`,s=Ps.get(o);return s||(s=new Intl.DateTimeFormat(t,e),Ps.set(o,s)),s}var ua={dateStyle:"medium",timeStyle:"short"};function Ms(i,e={}){let{locale:t,...o}=e,s=da(i);if(!Number.isFinite(s))return"";let n=Object.keys(o).length?o:ua;return ha(t,n).format(s)}var fd="USD",md=["USD","EUR","GBP","CAD","AUD","INR","AED","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL"],Es;function As(i){Es=i}var Rs=new Map;function Vt(i,e,t,o){let s=o??Es,n=`${s??""}|${i}|${e??"auto"}|${t??"auto"}`,r=Rs.get(n);return r||(r=new Intl.NumberFormat(s,{style:"currency",currency:i,minimumFractionDigits:e,maximumFractionDigits:t}),Rs.set(n,r)),r}function ot(i,e="USD",t,o){if(typeof t=="object"){let n=t;try{return Vt(e,n.minimumFractionDigits,n.maximumFractionDigits,n.locale).format(i)}catch(r){if(n.fallback)return n.fallback(i,e);throw r}}let s=t??(Number.isInteger(i)?0:void 0);return Vt(e,s,s,o).format(i)}function pa(i="USD"){try{return Vt(i,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function fa(i,e="USD"){return i/10**pa(e)}function yd(i,e="USD",t){return ot(fa(i,e),e,void 0,t)}function gd(i="USD"){return Vt(i,0,0).formatToParts(0).find(t=>t.type==="currency")?.value??i}var st={"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":"Overview","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.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 ma=["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"],Ld={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"},_s=["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"],ya=new Set(["ar","fa","he"]),Li={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"},Ti=new Map(ma.map(i=>[i.toLowerCase(),i]));function ga(i){let e=i.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let t=Ti.get(e)??Li[e];if(t)return t;let o=e.split("-");if(o.length>=2){let s=`${o[0]}-${o[1]}`,n=Ti.get(s)??Li[s];if(n)return n}return Ti.get(o[0])??Li[o[0]]}var Me={en:st},zt={},ce="en";function Bs(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 s=ga(o);if(s)return s}return"en"}function Td(){return ce}function Cd(i=ce){return ya.has(i)?"rtl":"ltr"}function Pd(i){return!!Me[i]}function We(i,e){e&&(Me[i]={...Me[i],...e}),ce=Me[i]?i:"en",As(ce),xs(ce),typeof document<"u"&&(document.documentElement.lang=ce)}function Id(i){zt=i}var Fs=/\{(\w+)\}/g;function Y(i,e){let t=zt[i]??Me[ce]?.[i]??st[i]??i;return e?t.replace(Fs,(o,s)=>String(e[s]??`{${s}}`)):t}function xd(i,e,t){let o=new Intl.PluralRules(ce).select(e);return(zt[`${i}.${o}`]??Me[ce]?.[`${i}.${o}`]??st[`${i}.${o}`]??zt[`${i}.other`]??Me[ce]?.[`${i}.other`]??st[`${i}.other`]??i).replace(Fs,(r,a)=>String({count:e,...t}[a]??`{${a}}`))}function Md(i,e){return Ms(i,{...e??{dateStyle:"medium",timeStyle:"short"},locale:ce})}function Ds(i,e,t,o=!1){let s=i.displayLabel?.trim()||i.label;return o?{title:s,detail:Y("map.statusTaken"),sellable:!1}:e==="booked"?{title:s,detail:Y("map.statusTaken"),sellable:!1}:e==="held"?{title:s,detail:Y("map.statusHeld"),sellable:!1}:{title:s,detail:t()??"",sellable:!0}}var Ve=32,Os=70;function Gs(i,e){let t=Ve+6,o=i.y-Os;return{x:Math.min(Math.max(i.x,t),Math.max(t,e.width-t)),y:o>=t?o:Math.min(i.y+Os,e.height-t)}}var wa=220,ka=.08,Kt=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.host=e}syncMarker(e,t,o){let s=o.get(e);if(o.delete(e),!t){this.retire(s);return}s?.destroy();let n=this.host,r=n.seat(e);if(!r)return;let a=n.seatShape(e)?.fill(),l=X(typeof a=="string"?a:"",n.selectionColor(),It),c=n.selectionFocusId()===e,d=n.boothDims(r.rowId),h=n.seatRadius(),p=n.seatPoint(r),m=new Ci({name:"selection-ring",x:p.x,y:p.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:n.selectionFocusId()&&!c?.2:1});if(n.viewMode()==="perspective"){let f=n.perspectiveSeatScale(e);m.scale({x:f,y:f})}m.setAttrs({seatId:e,ringColor:l});let y={name:"selection-halo",stroke:B(n.categoryColor(r.categoryKey),Ts(U(n.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let f=h*1.2;m.add(new Ii({...y,width:d.width+f*2,height:d.height+f*2,offsetX:(d.width+f*2)/2,offsetY:(d.height+f*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else m.add(new Re({...y,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let u={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(m.add(new Ii({...u,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)m.add(new Ii({...u,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 f=Math.max(0,d.width/2-14),b=-Math.max(0,d.height/2-14);m.add(new Re({x:f,y:b,radius:10,fill:l,listening:!1})),m.add(new Pi({x:f,y:b,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:U(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else m.add(new Re({...u,radius:Math.max(1,h-1.25),strokeWidth:Math.min(2.5,Math.max(1.8,h*.22))})),c?m.add(new Re({...u,radius:h+2,strokeWidth:2,opacity:.55})):m.add(new Pi({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(),s=n=>{if(t.isDestroyed()||!e.getLayer()){e.destroy();return}let r=Math.min(1,(n-o)/160);e.opacity(1-r),t.overlayLayer.batchDraw(),r<1?requestAnimationFrame(s):(e.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(s)}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 s=t.seatRadius(),n=t.seatPoint(o);this.pulses.get(e)?.destroy();let r=new Re({name:"selection-pulse",x:n.x,y:n.y,radius:s,stroke:t.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,s*.24),opacity:ki(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,r),this.pulseHome().add(r);let a=t.isCached()?void 0:t.seatShape(e),l=performance.now(),c=()=>{a?.scale({x:1,y:1}),r.destroy(),this.pulses.get(e)===r&&this.pulses.delete(e),t.overlayLayer.batchDraw(),a&&!t.isCached()&&t.seatLayer.batchDraw()},d=h=>{if(t.isDestroyed()){c();return}r.getLayer()||this.pulseHome().add(r);let p=h-l,m=ki(p/420);if(r.radius(s*m.radiusScale),r.opacity(m.opacity),a){let y=Cs(p/320);a.scale({x:y,y})}t.overlayLayer.batchDraw(),a&&!t.isCached()&&t.seatLayer.batchDraw(),p<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 s=performance.now(),n=()=>{o.scale({x:1,y:1}),t.seatLayer.batchDraw()},r=a=>{if(t.isDestroyed()||t.isCached()||!o.getLayer()){n();return}let l=a-s,c=Math.min(1,l/wa),d=1+ka*Math.sin(Math.PI*c);o.scale({x:d,y:d}),t.seatLayer.batchDraw(),c<1?requestAnimationFrame(r):n()};requestAnimationFrame(r)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Ci({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,Ie),s=o?t.seat(o):void 0;if(!s){this.hideLoupe();return}let n=Ds(s,t.seatStatus(s.id),()=>t.priceLabel(s),t.seatClosed(s.id)),r=Gs(e,{width:t.stage.width(),height:t.stage.height()}),a=1/(t.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=s.id,l.group.position(t.screenToWorld(r)),l.group.scale({x:a,y:a}),l.group.opacity(n.sellable?1:.75),l.group.visible(!0),l.disc.fill(t.categoryColor(s.categoryKey)),l.title.text(n.title),l.title.offsetX(l.title.width()/2),l.detail.text(n.detail),l.detail.offsetX(l.detail.width()/2),t.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,t=e.canvasBackground(),o=X(t,le(t).sectionInk),s=new Ci({name:"touch-loupe",listening:!1,visible:!1});s.add(new Pi({points:[-7,Ve-4,0,Ve+12,7,Ve-4],closed:!0,fill:t,stroke:B(o,.25),strokeWidth:1,listening:!1})),s.add(new Re({radius:Ve,fill:t,stroke:B(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let n=new Re({y:-15,radius:6,fill:"#6e7bff",listening:!1}),r=new Ns({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),a=new Ns({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:B(o,.72),listening:!1,perfectDrawEnabled:!1});return s.add(n),s.add(r),s.add(a),e.overlayLayer.add(s),s.moveToTop(),this.loupe={group:s,title:r,detail:a,disc:n,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}};function Ws(i,e){let t=i.width(),o=i.height(),s=1/0,n=1/0,r=-1/0,a=-1/0;for(let l of e){let c=l.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<s&&(s=c.x),c.y<n&&(n=c.y),c.x+c.width>r&&(r=c.x+c.width),c.y+c.height>a&&(a=c.y+c.height)}}return isFinite(s)?{x:s,y:n,width:r-s,height:a-n}:null}var Vs=8,La=.5;function Ks(i,e){let t=Ws(i,e);if(!t)return 0;zs(i,t);let o=Math.min((i.width()-2*Vs)/t.width,(i.height()-2*Vs)/t.height);if(!(Math.max(t.width-i.width(),t.height-i.height())>La)||!(o>0))return 1;let n=i.width()/2,r=i.height()/2;i.scale({x:i.scaleX()*o,y:i.scaleY()*o}),i.position({x:n+(i.x()-n)*o,y:r+(i.y()-r)*o});let a=Ws(i,e);return a&&zs(i,a),o}function zs(i,e){let t=i.width()/2-(e.x+e.width/2),o=i.height()/2-(e.y+e.height/2);return t===0&&o===0?!1:(i.position({x:i.x()+t,y:i.y()+o}),!0)}function xi(i){return`${i.x()},${i.y()},${i.scaleX()}`}import{Group as Ta}from"konva/lib/Group";import{Circle as Xs}from"konva/lib/shapes/Circle";import{Line as Ca}from"konva/lib/shapes/Line";import{Text as Pa}from"konva/lib/shapes/Text";var Ia=6;function xa(i){return U(i)?"#0b1220":"#ffffff"}function Ys(i){let{points:e}=i;if(!e.length)return null;let t=i.categoryColor??"#6e7bff",o=0,s=0;for(let n of e)o+=n.x,s+=n.y;return{count:e.length,centroid:{x:o/e.length,y:s/e.length},fill:t,ink:xa(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=Ys({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 Ta({listening:!1,name:"owned-sections"}),s=new Set;for(let n of this.host.sections()){let r=this.host.ownedPoints(n),a=Ys({points:r,categoryColor:this.host.sectionColor(n)});if(!a)continue;let l=Math.max(Ia/2/t,1);for(let y of r)o.add(new Xs({name:"owned-seat-dot",x:y.x,y:y.y,radius:l,fill:a.fill,stroke:B("#ffffff",.55),strokeWidth:Math.max(.5,l*.28),shadowColor:a.fill,shadowBlur:l*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(s.has(n.logicalId))continue;s.add(n.logicalId);let c=this.host.sections().filter(y=>y.logicalId===n.logicalId).reduce((y,u)=>y+this.host.ownedPoints(u).length,0),d=this.host.labelAnchor(n),h=11/t,p={x:d.x,y:d.y-h*2.1};o.add(new Xs({name:"owned-section-badge",x:p.x,y:p.y,radius:h,fill:a.fill,stroke:B(a.ink,.35),strokeWidth:1/t,listening:!1,perfectDrawEnabled:!1})),o.add(new Ca({x:p.x-h*.62,y:p.y,points:[-h*.22,0,-h*.02,h*.2,h*.34,-h*.26],stroke:a.ink,strokeWidth:Math.max(.6,h*.16),lineCap:"round",lineJoin:"round",listening:!1}));let m=new Pa({x:p.x+h*.12,y:p.y-h*.5,text:String(c),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:a.ink,listening:!1,perfectDrawEnabled:!1});o.add(m),this.badges.push({id:n.logicalId,centre:p,radius:h*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};function N(i){let e=So(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 s=o*Math.PI/180,n=Math.cos(s),r=Math.sin(s);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(a=>({x:i.x+a.x*n-a.y*r,y:i.y+a.x*r+a.y*n}))}function Yt(i,e,t,o,s,n){let r=o*Math.PI/180,a=Math.cos(r),l=Math.sin(r);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let h=e*(d/6-.5),p=t*(c/4-.5),m={x:i.x+h*a-p*l,y:i.y+h*l+p*a};if(!ie(m,s,n))return!1}return!0}function Us(i,e,t){let o=N(i),s=[t];for(let r=1;r<12;r+=1)for(let a=1;a<12;a+=1){let l={x:o.x+o.width*a/12,y:o.y+o.height*r/12};ie(l,i,e)&&s.push(l)}let n=[i,...e];return s.map(r=>({point:r,room:to(r,n)})).sort((r,a)=>a.room-r.room).map(r=>r.point).filter((r,a,l)=>a===l.findIndex(c=>Math.abs(c.x-r.x)<1e-6&&Math.abs(c.y-r.y)<1e-6))}function $s(i,e){let{stageScale:t,stageX:o,stageY:s}=i;if(i.viewMode==="perspective"&&e.perspectiveAffine)return N(e.outline.map(r=>{let a=i.projectedSectionPoint(e,r);return{x:a.x*t+o,y:a.y*t+s}}));let n=e.liftWorld>0?i.isoLiftLocal(e.liftWorld):{x:0,y:0};return N(e.outline.map(r=>{let a={x:r.x+n.x,y:r.y+n.y},l=i.isoT===0?a:i.isoForward(a);return{x:l.x*t+o,y:l.y*t+s}}))}function Ma(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)),s=Math.max(0,Math.min(i.y+i.height,e.height)-Math.max(i.y,0));return o*s/t}function qs(i){let{current:e,viewport:t}=i,o=new Map;for(let a of i.sections){let l=Ma(a.bounds,t)*a.members;l<=0||o.set(a.logicalId,(o.get(a.logicalId)??0)+l)}if(!o.size)return e;let s=null,n=0;for(let[a,l]of o)l>n&&(n=l,s=a);if(!s||s===e)return e;let r=e!=null?o.get(e)??0:0;return n>r*1.35?s:e}import{Text as Ea}from"konva/lib/shapes/Text";function Ra(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 s of this.keys(e))for(let n of this.cells.get(s)??[])t.has(n)||(t.add(n),Ra(e,n)&&o++);return o}keys(e){let t=Math.floor(e.x/Je),o=Math.floor((e.x+Math.max(0,e.width))/Je),s=Math.floor(e.y/Je),n=Math.floor((e.y+Math.max(0,e.height))/Je),r=[];for(let a=s;a<=n;a++)for(let l=t;l<=o;l++)r.push(`${l}:${a}`);return r}};function Zs(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(b=>i.projectedSectionPoint(y,b)));let u=y.liftWorld>0?i.isoLiftLocal(y.liftWorld):{x:0,y:0},f=y.outline.map(b=>{let g={x:b.x+u.x,y:b.y+u.y};return i.isoT===0?g:i.isoForward(g)});return N(f)});if(!o.length)return null;let s=Math.min(...o.map(y=>y.x)),n=Math.min(...o.map(y=>y.y)),r=Math.max(...o.map(y=>y.x+y.width)),a=Math.max(...o.map(y=>y.y+y.height)),l=new Set(t.flatMap(y=>y.memberIds));for(let y of l){let u=i.seatById.get(y);if(!u)continue;let f=i.renderedSeatPoint(u);s=Math.min(s,f.x-i.seatR),n=Math.min(n,f.y-i.seatR),r=Math.max(r,f.x+i.seatR),a=Math.max(a,f.y+i.seatR)}let c=y=>{[y.x,y.y,y.width,y.height].every(Number.isFinite)&&(s=Math.min(s,y.x),n=Math.min(n,y.y),r=Math.max(r,y.x+y.width),a=Math.max(a,y.y+y.height))},d=y=>{let u={x:y.x+y.width/2,y:y.y+y.height/2};return t.some(f=>ie(u,f.outline,f.holes))};for(let{node:y,backdrop:u}of i.freeTextById.values()){let f=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});d(f)&&(c(f),u&&c(u.getClientRect({relativeTo:i.bgLayer,skipShadow:!0})))}for(let{node:y}of i.iconNodeById.values()){let u=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});d(u)&&c(u)}let h=new Ke;for(let{node:y}of i.freeTextById.values()){let u=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:u.x-Q,y:u.y-Q,width:u.width+Q*2,height:u.height+Q*2})}for(let y of i.rowLabelPlan){let u=(y.focusKeys??[]).some(S=>S===e||t.some(v=>S===v.id||S===v.logicalId)),f=new Ea({text:y.text,fontSize:y.fontSize,fontStyle:"700",fontFamily:i.labelFont(),rotation:y.rotation,listening:!1});f.offsetX(f.width()/2),f.offsetY(f.height()/2);let b=i.resolveAutomaticRowLabelPosition(f,y,h),g=i.rowLabelBox(f,b);u&&c(g),h.insert(g),f.destroy()}let p=Math.max(r-s,a-n),m=Math.max(i.seatR*2,Math.min(24,p*.025));return{x:s-m,y:n-m,width:Math.max(1,r-s+m*2),height:Math.max(1,a-n+m*2)}}import{Rect as Aa}from"konva/lib/shapes/Rect";import{Text as Qs}from"konva/lib/shapes/Text";function js(i,e){if(!e.zones?.length||!i.sections.length)return;let t=Ls(i.canvasBackground),o=new Map;for(let s of i.sections)s.zone&&(o.get(s.zone)??o.set(s.zone,[]).get(s.zone)).push(s);for(let s of e.zones){let n=o.get(s.id);if(!n||!n.length)continue;let r=n[0];for(let m of n)m.centroid.y<r.centroid.y&&(r=m);let a=r.centroid.x,l=r.centroid.y,c=1/0;for(let m of n)for(let y of m.memberIds){let u=i.seatById.get(y),f=u&&i.catPrice.get(u.categoryKey);typeof f=="number"&&f<c&&(c=f)}let d=new Aa({x:a,y:l,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:t.plate,stroke:B(s.color??r.outlineTint,rs),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(d);let h=new Qs({x:a,y:l,text:s.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 p=null;isFinite(c)&&(p=new Qs({x:a,y:l,text:Y("map.fromPrice",{price:ot(c,i.currency)}),fontSize:Dt,fontStyle:Gt,fontFamily:i.labelFont(),fill:t.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),p.offsetX(p.width()/2),i.bgLayer.add(p)),i.zones.push({id:s.id,anchor:{x:a,y:l},back:d,background:t.plate,name:s.label.toUpperCase(),label:h,sub:p})}}import{Circle as Ha}from"konva/lib/shapes/Circle";import{Line as Na}from"konva/lib/shapes/Line";import{Rect as Wa}from"konva/lib/shapes/Rect";import{Text as Va}from"konva/lib/shapes/Text";function Ee(i,e){return e.length===0?!!i.accessible:!!i.accessibility?.some(t=>e.includes(t))}function Mi(i,e){return Ee(i,e)?"match":i.accessibility?.includes("companion")?"companion":"other"}var Js=.35,en=.7,nt="#0b1220",rt="#ffffff",tn="#0b1220",on="#232c40",sn="#8b93a7";function nn(i,e,t="normal"){let o=i?"bold":t;return e?`italic ${o}`.trim():o}var Ri="#f7f8fb";import{Shape as Ba}from"konva/lib/Shape";import{Circle as Fa}from"konva/lib/shapes/Circle";import{Rect as Oa}from"konva/lib/shapes/Rect";var _a={M:2,L:2,Q:4,C:6,Z:0},Ei=new Map;function Ai(i){let e=Ei.get(i);if(e)return e;let t=Mt(i);if(!t)return Ei.set(i,[]),[];let o=t.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],s=[],n=0;for(;n<o.length;){let r=o[n++],a=_a[r];if(a===void 0||n+a>o.length)throw new Error(`Invalid path data for seat glyph "${i}".`);let l=o.slice(n,n+a).map(Number);if(l.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${i}".`);n+=a,r==="M"||r==="L"?s.push({command:r,points:l}):r==="Q"?s.push({command:r,points:l}):r==="C"?s.push({command:r,points:l}):s.push({command:"Z",points:[]})}return Ei.set(i,s),s}function rn(i,e,t,o=0,s=0){let n=Ai(e),r=vo(e).bounds;if(!n.length||!r||!(t>0))return!1;let a=wo(r,t);i.save(),i.translate(o,s),i.scale(a.scale,a.scale),i.translate(-a.centreX,-a.centreY);for(let l of n)l.command==="M"?i.moveTo(l.points[0],l.points[1]):l.command==="L"?i.lineTo(l.points[0],l.points[1]):l.command==="Q"?i.quadraticCurveTo(l.points[0],l.points[1],l.points[2],l.points[3]):l.command==="C"?i.bezierCurveTo(l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]):i.closePath();return i.restore(),!0}function an(i,e){i.beginPath(),i.arc(0,0,e,0,Math.PI*2,!1),i.closePath()}var at=class extends Ba{_sceneFunc(e){let t=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,s=Ai(o),n=this.attrs.seatGlyphDetail,r;if(n===void 0){let a=this.getAbsoluteScale(),l=Math.max(Math.abs(a.x),Math.abs(a.y)),c=Number.isFinite(l)&&l>0?l:1;r=t*2*c>=16}else r=n;if(!s.length||!r){an(e,t),e.fillStrokeShape(this);return}e.beginPath(),rn(e,o,t),e.fillStrokeShape(this)}_hitFunc(e){an(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 Da(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 ln(i){let{x:e,y:t,radius:o}=i;return i.wheelchairBay?new Oa({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}):Da(i.glyph,{x:e,y:t,radius:o,detail:i.detail,fill:i.fill})??new Fa({x:e,y:t,radius:o,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Ga(i,e){return i*2*e>=16}function cn(i,e,t,o){let s=Ga(e,t);if(s===o||!i.length)return s;for(let n of i)n.setAttr("seatGlyphDetail",s);return s}function dn(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"){za(i,t);continue}let o=i.seatContainer(t.id),s=ln({x:t.x,y:t.y,radius:i.seatR,detail:i.seatGlyphDetail,glyph:ko(t.glyph,i.catByKey.get(t.categoryKey)),wheelchairBay:t.wheelchairSpaceType==="no-seat"});if(s instanceof at&&i.glyphMarkers.push(s),s.setAttr("seatId",t.id),i.circleById.set(t.id,s),i.paintSeat(s,t.id),o.add(s),t.accessible){if(t.wheelchairSpaceType!=="no-seat"){let n=new Ha({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,n),o.add(n)}if(t.accessibility?.includes("wheelchair")&&Ct(t.accessibility)){let n=i.buildAccessGlyph(t,typeof s.fill()=="string"?s.fill():"");i.accessGlyphById.set(t.id,n),o.add(n)}}}}function za(i,e){let t=i.seatContainer(e.id),o=i.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},s=e.x,n=e.y,r;o.points&&o.points.length>=3?(r=new Na({x:e.x,y:e.y,points:o.points.flatMap(l=>[l.x,l.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s=e.x+o.points.reduce((l,c)=>l+c.x,0)/o.points.length,n=e.y+o.points.reduce((l,c)=>l+c.y,0)/o.points.length):r=new Wa({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}),r.setAttr("seatId",e.id),i.circleById.set(e.id,r),t.add(r);let a=new Va({x:s,y:n,text:e.displayLabel??e.label,fontSize:Te,fontStyle:"600",fontFamily:i.labelFont(),fill:i.theme.seatLabelColor??nt,listening:!1,perfectDrawEnabled:!1});a.offsetX(a.width()/2),a.offsetY(a.height()/2),a.visible(!1),i.setHasBoothText(),i.boothLabelById.set(e.id,a),t.add(a),i.paintSeat(r,e.id)}function hn(i,e,t,o){let s=null,n=1/0,r=i.stage.scaleX()||1;for(let a of i.seats){if(!o?.includeUnavailable&&!i.selection.has(a.id)&&!i.isSelectable(a.id))continue;let l=i.worldToScreen(a),c=i.viewMode==="perspective"?i.perspectiveSeatScale.get(a.id)??1:1,d=i.seatR*r*c+t,h=Math.hypot(l.x-e.x,l.y-e.y);h<=d&&h<n&&(n=h,s=a.id)}return s}function un(i){if(!i.objectFloor.size)return null;let e=i.stage.getPointerPosition();if(!e)return null;let t=i.screenToWorld(e),o=null,s=1/0;for(let n of i.seats){let r=i.renderedSeatPoint(n),a=r.x-t.x,l=r.y-t.y,c=a*a+l*l;c<s&&(s=c,o=n.rowId)}return o?i.objectFloor.get(o)??null:null}import{Circle as Ka}from"konva/lib/shapes/Circle";import{Line as Xa}from"konva/lib/shapes/Line";function pn(i,e,t,o){let s=i.seatRadius(),n=new Ka({x:t.x,y:t.y,radius:s,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),r=i.viewMode()==="perspective"?i.perspectiveSeatScale(e):1;n.scale({x:r,y:r}),i.overlayLayer.add(n);let a=performance.now(),l=620,c=d=>{if(!n.getLayer())return;let h=Math.min(1,(d-a)/l);n.radius(s*(1+h*1.8)),n.opacity(.9*(1-h)),i.overlayLayer.batchDraw(),h<1?requestAnimationFrame(c):(n.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(c)}function fn(i,e,t){for(let o of e){let s=i.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(h=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,h))):o.outline.map(h=>{let p=o.liftWorld>0?i.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:h.x+p.x,y:h.y+p.y}}),n=s.reduce((h,p)=>({x:h.x+p.x,y:h.y+p.y}),{x:0,y:0});n.x/=s.length,n.y/=s.length;let r=new Xa({x:n.x,y:n.y,points:s.flatMap(h=>[h.x-n.x,h.y-n.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(r),i.overlayLayer.batchDraw();let a=()=>{r.getLayer()&&(r.destroy(),i.overlayLayer.batchDraw())};if(i.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=h=>{if(i.isDestroyed()||!r.getLayer())return;let p=Math.min(1,(h-l)/c),y=1+(1-Math.pow(1-p,3))*.04;r.scale({x:y,y}),r.opacity(.92*(1-p)),i.overlayLayer.batchDraw(),p<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as qa}from"konva/lib/Group";import{Shape as Za}from"konva/lib/Shape";import{Group as Ya}from"konva/lib/Group";import{Shape as Ua}from"konva/lib/Shape";function $a(i,e,t){let o=e.length,s={x:(e[o-1].x+e[0].x)/2,y:(e[o-1].y+e[0].y)/2};i.moveTo(s.x,s.y);for(let n=0;n<o;n+=1){let r=e[n],a=e[(n+1)%o],l=e[(n-1+o)%o],c=Math.min(Math.hypot(r.x-l.x,r.y-l.y)/2,Math.hypot(a.x-r.x,a.y-r.y)/2);i.arcTo(r.x,r.y,a.x,a.y,Math.max(0,Math.min(t,c)))}i.closePath()}function Ae(i,e,t,o){let s=Ze(i)>0,n=t.cornerRadius&&t.cornerRadius>0?t.cornerRadius:0;return new Ua({...t,sceneFunc(r,a){r.beginPath();let l=d=>{if(d.length){if(n>0&&d.length>=3)return $a(r,d,n);r.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h+=1)r.lineTo(d[h].x,d[h].y);r.closePath()}};o?(d=>{r.moveTo(d.start.x,d.start.y);let h=d.start;for(let p of d.segments)p.kind==="line"?r.lineTo(p.end.x,p.end.y):p.kind==="arc"?r.arc(p.center.x,p.center.y,p.radius,Math.atan2(h.y-p.center.y,h.x-p.center.x),Math.atan2(p.end.y-p.center.y,p.end.x-p.center.x),!p.clockwise):r.bezierCurveTo(p.control1.x,p.control1.y,p.control2.x,p.control2.y,p.end.x,p.end.y),h=p.end;r.closePath()})(o):l(i);for(let d of e??[]){let h=Ze(d)>0;l(h===s?[...d].reverse():d)}r.fillStrokeShape(a)},perfectDrawEnabled:!1})}var lt=class extends Ya{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 mn(i,e){if(!e.length)return null;let t=new qa({listening:!1});for(let o of e){let s=i.viewMode==="perspective"&&o.perspectiveAffine,n=s?o.outline.map(a=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,a))):o.outline,r=s?o.holes.map(a=>a.map(l=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,l)))):o.holes;t.add(Ae(n,r,{fill:bs,stroke:B("#ffffff",.1),strokeWidth:1,listening:!1},s?void 0:o.outlinePath))}return i.bgLayer.add(t),t.moveToTop(),t}function yn(i,e){let{bounds:t}=i,s=Math.max(t.width,t.height,1)*4+1e3,n=[{x:t.x-s,y:t.y-s},{x:t.x+t.width+s,y:t.y-s},{x:t.x+t.width+s,y:t.y+t.height+s},{x:t.x-s,y:t.y+t.height+s}],r=new Za({fill:i.canvasBackground,opacity:1-xe,listening:!1,perfectDrawEnabled:!1,sceneFunc:(a,l)=>{let c=d=>{if(d.length){a.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h++)a.lineTo(d[h].x,d[h].y);a.closePath()}};a.beginPath(),c(n);for(let d of e){let h=i.viewMode==="perspective"&&d.perspectiveAffine?d.outline.map(p=>i.perspectiveLocalPoint(i.projectedSectionPoint(d,p))):d.outline.map(p=>{let m=d.liftWorld>0?i.isoLiftLocal(d.liftWorld):{x:0,y:0};return{x:p.x+m.x,y:p.y+m.y}});c(Ze(h)>0?[...h].reverse():h)}a.fillStrokeShape(l)}});return i.overlayLayer.add(r),r.moveToTop(),r}import{Rect as Lr}from"konva/lib/shapes/Rect";import{Line as Ul}from"konva/lib/shapes/Line";import{Text as zi}from"konva/lib/shapes/Text";import{Path as $l}from"konva/lib/shapes/Path";var Ut=1.12;function _i(i){return{x:i.width()/2,y:i.height()/2}}function gn(i,e,t){if(e.width<=0||e.height<=0)return i.scaleX();let o=Math.min(i.width()/(e.width*Ut),i.height()/(e.height*Ut));return G(o,t.min,t.max)}function bn(i,e,t,o){let s=G(e,o.min,o.max),n=i.scaleX();if(s===n)return!1;let r=(t.x-i.x())/n,a=(t.y-i.y())/n;return i.scale({x:s,y:s}),i.position({x:t.x-r*s,y:t.y-a*s}),!0}function Sn(i,e,t,o){let s=Math.min(i.width()/(e.width*Ut),i.height()/(e.height*Ut)),n=G(Math.max(s,o??t.min),t.min,t.max);i.scale({x:n,y:n}),i.position({x:i.width()/2-(e.x+e.width/2)*n,y:i.height()/2-(e.y+e.height/2)*n})}function vn(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?Zo:qo}function wn(i){return Math.max(i*1.05,zo,re*1.3)}function kn(i,e){let t=1/0,o=-1/0,s=1/0,n=-1/0;for(let r of i)t=Math.min(t,r.x),o=Math.max(o,r.x),s=Math.min(s,r.y),n=Math.max(n,r.y);return t-=e,o+=e,s-=e,n+=e,{x:t,y:s,width:Math.max(40,o-t),height:Math.max(40,n-s)}}function Ln(i){let{stageWidth:e,stageHeight:t,fullBounds:o,visibleBounds:s,seatPoints:n,minScale:r}=i;if(e>=oe||!n.length)return null;let a=1.12;if(Math.min(e/(o.width*a),t/(o.height*a))>=r)return null;let c=i.tapAnchor??{x:s.x+s.width/2,y:s.y+s.height/2},d=n[0],h=1/0;for(let y of n){let u=(y.x-c.x)**2+(y.y-c.y)**2;u<h&&(d=y,h=u)}let p=e/(r*a),m=t/(r*a);return{bounds:{x:d.x-p/2,y:d.y-m/2,width:p,height:m},minScale:r}}var xn=.5,H=Math.SQRT1_2,Qa="#f3f4f6",Tn=4;function ja(i){let e=i.fraction;return typeof e!="number"||!Number.isFinite(e)?xn:Math.min(1,Math.max(0,e))}function Ja(i){return i==="booked"||i==="not_for_sale"?it:Nt}function Cn(i,e){return Number.parseInt(i.slice(e,e+2),16)}function Pn(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,s]=e.toLowerCase();return`#${t}${t}${o}${o}${s}${s}`}function el(i,e,t){let o=Pn(i),s=Pn(e);if(!o||!s)return i;let n=Math.min(1,Math.max(0,t)),r="#";for(let a=1;a<7;a+=2){let l=Math.round(Cn(o,a)*(1-n)+Cn(s,a)*n);r+=l.toString(16).padStart(2,"0")}return r}function In(i,e,t,o){let s=t*4,n=e*H,r=-e*H,a=o*H*2*s,l=o*-H*2*s,c=n+s*H,d=r+s*H,h=n-s*H,p=r-s*H;i.beginPath(),i.moveTo(c,d),i.lineTo(h,p),i.lineTo(h+a,p+l),i.lineTo(c+a,d+l),i.closePath(),i.clip()}function tl(i,e){let t=e*4,o=Math.max(e*.45,1);i.beginPath();for(let s=-Tn;s<=Tn;s++){let n=s*o*2,r=n+o,a=n*H,l=-n*H,c=r*H,d=-r*H;i.moveTo(a+t*H,l+t*H),i.lineTo(a-t*H,l-t*H),i.lineTo(c-t*H,d-t*H),i.lineTo(c+t*H,d+t*H),i.closePath()}i.clip()}function $t(i,e){i._sceneFunc(e)}function Mn(i){let e=this,t=e.attrs,o=t.markRadius||1,s=t.fill,n=e.getStage(),r=Math.abs((n?n.scaleX():1)*(e.scaleX()||1))||1;if(o*2*r<16){t.fill=t.markMidtone??s,$t(e,i),t.fill=s;return}let l=(1-2*(t.markFraction??xn))*o;i.save(),In(i,l,o,1),t.fill=t.markBase??s,$t(e,i),i.restore(),i.save(),In(i,l,o,-1),t.fill=t.markFill??s,$t(e,i),t.markHatch&&(tl(i,o),t.fill=Qa,$t(e,i)),i.restore(),t.fill=s}function il(i,e,t,o,s,n){let r=ja(e),a=Ja(t),l=i.attrs;l.markFraction=r,l.markBase=o,l.markFill=a,l.markMidtone=el(o,a,1-r),l.markHatch=n,l.markRadius=s>0?s:1,i.fill(l.markMidtone),i.stroke(""),i.strokeWidth(0),i.dash([]),i.opacity(1),i.sceneFunc(Mn)}function ol(i){i.setAttr("sceneFunc",void 0)}function Bi(i){return i.attrs.sceneFunc===Mn}var qt=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[s,n]of Object.entries(e))t.has(s)&&(n&&n.kind==="partial"?(this.marks.set(s,n),o.add(s)):this.marks.delete(s)&&o.add(s));return o}paint(e,t,o,s,n,r,a){let l=a?void 0:this.marks.get(t);if(!l){Bi(e)&&ol(e);return}il(e,l,o,s,n,r)}};function Zt(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 Rn=.85,sl=[2,2],nl=1,En=.6;function rl(i){return U(i)?"#334155":"#e2e8f0"}function An(i,e,t){return i==="held"?{fill:Nt,stroke:rl(e),strokeWidth:nl,dash:[...sl],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:Rn}:{fill:it,stroke:"",strokeWidth:0,dash:[],opacity:i==="booked"?.45:.6,scale:Rn}:null}var Fi=1e6;function al(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}var Qt=class{constructor(e,t=al()){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(Fi+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 s=e.changedTouches.item(o);if(!s)continue;let n=this.toLocal(s.clientX,s.clientY);this.updatePointer(Fi+s.identifier,n)&&(t=n)}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(Fi+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<Ko}toLocal(e,t){let o=this.host.container.getBoundingClientRect();return{x:e-o.left,y:t-o.top}}beginPointer(e,t,o,s){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:s})?(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[n,r]=[...this.pointers.values()],a={x:(n.x+r.x)/2,y:(n.y+r.y)/2},l=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(r.x-n.x,r.y-n.y),startScale:l,worldMid:{x:(a.x-this.host.stage.x())/l,y:(a.y-this.host.stage.y())/l}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=we+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=we+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>we?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[t,o]=[...this.pointers.values()],s=Math.hypot(o.x-t.x,o.y-t.y);if(this.pinch.startDist<1)return;let n={x:(t.x+o.x)/2,y:(t.y+o.y)/2},{min:r,max:a}=this.host.zoomBounds(),l=G(this.pinch.startScale*(s/this.pinch.startDist),r,a);this.host.stage.scale({x:l,y:l}),this.host.stage.position({x:n.x-this.pinch.worldMid.x*l,y:n.y-this.pinch.worldMid.y*l}),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=we)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}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 ll}from"konva/lib/shapes/Circle";import{Group as cl}from"konva/lib/Group";import{Text as dl}from"konva/lib/shapes/Text";var _n=13,hl=15,ul=.3,pl=.08;function Dn(i,e,t){return!!(i&&t!==i||e&&!e.has(t))}function fl(i,e){return!e||i.available==null?`cap ${i.capacity}`:i.available<=0?Y("map.soldOut"):Y("map.seatsLeft",{count:i.available})}function ml(i,e){return e&&i.available!=null&&i.available<=0}function Gn(i){for(let e of i.gaById.values()){let t=i.filteredOut(e.categoryKey),o=i.overviewHidden(e),s=ml(e,i.pickerMode),n=i.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:i.dimmed(e.categoryKey)?Ce*pl:s?Ce*ul:Ce),e.polygon.listening(!i.exportMode&&!o&&!t&&!s),e.polygon.stroke(n>0?i.selectionColor:e.strokeColor),e.polygon.strokeWidth(n>0?3:1.5),yl(i,e,s,n,o,i.dimmed(e.categoryKey))}}function yl(i,e,t,o,s,n){if(e.capacityNode){let r=fl(e,i.pickerMode);e.capacityNode.text()!==r&&(e.capacityNode.text(r),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(t?.75:1)}gl(i,e,s||n),o>0&&!s?Sl(i,e,o):e.chip&&e.chip.visible(!1)}var Oi=9,Bn=.86;function gl(i,e,t){let{labelNode:o,capacityNode:s}=e;if(!o&&!s)return;let n=Math.max(i.effScale(),1e-4);if(t){o?.visible(!1),s?.visible(!1);return}if(!i.pickerMode){o?.visible(i.labelLegible(o.fontSize())),s?.visible(i.labelLegible(s.fontSize()));return}let r=bl(e,n),a=Fn(o,Lt,r.width*Bn,n),l=Fn(s,Tt,r.width*Bn,n),c=a!=null,d=l!=null&&c&&a+l+Oi<=r.height;On(o,c?a:null,e.labelPoint.y-Oi/n,n),On(s,d?l:null,e.labelPoint.y+Oi/n,n)}function bl(i,e){let t=1/0,o=-1/0,s=1/0,n=-1/0;for(let r of i.points)r.x<t&&(t=r.x),r.x>o&&(o=r.x),r.y<s&&(s=r.y),r.y>n&&(n=r.y);return Number.isFinite(t)?{width:(o-t)*e,height:(n-s)*e}:{width:0,height:0}}function Fn(i,e,t,o){if(!i||!i.text())return null;i.fontSize(e/o);let s=i.width()*o;if(s<=t||s<=0)return e;let n=e*(t/s);return n>=Z?n:null}function On(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 Sl(i,e,t){if(!e.chip){let o=new cl({x:e.labelPoint.x,y:e.labelPoint.y-_n-16,listening:!1}),s=new ll({radius:_n,fill:i.selectionColor,listening:!1,perfectDrawEnabled:!1}),n=new dl({text:String(t),fontSize:hl,fontStyle:"800",fontFamily:i.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});o.add(s),o.add(n),i.bgLayer.add(o),e.chip=o,e.chipText=n}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 Hn(i,e){let t=!1;for(let[o,s]of Object.entries(e)){let n=i.get(o);n&&(s.available!==void 0&&n.available!==s.available&&(n.available=s.available,t=!0),s.selected!==void 0&&n.selected!==s.selected&&(n.selected=s.selected,t=!0))}return t}function Nn(i,e){return i===null||e===null?i===e:i.size===e.size&&[...i].every(t=>e.has(t))}function Wn(i,e){let t=null;for(let o of i){let s=e.get(o)?.logicalId;if(!s||t!=null&&t!==s)return null;t=s}return t}function Vn(i,e){if(!e?.size)return!1;for(let t of i)if(e.has(t))return!1;return!0}import{Rect as zn}from"konva/lib/shapes/Rect";import{Text as vl}from"konva/lib/shapes/Text";function Kn(i){let e=i.effScale(),t=i.stage.scaleX(),o={width:i.stage.width(),height:i.stage.height()},s=u=>Math.round(u*100)/100,n=new Map(i.overlayLayer.find(".selection-ring").map(u=>[String(u.getAttr("seatId")??""),String(u.getAttr("ringColor")??i.effSelection)])),r=i.seats.map(u=>{let f=i.circleById.get(u.id),b=i.boothLabelById.get(u.id)??i.seatLabelById.get(u.id),g=i.viewMode==="perspective"?i.perspectiveSeatScale.get(u.id)??1:1,S=(i.viewMode==="perspective"?t:e)*g,v=u.kind==="booth"?Te:fe*i.seatLabelScale(u),w=i.viewMode==="perspective"&&u.kind!=="booth"?e*g:S,k=s((b?.fontSize()??v)*w),T=i.worldToScreen(u),C=b?b.width()*t*g:0,L=b?b.height()*(i.viewMode==="perspective"&&u.kind==="booth"?t:e)*g:0,I=T.x-C/2<0||T.x+C/2>o.width||T.y-L/2<0||T.y+L/2>o.height,x=i.focusedSeatOpacity(u.id,f?.getAbsoluteOpacity()??0),M=i.seatSection.get(u.id),R=!!b?.isVisible()&&x>=.5&&!I,P;R||(x<.5?P="dimmed-or-unavailable":k<Z?P="below-minimum-size":I?P="outside-viewport":b?P="renderer-hidden":P="clutter-or-fit");let A=f instanceof zn?f.width()*t*g:i.seatR*2*S,_=f instanceof zn?f.height()*(i.viewMode==="perspective"?t:e)*g:i.seatR*2*S,j=2*(i.seatR*S+Ie),V=f?.fill(),z=b?.fill(),J=i.accessGlyphById.get(u.id),O=J?.getAbsoluteScale();return{seatId:u.id,label:u.label,kind:u.kind==="booth"?"booth":"seat",markerShape:u.kind==="booth"?"booth":u.wheelchairSpaceType==="no-seat"?"square":"circle",...u.wheelchairSpaceType?{wheelchairSpaceType:u.wheelchairSpaceType}:{},categoryKey:u.categoryKey,...M?{sectionId:M.id}:{},...M?.zone?{zoneId:M.zone}:{},status:i.statusById.get(u.id)??"free",selected:i.selection.has(u.id),visible:R,renderedFontPx:k,fill:typeof V=="string"?V:"",ink:typeof z=="string"?z:f?i.seatLabelInk(u,f):i.seatPreferredLabelInk(u),...n.has(u.id)?{selectionRingColor:n.get(u.id)}:{},opacity:s(x),...J?{accessibilityMarker:{glyphVisible:J.isVisible(),glyphWidthPx:s(ve*Math.abs(O?.x??0)),emphasizedByFilter:i.accessGlyphFilterEmphasized(u.id)}}:{},pointerTarget:{active:!i.cached&&!i.seatViewportCulled(u.id)&&!!f?.isVisible()&&!!f?.isListening()&&i.isSelectable(u.id),directWidthPx:s(A),directHeightPx:s(_),effectiveMinimumPx:s(Math.max(Math.min(A,_),j))},screenCenter:{x:s(T.x),y:s(T.y)},...R?{screenBox:{x:s(T.x-C/2),y:s(T.y-L/2),width:s(C),height:s(L)}}:{},...P?{hiddenReason:P}:{}}}),a=r.filter(u=>u.visible).length,l=(u,f,b,g,S,v)=>{let w=ze({x:g.x(),y:g.y()},g.width(),g.height(),g.rotation()),k=v&&v.liftWorld>0?i.isoLiftLocal(v.liftWorld):{x:0,y:0},T=N(w.map(R=>i.worldToScreen({x:R.x+k.x,y:R.y+k.y}))),C=s(g.opacity()),L=g.fill(),I=T.x+T.width<0||T.x>o.width||T.y+T.height<0||T.y>o.height,x=g.isVisible()&&C>.05&&!I,M=v?Yt({x:g.x(),y:g.y()},g.width(),g.height(),g.rotation(),v.outline,v.holes):void 0;return{id:u,kind:f,role:b,label:g.text(),visible:x,renderedFontPx:s(g.fontSize()*t),opacity:C,fill:S,ink:typeof L=="string"?L:"",...M==null?{}:{fitsContainer:M},...x?{screenBox:{x:s(T.x),y:s(T.y),width:s(T.width),height:s(T.height)}}:{}}},c=u=>{let f=u.namePlate.fill();if(u.namePlate.opacity()>.05&&typeof f=="string"&&f)return f;let b=u.blockPoly.fill();return typeof b=="string"?b:u.baseFill},d=[...i.sections.map(u=>l(u.id,"section","name",u.nameLabel,c(u),u)),...i.sections.map(u=>l(`${u.id}:availability`,"section","availability",u.subLabel,c(u),u)),...i.zones.flatMap(u=>[l(u.id,"zone","name",u.label,u.background),...u.sub?[l(`${u.id}:price`,"zone","price",u.sub,u.background)]:[]])],h=[...i.gaById].map(([u,f])=>{let b=f.points.map(I=>i.worldToScreen(I)),g=Math.min(...b.map(I=>I.x)),S=Math.min(...b.map(I=>I.y)),v=Math.max(...b.map(I=>I.x)),w=Math.max(...b.map(I=>I.y)),k=v<0||g>o.width||w<0||S>o.height,T=s(f.polygon.opacity()),C=T>=.1&&!k,L=f.polygon.fill();return{areaId:u,label:f.label,capacity:f.capacity,categoryKey:f.categoryKey,...f.sectionId?{sectionId:f.sectionId}:{},visible:C,interactive:f.polygon.listening(),opacity:T,fill:typeof L=="string"?L:"",effectiveBackground:f.effectiveBackground,...C?{screenBox:{x:s(g),y:s(S),width:s(v-g),height:s(w-S)}}:{}}}),p=[...i.freeTextById].map(([u,f])=>{let{node:b,background:g,kind:S}=f,v=i.worldToScreen({x:b.x(),y:b.y()}),w=b.width()*t,k=b.height()*e,T=v.x-b.offsetX()*t,C=v.y-b.offsetY()*e,L=s(b.fontSize()*e),I=T+w<0||T>o.width||C+k<0||C>o.height,x=b.isVisible()&&!I,M=b.fill(),R=s(b.getAbsoluteOpacity()),P;return x||(L<Z?P="below-minimum-size":I?P="outside-viewport":P="renderer-hidden"),{objectId:f.objectId??u,kind:S,text:b.text(),visible:x,renderedFontPx:L,ink:typeof M=="string"?M:"",background:g,opacity:R,...x?{screenBox:{x:s(T),y:s(C),width:s(w),height:s(k)}}:{},...P?{hiddenReason:P}:{}}}),m=i.labelGroup.find(u=>u.getAttr("rowLabel")===!0).filter(u=>u instanceof vl).map(u=>{let f=u.getClientRect({skipShadow:!0,skipStroke:!0}),b=f.x+f.width<0||f.x>o.width||f.y+f.height<0||f.y>o.height,g=u.fill();return{text:u.text(),visible:u.isVisible()&&!b,renderedFontPx:s(u.fontSize()*e),ink:typeof g=="string"?g:"",...b?{}:{screenBox:{x:s(f.x),y:s(f.y),width:s(f.width),height:s(f.height)}}}}),y=i.sections.filter(u=>u.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:s(e),rung:i.getRung(),minimumVisibleLabelPx:Z,totalLabelledBookableUnits:r.length,visibleLabels:a,hiddenLabels:r.length-a,totalBookableUnits:r.length+h.reduce((u,f)=>u+f.capacity,0),selectionRingSeatIds:i.overlayLayer.find(".selection-ring").map(u=>String(u.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(u=>{let f=u.blockPoly.fill();return typeof f!="string"||!wi(i.canvasBackground,f)}).length,tintedSectionShells:y.filter(u=>{let f=u.blockPoly.fill();return typeof f=="string"&&ks(i.canvasBackground,f)}).length,visibleCategoryDetailOutlines:i.sections.filter(u=>u.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:i.sections.filter(u=>u.subLabel.opacity()>.05).length,visibleSectionGADetails:[...i.gaById.values()].filter(u=>u.sectionId!=null&&u.polygon.opacity()>.05).length},labels:r,gaAreas:h,hierarchyLabels:d,freeTextLabels:p,rowLabels:m}}import{Circle as wl}from"konva/lib/shapes/Circle";import{Ellipse as kl}from"konva/lib/shapes/Ellipse";import{Line as Xn}from"konva/lib/shapes/Line";import{Arrow as Ll}from"konva/lib/shapes/Arrow";import{Path as Tl}from"konva/lib/shapes/Path";import{Rect as ct}from"konva/lib/shapes/Rect";import{Text as Gi}from"konva/lib/shapes/Text";import{Image as Yn}from"konva/lib/shapes/Image";function Un(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,s=t.naturalHeight||3,n=e.crop??{x:0,y:0,width:1,height:1},r=Math.max(0,Math.min(.99,n.x)),a=Math.max(0,Math.min(.99,n.y)),l={x:r,y:a,width:Math.max(.01,Math.min(1-r,n.width)),height:Math.max(.01,Math.min(1-a,n.height))},c=e.width,d=c*(s*l.height/(o*l.width)),h=new Yn({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:l.x*o,y:l.y*s,width:l.width*o,height:l.height*s},opacity:e.opacity,listening:!1});i.bgLayer.add(h),h.moveToBottom(),i.bgLayer.batchDraw()})}function $n(i,e){let t=new window.Image,o=new Yn({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 s=o.getLayer();s&&s.batchDraw()})}function qn(i,e){if(e.shape==="round")i.bgLayer.add(new wl({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,s=e.height??50;i.bgLayer.add(new ct({x:e.center.x,y:e.center.y,width:o,height:s,offsetX:o/2,offsetY:s/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 Cl=8,Pl=6;function Zn(i,e){let t=e.background?.color??i.canvasBackground,o=X(t,e.color??i.theme.textColor??sn),s=e.semanticKind==="icon"?Ro(e.iconKey):void 0;if(s){let c=e.fontSize/24,d=new Tl({x:e.position.x,y:e.position.y,data:s,rotation:e.rotation,scaleX:c,scaleY:c,stroke:X(t,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 n=e.background?.padding??0,r=e.opacity??1,a=new Gi({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:nn(e.bold,e.italic,"600"),fill:X(t,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:n,opacity:r,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),l;if(e.background){let c=a.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),d=Math.max(Cl,e.fontSize*.35),h=Math.max(Pl,e.fontSize*.28);l=new ct({x:e.position.x,y:e.position.y,offsetX:-(c.x-d),offsetY:-(c.y-h),width:c.width+d*2,height:c.height+h*2,rotation:e.rotation,fill:e.background.color,opacity:r*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),i.bgLayer.add(l)}i.freeTextById.set(e.id,{node:a,backdrop:l,background:t,kind:"free-text"}),i.bgLayer.add(a)}function Qn(i,e){let t=e.fill??i.theme.decorFill??on,o=e.role==="stage",s=e.role==="reference-focal",n=!!e.role&&!o,r=le(i.canvasBackground),a=s?r.focalFill:t,l=e.kind==="line"||e.kind==="polyline",c=e.stroke?.color??(o?Se(a,.28):s?r.focalStroke:l?"#9aa3b5":void 0),d=e.stroke?.width??(o?1:s||l?2:0),h=e.opacity!=null?G(e.opacity,.1,1):1,p=0,m=0,y=null;if(l&&e.points&&e.points.length>=2){p=e.points.reduce((g,S)=>g+S.x,0)/e.points.length,m=e.points.reduce((g,S)=>g+S.y,0)/e.points.length;let u=Eo(e),f=Ao(d),b=new Ll({points:e.points.flatMap(g=>[g.x,g.y]),closed:!1,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:c,fill:c,strokeWidth:d,opacity:h,lineCap:u.lineCap,lineJoin:u.lineJoin,pointerAtBeginning:u.startEnding==="arrow",pointerAtEnding:u.endEnding==="arrow",...f,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 u=o?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,ue(a,.3),1,Se(a,.12)]}:{fill:a};p=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height},i.bgLayer.add(new ct({x:p,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...u,stroke:c,strokeWidth:d,cornerRadius:G(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:h,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){p=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height};let u=o?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,ue(a,.3),1,Se(a,.12)]}:{fill:a};i.bgLayer.add(new kl({x:p,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...u,stroke:c,strokeWidth:d,opacity:h,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let u=e.points.flatMap(g=>[g.x,g.y]),f=N(e.points);p=e.points.reduce((g,S)=>g+S.x,0)/e.points.length,m=e.points.reduce((g,S)=>g+S.y,0)/e.points.length,y=f;let b=o?{fillLinearGradientStartPoint:{x:0,y:f.y},fillLinearGradientEndPoint:{x:0,y:f.y+f.height},fillLinearGradientColorStops:[0,ue(a,.3),1,Se(a,.12)]}:{fill:a};i.bgLayer.add(new Xn({points:u,closed:!0,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,...b,stroke:c,strokeWidth:d,opacity:h,listening:!1}))}y&&e.role&&i.landmarkBoxes.push(y);for(let u of Bo(e))i.bgLayer.add(new Xn({points:u.points.flatMap(f=>[f.x,f.y]),closed:u.closed,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:u.ink??_o,fill:u.fill,strokeWidth:2,opacity:h*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:u,spec:f}=xl(i,p,m,e.label,a,y);i.primaryFocalLabels.set(u,f),i.freeTextById.set(e.id,{node:u,background:a,kind:"stage"})}else if(n){let u=dt(i,i.bgLayer,e.label,p,m,s?X(a,"#e6e9f0"):"#9aa3b5",s?18:12,!1);s&&i.primaryFocalLabels.set(u,{targetPx:18,trackingRatio:0,ink:String(u.fill()??""),plateInk:String(u.fill()??""),plate:new ct({width:0,height:0,opacity:0,listening:!1})}),i.freeTextById.set(e.id,{node:u,background:a,kind:"decor"})}else{let u=dt(i,i.bgLayer,e.label,p,m,"#cbd5e1",16,!0);i.freeTextById.set(e.id,{node:u,background:a,kind:"decor"})}}var Di=22,Il=Z,jt=6;function xl(i,e,t,o,s,n){let r=X(s,i.theme.textColor??"#e6e9f0"),a=n?n.x+n.width/2:e,l=n?n.y+n.height/2:t,c=Ml(i.canvasBackground,s),d=new ct({x:a,y:l,width:0,height:0,cornerRadius:4,fill:c,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(d);let h=new Gi({x:a,y:l,text:o.toUpperCase(),fontSize:Di,fontStyle:"700",letterSpacing:4,fontFamily:i.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return h.offsetX(h.width()/2),h.offsetY(h.height()/2),i.bgLayer.add(h),{node:h,spec:{targetPx:Di,...n?{bounds:n}:{},trackingRatio:4/Di,ink:r,plateInk:X(c,i.theme.textColor??"#e6e9f0"),plate:d}}}function Ml(i,e){return pe(e,U(i)?"#ffffff":"#000000",.34)}function jn(i,e,t,o){let s=Math.max(t,1e-4),n=e.targetPx/s,r=m=>{i.letterSpacing(m*e.trackingRatio),o(i,m)};r(n);let a=e.bounds;if(!a){e.plate.opacity(0),i.fill(e.ink);return}let l={width:a.width-jt*2,height:a.height-jt*2},c=Math.min(1,l.width/Math.max(i.width(),1e-6),l.height/Math.max(i.height(),1e-6));if(c<1&&(n=Math.max(Il/s,n*c),r(n)),i.width()<=l.width&&i.height()<=l.height){e.plate.opacity(0),i.fill(e.ink);return}let h=i.width()+jt*2,p=i.height()+jt;e.plate.size({width:h,height:p}),e.plate.offset({x:h/2,y:p/2}),e.plate.opacity(1),i.fill(e.plateInk)}function Jn(i,e){let t=i.catColor.get(e.categoryKey)??"#6e7bff",o=i.canvasBackground,s=bo(t,o,Ce),n=i.theme.textColor??"#e6e9f0",r=X(s,n),a=Ae(e.points,e.holes,{fill:t,opacity:Ce,stroke:t,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",p=>{i.isGhostClick(p)||i.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{i.container.style.cursor="pointer"}),a.on("mouseleave",()=>{i.container.style.cursor="default"}),i.bgLayer.add(a);let l=St(e.points,e.holes),c=i.sections.find(p=>ie(l,p.outline,p.holes)),d=dt(i,i.bgLayer,e.displayLabel??e.label,l.x,l.y-8,r,Lt,!1),h=dt(i,i.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,r,Tt,!1);i.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:d,background:s,kind:"ga-label",categoryKey:e.categoryKey}),i.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:s,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:a,effectiveBackground:s,strokeColor:t,labelPoint:l,labelNode:d,capacityNode:h,...c?{sectionId:c.logicalId}:{}})}function dt(i,e,t,o,s,n,r,a){let l=new Gi({x:o,y:s,text:t,fontSize:r,fontStyle:a?"700":"500",fontFamily:i.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function er(i,e){let t=[],o=e.theme.background??"#f7f8fb",s=new Map,n=(c,d)=>{let h=s.get(c)??[];h.push(d),s.set(c,h)};for(let c of e.seats){if(c.kind==="booth")continue;let d=c.logicalRowId??c.rowId;n(d,c),d!==c.rowId&&n(c.rowId,c)}let r=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 p=c.segmentedRow&&!d?c.segmentedRow.groupId:c.id,m=(s.get(p)??[]).slice().sort((P,A)=>r(P)-r(A));if(!m.length)continue;let y=m[0],u=m[m.length-1],f=h?.labelStyle,b=X(o,f?.color??e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",It),g=f?.size??go,S=h?.rotation??0,v=e.objectFilteredOut(c)?.15:1,w=e.seatSection.get(y.id),k=c.segmentedRow?.displayLabel??c.displayLabel,T=w?.label.trim(),C=T&&c.label.toLocaleLowerCase("en-US").startsWith(`${T.toLocaleLowerCase("en-US")} `)?c.label.slice(T.length).trim():"",L=k??(/^[\p{L}\p{N}]{1,4}$/u.test(C)?C:c.label),I=w?[...new Set([w.id,w.logicalId,w.zone].filter(P=>!!P))]:void 0,x=(P,A,_)=>t.push({text:L,x:P,y:A,rotation:S,fontSize:g,ink:b,opacity:v,...I?.length?{focusKeys:I}:{},..._?{automaticAway:_}:{}});if(h?.position){x(h.position.x,h.position.y);continue}let M=e.seatR+12,R=h?.positionPreset??"start";if(R==="start"||R==="both"){let P=c.rotation*Math.PI/180,A={x:-Math.cos(P),y:-Math.sin(P)};x(y.x+A.x*M,y.y+A.y*M,A)}if(R==="end"||R==="both"){let P=(c.rotation+c.curve)*Math.PI/180,A={x:Math.cos(P),y:Math.sin(P)};x(u.x+A.x*M,u.y+A.y*M,A)}}let a=(e.seatR+12)*2.2,l=[];for(let c of t){let d=l.find(h=>h.text===c.text&&Math.hypot(h.x-c.x,h.y-c.y)<=a);if(d){d.x=(d.x+c.x)/2,d.y=(d.y+c.y)/2;continue}l.push(c)}return l}function Hi(i,e,t=Q){let o=i.rotation()*Math.PI/180,s=Math.abs(Math.cos(o)),n=Math.abs(Math.sin(o)),r=(i.width()*s+i.height()*n)/2+t,a=(i.width()*n+i.height()*s)/2+t;return{x:e.x-r,y:e.y-a,width:r*2,height:a*2}}function tr(i,e,t,o){let s={x:e.x,y:e.y},n=e.automaticAway;if(!n)return s;let r={x:-n.y,y:n.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=[{x:0,y:0}];for(let p=1;p<=4;p++){let m=a*p;l.push({x:r.x*m,y:r.y*m},{x:-r.x*m,y:-r.y*m},{x:n.x*m,y:n.y*m},{x:(n.x+r.x)*m,y:(n.y+r.y)*m},{x:(n.x-r.x)*m,y:(n.y-r.y)*m})}let c=s,d=1/0,h=1/0;for(let p of l){let m={x:s.x+p.x,y:s.y+p.y},y=Hi(i,m),f=(o?Rt(o,y,{mode:"overlap"}).length:0)+t.collisionCount(y),b=Math.hypot(p.x,p.y);if((f<d||f===d&&b<h)&&(c=m,d=f,h=b),f===0)break}return c}function ir(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(B(e.outlineTint,.5)),e.outlinePoly.fill(B(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=pe("#f4b740","#ef4444",t);e.outlinePoly.stroke(B(o,.72+t*.25)),e.outlinePoly.fill(B(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 Wi(i,e){return i.closedSections.has(e.id)||i.closedSections.has(e.logicalId)||e.zone!=null&&i.closedSections.has(e.zone)}function or(i,e){return Wi(i,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*ms?"nearly-gone":"normal"}function sr(i,e){let t=or(i,e),o=i.accessFilterActive&&i.sectionAccessibleFree(e)<=0,s=ws(i.canvasBackground,t,o?null:e.shellCategoryColor);e.shellFill=s.fill,e.shellStroke=s.stroke,e.blockPoly.fill(s.fill),e.blockPoly.stroke(s.stroke),e.subLabel.text(t==="sold-out"?Y("map.soldOut"):Y("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Rl(i,e){return pe(e,U(i)?"#ffffff":"#000000",hs)}function El(i,e,t=0){let o=ds-t;return!e||i.length<=o?i:`${i.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function Al(i,e){return i.accessFilterActive&&i.sectionAccessibleFree(e)>0}function _l(i,e,t){let o=Al(i,e),s=El(e.label,t,o?2:0),n=o?`\u267F ${s}`:s;e.nameLabel.text()!==n&&e.nameLabel.text(n),e.nameLabel.fontStyle(t?cs:Ne),e.nameLabel.letterSpacing(t?e.nameLabel.fontSize()*tt:0)}function Bl(i,e,t){let o=i.stageWidth<oe,s=e.nameLabel.opacity();if(!o||s<=.05||!e.nameLabel.visible()){e.namePlate.opacity(0),e.subLabel.opacity(0);return}let n=e.nameLabel.rotation(),r=n===0&&or(i,e)==="sold-out",a=bi/t,l=ps/t,c=r?2/t:0,d={x:e.nameLabel.x(),y:e.nameLabel.y()},h=e.nameLabel.height(),p=0;r?(_e(e.subLabel,He/t,d.y),p=e.subLabel.height(),e.subLabel.rotation(0),e.subLabel.x(d.x),e.subLabel.y(d.y+h/2+c+p/2),e.subLabel.opacity(s)):e.subLabel.opacity(0);let m=r?c+p:0,y=Math.max(e.nameLabel.width(),r?e.subLabel.width():0)+a*2,u=h+m+l*2;e.namePlate.position({x:d.x,y:d.y+m/2}),e.namePlate.rotation(n),e.namePlate.size({width:y,height:u}),e.namePlate.offset({x:y/2,y:u/2}),e.namePlate.cornerRadius(fs/t),e.namePlate.opacity(s*us)}function nr(i,e){let t,o;i.reducedMotion?(t=e<=ge?1:0,o=e<=Ge?1:0):(t=G((be-e)/(be-ge),0,1),o=G((ge-e)/(ge-Ge),0,1)),(i.floorOverview||i.focusedSectionId)&&(t=0,o=0);let s=!i.floorOverview&&!i.focusedSectionId&&e<re;s&&(t=1),i.zones.length||(o=0);let n=i.viewMode==="perspective"&&i.glideInProgress&&i.seatCount>2500;i.seatLayer.opacity(s||n?0:1-t);let r=i.stageScaleX,a=!i.glideInProgress&&(i.lodScale===0||Math.abs(e-i.lodScale)/(i.lodScale||1)>.08);a&&i.setLodScale(e);let l=i.focusedSectionId,c=i.stageWidth<oe,d=le(i.canvasBackground),h=G((t-.2)/.8,0,1);for(let m of i.sections){let y=i.hasFocusDimOverlay?1:l&&m.id!==l&&m.logicalId!==l&&m.zone!==l?xe:1,u=Math.min(y,Vn(m.memberCategoryKeys,i.categoryFilter)?xe:1);m.outlinePoly.opacity(s?0:(1-t)*u),m.blockPoly.opacity(Qo*t*u);let f=i.sectionIsOwned(m);m.blockPoly.stroke(f?i.selectionColor:m.shellStroke||d.sectionStroke),m.blockPoly.strokeWidth((f?jo:Ft)/Math.max(r,1e-4));let b=m.blockPoly.fill(),g=typeof b=="string"?b:m.baseFill,S=c?Rl(i.canvasBackground,g):null;S&&m.namePlate.fill(S);let v=X(S??g,m.preferredInk);m.nameLabel.fill(v),m.subLabel.fill(v),_l(i,m,c),a&&h>.01&&Dl(i,m,r),m.nameLabel.opacity(m.nameLabelFits?h*(1-o)*u:0),m.subLabel.opacity(0)}let p=o*(1-i.isoT);for(let m of i.zones)m.back.opacity(p),m.label.opacity(p),m.sub&&m.sub.opacity(i.stageWidth<oe?0:p),a&&Hl(i,m,r);if(!i.glideInProgress&&(h>.01||p>.01)){Ol(i,r),Fl(i.sections);for(let m of i.zones){let y=m.label.opacity();m.back.opacity(y),m.sub&&m.sub.opacity(i.stageWidth<oe?0:y)}}for(let m of i.sections)Bl(i,m,r);i.bgLayer.batchDraw()}function Fl(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(s=>s.nameLabel.opacity()>.05).sort((s,n)=>{let r=N(s.outline),a=N(n.outline);return a.width*a.height-r.width*r.height});for(let s of o.slice(1))s.nameLabel.opacity(0)}}function Ol(i,e){let o=[],s=l=>{let c=i.worldToScreen({x:l.x(),y:l.y()}),d=N(ze({x:0,y:0},l.width()*e,l.height()*e,l.rotation()));return{x:c.x-d.width/2,y:c.y-d.height/2,w:d.width,h:d.height}};for(let l of i.zones){if(l.label.opacity()<=.05)continue;let c=l.back.getAbsolutePosition(),d=l.back.width()*e,h=l.back.height()*e;o.push({node:l.label,tier:0,section:!1,zone:l,box:{x:c.x-d/2,y:c.y-h/2,w:d,h}})}for(let l of i.sections)l.nameLabel.opacity()>.05&&o.push({node:l.nameLabel,tier:1,section:!0,area:l.labelArea,box:s(l.nameLabel)});let n=i.landmarks.map(l=>{let c=i.worldToScreen({x:l.x,y:l.y}),d=i.worldToScreen({x:l.x+l.width,y:l.y+l.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&&!n.length)return;o.sort((l,c)=>l.tier-c.tier||(c.area??0)-(l.area??0)||l.box.y-c.box.y||l.box.x-c.box.x);let r=[...n],a=l=>r.some(c=>l.x<c.x+c.w+4&&c.x<l.x+l.w+4&&l.y<c.y+c.h+4&&c.y<l.y+l.h+4);for(let l of o){if(!a(l.box)){r.push(l.box);continue}let c=!1;if(l.zone)for(let d of ls){if(d===0)continue;let h={...l.box,y:l.box.y+d};if(!a(h)){Ni(l.zone,0,d/e),r.push(h),c=!0;break}}if(l.section){let d=l.node.fontSize(),h=l.node.y(),p=l.node.letterSpacing()>0;for(let m of Jo){let y=d*m;if(y*e<He)break;_e(l.node,y,h),p&&(l.node.letterSpacing(l.node.fontSize()*tt),l.node.offsetX(l.node.width()/2));let u=s(l.node);if(!a(u)){r.push(u),c=!0;break}}c||(_e(l.node,d,h),p&&(l.node.letterSpacing(l.node.fontSize()*tt),l.node.offsetX(l.node.width()/2)))}c||l.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 Dl(i,e,t){e.subLabelFits=!1;let o=i.stageWidth<oe,s=o?bi*2:0,n=Ht(gi*e.labelScale,i.stageWidth),r=He;for(let a=n;a>=r;a-=1)for(let l of[0,-90]){e.nameLabel.rotation(l),_e(e.nameLabel,a/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+s)/t;if(Yt(c,e.nameLabel.width()+d,e.nameLabel.height()+d,l,e.outline,e.holes)){e.nameLabelFits=!0;return}}}e.nameLabel.position(e.centroid),e.nameLabel.rotation(0),e.nameLabelFits=!1}function Gl(i,e,t){let o=s=>(i.text(s),i.width());if(!(o(e)<=t)){for(let s=e.length-1;s>=1;s-=1)if(o(`${e.slice(0,s).trimEnd()}\u2026`)<=t)return;o("\u2026")}}function Hl(i,e,t){let o=Si(i.stageWidth),s=e.sub!=null&&i.stageWidth>=oe,n=i.stageWidth<oe,r=(n?ts:os)*o/t,a=(n?is:ss)*o/t,l=s?3*o/t:0;if(e.label.text(e.name),_e(e.label,Ht(Ot,i.stageWidth)/t,e.anchor.y),n){let g=i.stageWidth*as/t-r*2;Gl(e.label,e.name,Math.max(g,1)),_e(e.label,e.label.fontSize(),e.anchor.y)}e.label.x(e.anchor.x),s&&(_e(e.sub,Ht(Dt,i.stageWidth)/t,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*es),e.sub.offsetX(e.sub.width()/2),e.sub.x(e.anchor.x));let c=Math.max(e.label.width(),s?e.sub.width():0)+r*2,d=e.label.height()+(s?l+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(s?(l+e.sub.height())/2:0)),s&&e.sub.y(e.anchor.y+(e.label.height()+l)/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(ns*o/t),e.back.strokeWidth(1/t);let h=e.back.getAbsolutePosition(),p=6,m=c*t;if(m>i.stageWidth-p*2){e.label.opacity(0),e.back.opacity(0),e.sub&&e.sub.opacity(0);return}let y=m/2,f=(G(h.x,p+y,i.stageWidth-p-y)-h.x)/t;Math.abs(f)>.001&&Ni(e,f,0);let b=62+d*t/2;h.y<b&&Ni(e,0,(b-h.y)/t)}function Ni(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 rr(i,e){let t=e,o=t._cache.get("canvas");if(!o)return;let s=[o.scene,o.filter,o.hit].map(n=>n?._canvas).filter(n=>!!n);s.length&&i.Util.releaseCanvas(...s),t._cache.delete("canvas")}function ar(i,e){let t=0,o=0,s=n=>{t||(t=n),o+=1;let r=n-t;r>=1e3&&(i(Math.round(o*1e3/r)),o=0,t=n),e(requestAnimationFrame(s))};e(requestAnimationFrame(s))}import{Group as Nl}from"konva/lib/Group";import{Line as lr}from"konva/lib/shapes/Line";import{Rect as Wl}from"konva/lib/shapes/Rect";import{Text as cr}from"konva/lib/shapes/Text";function Vl(i,e){return i>=ae||e&&i>=_t}function zl(i){return i.effectiveScale<_t?!1:i.focusActive||i.stageWidth<oe}function Kl(i,e,t){return t&&e>=_t?Math.max(i,Yo/Math.max(e,1e-4)):i}function Xl(i,e){return Math.max(1,i*2-(e?1:3))}function dr(i){let e=i.exportMode?Math.max(i.effScale(),ae):i.effScale(),t=zl({effectiveScale:e,focusActive:i.focusedSectionId!=null,stageWidth:i.stage.width()}),o=Vl(e,t),s=a=>{let l=a.getClientRect({skipShadow:!0,skipStroke:!0});return l.x>=0&&l.y>=0&&l.x+l.width<=i.stage.width()&&l.y+l.height<=i.stage.height()};for(let[a,l]of i.boothLabelById){let c=i.circleById.get(a);l.visible(me(l.fontSize(),e)&&!!c?.isVisible()&&i.focusedSeatOpacity(a,c?.getAbsoluteOpacity()??1)>=.5&&s(l))}i.labelGroup.destroyChildren(),i.labelLiftGroups.clear(),i.seatLabelById.clear();let n=0;if(o)for(let a of i.visibleSeatCandidates()){if(a.kind==="booth")continue;let l=i.worldToScreen(a);if(l.x<-20||l.x>i.stage.width()+20||l.y<-20||l.y>i.stage.height()+20||i.accessGlyphById.has(a.id)&&i.accessGlyphShouldShow(a.id))continue;let c=i.circleById.get(a.id);if(!c?.isVisible()||i.focusedSeatOpacity(a.id,c.getAbsoluteOpacity())<.5)continue;let d=i.statusById.get(a.id)??"free",h=i.renderedSeatPoint(a),p=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 Nl({x:h.x,y:h.y,listening:!1});if(b.scale({x:p,y:p}),d==="held"?(b.add(new Wl({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),b.add(new lr({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(En),b.add(new lr({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1}))),Zt(b),i.seatLabelContainer(a.id).add(b),++n>=yi)break;continue}let y=Kl(fe*i.seatLabelScale(a),e,t),u=new cr({x:h.x,y:h.y,text:Pt(a.displayLabel??a.label),fontSize:y,fontStyle:"600",fontFamily:i.labelFont(),fill:c?i.seatLabelInk(a,c):i.seatPreferredLabelInk(a),listening:!1,perfectDrawEnabled:!1}),f=Xl(i.seatR,t);if(u.width()>f&&u.fontSize(Math.max(je,y*f/u.width())),u.width()>f+.01){u.destroy();continue}if(!me(u.fontSize(),e)){u.destroy();continue}if(u.offsetX(u.width()/2),u.offsetY(u.height()/2),u.scale({x:p,y:p}),i.seatLabelContainer(a.id).add(u),!s(u)){u.destroy();continue}if(i.seatLabelById.set(a.id,u),++n>=yi)break}let r=new Ke;for(let{node:a}of i.freeTextById.values()){if(!a.isVisible())continue;let l=a.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});r.insert({x:l.x-Q,y:l.y-Q,width:l.width+Q*2,height:l.height+Q*2})}for(let a of i.rowLabelPlan){let l=i.focusedSectionId!=null&&a.focusKeys?.includes(i.focusedSectionId),c=l?Math.max(a.fontSize,Xo/Math.max(e,1e-4)):a.fontSize;if(!l&&!me(c,e))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 h=new cr({x:a.x,y:a.y,text:a.text,fontSize:c,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});h.offsetX(h.width()/2),h.offsetY(h.height()/2);let p=i.resolveAutomaticRowLabelPosition(h,a,r);h.position(p),h.setAttr("rowLabel",!0),i.labelGroup.add(h);let m=h.getClientRect({skipShadow:!0,skipStroke:!0}),y=6,u=m.x<y?y-m.x:m.x+m.width>i.stage.width()-y?i.stage.width()-y-m.x-m.width:0,f=m.y<y?y-m.y:m.y+m.height>i.stage.height()-y?i.stage.height()-y-m.y-m.height:0,b=p;if(u||f){let S=i.labelGroup.getAbsoluteTransform(),v=S.point(p);b=S.copy().invert().point({x:v.x+u,y:v.y+f}),h.position(b)}let g=i.rowLabelBox(h,b);if(a.automaticAway&&r.collisionCount(g)>0){h.destroy();continue}r.insert(g)}i.isoT>0&&i.viewMode!=="perspective"&&i.applyUprightLabels(),i.overlayLayer.batchDraw()}function hr(i){let e=i.now??(()=>typeof performance<"u"?performance.now():Date.now()),t=i.budgetMs??8,o=i.reducedMotion===!0,s=i.chunks.length>1?Math.min(30,Math.max(0,840/(i.chunks.length-1))):0,n=0,r=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},h=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},p=f=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,f()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,f()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,f()},16)}},m=()=>{a||r||(a=!0,h(),i.done())},y=f=>{for(let b=c.length-1;b>=0;b--){let g=c[b],S=o?1:Math.min(1,(f-g.startedAt)/160);i.fade(g.work,S),S>=1&&c.splice(b,1)}return c.length>0},u=()=>{if(r)return;let f=e(),b=f;for(;n<i.chunks.length&&(n===0||e()-b<t);){let S=i.chunks[n++];if(i.build(S.work),i.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:f+(n-1)*s}),e()-b>=t)break}let g=y(f);i.draw(),n<i.chunks.length||g?p(u):m()};return p(u),{cancel(){if(!a){r=!0,h();for(let f of c)i.fade(f.work,1);c.length=0}},finishNow(){if(!(r||a)){for(;n<i.chunks.length;){let f=i.chunks[n++];i.build(f.work)}for(let f of i.chunks)i.fade(f.work,1);c.length=0,i.draw(),m()}},get done(){return a}}}function ht(i){return{th:Bt*Math.PI/180*i.isoT,sg:1-(1-et)*i.isoT}}function ur(i,e){let{th:t,sg:o}=ht(e),s=e.centre,n=i.x-s.x,r=i.y-s.y,a=n*Math.cos(t)-r*Math.sin(t),l=(n*Math.sin(t)+r*Math.cos(t))*o;return{x:s.x+a,y:s.y+l}}function pr(i,e){let{th:t,sg:o}=ht(e),s=e.centre,n=i.x-s.x,a=(i.y-s.y)/o,l=n*Math.cos(t)+a*Math.sin(t),c=-n*Math.sin(t)+a*Math.cos(t);return{x:s.x+l,y:s.y+c}}function fr(i,e){let{th:t,sg:o}=ht(e),s=i*e.isoT;return{x:-(s/o)*Math.sin(t),y:-(s/o)*Math.cos(t)}}function mr(i,e,t){let o=Io(e);i.offset(t),i.position(ne(e,t)),i.rotation(o.rotationDeg),i.scale({x:o.scaleX,y:o.scaleY}),i.skewX(o.skewX),i.skewY(0)}function yr(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 gr(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 br(i,e,t){return i.perspectiveAffine?ne(i.perspectiveAffine,e):ne(t,e)}function Sr(i,e){return e?ne(e,i):i}function vr(i,e){let t=0;for(let h of i.seats){let p=Math.max(0,(h.eyeHeightM??ee)-ee);t=Math.max(t,p*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=To(i.bounds,t),s=Et(o,o.target),n=Co(s);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let r=1/0,a=1/0,l=-1/0,c=-1/0;for(let h of i.seats){let p=Math.max(0,(h.eyeHeightM??ee)-ee),m=ye(o,h,p*Oe),y={x:m.x,y:m.y};e.seatProjected.set(h.id,y),e.seatLocal.set(h.id,ne(n,y)),e.seatDepth.set(h.id,m.depth),e.seatScale.set(h.id,m.scale),r=Math.min(r,m.x),a=Math.min(a,m.y),l=Math.max(l,m.x),c=Math.max(c,m.y)}for(let h of[{x: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 p=ye(o,h,0);r=Math.min(r,p.x),a=Math.min(a,p.y),l=Math.max(l,p.x),c=Math.max(c,p.y)}let d=Math.max(24,i.seatR*3);return{camera:o,baseAffine:s,baseInverse:n,bounds:Number.isFinite(r)?{x:r-d,y:a-d,width:Math.max(1,l-r+d*2),height:Math.max(1,c-a+d*2)}:null}}function wr(i,e,t){let o=t?[...t].map(s=>i.seatById.get(s)).filter(s=>!!s):e?i.seats:[...i.perspectiveAppliedSeats].map(s=>i.seatById.get(s)).filter(s=>!!s);for(let s of o){if(e&&i.perspectiveAppliedSeats.has(s.id))continue;let n=e?i.perspectiveSeatProjected.get(s.id)??s:s,r=e?i.perspectiveSeatScale.get(s.id)??1:1,a=i.circleById.get(s.id);a?.position(n),a?.scale({x:r,y:r});let l=i.accessRingById.get(s.id);l?.position(n),l?.scale({x:r,y:r});let c=i.accessGlyphById.get(s.id);if(c){let h=i.seatR*1.5/ve;c.position(n),c.scale({x:h*r,y:h*r})}let d=i.boothLabelById.get(s.id);d?.position(n),d?.scale({x:r,y:r}),e&&i.perspectiveAppliedSeats.add(s.id)}e||i.perspectiveAppliedSeats.clear()}function Ki(i){return i?.getAttr?.("seatId")??void 0}var Tr=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.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=Ri;this.effSelection=rt;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 qt;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=vn();this.fitScale=1;this.fitPose="";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=Jt.pixelRatio;if(this.exportMode&&(this.dpr=1),Jt.pixelRatio=this.dpr,this.stage=new Yl({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Qt(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",Y("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Vi({listening:!this.exportMode}),this.seatLayer=new Vi({listening:!this.exportMode}),this.overlayLayer=new Vi({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 kr({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 kr({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&&(Jt.pixelRatio=o),!this.exportMode){this.wireInteraction();let s=this.opts.onFps;s&&ar(s,n=>{this.rafId=n})}!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 s=this.seatById.get(o);s&&t.push(this.renderedSeatPoint(s))}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 n of e.floors)for(let r of n.objects)this.objectFloor.set(r.id,n.id),r.type==="section"&&r.logicalSectionId&&this.objectFloor.set(r.logicalSectionId,n.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 n of this.selectionMarkers.values())n.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(n=>n.type==="section");for(let n of e.zones??[])n.color&&this.zoneColor.set(n.id,n.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=G(this.theme.seatScale??1,.7,1.6)*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(n=>n.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((n,r)=>{this.cbHueByKey.set(n,Wt[r%Wt.length])});for(let n of e.categories)this.catColor.set(n.key,n.color),this.catByKey.set(n.key,n),typeof n.price=="number"&&this.catPrice.set(n.key,n.price);for(let n of o.objects)n.type==="booth"&&this.boothDims.set(n.id,{width:n.width,height:n.height,rotation:n.rotation,...n.points&&n.points.length>=3?{points:n.points.map(r=>({x:r.x,y:r.y}))}:{}});this.seats=$e(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()});for(let n of this.seats)this.seatById.set(n.id,n),this.statusById.set(n.id,"free");this.seatIndex=Lo(this.seats,{seatRadius:this.seatR}),this.bounds=ho(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 s=this.seatRevealWanted();this.seatRevealPending=s,s||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=!s,this.zoomToFit(),s&&this.startSeatReveal()}seatRevealWanted(){return this.loadingReveal==="progressive"&&!this.exportMode&&this.sections.length>1&&this.seats.length>=this.progressiveSeatFloor}startSeatReveal(){this.cancelSeatReveal();let e=this.viewportCentreInChartSpace(),t=new Map,o=[];for(let n of this.seats){let r=this.seatSection.get(n.id);if(!r){o.push(n);continue}let a=t.get(r.id);a?a.push(n):t.set(r.id,[n])}let s=[...t.entries()].map(([n,r])=>{let a=this.sections.find(l=>l.id===n);return{id:n,work:{seats:r,group:a.liftGroupSeat},distance:Math.hypot(a.centroid.x-e.x,a.centroid.y-e.y)}}).sort((n,r)=>n.distance-r.distance);o.length&&this.unsectionedSeatGroup&&s.push({id:"",work:{seats:o,group:this.unsectionedSeatGroup},distance:1/0}),this.seatReveal=hr({chunks:s.map(n=>({id:n.id,work:n.work})),build:n=>this.renderSeats(n.seats),fade:(n,r)=>n.group.opacity(r),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.updateLOD(),this.fitPose&&xi(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||!e.floors.length)return{...e,referenceImage:void 0,backgroundImage:De(e)};if(this.floorOverview&&e.floors.length>=2)return{...lo(e)?co(e):ao(e),referenceImage:void 0,backgroundImage:De(e)};if(this.stacked&&e.floors.length>=2)return{...ro(e),referenceImage:void 0,backgroundImage:De(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:De(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(s=>s.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}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,s=this.hasSections?new Set:null;for(let n of e){if(!this.statusById.has(n))continue;let r=this.statusById.get(n);this.statusById.set(n,t);let a=this.circleById.get(n);if(a&&(this.paintSeat(a,n),o=!0),s){let l=this.seatSection.get(n);l&&(r==="free"!=(t==="free")&&(l.free+=t==="free"?1:-1),s.add(l))}}if(s&&s.size){for(let n of s)this.refreshSectionFill(n);this.bgLayer.batchDraw()}o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ae&&this.updateLabels())}setSeatCategories(e){let t=!1,o=new Set;for(let[n,r]of Object.entries(e)){let a=this.seatById.get(n);if(!a||!this.catColor.has(r)||a.categoryKey===r)continue;a.categoryKey=r;let l=this.circleById.get(n);l&&(this.paintSeat(l,n),t=!0);let c=this.seatSection.get(n);c&&o.add(c)}if(!t)return;let s=new Map((this.chartDoc?vt(this.chartDoc):[]).flatMap(n=>n.objects).filter(n=>n.type==="section").map(n=>[n.id,n]));for(let n of o){if(!s.get(n.id)?.color){let a=new Map;for(let l of n.memberIds){let c=this.seatById.get(l)?.categoryKey;c&&a.set(c,(a.get(c)??0)+1)}n.baseFill=ui([...a].map(([l,c])=>({hex:this.catColor.get(l)??"#6e7bff",w:c})),"#3a4358")}n.shellCategoryColor=this.dominantSellableColor(n.memberIds),this.refreshSectionFill(n)}o.size&&this.bgLayer.batchDraw(),this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ae&&this.updateLabels()}setOwnedHold(e){let t=new Set((e??[]).filter(s=>this.statusById.has(s))),o=new Set([...this.ownedHold,...t]);this.ownedHold=t;for(let s of o){let n=this.circleById.get(s);n&&this.paintSeat(n,s),this.syncSelectionMarker(s)}o.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>ae&&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 s of this.seats){let n=this.circleById.get(s.id);n&&this.paintSeat(n,s.id)}o&&this.syncSelectionMarker(o),t&&this.syncSelectionMarker(t);for(let[s,n]of this.selectionMarkers)n.opacity(!t||s===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 s=this.circleById.get(o);s&&this.paintSeat(s,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 s=this.seatById.get(o);s&&t.push(s)}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 s of this.seats)t.has(s.label)&&this.isSelectable(s.id)&&o.push(s.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 s of this.sections)if(!(s.id!==e&&s.logicalId!==e&&s.zone!==e))for(let n of s.memberIds){if(o.has(n)||(o.add(n),!this.isSelectable(n)))continue;let r=this.seatById.get(n);r&&t.push(r)}return t}selectMany(e){let t=e.filter(s=>!this.selection.has(s));if(!t.length)return this.getSelection();let o=this.selection.size+t.length<=Uo;for(let s of t)if(o)this.setSelected(s,!0,!0);else{this.selection.add(s);let n=this.circleById.get(s);n&&this.paintSeat(n,s)}return this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}beginMarquee(e){let t=this.screenToWorld(e),o=this.stage.scaleX()||1,s=new Lr({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(s),this.marquee={start:t,rect:s},this.marqueeCur=t,this.overlayLayer.batchDraw()}updateMarquee(e){if(!this.marquee)return;let t=this.screenToWorld(e),{start:o,rect:s}=this.marquee;s.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),s=Math.max(e.start.x,t.x),n=Math.min(e.start.y,t.y),r=Math.max(e.start.y,t.y),a=this.stage.scaleX()||1;if((s-o)*a<4&&(r-n)*a<4){this.selection.size&&(this.clearSelection(),this.opts.onMarquee?.([]));return}let l=[];for(let c of this.seats){let d=this.renderedSeatPoint(c);d.x<o||d.x>s||d.y<n||d.y>r||this.isSelectable(c.id)&&l.push(c.id)}this.selectMany(l),this.opts.onMarquee?.(this.getSelection())}flashSeat(e,t="#f43f5e"){let o=this.seatById.get(e);o&&pn(this.flashHost,e,this.renderedSeatPoint(o),t)}flashSection(e,t="#22a06b"){fn(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 s=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(o.id)??o:o,n=null,r=1/0;for(let a of this.seats){if(a.id===e)continue;let l=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(a.id)??a:a,c=l.x-s.x,d=l.y-s.y,h=c*t.x+d*t.y;if(h<=.5)continue;let p=Math.abs(c*t.y-d*t.x),m=h+p*2.5;m<r&&(r=m,n=a.id)}return n}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(),s=Math.max(this.stage.scaleX(),Pe*1.2),n=this.worldToScreen(e),r=70,a=n.x<r||n.x>t-r||n.y<r||n.y>o-r;if(this.stage.scaleX()<s||a){let l=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?ne(this.perspectiveBaseAffine,l):this.isoT===0?l:this.isoForward(l);this.stage.scale({x:s,y:s}),this.stage.position({x:t/2-c.x*s,y:o/2-c.y*s}),this.afterViewChange(),this.stage.batchDraw()}}zoomToFit(){let e=this.stage.width(),t=this.stage.height(),o=this.viewMode==="perspective"&&this.perspectiveBounds?this.perspectiveBounds:this.bounds;if(this.fitScale=Math.min(e/o.width,t/o.height)||1,this.opts.portraitFitCrop&&!this.exportMode){let n=e/o.width<=t/o.height,r=o.height*this.fitScale;n&&r<.55*t&&(this.fitScale=Math.min(this.fitScale*1.3,.62*t/o.height))}let s=this.fitScale;if(this.stage.scale({x:s,y:s}),this.stage.position({x:(e-o.width*s)/2-o.x*s,y:(t-o.height*s)/2-o.y*s}),this.settleView(),!this.exportMode){let n=Ks(this.stage,[this.bgLayer,this.seatLayer]);n>0&&n!==1&&(this.fitScale*=n),n>0&&this.afterViewChange(),this.fitPose=xi(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()}zoomIn(){this.zoomAbout(this.stage.scaleX()*pt.ZOOM_STEP,_i(this.stage))}zoomOut(){this.zoomAbout(this.stage.scaleX()/pt.ZOOM_STEP,_i(this.stage))}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,s=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let a=s?this.perspectiveSeatProjected.get(s.id)??ne(this.perspectiveBaseAffine,e):ne(this.perspectiveBaseAffine,e);return{x:a.x*t+this.stage.x(),y:a.y*t+this.stage.y()}}let n=s?this.renderedSeatPoint(s):e,r=this.isoT===0?n:this.isoForward(n);return{x:r.x*t+this.stage.x(),y:r.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 s=this.circleById.get(o.id);s&&this.paintSeat(s,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,s)=>o===e[s])}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(!Nn(t,this.categoryFilter)){this.categoryFilter=t;for(let o of this.seats){let s=this.circleById.get(o.id);s&&this.paintSeat(s,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(){Gn({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=>Dn(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<re,effScale:()=>this.effScale(),labelLegible:e=>me(e,this.effScale())})}setGAStates(e){Hn(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),s=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(!s.length)return;let n=Wn(s.map(d=>d.id),this.seatSection);n&&this.focusSection(n);let r=Math.max(24,this.seatR*3),a=s.map(d=>this.renderedSeatPoint(d)),l=kn(a,r),c=this.narrowSeatDetailFocus(a,l);this.focusRegion(c?.bounds??l,{animate:t?.animate,durationMs:this.cameraGlideMs,minScale:c?.minScale})}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let a=this.viewMode==="isometric"&&this.isoT>0;this.viewMode=e,this.isoTarget=1,this.isoT=1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.applyPerspective(a),this.zoomToFit();return}let 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 s=this.isoT;if(s===t){this.applyIso(),this.afterViewChange();return}let n=performance.now(),r=a=>{if(this.destroyed)return;let l=Math.min(1,(a-n)/$o),c=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2;this.isoT=s+(this.isoTarget-s)*c,this.applyIso(),this.scheduleViewChange(),l<1?this.isoRaf=requestAnimationFrame(r):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(r)}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 ur(e,this.isoState)}isoInverse(e){return pr(e,this.isoState)}buildPerspectiveProjection(e){let t=vr({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){mr(e,t,o)}resetContainerTransform(e){yr(e)}sectionSurfaceHeight(e,t){return gr(e,t)}projectedSectionPoint(e,t){return br(e,t,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return Sr(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return fr(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){wr(this.seatAnchorContext,e,t)}applyPerspective(e=!0){let t=this.perspectiveCamera,o=this.perspectiveBaseAffine,s=this.perspectiveBaseInverse;if(!t||!o||!s)return;let n=this.seats.length>2500&&this.sections.length>0;this.cached&&!n&&(this.seatLayer.clearCache(),this.seatLayer.listening(!0),this.cached=!1),this.resetLayerTransforms(e),this.resetSectionProjection(e);for(let a of[this.bgLayer,this.overlayLayer])this.setContainerAffine(a,o,t.target);this.perspectiveAppliedSeats.clear(),n||this.applyExactSeatAnchors(!0);for(let a of this.sections){let l=h=>this.sectionSurfaceHeight(a,h),c=Et(t,a.centroid,l),d=Po(s,c);a.perspectiveAffine=c,a.perspectiveCorrection=d,a.perspectiveDepth=ye(t,a.centroid,l(a.centroid)).depth,this.setContainerAffine(a.liftGroupBg,d,a.centroid);for(let h=0;h<a.sideFaces.length;h++){let p=a.outline[h],m=a.outline[(h+1)%a.outline.length],y=this.perspectiveLocalPoint(ye(t,p,0)),u=this.perspectiveLocalPoint(ye(t,m,0)),f=this.perspectiveLocalPoint(ye(t,m,l(m))),b=this.perspectiveLocalPoint(ye(t,p,l(p)));a.sideFaces[h].points([y.x,y.y,u.x,u.y,f.x,f.y,b.x,b.y]),a.sideFaces[h].opacity(.9)}}let r=[...this.sections].sort((a,l)=>(l.perspectiveDepth??0)-(a.perspectiveDepth??0));for(let a of r)a.rootGroupBg.moveToTop(),a.liftGroupSeat.moveToTop();this.unsectionedSeatGroup?.moveToTop(),this.syncSeatOverlayPositions(),n||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(),s=Math.cos(t),n=o*Math.sin(t),r=-Math.sin(t),a=o*Math.cos(t),l=Math.sqrt(s*s+n*n),c=s*a-n*r,d=Math.atan2(n,s)*180/Math.PI,h=l,p=c/l,m=(s*r+n*a)/c,y=this.isoCentre;for(let u of[this.bgLayer,this.seatLayer,this.overlayLayer])u.position({x:y.x,y:y.y}),u.offset({x:y.x,y:y.y}),u.rotation(d),u.scaleX(h),u.scaleY(p),u.skewX(m),u.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 s of o){let n=s.find("Text");for(let r of n){let a=r.getAttr("uprightBase");a==null&&(a=r.rotation(),r.setAttr("uprightBase",a)),r.rotation(a-e),r.scaleX(1),r.scaleY(t),r.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 s=.9*e;for(let n=0;n<t.sideFaces.length;n++){let r=t.sideFaces[n],a=t.outline[n],l=t.outline[(n+1)%t.outline.length];r.points([a.x,a.y,l.x,l.y,l.x+o.x,l.y+o.y,a.x+o.x,a.y+o.y]),r.opacity(s)}}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:xe)}sectionScreenBounds(e){return $s({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()>=re,t=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,o=96,s=this.stage.width(),n=this.stage.height();for(let r of this.sections){let a=!0;if(e){let c=this.sectionScreenBounds(r);a=c.x+c.width>=-o&&c.y+c.height>=-o&&c.x<=s+o&&c.y<=n+o,a&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,r.memberIds)}r.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(r.id)?.setViewportCulled(!a)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,this.seats.filter(r=>!this.seatSection.has(r.id)).map(r=>r.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 s=this.seatById.get(o);s&&e.push(s)}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 s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(o.id)??1:1;t.scale({x:s,y:s})}}}renderSeats(e=this.seats){dn({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/ve,s=new $l({x:e.x,y:e.y,data:Ct(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:pi(t),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Zt(s),s}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[t,o]of this.accessGlyphById){let s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1,n=this.seatR*1.5/ve*s,a=this.accessGlyphFilterEmphasized(t)?Wo:No,l=Math.max(n,a/(ve*Math.max(e,.001)));o.scale({x:l,y:l}),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"))&&Ee(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??nt}seatLabelInk(e,t){let o=t.fill();return X(typeof o=="string"?o:"",this.seatPreferredLabelInk(e))}paintSeat(e,t){let o=this.seatById.get(t),s=this.statusById.get(t)??"free",n=this.selection.has(t),r=this.categoryDisplayColor(o.categoryKey),a=this.boothLabelById.get(t);e.dash(Tr),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let l=s==="held"&&this.ownedHold.has(t),c=l?null:An(s,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})):l?(e.fill(Se(r,this.effSelection===rt?.24:.1)),e.stroke(this.effSelection),e.strokeWidth(3)):e.fill(n&&this.effSelection===rt?Se(r,.28):r),this.seatMarks.paint(e,t,s,r,this.seatR,this.colorblind,this.seatInClosedSection(t)),Bi(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&s==="free"&&(e.stroke(gt(o.accessibility)),e.strokeWidth(n?3:2),e.dash([3,2])),a&&(a.text(s==="booked"?"SOLD":s==="held"?"HELD":o.label),a.fontSize(s==="free"?10:Math.min(10,Math.max(6,this.boothDims.get(o.rowId)?.width??40)/6)),a.fontStyle(s==="free"?"600":"800"),a.fill(s==="free"?this.theme.seatLabelColor??nt:"#ffffff"),a.offsetX(a.width()/2),a.offsetY(a.height()/2)),this.accessFilter&&s==="free"&&!n){let p=Mi(o,this.accessFilter);p==="other"?e.opacity(Js):p==="companion"&&e.opacity(en)}if(this.categoryHighlight&&s==="free"&&!n&&o.categoryKey!==this.categoryHighlight&&e.opacity(.25),this.categoryFilter&&s==="free"&&!n&&!this.categoryFilter.has(o.categoryKey)&&e.opacity(.22),this.commercialLimitedFilter&&s==="free"&&!n&&(o.commercial?.restrictedView||o.commercial?.obstructedView)&&e.opacity(.22),this.dimmedSections.size){let p=this.seatSection.get(t);(p?this.dimmedSections.has(p.id)||this.dimmedSections.has(p.logicalId)||p.zone!=null&&this.dimmedSections.has(p.zone):this.dimmedSections.has(uo))&&e.opacity(.18)}this.closedSections.size&&this.seatInClosedSection(t)&&(e.fill(ys),e.stroke(""),e.strokeWidth(0),e.dash(Tr),e.opacity(gs),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 p=e.fill();h.fill(pi(typeof p=="string"?p:"")),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 s=this.circleById.get(o.id);s&&this.paintSeat(s,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 s=this.sectionBounds(e);if(!s)return;let n=this.sectionMembers(e).map(c=>this.seatById.get(c)).filter(c=>c!=null),r=n.filter(c=>(this.statusById.get(c.id)??"free")==="free"||this.ownedHold.has(c.id)),a=(r.length?r:n).map(c=>this.renderedSeatPoint(c)),l=this.narrowSeatDetailFocus(a,s,o);this.focusRegion(l?.bounds??s,{animate:t,minScale:l?.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()>=Vo}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let t=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=mn(this.focusBackdropHost,t),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=yn(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,s=-1/0,n=(r,a)=>{r<e&&(e=r),a<t&&(t=a),r>o&&(o=r),a>s&&(s=a)};for(let r of this.seats)n(r.x,r.y);for(let r of this.sections)for(let a of r.outline)n(a.x,a.y);for(let r of this.gaById.values())for(let a of r.points)n(a.x,a.y);return Number.isFinite(e)?{x:e,y:t,width:Math.max(1,o-e),height:Math.max(1,s-t)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(t=>{let o=this.isSectionClosed(t)||t.free<=0,s=t.memberIds.some(a=>this.selection.has(a)),n=s||t.memberIds.some(a=>this.ownedHold.has(a)),r=this.focusedSectionId===t.id||this.focusedSectionId===t.logicalId;return{id:t.logicalId,label:t.label,outline:t.outline.map(a=>({...a})),...this.objectFloor.get(t.id)?{floorId:this.objectFloor.get(t.id)}:{},state:s?"selected":o?"inactive":"available",active:r,paint:{fill:t.shellFill,stroke:t.shellStroke},owned:n}});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=De(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,s){let n=this.assetGeneration;/^https?:\/\//i.test(t)&&(e.crossOrigin="anonymous");let r=new Promise(a=>{let l=!1,c=()=>{l||(l=!0,this.assetCancels.delete(d),a())},d=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}c()};this.assetCancels.add(d),e.onload=()=>{if(!this.exportMode){n===this.assetGeneration&&s(),c();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{n===this.assetGeneration&&s()}).catch(()=>{n===this.assetGeneration&&this.assetErrors.push(`${o} could not be decoded.`)}).finally(c)},e.onerror=()=>{n===this.assetGeneration&&this.assetErrors.push(`${o} could not be loaded.`),c()},e.src=t});this.assetPromises.push(r)}cancelAssetLoads(){this.assetGeneration++;for(let e of[...this.assetCancels])e();this.assetCancels.clear(),this.assetPromises=[],this.assetErrors=[]}renderBackgroundImage(e){Un(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,s)=>this.trackAssetImage(e,t,o,s),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){$n(this.objectDrawContext,e)}renderTable(e){qn(this.objectDrawContext,e)}renderText(e){Zn(this.objectDrawContext,e)}renderShape(e){Qn(this.objectDrawContext,e)}renderGA(e){Jn(this.objectDrawContext,e)}renderSection(e){let t=St(e.outline,e.holes),o=le(this.canvasBackground),s=[],n=new Map,r=0,a=N(e.outline),l=this.seatIndex?Rt(this.seatIndex,a).map(P=>this.seatById.get(P)).filter(P=>!!P):this.seats;for(let P of l)this.seatSection.has(P.id)||ie(P,e.outline,e.holes)&&(s.push(P.id),n.set(P.categoryKey,(n.get(P.categoryKey)??0)+1),(this.statusById.get(P.id)??"free")==="free"&&r++);let c=e.color??ui([...n].map(([P,A])=>({hex:this.catColor.get(P)??"#6e7bff",w:A})),"#3a4358"),d=so(e.elevation),h=bt(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),p=h.height*Oe,m=new ut({listening:!1});this.bgLayer.add(m);let y=new ut({listening:!1});m.add(y);let u=new lt({listening:!0});this.seatLayer.add(u);let f=[];if(p>0){let P=ue(this.zoneColor.get(e.zone??"")??c,.42);for(let A=0;A<e.outline.length;A++){let _=new Ul({points:[],closed:!0,fill:P,stroke:B("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});f.push(_),m.add(_)}}y.moveToTop();let b=y,g=e.color??this.zoneColor.get(e.zone??"")??"#3a4358",S=Ae(e.outline,e.holes,{stroke:B(g,.5),strokeWidth:1,fill:B(g,.08),listening:!1},e.outlinePath);b.add(S);let v=Ae(e.outline,e.holes,{fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Ft,opacity:0,listening:!1},e.outlinePath);b.add(v);let w=e.labelPresentation?.labelStyle,k=w?.color??o.sectionInk,T=(w?.size??18)/18,C=new Lr({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});b.add(C);let L=new zi({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:X(o.sectionFill,k),listening:!1,perfectDrawEnabled:!1});L.offsetX(L.width()/2),L.offsetY(L.height()/2),b.add(L);let I=new zi({x:t.x,y:t.y,text:Y("map.seatsLeft",{count:r}),fontSize:12,fontStyle:Gt,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});I.offsetX(I.width()/2),b.add(I);let x={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:Us(e.outline,e.holes??[],t),memberCategoryKeys:new Set(s.map(P=>this.seatById.get(P)?.categoryKey).filter(Boolean)),shellCategoryColor:this.dominantSellableColor(s),shellFill:o.sectionFill,shellStroke:o.sectionStroke,labelArea:io(e.outline,e.holes),zone:e.zone,memberIds:s,total:s.length,free:r,baseFill:c,outlineTint:g,outlinePoly:S,blockPoly:v,namePlate:C,nameLabel:L,subLabel:I,preferredInk:k,labelScale:T,nameLabelFits:!1,subLabelFits:!0,elevation:d,liftWorld:p,rakeDeg:h.rake,surfaceFocal:s.length?{...this.seatById.get(s[0])?.focalPoint??this.isoCentre}:{...this.chartDoc?.focalPoint??this.isoCentre},frontDistanceWorld:0,rootGroupBg:m,bgZIndex:m.zIndex(),seatZIndex:u.zIndex(),liftGroupBg:y,liftGroupSeat:u,sideFaces:f},M=s.map(P=>this.seatById.get(P)).filter(P=>!!P),R=M.length?M:e.outline;x.frontDistanceWorld=Math.min(...R.map(P=>Math.hypot(P.x-x.surfaceFocal.x,P.y-x.surfaceFocal.y)));for(let P of s)this.seatSection.set(P,x);this.refreshSectionFill(x),this.refreshSectionHeat(x),this.sections.push(x)}refreshSectionHeat(e){ir(this.sectionLodPaintContext,e)}refreshSectionFill(e){sr(this.sectionLodPaintContext,e)}isSectionClosed(e){return Wi(this.sectionLodPaintContext,e)}dominantSellableColor(e){let t=new Map;for(let n of e){let r=this.seatById.get(n)?.categoryKey;!r||this.catByKey.get(r)?.notForSale||t.set(r,(t.get(r)??0)+1)}let o=null,s=0;for(let[n,r]of t)(r>s||r===s&&o!=null&&n<o)&&(o=n,s=r);return o?this.categoryDisplayColor(o):null}sectionAccessibleFree(e){let t=this.accessFilter;if(!t)return 0;let o=0;for(let s of e.memberIds){if((this.statusById.get(s)??"free")!=="free")continue;let n=this.seatById.get(s);n&&Ee(n,t)&&(o+=1)}return o}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){js({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?ne(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(s=>{if(this.viewMode==="perspective"&&s.perspectiveAffine)return ie(t,s.outline.map(r=>this.perspectiveLocalPoint(this.projectedSectionPoint(s,r))),s.holes.map(r=>r.map(a=>this.perspectiveLocalPoint(this.projectedSectionPoint(s,a)))));let n=s.liftWorld>0?this.isoLiftLocal(s.liftWorld):{x:0,y:0};return ie({x:t.x-n.x,y:t.y-n.y},s.outline,s.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?Mi(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?hi(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let t=this.container;for(;t;){let o=hi(getComputedStyle(t).backgroundColor);if(o)return o;t=t.parentElement}}return Ri}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:U(this.canvasBackground)?tn:rt}setSelected(e,t,o=!1){let s=this.circleById.get(e);t?this.selection.add(e):(this.selectionFocusId===e&&this.setSelectionFocus(null),this.selection.delete(e)),s&&(this.paintSeat(s,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 Zs({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,s)=>this.resolveAutomaticRowLabelPosition(t,o,s),rowLabelBox:(t,o)=>this.rowLabelBox(t,o)},e)}sectionFrameScale(e){let t=this.sectionBounds(e);return t?gn(this.stage,t,this.zoomBounds()):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()<ae&&this.sections.length){let o=this.seatSection.get(e);if(o){let s=this.focusedSectionId===o.logicalId,n=this.sectionFrameScale(o.logicalId)>this.stage.scaleX()*1.02;if(!s&&n){let r=this.seatById.get(e),a=r?this.renderedSeatPoint(r):void 0;this.opts.onSectionTap?this.opts.onSectionTap(o.logicalId,a):this.focusSection(o.logicalId,{anchor:a});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 un(this.screenPickingHost)}nearestSeatToScreen(e,t,o=!1){return hn(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>we||this.isGhostClick(e))return;let t=Ki(e.target);t&&this.handleSeatTap(t)}),this.seatLayer.on("mouseover",e=>{let t=Ki(e.target);if(!t)return;let o=this.seatById.get(t);if(!o)return;this.hoveredId=t,this.hoverRing.position(this.renderedSeatPoint(o));let s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1;this.hoverRing.scale({x:s,y:s}),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},s=Math.exp(-e.evt.deltaY*.002);this.zoomAbout(this.stage.scaleX()*G(s,.5,2),o)}),this.stage.on("click tap",e=>{if(this.moved>we||this.isGhostClick(e))return;let t=this.stage.getPointerPosition();if(!t)return;if(!this.cached){if(Ki(e.target))return;if(this.seatsRevealed()){let s=this.focusedSectionId,n=this.nearestSeatToScreen(t,Ie),r=n?this.seatSection.get(n):null;if(n&&(!s||r&&this.sectionMatchesFocus(r))){this.handleSeatTap(n);return}let a=n?null:this.nearestSeatToScreen(t,Ie,!0),l=a?this.seatSection.get(a):null;if(a&&(!s||l&&this.sectionMatchesFocus(l))){this.handleSeatTap(a);return}if(s&&this.opts.onBackdropTap&&!this.floorOverview){let d=this.sectionAt(t);if(d&&d!==s){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(s)return;let c=this.sections.length?this.sectionAt(t):null;if(!c||this.effScale()>=ae||this.sectionFrameScale(c)<=this.stage.scaleX()*1.02)return}}if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let s=this.floorOverview?this.sectionAt(t):null,n=(s?this.objectFloor.get(s):null)??this.deckFloorAt();if(n){this.opts.onDeckTap(n);return}}if(this.sections.length){let s=this.screenToWorld(t),n=this.owned.badgeAt(s)??this.sectionAt(t);if(n){let r=this.sectionTapAnchor(n,s);this.opts.onSectionTap?this.opts.onSectionTap(n,r):this.focusSection(n,{anchor:r});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,Ge*.9)),{min:e,max:Math.max(10*this.fitScale,4)}}zoomAbout(e,t){bn(this.stage,e,t,this.zoomBounds())&&(this.afterViewChange(),this.stage.batchDraw())}zoomToBounds(e,t){Sn(this.stage,e,this.zoomBounds(),t),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 s=this.stage.width(),n=this.stage.height(),{min:r,max:a}=this.zoomBounds(),l=1.12,c=Math.min(s/(o.width*l),n/(o.height*l)),d=G(Math.max(c,t?.minScale??r),r,a),h=s/2-(o.x+o.width/2)*d,p=n/2-(o.y+o.height/2)*d,m=this.stage.scaleX(),y=this.stage.x(),u=this.stage.y();if(Math.abs(d-m)<1e-4&&Math.abs(h-y)<.5&&Math.abs(p-u)<.5){this.settleView();return}let f=performance.now(),b=Math.max(180,Math.min(1200,t?.durationMs??this.cameraGlideMs));this.glideInProgress=!0;let g=S=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let v=Math.min(1,(S-f)/b),w=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,k=m+(d-m)*w;this.stage.scale({x:k,y:k}),this.stage.position({x:y+(h-y)*w,y:u+(p-u)*w}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),v<1?this.glideRaf=requestAnimationFrame(g):(this.glideRaf=0,this.glideInProgress=!1,this.settleView())};this.glideRaf=requestAnimationFrame(g)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){let e=this.effScale();return e>=re?"seats":this.zones.length&&e<Ge?"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),Kn(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let t=e==="sections"?(ge+re)/2:this.seatRungScale(),o=this.stage.width(),s=this.stage.height(),n=this.getVisibleWorldRect(),r={x:n.x+n.width/2,y:n.y+n.height/2},a=r.x,l=r.y;if(e==="sections"&&this.sections.length>0){let p=this.sections.map(f=>{let b=N(f.outline);return{x:b.x+b.width/2,y:b.y+b.height/2}}),m=o/(t*2),y=s/(t*2);if(!p.some(f=>Math.abs(f.x-r.x)<=m&&Math.abs(f.y-r.y)<=y)){let f=p.reduce((b,g)=>{let S=(g.x-r.x)**2+(g.y-r.y)**2;return S<b.distance?{point:g,distance:S}:b},{point:p[0],distance:1/0});a=f.point.x,l=f.point.y}}let c=e==="seats"?this.seats.filter(p=>p.kind!=="booth"):[];if(c.length>0){let p=c[0],m=1/0;for(let y of c){let u=y.x-r.x,f=y.y-r.y,b=u*u+f*f;b<m&&(p=y,m=b)}a=p.x,l=p.y}let d=o/(t*1.12),h=s/(t*1.12);this.focusRegion({x:a-d/2,y:l-h/2,width:d,height:h})}seatRungScale(){return wn(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,t,o){return Ln({stageWidth:this.stage.width(),stageHeight:this.stage.height(),fullBounds:t,seatPoints:e,visibleBounds:this.getVisibleWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}seatLabelTargetScale(){let e=Te,t=new zi({fontSize:fe,fontStyle:"600",fontFamily:this.labelFont(),listening:!1}),o=this.seatR*2-3;for(let s of this.seats){if(s.kind==="booth"){e=Math.min(e,Te);continue}let n=fe*this.seatLabelScale(s);t.fontSize(n),t.text(Pt(s.displayLabel??s.label));let r=t.width()>o?Math.max(je,n*o/t.width()):n;e=Math.min(e,r)}return t.destroy(),Z/Math.max(je,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=qs({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,ae):this.effScale(),t=Math.max(e,1e-4);for(let[n,r]of this.primaryFocalLabels)jn(n,r,t,(a,l)=>{this.sizeLabel(a,l,a.y())});this.hasSections?(nr(this.sectionLodPaintContext,e),this.owned.sync(e)):this.primaryFocalLabels.size&&this.bgLayer.batchDraw(),this.paintGAStateForView(),this.updateAccessGlyphs(e),this.seatGlyphDetail=cn(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail);let o=!this.exportMode&&e<re;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(){rr(Jt,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<re?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(r=>r.getClientRect({relativeTo:this.stage})).filter(r=>r.width>0&&r.height>0);if(!e.length)return this.bounds;let t=Math.min(...e.map(r=>r.x)),o=Math.min(...e.map(r=>r.y)),s=Math.max(...e.map(r=>r.x+r.width)),n=Math.max(...e.map(r=>r.y+r.height));return{x:t,y:o,width:Math.max(1,s-t),height:Math.max(1,n-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)),s=()=>{let n=this.exportSceneBounds(),r=Math.max(1,e-o*2),a=Math.max(1,t-o*2),l=Math.min(r/n.width,a/n.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-n.width*l)/2-n.x*l,y:(t-n.height*l)/2-n.y*l}),this.afterViewChange()};s(),s()}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(s){let n=s instanceof Error?s.message:String(s);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${n}`)}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(),ae):this.effScale();for(let{node:t,backdrop:o,kind:s}of this.freeTextById.values()){if(s==="ga-label"||s==="ga-capacity")continue;let r=s==="free-text"&&this.nodeBelongsToFocusedSection(t)||me(t.fontSize(),e);t.visible(r),o?.visible(r)}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(r=>r.id===t||r.logicalId===t||r.zone===t);if(!o.length)return!1;let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),n={x:s.x+s.width/2,y:s.y+s.height/2};return o.some(r=>ie(n,r.outline,r.holes))}buildRowLabelPlan(e){this.rowLabelPlan=er(e,{theme:this.theme,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:t=>this.objectFilteredOut(t)})}rowLabelBox(e,t,o=Q){return Hi(e,t,o)}resolveAutomaticRowLabelPosition(e,t,o){return tr(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(){dr(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 Xi=pt;function Cr(i,e){return new Xi(i,e)}function Pr(i,e,t){let o=new Map,s=new Map,n=new Map,r=new Map,a=[],l=new Map(no(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),s.set(h.label,h),n.set(h.id,h),a.push(h.id);let p=l.get(h.rowId),m=p&&"label"in p&&typeof p.label=="string"?p.label:void 0,y=p?.type==="row"?p.segmentedRow:void 0,u=y?.displayLabel??(p&&"displayLabel"in p&&typeof p.displayLabel=="string"&&p.displayLabel?p.displayLabel:m),f=t.get(h.rowId),b=p?.type==="table"?"table":p?.type==="booth"?"booth":"seat",g=u,S=y?.displayType?.trim()||(p&&"displayType"in p&&typeof p.displayType=="string"&&p.displayType.trim()?p.displayType.trim():void 0),v=h.displayLabel??h.label,w=v.split("-"),k=f||h.kind==="booth"?void 0:u&&v.startsWith(`${u}-`)?v.slice(u.length+1):w[w.length-1]??v;r.set(h.id,{objectId:h.rowId,objectType:b,sectionLabel:d.get(c.objectToSection.get(h.rowId)??""),rowLabel:g,seatNumber:k,...S?{displayType:S,rowType:S}:{}})}return{labelToId:o,labelToSeat:s,seatById:n,seatContext:r,allIds:a}}function Ir(i,e={}){let{baseMs:t=1e3,factor:o=2,maxMs:s=1/0,jitter:n=0,random:r=Math.random}=e,a=Math.min(t*o**Math.max(0,i),s);if(n<=0)return a;let l=Math.min(1,n);return a*(1-l+l*r())}function xr(i,e,t){return qe(i).map(o=>{let s=i.categories.find(n=>n.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(n=>t(n)==="free").length,categoryKey:o.categoryKey,tiers:s?.tiers,price:s?.tiers?.[0]?.price??s?.price??0,currency:e}})}function Mr(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 Rr(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(s=>i.closedMembers.has(s.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}var Yi=["background","rowLabelColor","textColor","selectionColor"];function Er(i,e){return!i||!e?!i&&!e:Yi.every(t=>i[t]===e[t])}function ft(i){let e=i??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function ei(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}var ke=class extends Error{constructor(t){super(t.message);this.status=422;this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function Ar(i,e){return!e||i.eventConfigurationId===e.id&&i.eventConfigurationVersion===e.version?i:{...i,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var ti=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(s=>{if(s.reference.id!==o.id||s.reference.version!==o.version||s.configuration.id!==o.id||s.configuration.version!==o.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return s.configuration})}return this.pending}};function _r(i){if(i!=null&&(!Number.isInteger(i)||i<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return i??null}function Br(i,e,t,o){if(t!=null&&!Array.isArray(t))throw new TypeError("picker: `selectionValidators` must be an array");let s=[],n=0,r=!1,a=!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");n=Math.max(n,Number(c.minimum))}else if(c?.type==="consecutiveSeats")r=!0;else if(c?.type==="noOrphanSeats")a=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(n&&s.push({type:"minimumSelectedPlaces",minimum:n}),r&&s.push({type:"consecutiveSeats"}),a&&s.push({type:"noOrphanSeats"}),i!=null&&n>i)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let l=Math.max(0,Math.floor(e??i??Math.max(o,n)));if(i!=null&&l<i)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&l<n)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:s,maxSelection:i??l}}function ql(i){let e=Number(i.slice(i.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Zl(i){if(i.length<=1)return!1;let e=i[0]?.objectId,t=i[0]?.categoryKey;if(!e||i.some(s=>s.objectId!==e||s.categoryKey!==t))return!0;let o=i.map(s=>ql(s.id)).sort((s,n)=>s-n);return o.some((s,n)=>s<0||n>0&&s!==o[n-1]+1)}function Fr(i,e,t,o,s){let n=o.find(l=>l.type==="minimumSelectedPlaces")?.minimum??0,r=t??n,a=[];return t!=null&&e!==t&&a.push("numberOfPlacesToSelect"),n&&e<n&&a.push("minimumSelectedPlaces"),o.some(l=>l.type==="consecutiveSeats")&&Zl(i)&&a.push("consecutiveSeats"),o.some(l=>l.type==="noOrphanSeats")&&s()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:r,remaining:Math.max(0,r-e),seats:i,violations:a}}function Or(i){let{id:e,doc:t,seatById:o,groupedTableBySeatId:s}=i,n=t.objects.find(f=>f.type==="section"&&f.id===e);if(!n)return null;let r=i.sectionMembers(e),a=new Map,l=new Set,c=0,d=0;for(let f of r){let b=o.get(f);if(!b)continue;i.matchesAccessFilter&&i.statusOf(f)==="free"&&i.matchesAccessFilter(b)&&(d+=1);let g=s.get(f);if(g){if(l.has(g.label))continue;l.add(g.label),a.set(g.categoryKey,(a.get(g.categoryKey)??0)+g.maxOccupancy),i.statusOf(g.chairs[0]?.id??f)==="free"&&(c+=g.maxOccupancy)}else a.set(b.categoryKey,(a.get(b.categoryKey)??0)+1),i.statusOf(f)==="free"&&c++}let h=[...a.entries()].map(([f,b])=>{let g=t.categories.find(k=>k.key===f),S=g?.tiers?.length?g.tiers.map(k=>k.price):[g?.price??0],v=Math.min(...S),w=Math.max(...S);return{key:f,count:b,label:g?.label??f,color:g?.color??"#6e7bff",price:v,priceMin:v,priceMax:w}}).sort((f,b)=>f.price-b.price),p=h.map(f=>f.priceMin),m=h.map(f=>f.priceMax),y=n.zone?t.zones?.find(f=>f.id===n.zone):void 0,u=n.color??y?.color??h[0]?.color??"#6e7bff";return{id:e,...i.matchesAccessFilter?{accessibleLeft:d}:{},label:n.displayLabel??n.label,zoneLabel:y?.label??"",...n.entrance&&n.entrance.trim()?{entrance:n.entrance.trim()}:{},color:u,seatsLeft:c,priceMin:p.length?Math.min(...p):0,priceMax:m.length?Math.max(...m):0,categories:h}}var Ql=10,jl=15e3,Dr=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new ti;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.onVisibilityChange=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.accessFilter=null;this.hintShown=!1;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=_r(e.numberOfPlacesToSelect);let t=Br(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Ql);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=po(this._doc,this.hidden);if(!this.mapTheme)return e;let t={...e.theme??{}};for(let o of Yi){let s=this.mapTheme[o];s&&(t[o]=s)}return{...e,theme:t}}setMapTheme(e){return Er(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(n=>n.id),o=this.getActiveFloorId(),s=e.isFloorOverview?.()??!1;return e.setChart(this.visibleDoc(),o?{floorId:o}:void 0),s&&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),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let t=e.filter(s=>typeof s=="string");if(t.length===this.hidden.size&&t.every(s=>this.hidden.has(s)))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(s=>s.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 s=this.visibleDoc(),n=qe(s).find(r=>r.id===e.objectId);return{...n?.displayLabel?{displayLabel:n.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}if(e.objectType==="table"){let s=this.groupedTablesByLabel.get(e.label);return{...s?.displayLabel&&s.displayLabel!==s.label?{displayLabel:s.displayLabel}:{},...s?.displayType?{displayType:s.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={},s=C=>Math.round((performance.now()-C)*100)/100;this.closed=!1;let n=performance.now(),r=(async()=>this.api.chart(this.key))().then(C=>({ok:!0,res:C,elapsed:s(n)}),C=>({ok:!1,error:C,elapsed:s(n)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(C=>({ok:!0,objects:C,elapsed:s(a)}),()=>({ok:!1,elapsed:s(a)})),c=await r;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=Ar(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let h=performance.now();try{let C=Go(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=$e(d.doc);let p=Pr(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=p.labelToId,this.labelToSeat=p.labelToSeat,this.seatById=p.seatById,this.seatContext=p.seatContext,this.allIds=p.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=s(h);let m=d.event.currency??this.opts.currency;this.currency=m??"USD";let y=performance.now(),u=Cr(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:m,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=s(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=s(y),this.closed)return u.destroy(),null;this.renderer=u;let f=null,b="free",g=[],S=await l;if(S.ok){let C=S.objects;this.hidden=new Set(C.hidden??[]),g=(C.closed??[]).filter(L=>typeof L=="string"),f=C.seats,b=C.default??"free"}if(o.loadStatuses=S.elapsed,this.closed)return u.destroy(),this.renderer=null,null;let v=performance.now();u.setChart(this.visibleDoc()),(d.doc.floors?.length??0)>1&&u.setFloorOverview?.(!0),this.opts.colorblindSafe&&u.setColorblindSafe?.(!0),o.buildScene=s(v),this.closedSections=new Set(g);let w=performance.now();g.length&&u.setClosedSections?.(g),f&&this.applySeatsMap(f,b),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=s(w);let k=performance.now();u.forceDraw(),o.firstPaint=s(k);let T=performance.now();return this.attachVisibilityListener(),this.connect(),o.startRealtime=s(T),o.controllerTotal=s(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,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],t=new Set;for(let o of this.renderer.getSelection()){let s=this.groupedTableBySeatId.get(o.id);s?t.has(s.label)||(t.add(s.label),e.push(this.toTableSeat(s))):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 s=this.groupedTableBySeatId.get(o)??this.groupedTablesByLabel.get(o);if(s)s.chairs.forEach(n=>t.add(n.id)),this.hold_?.labels.includes(s.label)||(this.tableQuantities.set(s.label,s.mode==="whole"?s.capacity:s.minOccupancy),s.mode==="variable"&&this.confirmedVariableTables.delete(s.label));else{let n=this.seatById.has(o)?o:this.labelToId.get(o);n&&t.add(n)}}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(r=>r.label)),o=new Set,s=[];for(let r of e){let a=this.groupedTableBySeatId.get(r)??this.groupedTablesByLabel.get(r);if(a)this.tableTierResolution(a).kind==="invalid"?s.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let l=this.seatById.has(r)?r:this.labelToId.get(r);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?s.push(c.label):o.add(l)}}if(s.length&&this.emitError(new ke(mi(s))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let n=this.getSelection().filter(r=>!t.has(r.label));return n.length&&this.emitSelectionChange(),n}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((s,n)=>s+(n.quantity??1),0);return Fr(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&&fi(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(n=>e.add(n.id));continue}let s=this.seatById.has(t)?t:this.labelToId.get(t);s&&e.add(s)}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 s=o.mode==="whole"?o.capacity:Math.floor(t);if(!Number.isInteger(s)||s<o.minOccupancy||s>o.maxOccupancy)return!1;let n=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,s),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,n),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,t,o){let s=this.groupedTablesByLabel.get(e),n=this.hold_;if(!s||s.mode!=="variable"||!n?.labels.includes(e))return null;let r=Math.floor(t);if(!Number.isInteger(r)||r<s.minOccupancy||r>s.maxOccupancy)return null;if((n.items??[]).filter(d=>d.label!==e).reduce((d,h)=>d+(h.quantity??1),0)+r>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(n.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?r:d.quantity}));if(!l.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,l,o,n.holdId);return this.tableQuantities.set(e,r),this.setHold({holdId:c.holdId,labels:l.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(s=>s.id):[e.id]),this.emitSelectionChange();return}if((t?this.tableTierResolution(t):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(t?t.chairs.map(s=>s.id):[e.id]),this.emitError(new ke(mi([t?.label??e.label]))),this.emitSelectionChange();return}if(t){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(t.chairs.map(s=>s.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(t.chairs.map(s=>s.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 s=e??this.getSelection().map(l=>l.label),n=(this.hold_?.items??[]).filter(l=>l.objectType==="ga"),r=[...new Set([...n.map(l=>l.label),...s])];if(!r.length)return null;let a=this.ticketIssue(r);if(a)throw new ke(a);if(this.hold_&&this.holdCovers(r))return this.hold_;try{let l=r.map(d=>{let h=n.find(y=>y.label===d);if(h)return{label:d,tierId:h.tierId,quantity:h.quantity};let p=this.labelToSeat.get(d),m=p?this.toSeat(p):null;return{label:d,...m?.tierId?{tierId:m.tierId}:{},...this.tableQuantityRequest(m)}}),c=await this.api.hold(this.key,l,t,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:r,expiresAt:c.expiresAt,items:c.items}),this.hold_}catch(l){throw this.handle409Conflicts(l),l}}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(s=>s.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 Rr({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 s of t.sectionMembers?.(o)??[])e.add(s);return e}getGAAreas(){let e=this.visibleDoc();return e?xr(e,this.currency,t=>this.statusOf(t)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Mr(this.getGAAreas(),this.gaSelected))}async holdGA(e,t,o={}){let s=this.visibleDoc();if(!s||!Number.isFinite(t)||t<1)return null;let n=qe(s).find(d=>d.id===e);if(!n)return null;let r=wt(n).filter(d=>!this.hold_?.labels.includes(d)&&this.statusOf(d)==="free").slice(0,Math.floor(t));if(r.length!==Math.floor(t))return null;let a=new Map;for(let d of this.hold_?.items??[])a.set(d.label,{label:d.label,tierId:d.tierId,quantity:d.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let d of this.hold_.seats)a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{}});for(let d of this.getSelection())a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{},...this.tableQuantityRequest(d)});for(let d of r)a.set(d,{label:d,...o.tierId?{tierId:o.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,o.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}hasPremiumSeats(){for(let e of this.labelToSeat.values())if(e.commercial?.premium)return!0;return!1}getBestAvailableZones(){let e=this.visibleDoc();if(!e?.zones?.length)return[];let t=new Set(kt(e).sections.filter(o=>o.seatCount>0&&!!o.zone).map(o=>o.zone));return e.zones.filter(o=>t.has(o.id)).map(o=>({id:o.id,label:o.label}))}pickPremiumBlock(e,t,o){let s=this.visibleDoc();if(!s?.objects?.length)return null;let n=s.focalPoint??{x:0,y:0},r=new Set(this.groupedTablesByObject.keys()),a=$e(s).filter(p=>!r.has(p.rowId)),l=new Set(this.hold_?.labels??[]),c=new Set;for(let p of a){if(l.has(p.label)||this.seatTierResolution(p).kind==="invalid"||this.accessFilter&&!Ee(p,this.accessFilter))continue;let m=this.labelToId.get(p.label);((m?this.getStatus(m):void 0)??"free")==="free"&&c.add(p.label)}let d=Fo(a,c,{qty:e,categoryKey:t,zoneId:o,focal:n,preferPremium:!0});return d.labels.length!==e?null:d.labels.every(p=>this.labelToSeat.get(p)?.commercial?.premium)?[...d.labels]:null}async bestAvailable(e,t,o={}){let s=this.renderer;if(!s)return null;if(o.preferPremium){let n=this.pickPremiumBlock(e,t,o.zoneId);if(n){if(this.hold_&&!await this.release())return null;try{let r=n.map(d=>{let h=this.labelToSeat.get(d),p=h?this.toSeat(h):null;return{label:d,...p?.tierId?{tierId:p.tierId}:{}}}),a=await this.api.hold(this.key,r,o.ttlMs);s.clearSelection();let l=this.idsForLabels(n);l.length&&s.setStatus(l,"held"),this.setHold({holdId:a.holdId,labels:[...n],expiresAt:a.expiresAt,items:a.items});let c=n.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(r){let{status:a,reason:l}=ft(r);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),r}}}if(this.hold_&&!await this.release())return null;try{let n=await this.api.bestAvailable(this.key,e,t,o.zoneId,o.ttlMs);s.clearSelection();let r=this.idsForLabels(n.labels);r.length&&s.setStatus(r,"held"),this.setHold({holdId:n.holdId,labels:[...n.labels],expiresAt:n.expiresAt,items:n.items});let a=n.labels.map(l=>this.labelToSeat.get(l)).filter(l=>!!l).map(l=>this.toSeat(l));return this.opts.onSelectionChange?.(a),this.hold_}catch(n){let{status:r,reason:a}=ft(n);throw r===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),n}}async book(e,t,o){let s=this.renderer;if(!s)return null;if(!this.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let n=t??this.getSelection().map(c=>c.label);if(!n.length)return null;let r=this.ticketIssue(n);if(r)throw new ke(r);let a;try{if(this.hold_&&this.holdCovers(n))a=this.hold_.holdId;else{let c=this.hold_?.holdId,d=await this.api.hold(this.key,n.map(h=>{let p=this.labelToSeat.get(h),m=p?this.toSeat(p):null;return{label:h,...m?.tierId?{tierId:m.tierId}:{},...this.tableQuantityRequest(m)}}),o,c);a=d.holdId,this.setHold({holdId:a,labels:[...n],expiresAt:d.expiresAt,items:d.items})}await this.api.book(this.key,n,a,e)}catch(c){let{status:d,conflicts:h,reason:p}=ft(c);if(this.clearHold(),d===409&&p==="event_closed")this.opts.onSalesClosed?.();else if(d===409&&h?.length){let m=new Set(h.map(f=>f.label)),y=this.idsForLabels(m);y.length&&(s.setStatus(y,"booked"),s.deselect(y),this.resetTableQuantitiesForLabels(m));let u=n.filter(f=>!m.has(f));u.length&&a&&this.api.release(this.key,u,a).catch(()=>{}),this.emitSelectionChange()}else a&&this.api.release(this.key,n,a).catch(()=>{});throw c}let l=this.idsForLabels(n);return l.length&&(s.setStatus(l,"booked"),s.deselect(l)),this.clearHold(),this.resetTableQuantitiesForLabels(n),this.emitSelectionChange(),this.opts.onBook?.(e),n}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(a=>t.labels.includes(a));if(!o.length)return!0;try{let a=await this.api.release(this.key,o,t.holdId);if(!this.releaseConfirmed(a,o))return await this.resnapshot(),!1}catch(a){return this.emitError(a),!1}if(this.hold_?.holdId!==t.holdId)return!0;let s=t.labels.filter(a=>!o.includes(a)),n=t.items?.filter(a=>!o.includes(a.label));s.length?this.setHold({...t,labels:s,items:n}):this.clearHold(),this.resetTableQuantitiesForLabels(o);let r=this.idsForLabels(o);return r.length&&(this.renderer?.deselect(r),this.renderer?.setStatus(r,"free")),!0}releaseConfirmed(e,t){let o=e?.released;return!Array.isArray(o)||t.every(s=>o.includes(s))}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(s=>s.notForSale).map(s=>s.key));if(!t.size)return[];let o=[];for(let[s,n]of this.seatById)t.has(n.categoryKey)&&o.push(s);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()}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),s=a=>a.some(l=>l.type==="row"&&(o.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||l.type==="gaArea"&&o.has(l.categoryKey)),n=this.getActiveFloorId(),r=t.floors.find(a=>a.id===n);return r&&s(r.objects)?null:t.floors.find(a=>s(a.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:Or({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=>Ee(t,this.accessFilter)}:{}})}destroy(){if(this.closed=!0,this.detachVisibilityListener(),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,s=e.displayLabel?{displayLabel:e.displayLabel}:void 0,n=e.accessibility?.length?{accessibility:e.accessibility}:void 0,r=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,a=this.seatContext.get(e.id),l=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!l)return{id:e.id,label:e.label,...s,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...n,...r};let d=c.tier;return{id:e.id,label:e.label,...s,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...o,...n,...r}}toTableSeat(e){let t=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(r=>At(this._doc,this.tableTierSeat(e),r.id).kind==="resolved"),s=this.tableTierResolution(e),n=s.kind==="resolved"?s.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:n?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:n?.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(r=>r.id)}}describeSeat(e,t){let o=this._doc?.categories.find(s=>s.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=Oo(this._doc,e);return t.length?t:void 0}seatTierResolution(e){return this._doc?At(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 At(this._doc,this.tableTierSeat(e),this.seatTiers.get(t))}setSeatTier(e,t){let o=this.seatById.get(e);if(!o)return;let s=this.tiersForSeat(o);if(s){if(t==null)this.seatTiers.delete(e);else if(s.some(n=>n.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 s=this.labelToSeat.get(o);s&&t.push(this.toSeat(s))}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 Do(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"?Y("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=new Set(e.getSelection().map(n=>n.id));(o.size?fi(this.seatById.values(),n=>e.getStatus(n),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(Y("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(n=>t.labels.includes(n)))return!1;let o=new Map((t.items??[]).map(n=>[n.label,n.tierId])),s=new Map((t.items??[]).map(n=>[n.label,n.quantity??1]));return e.every(n=>{let r=this.labelToSeat.get(n),a=r?this.toSeat(r):null,l=a?.tierId??null;return(a?.objectType!=="table"||(a.bookingMode!=="variable"||this.confirmedVariableTables.has(n))&&(!s.has(n)||s.get(n)===a.quantity))&&(!o.has(n)||o.get(n)===l)})}handle409Conflicts(e){let{status:t,conflicts:o}=ft(e);if(t!==409||!o?.length)return;let s=this.renderer;if(!s)return;let n=this.idsForLabels(o.map(r=>r.label));n.length&&(s.deselect(n),s.setStatus(n,"held"),this.resetTableQuantitiesForLabels(o.map(r=>r.label))),this.emitSelectionChange()}setHold(e,t="created"){for(let n of e.items??[])this.groupedTablesByLabel.has(n.label)&&n.quantity!=null&&(this.tableQuantities.set(n.label,n.quantity),this.groupedTablesByLabel.get(n.label)?.mode==="variable"&&this.confirmedVariableTables.add(n.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 s=Math.max(0,o.expiresAt-Date.now());this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},s),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(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 s=ei(t);this.allIds.length&&o.setStatus(this.allIds,s),o.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let n={free:[],held:[],booked:[],not_for_sale:[]};for(let[a,l]of Object.entries(e))n[ei(l)].push(...this.idsForLabel(a));["free","held","booked","not_for_sale"].forEach(a=>{a!==s&&n[a].length&&o.setStatus(n[a],a)});let r=this.notForSaleCategorySeatIds();r.length&&o.setStatus(r,"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))}async resnapshot(){try{let e=await this.api.objects(this.key);this.applySeatsMap(e.seats,e.default??"free")}catch{}}async refresh(){await this.resnapshot()}attachVisibilityListener(){if(this.onVisibilityChange||typeof document>"u"||typeof document.addEventListener!="function")return;let e=()=>{this.closed||document.visibilityState==="visible"&&this.resnapshot().then(()=>{this.closed||this.renderer?.forceDraw()})};this.onVisibilityChange=e,document.addEventListener("visibilitychange",e)}detachVisibilityListener(){this.onVisibilityChange&&(typeof document<"u"&&typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onVisibilityChange=null)}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),s=this.syncClosed(t);o&&this.resnapshot(),(o||s)&&this.opts.onStatusChange?.()}}}applyStatusChanges(e){let t=this.renderer;if(t){for(let o of e){this.liveStatuses.set(o.label,o.status);let s=this.idsForLabel(o.label);if(!s.length)continue;let n=ei(o.status);this.opts.flashOnLiveChange&&n!=="free"&&s.some(r=>t.getStatus(r)==="free")&&!this.hold_?.labels.includes(o.label)&&s.forEach(r=>t.flashSeat(r,n==="held"?"#f4b740":"#f43f5e")),t.setStatus(s,n)}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 s;try{s=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(!this.renderer||!s||typeof s!="object")return;let r=s;Array.isArray(r.hidden)&&this.syncHidden(r.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.()),Array.isArray(r.closed)&&this.syncClosed(r.closed)&&this.opts.onStatusChange?.(),r.type!=="hidden"&&(r.seats&&typeof r.seats=="object"?this.applySeatsMap(r.seats):Array.isArray(r.changes)&&this.applyStatusChanges(r.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=Ir(e,{baseMs:1e3,maxMs:jl,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}};var Jl=5,ec=-1.1,Ui=35;function $i(i,e){let t=i-ee,o=Math.atan2(Jl-t,e)*180/Math.PI,s=Math.atan2(ec-t,e)*180/Math.PI;return s<-Ui&&(o+=-Ui-s,s=-Ui),{topPitch:o,basePitch:s}}var $=2048,de=1024,yt=oo,E=Math.PI*2,tc=de/180,Ye=i=>(i+180)/360*$,W=i=>(90-i)/180*de;function Vr(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 zr(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 ii=96,Qi=360/ii,ic=.6,qi=[17,23,42];function Zi(i,e,t=1){let o=Math.max(0,Math.min(.58,e)),s=Math.round(i[0]+(qi[0]-i[0])*o),n=Math.round(i[1]+(qi[1]-i[1])*o),r=Math.round(i[2]+(qi[2]-i[2])*o);return`rgba(${s},${n},${r},${t})`}function Gr(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,s=(i%360+360)%360/60,n=o*(1-Math.abs(s%2-1)),r=0,a=0,l=0;s<1?[r,a,l]=[o,n,0]:s<2?[r,a,l]=[n,o,0]:s<3?[r,a,l]=[0,o,n]:s<4?[r,a,l]=[0,n,o]:s<5?[r,a,l]=[n,0,o]:[r,a,l]=[o,0,n];let c=t-o/2;return[Math.round((r+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var Hr=new Map;function Nr(i){if(!i)return null;let e=Hr.get(i);if(e)return e;let t=2166136261;for(let n=0;n<i.length;n++)t^=i.charCodeAt(n),t=Math.imul(t,16777619);let o=(t>>>0)%360,s=te(o,.3,.42);return Hr.set(i,s),s}function oc(i,e,t,o){let s=new Array(ii).fill(null),n=0,r=i.sectionId;for(let a of e){if(a.id===i.id)continue;let l=a.sectionId;if(!l||r&&l===r)continue;let c=a.x-i.x,d=a.y-i.y,h=Math.hypot(c,d)*yt;if(h<1.5||h>95)continue;let p=a.eyeHeightM??ee,m=p-o;Math.abs(m)>n&&(n=Math.abs(m));let y=Math.atan2(m,h)*180/Math.PI,u=Math.atan2(p-ee-o,h)*180/Math.PI,b=((Math.atan2(c,-d)-t)*180/Math.PI+540)%360-180,g=Math.min(ii-1,Math.max(0,Math.floor((b+180)/Qi))),S=y>34&&h<16,v=s[g];v?(y>v.top&&(v.top=y),u<v.base&&(v.base=u),h<v.nearM&&(v.nearM=h,v.tint=Nr(a.categoryKey)),v.overhead=v.overhead||S):s[g]={top:y,base:u,nearM:h,overhead:S,tint:Nr(a.categoryKey)}}return{bins:s,maxDelta:n}}function sc(i,e,t,o){for(let s=0;s<ii;s++){let n=e[s];if(!n)continue;let r=-180+s*Qi,a=t(r),l=t(r+Qi);if(!(l>a))continue;let c=Math.min(72,n.top),d=Math.min(n.base,-4),h=o(c),p=o(d);if(p<=h)continue;let m=n.nearM/95,y=n.tint,u=y?Gr([44,54,80],y,.34):[44,54,80],f=y?Gr([24,30,48],y,.28):[24,30,48],b=i.createLinearGradient(0,h,0,p);b.addColorStop(0,Zi(u,m)),b.addColorStop(.24,Zi(f,m)),b.addColorStop(1,Zi([10,13,22],m)),i.fillStyle=b,i.fillRect(a,h,l-a+1,p-h),i.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,i.fillRect(a,h,l-a+1,1.5);let S=Math.min(p,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(a,T,l-a+1,1.5),i.fillStyle=`rgba(120,134,170,${.1*w})`,i.fillRect(a,T+1.5,l-a+1,1.2)}}if(n.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(a,v,l-a+1,h-v),i.fillStyle="rgba(120,130,160,0.14)",i.fillRect(a,h-1.5,l-a+1,1.5)}}}function nc(i,e,t){let s=new Array(72).fill(!1),n=new Array(72).fill(1/0),r=new Set,a=0;for(let b of t){a++,b.sectionId&&r.add(b.sectionId);let g=b.x-e.x,S=b.y-e.y,v=Math.hypot(g,S)*yt;if(v<.5)continue;let w=Math.atan2(g,-S),k=Math.floor((w+Math.PI)/E*72);k<0?k=0:k>=72&&(k=71),s[k]=!0,v<n[k]&&(n[k]=v)}let l=0,c=[];for(let b=0;b<72;b++)s[b]&&(l++,c.push(n[b]));let d=l/72*360;c.sort((b,g)=>b-g);let h=c.length?c[c.length>>1]:0,p=c.length?c[Math.floor(c.length*.15)]??h:0,m=c.length?c[Math.floor(c.length*.85)]??h:0,y=p>.5?m/p:1,u=Vr(`${a}|${[...r].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),f;return d>=300&&h>11&&y>1.35?f="sport":d>=285?f="arena":f="proscenium",{mode:f,seed:u,voidRadiusM:h,aspect:y}}var rc=5;function ac(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 lc(i,e,t,o,s){let n=o*.44,r=o*s.shoulderK,a=o*.66,l=o*1.68,c=o*5.4,d=`rgba(${s.clothing[0]},${s.clothing[1]},${s.clothing[2]},${s.alpha})`,h=`rgba(${s.tone[0]},${s.tone[1]},${s.tone[2]},${s.alpha})`;i.save(),i.translate(e,t);let p=s.lean*o;i.fillStyle=d,i.beginPath(),i.moveTo(-n,a),i.quadraticCurveTo(-n*1.18,l-p-o*.6,-r,l-p),i.quadraticCurveTo(-r*1.05,l+o*1.2,-r*.94,c),i.lineTo(r*.94,c),i.quadraticCurveTo(r*1.05,l+o*1.2,r,l+p),i.quadraticCurveTo(n*1.18,l+p-o*.6,n,a),i.closePath(),i.fill(),i.fillStyle=h,i.fillRect(-n*.82,o*.5,n*1.64,o*.9),i.save(),i.rotate(s.tilt),i.translate(s.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,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()),ac(i,o,s.hair),s.rim>.01&&(i.strokeStyle=`rgba(245,205,150,${(.5*s.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(),s.rim>.01&&(i.strokeStyle=`rgba(240,200,150,${(.28*s.rim).toFixed(3)})`,i.lineWidth=Math.max(1,o*.12),i.beginPath(),i.moveTo(-r*.8,l-o*.05),i.quadraticCurveTo(-n,l-o*.75,0,l-o*.82),i.quadraticCurveTo(n,l-o*.75,r*.8,l-o*.05),i.stroke()),i.restore()}function cc(i,e,t,o,s,n,r){i.fillStyle=`rgba(${s[0]},${s[1]},${s[2]},${r})`,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(${n[0]},${n[1]},${n[2]},${r})`,i.beginPath(),i.ellipse(e,t,o*.9,o*1.05,0,0,E),i.fill()}function Ji(i,e,t,o,s){let n=o*.1,r=t-o*.9,a=t-o*.74,l=t-o*.46,c=o*.13,d=o*.09,h=`rgba(${s.tone[0]},${s.tone[1]},${s.tone[2]},${s.alpha})`,p=i.createRadialGradient(e,t,1,e,t,o*.24);p.addColorStop(0,"rgba(0,0,0,0.4)"),p.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.scale(1,.28),i.fillStyle=p,i.beginPath(),i.ellipse(e,t/.28,o*.24,o*.24,0,0,E),i.fill(),i.restore(),i.fillStyle=h,i.beginPath(),i.moveTo(e-d,l),i.lineTo(e-d*.7,t),i.lineTo(e-d*.1,t),i.lineTo(e-d*.1,l+o*.02),i.lineTo(e+d*.1,l+o*.02),i.lineTo(e+d*.1,t),i.lineTo(e+d*.7,t),i.lineTo(e+d,l),i.closePath(),i.fill(),i.beginPath(),i.moveTo(e-c,a),i.quadraticCurveTo(e-c*.9,l-o*.12,e-d,l),i.lineTo(e+d,l),i.quadraticCurveTo(e+c*.9,l-o*.12,e+c,a),i.quadraticCurveTo(e,a-o*.05,e-c,a),i.closePath(),i.fill(),i.lineCap="round",i.lineJoin="round",i.strokeStyle=h,i.lineWidth=o*.055;let m=a+o*.02;s.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()):s.pose===2?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e+d*1.4,l-o*.02),i.moveTo(e+c*.8,m),i.lineTo(e-d*.4,l-o*.06),i.stroke(),i.fillStyle=h,i.beginPath(),i.ellipse(e+d*1.5,l-o*.04,o*.07,o*.09,-.5,0,E),i.fill()):s.pose===3?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e-c*.2,r+n*.6),i.moveTo(e+c*.8,m),i.lineTo(e+c*1.1,l),i.stroke(),i.lineWidth=o*.02,i.beginPath(),i.moveTo(e-c*.2,r+n*.9),i.lineTo(e-c*.2,t-o*.02),i.stroke()):(i.beginPath(),i.moveTo(e-c*.85,m),i.lineTo(e-c*.95,l+o*.02),i.moveTo(e+c*.85,m),i.lineTo(e+c*.95,l+o*.02),i.stroke()),i.fillStyle=h,i.fillRect(e-n*.34,r+n*.6,n*.68,n*.9),i.beginPath(),i.ellipse(e,r,n*.86,n*1.05,0,0,E),i.fill(),s.rimStrength>.01&&(i.strokeStyle=`rgba(${s.rim[0]},${s.rim[1]},${s.rim[2]},${(.6*s.rimStrength).toFixed(3)})`,i.lineWidth=Math.max(1,o*.02),i.beginPath(),i.moveTo(e-c,a),i.lineTo(e-n*.6,r+n*.4),i.moveTo(e-n*.7,r),i.ellipse(e,r,n*.84,n*1.02,0,Math.PI*1.05,Math.PI*1.55),i.stroke())}function oi(i,e,t,o,s,n,r,a,l){i.save(),i.globalCompositeOperation="lighter";let c=i.createLinearGradient(0,t,0,s);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),i.fillStyle=c,i.beginPath(),i.moveTo(e-n,t),i.lineTo(o-r,s),i.lineTo(o+r,s),i.lineTo(e+n,t),i.closePath(),i.fill(),i.restore()}function eo(i,e,t,o,s){let n=i.createRadialGradient(e,t,0,e,t,o*3);n.addColorStop(0,`rgba(${s},0.9)`),n.addColorStop(.4,`rgba(${s},0.35)`),n.addColorStop(1,`rgba(${s},0)`),i.fillStyle=n,i.beginPath(),i.arc(e,t,o*3,0,E),i.fill(),i.fillStyle=`rgba(${s},1)`,i.beginPath(),i.arc(e,t,o,0,E),i.fill()}function hm(i,e,t){let o=document.createElement("canvas");o.width=$,o.height=de;let s=o.getContext("2d"),n=e.x-i.x,r=e.y-i.y,a=Math.hypot(n,r),l=Math.max(2,a*yt),c=i.eyeHeightM??ee,d=nc(i,e,t),h=zr(d.seed),p=210+h()*150,m=te(220+(h()-.5)*60,.55,.82),y=`${m[0]},${m[1]},${m[2]}`,u=s.createLinearGradient(0,0,0,de);u.addColorStop(0,"#080b12"),u.addColorStop(.42,"#12182c"),u.addColorStop(.5,"#1c2440"),u.addColorStop(.56,"#151b2c"),u.addColorStop(.78,"#171e30"),u.addColorStop(1,"#131829"),s.fillStyle=u,s.fillRect(0,0,$,de);let f=s.createLinearGradient(0,W(-6),0,de);f.addColorStop(0,"rgba(30, 37, 56, 0)"),f.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),f.addColorStop(1,"rgba(22, 28, 44, 0.12)"),s.fillStyle=f,s.fillRect(0,W(-6),$,de-W(-6));let b=Math.atan2(n,-r),g=oc(i,t,b,c),S=g.maxDelta>=ic;S&&sc(s,g.bins,Ye,W);let v=Math.max(.3,Math.min(1,1-(l-6)/60)),w=$i(c,l),k=Math.min(80,Math.atan2(4,l)*180/Math.PI),T=Math.min(45,w.topPitch),C=w.basePitch;d.mode==="sport"?uc(s,l,c,d,v,p,y,h):d.mode==="arena"?hc(s,l,c,d,v,y,h):dc(s,k,T,C,v,p,y,h);let L=d.mode==="sport"?34:24+Math.floor(h()*8);s.fillStyle=`rgba(${y},0.8)`;for(let x=0;x<L;x++){let M=(x+.5)/L*$,R=W(d.mode==="sport"?58:54+x*7%3*6);s.beginPath(),s.arc(M,R,d.mode==="sport"?2.6:3.2,0,E),s.fill()}pc(s,i,t,e,b,c,n,r,S,d);let I=s.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)"),s.fillStyle=I,s.fillRect(0,0,$,de),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function dc(i,e,t,o,s,n,r,a){let l=Ye(-e),c=Ye(e),d=W(t),h=W(o),p=c-l,m=h-d,y=W(Math.min(50,t+10)),u=p*(1.1+(1-s)*.5),f=i.createRadialGradient($/2,(d+h)/2,8,$/2,(d+h)/2,u);f.addColorStop(0,"rgba(255, 214, 150, 0.34)"),f.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),f.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),f.addColorStop(1,"rgba(99, 102, 241, 0)"),i.fillStyle=f,i.fillRect(l-p*.6,d-m*1.2,p*2.2,m*3.4);let b=te(n,.62,.55),g=te(n+40,.7,.5),S=te(n+70,.78,.52);i.save(),i.beginPath(),i.rect(l,d,p,m),i.clip();let v=i.createLinearGradient(0,d,0,h);v.addColorStop(0,`rgb(${b[0]},${b[1]},${b[2]})`),v.addColorStop(.5,`rgb(${g[0]},${g[1]},${g[2]})`),v.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),i.globalAlpha=.8,i.fillStyle=v,i.fillRect(l,d,p,m),i.globalAlpha=1;let w=i.createRadialGradient($/2,(d+h)/2,p*.12,$/2,(d+h)/2,p*.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(l,d,p,m),i.restore();let k=3+Math.floor(a()*3),T=m*.46,C=h-m*.08;for(let _=0;_<k;_++){let j=(_+1)/(k+1),V=l+p*(.22+j*.56+(a()-.5)*.06);Ji(i,V,C,T*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:te(n+20,.5,.7),rimStrength:.7})}i.fillStyle="#05070d",i.fillRect(l-p*.5,y,p*.5,h-y),i.fillRect(c,y,p*.5,h-y);let L=p*.055+3,I=L*1.35;i.fillStyle="#03050a",i.beginPath(),i.moveTo(l,h),i.lineTo(l-L,h),i.lineTo(l-I,y),i.lineTo(l+p*.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-p*.012,y),i.closePath(),i.fill(),i.fillRect(l-I,y,p+I*2,(h-y)*.12);let x=m*.14,M=y+(h-y)*.12;i.fillStyle="rgba(4,6,12,0.96)";let R=7;i.beginPath(),i.moveTo(l-I,M);for(let _=0;_<=R;_++){let j=l-I+(p+I*2)*_/R;i.quadraticCurveTo(j-(p+I*2)/R/2,M+x,j,M)}i.lineTo(c+I,M),i.lineTo(c+I,y),i.lineTo(l-I,y),i.closePath(),i.fill(),i.fillStyle=`rgba(${r},0.12)`,i.fillRect(l-1.5,M,1.5,h-M),i.fillRect(c,M,1.5,h-M),i.fillStyle="#0b0f18",i.fillRect(l-L,h-m*.05,p+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*s).toFixed(3)})`),P.addColorStop(1,"rgba(255,206,140,0)"),i.fillStyle=P,i.fillRect(l-L,h-m*.05,p+L*2,m*.2);let A=3+Math.floor(a()*2);for(let _=0;_<A;_++){let j=(_+1)/(A+1),V=l+p*(j+(a()-.5)*.08),z=W(Math.min(62,t+26)),J=(a()-.5)*p*.16;oi(i,V,z,V+J,h,4,p*.09,r,.16*(.7+s*.5)),eo(i,V,z,2.4,r)}}function hc(i,e,t,o,s,n,r){let a=Math.min(e*.6,Math.max(3,o.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=$/2,d=1.2,h=Math.max(e*.45,e-a),p=e+a,m=Math.atan2(d-t,h)*180/Math.PI,y=Math.atan2(d-t,p)*180/Math.PI,u=Math.atan2(-t,h)*180/Math.PI,f=W(m),b=W(y),g=W(u),S=Ye(l)-c,v=Math.max(6,(f-b)/2),w=(f+b)/2,k=i.createRadialGradient(c,g,4,c,g,S*2.6);k.addColorStop(0,`rgba(255,206,150,${(.2*s).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,b-v,S*5.2,g-b+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,g),i.ellipse(c,g,S,v,0,0,Math.PI,!1),i.closePath(),i.fill();let T=i.createLinearGradient(0,w,0,g);T.addColorStop(0,`rgba(${n},0.14)`),T.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=T,i.fillRect(c-S,w,S*2,g-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(r()*C.length)],I=r()<.5?-1:1,x=F=>c+F.u*I*S*.84,M=F=>w+F.v*v*.8,R=L.find(F=>F.lead)??L[0],P=x(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(P,w,2,P,w,S);_.addColorStop(0,`rgba(255,214,160,${(.5*s).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(${n},0.7)`,i.lineWidth=2,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.stroke();let j=Math.max(24,(g-b)*1.3),V=L.length>=3?3:2;for(let F=0;F<V;F++){let he=(-.62+F*.52+(r()-.5)*.12)*-I,Le=c+he*S*.7,Ue=w-v*(.45+r()*.18),Fe=S*(.07+r()*.04),ci=j*(.26+r()*.12);i.fillStyle="#0a0e18",i.fillRect(Le-Fe/2,Ue-ci,Fe,ci),i.fillStyle=`rgba(${n},0.3)`,i.fillRect(Le-Fe/2,Ue-ci,Fe,1.5)}if(L.length>=3){let F=c-R.u*I*S*.4;i.fillStyle="#0b0f1a",i.beginPath(),i.ellipse(F,w-v*.34,S*.08,v*.1,0,0,E),i.fill(),i.strokeStyle=`rgba(${n},0.35)`,i.lineWidth=1,i.stroke()}for(let F of[...L].sort((he,Le)=>he.v-Le.v)){let he=.82+(F.v+1)*.14;Ji(i,x(F),M(F),j*he*(F.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:F.pose,rim:te(40,.72,.8),rimStrength:F.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,E),i.stroke();let O=4+Math.floor(r()*3);for(let F=0;F<O;F++){let he=F/O*E,Le=c+Math.cos(he)*S*1.15,Ue=z+Math.sin(he)*J;if(Math.sin(he)>-.2){let Fe=c+(r()-.5)*S*.8;oi(i,Le,Ue,Fe,w,3,S*.32,n,.2*(.7+s*.4))}eo(i,Le,Ue,3,n)}let K=W(Math.min(52,y+24)),D=Math.max(60,S*.4),q=Math.max(24,D*.34);i.strokeStyle="rgba(70,78,102,0.6)",i.lineWidth=1.5,i.beginPath(),i.moveTo(c-D*.3,K-q/2),i.lineTo(c-D*.16,K-q*2.2),i.moveTo(c+D*.3,K-q/2),i.lineTo(c+D*.16,K-q*2.2),i.stroke(),i.fillStyle="#0d1220",i.fillRect(c-D/2,K-q/2,D,q);let ni=i.createLinearGradient(0,K-q*.3,0,K+q*.42);ni.addColorStop(0,`rgba(${n},0.5)`),ni.addColorStop(1,"rgba(255,214,160,0.32)"),i.fillStyle=ni,i.fillRect(c-D*.42,K-q*.3,D*.84,q*.72),i.fillStyle="rgba(255,214,160,0.55)",i.fillRect(c-D/2,K+q/2-2,D,2);let ri=i.createRadialGradient(c,K,4,c,K,D*1.1);ri.addColorStop(0,`rgba(${n},0.2)`),ri.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=ri,i.fillRect(c-D*1.1,K-D*.8,D*2.2,D*1.6);let ai=i.createRadialGradient(c,(z+w)/2,6,c,(z+w)/2,S*1.5);ai.addColorStop(0,`rgba(${n},${(.1*(.6+s*.5)).toFixed(3)})`),ai.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=ai,i.fillRect(c-S*1.5,z-40,S*3,w-z+80),i.restore();let Xr=c+Math.sign(P-c||1)*S*.5;oi(i,Xr,z-J*.4,P,M(R),2.5,S*.16,"255,224,178",.42*(.7+s*.4));let li=i.createRadialGradient(P,M(R),1,P,M(R),S*.2);li.addColorStop(0,`rgba(255,228,185,${(.4*s).toFixed(3)})`),li.addColorStop(1,"rgba(255,228,185,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=li,i.beginPath(),i.ellipse(P,M(R),S*.2,v*.24,0,0,E),i.fill(),i.restore()}function uc(i,e,t,o,s,n,r,a){let l=$/2,c=Math.max(10,o.voidRadiusM),d=Math.max(2,e-c),h=e+c,p=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,u=W(m),f=W(y),b=Ye(p)-l,g=(u+f)/2,S=Math.max(10,(u-f)/2),v=i.createRadialGradient(l,g,4,l,g,b);v.addColorStop(0,"#e8f0fb"),v.addColorStop(.7,"#b9c9e2"),v.addColorStop(1,"#8fa3c4"),i.save(),i.beginPath(),i.ellipse(l,g,b,S,0,0,E),i.clip(),i.fillStyle=v,i.fillRect(l-b,g-S,b*2,S*2),i.strokeStyle="rgba(90,120,170,0.5)",i.lineWidth=3,i.beginPath(),i.moveTo(l,g-S),i.lineTo(l,g+S),i.moveTo(l-b*.5,g-S),i.lineTo(l-b*.5,g+S),i.moveTo(l+b*.5,g-S),i.lineTo(l+b*.5,g+S),i.stroke(),i.strokeStyle="rgba(180,90,110,0.45)",i.beginPath(),i.ellipse(l,g,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(l,g,b,S,0,0,E),i.stroke(),i.fillStyle="rgba(20,26,40,0.8)";for(let x=0;x<5;x++){let M=l+(a()-.5)*b*1.4,R=g+(a()-.5)*S*1.1,P=Math.max(2,S*.06);i.beginPath(),i.ellipse(M,R,P*.6,P,0,0,E),i.fill()}let w=i.createRadialGradient(l,g,4,l,g,b*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(l-b*1.4,f-S,b*2.8,u-f+S*2),i.restore();let k=W(Math.min(66,y+60)),T=Math.max(80,b*.7),C=T*.5,L=i.createRadialGradient(l,k,4,l,k,T*1.6);L.addColorStop(0,`rgba(${r},0.3)`),L.addColorStop(1,`rgba(${r},0)`),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=L,i.fillRect(l-T*1.6,k-T*1.2,T*3.2,T*2.4),i.restore(),i.fillStyle="#080b12",i.beginPath(),i.moveTo(l-T/2,k-C/2),i.lineTo(l+T/2,k-C/2),i.lineTo(l+T*.6,k),i.lineTo(l+T/2,k+C/2),i.lineTo(l-T/2,k+C/2),i.lineTo(l-T*.6,k),i.closePath(),i.fill();let I=n;for(let x=0;x<3;x++){let M=te(I+x*30,.5,.5);i.fillStyle=`rgba(${M[0]},${M[1]},${M[2]},0.75)`;let R=T*.26;i.fillRect(l-T*.42+x*(R+T*.06),k-C*.32,R,C*.64)}i.fillStyle=`rgba(${r},0.9)`;for(let x=0;x<8;x++){let M=l-T*.6+T*1.2*x/7;i.beginPath(),i.arc(M,k+C*.62,2.4,0,E),i.fill()}}function pc(i,e,t,o,s,n,r,a,l,c){let d=e.sectionId,h=!1,p=[];for(let u of t){if(u.id===e.id)continue;let f=u.x-e.x,b=u.y-e.y,g=Math.hypot(f,b)*yt;if(d&&u.sectionId===d&&g<3&&f*r+b*a>0&&(h=!0),g<.3||g>32)continue;let v=((Math.atan2(f,-b)-s)*180/Math.PI+540)%360-180,w=l?(u.eyeHeightM??ee)-n:0,k=Math.atan2(w-.28,g)*180/Math.PI;if(k>10&&g>5)continue;let T=0;for(let I=0;I<u.id.length;I++)T=T*31+u.id.charCodeAt(I)&65535;let C=.9+(T&15)/40,L=Math.min(78,Math.atan2(.16,g)*180/Math.PI*tc*C);L<1.2||p.push({hx:Ye(v),hy:W(k),r:L,d:g,hash:T})}p.sort((u,f)=>f.d-u.d);let m=[];{let u=[...p].sort((g,S)=>g.hy-S.hy),f=[],b=()=>{if(!f.length)return;let g=f.reduce((w,k)=>w+k.d,0)/f.length,S=f.reduce((w,k)=>w+k.hy,0)/f.length,v=f.reduce((w,k)=>w+k.r,0)/f.length;m.push({figs:f.sort((w,k)=>k.d-w.d),d:g,hy:S,r:v}),f=[]};for(let g of u){let S=f[f.length-1];S&&Math.abs(g.hy-S.hy)>Math.max(5,(S.r+g.r)/2*1.7)&&b(),f.push(g)}b()}m.sort((u,f)=>f.d-u.d);let y=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let u of m){if(u.figs.length>=3&&u.r>=1.6&&u.r<26){let f=[],b=[...u.figs].sort((v,w)=>v.hx-w.hx),g=[];for(let v of b){let w=g[g.length-1];w&&v.hx-w.hx>Math.max(14,v.r*7)&&(g.length>=3&&f.push(g),g=[]),g.push(v)}g.length>=3&&f.push(g);let S=Math.min(.42,.5*(1-u.d/42));if(S>.05){i.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let v of f){let w=v[0].hx-u.r*1.6,k=v[v.length-1].hx+u.r*1.6;i.beginPath(),i.roundRect(w,u.hy+u.r*.8,k-w,u.r*2.4,u.r*.8),i.fill()}}}for(let f of u.figs){let b=f.d<12?.95:f.d<17?Math.max(.66,.95-(f.d-12)/18):Math.max(.3,.68-(f.d-17)/34),g=Math.round((1-Math.min(1,f.d/16))*10),S=[14+(f.hash>>4&6)+g,17+(f.hash>>4&6)+g,25+(f.hash>>4&6)+g],v=y[f.hash%y.length],w=[v[0]+g,v[1]+g,v[2]+g];if(f.r>=13){let k=f.d<9?.16*(1-f.d/9)+(c.mode==="proscenium"?.06:0):0;lc(i,f.hx,f.hy,f.r,{tone:S,clothing:w,alpha:b,tilt:((f.hash>>2&7)-3.5)*.018,shoulderK:1.72+(f.hash>>5&7)/22,hair:f.hash%rc,rim:k,turn:((f.hash>>8&7)-3.5)*.034,lean:((f.hash>>10&3)-1.5)*.09})}else f.r>=5.5?cc(i,f.hx,f.hy,f.r,w,S,b):(i.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${b.toFixed(3)})`,i.beginPath(),i.arc(f.hx,f.hy,f.r,0,E),i.fill(),i.beginPath(),i.ellipse(f.hx,f.hy+f.r*1.4,f.r*1.85,f.r*.95,0,Math.PI,0,!0),i.fill())}}if(h){let u=W(-34);i.fillStyle="rgba(6, 8, 14, 0.92)",i.fillRect(0,u,$,de-u),i.fillStyle="rgba(24, 30, 46, 0.9)";let f=16;for(let b=0;b<f;b++){let g=(b+.5)/f*$;i.beginPath(),i.ellipse(g,u+6,$/f*.42,22,0,Math.PI,0,!0),i.fill()}}}var se=480,Xe=270,ji=50,Be=30,Wr=i=>(i+ji)/(2*ji)*se,mt=i=>(Be-i)/(2*Be)*Xe;function um(i,e,t){let o=document.createElement("canvas");o.width=se,o.height=Xe;let s=o.getContext("2d"),n=e.x-i.x,r=e.y-i.y,a=Math.max(2,Math.hypot(n,r)*yt),l=zr(Vr(`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=te(220+(l()-.5)*60,.55,.82),h=`${d[0]},${d[1]},${d[2]}`,p=s.createLinearGradient(0,0,0,Xe);p.addColorStop(0,"#080b12"),p.addColorStop(.44,"#151c32"),p.addColorStop(.5,"#1d2644"),p.addColorStop(.58,"#161c2e"),p.addColorStop(1,"#131829"),s.fillStyle=p,s.fillRect(0,0,se,Xe);let m=i.eyeHeightM??ee,y=$i(m,a),u=Math.min(ji-2,Math.atan2(4,a)*180/Math.PI),f=Math.min(Be-2,y.topPitch),b=Math.max(-Be+2,y.basePitch),g=Wr(-u),S=Wr(u),v=mt(f),w=mt(b),k=S-g,T=w-v,C=Math.max(.35,Math.min(1,1-(a-6)/60)),L=mt(Math.min(Be-1,f+8)),I=s.createRadialGradient(se/2,(v+w)/2,4,se/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)"),s.fillStyle=I,s.fillRect(g-k*.6,v-T*1.2,k*2.2,T*3.4);let x=te(c,.62,.55),M=te(c+40,.7,.5),R=te(c+70,.78,.52);s.save(),s.beginPath(),s.rect(g,v,k,T),s.clip();let P=s.createLinearGradient(0,v,0,w);P.addColorStop(0,`rgb(${x[0]},${x[1]},${x[2]})`),P.addColorStop(.5,`rgb(${M[0]},${M[1]},${M[2]})`),P.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),s.globalAlpha=.8,s.fillStyle=P,s.fillRect(g,v,k,T),s.globalAlpha=1;let A=s.createRadialGradient(se/2,(v+w)/2,k*.12,se/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)"),s.fillStyle=A,s.fillRect(g,v,k,T),s.restore();let _=3,j=w-T*.08;for(let O=0;O<_;O++){let K=(O+1)/(_+1);Ji(s,g+k*(.24+K*.52),j,T*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:te(c+20,.5,.7),rimStrength:.7})}s.fillStyle="#05070d",s.fillRect(g-k*.5,L,k*.5,w-L),s.fillRect(S,L,k*.5,w-L);let V=k*.05+2,z=V*1.35;s.fillStyle="#03050a",s.beginPath(),s.moveTo(g,w),s.lineTo(g-V,w),s.lineTo(g-z,L),s.lineTo(g+k*.012,L),s.closePath(),s.fill(),s.beginPath(),s.moveTo(S,w),s.lineTo(S+V,w),s.lineTo(S+z,L),s.lineTo(S-k*.012,L),s.closePath(),s.fill(),s.fillRect(g-z,L,k+z*2,(w-L)*.13),s.fillStyle=`rgba(${h},0.12)`,s.fillRect(g-1.2,L,1.2,w-L),s.fillRect(S,L,1.2,w-L),s.fillStyle="#0b0f18",s.fillRect(g-V,w-T*.05,k+V*2,T*.05+2);let J=s.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)"),s.fillStyle=J,s.fillRect(g-V,w-T*.05,k+V*2,T*.22);for(let O=0;O<3;O++){let K=(O+1)/4,D=g+k*K,q=mt(Math.min(Be-1,f+20));oi(s,D,q,D+(l()-.5)*k*.14,w,3,k*.09,h,.17*C),eo(s,D,q,1.8,h)}s.fillStyle=`rgba(${h},0.75)`;for(let O=0;O<8;O++)s.beginPath(),s.arc((O+.5)/8*se,mt(Be-4-O%2*3),2.2,0,E),s.fill();s.fillStyle="rgba(10,13,20,0.9)",s.fillRect(0,Xe-26,se,26),s.fillStyle="rgba(30,37,54,0.9)";for(let O=0;O<9;O++){let K=O*(se/9)+se/18;s.beginPath(),s.ellipse(K,Xe-22,se/9*.4,15,0,Math.PI,0,!0),s.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var Kr=new Set(["en"]),si=new Map;async function fc(i){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(Ho(`i18n/${i}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-EMBA3SWS.js"),t=e[i];return t?await t():null}async function ym(i,e){let t=Bs(i,e);if(t==="en"||Kr.has(t))return We(t),t;if(!_s.includes(t))return We("en"),"en";try{let o=si.get(t);o||(o=fc(t),si.set(t,o));let s=await o;return si.delete(t),s?(We(t,s),Kr.add(t),t):(We("en"),"en")}catch{return si.delete(t),We("en"),"en"}}export{bc as ACCESSIBILITY_RING_COLOR,yc as ACCESSIBILITY_TYPES,mc as CHART_STORAGE_KEY,md as CURRENCY_CHOICES,fd as DEFAULT_CURRENCY,Pc as EVENT_CONFIGURATION_EXPORT_SCHEMA,Cc as EVENT_CONFIGURATION_SCHEMA,kc as LABEL_STYLE_MAX_SIZE,wc as LABEL_STYLE_MIN_SIZE,Ld as LOCALE_NAMES,jc as MAX_EVENT_INVENTORY,Qc as MAX_GA_CAPACITY,Dr as PickerController,ke as PickerSelectionError,rd as RENDERED_QUALITY_REPORT_VERSION,Sc as SEAT_COMMERCIAL_MARKS,ma as SUPPORTED_LOCALES,Lc as SURROUNDINGS_SHAPE_ROLES,Xi as SeatmapRenderer,Fc as TABLE_SEAT_OFFSET,Bc as TIER_HEIGHT_M,_s as TRANSLATED_LOCALES,uo as UNGROUPED_ID,gc as accessibilityMeta,gt as accessibilityRingColor,no as allObjects,po as applyHidden,Ec as canTransitionEventConfiguration,Mc as canonicalEventConfigurationJson,ho as chartBounds,kt as computeSections,Cr as createRenderer,pa as currencyExponent,gd as currencySymbol,Kc as expandBooth,$e as expandChart,Hc as expandRow,Gc as expandRowSlots,zc as expandTable,Wc as expandTableSlots,$c as floorObjects,Zc as floorOverviewTranslations,vt as floorsOf,lo as floorsShareFootprint,Md as formatDate,yd as formatMinor,ot as formatMoney,fa as fromMinorUnits,qe as gaAreasOf,td as gaInventorySegments,Jc as gaUnitLabel,wt as gaUnitLabels,hm as generateSeatPanorama,um as generateSeatThumb,Td as getLocale,id as growJoinedGAInventory,nd as hiddenObjectIds,Rc as inspectEventConfigurationCompatibility,ad as inspectRenderedQualityEvidence,od as isGaUnitLabel,Pd as isLocaleLoaded,sd as isSectionHidden,Tc as layerOf,ao as layoutFloorOverview,co as layoutFloorRings,ym as loadLocale,Cd as localeDirection,_c as migrateLegacyEventConfigurations,Yc as objectCenter,Uc as owningSectionForObject,xc as parseEventConfigurationExport,Ic as parseEventConfigurationVersion,Xc as pointInPolygon,ie as pointInPolygonWithHoles,St as polygonLabelPoint,Ac as resolveEventConfigurationRollback,Bs as resolveLocale,Dc as rowInventoryCount,Oc as rowSeatPositions,vc as seatCommercialMeta,bt as sectionGeometry,We as setLocale,As as setMoneyLocale,Id as setStringOverrides,ro as stackFloors,Y as t,xd as tCount,Vc as tableInventoryCount,Nc as tableSeatCountsBySide,qc as translateObject,ed as validGAInventorySegments};
1
+ import{a as fi,b as Fo,d as mi,f as Oo,g as At,i as Do,k as Go}from"./chunk-652LV66L.js";import{b as Lo,e as Rt,g as To,h as ye,i as se,j as Co,k as Po,l as Et,m as Io}from"./chunk-WXWJZ5DO.js";import{a as rd,b as ad}from"./chunk-MR2O5WC7.js";import{b as Ho}from"./chunk-FOYQOIWG.js";import{a as Cc,b as Pc,c as Ic,d as xc,e as Mc,f as Rc,g as Ec,h as Ac,i as _c}from"./chunk-UHPX2P7O.js";import{a as fe,b as go,c as Te,d as Lt,e as Tt,f as Ce,g as Z,m as me,n as ve,q as Ct,r as Pt,t as bo,u as It,v as X,w as pi}from"./chunk-GXMGOWKB.js";import{b as De,f as xo,g as Mo,m as Ro,x as Eo,y as Ao}from"./chunk-JBGLFOJO.js";import{a as Qc,b as jc,c as Jc,d as ed,e as td,f as wt,g as id,h as qe,i as od,j as uo,k as kt,l as sd,m as nd,n as po}from"./chunk-A27USMF7.js";import{c as _o,e as Bo}from"./chunk-T2LWVOQ3.js";import{a as mc,b as yc,c as gc,d as bc,e as gt,f as Sc,g as vc,h as wc,i as kc,j as Lc,k as Tc,p as So,s as Ze}from"./chunk-AWPHGLTU.js";import{b as xt,f as vo,h as Mt,i as wo,k as ko}from"./chunk-UL5OIGIF.js";import{Aa as $c,Ba as no,Ca as qc,Da as ro,Ea as ao,Fa as lo,Ga as co,Ha as Zc,Ia as $e,Ja as ho,W as oo,X as Oe,Y as Bc,ea as ee,fa as so,ga as bt,ka as Fc,la as Oc,ma as Dc,na as Gc,oa as Hc,pa as Nc,qa as Wc,ra as Vc,s as to,sa as zc,ta as Kc,u as io,ua as Xc,va as ie,w as G,wa as St,xa as Yc,ya as Uc,za as vt}from"./chunk-X3K36XZM.js";import{B,c as di,h as hi,l as fo,n as mo,s as U,t as Se,u as ue,v as pe,w as ui,y as yo}from"./chunk-CXF32VPG.js";import"./chunk-CRCGO52K.js";import{Konva as Jt}from"konva/lib/Core";import{Stage as Yl}from"konva/lib/Stage";import{Layer as Vi}from"konva/lib/Layer";import{Group as ut}from"konva/lib/Group";import{Circle as kr}from"konva/lib/shapes/Circle";import{Group as Ci}from"konva/lib/Group";import{Circle as Re}from"konva/lib/shapes/Circle";import{Line as Pi}from"konva/lib/shapes/Line";import{Rect as Ii}from"konva/lib/shapes/Rect";import{Text as Ns}from"konva/lib/shapes/Text";var Qe=9,Pe=.9,ne=.55*Pe,re=Z/fe,je=4,Ie=14,No=10,Wo=14,ge=.45*Pe,be=.9*Pe,Vo=(ge+be)/2,zo=Math.max(Pe*1.1,be),we=8,Ko=700,Q=2,Xo=Z,_t=.85,Yo=Z,Je=64,Ge=.55*ge,yi=700,Uo=2500,Bt=-11.5,et=.58,$o=320,qo=650,Zo=420,Qo=1,Ft=1,jo=2,gi=16,He=12,Jo=[.85,.72,.62],Ot=15,Dt=12,es=.01,ts=10,is=6,os=12,ss=8,ns=8,rs=.6,as=.6,ls=[0,18,-18,36,-36,54,-54],Ne="600",Gt="500",ce=640,cs="700",tt=.02,ds=14,hs=.34,us=.92,bi=7,ps=3,fs=6;function Si(i){return Math.min(1,Math.max(He/gi,i/900))}function Ht(i,e){return Math.max(He,i*Si(e))}var ms=.1;var Yr="#e5e7eb",Ur="#c7cbd1",$r="#595f69",qr="#d1d5db",Zr="#b8bdc4",Qr="#273142",jr="#526078",Jr="#f1f5f9",ea="#374151",ta="#64748b",ia="#111827",Nt="#6b7280",it="#374151";var ys="#4b5563",gs=.4,xe=.16,bs="rgba(244,246,248,0.06)",Wt=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function ae(i){return U(i)?{sectionFill:Yr,sectionStroke:Ur,sectionInk:$r,focalFill:qr,focalStroke:Zr}:{sectionFill:Qr,sectionStroke:jr,sectionInk:Jr,focalFill:ea,focalStroke:ta}}function vi(i,e){let t=i.sectionFill,o=yo(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 Ss=.28,vs=.32,oa=.55,sa=.7;function ws(i,e,t){let o=ae(i),s=vi(o,e);if(!t||e==="sold-out"||e==="closed")return{fill:s,stroke:o.sectionStroke};let n=U(i);return{fill:pe(s,t,n?vs:Ss),stroke:B(t,n?sa:oa)}}var na=.03;function ks(i,e){let t=ae(i);return!["normal","nearly-gone","sold-out","closed"].map(s=>vi(t,s).toLowerCase()).includes(e.trim().toLowerCase())&&wi(i,e)}function wi(i,e){let t=di(e);if(!t)return!1;let o=ae(i),s=Math.max(Ss,vs)+na;return["normal","nearly-gone","sold-out","closed"].some(n=>{let r=di(vi(o,n));return r?Math.max(Math.abs(r[0]-t[0]),Math.abs(r[1]-t[1]),Math.abs(r[2]-t[2]))/255<=s:!1})}var ra="#f8fafc",aa="#f4f6fb",la="#111827",ca=.72;function Ls(i){let e=U(i),t=e?ra:ia,o=e?la:aa,s=pe(o,t,1-ca);return{plate:t,ink:o,subInk:fo(s,t)>=mo?s:o}}function Ts(i){return i?.35:.3}function Cs(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 ki(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 Is;function xs(i){Is=i}function da(i){return typeof i=="number"?i:i instanceof Date?i.getTime():Date.parse(i)}var Ps=new Map;function ha(i,e){let t=i??Is,o=`${t??""}|${JSON.stringify(e)}`,s=Ps.get(o);return s||(s=new Intl.DateTimeFormat(t,e),Ps.set(o,s)),s}var ua={dateStyle:"medium",timeStyle:"short"};function Ms(i,e={}){let{locale:t,...o}=e,s=da(i);if(!Number.isFinite(s))return"";let n=Object.keys(o).length?o:ua;return ha(t,n).format(s)}var fd="USD",md=["USD","EUR","GBP","CAD","AUD","INR","AED","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL"],Es;function As(i){Es=i}var Rs=new Map;function Vt(i,e,t,o){let s=o??Es,n=`${s??""}|${i}|${e??"auto"}|${t??"auto"}`,r=Rs.get(n);return r||(r=new Intl.NumberFormat(s,{style:"currency",currency:i,minimumFractionDigits:e,maximumFractionDigits:t}),Rs.set(n,r)),r}function ot(i,e="USD",t,o){if(typeof t=="object"){let n=t;try{return Vt(e,n.minimumFractionDigits,n.maximumFractionDigits,n.locale).format(i)}catch(r){if(n.fallback)return n.fallback(i,e);throw r}}let s=t??(Number.isInteger(i)?0:void 0);return Vt(e,s,s,o).format(i)}function pa(i="USD"){try{return Vt(i,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function fa(i,e="USD"){return i/10**pa(e)}function yd(i,e="USD",t){return ot(fa(i,e),e,void 0,t)}function gd(i="USD"){return Vt(i,0,0).formatToParts(0).find(t=>t.type==="currency")?.value??i}var st={"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":"Overview","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.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 ma=["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"],Ld={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"},_s=["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"],ya=new Set(["ar","fa","he"]),Li={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"},Ti=new Map(ma.map(i=>[i.toLowerCase(),i]));function ga(i){let e=i.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let t=Ti.get(e)??Li[e];if(t)return t;let o=e.split("-");if(o.length>=2){let s=`${o[0]}-${o[1]}`,n=Ti.get(s)??Li[s];if(n)return n}return Ti.get(o[0])??Li[o[0]]}var Me={en:st},zt={},le="en";function Bs(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 s=ga(o);if(s)return s}return"en"}function Td(){return le}function Cd(i=le){return ya.has(i)?"rtl":"ltr"}function Pd(i){return!!Me[i]}function We(i,e){e&&(Me[i]={...Me[i],...e}),le=Me[i]?i:"en",As(le),xs(le),typeof document<"u"&&(document.documentElement.lang=le)}function Id(i){zt=i}var Fs=/\{(\w+)\}/g;function Y(i,e){let t=zt[i]??Me[le]?.[i]??st[i]??i;return e?t.replace(Fs,(o,s)=>String(e[s]??`{${s}}`)):t}function xd(i,e,t){let o=new Intl.PluralRules(le).select(e);return(zt[`${i}.${o}`]??Me[le]?.[`${i}.${o}`]??st[`${i}.${o}`]??zt[`${i}.other`]??Me[le]?.[`${i}.other`]??st[`${i}.other`]??i).replace(Fs,(r,a)=>String({count:e,...t}[a]??`{${a}}`))}function Md(i,e){return Ms(i,{...e??{dateStyle:"medium",timeStyle:"short"},locale:le})}function Ds(i,e,t,o=!1){let s=i.displayLabel?.trim()||i.label;return o?{title:s,detail:Y("map.statusTaken"),sellable:!1}:e==="booked"?{title:s,detail:Y("map.statusTaken"),sellable:!1}:e==="held"?{title:s,detail:Y("map.statusHeld"),sellable:!1}:{title:s,detail:t()??"",sellable:!0}}var Ve=32,Os=70;function Gs(i,e){let t=Ve+6,o=i.y-Os;return{x:Math.min(Math.max(i.x,t),Math.max(t,e.width-t)),y:o>=t?o:Math.min(i.y+Os,e.height-t)}}var wa=220,ka=.08,Kt=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.host=e}syncMarker(e,t,o){let s=o.get(e);if(o.delete(e),!t){this.retire(s);return}s?.destroy();let n=this.host,r=n.seat(e);if(!r)return;let a=n.seatShape(e)?.fill(),l=X(typeof a=="string"?a:"",n.selectionColor(),It),c=n.selectionFocusId()===e,d=n.boothDims(r.rowId),h=n.seatRadius(),p=n.seatPoint(r),m=new Ci({name:"selection-ring",x:p.x,y:p.y,rotation:d?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:n.selectionFocusId()&&!c?.2:1});if(n.viewMode()==="perspective"){let f=n.perspectiveSeatScale(e);m.scale({x:f,y:f})}m.setAttrs({seatId:e,ringColor:l});let y={name:"selection-halo",stroke:B(n.categoryColor(r.categoryKey),Ts(U(n.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d){let f=h*1.2;m.add(new Ii({...y,width:d.width+f*2,height:d.height+f*2,offsetX:(d.width+f*2)/2,offsetY:(d.height+f*2)/2,cornerRadius:8,strokeWidth:Math.max(2,h*.5)}))}else m.add(new Re({...y,radius:h*1.6,strokeWidth:Math.max(2,h*.55)}));let u={stroke:l,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(d)if(m.add(new Ii({...u,width:d.width,height:d.height,offsetX:d.width/2,offsetY:d.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)m.add(new Ii({...u,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 f=Math.max(0,d.width/2-14),b=-Math.max(0,d.height/2-14);m.add(new Re({x:f,y:b,radius:10,fill:l,listening:!1})),m.add(new Pi({x:f,y:b,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:U(l)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else m.add(new Re({...u,radius:Math.max(1,h-1.25),strokeWidth:Math.min(2.5,Math.max(1.8,h*.22))})),c?m.add(new Re({...u,radius:h+2,strokeWidth:2,opacity:.55})):m.add(new Pi({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(),s=n=>{if(t.isDestroyed()||!e.getLayer()){e.destroy();return}let r=Math.min(1,(n-o)/160);e.opacity(1-r),t.overlayLayer.batchDraw(),r<1?requestAnimationFrame(s):(e.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(s)}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 s=t.seatRadius(),n=t.seatPoint(o);this.pulses.get(e)?.destroy();let r=new Re({name:"selection-pulse",x:n.x,y:n.y,radius:s,stroke:t.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,s*.24),opacity:ki(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,r),this.pulseHome().add(r);let a=t.isCached()?void 0:t.seatShape(e),l=performance.now(),c=()=>{a?.scale({x:1,y:1}),r.destroy(),this.pulses.get(e)===r&&this.pulses.delete(e),t.overlayLayer.batchDraw(),a&&!t.isCached()&&t.seatLayer.batchDraw()},d=h=>{if(t.isDestroyed()){c();return}r.getLayer()||this.pulseHome().add(r);let p=h-l,m=ki(p/420);if(r.radius(s*m.radiusScale),r.opacity(m.opacity),a){let y=Cs(p/320);a.scale({x:y,y})}t.overlayLayer.batchDraw(),a&&!t.isCached()&&t.seatLayer.batchDraw(),p<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 s=performance.now(),n=()=>{o.scale({x:1,y:1}),t.seatLayer.batchDraw()},r=a=>{if(t.isDestroyed()||t.isCached()||!o.getLayer()){n();return}let l=a-s,c=Math.min(1,l/wa),d=1+ka*Math.sin(Math.PI*c);o.scale({x:d,y:d}),t.seatLayer.batchDraw(),c<1?requestAnimationFrame(r):n()};requestAnimationFrame(r)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Ci({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,Ie),s=o?t.seat(o):void 0;if(!s){this.hideLoupe();return}let n=Ds(s,t.seatStatus(s.id),()=>t.priceLabel(s),t.seatClosed(s.id)),r=Gs(e,{width:t.stage.width(),height:t.stage.height()}),a=1/(t.stage.scaleX()||1),l=this.loupe??this.buildLoupe();l.seatId=s.id,l.group.position(t.screenToWorld(r)),l.group.scale({x:a,y:a}),l.group.opacity(n.sellable?1:.75),l.group.visible(!0),l.disc.fill(t.categoryColor(s.categoryKey)),l.title.text(n.title),l.title.offsetX(l.title.width()/2),l.detail.text(n.detail),l.detail.offsetX(l.detail.width()/2),t.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,t=e.canvasBackground(),o=X(t,ae(t).sectionInk),s=new Ci({name:"touch-loupe",listening:!1,visible:!1});s.add(new Pi({points:[-7,Ve-4,0,Ve+12,7,Ve-4],closed:!0,fill:t,stroke:B(o,.25),strokeWidth:1,listening:!1})),s.add(new Re({radius:Ve,fill:t,stroke:B(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let n=new Re({y:-15,radius:6,fill:"#6e7bff",listening:!1}),r=new Ns({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),a=new Ns({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:B(o,.72),listening:!1,perfectDrawEnabled:!1});return s.add(n),s.add(r),s.add(a),e.overlayLayer.add(s),s.moveToTop(),this.loupe={group:s,title:r,detail:a,disc:n,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}};function Ws(i,e){let t=i.width(),o=i.height(),s=1/0,n=1/0,r=-1/0,a=-1/0;for(let l of e){let c=l.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<s&&(s=c.x),c.y<n&&(n=c.y),c.x+c.width>r&&(r=c.x+c.width),c.y+c.height>a&&(a=c.y+c.height)}}return isFinite(s)?{x:s,y:n,width:r-s,height:a-n}:null}var Vs=8,La=.5;function Ks(i,e){let t=Ws(i,e);if(!t)return 0;zs(i,t);let o=Math.min((i.width()-2*Vs)/t.width,(i.height()-2*Vs)/t.height);if(!(Math.max(t.width-i.width(),t.height-i.height())>La)||!(o>0))return 1;let n=i.width()/2,r=i.height()/2;i.scale({x:i.scaleX()*o,y:i.scaleY()*o}),i.position({x:n+(i.x()-n)*o,y:r+(i.y()-r)*o});let a=Ws(i,e);return a&&zs(i,a),o}function zs(i,e){let t=i.width()/2-(e.x+e.width/2),o=i.height()/2-(e.y+e.height/2);return t===0&&o===0?!1:(i.position({x:i.x()+t,y:i.y()+o}),!0)}function xi(i){return`${i.x()},${i.y()},${i.scaleX()}`}import{Group as Ta}from"konva/lib/Group";import{Circle as Xs}from"konva/lib/shapes/Circle";import{Line as Ca}from"konva/lib/shapes/Line";import{Text as Pa}from"konva/lib/shapes/Text";var Ia=6;function xa(i){return U(i)?"#0b1220":"#ffffff"}function Ys(i){let{points:e}=i;if(!e.length)return null;let t=i.categoryColor??"#6e7bff",o=0,s=0;for(let n of e)o+=n.x,s+=n.y;return{count:e.length,centroid:{x:o/e.length,y:s/e.length},fill:t,ink:xa(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=Ys({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 Ta({listening:!1,name:"owned-sections"}),s=new Set;for(let n of this.host.sections()){let r=this.host.ownedPoints(n),a=Ys({points:r,categoryColor:this.host.sectionColor(n)});if(!a)continue;let l=Math.max(Ia/2/t,1);for(let y of r)o.add(new Xs({name:"owned-seat-dot",x:y.x,y:y.y,radius:l,fill:a.fill,stroke:B("#ffffff",.55),strokeWidth:Math.max(.5,l*.28),shadowColor:a.fill,shadowBlur:l*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(s.has(n.logicalId))continue;s.add(n.logicalId);let c=this.host.sections().filter(y=>y.logicalId===n.logicalId).reduce((y,u)=>y+this.host.ownedPoints(u).length,0),d=this.host.labelAnchor(n),h=11/t,p={x:d.x,y:d.y-h*2.1};o.add(new Xs({name:"owned-section-badge",x:p.x,y:p.y,radius:h,fill:a.fill,stroke:B(a.ink,.35),strokeWidth:1/t,listening:!1,perfectDrawEnabled:!1})),o.add(new Ca({x:p.x-h*.62,y:p.y,points:[-h*.22,0,-h*.02,h*.2,h*.34,-h*.26],stroke:a.ink,strokeWidth:Math.max(.6,h*.16),lineCap:"round",lineJoin:"round",listening:!1}));let m=new Pa({x:p.x+h*.12,y:p.y-h*.5,text:String(c),fontSize:h,fontStyle:"800",fontFamily:this.host.labelFont(),fill:a.ink,listening:!1,perfectDrawEnabled:!1});o.add(m),this.badges.push({id:n.logicalId,centre:p,radius:h*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};function N(i){let e=So(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 s=o*Math.PI/180,n=Math.cos(s),r=Math.sin(s);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(a=>({x:i.x+a.x*n-a.y*r,y:i.y+a.x*r+a.y*n}))}function Yt(i,e,t,o,s,n){let r=o*Math.PI/180,a=Math.cos(r),l=Math.sin(r);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){let h=e*(d/6-.5),p=t*(c/4-.5),m={x:i.x+h*a-p*l,y:i.y+h*l+p*a};if(!ie(m,s,n))return!1}return!0}function Us(i,e,t){let o=N(i),s=[t];for(let r=1;r<12;r+=1)for(let a=1;a<12;a+=1){let l={x:o.x+o.width*a/12,y:o.y+o.height*r/12};ie(l,i,e)&&s.push(l)}let n=[i,...e];return s.map(r=>({point:r,room:to(r,n)})).sort((r,a)=>a.room-r.room).map(r=>r.point).filter((r,a,l)=>a===l.findIndex(c=>Math.abs(c.x-r.x)<1e-6&&Math.abs(c.y-r.y)<1e-6))}function $s(i,e){let{stageScale:t,stageX:o,stageY:s}=i;if(i.viewMode==="perspective"&&e.perspectiveAffine)return N(e.outline.map(r=>{let a=i.projectedSectionPoint(e,r);return{x:a.x*t+o,y:a.y*t+s}}));let n=e.liftWorld>0?i.isoLiftLocal(e.liftWorld):{x:0,y:0};return N(e.outline.map(r=>{let a={x:r.x+n.x,y:r.y+n.y},l=i.isoT===0?a:i.isoForward(a);return{x:l.x*t+o,y:l.y*t+s}}))}function Ma(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)),s=Math.max(0,Math.min(i.y+i.height,e.height)-Math.max(i.y,0));return o*s/t}function qs(i){let{current:e,viewport:t}=i,o=new Map;for(let a of i.sections){let l=Ma(a.bounds,t)*a.members;l<=0||o.set(a.logicalId,(o.get(a.logicalId)??0)+l)}if(!o.size)return e;let s=null,n=0;for(let[a,l]of o)l>n&&(n=l,s=a);if(!s||s===e)return e;let r=e!=null?o.get(e)??0:0;return n>r*1.35?s:e}import{Text as Ea}from"konva/lib/shapes/Text";function Ra(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 s of this.keys(e))for(let n of this.cells.get(s)??[])t.has(n)||(t.add(n),Ra(e,n)&&o++);return o}keys(e){let t=Math.floor(e.x/Je),o=Math.floor((e.x+Math.max(0,e.width))/Je),s=Math.floor(e.y/Je),n=Math.floor((e.y+Math.max(0,e.height))/Je),r=[];for(let a=s;a<=n;a++)for(let l=t;l<=o;l++)r.push(`${l}:${a}`);return r}};function Zs(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(b=>i.projectedSectionPoint(y,b)));let u=y.liftWorld>0?i.isoLiftLocal(y.liftWorld):{x:0,y:0},f=y.outline.map(b=>{let g={x:b.x+u.x,y:b.y+u.y};return i.isoT===0?g:i.isoForward(g)});return N(f)});if(!o.length)return null;let s=Math.min(...o.map(y=>y.x)),n=Math.min(...o.map(y=>y.y)),r=Math.max(...o.map(y=>y.x+y.width)),a=Math.max(...o.map(y=>y.y+y.height)),l=new Set(t.flatMap(y=>y.memberIds));for(let y of l){let u=i.seatById.get(y);if(!u)continue;let f=i.renderedSeatPoint(u);s=Math.min(s,f.x-i.seatR),n=Math.min(n,f.y-i.seatR),r=Math.max(r,f.x+i.seatR),a=Math.max(a,f.y+i.seatR)}let c=y=>{[y.x,y.y,y.width,y.height].every(Number.isFinite)&&(s=Math.min(s,y.x),n=Math.min(n,y.y),r=Math.max(r,y.x+y.width),a=Math.max(a,y.y+y.height))},d=y=>{let u={x:y.x+y.width/2,y:y.y+y.height/2};return t.some(f=>ie(u,f.outline,f.holes))};for(let{node:y,backdrop:u}of i.freeTextById.values()){let f=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});d(f)&&(c(f),u&&c(u.getClientRect({relativeTo:i.bgLayer,skipShadow:!0})))}for(let{node:y}of i.iconNodeById.values()){let u=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});d(u)&&c(u)}let h=new Ke;for(let{node:y}of i.freeTextById.values()){let u=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});h.insert({x:u.x-Q,y:u.y-Q,width:u.width+Q*2,height:u.height+Q*2})}for(let y of i.rowLabelPlan){let u=(y.focusKeys??[]).some(S=>S===e||t.some(v=>S===v.id||S===v.logicalId)),f=new Ea({text:y.text,fontSize:y.fontSize,fontStyle:"700",fontFamily:i.labelFont(),rotation:y.rotation,listening:!1});f.offsetX(f.width()/2),f.offsetY(f.height()/2);let b=i.resolveAutomaticRowLabelPosition(f,y,h),g=i.rowLabelBox(f,b);u&&c(g),h.insert(g),f.destroy()}let p=Math.max(r-s,a-n),m=Math.max(i.seatR*2,Math.min(24,p*.025));return{x:s-m,y:n-m,width:Math.max(1,r-s+m*2),height:Math.max(1,a-n+m*2)}}import{Rect as Aa}from"konva/lib/shapes/Rect";import{Text as Qs}from"konva/lib/shapes/Text";function js(i,e){if(!e.zones?.length||!i.sections.length)return;let t=Ls(i.canvasBackground),o=new Map;for(let s of i.sections)s.zone&&(o.get(s.zone)??o.set(s.zone,[]).get(s.zone)).push(s);for(let s of e.zones){let n=o.get(s.id);if(!n||!n.length)continue;let r=n[0];for(let m of n)m.centroid.y<r.centroid.y&&(r=m);let a=r.centroid.x,l=r.centroid.y,c=1/0;for(let m of n)for(let y of m.memberIds){let u=i.seatById.get(y),f=u&&i.catPrice.get(u.categoryKey);typeof f=="number"&&f<c&&(c=f)}let d=new Aa({x:a,y:l,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:t.plate,stroke:B(s.color??r.outlineTint,rs),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(d);let h=new Qs({x:a,y:l,text:s.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 p=null;isFinite(c)&&(p=new Qs({x:a,y:l,text:Y("map.fromPrice",{price:ot(c,i.currency)}),fontSize:Dt,fontStyle:Gt,fontFamily:i.labelFont(),fill:t.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),p.offsetX(p.width()/2),i.bgLayer.add(p)),i.zones.push({id:s.id,anchor:{x:a,y:l},back:d,background:t.plate,name:s.label.toUpperCase(),label:h,sub:p})}}import{Circle as Ha}from"konva/lib/shapes/Circle";import{Line as Na}from"konva/lib/shapes/Line";import{Rect as Wa}from"konva/lib/shapes/Rect";import{Text as Va}from"konva/lib/shapes/Text";function Ee(i,e){return e.length===0?!!i.accessible:!!i.accessibility?.some(t=>e.includes(t))}function Mi(i,e){return Ee(i,e)?"match":i.accessibility?.includes("companion")?"companion":"other"}var Js=.35,en=.7,nt="#0b1220",rt="#ffffff",tn="#0b1220",on="#232c40",sn="#8b93a7";function nn(i,e,t="normal"){let o=i?"bold":t;return e?`italic ${o}`.trim():o}var Ri="#f7f8fb";import{Shape as Ba}from"konva/lib/Shape";import{Circle as Fa}from"konva/lib/shapes/Circle";import{Rect as Oa}from"konva/lib/shapes/Rect";var _a={M:2,L:2,Q:4,C:6,Z:0},Ei=new Map;function Ai(i){let e=Ei.get(i);if(e)return e;let t=Mt(i);if(!t)return Ei.set(i,[]),[];let o=t.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],s=[],n=0;for(;n<o.length;){let r=o[n++],a=_a[r];if(a===void 0||n+a>o.length)throw new Error(`Invalid path data for seat glyph "${i}".`);let l=o.slice(n,n+a).map(Number);if(l.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${i}".`);n+=a,r==="M"||r==="L"?s.push({command:r,points:l}):r==="Q"?s.push({command:r,points:l}):r==="C"?s.push({command:r,points:l}):s.push({command:"Z",points:[]})}return Ei.set(i,s),s}function rn(i,e,t,o=0,s=0){let n=Ai(e),r=vo(e).bounds;if(!n.length||!r||!(t>0))return!1;let a=wo(r,t);i.save(),i.translate(o,s),i.scale(a.scale,a.scale),i.translate(-a.centreX,-a.centreY);for(let l of n)l.command==="M"?i.moveTo(l.points[0],l.points[1]):l.command==="L"?i.lineTo(l.points[0],l.points[1]):l.command==="Q"?i.quadraticCurveTo(l.points[0],l.points[1],l.points[2],l.points[3]):l.command==="C"?i.bezierCurveTo(l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]):i.closePath();return i.restore(),!0}function an(i,e){i.beginPath(),i.arc(0,0,e,0,Math.PI*2,!1),i.closePath()}var at=class extends Ba{_sceneFunc(e){let t=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,s=Ai(o),n=this.attrs.seatGlyphDetail,r;if(n===void 0){let a=this.getAbsoluteScale(),l=Math.max(Math.abs(a.x),Math.abs(a.y)),c=Number.isFinite(l)&&l>0?l:1;r=t*2*c>=16}else r=n;if(!s.length||!r){an(e,t),e.fillStrokeShape(this);return}e.beginPath(),rn(e,o,t),e.fillStrokeShape(this)}_hitFunc(e){an(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 Da(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 ln(i){let{x:e,y:t,radius:o}=i;return i.wheelchairBay?new Oa({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}):Da(i.glyph,{x:e,y:t,radius:o,detail:i.detail,fill:i.fill})??new Fa({x:e,y:t,radius:o,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Ga(i,e){return i*2*e>=16}function cn(i,e,t,o){let s=Ga(e,t);if(s===o||!i.length)return s;for(let n of i)n.setAttr("seatGlyphDetail",s);return s}function dn(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"){za(i,t);continue}let o=i.seatContainer(t.id),s=ln({x:t.x,y:t.y,radius:i.seatR,detail:i.seatGlyphDetail,glyph:ko(t.glyph,i.catByKey.get(t.categoryKey)),wheelchairBay:t.wheelchairSpaceType==="no-seat"});if(s instanceof at&&i.glyphMarkers.push(s),s.setAttr("seatId",t.id),i.circleById.set(t.id,s),i.paintSeat(s,t.id),o.add(s),t.accessible){if(t.wheelchairSpaceType!=="no-seat"){let n=new Ha({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,n),o.add(n)}if(t.accessibility?.includes("wheelchair")&&Ct(t.accessibility)){let n=i.buildAccessGlyph(t,typeof s.fill()=="string"?s.fill():"");i.accessGlyphById.set(t.id,n),o.add(n)}}}}function za(i,e){let t=i.seatContainer(e.id),o=i.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},s=e.x,n=e.y,r;o.points&&o.points.length>=3?(r=new Na({x:e.x,y:e.y,points:o.points.flatMap(l=>[l.x,l.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s=e.x+o.points.reduce((l,c)=>l+c.x,0)/o.points.length,n=e.y+o.points.reduce((l,c)=>l+c.y,0)/o.points.length):r=new Wa({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}),r.setAttr("seatId",e.id),i.circleById.set(e.id,r),t.add(r);let a=new Va({x:s,y:n,text:e.displayLabel??e.label,fontSize:Te,fontStyle:"600",fontFamily:i.labelFont(),fill:i.theme.seatLabelColor??nt,listening:!1,perfectDrawEnabled:!1});a.offsetX(a.width()/2),a.offsetY(a.height()/2),a.visible(!1),i.setHasBoothText(),i.boothLabelById.set(e.id,a),t.add(a),i.paintSeat(r,e.id)}function hn(i,e,t,o){let s=null,n=1/0,r=i.stage.scaleX()||1;for(let a of i.seats){if(!o?.includeUnavailable&&!i.selection.has(a.id)&&!i.isSelectable(a.id))continue;let l=i.worldToScreen(a),c=i.viewMode==="perspective"?i.perspectiveSeatScale.get(a.id)??1:1,d=i.seatR*r*c+t,h=Math.hypot(l.x-e.x,l.y-e.y);h<=d&&h<n&&(n=h,s=a.id)}return s}function un(i){if(!i.objectFloor.size)return null;let e=i.stage.getPointerPosition();if(!e)return null;let t=i.screenToWorld(e),o=null,s=1/0;for(let n of i.seats){let r=i.renderedSeatPoint(n),a=r.x-t.x,l=r.y-t.y,c=a*a+l*l;c<s&&(s=c,o=n.rowId)}return o?i.objectFloor.get(o)??null:null}import{Circle as Ka}from"konva/lib/shapes/Circle";import{Line as Xa}from"konva/lib/shapes/Line";function pn(i,e,t,o){let s=i.seatRadius(),n=new Ka({x:t.x,y:t.y,radius:s,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),r=i.viewMode()==="perspective"?i.perspectiveSeatScale(e):1;n.scale({x:r,y:r}),i.overlayLayer.add(n);let a=performance.now(),l=620,c=d=>{if(!n.getLayer())return;let h=Math.min(1,(d-a)/l);n.radius(s*(1+h*1.8)),n.opacity(.9*(1-h)),i.overlayLayer.batchDraw(),h<1?requestAnimationFrame(c):(n.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(c)}function fn(i,e,t){for(let o of e){let s=i.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(h=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,h))):o.outline.map(h=>{let p=o.liftWorld>0?i.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:h.x+p.x,y:h.y+p.y}}),n=s.reduce((h,p)=>({x:h.x+p.x,y:h.y+p.y}),{x:0,y:0});n.x/=s.length,n.y/=s.length;let r=new Xa({x:n.x,y:n.y,points:s.flatMap(h=>[h.x-n.x,h.y-n.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(r),i.overlayLayer.batchDraw();let a=()=>{r.getLayer()&&(r.destroy(),i.overlayLayer.batchDraw())};if(i.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(a,520);continue}let l=performance.now(),c=820,d=h=>{if(i.isDestroyed()||!r.getLayer())return;let p=Math.min(1,(h-l)/c),y=1+(1-Math.pow(1-p,3))*.04;r.scale({x:y,y}),r.opacity(.92*(1-p)),i.overlayLayer.batchDraw(),p<1?requestAnimationFrame(d):a()};requestAnimationFrame(d)}}import{Group as qa}from"konva/lib/Group";import{Shape as Za}from"konva/lib/Shape";import{Group as Ya}from"konva/lib/Group";import{Shape as Ua}from"konva/lib/Shape";function $a(i,e,t){let o=e.length,s={x:(e[o-1].x+e[0].x)/2,y:(e[o-1].y+e[0].y)/2};i.moveTo(s.x,s.y);for(let n=0;n<o;n+=1){let r=e[n],a=e[(n+1)%o],l=e[(n-1+o)%o],c=Math.min(Math.hypot(r.x-l.x,r.y-l.y)/2,Math.hypot(a.x-r.x,a.y-r.y)/2);i.arcTo(r.x,r.y,a.x,a.y,Math.max(0,Math.min(t,c)))}i.closePath()}function Ae(i,e,t,o){let s=Ze(i)>0,n=t.cornerRadius&&t.cornerRadius>0?t.cornerRadius:0;return new Ua({...t,sceneFunc(r,a){r.beginPath();let l=d=>{if(d.length){if(n>0&&d.length>=3)return $a(r,d,n);r.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h+=1)r.lineTo(d[h].x,d[h].y);r.closePath()}};o?(d=>{r.moveTo(d.start.x,d.start.y);let h=d.start;for(let p of d.segments)p.kind==="line"?r.lineTo(p.end.x,p.end.y):p.kind==="arc"?r.arc(p.center.x,p.center.y,p.radius,Math.atan2(h.y-p.center.y,h.x-p.center.x),Math.atan2(p.end.y-p.center.y,p.end.x-p.center.x),!p.clockwise):r.bezierCurveTo(p.control1.x,p.control1.y,p.control2.x,p.control2.y,p.end.x,p.end.y),h=p.end;r.closePath()})(o):l(i);for(let d of e??[]){let h=Ze(d)>0;l(h===s?[...d].reverse():d)}r.fillStrokeShape(a)},perfectDrawEnabled:!1})}var lt=class extends Ya{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 mn(i,e){if(!e.length)return null;let t=new qa({listening:!1});for(let o of e){let s=i.viewMode==="perspective"&&o.perspectiveAffine,n=s?o.outline.map(a=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,a))):o.outline,r=s?o.holes.map(a=>a.map(l=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,l)))):o.holes;t.add(Ae(n,r,{fill:bs,stroke:B("#ffffff",.1),strokeWidth:1,listening:!1},s?void 0:o.outlinePath))}return i.bgLayer.add(t),t.moveToTop(),t}function yn(i,e){let{bounds:t}=i,s=Math.max(t.width,t.height,1)*4+1e3,n=[{x:t.x-s,y:t.y-s},{x:t.x+t.width+s,y:t.y-s},{x:t.x+t.width+s,y:t.y+t.height+s},{x:t.x-s,y:t.y+t.height+s}],r=new Za({fill:i.canvasBackground,opacity:1-xe,listening:!1,perfectDrawEnabled:!1,sceneFunc:(a,l)=>{let c=d=>{if(d.length){a.moveTo(d[0].x,d[0].y);for(let h=1;h<d.length;h++)a.lineTo(d[h].x,d[h].y);a.closePath()}};a.beginPath(),c(n);for(let d of e){let h=i.viewMode==="perspective"&&d.perspectiveAffine?d.outline.map(p=>i.perspectiveLocalPoint(i.projectedSectionPoint(d,p))):d.outline.map(p=>{let m=d.liftWorld>0?i.isoLiftLocal(d.liftWorld):{x:0,y:0};return{x:p.x+m.x,y:p.y+m.y}});c(Ze(h)>0?[...h].reverse():h)}a.fillStrokeShape(l)}});return i.overlayLayer.add(r),r.moveToTop(),r}import{Rect as Lr}from"konva/lib/shapes/Rect";import{Line as Ul}from"konva/lib/shapes/Line";import{Text as zi}from"konva/lib/shapes/Text";import{Path as $l}from"konva/lib/shapes/Path";var Ut=1.12;function _i(i){return{x:i.width()/2,y:i.height()/2}}function gn(i,e,t){if(e.width<=0||e.height<=0)return i.scaleX();let o=Math.min(i.width()/(e.width*Ut),i.height()/(e.height*Ut));return G(o,t.min,t.max)}function bn(i,e,t,o){let s=G(e,o.min,o.max),n=i.scaleX();if(s===n)return!1;let r=(t.x-i.x())/n,a=(t.y-i.y())/n;return i.scale({x:s,y:s}),i.position({x:t.x-r*s,y:t.y-a*s}),!0}function Sn(i,e,t,o){let s=Math.min(i.width()/(e.width*Ut),i.height()/(e.height*Ut)),n=G(Math.max(s,o??t.min),t.min,t.max);i.scale({x:n,y:n}),i.position({x:i.width()/2-(e.x+e.width/2)*n,y:i.height()/2-(e.y+e.height/2)*n})}function vn(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?Zo:qo}function wn(i){return Math.max(i*1.05,zo,ne*1.3)}function kn(i,e){let t=1/0,o=-1/0,s=1/0,n=-1/0;for(let r of i)t=Math.min(t,r.x),o=Math.max(o,r.x),s=Math.min(s,r.y),n=Math.max(n,r.y);return t-=e,o+=e,s-=e,n+=e,{x:t,y:s,width:Math.max(40,o-t),height:Math.max(40,n-s)}}function Ln(i){let{stageWidth:e,stageHeight:t,fullBounds:o,visibleBounds:s,seatPoints:n,minScale:r}=i;if(!n.length)return null;let a=1.12;if(Math.min(e/(o.width*a),t/(o.height*a))>=r)return null;let c=i.tapAnchor??{x:s.x+s.width/2,y:s.y+s.height/2},d=n[0],h=1/0;for(let y of n){let u=(y.x-c.x)**2+(y.y-c.y)**2;u<h&&(d=y,h=u)}let p=e/(r*a),m=t/(r*a);return{bounds:{x:d.x-p/2,y:d.y-m/2,width:p,height:m},minScale:r}}var xn=.5,H=Math.SQRT1_2,Qa="#f3f4f6",Tn=4;function ja(i){let e=i.fraction;return typeof e!="number"||!Number.isFinite(e)?xn:Math.min(1,Math.max(0,e))}function Ja(i){return i==="booked"||i==="not_for_sale"?it:Nt}function Cn(i,e){return Number.parseInt(i.slice(e,e+2),16)}function Pn(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,s]=e.toLowerCase();return`#${t}${t}${o}${o}${s}${s}`}function el(i,e,t){let o=Pn(i),s=Pn(e);if(!o||!s)return i;let n=Math.min(1,Math.max(0,t)),r="#";for(let a=1;a<7;a+=2){let l=Math.round(Cn(o,a)*(1-n)+Cn(s,a)*n);r+=l.toString(16).padStart(2,"0")}return r}function In(i,e,t,o){let s=t*4,n=e*H,r=-e*H,a=o*H*2*s,l=o*-H*2*s,c=n+s*H,d=r+s*H,h=n-s*H,p=r-s*H;i.beginPath(),i.moveTo(c,d),i.lineTo(h,p),i.lineTo(h+a,p+l),i.lineTo(c+a,d+l),i.closePath(),i.clip()}function tl(i,e){let t=e*4,o=Math.max(e*.45,1);i.beginPath();for(let s=-Tn;s<=Tn;s++){let n=s*o*2,r=n+o,a=n*H,l=-n*H,c=r*H,d=-r*H;i.moveTo(a+t*H,l+t*H),i.lineTo(a-t*H,l-t*H),i.lineTo(c-t*H,d-t*H),i.lineTo(c+t*H,d+t*H),i.closePath()}i.clip()}function $t(i,e){i._sceneFunc(e)}function Mn(i){let e=this,t=e.attrs,o=t.markRadius||1,s=t.fill,n=e.getStage(),r=Math.abs((n?n.scaleX():1)*(e.scaleX()||1))||1;if(o*2*r<16){t.fill=t.markMidtone??s,$t(e,i),t.fill=s;return}let l=(1-2*(t.markFraction??xn))*o;i.save(),In(i,l,o,1),t.fill=t.markBase??s,$t(e,i),i.restore(),i.save(),In(i,l,o,-1),t.fill=t.markFill??s,$t(e,i),t.markHatch&&(tl(i,o),t.fill=Qa,$t(e,i)),i.restore(),t.fill=s}function il(i,e,t,o,s,n){let r=ja(e),a=Ja(t),l=i.attrs;l.markFraction=r,l.markBase=o,l.markFill=a,l.markMidtone=el(o,a,1-r),l.markHatch=n,l.markRadius=s>0?s:1,i.fill(l.markMidtone),i.stroke(""),i.strokeWidth(0),i.dash([]),i.opacity(1),i.sceneFunc(Mn)}function ol(i){i.setAttr("sceneFunc",void 0)}function Bi(i){return i.attrs.sceneFunc===Mn}var qt=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[s,n]of Object.entries(e))t.has(s)&&(n&&n.kind==="partial"?(this.marks.set(s,n),o.add(s)):this.marks.delete(s)&&o.add(s));return o}paint(e,t,o,s,n,r,a){let l=a?void 0:this.marks.get(t);if(!l){Bi(e)&&ol(e);return}il(e,l,o,s,n,r)}};function Zt(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 Rn=.85,sl=[2,2],nl=1,En=.6;function rl(i){return U(i)?"#334155":"#e2e8f0"}function An(i,e,t){return i==="held"?{fill:Nt,stroke:rl(e),strokeWidth:nl,dash:[...sl],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:Rn}:{fill:it,stroke:"",strokeWidth:0,dash:[],opacity:i==="booked"?.45:.6,scale:Rn}:null}var Fi=1e6;function al(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}var Qt=class{constructor(e,t=al()){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(Fi+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 s=e.changedTouches.item(o);if(!s)continue;let n=this.toLocal(s.clientX,s.clientY);this.updatePointer(Fi+s.identifier,n)&&(t=n)}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(Fi+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<Ko}toLocal(e,t){let o=this.host.container.getBoundingClientRect();return{x:e-o.left,y:t-o.top}}beginPointer(e,t,o,s){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:s})?(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[n,r]=[...this.pointers.values()],a={x:(n.x+r.x)/2,y:(n.y+r.y)/2},l=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(r.x-n.x,r.y-n.y),startScale:l,worldMid:{x:(a.x-this.host.stage.x())/l,y:(a.y-this.host.stage.y())/l}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=we+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=we+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>we?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[t,o]=[...this.pointers.values()],s=Math.hypot(o.x-t.x,o.y-t.y);if(this.pinch.startDist<1)return;let n={x:(t.x+o.x)/2,y:(t.y+o.y)/2},{min:r,max:a}=this.host.zoomBounds(),l=G(this.pinch.startScale*(s/this.pinch.startDist),r,a);this.host.stage.scale({x:l,y:l}),this.host.stage.position({x:n.x-this.pinch.worldMid.x*l,y:n.y-this.pinch.worldMid.y*l}),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=we)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}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 ll}from"konva/lib/shapes/Circle";import{Group as cl}from"konva/lib/Group";import{Text as dl}from"konva/lib/shapes/Text";var _n=13,hl=15,ul=.3,pl=.08;function Dn(i,e,t){return!!(i&&t!==i||e&&!e.has(t))}function fl(i,e){return!e||i.available==null?`cap ${i.capacity}`:i.available<=0?Y("map.soldOut"):Y("map.seatsLeft",{count:i.available})}function ml(i,e){return e&&i.available!=null&&i.available<=0}function Gn(i){for(let e of i.gaById.values()){let t=i.filteredOut(e.categoryKey),o=i.overviewHidden(e),s=ml(e,i.pickerMode),n=i.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:i.dimmed(e.categoryKey)?Ce*pl:s?Ce*ul:Ce),e.polygon.listening(!i.exportMode&&!o&&!t&&!s),e.polygon.stroke(n>0?i.selectionColor:e.strokeColor),e.polygon.strokeWidth(n>0?3:1.5),yl(i,e,s,n,o,i.dimmed(e.categoryKey))}}function yl(i,e,t,o,s,n){if(e.capacityNode){let r=fl(e,i.pickerMode);e.capacityNode.text()!==r&&(e.capacityNode.text(r),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(t?.75:1)}gl(i,e,s||n),o>0&&!s?Sl(i,e,o):e.chip&&e.chip.visible(!1)}var Oi=9,Bn=.86;function gl(i,e,t){let{labelNode:o,capacityNode:s}=e;if(!o&&!s)return;let n=Math.max(i.effScale(),1e-4);if(t){o?.visible(!1),s?.visible(!1);return}if(!i.pickerMode){o?.visible(i.labelLegible(o.fontSize())),s?.visible(i.labelLegible(s.fontSize()));return}let r=bl(e,n),a=Fn(o,Lt,r.width*Bn,n),l=Fn(s,Tt,r.width*Bn,n),c=a!=null,d=l!=null&&c&&a+l+Oi<=r.height;On(o,c?a:null,e.labelPoint.y-Oi/n,n),On(s,d?l:null,e.labelPoint.y+Oi/n,n)}function bl(i,e){let t=1/0,o=-1/0,s=1/0,n=-1/0;for(let r of i.points)r.x<t&&(t=r.x),r.x>o&&(o=r.x),r.y<s&&(s=r.y),r.y>n&&(n=r.y);return Number.isFinite(t)?{width:(o-t)*e,height:(n-s)*e}:{width:0,height:0}}function Fn(i,e,t,o){if(!i||!i.text())return null;i.fontSize(e/o);let s=i.width()*o;if(s<=t||s<=0)return e;let n=e*(t/s);return n>=Z?n:null}function On(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 Sl(i,e,t){if(!e.chip){let o=new cl({x:e.labelPoint.x,y:e.labelPoint.y-_n-16,listening:!1}),s=new ll({radius:_n,fill:i.selectionColor,listening:!1,perfectDrawEnabled:!1}),n=new dl({text:String(t),fontSize:hl,fontStyle:"800",fontFamily:i.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});o.add(s),o.add(n),i.bgLayer.add(o),e.chip=o,e.chipText=n}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 Hn(i,e){let t=!1;for(let[o,s]of Object.entries(e)){let n=i.get(o);n&&(s.available!==void 0&&n.available!==s.available&&(n.available=s.available,t=!0),s.selected!==void 0&&n.selected!==s.selected&&(n.selected=s.selected,t=!0))}return t}function Nn(i,e){return i===null||e===null?i===e:i.size===e.size&&[...i].every(t=>e.has(t))}function Wn(i,e){let t=null;for(let o of i){let s=e.get(o)?.logicalId;if(!s||t!=null&&t!==s)return null;t=s}return t}function Vn(i,e){if(!e?.size)return!1;for(let t of i)if(e.has(t))return!1;return!0}import{Rect as zn}from"konva/lib/shapes/Rect";import{Text as vl}from"konva/lib/shapes/Text";function Kn(i){let e=i.effScale(),t=i.stage.scaleX(),o={width:i.stage.width(),height:i.stage.height()},s=u=>Math.round(u*100)/100,n=new Map(i.overlayLayer.find(".selection-ring").map(u=>[String(u.getAttr("seatId")??""),String(u.getAttr("ringColor")??i.effSelection)])),r=i.seats.map(u=>{let f=i.circleById.get(u.id),b=i.boothLabelById.get(u.id)??i.seatLabelById.get(u.id),g=i.viewMode==="perspective"?i.perspectiveSeatScale.get(u.id)??1:1,S=(i.viewMode==="perspective"?t:e)*g,v=u.kind==="booth"?Te:fe*i.seatLabelScale(u),w=i.viewMode==="perspective"&&u.kind!=="booth"?e*g:S,k=s((b?.fontSize()??v)*w),T=i.worldToScreen(u),C=b?b.width()*t*g:0,L=b?b.height()*(i.viewMode==="perspective"&&u.kind==="booth"?t:e)*g:0,I=T.x-C/2<0||T.x+C/2>o.width||T.y-L/2<0||T.y+L/2>o.height,x=i.focusedSeatOpacity(u.id,f?.getAbsoluteOpacity()??0),M=i.seatSection.get(u.id),R=!!b?.isVisible()&&x>=.5&&!I,P;R||(x<.5?P="dimmed-or-unavailable":k<Z?P="below-minimum-size":I?P="outside-viewport":b?P="renderer-hidden":P="clutter-or-fit");let A=f instanceof zn?f.width()*t*g:i.seatR*2*S,_=f instanceof zn?f.height()*(i.viewMode==="perspective"?t:e)*g:i.seatR*2*S,j=2*(i.seatR*S+Ie),V=f?.fill(),z=b?.fill(),J=i.accessGlyphById.get(u.id),O=J?.getAbsoluteScale();return{seatId:u.id,label:u.label,kind:u.kind==="booth"?"booth":"seat",markerShape:u.kind==="booth"?"booth":u.wheelchairSpaceType==="no-seat"?"square":"circle",...u.wheelchairSpaceType?{wheelchairSpaceType:u.wheelchairSpaceType}:{},categoryKey:u.categoryKey,...M?{sectionId:M.id}:{},...M?.zone?{zoneId:M.zone}:{},status:i.statusById.get(u.id)??"free",selected:i.selection.has(u.id),visible:R,renderedFontPx:k,fill:typeof V=="string"?V:"",ink:typeof z=="string"?z:f?i.seatLabelInk(u,f):i.seatPreferredLabelInk(u),...n.has(u.id)?{selectionRingColor:n.get(u.id)}:{},opacity:s(x),...J?{accessibilityMarker:{glyphVisible:J.isVisible(),glyphWidthPx:s(ve*Math.abs(O?.x??0)),emphasizedByFilter:i.accessGlyphFilterEmphasized(u.id)}}:{},pointerTarget:{active:!i.cached&&!i.seatViewportCulled(u.id)&&!!f?.isVisible()&&!!f?.isListening()&&i.isSelectable(u.id),directWidthPx:s(A),directHeightPx:s(_),effectiveMinimumPx:s(Math.max(Math.min(A,_),j))},screenCenter:{x:s(T.x),y:s(T.y)},...R?{screenBox:{x:s(T.x-C/2),y:s(T.y-L/2),width:s(C),height:s(L)}}:{},...P?{hiddenReason:P}:{}}}),a=r.filter(u=>u.visible).length,l=(u,f,b,g,S,v)=>{let w=ze({x:g.x(),y:g.y()},g.width(),g.height(),g.rotation()),k=v&&v.liftWorld>0?i.isoLiftLocal(v.liftWorld):{x:0,y:0},T=N(w.map(R=>i.worldToScreen({x:R.x+k.x,y:R.y+k.y}))),C=s(g.opacity()),L=g.fill(),I=T.x+T.width<0||T.x>o.width||T.y+T.height<0||T.y>o.height,x=g.isVisible()&&C>.05&&!I,M=v?Yt({x:g.x(),y:g.y()},g.width(),g.height(),g.rotation(),v.outline,v.holes):void 0;return{id:u,kind:f,role:b,label:g.text(),visible:x,renderedFontPx:s(g.fontSize()*t),opacity:C,fill:S,ink:typeof L=="string"?L:"",...M==null?{}:{fitsContainer:M},...x?{screenBox:{x:s(T.x),y:s(T.y),width:s(T.width),height:s(T.height)}}:{}}},c=u=>{let f=u.namePlate.fill();if(u.namePlate.opacity()>.05&&typeof f=="string"&&f)return f;let b=u.blockPoly.fill();return typeof b=="string"?b:u.baseFill},d=[...i.sections.map(u=>l(u.id,"section","name",u.nameLabel,c(u),u)),...i.sections.map(u=>l(`${u.id}:availability`,"section","availability",u.subLabel,c(u),u)),...i.zones.flatMap(u=>[l(u.id,"zone","name",u.label,u.background),...u.sub?[l(`${u.id}:price`,"zone","price",u.sub,u.background)]:[]])],h=[...i.gaById].map(([u,f])=>{let b=f.points.map(I=>i.worldToScreen(I)),g=Math.min(...b.map(I=>I.x)),S=Math.min(...b.map(I=>I.y)),v=Math.max(...b.map(I=>I.x)),w=Math.max(...b.map(I=>I.y)),k=v<0||g>o.width||w<0||S>o.height,T=s(f.polygon.opacity()),C=T>=.1&&!k,L=f.polygon.fill();return{areaId:u,label:f.label,capacity:f.capacity,categoryKey:f.categoryKey,...f.sectionId?{sectionId:f.sectionId}:{},visible:C,interactive:f.polygon.listening(),opacity:T,fill:typeof L=="string"?L:"",effectiveBackground:f.effectiveBackground,...C?{screenBox:{x:s(g),y:s(S),width:s(v-g),height:s(w-S)}}:{}}}),p=[...i.freeTextById].map(([u,f])=>{let{node:b,background:g,kind:S}=f,v=i.worldToScreen({x:b.x(),y:b.y()}),w=b.width()*t,k=b.height()*e,T=v.x-b.offsetX()*t,C=v.y-b.offsetY()*e,L=s(b.fontSize()*e),I=T+w<0||T>o.width||C+k<0||C>o.height,x=b.isVisible()&&!I,M=b.fill(),R=s(b.getAbsoluteOpacity()),P;return x||(L<Z?P="below-minimum-size":I?P="outside-viewport":P="renderer-hidden"),{objectId:f.objectId??u,kind:S,text:b.text(),visible:x,renderedFontPx:L,ink:typeof M=="string"?M:"",background:g,opacity:R,...x?{screenBox:{x:s(T),y:s(C),width:s(w),height:s(k)}}:{},...P?{hiddenReason:P}:{}}}),m=i.labelGroup.find(u=>u.getAttr("rowLabel")===!0).filter(u=>u instanceof vl).map(u=>{let f=u.getClientRect({skipShadow:!0,skipStroke:!0}),b=f.x+f.width<0||f.x>o.width||f.y+f.height<0||f.y>o.height,g=u.fill();return{text:u.text(),visible:u.isVisible()&&!b,renderedFontPx:s(u.fontSize()*e),ink:typeof g=="string"?g:"",...b?{}:{screenBox:{x:s(f.x),y:s(f.y),width:s(f.width),height:s(f.height)}}}}),y=i.sections.filter(u=>u.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:s(e),rung:i.getRung(),minimumVisibleLabelPx:Z,totalLabelledBookableUnits:r.length,visibleLabels:a,hiddenLabels:r.length-a,totalBookableUnits:r.length+h.reduce((u,f)=>u+f.capacity,0),selectionRingSeatIds:i.overlayLayer.find(".selection-ring").map(u=>String(u.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(u=>{let f=u.blockPoly.fill();return typeof f!="string"||!wi(i.canvasBackground,f)}).length,tintedSectionShells:y.filter(u=>{let f=u.blockPoly.fill();return typeof f=="string"&&ks(i.canvasBackground,f)}).length,visibleCategoryDetailOutlines:i.sections.filter(u=>u.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:i.sections.filter(u=>u.subLabel.opacity()>.05).length,visibleSectionGADetails:[...i.gaById.values()].filter(u=>u.sectionId!=null&&u.polygon.opacity()>.05).length},labels:r,gaAreas:h,hierarchyLabels:d,freeTextLabels:p,rowLabels:m}}import{Circle as wl}from"konva/lib/shapes/Circle";import{Ellipse as kl}from"konva/lib/shapes/Ellipse";import{Line as Xn}from"konva/lib/shapes/Line";import{Arrow as Ll}from"konva/lib/shapes/Arrow";import{Path as Tl}from"konva/lib/shapes/Path";import{Rect as ct}from"konva/lib/shapes/Rect";import{Text as Gi}from"konva/lib/shapes/Text";import{Image as Yn}from"konva/lib/shapes/Image";function Un(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,s=t.naturalHeight||3,n=e.crop??{x:0,y:0,width:1,height:1},r=Math.max(0,Math.min(.99,n.x)),a=Math.max(0,Math.min(.99,n.y)),l={x:r,y:a,width:Math.max(.01,Math.min(1-r,n.width)),height:Math.max(.01,Math.min(1-a,n.height))},c=e.width,d=c*(s*l.height/(o*l.width)),h=new Yn({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:l.x*o,y:l.y*s,width:l.width*o,height:l.height*s},opacity:e.opacity,listening:!1});i.bgLayer.add(h),h.moveToBottom(),i.bgLayer.batchDraw()})}function $n(i,e){let t=new window.Image,o=new Yn({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 s=o.getLayer();s&&s.batchDraw()})}function qn(i,e){if(e.shape==="round")i.bgLayer.add(new wl({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,s=e.height??50;i.bgLayer.add(new ct({x:e.center.x,y:e.center.y,width:o,height:s,offsetX:o/2,offsetY:s/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 Cl=8,Pl=6;function Zn(i,e){let t=e.background?.color??i.canvasBackground,o=X(t,e.color??i.theme.textColor??sn),s=e.semanticKind==="icon"?Ro(e.iconKey):void 0;if(s){let c=e.fontSize/24,d=new Tl({x:e.position.x,y:e.position.y,data:s,rotation:e.rotation,scaleX:c,scaleY:c,stroke:X(t,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 n=e.background?.padding??0,r=e.opacity??1,a=new Gi({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:nn(e.bold,e.italic,"600"),fill:X(t,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:n,opacity:r,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),l;if(e.background){let c=a.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),d=Math.max(Cl,e.fontSize*.35),h=Math.max(Pl,e.fontSize*.28);l=new ct({x:e.position.x,y:e.position.y,offsetX:-(c.x-d),offsetY:-(c.y-h),width:c.width+d*2,height:c.height+h*2,rotation:e.rotation,fill:e.background.color,opacity:r*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),i.bgLayer.add(l)}i.freeTextById.set(e.id,{node:a,backdrop:l,background:t,kind:"free-text"}),i.bgLayer.add(a)}function Qn(i,e){let t=e.fill??i.theme.decorFill??on,o=e.role==="stage",s=e.role==="reference-focal",n=!!e.role&&!o,r=ae(i.canvasBackground),a=s?r.focalFill:t,l=e.kind==="line"||e.kind==="polyline",c=e.stroke?.color??(o?Se(a,.28):s?r.focalStroke:l?"#9aa3b5":void 0),d=e.stroke?.width??(o?1:s||l?2:0),h=e.opacity!=null?G(e.opacity,.1,1):1,p=0,m=0,y=null;if(l&&e.points&&e.points.length>=2){p=e.points.reduce((g,S)=>g+S.x,0)/e.points.length,m=e.points.reduce((g,S)=>g+S.y,0)/e.points.length;let u=Eo(e),f=Ao(d),b=new Ll({points:e.points.flatMap(g=>[g.x,g.y]),closed:!1,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:c,fill:c,strokeWidth:d,opacity:h,lineCap:u.lineCap,lineJoin:u.lineJoin,pointerAtBeginning:u.startEnding==="arrow",pointerAtEnding:u.endEnding==="arrow",...f,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 u=o?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,ue(a,.3),1,Se(a,.12)]}:{fill:a};p=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height},i.bgLayer.add(new ct({x:p,y:m,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...u,stroke:c,strokeWidth:d,cornerRadius:G(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:h,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){p=e.x+e.width/2,m=e.y+e.height/2,y={x:e.x,y:e.y,width:e.width,height:e.height};let u=o?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,ue(a,.3),1,Se(a,.12)]}:{fill:a};i.bgLayer.add(new kl({x:p,y:m,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...u,stroke:c,strokeWidth:d,opacity:h,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let u=e.points.flatMap(g=>[g.x,g.y]),f=N(e.points);p=e.points.reduce((g,S)=>g+S.x,0)/e.points.length,m=e.points.reduce((g,S)=>g+S.y,0)/e.points.length,y=f;let b=o?{fillLinearGradientStartPoint:{x:0,y:f.y},fillLinearGradientEndPoint:{x:0,y:f.y+f.height},fillLinearGradientColorStops:[0,ue(a,.3),1,Se(a,.12)]}:{fill:a};i.bgLayer.add(new Xn({points:u,closed:!0,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,...b,stroke:c,strokeWidth:d,opacity:h,listening:!1}))}y&&e.role&&i.landmarkBoxes.push(y);for(let u of Bo(e))i.bgLayer.add(new Xn({points:u.points.flatMap(f=>[f.x,f.y]),closed:u.closed,x:p,y:m,offsetX:p,offsetY:m,rotation:e.rotation??0,stroke:u.ink??_o,fill:u.fill,strokeWidth:2,opacity:h*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:u,spec:f}=xl(i,p,m,e.label,a,y);i.primaryFocalLabels.set(u,f),i.freeTextById.set(e.id,{node:u,background:a,kind:"stage"})}else if(n){let u=dt(i,i.bgLayer,e.label,p,m,s?X(a,"#e6e9f0"):"#9aa3b5",s?18:12,!1);s&&i.primaryFocalLabels.set(u,{targetPx:18,trackingRatio:0,ink:String(u.fill()??""),plateInk:String(u.fill()??""),plate:new ct({width:0,height:0,opacity:0,listening:!1})}),i.freeTextById.set(e.id,{node:u,background:a,kind:"decor"})}else{let u=dt(i,i.bgLayer,e.label,p,m,"#cbd5e1",16,!0);i.freeTextById.set(e.id,{node:u,background:a,kind:"decor"})}}var Di=22,Il=Z,jt=6;function xl(i,e,t,o,s,n){let r=X(s,i.theme.textColor??"#e6e9f0"),a=n?n.x+n.width/2:e,l=n?n.y+n.height/2:t,c=Ml(i.canvasBackground,s),d=new ct({x:a,y:l,width:0,height:0,cornerRadius:4,fill:c,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(d);let h=new Gi({x:a,y:l,text:o.toUpperCase(),fontSize:Di,fontStyle:"700",letterSpacing:4,fontFamily:i.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return h.offsetX(h.width()/2),h.offsetY(h.height()/2),i.bgLayer.add(h),{node:h,spec:{targetPx:Di,...n?{bounds:n}:{},trackingRatio:4/Di,ink:r,plateInk:X(c,i.theme.textColor??"#e6e9f0"),plate:d}}}function Ml(i,e){return pe(e,U(i)?"#ffffff":"#000000",.34)}function jn(i,e,t,o){let s=Math.max(t,1e-4),n=e.targetPx/s,r=m=>{i.letterSpacing(m*e.trackingRatio),o(i,m)};r(n);let a=e.bounds;if(!a){e.plate.opacity(0),i.fill(e.ink);return}let l={width:a.width-jt*2,height:a.height-jt*2},c=Math.min(1,l.width/Math.max(i.width(),1e-6),l.height/Math.max(i.height(),1e-6));if(c<1&&(n=Math.max(Il/s,n*c),r(n)),i.width()<=l.width&&i.height()<=l.height){e.plate.opacity(0),i.fill(e.ink);return}let h=i.width()+jt*2,p=i.height()+jt;e.plate.size({width:h,height:p}),e.plate.offset({x:h/2,y:p/2}),e.plate.opacity(1),i.fill(e.plateInk)}function Jn(i,e){let t=i.catColor.get(e.categoryKey)??"#6e7bff",o=i.canvasBackground,s=bo(t,o,Ce),n=i.theme.textColor??"#e6e9f0",r=X(s,n),a=Ae(e.points,e.holes,{fill:t,opacity:Ce,stroke:t,strokeWidth:1.5,cornerRadius:e.cornerRadius});a.setAttr("gaId",e.id),a.on("click tap",p=>{i.isGhostClick(p)||i.opts.onGAClick?.(e.id)}),a.on("mouseenter",()=>{i.container.style.cursor="pointer"}),a.on("mouseleave",()=>{i.container.style.cursor="default"}),i.bgLayer.add(a);let l=St(e.points,e.holes),c=i.sections.find(p=>ie(l,p.outline,p.holes)),d=dt(i,i.bgLayer,e.displayLabel??e.label,l.x,l.y-8,r,Lt,!1),h=dt(i,i.bgLayer,`cap ${e.capacity}`,l.x,l.y+10,r,Tt,!1);i.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:d,background:s,kind:"ga-label",categoryKey:e.categoryKey}),i.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:h,background:s,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:a,effectiveBackground:s,strokeColor:t,labelPoint:l,labelNode:d,capacityNode:h,...c?{sectionId:c.logicalId}:{}})}function dt(i,e,t,o,s,n,r,a){let l=new Gi({x:o,y:s,text:t,fontSize:r,fontStyle:a?"700":"500",fontFamily:i.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function er(i,e){let t=[],o=e.theme.background??"#f7f8fb",s=new Map,n=(c,d)=>{let h=s.get(c)??[];h.push(d),s.set(c,h)};for(let c of e.seats){if(c.kind==="booth")continue;let d=c.logicalRowId??c.rowId;n(d,c),d!==c.rowId&&n(c.rowId,c)}let r=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 p=c.segmentedRow&&!d?c.segmentedRow.groupId:c.id,m=(s.get(p)??[]).slice().sort((P,A)=>r(P)-r(A));if(!m.length)continue;let y=m[0],u=m[m.length-1],f=h?.labelStyle,b=X(o,f?.color??e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",It),g=f?.size??go,S=h?.rotation??0,v=e.objectFilteredOut(c)?.15:1,w=e.seatSection.get(y.id),k=c.segmentedRow?.displayLabel??c.displayLabel,T=w?.label.trim(),C=T&&c.label.toLocaleLowerCase("en-US").startsWith(`${T.toLocaleLowerCase("en-US")} `)?c.label.slice(T.length).trim():"",L=k??(/^[\p{L}\p{N}]{1,4}$/u.test(C)?C:c.label),I=w?[...new Set([w.id,w.logicalId,w.zone].filter(P=>!!P))]:void 0,x=(P,A,_)=>t.push({text:L,x:P,y:A,rotation:S,fontSize:g,ink:b,opacity:v,...I?.length?{focusKeys:I}:{},..._?{automaticAway:_}:{}});if(h?.position){x(h.position.x,h.position.y);continue}let M=e.seatR+12,R=h?.positionPreset??"start";if(R==="start"||R==="both"){let P=c.rotation*Math.PI/180,A={x:-Math.cos(P),y:-Math.sin(P)};x(y.x+A.x*M,y.y+A.y*M,A)}if(R==="end"||R==="both"){let P=(c.rotation+c.curve)*Math.PI/180,A={x:Math.cos(P),y:Math.sin(P)};x(u.x+A.x*M,u.y+A.y*M,A)}}let a=(e.seatR+12)*2.2,l=[];for(let c of t){let d=l.find(h=>h.text===c.text&&Math.hypot(h.x-c.x,h.y-c.y)<=a);if(d){d.x=(d.x+c.x)/2,d.y=(d.y+c.y)/2;continue}l.push(c)}return l}function Hi(i,e,t=Q){let o=i.rotation()*Math.PI/180,s=Math.abs(Math.cos(o)),n=Math.abs(Math.sin(o)),r=(i.width()*s+i.height()*n)/2+t,a=(i.width()*n+i.height()*s)/2+t;return{x:e.x-r,y:e.y-a,width:r*2,height:a*2}}function tr(i,e,t,o){let s={x:e.x,y:e.y},n=e.automaticAway;if(!n)return s;let r={x:-n.y,y:n.x},a=Math.max(7,Math.min(16,e.fontSize*.75)),l=[{x:0,y:0}];for(let p=1;p<=4;p++){let m=a*p;l.push({x:r.x*m,y:r.y*m},{x:-r.x*m,y:-r.y*m},{x:n.x*m,y:n.y*m},{x:(n.x+r.x)*m,y:(n.y+r.y)*m},{x:(n.x-r.x)*m,y:(n.y-r.y)*m})}let c=s,d=1/0,h=1/0;for(let p of l){let m={x:s.x+p.x,y:s.y+p.y},y=Hi(i,m),f=(o?Rt(o,y,{mode:"overlap"}).length:0)+t.collisionCount(y),b=Math.hypot(p.x,p.y);if((f<d||f===d&&b<h)&&(c=m,d=f,h=b),f===0)break}return c}function ir(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(B(e.outlineTint,.5)),e.outlinePoly.fill(B(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=pe("#f4b740","#ef4444",t);e.outlinePoly.stroke(B(o,.72+t*.25)),e.outlinePoly.fill(B(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 Wi(i,e){return i.closedSections.has(e.id)||i.closedSections.has(e.logicalId)||e.zone!=null&&i.closedSections.has(e.zone)}function or(i,e){return Wi(i,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*ms?"nearly-gone":"normal"}function sr(i,e){let t=or(i,e),o=i.accessFilterActive&&i.sectionAccessibleFree(e)<=0,s=ws(i.canvasBackground,t,o?null:e.shellCategoryColor);e.shellFill=s.fill,e.shellStroke=s.stroke,e.blockPoly.fill(s.fill),e.blockPoly.stroke(s.stroke),e.subLabel.text(t==="sold-out"?Y("map.soldOut"):Y("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function Rl(i,e){return pe(e,U(i)?"#ffffff":"#000000",hs)}function El(i,e,t=0){let o=ds-t;return!e||i.length<=o?i:`${i.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function Al(i,e){return i.accessFilterActive&&i.sectionAccessibleFree(e)>0}function _l(i,e,t){let o=Al(i,e),s=El(e.label,t,o?2:0),n=o?`\u267F ${s}`:s;e.nameLabel.text()!==n&&e.nameLabel.text(n),e.nameLabel.fontStyle(t?cs:Ne),e.nameLabel.letterSpacing(t?e.nameLabel.fontSize()*tt:0)}function Bl(i,e,t){let o=i.stageWidth<ce,s=e.nameLabel.opacity();if(!o||s<=.05||!e.nameLabel.visible()){e.namePlate.opacity(0),e.subLabel.opacity(0);return}let n=e.nameLabel.rotation(),r=n===0&&or(i,e)==="sold-out",a=bi/t,l=ps/t,c=r?2/t:0,d={x:e.nameLabel.x(),y:e.nameLabel.y()},h=e.nameLabel.height(),p=0;r?(_e(e.subLabel,He/t,d.y),p=e.subLabel.height(),e.subLabel.rotation(0),e.subLabel.x(d.x),e.subLabel.y(d.y+h/2+c+p/2),e.subLabel.opacity(s)):e.subLabel.opacity(0);let m=r?c+p:0,y=Math.max(e.nameLabel.width(),r?e.subLabel.width():0)+a*2,u=h+m+l*2;e.namePlate.position({x:d.x,y:d.y+m/2}),e.namePlate.rotation(n),e.namePlate.size({width:y,height:u}),e.namePlate.offset({x:y/2,y:u/2}),e.namePlate.cornerRadius(fs/t),e.namePlate.opacity(s*us)}function nr(i,e){let t,o;i.reducedMotion?(t=e<=ge?1:0,o=e<=Ge?1:0):(t=G((be-e)/(be-ge),0,1),o=G((ge-e)/(ge-Ge),0,1)),(i.floorOverview||i.focusedSectionId)&&(t=0,o=0);let s=!i.floorOverview&&!i.focusedSectionId&&e<ne;s&&(t=1),i.zones.length||(o=0);let n=i.viewMode==="perspective"&&i.glideInProgress&&i.seatCount>2500;i.seatLayer.opacity(s||n?0:1-t);let r=i.stageScaleX,a=!i.glideInProgress&&(i.lodScale===0||Math.abs(e-i.lodScale)/(i.lodScale||1)>.08);a&&i.setLodScale(e);let l=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:l&&m.id!==l&&m.logicalId!==l&&m.zone!==l?xe:1,u=Math.min(y,Vn(m.memberCategoryKeys,i.categoryFilter)?xe:1);m.outlinePoly.opacity(s?0:(1-t)*u),m.blockPoly.opacity(Qo*t*u);let f=i.sectionIsOwned(m);m.blockPoly.stroke(f?i.selectionColor:m.shellStroke||d.sectionStroke),m.blockPoly.strokeWidth((f?jo:Ft)/Math.max(r,1e-4));let b=m.blockPoly.fill(),g=typeof b=="string"?b:m.baseFill,S=c?Rl(i.canvasBackground,g):null;S&&m.namePlate.fill(S);let v=X(S??g,m.preferredInk);m.nameLabel.fill(v),m.subLabel.fill(v),_l(i,m,c),a&&h>.01&&Dl(i,m,r),m.nameLabel.opacity(m.nameLabelFits?h*(1-o)*u:0),m.subLabel.opacity(0)}let p=o*(1-i.isoT);for(let m of i.zones)m.back.opacity(p),m.label.opacity(p),m.sub&&m.sub.opacity(i.stageWidth<ce?0:p),a&&Hl(i,m,r);if(!i.glideInProgress&&(h>.01||p>.01)){Ol(i,r),Fl(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)Bl(i,m,r);i.bgLayer.batchDraw()}function Fl(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(s=>s.nameLabel.opacity()>.05).sort((s,n)=>{let r=N(s.outline),a=N(n.outline);return a.width*a.height-r.width*r.height});for(let s of o.slice(1))s.nameLabel.opacity(0)}}function Ol(i,e){let o=[],s=l=>{let c=i.worldToScreen({x:l.x(),y:l.y()}),d=N(ze({x:0,y:0},l.width()*e,l.height()*e,l.rotation()));return{x:c.x-d.width/2,y:c.y-d.height/2,w:d.width,h:d.height}};for(let l of i.zones){if(l.label.opacity()<=.05)continue;let c=l.back.getAbsolutePosition(),d=l.back.width()*e,h=l.back.height()*e;o.push({node:l.label,tier:0,section:!1,zone:l,box:{x:c.x-d/2,y:c.y-h/2,w:d,h}})}for(let l of i.sections)l.nameLabel.opacity()>.05&&o.push({node:l.nameLabel,tier:1,section:!0,area:l.labelArea,box:s(l.nameLabel)});let n=i.landmarks.map(l=>{let c=i.worldToScreen({x:l.x,y:l.y}),d=i.worldToScreen({x:l.x+l.width,y:l.y+l.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&&!n.length)return;o.sort((l,c)=>l.tier-c.tier||(c.area??0)-(l.area??0)||l.box.y-c.box.y||l.box.x-c.box.x);let r=[...n],a=l=>r.some(c=>l.x<c.x+c.w+4&&c.x<l.x+l.w+4&&l.y<c.y+c.h+4&&c.y<l.y+l.h+4);for(let l of o){if(!a(l.box)){r.push(l.box);continue}let c=!1;if(l.zone)for(let d of ls){if(d===0)continue;let h={...l.box,y:l.box.y+d};if(!a(h)){Ni(l.zone,0,d/e),r.push(h),c=!0;break}}if(l.section){let d=l.node.fontSize(),h=l.node.y(),p=l.node.letterSpacing()>0;for(let m of Jo){let y=d*m;if(y*e<He)break;_e(l.node,y,h),p&&(l.node.letterSpacing(l.node.fontSize()*tt),l.node.offsetX(l.node.width()/2));let u=s(l.node);if(!a(u)){r.push(u),c=!0;break}}c||(_e(l.node,d,h),p&&(l.node.letterSpacing(l.node.fontSize()*tt),l.node.offsetX(l.node.width()/2)))}c||l.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 Dl(i,e,t){e.subLabelFits=!1;let o=i.stageWidth<ce,s=o?bi*2:0,n=Ht(gi*e.labelScale,i.stageWidth),r=He;for(let a=n;a>=r;a-=1)for(let l of[0,-90]){e.nameLabel.rotation(l),_e(e.nameLabel,a/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+s)/t;if(Yt(c,e.nameLabel.width()+d,e.nameLabel.height()+d,l,e.outline,e.holes)){e.nameLabelFits=!0;return}}}e.nameLabel.position(e.centroid),e.nameLabel.rotation(0),e.nameLabelFits=!1}function Gl(i,e,t){let o=s=>(i.text(s),i.width());if(!(o(e)<=t)){for(let s=e.length-1;s>=1;s-=1)if(o(`${e.slice(0,s).trimEnd()}\u2026`)<=t)return;o("\u2026")}}function Hl(i,e,t){let o=Si(i.stageWidth),s=e.sub!=null&&i.stageWidth>=ce,n=i.stageWidth<ce,r=(n?ts:os)*o/t,a=(n?is:ss)*o/t,l=s?3*o/t:0;if(e.label.text(e.name),_e(e.label,Ht(Ot,i.stageWidth)/t,e.anchor.y),n){let g=i.stageWidth*as/t-r*2;Gl(e.label,e.name,Math.max(g,1)),_e(e.label,e.label.fontSize(),e.anchor.y)}e.label.x(e.anchor.x),s&&(_e(e.sub,Ht(Dt,i.stageWidth)/t,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*es),e.sub.offsetX(e.sub.width()/2),e.sub.x(e.anchor.x));let c=Math.max(e.label.width(),s?e.sub.width():0)+r*2,d=e.label.height()+(s?l+e.sub.height():0)+a*2;e.label.y(e.anchor.y-(s?(l+e.sub.height())/2:0)),s&&e.sub.y(e.anchor.y+(e.label.height()+l)/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(ns*o/t),e.back.strokeWidth(1/t);let h=e.back.getAbsolutePosition(),p=6,m=c*t;if(m>i.stageWidth-p*2){e.label.opacity(0),e.back.opacity(0),e.sub&&e.sub.opacity(0);return}let y=m/2,f=(G(h.x,p+y,i.stageWidth-p-y)-h.x)/t;Math.abs(f)>.001&&Ni(e,f,0);let b=62+d*t/2;h.y<b&&Ni(e,0,(b-h.y)/t)}function Ni(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 rr(i,e){let t=e,o=t._cache.get("canvas");if(!o)return;let s=[o.scene,o.filter,o.hit].map(n=>n?._canvas).filter(n=>!!n);s.length&&i.Util.releaseCanvas(...s),t._cache.delete("canvas")}function ar(i,e){let t=0,o=0,s=n=>{t||(t=n),o+=1;let r=n-t;r>=1e3&&(i(Math.round(o*1e3/r)),o=0,t=n),e(requestAnimationFrame(s))};e(requestAnimationFrame(s))}import{Group as Nl}from"konva/lib/Group";import{Line as lr}from"konva/lib/shapes/Line";import{Rect as Wl}from"konva/lib/shapes/Rect";import{Text as cr}from"konva/lib/shapes/Text";function Vl(i,e){return i>=re||e&&i>=_t}function zl(i){return i.effectiveScale<_t?!1:i.focusActive||i.stageWidth<ce}function Kl(i,e,t){return t&&e>=_t?Math.max(i,Yo/Math.max(e,1e-4)):i}function Xl(i,e){return Math.max(1,i*2-(e?1:3))}function dr(i){let e=i.exportMode?Math.max(i.effScale(),re):i.effScale(),t=zl({effectiveScale:e,focusActive:i.focusedSectionId!=null,stageWidth:i.stage.width()}),o=Vl(e,t),s=a=>{let l=a.getClientRect({skipShadow:!0,skipStroke:!0});return l.x>=0&&l.y>=0&&l.x+l.width<=i.stage.width()&&l.y+l.height<=i.stage.height()};for(let[a,l]of i.boothLabelById){let c=i.circleById.get(a);l.visible(me(l.fontSize(),e)&&!!c?.isVisible()&&i.focusedSeatOpacity(a,c?.getAbsoluteOpacity()??1)>=.5&&s(l))}i.labelGroup.destroyChildren(),i.labelLiftGroups.clear(),i.seatLabelById.clear();let n=0;if(o)for(let a of i.visibleSeatCandidates()){if(a.kind==="booth")continue;let l=i.worldToScreen(a);if(l.x<-20||l.x>i.stage.width()+20||l.y<-20||l.y>i.stage.height()+20||i.accessGlyphById.has(a.id)&&i.accessGlyphShouldShow(a.id))continue;let c=i.circleById.get(a.id);if(!c?.isVisible()||i.focusedSeatOpacity(a.id,c.getAbsoluteOpacity())<.5)continue;let d=i.statusById.get(a.id)??"free",h=i.renderedSeatPoint(a),p=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 Nl({x:h.x,y:h.y,listening:!1});if(b.scale({x:p,y:p}),d==="held"?(b.add(new Wl({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),b.add(new lr({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(En),b.add(new lr({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1}))),Zt(b),i.seatLabelContainer(a.id).add(b),++n>=yi)break;continue}let y=Kl(fe*i.seatLabelScale(a),e,t),u=new cr({x:h.x,y:h.y,text:Pt(a.displayLabel??a.label),fontSize:y,fontStyle:"600",fontFamily:i.labelFont(),fill:c?i.seatLabelInk(a,c):i.seatPreferredLabelInk(a),listening:!1,perfectDrawEnabled:!1}),f=Xl(i.seatR,t);if(u.width()>f&&u.fontSize(Math.max(je,y*f/u.width())),u.width()>f+.01){u.destroy();continue}if(!me(u.fontSize(),e)){u.destroy();continue}if(u.offsetX(u.width()/2),u.offsetY(u.height()/2),u.scale({x:p,y:p}),i.seatLabelContainer(a.id).add(u),!s(u)){u.destroy();continue}if(i.seatLabelById.set(a.id,u),++n>=yi)break}let r=new Ke;for(let{node:a}of i.freeTextById.values()){if(!a.isVisible())continue;let l=a.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});r.insert({x:l.x-Q,y:l.y-Q,width:l.width+Q*2,height:l.height+Q*2})}for(let a of i.rowLabelPlan){let l=i.focusedSectionId!=null&&a.focusKeys?.includes(i.focusedSectionId),c=l?Math.max(a.fontSize,Xo/Math.max(e,1e-4)):a.fontSize;if(!l&&!me(c,e))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 h=new cr({x:a.x,y:a.y,text:a.text,fontSize:c,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});h.offsetX(h.width()/2),h.offsetY(h.height()/2);let p=i.resolveAutomaticRowLabelPosition(h,a,r);h.position(p),h.setAttr("rowLabel",!0),i.labelGroup.add(h);let m=h.getClientRect({skipShadow:!0,skipStroke:!0}),y=6,u=m.x<y?y-m.x:m.x+m.width>i.stage.width()-y?i.stage.width()-y-m.x-m.width:0,f=m.y<y?y-m.y:m.y+m.height>i.stage.height()-y?i.stage.height()-y-m.y-m.height:0,b=p;if(u||f){let S=i.labelGroup.getAbsoluteTransform(),v=S.point(p);b=S.copy().invert().point({x:v.x+u,y:v.y+f}),h.position(b)}let g=i.rowLabelBox(h,b);if(a.automaticAway&&r.collisionCount(g)>0){h.destroy();continue}r.insert(g)}i.isoT>0&&i.viewMode!=="perspective"&&i.applyUprightLabels(),i.overlayLayer.batchDraw()}function hr(i){let e=i.now??(()=>typeof performance<"u"?performance.now():Date.now()),t=i.budgetMs??8,o=i.reducedMotion===!0,s=i.chunks.length>1?Math.min(30,Math.max(0,840/(i.chunks.length-1))):0,n=0,r=!1,a=!1,l=null,c=[],d=typeof globalThis<"u"?globalThis:{},h=()=>{l&&(l.kind==="idle"?d.cancelIdleCallback?.(l.id):l.kind==="frame"?d.cancelAnimationFrame?.(l.id):clearTimeout(l.id),l=null)},p=f=>{if(!c.length&&typeof d.requestIdleCallback=="function"){l={kind:"idle",id:d.requestIdleCallback(()=>{l=null,f()},{timeout:120})};return}if(typeof d.requestAnimationFrame=="function"){l={kind:"frame",id:d.requestAnimationFrame(()=>{l=null,f()})};return}l={kind:"timer",id:setTimeout(()=>{l=null,f()},16)}},m=()=>{a||r||(a=!0,h(),i.done())},y=f=>{for(let b=c.length-1;b>=0;b--){let g=c[b],S=o?1:Math.min(1,(f-g.startedAt)/160);i.fade(g.work,S),S>=1&&c.splice(b,1)}return c.length>0},u=()=>{if(r)return;let f=e(),b=f;for(;n<i.chunks.length&&(n===0||e()-b<t);){let S=i.chunks[n++];if(i.build(S.work),i.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:f+(n-1)*s}),e()-b>=t)break}let g=y(f);i.draw(),n<i.chunks.length||g?p(u):m()};return p(u),{cancel(){if(!a){r=!0,h();for(let f of c)i.fade(f.work,1);c.length=0}},finishNow(){if(!(r||a)){for(;n<i.chunks.length;){let f=i.chunks[n++];i.build(f.work)}for(let f of i.chunks)i.fade(f.work,1);c.length=0,i.draw(),m()}},get done(){return a}}}function ht(i){return{th:Bt*Math.PI/180*i.isoT,sg:1-(1-et)*i.isoT}}function ur(i,e){let{th:t,sg:o}=ht(e),s=e.centre,n=i.x-s.x,r=i.y-s.y,a=n*Math.cos(t)-r*Math.sin(t),l=(n*Math.sin(t)+r*Math.cos(t))*o;return{x:s.x+a,y:s.y+l}}function pr(i,e){let{th:t,sg:o}=ht(e),s=e.centre,n=i.x-s.x,a=(i.y-s.y)/o,l=n*Math.cos(t)+a*Math.sin(t),c=-n*Math.sin(t)+a*Math.cos(t);return{x:s.x+l,y:s.y+c}}function fr(i,e){let{th:t,sg:o}=ht(e),s=i*e.isoT;return{x:-(s/o)*Math.sin(t),y:-(s/o)*Math.cos(t)}}function mr(i,e,t){let o=Io(e);i.offset(t),i.position(se(e,t)),i.rotation(o.rotationDeg),i.scale({x:o.scaleX,y:o.scaleY}),i.skewX(o.skewX),i.skewY(0)}function yr(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 gr(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 br(i,e,t){return i.perspectiveAffine?se(i.perspectiveAffine,e):se(t,e)}function Sr(i,e){return e?se(e,i):i}function vr(i,e){let t=0;for(let h of i.seats){let p=Math.max(0,(h.eyeHeightM??ee)-ee);t=Math.max(t,p*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=To(i.bounds,t),s=Et(o,o.target),n=Co(s);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let r=1/0,a=1/0,l=-1/0,c=-1/0;for(let h of i.seats){let p=Math.max(0,(h.eyeHeightM??ee)-ee),m=ye(o,h,p*Oe),y={x:m.x,y:m.y};e.seatProjected.set(h.id,y),e.seatLocal.set(h.id,se(n,y)),e.seatDepth.set(h.id,m.depth),e.seatScale.set(h.id,m.scale),r=Math.min(r,m.x),a=Math.min(a,m.y),l=Math.max(l,m.x),c=Math.max(c,m.y)}for(let h of[{x: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 p=ye(o,h,0);r=Math.min(r,p.x),a=Math.min(a,p.y),l=Math.max(l,p.x),c=Math.max(c,p.y)}let d=Math.max(24,i.seatR*3);return{camera:o,baseAffine:s,baseInverse:n,bounds:Number.isFinite(r)?{x:r-d,y:a-d,width:Math.max(1,l-r+d*2),height:Math.max(1,c-a+d*2)}:null}}function wr(i,e,t){let o=t?[...t].map(s=>i.seatById.get(s)).filter(s=>!!s):e?i.seats:[...i.perspectiveAppliedSeats].map(s=>i.seatById.get(s)).filter(s=>!!s);for(let s of o){if(e&&i.perspectiveAppliedSeats.has(s.id))continue;let n=e?i.perspectiveSeatProjected.get(s.id)??s:s,r=e?i.perspectiveSeatScale.get(s.id)??1:1,a=i.circleById.get(s.id);a?.position(n),a?.scale({x:r,y:r});let l=i.accessRingById.get(s.id);l?.position(n),l?.scale({x:r,y:r});let c=i.accessGlyphById.get(s.id);if(c){let h=i.seatR*1.5/ve;c.position(n),c.scale({x:h*r,y:h*r})}let d=i.boothLabelById.get(s.id);d?.position(n),d?.scale({x:r,y:r}),e&&i.perspectiveAppliedSeats.add(s.id)}e||i.perspectiveAppliedSeats.clear()}function Ki(i){return i?.getAttr?.("seatId")??void 0}var Tr=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.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=Ri;this.effSelection=rt;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 qt;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=vn();this.fitScale=1;this.fitPose="";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=Jt.pixelRatio;if(this.exportMode&&(this.dpr=1),Jt.pixelRatio=this.dpr,this.stage=new Yl({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Qt(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",Y("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Vi({listening:!this.exportMode}),this.seatLayer=new Vi({listening:!this.exportMode}),this.overlayLayer=new Vi({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 kr({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 kr({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&&(Jt.pixelRatio=o),!this.exportMode){this.wireInteraction();let s=this.opts.onFps;s&&ar(s,n=>{this.rafId=n})}!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 s=this.seatById.get(o);s&&t.push(this.renderedSeatPoint(s))}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 n of e.floors)for(let r of n.objects)this.objectFloor.set(r.id,n.id),r.type==="section"&&r.logicalSectionId&&this.objectFloor.set(r.logicalSectionId,n.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 n of this.selectionMarkers.values())n.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(n=>n.type==="section");for(let n of e.zones??[])n.color&&this.zoneColor.set(n.id,n.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=G(this.theme.seatScale??1,.7,1.6)*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(n=>n.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((n,r)=>{this.cbHueByKey.set(n,Wt[r%Wt.length])});for(let n of e.categories)this.catColor.set(n.key,n.color),this.catByKey.set(n.key,n),typeof n.price=="number"&&this.catPrice.set(n.key,n.price);for(let n of o.objects)n.type==="booth"&&this.boothDims.set(n.id,{width:n.width,height:n.height,rotation:n.rotation,...n.points&&n.points.length>=3?{points:n.points.map(r=>({x:r.x,y:r.y}))}:{}});this.seats=$e(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()});for(let n of this.seats)this.seatById.set(n.id,n),this.statusById.set(n.id,"free");this.seatIndex=Lo(this.seats,{seatRadius:this.seatR}),this.bounds=ho(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 s=this.seatRevealWanted();this.seatRevealPending=s,s||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=!s,this.zoomToFit(),s&&this.startSeatReveal()}seatRevealWanted(){return this.loadingReveal==="progressive"&&!this.exportMode&&this.sections.length>1&&this.seats.length>=this.progressiveSeatFloor}startSeatReveal(){this.cancelSeatReveal();let e=this.viewportCentreInChartSpace(),t=new Map,o=[];for(let n of this.seats){let r=this.seatSection.get(n.id);if(!r){o.push(n);continue}let a=t.get(r.id);a?a.push(n):t.set(r.id,[n])}let s=[...t.entries()].map(([n,r])=>{let a=this.sections.find(l=>l.id===n);return{id:n,work:{seats:r,group:a.liftGroupSeat},distance:Math.hypot(a.centroid.x-e.x,a.centroid.y-e.y)}}).sort((n,r)=>n.distance-r.distance);o.length&&this.unsectionedSeatGroup&&s.push({id:"",work:{seats:o,group:this.unsectionedSeatGroup},distance:1/0}),this.seatReveal=hr({chunks:s.map(n=>({id:n.id,work:n.work})),build:n=>this.renderSeats(n.seats),fade:(n,r)=>n.group.opacity(r),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.updateLOD(),this.fitPose&&xi(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||!e.floors.length)return{...e,referenceImage:void 0,backgroundImage:De(e)};if(this.floorOverview&&e.floors.length>=2)return{...lo(e)?co(e):ao(e),referenceImage:void 0,backgroundImage:De(e)};if(this.stacked&&e.floors.length>=2)return{...ro(e),referenceImage:void 0,backgroundImage:De(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:De(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(s=>s.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}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,s=this.hasSections?new Set:null;for(let n of e){if(!this.statusById.has(n))continue;let r=this.statusById.get(n);this.statusById.set(n,t);let a=this.circleById.get(n);if(a&&(this.paintSeat(a,n),o=!0),s){let l=this.seatSection.get(n);l&&(r==="free"!=(t==="free")&&(l.free+=t==="free"?1:-1),s.add(l))}}if(s&&s.size){for(let n of s)this.refreshSectionFill(n);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[n,r]of Object.entries(e)){let a=this.seatById.get(n);if(!a||!this.catColor.has(r)||a.categoryKey===r)continue;a.categoryKey=r;let l=this.circleById.get(n);l&&(this.paintSeat(l,n),t=!0);let c=this.seatSection.get(n);c&&o.add(c)}if(!t)return;let s=new Map((this.chartDoc?vt(this.chartDoc):[]).flatMap(n=>n.objects).filter(n=>n.type==="section").map(n=>[n.id,n]));for(let n of o){if(!s.get(n.id)?.color){let a=new Map;for(let l of n.memberIds){let c=this.seatById.get(l)?.categoryKey;c&&a.set(c,(a.get(c)??0)+1)}n.baseFill=ui([...a].map(([l,c])=>({hex:this.catColor.get(l)??"#6e7bff",w:c})),"#3a4358")}n.shellCategoryColor=this.dominantSellableColor(n.memberIds),this.refreshSectionFill(n)}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(s=>this.statusById.has(s))),o=new Set([...this.ownedHold,...t]);this.ownedHold=t;for(let s of o){let n=this.circleById.get(s);n&&this.paintSeat(n,s),this.syncSelectionMarker(s)}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 s of this.seats){let n=this.circleById.get(s.id);n&&this.paintSeat(n,s.id)}o&&this.syncSelectionMarker(o),t&&this.syncSelectionMarker(t);for(let[s,n]of this.selectionMarkers)n.opacity(!t||s===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 s=this.circleById.get(o);s&&this.paintSeat(s,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 s=this.seatById.get(o);s&&t.push(s)}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 s of this.seats)t.has(s.label)&&this.isSelectable(s.id)&&o.push(s.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 s of this.sections)if(!(s.id!==e&&s.logicalId!==e&&s.zone!==e))for(let n of s.memberIds){if(o.has(n)||(o.add(n),!this.isSelectable(n)))continue;let r=this.seatById.get(n);r&&t.push(r)}return t}selectMany(e){let t=e.filter(s=>!this.selection.has(s));if(!t.length)return this.getSelection();let o=this.selection.size+t.length<=Uo;for(let s of t)if(o)this.setSelected(s,!0,!0);else{this.selection.add(s);let n=this.circleById.get(s);n&&this.paintSeat(n,s)}return this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}beginMarquee(e){let t=this.screenToWorld(e),o=this.stage.scaleX()||1,s=new Lr({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(s),this.marquee={start:t,rect:s},this.marqueeCur=t,this.overlayLayer.batchDraw()}updateMarquee(e){if(!this.marquee)return;let t=this.screenToWorld(e),{start:o,rect:s}=this.marquee;s.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),s=Math.max(e.start.x,t.x),n=Math.min(e.start.y,t.y),r=Math.max(e.start.y,t.y),a=this.stage.scaleX()||1;if((s-o)*a<4&&(r-n)*a<4){this.selection.size&&(this.clearSelection(),this.opts.onMarquee?.([]));return}let l=[];for(let c of this.seats){let d=this.renderedSeatPoint(c);d.x<o||d.x>s||d.y<n||d.y>r||this.isSelectable(c.id)&&l.push(c.id)}this.selectMany(l),this.opts.onMarquee?.(this.getSelection())}flashSeat(e,t="#f43f5e"){let o=this.seatById.get(e);o&&pn(this.flashHost,e,this.renderedSeatPoint(o),t)}flashSection(e,t="#22a06b"){fn(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 s=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(o.id)??o:o,n=null,r=1/0;for(let a of this.seats){if(a.id===e)continue;let l=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(a.id)??a:a,c=l.x-s.x,d=l.y-s.y,h=c*t.x+d*t.y;if(h<=.5)continue;let p=Math.abs(c*t.y-d*t.x),m=h+p*2.5;m<r&&(r=m,n=a.id)}return n}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(),s=Math.max(this.stage.scaleX(),Pe*1.2),n=this.worldToScreen(e),r=70,a=n.x<r||n.x>t-r||n.y<r||n.y>o-r;if(this.stage.scaleX()<s||a){let l=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?se(this.perspectiveBaseAffine,l):this.isoT===0?l:this.isoForward(l);this.stage.scale({x:s,y:s}),this.stage.position({x:t/2-c.x*s,y:o/2-c.y*s}),this.afterViewChange(),this.stage.batchDraw()}}zoomToFit(){let e=this.stage.width(),t=this.stage.height(),o=this.viewMode==="perspective"&&this.perspectiveBounds?this.perspectiveBounds:this.bounds;if(this.fitScale=Math.min(e/o.width,t/o.height)||1,this.opts.portraitFitCrop&&!this.exportMode){let n=e/o.width<=t/o.height,r=o.height*this.fitScale;n&&r<.55*t&&(this.fitScale=Math.min(this.fitScale*1.3,.62*t/o.height))}let s=this.fitScale;if(this.stage.scale({x:s,y:s}),this.stage.position({x:(e-o.width*s)/2-o.x*s,y:(t-o.height*s)/2-o.y*s}),this.settleView(),!this.exportMode){let n=Ks(this.stage,[this.bgLayer,this.seatLayer]);n>0&&n!==1&&(this.fitScale*=n),n>0&&this.afterViewChange(),this.fitPose=xi(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()}zoomIn(){this.zoomAbout(this.stage.scaleX()*pt.ZOOM_STEP,_i(this.stage))}zoomOut(){this.zoomAbout(this.stage.scaleX()/pt.ZOOM_STEP,_i(this.stage))}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,s=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let a=s?this.perspectiveSeatProjected.get(s.id)??se(this.perspectiveBaseAffine,e):se(this.perspectiveBaseAffine,e);return{x:a.x*t+this.stage.x(),y:a.y*t+this.stage.y()}}let n=s?this.renderedSeatPoint(s):e,r=this.isoT===0?n:this.isoForward(n);return{x:r.x*t+this.stage.x(),y:r.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 s=this.circleById.get(o.id);s&&this.paintSeat(s,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,s)=>o===e[s])}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(!Nn(t,this.categoryFilter)){this.categoryFilter=t;for(let o of this.seats){let s=this.circleById.get(o.id);s&&this.paintSeat(s,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(){Gn({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=>Dn(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<ne,effScale:()=>this.effScale(),labelLegible:e=>me(e,this.effScale())})}setGAStates(e){Hn(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),s=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(!s.length)return;let n=Wn(s.map(d=>d.id),this.seatSection);n&&this.focusSection(n);let r=Math.max(24,this.seatR*3),a=s.map(d=>this.renderedSeatPoint(d)),l=kn(a,r),c=this.narrowSeatDetailFocus(a,l);this.focusRegion(c?.bounds??l,{animate:t?.animate,durationMs:this.cameraGlideMs,minScale:c?.minScale})}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let a=this.viewMode==="isometric"&&this.isoT>0;this.viewMode=e,this.isoTarget=1,this.isoT=1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.applyPerspective(a),this.zoomToFit();return}let 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 s=this.isoT;if(s===t){this.applyIso(),this.afterViewChange();return}let n=performance.now(),r=a=>{if(this.destroyed)return;let l=Math.min(1,(a-n)/$o),c=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2;this.isoT=s+(this.isoTarget-s)*c,this.applyIso(),this.scheduleViewChange(),l<1?this.isoRaf=requestAnimationFrame(r):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(r)}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 ur(e,this.isoState)}isoInverse(e){return pr(e,this.isoState)}buildPerspectiveProjection(e){let t=vr({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){mr(e,t,o)}resetContainerTransform(e){yr(e)}sectionSurfaceHeight(e,t){return gr(e,t)}projectedSectionPoint(e,t){return br(e,t,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return Sr(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return fr(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){wr(this.seatAnchorContext,e,t)}applyPerspective(e=!0){let t=this.perspectiveCamera,o=this.perspectiveBaseAffine,s=this.perspectiveBaseInverse;if(!t||!o||!s)return;let n=this.seats.length>2500&&this.sections.length>0;this.cached&&!n&&(this.seatLayer.clearCache(),this.seatLayer.listening(!0),this.cached=!1),this.resetLayerTransforms(e),this.resetSectionProjection(e);for(let a of[this.bgLayer,this.overlayLayer])this.setContainerAffine(a,o,t.target);this.perspectiveAppliedSeats.clear(),n||this.applyExactSeatAnchors(!0);for(let a of this.sections){let l=h=>this.sectionSurfaceHeight(a,h),c=Et(t,a.centroid,l),d=Po(s,c);a.perspectiveAffine=c,a.perspectiveCorrection=d,a.perspectiveDepth=ye(t,a.centroid,l(a.centroid)).depth,this.setContainerAffine(a.liftGroupBg,d,a.centroid);for(let h=0;h<a.sideFaces.length;h++){let p=a.outline[h],m=a.outline[(h+1)%a.outline.length],y=this.perspectiveLocalPoint(ye(t,p,0)),u=this.perspectiveLocalPoint(ye(t,m,0)),f=this.perspectiveLocalPoint(ye(t,m,l(m))),b=this.perspectiveLocalPoint(ye(t,p,l(p)));a.sideFaces[h].points([y.x,y.y,u.x,u.y,f.x,f.y,b.x,b.y]),a.sideFaces[h].opacity(.9)}}let r=[...this.sections].sort((a,l)=>(l.perspectiveDepth??0)-(a.perspectiveDepth??0));for(let a of r)a.rootGroupBg.moveToTop(),a.liftGroupSeat.moveToTop();this.unsectionedSeatGroup?.moveToTop(),this.syncSeatOverlayPositions(),n||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(),s=Math.cos(t),n=o*Math.sin(t),r=-Math.sin(t),a=o*Math.cos(t),l=Math.sqrt(s*s+n*n),c=s*a-n*r,d=Math.atan2(n,s)*180/Math.PI,h=l,p=c/l,m=(s*r+n*a)/c,y=this.isoCentre;for(let u of[this.bgLayer,this.seatLayer,this.overlayLayer])u.position({x:y.x,y:y.y}),u.offset({x:y.x,y:y.y}),u.rotation(d),u.scaleX(h),u.scaleY(p),u.skewX(m),u.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 s of o){let n=s.find("Text");for(let r of n){let a=r.getAttr("uprightBase");a==null&&(a=r.rotation(),r.setAttr("uprightBase",a)),r.rotation(a-e),r.scaleX(1),r.scaleY(t),r.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 s=.9*e;for(let n=0;n<t.sideFaces.length;n++){let r=t.sideFaces[n],a=t.outline[n],l=t.outline[(n+1)%t.outline.length];r.points([a.x,a.y,l.x,l.y,l.x+o.x,l.y+o.y,a.x+o.x,a.y+o.y]),r.opacity(s)}}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:xe)}sectionScreenBounds(e){return $s({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()>=ne,t=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,o=96,s=this.stage.width(),n=this.stage.height();for(let r of this.sections){let a=!0;if(e){let c=this.sectionScreenBounds(r);a=c.x+c.width>=-o&&c.y+c.height>=-o&&c.x<=s+o&&c.y<=n+o,a&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,r.memberIds)}r.liftGroupSeat.setViewportCulled(!a),this.labelLiftGroups.get(r.id)?.setViewportCulled(!a)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,this.seats.filter(r=>!this.seatSection.has(r.id)).map(r=>r.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 s=this.seatById.get(o);s&&e.push(s)}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 s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(o.id)??1:1;t.scale({x:s,y:s})}}}renderSeats(e=this.seats){dn({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/ve,s=new $l({x:e.x,y:e.y,data:Ct(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:pi(t),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return Zt(s),s}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[t,o]of this.accessGlyphById){let s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1,n=this.seatR*1.5/ve*s,a=this.accessGlyphFilterEmphasized(t)?Wo:No,l=Math.max(n,a/(ve*Math.max(e,.001)));o.scale({x:l,y:l}),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"))&&Ee(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??nt}seatLabelInk(e,t){let o=t.fill();return X(typeof o=="string"?o:"",this.seatPreferredLabelInk(e))}paintSeat(e,t){let o=this.seatById.get(t),s=this.statusById.get(t)??"free",n=this.selection.has(t),r=this.categoryDisplayColor(o.categoryKey),a=this.boothLabelById.get(t);e.dash(Tr),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let l=s==="held"&&this.ownedHold.has(t),c=l?null:An(s,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})):l?(e.fill(Se(r,this.effSelection===rt?.24:.1)),e.stroke(this.effSelection),e.strokeWidth(3)):e.fill(n&&this.effSelection===rt?Se(r,.28):r),this.seatMarks.paint(e,t,s,r,this.seatR,this.colorblind,this.seatInClosedSection(t)),Bi(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&s==="free"&&(e.stroke(gt(o.accessibility)),e.strokeWidth(n?3:2),e.dash([3,2])),a&&(a.text(s==="booked"?"SOLD":s==="held"?"HELD":o.label),a.fontSize(s==="free"?10:Math.min(10,Math.max(6,this.boothDims.get(o.rowId)?.width??40)/6)),a.fontStyle(s==="free"?"600":"800"),a.fill(s==="free"?this.theme.seatLabelColor??nt:"#ffffff"),a.offsetX(a.width()/2),a.offsetY(a.height()/2)),this.accessFilter&&s==="free"&&!n){let p=Mi(o,this.accessFilter);p==="other"?e.opacity(Js):p==="companion"&&e.opacity(en)}if(this.categoryHighlight&&s==="free"&&!n&&o.categoryKey!==this.categoryHighlight&&e.opacity(.25),this.categoryFilter&&s==="free"&&!n&&!this.categoryFilter.has(o.categoryKey)&&e.opacity(.22),this.commercialLimitedFilter&&s==="free"&&!n&&(o.commercial?.restrictedView||o.commercial?.obstructedView)&&e.opacity(.22),this.dimmedSections.size){let p=this.seatSection.get(t);(p?this.dimmedSections.has(p.id)||this.dimmedSections.has(p.logicalId)||p.zone!=null&&this.dimmedSections.has(p.zone):this.dimmedSections.has(uo))&&e.opacity(.18)}this.closedSections.size&&this.seatInClosedSection(t)&&(e.fill(ys),e.stroke(""),e.strokeWidth(0),e.dash(Tr),e.opacity(gs),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 p=e.fill();h.fill(pi(typeof p=="string"?p:"")),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 s=this.circleById.get(o.id);s&&this.paintSeat(s,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 s=this.sectionBounds(e);if(!s)return;let n=this.sectionMembers(e).map(c=>this.seatById.get(c)).filter(c=>c!=null),r=n.filter(c=>(this.statusById.get(c.id)??"free")==="free"||this.ownedHold.has(c.id)),a=(r.length?r:n).map(c=>this.renderedSeatPoint(c)),l=this.narrowSeatDetailFocus(a,s,o);this.focusRegion(l?.bounds??s,{animate:t,minScale:l?.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()>=Vo}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let t=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=mn(this.focusBackdropHost,t),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=yn(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,s=-1/0,n=(r,a)=>{r<e&&(e=r),a<t&&(t=a),r>o&&(o=r),a>s&&(s=a)};for(let r of this.seats)n(r.x,r.y);for(let r of this.sections)for(let a of r.outline)n(a.x,a.y);for(let r of this.gaById.values())for(let a of r.points)n(a.x,a.y);return Number.isFinite(e)?{x:e,y:t,width:Math.max(1,o-e),height:Math.max(1,s-t)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(t=>{let o=this.isSectionClosed(t)||t.free<=0,s=t.memberIds.some(a=>this.selection.has(a)),n=s||t.memberIds.some(a=>this.ownedHold.has(a)),r=this.focusedSectionId===t.id||this.focusedSectionId===t.logicalId;return{id:t.logicalId,label:t.label,outline:t.outline.map(a=>({...a})),...this.objectFloor.get(t.id)?{floorId:this.objectFloor.get(t.id)}:{},state:s?"selected":o?"inactive":"available",active:r,paint:{fill:t.shellFill,stroke:t.shellStroke},owned:n}});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=De(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,s){let n=this.assetGeneration;/^https?:\/\//i.test(t)&&(e.crossOrigin="anonymous");let r=new Promise(a=>{let l=!1,c=()=>{l||(l=!0,this.assetCancels.delete(d),a())},d=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}c()};this.assetCancels.add(d),e.onload=()=>{if(!this.exportMode){n===this.assetGeneration&&s(),c();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{n===this.assetGeneration&&s()}).catch(()=>{n===this.assetGeneration&&this.assetErrors.push(`${o} could not be decoded.`)}).finally(c)},e.onerror=()=>{n===this.assetGeneration&&this.assetErrors.push(`${o} could not be loaded.`),c()},e.src=t});this.assetPromises.push(r)}cancelAssetLoads(){this.assetGeneration++;for(let e of[...this.assetCancels])e();this.assetCancels.clear(),this.assetPromises=[],this.assetErrors=[]}renderBackgroundImage(e){Un(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,s)=>this.trackAssetImage(e,t,o,s),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){$n(this.objectDrawContext,e)}renderTable(e){qn(this.objectDrawContext,e)}renderText(e){Zn(this.objectDrawContext,e)}renderShape(e){Qn(this.objectDrawContext,e)}renderGA(e){Jn(this.objectDrawContext,e)}renderSection(e){let t=St(e.outline,e.holes),o=ae(this.canvasBackground),s=[],n=new Map,r=0,a=N(e.outline),l=this.seatIndex?Rt(this.seatIndex,a).map(P=>this.seatById.get(P)).filter(P=>!!P):this.seats;for(let P of l)this.seatSection.has(P.id)||ie(P,e.outline,e.holes)&&(s.push(P.id),n.set(P.categoryKey,(n.get(P.categoryKey)??0)+1),(this.statusById.get(P.id)??"free")==="free"&&r++);let c=e.color??ui([...n].map(([P,A])=>({hex:this.catColor.get(P)??"#6e7bff",w:A})),"#3a4358"),d=so(e.elevation),h=bt(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),p=h.height*Oe,m=new ut({listening:!1});this.bgLayer.add(m);let y=new ut({listening:!1});m.add(y);let u=new lt({listening:!0});this.seatLayer.add(u);let f=[];if(p>0){let P=ue(this.zoneColor.get(e.zone??"")??c,.42);for(let A=0;A<e.outline.length;A++){let _=new Ul({points:[],closed:!0,fill:P,stroke:B("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});f.push(_),m.add(_)}}y.moveToTop();let b=y,g=e.color??this.zoneColor.get(e.zone??"")??"#3a4358",S=Ae(e.outline,e.holes,{stroke:B(g,.5),strokeWidth:1,fill:B(g,.08),listening:!1},e.outlinePath);b.add(S);let v=Ae(e.outline,e.holes,{fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Ft,opacity:0,listening:!1},e.outlinePath);b.add(v);let w=e.labelPresentation?.labelStyle,k=w?.color??o.sectionInk,T=(w?.size??18)/18,C=new Lr({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});b.add(C);let L=new zi({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:X(o.sectionFill,k),listening:!1,perfectDrawEnabled:!1});L.offsetX(L.width()/2),L.offsetY(L.height()/2),b.add(L);let I=new zi({x:t.x,y:t.y,text:Y("map.seatsLeft",{count:r}),fontSize:12,fontStyle:Gt,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});I.offsetX(I.width()/2),b.add(I);let x={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:Us(e.outline,e.holes??[],t),memberCategoryKeys:new Set(s.map(P=>this.seatById.get(P)?.categoryKey).filter(Boolean)),shellCategoryColor:this.dominantSellableColor(s),shellFill:o.sectionFill,shellStroke:o.sectionStroke,labelArea:io(e.outline,e.holes),zone:e.zone,memberIds:s,total:s.length,free:r,baseFill:c,outlineTint:g,outlinePoly:S,blockPoly:v,namePlate:C,nameLabel:L,subLabel:I,preferredInk:k,labelScale:T,nameLabelFits:!1,subLabelFits:!0,elevation:d,liftWorld:p,rakeDeg:h.rake,surfaceFocal:s.length?{...this.seatById.get(s[0])?.focalPoint??this.isoCentre}:{...this.chartDoc?.focalPoint??this.isoCentre},frontDistanceWorld:0,rootGroupBg:m,bgZIndex:m.zIndex(),seatZIndex:u.zIndex(),liftGroupBg:y,liftGroupSeat:u,sideFaces:f},M=s.map(P=>this.seatById.get(P)).filter(P=>!!P),R=M.length?M:e.outline;x.frontDistanceWorld=Math.min(...R.map(P=>Math.hypot(P.x-x.surfaceFocal.x,P.y-x.surfaceFocal.y)));for(let P of s)this.seatSection.set(P,x);this.refreshSectionFill(x),this.refreshSectionHeat(x),this.sections.push(x)}refreshSectionHeat(e){ir(this.sectionLodPaintContext,e)}refreshSectionFill(e){sr(this.sectionLodPaintContext,e)}isSectionClosed(e){return Wi(this.sectionLodPaintContext,e)}dominantSellableColor(e){let t=new Map;for(let n of e){let r=this.seatById.get(n)?.categoryKey;!r||this.catByKey.get(r)?.notForSale||t.set(r,(t.get(r)??0)+1)}let o=null,s=0;for(let[n,r]of t)(r>s||r===s&&o!=null&&n<o)&&(o=n,s=r);return o?this.categoryDisplayColor(o):null}sectionAccessibleFree(e){let t=this.accessFilter;if(!t)return 0;let o=0;for(let s of e.memberIds){if((this.statusById.get(s)??"free")!=="free")continue;let n=this.seatById.get(s);n&&Ee(n,t)&&(o+=1)}return o}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){js({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?se(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(s=>{if(this.viewMode==="perspective"&&s.perspectiveAffine)return ie(t,s.outline.map(r=>this.perspectiveLocalPoint(this.projectedSectionPoint(s,r))),s.holes.map(r=>r.map(a=>this.perspectiveLocalPoint(this.projectedSectionPoint(s,a)))));let n=s.liftWorld>0?this.isoLiftLocal(s.liftWorld):{x:0,y:0};return ie({x:t.x-n.x,y:t.y-n.y},s.outline,s.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?Mi(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?hi(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let t=this.container;for(;t;){let o=hi(getComputedStyle(t).backgroundColor);if(o)return o;t=t.parentElement}}return Ri}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:U(this.canvasBackground)?tn:rt}setSelected(e,t,o=!1){let s=this.circleById.get(e);t?this.selection.add(e):(this.selectionFocusId===e&&this.setSelectionFocus(null),this.selection.delete(e)),s&&(this.paintSeat(s,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 Zs({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,s)=>this.resolveAutomaticRowLabelPosition(t,o,s),rowLabelBox:(t,o)=>this.rowLabelBox(t,o)},e)}sectionFrameScale(e){let t=this.sectionBounds(e);return t?gn(this.stage,t,this.zoomBounds()):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 s=this.focusedSectionId===o.logicalId,n=this.sectionFrameScale(o.logicalId)>this.stage.scaleX()*1.02;if(!s&&n){let r=this.seatById.get(e),a=r?this.renderedSeatPoint(r):void 0;this.opts.onSectionTap?this.opts.onSectionTap(o.logicalId,a):this.focusSection(o.logicalId,{anchor:a});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 un(this.screenPickingHost)}nearestSeatToScreen(e,t,o=!1){return hn(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>we||this.isGhostClick(e))return;let t=Ki(e.target);t&&this.handleSeatTap(t)}),this.seatLayer.on("mouseover",e=>{let t=Ki(e.target);if(!t)return;let o=this.seatById.get(t);if(!o)return;this.hoveredId=t,this.hoverRing.position(this.renderedSeatPoint(o));let s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1;this.hoverRing.scale({x:s,y:s}),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},s=Math.exp(-e.evt.deltaY*.002);this.zoomAbout(this.stage.scaleX()*G(s,.5,2),o)}),this.stage.on("click tap",e=>{if(this.moved>we||this.isGhostClick(e))return;let t=this.stage.getPointerPosition();if(!t)return;if(!this.cached){if(Ki(e.target))return;if(this.seatsRevealed()){let s=this.focusedSectionId,n=this.nearestSeatToScreen(t,Ie),r=n?this.seatSection.get(n):null;if(n&&(!s||r&&this.sectionMatchesFocus(r))){this.handleSeatTap(n);return}let a=n?null:this.nearestSeatToScreen(t,Ie,!0),l=a?this.seatSection.get(a):null;if(a&&(!s||l&&this.sectionMatchesFocus(l))){this.handleSeatTap(a);return}if(s&&this.opts.onBackdropTap&&!this.floorOverview){let d=this.sectionAt(t);if(d&&d!==s){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(s)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 s=this.floorOverview?this.sectionAt(t):null,n=(s?this.objectFloor.get(s):null)??this.deckFloorAt();if(n){this.opts.onDeckTap(n);return}}if(this.sections.length){let s=this.screenToWorld(t),n=this.owned.badgeAt(s)??this.sectionAt(t);if(n){let r=this.sectionTapAnchor(n,s);this.opts.onSectionTap?this.opts.onSectionTap(n,r):this.focusSection(n,{anchor:r});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,Ge*.9)),{min:e,max:Math.max(10*this.fitScale,4)}}zoomAbout(e,t){bn(this.stage,e,t,this.zoomBounds())&&(this.afterViewChange(),this.stage.batchDraw())}zoomToBounds(e,t){Sn(this.stage,e,this.zoomBounds(),t),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 s=this.stage.width(),n=this.stage.height(),{min:r,max:a}=this.zoomBounds(),l=1.12,c=Math.min(s/(o.width*l),n/(o.height*l)),d=G(Math.max(c,t?.minScale??r),r,a),h=s/2-(o.x+o.width/2)*d,p=n/2-(o.y+o.height/2)*d,m=this.stage.scaleX(),y=this.stage.x(),u=this.stage.y();if(Math.abs(d-m)<1e-4&&Math.abs(h-y)<.5&&Math.abs(p-u)<.5){this.settleView();return}let f=performance.now(),b=Math.max(180,Math.min(1200,t?.durationMs??this.cameraGlideMs));this.glideInProgress=!0;let g=S=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let v=Math.min(1,(S-f)/b),w=v<.5?4*v*v*v:1-Math.pow(-2*v+2,3)/2,k=m+(d-m)*w;this.stage.scale({x:k,y:k}),this.stage.position({x:y+(h-y)*w,y:u+(p-u)*w}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),v<1?this.glideRaf=requestAnimationFrame(g):(this.glideRaf=0,this.glideInProgress=!1,this.settleView())};this.glideRaf=requestAnimationFrame(g)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){let e=this.effScale();return e>=ne?"seats":this.zones.length&&e<Ge?"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),Kn(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let t=e==="sections"?(ge+ne)/2:this.seatRungScale(),o=this.stage.width(),s=this.stage.height(),n=this.getVisibleWorldRect(),r={x:n.x+n.width/2,y:n.y+n.height/2},a=r.x,l=r.y;if(e==="sections"&&this.sections.length>0){let p=this.sections.map(f=>{let b=N(f.outline);return{x:b.x+b.width/2,y:b.y+b.height/2}}),m=o/(t*2),y=s/(t*2);if(!p.some(f=>Math.abs(f.x-r.x)<=m&&Math.abs(f.y-r.y)<=y)){let f=p.reduce((b,g)=>{let S=(g.x-r.x)**2+(g.y-r.y)**2;return S<b.distance?{point:g,distance:S}:b},{point:p[0],distance:1/0});a=f.point.x,l=f.point.y}}let c=e==="seats"?this.seats.filter(p=>p.kind!=="booth"):[];if(c.length>0){let p=c[0],m=1/0;for(let y of c){let u=y.x-r.x,f=y.y-r.y,b=u*u+f*f;b<m&&(p=y,m=b)}a=p.x,l=p.y}let d=o/(t*1.12),h=s/(t*1.12);this.focusRegion({x:a-d/2,y:l-h/2,width:d,height:h})}seatRungScale(){return wn(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,t,o){return Ln({stageWidth:this.stage.width(),stageHeight:this.stage.height(),fullBounds:t,seatPoints:e,visibleBounds:this.getVisibleWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}seatLabelTargetScale(){let e=Te,t=new zi({fontSize:fe,fontStyle:"600",fontFamily:this.labelFont(),listening:!1}),o=this.seatR*2-3;for(let s of this.seats){if(s.kind==="booth"){e=Math.min(e,Te);continue}let n=fe*this.seatLabelScale(s);t.fontSize(n),t.text(Pt(s.displayLabel??s.label));let r=t.width()>o?Math.max(je,n*o/t.width()):n;e=Math.min(e,r)}return t.destroy(),Z/Math.max(je,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=qs({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,re):this.effScale(),t=Math.max(e,1e-4);for(let[n,r]of this.primaryFocalLabels)jn(n,r,t,(a,l)=>{this.sizeLabel(a,l,a.y())});this.hasSections?(nr(this.sectionLodPaintContext,e),this.owned.sync(e)):this.primaryFocalLabels.size&&this.bgLayer.batchDraw(),this.paintGAStateForView(),this.updateAccessGlyphs(e),this.seatGlyphDetail=cn(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail);let o=!this.exportMode&&e<ne;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(){rr(Jt,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<ne?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(r=>r.getClientRect({relativeTo:this.stage})).filter(r=>r.width>0&&r.height>0);if(!e.length)return this.bounds;let t=Math.min(...e.map(r=>r.x)),o=Math.min(...e.map(r=>r.y)),s=Math.max(...e.map(r=>r.x+r.width)),n=Math.max(...e.map(r=>r.y+r.height));return{x:t,y:o,width:Math.max(1,s-t),height:Math.max(1,n-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)),s=()=>{let n=this.exportSceneBounds(),r=Math.max(1,e-o*2),a=Math.max(1,t-o*2),l=Math.min(r/n.width,a/n.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-n.width*l)/2-n.x*l,y:(t-n.height*l)/2-n.y*l}),this.afterViewChange()};s(),s()}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(s){let n=s instanceof Error?s.message:String(s);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${n}`)}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:s}of this.freeTextById.values()){if(s==="ga-label"||s==="ga-capacity")continue;let r=s==="free-text"&&this.nodeBelongsToFocusedSection(t)||me(t.fontSize(),e);t.visible(r),o?.visible(r)}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(r=>r.id===t||r.logicalId===t||r.zone===t);if(!o.length)return!1;let s=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),n={x:s.x+s.width/2,y:s.y+s.height/2};return o.some(r=>ie(n,r.outline,r.holes))}buildRowLabelPlan(e){this.rowLabelPlan=er(e,{theme:this.theme,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:t=>this.objectFilteredOut(t)})}rowLabelBox(e,t,o=Q){return Hi(e,t,o)}resolveAutomaticRowLabelPosition(e,t,o){return tr(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(){dr(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 Xi=pt;function Cr(i,e){return new Xi(i,e)}function Pr(i,e,t){let o=new Map,s=new Map,n=new Map,r=new Map,a=[],l=new Map(no(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),s.set(h.label,h),n.set(h.id,h),a.push(h.id);let p=l.get(h.rowId),m=p&&"label"in p&&typeof p.label=="string"?p.label:void 0,y=p?.type==="row"?p.segmentedRow:void 0,u=y?.displayLabel??(p&&"displayLabel"in p&&typeof p.displayLabel=="string"&&p.displayLabel?p.displayLabel:m),f=t.get(h.rowId),b=p?.type==="table"?"table":p?.type==="booth"?"booth":"seat",g=u,S=y?.displayType?.trim()||(p&&"displayType"in p&&typeof p.displayType=="string"&&p.displayType.trim()?p.displayType.trim():void 0),v=h.displayLabel??h.label,w=v.split("-"),k=f||h.kind==="booth"?void 0:u&&v.startsWith(`${u}-`)?v.slice(u.length+1):w[w.length-1]??v;r.set(h.id,{objectId:h.rowId,objectType:b,sectionLabel:d.get(c.objectToSection.get(h.rowId)??""),rowLabel:g,seatNumber:k,...S?{displayType:S,rowType:S}:{}})}return{labelToId:o,labelToSeat:s,seatById:n,seatContext:r,allIds:a}}function Ir(i,e={}){let{baseMs:t=1e3,factor:o=2,maxMs:s=1/0,jitter:n=0,random:r=Math.random}=e,a=Math.min(t*o**Math.max(0,i),s);if(n<=0)return a;let l=Math.min(1,n);return a*(1-l+l*r())}function xr(i,e,t){return qe(i).map(o=>{let s=i.categories.find(n=>n.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(n=>t(n)==="free").length,categoryKey:o.categoryKey,tiers:s?.tiers,price:s?.tiers?.[0]?.price??s?.price??0,currency:e}})}function Mr(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 Rr(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(s=>i.closedMembers.has(s.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}var Yi=["background","rowLabelColor","textColor","selectionColor"];function Er(i,e){return!i||!e?!i&&!e:Yi.every(t=>i[t]===e[t])}function ft(i){let e=i??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function ei(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}var ke=class extends Error{constructor(t){super(t.message);this.status=422;this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function Ar(i,e){return!e||i.eventConfigurationId===e.id&&i.eventConfigurationVersion===e.version?i:{...i,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var ti=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(s=>{if(s.reference.id!==o.id||s.reference.version!==o.version||s.configuration.id!==o.id||s.configuration.version!==o.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return s.configuration})}return this.pending}};function _r(i){if(i!=null&&(!Number.isInteger(i)||i<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return i??null}function Br(i,e,t,o){if(t!=null&&!Array.isArray(t))throw new TypeError("picker: `selectionValidators` must be an array");let s=[],n=0,r=!1,a=!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");n=Math.max(n,Number(c.minimum))}else if(c?.type==="consecutiveSeats")r=!0;else if(c?.type==="noOrphanSeats")a=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(n&&s.push({type:"minimumSelectedPlaces",minimum:n}),r&&s.push({type:"consecutiveSeats"}),a&&s.push({type:"noOrphanSeats"}),i!=null&&n>i)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let l=Math.max(0,Math.floor(e??i??Math.max(o,n)));if(i!=null&&l<i)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&l<n)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:s,maxSelection:i??l}}function ql(i){let e=Number(i.slice(i.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Zl(i){if(i.length<=1)return!1;let e=i[0]?.objectId,t=i[0]?.categoryKey;if(!e||i.some(s=>s.objectId!==e||s.categoryKey!==t))return!0;let o=i.map(s=>ql(s.id)).sort((s,n)=>s-n);return o.some((s,n)=>s<0||n>0&&s!==o[n-1]+1)}function Fr(i,e,t,o,s){let n=o.find(l=>l.type==="minimumSelectedPlaces")?.minimum??0,r=t??n,a=[];return t!=null&&e!==t&&a.push("numberOfPlacesToSelect"),n&&e<n&&a.push("minimumSelectedPlaces"),o.some(l=>l.type==="consecutiveSeats")&&Zl(i)&&a.push("consecutiveSeats"),o.some(l=>l.type==="noOrphanSeats")&&s()&&a.push("noOrphanSeats"),{isValid:a.length===0,count:e,required:r,remaining:Math.max(0,r-e),seats:i,violations:a}}function Or(i){let{id:e,doc:t,seatById:o,groupedTableBySeatId:s}=i,n=t.objects.find(f=>f.type==="section"&&f.id===e);if(!n)return null;let r=i.sectionMembers(e),a=new Map,l=new Set,c=0,d=0;for(let f of r){let b=o.get(f);if(!b)continue;i.matchesAccessFilter&&i.statusOf(f)==="free"&&i.matchesAccessFilter(b)&&(d+=1);let g=s.get(f);if(g){if(l.has(g.label))continue;l.add(g.label),a.set(g.categoryKey,(a.get(g.categoryKey)??0)+g.maxOccupancy),i.statusOf(g.chairs[0]?.id??f)==="free"&&(c+=g.maxOccupancy)}else a.set(b.categoryKey,(a.get(b.categoryKey)??0)+1),i.statusOf(f)==="free"&&c++}let h=[...a.entries()].map(([f,b])=>{let g=t.categories.find(k=>k.key===f),S=g?.tiers?.length?g.tiers.map(k=>k.price):[g?.price??0],v=Math.min(...S),w=Math.max(...S);return{key:f,count:b,label:g?.label??f,color:g?.color??"#6e7bff",price:v,priceMin:v,priceMax:w}}).sort((f,b)=>f.price-b.price),p=h.map(f=>f.priceMin),m=h.map(f=>f.priceMax),y=n.zone?t.zones?.find(f=>f.id===n.zone):void 0,u=n.color??y?.color??h[0]?.color??"#6e7bff";return{id:e,...i.matchesAccessFilter?{accessibleLeft:d}:{},label:n.displayLabel??n.label,zoneLabel:y?.label??"",...n.entrance&&n.entrance.trim()?{entrance:n.entrance.trim()}:{},color:u,seatsLeft:c,priceMin:p.length?Math.min(...p):0,priceMax:m.length?Math.max(...m):0,categories:h}}var Ql=10,jl=15e3,Dr=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new ti;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.onVisibilityChange=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.accessFilter=null;this.hintShown=!1;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=_r(e.numberOfPlacesToSelect);let t=Br(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Ql);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=po(this._doc,this.hidden);if(!this.mapTheme)return e;let t={...e.theme??{}};for(let o of Yi){let s=this.mapTheme[o];s&&(t[o]=s)}return{...e,theme:t}}setMapTheme(e){return Er(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(n=>n.id),o=this.getActiveFloorId(),s=e.isFloorOverview?.()??!1;return e.setChart(this.visibleDoc(),o?{floorId:o}:void 0),s&&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),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let t=e.filter(s=>typeof s=="string");if(t.length===this.hidden.size&&t.every(s=>this.hidden.has(s)))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(s=>s.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 s=this.visibleDoc(),n=qe(s).find(r=>r.id===e.objectId);return{...n?.displayLabel?{displayLabel:n.displayLabel}:{},...n?.displayType?{displayType:n.displayType}:{}}}if(e.objectType==="table"){let s=this.groupedTablesByLabel.get(e.label);return{...s?.displayLabel&&s.displayLabel!==s.label?{displayLabel:s.displayLabel}:{},...s?.displayType?{displayType:s.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={},s=C=>Math.round((performance.now()-C)*100)/100;this.closed=!1;let n=performance.now(),r=(async()=>this.api.chart(this.key))().then(C=>({ok:!0,res:C,elapsed:s(n)}),C=>({ok:!1,error:C,elapsed:s(n)})),a=performance.now(),l=(async()=>this.api.objects(this.key))().then(C=>({ok:!0,objects:C,elapsed:s(a)}),()=>({ok:!1,elapsed:s(a)})),c=await r;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let d=c.res;if(this.closed)return null;this._doc=Ar(d.doc,d.event.eventConfiguration),this.eventConfiguration.reset(d.event.eventConfiguration);let h=performance.now();try{let C=Go(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=$e(d.doc);let p=Pr(d.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=p.labelToId,this.labelToSeat=p.labelToSeat,this.seatById=p.seatById,this.seatContext=p.seatContext,this.allIds=p.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=s(h);let m=d.event.currency??this.opts.currency;this.currency=m??"USD";let y=performance.now(),u=Cr(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:m,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=s(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=s(y),this.closed)return u.destroy(),null;this.renderer=u;let f=null,b="free",g=[],S=await l;if(S.ok){let C=S.objects;this.hidden=new Set(C.hidden??[]),g=(C.closed??[]).filter(L=>typeof L=="string"),f=C.seats,b=C.default??"free"}if(o.loadStatuses=S.elapsed,this.closed)return u.destroy(),this.renderer=null,null;let v=performance.now();u.setChart(this.visibleDoc()),(d.doc.floors?.length??0)>1&&u.setFloorOverview?.(!0),this.opts.colorblindSafe&&u.setColorblindSafe?.(!0),o.buildScene=s(v),this.closedSections=new Set(g);let w=performance.now();g.length&&u.setClosedSections?.(g),f&&this.applySeatsMap(f,b),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=s(w);let k=performance.now();u.forceDraw(),o.firstPaint=s(k);let T=performance.now();return this.attachVisibilityListener(),this.connect(),o.startRealtime=s(T),o.controllerTotal=s(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,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],t=new Set;for(let o of this.renderer.getSelection()){let s=this.groupedTableBySeatId.get(o.id);s?t.has(s.label)||(t.add(s.label),e.push(this.toTableSeat(s))):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 s=this.groupedTableBySeatId.get(o)??this.groupedTablesByLabel.get(o);if(s)s.chairs.forEach(n=>t.add(n.id)),this.hold_?.labels.includes(s.label)||(this.tableQuantities.set(s.label,s.mode==="whole"?s.capacity:s.minOccupancy),s.mode==="variable"&&this.confirmedVariableTables.delete(s.label));else{let n=this.seatById.has(o)?o:this.labelToId.get(o);n&&t.add(n)}}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(r=>r.label)),o=new Set,s=[];for(let r of e){let a=this.groupedTableBySeatId.get(r)??this.groupedTablesByLabel.get(r);if(a)this.tableTierResolution(a).kind==="invalid"?s.push(a.label):a.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let l=this.seatById.has(r)?r:this.labelToId.get(r);if(!l||!this.isSelectableByPolicy(l))continue;let c=this.seatById.get(l);c&&this.seatTierResolution(c).kind==="invalid"?s.push(c.label):o.add(l)}}if(s.length&&this.emitError(new ke(mi(s))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let n=this.getSelection().filter(r=>!t.has(r.label));return n.length&&this.emitSelectionChange(),n}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((s,n)=>s+(n.quantity??1),0);return Fr(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&&fi(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(n=>e.add(n.id));continue}let s=this.seatById.has(t)?t:this.labelToId.get(t);s&&e.add(s)}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 s=o.mode==="whole"?o.capacity:Math.floor(t);if(!Number.isInteger(s)||s<o.minOccupancy||s>o.maxOccupancy)return!1;let n=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,s),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,n),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,t,o){let s=this.groupedTablesByLabel.get(e),n=this.hold_;if(!s||s.mode!=="variable"||!n?.labels.includes(e))return null;let r=Math.floor(t);if(!Number.isInteger(r)||r<s.minOccupancy||r>s.maxOccupancy)return null;if((n.items??[]).filter(d=>d.label!==e).reduce((d,h)=>d+(h.quantity??1),0)+r>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let l=(n.items??[]).map(d=>({label:d.label,tierId:d.tierId,quantity:d.label===e?r:d.quantity}));if(!l.some(d=>d.label===e))return null;let c=await this.api.hold(this.key,l,o,n.holdId);return this.tableQuantities.set(e,r),this.setHold({holdId:c.holdId,labels:l.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(s=>s.id):[e.id]),this.emitSelectionChange();return}if((t?this.tableTierResolution(t):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(t?t.chairs.map(s=>s.id):[e.id]),this.emitError(new ke(mi([t?.label??e.label]))),this.emitSelectionChange();return}if(t){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(t.chairs.map(s=>s.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(t.chairs.map(s=>s.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 s=e??this.getSelection().map(l=>l.label),n=(this.hold_?.items??[]).filter(l=>l.objectType==="ga"),r=[...new Set([...n.map(l=>l.label),...s])];if(!r.length)return null;let a=this.ticketIssue(r);if(a)throw new ke(a);if(this.hold_&&this.holdCovers(r))return this.hold_;try{let l=r.map(d=>{let h=n.find(y=>y.label===d);if(h)return{label:d,tierId:h.tierId,quantity:h.quantity};let p=this.labelToSeat.get(d),m=p?this.toSeat(p):null;return{label:d,...m?.tierId?{tierId:m.tierId}:{},...this.tableQuantityRequest(m)}}),c=await this.api.hold(this.key,l,t,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:r,expiresAt:c.expiresAt,items:c.items}),this.hold_}catch(l){throw this.handle409Conflicts(l),l}}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(s=>s.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 Rr({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 s of t.sectionMembers?.(o)??[])e.add(s);return e}getGAAreas(){let e=this.visibleDoc();return e?xr(e,this.currency,t=>this.statusOf(t)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Mr(this.getGAAreas(),this.gaSelected))}async holdGA(e,t,o={}){let s=this.visibleDoc();if(!s||!Number.isFinite(t)||t<1)return null;let n=qe(s).find(d=>d.id===e);if(!n)return null;let r=wt(n).filter(d=>!this.hold_?.labels.includes(d)&&this.statusOf(d)==="free").slice(0,Math.floor(t));if(r.length!==Math.floor(t))return null;let a=new Map;for(let d of this.hold_?.items??[])a.set(d.label,{label:d.label,tierId:d.tierId,quantity:d.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let d of this.hold_.seats)a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{}});for(let d of this.getSelection())a.set(d.label,{label:d.label,...d.tierId?{tierId:d.tierId}:{},...this.tableQuantityRequest(d)});for(let d of r)a.set(d,{label:d,...o.tierId?{tierId:o.tierId}:{}});let l=[...a.values()],c=await this.api.hold(this.key,l,o.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:l.map(d=>d.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}hasPremiumSeats(){for(let e of this.labelToSeat.values())if(e.commercial?.premium)return!0;return!1}getBestAvailableZones(){let e=this.visibleDoc();if(!e?.zones?.length)return[];let t=new Set(kt(e).sections.filter(o=>o.seatCount>0&&!!o.zone).map(o=>o.zone));return e.zones.filter(o=>t.has(o.id)).map(o=>({id:o.id,label:o.label}))}pickPremiumBlock(e,t,o){let s=this.visibleDoc();if(!s?.objects?.length)return null;let n=s.focalPoint??{x:0,y:0},r=new Set(this.groupedTablesByObject.keys()),a=$e(s).filter(p=>!r.has(p.rowId)),l=new Set(this.hold_?.labels??[]),c=new Set;for(let p of a){if(l.has(p.label)||this.seatTierResolution(p).kind==="invalid"||this.accessFilter&&!Ee(p,this.accessFilter))continue;let m=this.labelToId.get(p.label);((m?this.getStatus(m):void 0)??"free")==="free"&&c.add(p.label)}let d=Fo(a,c,{qty:e,categoryKey:t,zoneId:o,focal:n,preferPremium:!0});return d.labels.length!==e?null:d.labels.every(p=>this.labelToSeat.get(p)?.commercial?.premium)?[...d.labels]:null}async bestAvailable(e,t,o={}){let s=this.renderer;if(!s)return null;if(o.preferPremium){let n=this.pickPremiumBlock(e,t,o.zoneId);if(n){if(this.hold_&&!await this.release())return null;try{let r=n.map(d=>{let h=this.labelToSeat.get(d),p=h?this.toSeat(h):null;return{label:d,...p?.tierId?{tierId:p.tierId}:{}}}),a=await this.api.hold(this.key,r,o.ttlMs);s.clearSelection();let l=this.idsForLabels(n);l.length&&s.setStatus(l,"held"),this.setHold({holdId:a.holdId,labels:[...n],expiresAt:a.expiresAt,items:a.items});let c=n.map(d=>this.labelToSeat.get(d)).filter(d=>!!d).map(d=>this.toSeat(d));return this.opts.onSelectionChange?.(c),this.hold_}catch(r){let{status:a,reason:l}=ft(r);if(a===409&&l==="event_closed")throw this.opts.onSalesClosed?.(),r}}}if(this.hold_&&!await this.release())return null;try{let n=await this.api.bestAvailable(this.key,e,t,o.zoneId,o.ttlMs);s.clearSelection();let r=this.idsForLabels(n.labels);r.length&&s.setStatus(r,"held"),this.setHold({holdId:n.holdId,labels:[...n.labels],expiresAt:n.expiresAt,items:n.items});let a=n.labels.map(l=>this.labelToSeat.get(l)).filter(l=>!!l).map(l=>this.toSeat(l));return this.opts.onSelectionChange?.(a),this.hold_}catch(n){let{status:r,reason:a}=ft(n);throw r===409&&a==="event_closed"&&this.opts.onSalesClosed?.(),n}}async book(e,t,o){let s=this.renderer;if(!s)return null;if(!this.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let n=t??this.getSelection().map(c=>c.label);if(!n.length)return null;let r=this.ticketIssue(n);if(r)throw new ke(r);let a;try{if(this.hold_&&this.holdCovers(n))a=this.hold_.holdId;else{let c=this.hold_?.holdId,d=await this.api.hold(this.key,n.map(h=>{let p=this.labelToSeat.get(h),m=p?this.toSeat(p):null;return{label:h,...m?.tierId?{tierId:m.tierId}:{},...this.tableQuantityRequest(m)}}),o,c);a=d.holdId,this.setHold({holdId:a,labels:[...n],expiresAt:d.expiresAt,items:d.items})}await this.api.book(this.key,n,a,e)}catch(c){let{status:d,conflicts:h,reason:p}=ft(c);if(this.clearHold(),d===409&&p==="event_closed")this.opts.onSalesClosed?.();else if(d===409&&h?.length){let m=new Set(h.map(f=>f.label)),y=this.idsForLabels(m);y.length&&(s.setStatus(y,"booked"),s.deselect(y),this.resetTableQuantitiesForLabels(m));let u=n.filter(f=>!m.has(f));u.length&&a&&this.api.release(this.key,u,a).catch(()=>{}),this.emitSelectionChange()}else a&&this.api.release(this.key,n,a).catch(()=>{});throw c}let l=this.idsForLabels(n);return l.length&&(s.setStatus(l,"booked"),s.deselect(l)),this.clearHold(),this.resetTableQuantitiesForLabels(n),this.emitSelectionChange(),this.opts.onBook?.(e),n}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(a=>t.labels.includes(a));if(!o.length)return!0;try{let a=await this.api.release(this.key,o,t.holdId);if(!this.releaseConfirmed(a,o))return await this.resnapshot(),!1}catch(a){return this.emitError(a),!1}if(this.hold_?.holdId!==t.holdId)return!0;let s=t.labels.filter(a=>!o.includes(a)),n=t.items?.filter(a=>!o.includes(a.label));s.length?this.setHold({...t,labels:s,items:n}):this.clearHold(),this.resetTableQuantitiesForLabels(o);let r=this.idsForLabels(o);return r.length&&(this.renderer?.deselect(r),this.renderer?.setStatus(r,"free")),!0}releaseConfirmed(e,t){let o=e?.released;return!Array.isArray(o)||t.every(s=>o.includes(s))}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(s=>s.notForSale).map(s=>s.key));if(!t.size)return[];let o=[];for(let[s,n]of this.seatById)t.has(n.categoryKey)&&o.push(s);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()}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),s=a=>a.some(l=>l.type==="row"&&(o.has(l.categoryKey)||(l.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||l.type==="gaArea"&&o.has(l.categoryKey)),n=this.getActiveFloorId(),r=t.floors.find(a=>a.id===n);return r&&s(r.objects)?null:t.floors.find(a=>s(a.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:Or({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=>Ee(t,this.accessFilter)}:{}})}destroy(){if(this.closed=!0,this.detachVisibilityListener(),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,s=e.displayLabel?{displayLabel:e.displayLabel}:void 0,n=e.accessibility?.length?{accessibility:e.accessibility}:void 0,r=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,a=this.seatContext.get(e.id),l=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!l)return{id:e.id,label:e.label,...s,...a,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...n,...r};let d=c.tier;return{id:e.id,label:e.label,...s,...a,categoryKey:e.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...o,...n,...r}}toTableSeat(e){let t=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(r=>At(this._doc,this.tableTierSeat(e),r.id).kind==="resolved"),s=this.tableTierResolution(e),n=s.kind==="resolved"?s.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:n?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:n?.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(r=>r.id)}}describeSeat(e,t){let o=this._doc?.categories.find(s=>s.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=Oo(this._doc,e);return t.length?t:void 0}seatTierResolution(e){return this._doc?At(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 At(this._doc,this.tableTierSeat(e),this.seatTiers.get(t))}setSeatTier(e,t){let o=this.seatById.get(e);if(!o)return;let s=this.tiersForSeat(o);if(s){if(t==null)this.seatTiers.delete(e);else if(s.some(n=>n.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 s=this.labelToSeat.get(o);s&&t.push(this.toSeat(s))}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 Do(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"?Y("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=new Set(e.getSelection().map(n=>n.id));(o.size?fi(this.seatById.values(),n=>e.getStatus(n),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(Y("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(n=>t.labels.includes(n)))return!1;let o=new Map((t.items??[]).map(n=>[n.label,n.tierId])),s=new Map((t.items??[]).map(n=>[n.label,n.quantity??1]));return e.every(n=>{let r=this.labelToSeat.get(n),a=r?this.toSeat(r):null,l=a?.tierId??null;return(a?.objectType!=="table"||(a.bookingMode!=="variable"||this.confirmedVariableTables.has(n))&&(!s.has(n)||s.get(n)===a.quantity))&&(!o.has(n)||o.get(n)===l)})}handle409Conflicts(e){let{status:t,conflicts:o}=ft(e);if(t!==409||!o?.length)return;let s=this.renderer;if(!s)return;let n=this.idsForLabels(o.map(r=>r.label));n.length&&(s.deselect(n),s.setStatus(n,"held"),this.resetTableQuantitiesForLabels(o.map(r=>r.label))),this.emitSelectionChange()}setHold(e,t="created"){for(let n of e.items??[])this.groupedTablesByLabel.has(n.label)&&n.quantity!=null&&(this.tableQuantities.set(n.label,n.quantity),this.groupedTablesByLabel.get(n.label)?.mode==="variable"&&this.confirmedVariableTables.add(n.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 s=Math.max(0,o.expiresAt-Date.now());this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},s),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(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 s=ei(t);this.allIds.length&&o.setStatus(this.allIds,s),o.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let n={free:[],held:[],booked:[],not_for_sale:[]};for(let[a,l]of Object.entries(e))n[ei(l)].push(...this.idsForLabel(a));["free","held","booked","not_for_sale"].forEach(a=>{a!==s&&n[a].length&&o.setStatus(n[a],a)});let r=this.notForSaleCategorySeatIds();r.length&&o.setStatus(r,"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))}async resnapshot(){try{let e=await this.api.objects(this.key);this.applySeatsMap(e.seats,e.default??"free")}catch{}}async refresh(){await this.resnapshot()}attachVisibilityListener(){if(this.onVisibilityChange||typeof document>"u"||typeof document.addEventListener!="function")return;let e=()=>{this.closed||document.visibilityState==="visible"&&this.resnapshot().then(()=>{this.closed||this.renderer?.forceDraw()})};this.onVisibilityChange=e,document.addEventListener("visibilitychange",e)}detachVisibilityListener(){this.onVisibilityChange&&(typeof document<"u"&&typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onVisibilityChange=null)}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),s=this.syncClosed(t);o&&this.resnapshot(),(o||s)&&this.opts.onStatusChange?.()}}}applyStatusChanges(e){let t=this.renderer;if(t){for(let o of e){this.liveStatuses.set(o.label,o.status);let s=this.idsForLabel(o.label);if(!s.length)continue;let n=ei(o.status);this.opts.flashOnLiveChange&&n!=="free"&&s.some(r=>t.getStatus(r)==="free")&&!this.hold_?.labels.includes(o.label)&&s.forEach(r=>t.flashSeat(r,n==="held"?"#f4b740":"#f43f5e")),t.setStatus(s,n)}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 s;try{s=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(!this.renderer||!s||typeof s!="object")return;let r=s;Array.isArray(r.hidden)&&this.syncHidden(r.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.()),Array.isArray(r.closed)&&this.syncClosed(r.closed)&&this.opts.onStatusChange?.(),r.type!=="hidden"&&(r.seats&&typeof r.seats=="object"?this.applySeatsMap(r.seats):Array.isArray(r.changes)&&this.applyStatusChanges(r.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=Ir(e,{baseMs:1e3,maxMs:jl,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}};var Jl=5,ec=-1.1,Ui=35;function $i(i,e){let t=i-ee,o=Math.atan2(Jl-t,e)*180/Math.PI,s=Math.atan2(ec-t,e)*180/Math.PI;return s<-Ui&&(o+=-Ui-s,s=-Ui),{topPitch:o,basePitch:s}}var $=2048,de=1024,yt=oo,E=Math.PI*2,tc=de/180,Ye=i=>(i+180)/360*$,W=i=>(90-i)/180*de;function Vr(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 zr(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 ii=96,Qi=360/ii,ic=.6,qi=[17,23,42];function Zi(i,e,t=1){let o=Math.max(0,Math.min(.58,e)),s=Math.round(i[0]+(qi[0]-i[0])*o),n=Math.round(i[1]+(qi[1]-i[1])*o),r=Math.round(i[2]+(qi[2]-i[2])*o);return`rgba(${s},${n},${r},${t})`}function Gr(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,s=(i%360+360)%360/60,n=o*(1-Math.abs(s%2-1)),r=0,a=0,l=0;s<1?[r,a,l]=[o,n,0]:s<2?[r,a,l]=[n,o,0]:s<3?[r,a,l]=[0,o,n]:s<4?[r,a,l]=[0,n,o]:s<5?[r,a,l]=[n,0,o]:[r,a,l]=[o,0,n];let c=t-o/2;return[Math.round((r+c)*255),Math.round((a+c)*255),Math.round((l+c)*255)]}var Hr=new Map;function Nr(i){if(!i)return null;let e=Hr.get(i);if(e)return e;let t=2166136261;for(let n=0;n<i.length;n++)t^=i.charCodeAt(n),t=Math.imul(t,16777619);let o=(t>>>0)%360,s=te(o,.3,.42);return Hr.set(i,s),s}function oc(i,e,t,o){let s=new Array(ii).fill(null),n=0,r=i.sectionId;for(let a of e){if(a.id===i.id)continue;let l=a.sectionId;if(!l||r&&l===r)continue;let c=a.x-i.x,d=a.y-i.y,h=Math.hypot(c,d)*yt;if(h<1.5||h>95)continue;let p=a.eyeHeightM??ee,m=p-o;Math.abs(m)>n&&(n=Math.abs(m));let y=Math.atan2(m,h)*180/Math.PI,u=Math.atan2(p-ee-o,h)*180/Math.PI,b=((Math.atan2(c,-d)-t)*180/Math.PI+540)%360-180,g=Math.min(ii-1,Math.max(0,Math.floor((b+180)/Qi))),S=y>34&&h<16,v=s[g];v?(y>v.top&&(v.top=y),u<v.base&&(v.base=u),h<v.nearM&&(v.nearM=h,v.tint=Nr(a.categoryKey)),v.overhead=v.overhead||S):s[g]={top:y,base:u,nearM:h,overhead:S,tint:Nr(a.categoryKey)}}return{bins:s,maxDelta:n}}function sc(i,e,t,o){for(let s=0;s<ii;s++){let n=e[s];if(!n)continue;let r=-180+s*Qi,a=t(r),l=t(r+Qi);if(!(l>a))continue;let c=Math.min(72,n.top),d=Math.min(n.base,-4),h=o(c),p=o(d);if(p<=h)continue;let m=n.nearM/95,y=n.tint,u=y?Gr([44,54,80],y,.34):[44,54,80],f=y?Gr([24,30,48],y,.28):[24,30,48],b=i.createLinearGradient(0,h,0,p);b.addColorStop(0,Zi(u,m)),b.addColorStop(.24,Zi(f,m)),b.addColorStop(1,Zi([10,13,22],m)),i.fillStyle=b,i.fillRect(a,h,l-a+1,p-h),i.fillStyle=`rgba(150,165,205,${.35*(1-m*.55)})`,i.fillRect(a,h,l-a+1,1.5);let S=Math.min(p,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(a,T,l-a+1,1.5),i.fillStyle=`rgba(120,134,170,${.1*w})`,i.fillRect(a,T+1.5,l-a+1,1.2)}}if(n.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(a,v,l-a+1,h-v),i.fillStyle="rgba(120,130,160,0.14)",i.fillRect(a,h-1.5,l-a+1,1.5)}}}function nc(i,e,t){let s=new Array(72).fill(!1),n=new Array(72).fill(1/0),r=new Set,a=0;for(let b of t){a++,b.sectionId&&r.add(b.sectionId);let g=b.x-e.x,S=b.y-e.y,v=Math.hypot(g,S)*yt;if(v<.5)continue;let w=Math.atan2(g,-S),k=Math.floor((w+Math.PI)/E*72);k<0?k=0:k>=72&&(k=71),s[k]=!0,v<n[k]&&(n[k]=v)}let l=0,c=[];for(let b=0;b<72;b++)s[b]&&(l++,c.push(n[b]));let d=l/72*360;c.sort((b,g)=>b-g);let h=c.length?c[c.length>>1]:0,p=c.length?c[Math.floor(c.length*.15)]??h:0,m=c.length?c[Math.floor(c.length*.85)]??h:0,y=p>.5?m/p:1,u=Vr(`${a}|${[...r].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),f;return d>=300&&h>11&&y>1.35?f="sport":d>=285?f="arena":f="proscenium",{mode:f,seed:u,voidRadiusM:h,aspect:y}}var rc=5;function ac(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 lc(i,e,t,o,s){let n=o*.44,r=o*s.shoulderK,a=o*.66,l=o*1.68,c=o*5.4,d=`rgba(${s.clothing[0]},${s.clothing[1]},${s.clothing[2]},${s.alpha})`,h=`rgba(${s.tone[0]},${s.tone[1]},${s.tone[2]},${s.alpha})`;i.save(),i.translate(e,t);let p=s.lean*o;i.fillStyle=d,i.beginPath(),i.moveTo(-n,a),i.quadraticCurveTo(-n*1.18,l-p-o*.6,-r,l-p),i.quadraticCurveTo(-r*1.05,l+o*1.2,-r*.94,c),i.lineTo(r*.94,c),i.quadraticCurveTo(r*1.05,l+o*1.2,r,l+p),i.quadraticCurveTo(n*1.18,l+p-o*.6,n,a),i.closePath(),i.fill(),i.fillStyle=h,i.fillRect(-n*.82,o*.5,n*1.64,o*.9),i.save(),i.rotate(s.tilt),i.translate(s.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,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()),ac(i,o,s.hair),s.rim>.01&&(i.strokeStyle=`rgba(245,205,150,${(.5*s.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(),s.rim>.01&&(i.strokeStyle=`rgba(240,200,150,${(.28*s.rim).toFixed(3)})`,i.lineWidth=Math.max(1,o*.12),i.beginPath(),i.moveTo(-r*.8,l-o*.05),i.quadraticCurveTo(-n,l-o*.75,0,l-o*.82),i.quadraticCurveTo(n,l-o*.75,r*.8,l-o*.05),i.stroke()),i.restore()}function cc(i,e,t,o,s,n,r){i.fillStyle=`rgba(${s[0]},${s[1]},${s[2]},${r})`,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(${n[0]},${n[1]},${n[2]},${r})`,i.beginPath(),i.ellipse(e,t,o*.9,o*1.05,0,0,E),i.fill()}function Ji(i,e,t,o,s){let n=o*.1,r=t-o*.9,a=t-o*.74,l=t-o*.46,c=o*.13,d=o*.09,h=`rgba(${s.tone[0]},${s.tone[1]},${s.tone[2]},${s.alpha})`,p=i.createRadialGradient(e,t,1,e,t,o*.24);p.addColorStop(0,"rgba(0,0,0,0.4)"),p.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.scale(1,.28),i.fillStyle=p,i.beginPath(),i.ellipse(e,t/.28,o*.24,o*.24,0,0,E),i.fill(),i.restore(),i.fillStyle=h,i.beginPath(),i.moveTo(e-d,l),i.lineTo(e-d*.7,t),i.lineTo(e-d*.1,t),i.lineTo(e-d*.1,l+o*.02),i.lineTo(e+d*.1,l+o*.02),i.lineTo(e+d*.1,t),i.lineTo(e+d*.7,t),i.lineTo(e+d,l),i.closePath(),i.fill(),i.beginPath(),i.moveTo(e-c,a),i.quadraticCurveTo(e-c*.9,l-o*.12,e-d,l),i.lineTo(e+d,l),i.quadraticCurveTo(e+c*.9,l-o*.12,e+c,a),i.quadraticCurveTo(e,a-o*.05,e-c,a),i.closePath(),i.fill(),i.lineCap="round",i.lineJoin="round",i.strokeStyle=h,i.lineWidth=o*.055;let m=a+o*.02;s.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()):s.pose===2?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e+d*1.4,l-o*.02),i.moveTo(e+c*.8,m),i.lineTo(e-d*.4,l-o*.06),i.stroke(),i.fillStyle=h,i.beginPath(),i.ellipse(e+d*1.5,l-o*.04,o*.07,o*.09,-.5,0,E),i.fill()):s.pose===3?(i.beginPath(),i.moveTo(e-c*.8,m),i.lineTo(e-c*.2,r+n*.6),i.moveTo(e+c*.8,m),i.lineTo(e+c*1.1,l),i.stroke(),i.lineWidth=o*.02,i.beginPath(),i.moveTo(e-c*.2,r+n*.9),i.lineTo(e-c*.2,t-o*.02),i.stroke()):(i.beginPath(),i.moveTo(e-c*.85,m),i.lineTo(e-c*.95,l+o*.02),i.moveTo(e+c*.85,m),i.lineTo(e+c*.95,l+o*.02),i.stroke()),i.fillStyle=h,i.fillRect(e-n*.34,r+n*.6,n*.68,n*.9),i.beginPath(),i.ellipse(e,r,n*.86,n*1.05,0,0,E),i.fill(),s.rimStrength>.01&&(i.strokeStyle=`rgba(${s.rim[0]},${s.rim[1]},${s.rim[2]},${(.6*s.rimStrength).toFixed(3)})`,i.lineWidth=Math.max(1,o*.02),i.beginPath(),i.moveTo(e-c,a),i.lineTo(e-n*.6,r+n*.4),i.moveTo(e-n*.7,r),i.ellipse(e,r,n*.84,n*1.02,0,Math.PI*1.05,Math.PI*1.55),i.stroke())}function oi(i,e,t,o,s,n,r,a,l){i.save(),i.globalCompositeOperation="lighter";let c=i.createLinearGradient(0,t,0,s);c.addColorStop(0,`rgba(${a},${l})`),c.addColorStop(.5,`rgba(${a},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${a},0)`),i.fillStyle=c,i.beginPath(),i.moveTo(e-n,t),i.lineTo(o-r,s),i.lineTo(o+r,s),i.lineTo(e+n,t),i.closePath(),i.fill(),i.restore()}function eo(i,e,t,o,s){let n=i.createRadialGradient(e,t,0,e,t,o*3);n.addColorStop(0,`rgba(${s},0.9)`),n.addColorStop(.4,`rgba(${s},0.35)`),n.addColorStop(1,`rgba(${s},0)`),i.fillStyle=n,i.beginPath(),i.arc(e,t,o*3,0,E),i.fill(),i.fillStyle=`rgba(${s},1)`,i.beginPath(),i.arc(e,t,o,0,E),i.fill()}function hm(i,e,t){let o=document.createElement("canvas");o.width=$,o.height=de;let s=o.getContext("2d"),n=e.x-i.x,r=e.y-i.y,a=Math.hypot(n,r),l=Math.max(2,a*yt),c=i.eyeHeightM??ee,d=nc(i,e,t),h=zr(d.seed),p=210+h()*150,m=te(220+(h()-.5)*60,.55,.82),y=`${m[0]},${m[1]},${m[2]}`,u=s.createLinearGradient(0,0,0,de);u.addColorStop(0,"#080b12"),u.addColorStop(.42,"#12182c"),u.addColorStop(.5,"#1c2440"),u.addColorStop(.56,"#151b2c"),u.addColorStop(.78,"#171e30"),u.addColorStop(1,"#131829"),s.fillStyle=u,s.fillRect(0,0,$,de);let f=s.createLinearGradient(0,W(-6),0,de);f.addColorStop(0,"rgba(30, 37, 56, 0)"),f.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),f.addColorStop(1,"rgba(22, 28, 44, 0.12)"),s.fillStyle=f,s.fillRect(0,W(-6),$,de-W(-6));let b=Math.atan2(n,-r),g=oc(i,t,b,c),S=g.maxDelta>=ic;S&&sc(s,g.bins,Ye,W);let v=Math.max(.3,Math.min(1,1-(l-6)/60)),w=$i(c,l),k=Math.min(80,Math.atan2(4,l)*180/Math.PI),T=Math.min(45,w.topPitch),C=w.basePitch;d.mode==="sport"?uc(s,l,c,d,v,p,y,h):d.mode==="arena"?hc(s,l,c,d,v,y,h):dc(s,k,T,C,v,p,y,h);let L=d.mode==="sport"?34:24+Math.floor(h()*8);s.fillStyle=`rgba(${y},0.8)`;for(let x=0;x<L;x++){let M=(x+.5)/L*$,R=W(d.mode==="sport"?58:54+x*7%3*6);s.beginPath(),s.arc(M,R,d.mode==="sport"?2.6:3.2,0,E),s.fill()}pc(s,i,t,e,b,c,n,r,S,d);let I=s.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)"),s.fillStyle=I,s.fillRect(0,0,$,de),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(l)}}function dc(i,e,t,o,s,n,r,a){let l=Ye(-e),c=Ye(e),d=W(t),h=W(o),p=c-l,m=h-d,y=W(Math.min(50,t+10)),u=p*(1.1+(1-s)*.5),f=i.createRadialGradient($/2,(d+h)/2,8,$/2,(d+h)/2,u);f.addColorStop(0,"rgba(255, 214, 150, 0.34)"),f.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),f.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),f.addColorStop(1,"rgba(99, 102, 241, 0)"),i.fillStyle=f,i.fillRect(l-p*.6,d-m*1.2,p*2.2,m*3.4);let b=te(n,.62,.55),g=te(n+40,.7,.5),S=te(n+70,.78,.52);i.save(),i.beginPath(),i.rect(l,d,p,m),i.clip();let v=i.createLinearGradient(0,d,0,h);v.addColorStop(0,`rgb(${b[0]},${b[1]},${b[2]})`),v.addColorStop(.5,`rgb(${g[0]},${g[1]},${g[2]})`),v.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),i.globalAlpha=.8,i.fillStyle=v,i.fillRect(l,d,p,m),i.globalAlpha=1;let w=i.createRadialGradient($/2,(d+h)/2,p*.12,$/2,(d+h)/2,p*.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(l,d,p,m),i.restore();let k=3+Math.floor(a()*3),T=m*.46,C=h-m*.08;for(let _=0;_<k;_++){let j=(_+1)/(k+1),V=l+p*(.22+j*.56+(a()-.5)*.06);Ji(i,V,C,T*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:te(n+20,.5,.7),rimStrength:.7})}i.fillStyle="#05070d",i.fillRect(l-p*.5,y,p*.5,h-y),i.fillRect(c,y,p*.5,h-y);let L=p*.055+3,I=L*1.35;i.fillStyle="#03050a",i.beginPath(),i.moveTo(l,h),i.lineTo(l-L,h),i.lineTo(l-I,y),i.lineTo(l+p*.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-p*.012,y),i.closePath(),i.fill(),i.fillRect(l-I,y,p+I*2,(h-y)*.12);let x=m*.14,M=y+(h-y)*.12;i.fillStyle="rgba(4,6,12,0.96)";let R=7;i.beginPath(),i.moveTo(l-I,M);for(let _=0;_<=R;_++){let j=l-I+(p+I*2)*_/R;i.quadraticCurveTo(j-(p+I*2)/R/2,M+x,j,M)}i.lineTo(c+I,M),i.lineTo(c+I,y),i.lineTo(l-I,y),i.closePath(),i.fill(),i.fillStyle=`rgba(${r},0.12)`,i.fillRect(l-1.5,M,1.5,h-M),i.fillRect(c,M,1.5,h-M),i.fillStyle="#0b0f18",i.fillRect(l-L,h-m*.05,p+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*s).toFixed(3)})`),P.addColorStop(1,"rgba(255,206,140,0)"),i.fillStyle=P,i.fillRect(l-L,h-m*.05,p+L*2,m*.2);let A=3+Math.floor(a()*2);for(let _=0;_<A;_++){let j=(_+1)/(A+1),V=l+p*(j+(a()-.5)*.08),z=W(Math.min(62,t+26)),J=(a()-.5)*p*.16;oi(i,V,z,V+J,h,4,p*.09,r,.16*(.7+s*.5)),eo(i,V,z,2.4,r)}}function hc(i,e,t,o,s,n,r){let a=Math.min(e*.6,Math.max(3,o.voidRadiusM)),l=Math.min(55,Math.atan2(a,e)*180/Math.PI),c=$/2,d=1.2,h=Math.max(e*.45,e-a),p=e+a,m=Math.atan2(d-t,h)*180/Math.PI,y=Math.atan2(d-t,p)*180/Math.PI,u=Math.atan2(-t,h)*180/Math.PI,f=W(m),b=W(y),g=W(u),S=Ye(l)-c,v=Math.max(6,(f-b)/2),w=(f+b)/2,k=i.createRadialGradient(c,g,4,c,g,S*2.6);k.addColorStop(0,`rgba(255,206,150,${(.2*s).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,b-v,S*5.2,g-b+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,g),i.ellipse(c,g,S,v,0,0,Math.PI,!1),i.closePath(),i.fill();let T=i.createLinearGradient(0,w,0,g);T.addColorStop(0,`rgba(${n},0.14)`),T.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=T,i.fillRect(c-S,w,S*2,g-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(r()*C.length)],I=r()<.5?-1:1,x=F=>c+F.u*I*S*.84,M=F=>w+F.v*v*.8,R=L.find(F=>F.lead)??L[0],P=x(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(P,w,2,P,w,S);_.addColorStop(0,`rgba(255,214,160,${(.5*s).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(${n},0.7)`,i.lineWidth=2,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.stroke();let j=Math.max(24,(g-b)*1.3),V=L.length>=3?3:2;for(let F=0;F<V;F++){let he=(-.62+F*.52+(r()-.5)*.12)*-I,Le=c+he*S*.7,Ue=w-v*(.45+r()*.18),Fe=S*(.07+r()*.04),ci=j*(.26+r()*.12);i.fillStyle="#0a0e18",i.fillRect(Le-Fe/2,Ue-ci,Fe,ci),i.fillStyle=`rgba(${n},0.3)`,i.fillRect(Le-Fe/2,Ue-ci,Fe,1.5)}if(L.length>=3){let F=c-R.u*I*S*.4;i.fillStyle="#0b0f1a",i.beginPath(),i.ellipse(F,w-v*.34,S*.08,v*.1,0,0,E),i.fill(),i.strokeStyle=`rgba(${n},0.35)`,i.lineWidth=1,i.stroke()}for(let F of[...L].sort((he,Le)=>he.v-Le.v)){let he=.82+(F.v+1)*.14;Ji(i,x(F),M(F),j*he*(F.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:F.pose,rim:te(40,.72,.8),rimStrength:F.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,E),i.stroke();let O=4+Math.floor(r()*3);for(let F=0;F<O;F++){let he=F/O*E,Le=c+Math.cos(he)*S*1.15,Ue=z+Math.sin(he)*J;if(Math.sin(he)>-.2){let Fe=c+(r()-.5)*S*.8;oi(i,Le,Ue,Fe,w,3,S*.32,n,.2*(.7+s*.4))}eo(i,Le,Ue,3,n)}let K=W(Math.min(52,y+24)),D=Math.max(60,S*.4),q=Math.max(24,D*.34);i.strokeStyle="rgba(70,78,102,0.6)",i.lineWidth=1.5,i.beginPath(),i.moveTo(c-D*.3,K-q/2),i.lineTo(c-D*.16,K-q*2.2),i.moveTo(c+D*.3,K-q/2),i.lineTo(c+D*.16,K-q*2.2),i.stroke(),i.fillStyle="#0d1220",i.fillRect(c-D/2,K-q/2,D,q);let ni=i.createLinearGradient(0,K-q*.3,0,K+q*.42);ni.addColorStop(0,`rgba(${n},0.5)`),ni.addColorStop(1,"rgba(255,214,160,0.32)"),i.fillStyle=ni,i.fillRect(c-D*.42,K-q*.3,D*.84,q*.72),i.fillStyle="rgba(255,214,160,0.55)",i.fillRect(c-D/2,K+q/2-2,D,2);let ri=i.createRadialGradient(c,K,4,c,K,D*1.1);ri.addColorStop(0,`rgba(${n},0.2)`),ri.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=ri,i.fillRect(c-D*1.1,K-D*.8,D*2.2,D*1.6);let ai=i.createRadialGradient(c,(z+w)/2,6,c,(z+w)/2,S*1.5);ai.addColorStop(0,`rgba(${n},${(.1*(.6+s*.5)).toFixed(3)})`),ai.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=ai,i.fillRect(c-S*1.5,z-40,S*3,w-z+80),i.restore();let Xr=c+Math.sign(P-c||1)*S*.5;oi(i,Xr,z-J*.4,P,M(R),2.5,S*.16,"255,224,178",.42*(.7+s*.4));let li=i.createRadialGradient(P,M(R),1,P,M(R),S*.2);li.addColorStop(0,`rgba(255,228,185,${(.4*s).toFixed(3)})`),li.addColorStop(1,"rgba(255,228,185,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=li,i.beginPath(),i.ellipse(P,M(R),S*.2,v*.24,0,0,E),i.fill(),i.restore()}function uc(i,e,t,o,s,n,r,a){let l=$/2,c=Math.max(10,o.voidRadiusM),d=Math.max(2,e-c),h=e+c,p=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,u=W(m),f=W(y),b=Ye(p)-l,g=(u+f)/2,S=Math.max(10,(u-f)/2),v=i.createRadialGradient(l,g,4,l,g,b);v.addColorStop(0,"#e8f0fb"),v.addColorStop(.7,"#b9c9e2"),v.addColorStop(1,"#8fa3c4"),i.save(),i.beginPath(),i.ellipse(l,g,b,S,0,0,E),i.clip(),i.fillStyle=v,i.fillRect(l-b,g-S,b*2,S*2),i.strokeStyle="rgba(90,120,170,0.5)",i.lineWidth=3,i.beginPath(),i.moveTo(l,g-S),i.lineTo(l,g+S),i.moveTo(l-b*.5,g-S),i.lineTo(l-b*.5,g+S),i.moveTo(l+b*.5,g-S),i.lineTo(l+b*.5,g+S),i.stroke(),i.strokeStyle="rgba(180,90,110,0.45)",i.beginPath(),i.ellipse(l,g,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(l,g,b,S,0,0,E),i.stroke(),i.fillStyle="rgba(20,26,40,0.8)";for(let x=0;x<5;x++){let M=l+(a()-.5)*b*1.4,R=g+(a()-.5)*S*1.1,P=Math.max(2,S*.06);i.beginPath(),i.ellipse(M,R,P*.6,P,0,0,E),i.fill()}let w=i.createRadialGradient(l,g,4,l,g,b*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(l-b*1.4,f-S,b*2.8,u-f+S*2),i.restore();let k=W(Math.min(66,y+60)),T=Math.max(80,b*.7),C=T*.5,L=i.createRadialGradient(l,k,4,l,k,T*1.6);L.addColorStop(0,`rgba(${r},0.3)`),L.addColorStop(1,`rgba(${r},0)`),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=L,i.fillRect(l-T*1.6,k-T*1.2,T*3.2,T*2.4),i.restore(),i.fillStyle="#080b12",i.beginPath(),i.moveTo(l-T/2,k-C/2),i.lineTo(l+T/2,k-C/2),i.lineTo(l+T*.6,k),i.lineTo(l+T/2,k+C/2),i.lineTo(l-T/2,k+C/2),i.lineTo(l-T*.6,k),i.closePath(),i.fill();let I=n;for(let x=0;x<3;x++){let M=te(I+x*30,.5,.5);i.fillStyle=`rgba(${M[0]},${M[1]},${M[2]},0.75)`;let R=T*.26;i.fillRect(l-T*.42+x*(R+T*.06),k-C*.32,R,C*.64)}i.fillStyle=`rgba(${r},0.9)`;for(let x=0;x<8;x++){let M=l-T*.6+T*1.2*x/7;i.beginPath(),i.arc(M,k+C*.62,2.4,0,E),i.fill()}}function pc(i,e,t,o,s,n,r,a,l,c){let d=e.sectionId,h=!1,p=[];for(let u of t){if(u.id===e.id)continue;let f=u.x-e.x,b=u.y-e.y,g=Math.hypot(f,b)*yt;if(d&&u.sectionId===d&&g<3&&f*r+b*a>0&&(h=!0),g<.3||g>32)continue;let v=((Math.atan2(f,-b)-s)*180/Math.PI+540)%360-180,w=l?(u.eyeHeightM??ee)-n:0,k=Math.atan2(w-.28,g)*180/Math.PI;if(k>10&&g>5)continue;let T=0;for(let I=0;I<u.id.length;I++)T=T*31+u.id.charCodeAt(I)&65535;let C=.9+(T&15)/40,L=Math.min(78,Math.atan2(.16,g)*180/Math.PI*tc*C);L<1.2||p.push({hx:Ye(v),hy:W(k),r:L,d:g,hash:T})}p.sort((u,f)=>f.d-u.d);let m=[];{let u=[...p].sort((g,S)=>g.hy-S.hy),f=[],b=()=>{if(!f.length)return;let g=f.reduce((w,k)=>w+k.d,0)/f.length,S=f.reduce((w,k)=>w+k.hy,0)/f.length,v=f.reduce((w,k)=>w+k.r,0)/f.length;m.push({figs:f.sort((w,k)=>k.d-w.d),d:g,hy:S,r:v}),f=[]};for(let g of u){let S=f[f.length-1];S&&Math.abs(g.hy-S.hy)>Math.max(5,(S.r+g.r)/2*1.7)&&b(),f.push(g)}b()}m.sort((u,f)=>f.d-u.d);let y=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let u of m){if(u.figs.length>=3&&u.r>=1.6&&u.r<26){let f=[],b=[...u.figs].sort((v,w)=>v.hx-w.hx),g=[];for(let v of b){let w=g[g.length-1];w&&v.hx-w.hx>Math.max(14,v.r*7)&&(g.length>=3&&f.push(g),g=[]),g.push(v)}g.length>=3&&f.push(g);let S=Math.min(.42,.5*(1-u.d/42));if(S>.05){i.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let v of f){let w=v[0].hx-u.r*1.6,k=v[v.length-1].hx+u.r*1.6;i.beginPath(),i.roundRect(w,u.hy+u.r*.8,k-w,u.r*2.4,u.r*.8),i.fill()}}}for(let f of u.figs){let b=f.d<12?.95:f.d<17?Math.max(.66,.95-(f.d-12)/18):Math.max(.3,.68-(f.d-17)/34),g=Math.round((1-Math.min(1,f.d/16))*10),S=[14+(f.hash>>4&6)+g,17+(f.hash>>4&6)+g,25+(f.hash>>4&6)+g],v=y[f.hash%y.length],w=[v[0]+g,v[1]+g,v[2]+g];if(f.r>=13){let k=f.d<9?.16*(1-f.d/9)+(c.mode==="proscenium"?.06:0):0;lc(i,f.hx,f.hy,f.r,{tone:S,clothing:w,alpha:b,tilt:((f.hash>>2&7)-3.5)*.018,shoulderK:1.72+(f.hash>>5&7)/22,hair:f.hash%rc,rim:k,turn:((f.hash>>8&7)-3.5)*.034,lean:((f.hash>>10&3)-1.5)*.09})}else f.r>=5.5?cc(i,f.hx,f.hy,f.r,w,S,b):(i.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${b.toFixed(3)})`,i.beginPath(),i.arc(f.hx,f.hy,f.r,0,E),i.fill(),i.beginPath(),i.ellipse(f.hx,f.hy+f.r*1.4,f.r*1.85,f.r*.95,0,Math.PI,0,!0),i.fill())}}if(h){let u=W(-34);i.fillStyle="rgba(6, 8, 14, 0.92)",i.fillRect(0,u,$,de-u),i.fillStyle="rgba(24, 30, 46, 0.9)";let f=16;for(let b=0;b<f;b++){let g=(b+.5)/f*$;i.beginPath(),i.ellipse(g,u+6,$/f*.42,22,0,Math.PI,0,!0),i.fill()}}}var oe=480,Xe=270,ji=50,Be=30,Wr=i=>(i+ji)/(2*ji)*oe,mt=i=>(Be-i)/(2*Be)*Xe;function um(i,e,t){let o=document.createElement("canvas");o.width=oe,o.height=Xe;let s=o.getContext("2d"),n=e.x-i.x,r=e.y-i.y,a=Math.max(2,Math.hypot(n,r)*yt),l=zr(Vr(`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+l()*150,d=te(220+(l()-.5)*60,.55,.82),h=`${d[0]},${d[1]},${d[2]}`,p=s.createLinearGradient(0,0,0,Xe);p.addColorStop(0,"#080b12"),p.addColorStop(.44,"#151c32"),p.addColorStop(.5,"#1d2644"),p.addColorStop(.58,"#161c2e"),p.addColorStop(1,"#131829"),s.fillStyle=p,s.fillRect(0,0,oe,Xe);let m=i.eyeHeightM??ee,y=$i(m,a),u=Math.min(ji-2,Math.atan2(4,a)*180/Math.PI),f=Math.min(Be-2,y.topPitch),b=Math.max(-Be+2,y.basePitch),g=Wr(-u),S=Wr(u),v=mt(f),w=mt(b),k=S-g,T=w-v,C=Math.max(.35,Math.min(1,1-(a-6)/60)),L=mt(Math.min(Be-1,f+8)),I=s.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)"),s.fillStyle=I,s.fillRect(g-k*.6,v-T*1.2,k*2.2,T*3.4);let x=te(c,.62,.55),M=te(c+40,.7,.5),R=te(c+70,.78,.52);s.save(),s.beginPath(),s.rect(g,v,k,T),s.clip();let P=s.createLinearGradient(0,v,0,w);P.addColorStop(0,`rgb(${x[0]},${x[1]},${x[2]})`),P.addColorStop(.5,`rgb(${M[0]},${M[1]},${M[2]})`),P.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),s.globalAlpha=.8,s.fillStyle=P,s.fillRect(g,v,k,T),s.globalAlpha=1;let A=s.createRadialGradient(oe/2,(v+w)/2,k*.12,oe/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)"),s.fillStyle=A,s.fillRect(g,v,k,T),s.restore();let _=3,j=w-T*.08;for(let O=0;O<_;O++){let K=(O+1)/(_+1);Ji(s,g+k*(.24+K*.52),j,T*.46*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:te(c+20,.5,.7),rimStrength:.7})}s.fillStyle="#05070d",s.fillRect(g-k*.5,L,k*.5,w-L),s.fillRect(S,L,k*.5,w-L);let V=k*.05+2,z=V*1.35;s.fillStyle="#03050a",s.beginPath(),s.moveTo(g,w),s.lineTo(g-V,w),s.lineTo(g-z,L),s.lineTo(g+k*.012,L),s.closePath(),s.fill(),s.beginPath(),s.moveTo(S,w),s.lineTo(S+V,w),s.lineTo(S+z,L),s.lineTo(S-k*.012,L),s.closePath(),s.fill(),s.fillRect(g-z,L,k+z*2,(w-L)*.13),s.fillStyle=`rgba(${h},0.12)`,s.fillRect(g-1.2,L,1.2,w-L),s.fillRect(S,L,1.2,w-L),s.fillStyle="#0b0f18",s.fillRect(g-V,w-T*.05,k+V*2,T*.05+2);let J=s.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)"),s.fillStyle=J,s.fillRect(g-V,w-T*.05,k+V*2,T*.22);for(let O=0;O<3;O++){let K=(O+1)/4,D=g+k*K,q=mt(Math.min(Be-1,f+20));oi(s,D,q,D+(l()-.5)*k*.14,w,3,k*.09,h,.17*C),eo(s,D,q,1.8,h)}s.fillStyle=`rgba(${h},0.75)`;for(let O=0;O<8;O++)s.beginPath(),s.arc((O+.5)/8*oe,mt(Be-4-O%2*3),2.2,0,E),s.fill();s.fillStyle="rgba(10,13,20,0.9)",s.fillRect(0,Xe-26,oe,26),s.fillStyle="rgba(30,37,54,0.9)";for(let O=0;O<9;O++){let K=O*(oe/9)+oe/18;s.beginPath(),s.ellipse(K,Xe-22,oe/9*.4,15,0,Math.PI,0,!0),s.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(a)}}var Kr=new Set(["en"]),si=new Map;async function fc(i){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(Ho(`i18n/${i}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-EMBA3SWS.js"),t=e[i];return t?await t():null}async function ym(i,e){let t=Bs(i,e);if(t==="en"||Kr.has(t))return We(t),t;if(!_s.includes(t))return We("en"),"en";try{let o=si.get(t);o||(o=fc(t),si.set(t,o));let s=await o;return si.delete(t),s?(We(t,s),Kr.add(t),t):(We("en"),"en")}catch{return si.delete(t),We("en"),"en"}}export{bc as ACCESSIBILITY_RING_COLOR,yc as ACCESSIBILITY_TYPES,mc as CHART_STORAGE_KEY,md as CURRENCY_CHOICES,fd as DEFAULT_CURRENCY,Pc as EVENT_CONFIGURATION_EXPORT_SCHEMA,Cc as EVENT_CONFIGURATION_SCHEMA,kc as LABEL_STYLE_MAX_SIZE,wc as LABEL_STYLE_MIN_SIZE,Ld as LOCALE_NAMES,jc as MAX_EVENT_INVENTORY,Qc as MAX_GA_CAPACITY,Dr as PickerController,ke as PickerSelectionError,rd as RENDERED_QUALITY_REPORT_VERSION,Sc as SEAT_COMMERCIAL_MARKS,ma as SUPPORTED_LOCALES,Lc as SURROUNDINGS_SHAPE_ROLES,Xi as SeatmapRenderer,Fc as TABLE_SEAT_OFFSET,Bc as TIER_HEIGHT_M,_s as TRANSLATED_LOCALES,uo as UNGROUPED_ID,gc as accessibilityMeta,gt as accessibilityRingColor,no as allObjects,po as applyHidden,Ec as canTransitionEventConfiguration,Mc as canonicalEventConfigurationJson,ho as chartBounds,kt as computeSections,Cr as createRenderer,pa as currencyExponent,gd as currencySymbol,Kc as expandBooth,$e as expandChart,Hc as expandRow,Gc as expandRowSlots,zc as expandTable,Wc as expandTableSlots,$c as floorObjects,Zc as floorOverviewTranslations,vt as floorsOf,lo as floorsShareFootprint,Md as formatDate,yd as formatMinor,ot as formatMoney,fa as fromMinorUnits,qe as gaAreasOf,td as gaInventorySegments,Jc as gaUnitLabel,wt as gaUnitLabels,hm as generateSeatPanorama,um as generateSeatThumb,Td as getLocale,id as growJoinedGAInventory,nd as hiddenObjectIds,Rc as inspectEventConfigurationCompatibility,ad as inspectRenderedQualityEvidence,od as isGaUnitLabel,Pd as isLocaleLoaded,sd as isSectionHidden,Tc as layerOf,ao as layoutFloorOverview,co as layoutFloorRings,ym as loadLocale,Cd as localeDirection,_c as migrateLegacyEventConfigurations,Yc as objectCenter,Uc as owningSectionForObject,xc as parseEventConfigurationExport,Ic as parseEventConfigurationVersion,Xc as pointInPolygon,ie as pointInPolygonWithHoles,St as polygonLabelPoint,Ac as resolveEventConfigurationRollback,Bs as resolveLocale,Dc as rowInventoryCount,Oc as rowSeatPositions,vc as seatCommercialMeta,bt as sectionGeometry,We as setLocale,As as setMoneyLocale,Id as setStringOverrides,ro as stackFloors,Y as t,xd as tCount,Vc as tableInventoryCount,Nc as tableSeatCountsBySide,qc as translateObject,ed as validGAInventorySegments};