@seatlayer/core 0.73.0 → 0.75.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +3 -2
  2. package/dist/ar-JOSU54ZZ.js +1 -0
  3. package/dist/be-UDIVAZGH.js +1 -0
  4. package/dist/bg-AJX2SNK4.js +1 -0
  5. package/dist/ca-MC23KMQH.js +1 -0
  6. package/dist/{categoryInventory-Bcmnr6ZH.d.ts → categoryInventory-C5I2U-EM.d.ts} +1 -1
  7. package/dist/{categoryInventory-DueSAIBX.d.cts → categoryInventory-DFp26meo.d.cts} +1 -1
  8. package/dist/chunk-KHFCTR3V.js +1 -0
  9. package/dist/{chunk-UX67GDLV.js → chunk-N3DPHRJ3.js} +1 -1
  10. package/dist/{chunk-JLYR66MT.js → chunk-OGIAQX62.js} +1 -1
  11. package/dist/chunk-QUOAQQMP.js +1 -0
  12. package/dist/chunk-SPM2LMKI.js +1 -0
  13. package/dist/{chunk-N5NRM4NW.js → chunk-TN6DFYEV.js} +1 -1
  14. package/dist/{chunk-ZMYRXJOA.js → chunk-UVAV3E7K.js} +1 -1
  15. package/dist/chunk-X2GZ5O7C.js +1 -0
  16. package/dist/{chunk-BAWUBGWY.js → chunk-YACNGDTE.js} +1 -1
  17. package/dist/core/chart-ops/index.cjs +1 -1
  18. package/dist/core/chart-ops/index.d.cts +4 -4
  19. package/dist/core/chart-ops/index.d.ts +4 -4
  20. package/dist/core/chart-ops/index.js +1 -1
  21. package/dist/core/inventory/index.cjs +1 -1
  22. package/dist/core/inventory/index.d.cts +4 -4
  23. package/dist/core/inventory/index.d.ts +4 -4
  24. package/dist/core/inventory/index.js +1 -1
  25. package/dist/core/layout/index.cjs +1 -1
  26. package/dist/core/layout/index.d.cts +5 -5
  27. package/dist/core/layout/index.d.ts +5 -5
  28. package/dist/core/layout/index.js +1 -1
  29. package/dist/core/quality/index.d.cts +3 -3
  30. package/dist/core/quality/index.d.ts +3 -3
  31. package/dist/core/render-assets/index.d.cts +1 -1
  32. package/dist/core/render-assets/index.d.ts +1 -1
  33. package/dist/core/render-assets/index.js +1 -1
  34. package/dist/core/seatConfidence.d.cts +1 -1
  35. package/dist/core/seatConfidence.d.ts +1 -1
  36. package/dist/core/sections/index.cjs +1 -1
  37. package/dist/core/sections/index.d.cts +5 -5
  38. package/dist/core/sections/index.d.ts +5 -5
  39. package/dist/core/sections/index.js +1 -1
  40. package/dist/cs-Q4OEV3NE.js +1 -0
  41. package/dist/cy-TPDRMPTK.js +1 -0
  42. package/dist/da-U6XXTCII.js +1 -0
  43. package/dist/de-ZV54ZWHR.js +1 -0
  44. package/dist/el-5VQKNNQV.js +1 -0
  45. package/dist/es-Y3BNIAEW.js +1 -0
  46. package/dist/et-HCCA6TE3.js +1 -0
  47. package/dist/{eventConfigurations-C7YAqkFR.d.ts → eventConfigurations-BQGuLLv0.d.ts} +1 -1
  48. package/dist/{eventConfigurations-DwXdrjqj.d.cts → eventConfigurations-DAaOaKJK.d.cts} +1 -1
  49. package/dist/fa-SZ3EAODM.js +1 -0
  50. package/dist/fi-S34TMT35.js +1 -0
  51. package/dist/fr-RQIXNHQ5.js +1 -0
  52. package/dist/he-PPNABESI.js +1 -0
  53. package/dist/hr-IZOGRWC5.js +1 -0
  54. package/dist/hu-K7EOGFAB.js +1 -0
  55. package/dist/index.cjs +1 -1
  56. package/dist/index.d.cts +148 -14
  57. package/dist/index.d.ts +148 -14
  58. package/dist/index.js +1 -1
  59. package/dist/it-PD5WJDNR.js +1 -0
  60. package/dist/ja-3CFZ2KK6.js +1 -0
  61. package/dist/ku-MQJTRLDV.js +1 -0
  62. package/dist/{labeling-iugoy25P.d.cts → labeling-BZp91HiS.d.cts} +1 -1
  63. package/dist/{labeling-BUCj-kHU.d.ts → labeling-Duul2sao.d.ts} +1 -1
  64. package/dist/{layout-Dv3R0Mpw.d.ts → layout-DGbWo5fV.d.ts} +12 -3
  65. package/dist/{layout-DPJX6D9k.d.cts → layout-Gkx3fo5_.d.cts} +12 -3
  66. package/dist/localeLoaders-ETY2H7H3.js +1 -0
  67. package/dist/lt-6Q5DJHXR.js +1 -0
  68. package/dist/lv-BQ3LWGW6.js +1 -0
  69. package/dist/nl-ZPVH2YGT.js +1 -0
  70. package/dist/no-R7I6YW7N.js +1 -0
  71. package/dist/openPanorama-6FMXAJ6O.js +20 -0
  72. package/dist/pl-EU2O5DYI.js +1 -0
  73. package/dist/pt-UMSFOY5P.js +1 -0
  74. package/dist/{renderedQuality-CfonzUpl.d.ts → renderedQuality-BYhJ3Cer.d.ts} +1 -1
  75. package/dist/{renderedQuality-CSHrmnHf.d.cts → renderedQuality-CEPse8ir.d.cts} +1 -1
  76. package/dist/{renderer-Dn4Plcv9.d.cts → renderer-BlLKrW-U.d.ts} +17 -1
  77. package/dist/{renderer-C5avrVLy.d.ts → renderer-Cv_gzYvT.d.cts} +17 -1
  78. package/dist/ro-GR35LU2L.js +1 -0
  79. package/dist/ru-CXYAZQEV.js +1 -0
  80. package/dist/{sections-DhJ7TukF.d.cts → sections-CRSGPI3T.d.cts} +1 -1
  81. package/dist/{sections-uV7vqDHj.d.ts → sections-DIVvr8QN.d.ts} +1 -1
  82. package/dist/{segmentedRowModel-DgSEzAYd.d.ts → segmentedRowModel-CD-YT9bT.d.ts} +1 -1
  83. package/dist/{segmentedRowModel-DWOjcPrU.d.cts → segmentedRowModel-CvyOS6Bx.d.cts} +1 -1
  84. package/dist/sk-GUB52YMC.js +1 -0
  85. package/dist/sl-J7N6LDON.js +1 -0
  86. package/dist/sr-A7GQEH7K.js +1 -0
  87. package/dist/sv-ARLHHSPZ.js +1 -0
  88. package/dist/{ticketRestrictions-JT87K45q.d.cts → ticketRestrictions-C31mrE97.d.cts} +2 -2
  89. package/dist/{ticketRestrictions-DIh61MqE.d.ts → ticketRestrictions-DXO2eckD.d.ts} +2 -2
  90. package/dist/tr-6TE3U7WM.js +1 -0
  91. package/dist/{types-Dx4jA8aI.d.cts → types-BVRza86Q.d.cts} +15 -0
  92. package/dist/{types-Dx4jA8aI.d.ts → types-BVRza86Q.d.ts} +15 -0
  93. package/dist/uk-RMVPSRMH.js +1 -0
  94. package/dist/view3d/crossfade/panorama.cjs +1 -1
  95. package/dist/view3d/crossfade/panorama.d.cts +20 -2
  96. package/dist/view3d/crossfade/panorama.d.ts +20 -2
  97. package/dist/view3d/crossfade/panorama.js +1 -1
  98. package/dist/view3d/index.cjs +31 -31
  99. package/dist/view3d/index.d.cts +30 -3
  100. package/dist/view3d/index.d.ts +30 -3
  101. package/dist/view3d/index.js +25 -25
  102. package/dist/view3d/scene/scene.worker.cjs +1 -1
  103. package/dist/view3d/scene/scene.worker.js +1 -1
  104. package/dist/zh-Hans-SNO4DA32.js +1 -0
  105. package/dist/zh-Hant-TVIKBD5S.js +1 -0
  106. package/package.json +2 -2
  107. package/dist/ar-JP4VPYJ2.js +0 -1
  108. package/dist/be-ROTFZNMH.js +0 -1
  109. package/dist/bg-YMQ3B5NS.js +0 -1
  110. package/dist/ca-L2OMCHWL.js +0 -1
  111. package/dist/chunk-52MZJZMW.js +0 -1
  112. package/dist/chunk-5JB4VW6B.js +0 -1
  113. package/dist/chunk-BLPBTW6I.js +0 -1
  114. package/dist/chunk-HDY2MYYH.js +0 -1
  115. package/dist/chunk-KN7GLEAI.js +0 -1
  116. package/dist/chunk-YFV4DSSX.js +0 -1
  117. package/dist/cs-CHBOZAYY.js +0 -1
  118. package/dist/cy-ZIVBYZBX.js +0 -1
  119. package/dist/da-PUY5IIER.js +0 -1
  120. package/dist/de-ILFIEU77.js +0 -1
  121. package/dist/el-5EG3QS5T.js +0 -1
  122. package/dist/es-YXZQB5VZ.js +0 -1
  123. package/dist/et-FZIUC4FC.js +0 -1
  124. package/dist/fa-KKBNUDRE.js +0 -1
  125. package/dist/fi-B6JSP5Z5.js +0 -1
  126. package/dist/fr-T5LHFRKG.js +0 -1
  127. package/dist/he-JF4HU75D.js +0 -1
  128. package/dist/hr-S5OXZ3NI.js +0 -1
  129. package/dist/hu-ZZDYG6ZF.js +0 -1
  130. package/dist/it-A5VCFTQP.js +0 -1
  131. package/dist/ja-PAJD5HFJ.js +0 -1
  132. package/dist/ku-KV2AIB6I.js +0 -1
  133. package/dist/localeLoaders-VULFUGJH.js +0 -1
  134. package/dist/lt-OSFNYQ2L.js +0 -1
  135. package/dist/lv-5INNWEN5.js +0 -1
  136. package/dist/nl-YOLY3DXM.js +0 -1
  137. package/dist/no-C5MG5NPH.js +0 -1
  138. package/dist/openPanorama-HGRYMWKC.js +0 -20
  139. package/dist/pl-ERGM2HA3.js +0 -1
  140. package/dist/pt-S6SBTHES.js +0 -1
  141. package/dist/ro-NQ4LIATX.js +0 -1
  142. package/dist/ru-ICFP6U3S.js +0 -1
  143. package/dist/sk-VYH6WIZ2.js +0 -1
  144. package/dist/sl-AA54VE5P.js +0 -1
  145. package/dist/sr-Z27ZL5ZE.js +0 -1
  146. package/dist/sv-BT4MNMB5.js +0 -1
  147. package/dist/tr-3TSE3BBR.js +0 -1
  148. package/dist/uk-YD2PBENU.js +0 -1
  149. package/dist/zh-Hans-VPQE6LWU.js +0 -1
  150. package/dist/zh-Hant-PUKPX45I.js +0 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as cd,b as hd,c as _o,d as dd,e as ud,f as Fo,h as qo,k as Gt,m as Zo,n as ye,o as ae,p as Qo,q as jo,r as Ht,s as Jo}from"./chunk-ZMYRXJOA.js";import{a as kd,b as Vo,c as Ld}from"./chunk-3L4M7L5I.js";import{b as ur}from"./chunk-FOYQOIWG.js";import{a as Gh,b as Hh,c as Nh,d as Wh,e as Vh,f as Kh,g as zh,h as Xh,i as Yh}from"./chunk-YFV4DSSX.js";import{c as nr,e as ar}from"./chunk-BLPBTW6I.js";import{b as Ot,f as zo,h as Dt,i as Xo,k as Yo}from"./chunk-UL5OIGIF.js";import{a as xi,b as Ci,d as lr,e as Nt,g as cr,h as hr,k as dr}from"./chunk-JLYR66MT.js";import{a as fe,b as No,c as Me,d as At,e as Et,f as Re,g as G,m as me,n as xe,q as _t,r as Ft,t as Wo,u as Bt,v as U,w as Ti}from"./chunk-FMZ6HLDH.js";import{A as rr,B as sr,b as Uo,c as $o,e as st,i as tr,j as ir,p as or}from"./chunk-QLDV5ZGA.js";import{a as pd,b as fd,c as md,d as yd,e as gd,f as Mt,g as bd,h as ot,i as Sd,j as Bo,k as Rt,l as vd,m as wd,n as Oo}from"./chunk-UX67GDLV.js";import{a as Ph,b as Mh,c as xo,d as Rh,e as Ah,f as xt,g as Eh,h as _h,i as Fh,j as Bh,k as Oh,l as Dh,q as Ko,t as rt,x as er}from"./chunk-BAWUBGWY.js";import{Aa as ad,Ba as Ro,Ca as ld,Da as Ao,Ea as ze,Fa as Eo,W as Po,X as Ke,Y as Uh,ea as ee,fa as Mo,ga as Ct,ka as $h,la as qh,ma as Zh,na as Qh,oa as jh,pa as Jh,qa as ed,ra as td,s as Co,sa as id,ta as od,u as Io,ua as rd,va as oe,w as N,wa as It,xa as sd,ya as nd,za as Pt}from"./chunk-KN7GLEAI.js";import{C as F,c as wi,h as ki,m as Do,o as Go,t as W,u as Te,v as ue,w as pe,x as Li,z as Ho}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var Td=1,Ii=150;function Pi(i,e){return!Number.isFinite(i)||!Number.isFinite(e)?0:Math.max(0,i*e)}function pr(i,e,t,o=1){if(!Number.isFinite(i))return t;let r=Math.max(0,o);return t?i>=e-r:i>=e+r}function Mi(i,e,t,o=1){if(!Number.isFinite(i)||!(t>0))return i;let r=Math.max(0,o)/t;return e?i*(1+r):i*(1-r)}function xd(i){let{point:e,camera:t,scale:o,nextScale:r}=i;if(!Number.isFinite(o)||o<=0||!Number.isFinite(r))return{...t};let s=(e.x-t.x)/o,n=(e.y-t.y)/o;return{x:e.x-s*r,y:e.y-n*r}}import{Konva as ci}from"konva/lib/Core";import{Stage as oh}from"konva/lib/Stage";import{Layer as po}from"konva/lib/Layer";import{Group as vt}from"konva/lib/Group";import{Circle as fa}from"konva/lib/shapes/Circle";import{Group as Gi}from"konva/lib/Group";import{Circle as Ge}from"konva/lib/shapes/Circle";import{Line as Hi}from"konva/lib/shapes/Line";import{Rect as Ni}from"konva/lib/shapes/Rect";import{Text as us}from"konva/lib/shapes/Text";var ge=9,Ae=.9,le=.55*Ae,re=G/fe,nt=4,Ee=14,fr=10,mr=14,be=.45*Ae,Se=.9*Ae,_e=(be+Se)/2,yr=Math.max(Ae*1.1,Se),Ce=8,gr=700,Q=2,br=G,Wt=.85,Sr=G,at=64,Xe=.55*be,Ri=700,vr=2500,Vt=-11.5,lt=.58,wr=320,kr=650,Lr=420,Tr=1,Fe=1,xr=2,Ye=16,ve=12,Cr=[.85,.72,.62],Kt=15,zt=12,Ir=.01,Pr=10,Mr=6,Rr=12,Ar=8,Er=8,_r=.6,Fr=.6,Br=[0,18,-18,36,-36,54,-54],we="600",Xt="500",se=640,Yt="700",Be=.02,Or=14,Dr=.34,Ut=.92,ct=7,$t=3,Gr=6;function Ai(i){return Math.min(1,Math.max(ve/Ye,i/900))}function Ue(i,e){return Math.max(ve,i*Ai(e))}var Hr=.1,$e=1.02,Ya=3,Ua=8,Ei=Ua**(1/Ya);function Nr(i,e,t=Ei){if(!(i>0)||!(e>0)||!(t>1)||i>=e)return null;let o=Math.min(i*t,e);return o/i<$e?e:o}var $a="#e5e7eb",qa="#c7cbd1",Za="#595f69",Qa="#d1d5db",ja="#b8bdc4",Ja="#273142",el="#526078",tl="#f1f5f9",il="#374151",ol="#64748b",rl="#111827",qt="#6b7280",ht="#374151";var Wr="#4b5563",Vr=.4,Oe=.16,Kr="rgba(244,246,248,0.06)",Zt=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function zr(i,e,t){let o=new Map;for(let n of i){let l=e(n);!l||t(l)||o.set(l,(o.get(l)??0)+1)}let r=null,s=0;for(let[n,l]of o)(l>s||l===s&&r!=null&&n<r)&&(r=n,s=l);return r}function te(i){return W(i)?{sectionFill:$a,sectionStroke:qa,sectionInk:Za,focalFill:Qa,focalStroke:ja}:{sectionFill:Ja,sectionStroke:el,sectionInk:tl,focalFill:il,focalStroke:ol}}function _i(i,e){let t=i.sectionFill,o=Ho(ue(t,.2),.85);switch(e){case"closed":return ue(t,.12);case"sold-out":return o;case"nearly-gone":return pe(t,o,.4);default:return t}}var Xr=.28,Yr=.32,sl=.55,nl=.7;function Ur(i,e,t){let o=te(i),r=_i(o,e);if(!t||e==="sold-out"||e==="closed")return{fill:r,stroke:o.sectionStroke};let s=W(i);return{fill:pe(r,t,s?Yr:Xr),stroke:F(t,s?nl:sl)}}var al=.03;function $r(i,e){let t=te(i);return!["normal","nearly-gone","sold-out","closed"].map(r=>_i(t,r).toLowerCase()).includes(e.trim().toLowerCase())&&Fi(i,e)}function Fi(i,e){let t=wi(e);if(!t)return!1;let o=te(i),r=Math.max(Xr,Yr)+al;return["normal","nearly-gone","sold-out","closed"].some(s=>{let n=wi(_i(o,s));return n?Math.max(Math.abs(n[0]-t[0]),Math.abs(n[1]-t[1]),Math.abs(n[2]-t[2]))/255<=r:!1})}var ll="#f8fafc",cl="#f4f6fb",hl="#111827",dl=.72;function qr(i){let e=W(i),t=e?ll:rl,o=e?hl:cl,r=pe(o,t,1-dl);return{plate:t,ink:o,subInk:Do(r,t)>=Go?r:o}}function Zr(i){return i?.35:.3}function Qr(i){if(i<=0||i>=1)return 1;let e=1.25-1;if(i<.45){let o=i/.45;return 1+e*(1-(1-o)**2)}let t=(i-.45)/(1-.45);return 1+e*Math.cos(t*Math.PI*1.5)*(1-t)**2}function Bi(i){let e=i<=0?0:i>=1?1:i,t=1-(1-e)**3;return{radiusScale:1+(2.5-1)*t,opacity:.55*(1-e)}}var Jr;function es(i){Jr=i}function ul(i){return typeof i=="number"?i:i instanceof Date?i.getTime():Date.parse(i)}var jr=new Map;function pl(i,e){let t=i??Jr,o=`${t??""}|${JSON.stringify(e)}`,r=jr.get(o);return r||(r=new Intl.DateTimeFormat(t,e),jr.set(o,r)),r}var fl={dateStyle:"medium",timeStyle:"short"};function ts(i,e={}){let{locale:t,...o}=e,r=ul(i);if(!Number.isFinite(r))return"";let s=Object.keys(o).length?o:fl;return pl(t,s).format(r)}var _d="USD",Fd=["USD","EUR","GBP","CAD","AUD","INR","AED","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL"],os;function rs(i){os=i}var is=new Map;function Qt(i,e,t,o){let r=o??os,s=`${r??""}|${i}|${e??"auto"}|${t??"auto"}`,n=is.get(s);return n||(n=new Intl.NumberFormat(r,{style:"currency",currency:i,minimumFractionDigits:e,maximumFractionDigits:t}),is.set(s,n)),n}function dt(i,e="USD",t,o){if(typeof t=="object"){let s=t;try{return Qt(e,s.minimumFractionDigits,s.maximumFractionDigits,s.locale).format(i)}catch(n){if(s.fallback)return s.fallback(i,e);throw n}}let r=t??(Number.isInteger(i)?0:void 0);return Qt(e,r,r,o).format(i)}function ml(i="USD"){try{return Qt(i,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function yl(i,e="USD"){return i/10**ml(e)}function Bd(i,e="USD",t){return dt(yl(i,e),e,void 0,t)}function Od(i="USD"){return Qt(i,0,0).formatToParts(0).find(t=>t.type==="currency")?.value??i}var ut={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"\u2713 Copied","picker.holdExpired":"Your hold expired \u2014 the seats were released. Pick again.","picker.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","picker.orphanHint":"This leaves a single seat stranded \u2014 consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview \u2014 groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks \u2014 sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats \u2014 blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.seatsLeftShort":"{count} left","picker.overview":"Venue","picker.entrance":"Entrance","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","picker.tapSeatHint":"Tap any seat to check its view","picker.ticketTierFor":"Ticket tier for {label}","picker.viewFromSeat":"View from seat {label}","picker.real360":"REAL 360\xB0","picker.preview":"PREVIEW","picker.sightline":"\u2248 {m} m to stage","picker.panorama360":"360\xB0 venue photo","picker.illustrationCaption":"illustration \xB7 \u2248 {m} m from stage","picker.restrictedView":"Restricted view","picker.obstructedView":"Obstructed view","picker.premiumSeat":"Premium seat","picker.hideLimitedView":"Hide limited-view seats","picker.bestSeatsPremium":"Best seats","picker.premiumFallbackNote":"No premium block of {count} \u2014 showing best overall","picker.loading3d":"Building the 3D venue\u2026","picker.unavailable3d":"3D could not start. The seat map is still available.","picker.jumpToSection":"Jump to section","picker.salesClosedPill":"Sales are closed","picker.salesClosedCopy":"Ticket sales for this event have ended.","picker.salesClosedCta":"Sales closed","picker.salesClosedToast":"Sales are closed for this event.","picker.holdReassurance":"Yours for {time} \u2014 you won\u2019t be charged yet.","picker.securingSeats":"Securing your seats\u2026","picker.openingCheckout":"Opening secure checkout\u2026","picker.peekSecured":"\u2713 {count} secured \xB7 {total} \u2014 you won\u2019t be charged yet","picker.priceHint":"Colours on the map are ticket types \u2014 tap one below to show just those seats.","picker.findTogetherInstead":"Find seats together instead","picker.keepMyPicks":"Keep my picks","picker.accessExpiredBody":"Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours.","picker.accessExpiredTitle":"Your access session has ended","picker.accessInvalidBody":"You can still book anything shown as available. Contact whoever sent you here for access to the rest.","picker.accessInvalidTitle":"We couldn\u2019t verify your access","picker.accessPausedBody":"The organizer has paused this selection. Try again in a few minutes.","picker.accessPausedTitle":"These seats are on hold right now","picker.accessRetry":"Try again","picker.accessRevokedBody":"Ask whoever sent you here for a new link to keep booking these seats.","picker.accessRevokedTitle":"This access link is no longer active","picker.accessiblePhysicalSeat":"Accessible physical seat","picker.addTime":"Add time","picker.accessibilityOptions":"Accessibility and colour options","picker.addingEllipsis":"Adding\u2026","picker.allLevels":"All levels","picker.allPlacesBookedTogether":"All {count} places are booked together as one exclusive table.","picker.allPrices":"All prices","picker.allSeats":"All seats","picker.allSetTitle":"You\u2019re all set","picker.anyTicketType":"Any ticket type","picker.anyVenueZone":"Any venue zone","picker.areas":"Areas","picker.available":"Available","picker.backToMap":"Back to map","picker.backToVenue":"Back to venue","picker.bestSeatsStar":"\u2726 Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.change":"Change","picker.chartDerivedModel":"Chart-derived model","picker.chartDerivedSeatEye":"Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed","picker.checkConnection":"Check your connection and try again.","picker.checkoutCouldNotBeOpened":"Checkout could not be opened. Your seats are still held \u2014 please try again.","picker.chooseAnotherToCompare":"Choose another seat to compare.","picker.chooseGuestsCopy":"Choose how many guests will sit together. This table is held exclusively for your party.","picker.chooseMinMaxGuests":"Choose {min}\u2013{max} guests","picker.clearSavedSeatComparison":"Clear saved seat comparison","picker.close":"Close","picker.closeSeatStatus":"Close seat status","picker.closestGroupChosenInstantly":"Closest available group, chosen instantly.","picker.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","picker.accessFreeCount":"{count} free","picker.accessNoneLeft":"None left","picker.holdLapsedStillFree.one":"Your hold ended while you were away. That seat is still free.","picker.holdLapsedStillFree.other":"Your hold ended while you were away. Those seats are still free.","picker.holdLapsedSomeTaken.one":"Your hold ended while you were away, and {count} of those seats has been taken. The rest are still free.","picker.holdLapsedSomeTaken.other":"Your hold ended while you were away, and {count} of those seats have been taken. The rest are still free.","picker.holdLapsedAllTaken.one":"Your hold ended while you were away, and that seat has been taken.","picker.holdLapsedAllTaken.other":"Your hold ended while you were away, and those seats have been taken.","picker.holdLapsedSelectAgain.one":"Select it again","picker.holdLapsedSelectAgain.other":"Select them again","picker.compareCount":"Compare {count}","picker.compareWithSaved":"Compare with saved","picker.confirmOrCancelSeat":"Confirm or cancel this seat","picker.confirmSeatLabel":"Confirm seat {label}","picker.confirmYourTable":"Confirm your table","picker.confirmedAndOnWay":"confirmed. A confirmation is on its way.","picker.continue":"Continue","picker.continueToCheckout":"Continue to checkout","picker.couldNotAddMoreTime":"Couldn\u2019t add more time \u2014 please head to checkout now.","picker.couldNotFindSeatsTogether":"We couldn\u2019t find {count} seats together. Try fewer seats or another ticket type.","picker.couldNotReleaseTickets":"Couldn\u2019t release your tickets. Your hold is unchanged.","picker.couldNotRemoveLabel":"Couldn\u2019t remove {label}. Your hold is unchanged.","picker.currentOffer":"Current offer","picker.currentTicketOffer":"Current ticket offer","picker.dragToLookAround":"Drag to look around \xB7 scroll to zoom","picker.emptyWheelchairSpace":"Empty wheelchair space","picker.exitFullScreen":"Exit full screen","picker.fewer":"Fewer","picker.fewerGuests":"Fewer guests","picker.fewerSeats":"Fewer seats","picker.filterAndFocusByPrice":"Filter and focus seats by price","picker.filters":"Filters","picker.findBestSeatsCount.one":"Find {count} best seat","picker.findBestSeatsCount.other":"Find {count} best seats","picker.findBestSeatsTogether":"Find the best seats together","picker.findNewSeats":"Find new seats","picker.findingBestSeats":"Finding the best seats\u2026","picker.findingEllipsis":"Finding\u2026","picker.fitToScreen":"Fit to screen","picker.flat2dMap":"Flat 2D map","picker.flexiblePartyTypeWord":"Flexible party \xB7 {typeWord}","picker.fullScreen":"Full screen","picker.generalAdmission":"General admission","picker.guestCountCouldNotBeSecured":"That guest count could not be secured. Your current table hold is unchanged.","picker.guestCountNoLongerAvailable":"That guest count is no longer available. Your current hold is unchanged.","picker.guests":"Guests","picker.guestsCount":"{count} guests","picker.guestsCountEdit":"{count} guests \xB7 Edit","picker.held":"Held","picker.heldByOther":"Held by another buyer \u2014 may become available","picker.heldForYou":"Held for you","picker.heldSeatExplanation":"Another buyer is holding this seat. It may become available again.","picker.heldTicketsReleased":"Held tickets released. Choose your new seats.","picker.heldTicketsRestored":"Your held tickets have been restored.","picker.hidePanel":"Hide panel","picker.hideTicketPanel":"Hide the ticket panel","picker.holdSeatsAndCheckout":"Hold seats & checkout","picker.howOfferWorks":"How the {name} offer works","picker.interactive3dVenueView":"Interactive 3D venue view","picker.keepMine":"Keep mine","picker.labelNoLongerAvailable":"{label} is no longer available.","picker.labelRemoved":"{label} removed.","picker.labelRemovedFromHold":"{label} removed from your hold.","picker.labelRestored":"{label} restored.","picker.labelsNoLongerAvailable.one":"{labels} is no longer available. Choose another seat.","picker.labelsNoLongerAvailable.other":"{labels} are no longer available. Choose another group.","picker.leftCount.one":"{count} left","picker.leftCount.other":"{count} left","picker.levelNumber":"Level {number}","picker.levels":"Levels","picker.liveAvailability":"Live availability \u2014 seats update in real time","picker.loadingSeatMap":"Loading seat map\u2026","picker.lookAroundLive3d":"Look around in live 3D","picker.manualTicketsRemovedNote":"Your manually selected tickets will be removed only after a new group is secured.","picker.map":"Map","picker.mapDidNotLoad":"The seat map didn\u2019t load","picker.maxTicketsForOrder":"You can select up to {count} tickets for this order.","picker.selectExactMore":"Select {count} more","picker.selectExactCount":"Select exactly {count} tickets","picker.selectMinimumMore":"Select {count} more","picker.adjustSeatSelection":"Adjust seat selection","picker.selectSeatsTogether":"Choose seats together in the same row and ticket category.","picker.minToMaxGuests":"{min} to {max} guests","picker.more":"More","picker.moreCount":"+{count} more","picker.showLess":"Show less","picker.moreGuests":"More guests","picker.moreSeats":"More seats","picker.moreSelectedCount":"{count} more selected","picker.moreTimeAdded":"More time added \u2014 your seats are still held.","picker.noAccessibilityMetadata":"No accessibility metadata supplied","picker.noAuthoredRestriction":"No organizer-authored restriction","picker.noSeatsSelected":"No seats selected","picker.notChargedYet":"You won\u2019t be charged yet.","picker.notForSale":"Not for sale","picker.notForSaleExplanation":"This seat is not included in the current sale.","picker.numberOfGuests":"Number of guests","picker.offerDetailActive":"This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over.","picker.offerDetailUpcoming":"Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts.","picker.offerRemainingAvailable":"{count} available","picker.offerStarts":"starts {time}","picker.offerUntil":"until {time}","picker.oneSeatSaved":"1 seat saved","picker.oneSeatSavedChooseAnother":"One seat saved; choose another to compare","picker.openAuthored360":"Open venue 360\xB0","picker.openComparison":"Open comparison","picker.openComparisonOfSeats":"Open comparison of {count} seats","picker.openTicketPanel":"Open ticket panel","picker.peekFromPrice":"From {price}","picker.peekTicketsTotal.one":"{count} ticket \xB7 {total}","picker.peekTicketsTotal.other":"{count} tickets \xB7 {total}","picker.perGuestPrice":"{price} per guest","picker.pickYourSeats":"Pick your seats","picker.preferredTicketType":"Preferred ticket type","picker.preferredVenueZone":"Preferred venue zone","picker.priceNotSupplied":"Price not supplied","picker.releaseHeldTickets":"Release held tickets and choose different seats","picker.releasingEllipsis":"Releasing\u2026","picker.removeHeldTicketLabel":"Remove held ticket {label}","picker.removeSeatLabel":"Remove {label}","picker.removeTicketsUntilOrFewer":"Remove tickets until your order has {count} or fewer.","picker.replaceCurrentChoices":"Replace your current choices?","picker.review":"Review","picker.row":"Row","picker.rowLabel":"Row {label}","picker.saveToCompare":"Save to compare","picker.savedForComparison":"Saved for comparison","picker.savedSeatComparison":"Saved seat comparison","picker.scheduledOffer":"Scheduled offer","picker.seat":"Seat","picker.seatCount.one":"{count} seat","picker.seatCount.other":"{count} seats","picker.seatJustTakenByAnother":"Seat {label} was just taken by another buyer.","picker.seatLabel":"Seat {label}","picker.seatNoLongerAvailable":"That seat is no longer available.","picker.seatNoLongerYours":"Some seats are no longer available to you. They have been removed from your order.","picker.seatNumberLower":"seat {label}","picker.seatSalesClosedForEvent":"Seat sales have closed for this event.","picker.seatSelection":"Seat selection","picker.seatStatusLegend":"Seat status legend","picker.seatTaken":"Someone else took a seat you had picked. It has been removed from your order.","picker.seatsHeldForNeedMoreTime":"Your seats are held for <b>{time}</b>. Need more time?","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsJustTakenInCategory.one":"{count} seat just taken in {label} \xB7 {left} left","picker.seatsJustTakenInCategory.other":"{count} seats just taken in {label} \xB7 {left} left","picker.seatsNoLongerAvailableTryAnother":"Those seats are no longer available. Try another quantity or ticket type.","picker.seatsSecured":"Seats secured","picker.seatsSelectedCount.one":"{count} selected","picker.seatsSelectedCount.other":"{count} selected","picker.section":"Section","picker.secureMore":"Secure more","picker.secureMoreAndCheckout":"Secure {count} more & checkout","picker.securedCount":"{count} secured","picker.seeItIn3d":"See it in 3D","picker.select":"Select","picker.selectSeats":"Select seats","picker.selectTable":"Select table","picker.selectWholeTable":"Select whole table","picker.selected":"Selected","picker.selectingEllipsis":"Selecting\u2026","picker.showAllSeats":"Show all seats","picker.showAllTicketTypes":"Show all {count} ticket types","picker.showFewer":"Show fewer","picker.showLabelSeatsOnMap":"Show {label} seats on the map","picker.showTicketPanel":"Show the ticket panel","picker.sold":"Sold","picker.soldOutCopy":"No reserved seats are currently available for this event.","picker.soldOutEyebrow":"This event","picker.soldOutTitle":"Sold out","picker.soldSeatExplanation":"This seat has already been booked.","picker.statusAvailable":"available","picker.statusOnHold":"on hold","picker.statusTaken2":"taken","picker.table":"Table","picker.tableCapacity":"Table capacity","picker.tableUpdatedForGuests":"{label} updated for {count} guests.","picker.temporarilyHeld":"Temporarily held","picker.ticketPrices":"Ticket prices","picker.ticketTypeSoldOut":"That ticket type is sold out. Try another ticket type.","picker.tickets":"Tickets","picker.ticketsCount.one":"{count} ticket","picker.ticketsCount.other":"{count} tickets","picker.toggleColorblindColors":"Toggle colorblind-friendly colors","picker.total":"Total","picker.trayHintTapOrBest":"Tap a seat on the map, or let us pick the best available for you.","picker.trayHintTapOrStanding":"Tap a seat on the map \u2014 or grab standing tickets below.","picker.undo":"Undo","picker.upcomingTicketOffer":"Upcoming ticket offer","picker.updateTable":"Update table","picker.updatingEllipsis":"Updating\u2026","picker.venueView":"Venue view","picker.recentreOnStage":"Recentre on the stage","picker.stopYourSeat":"Your seat","picker.stopYourRow":"Your row","picker.stopYourSection":"Your section","picker.stopWholeVenue":"Whole venue","picker.viewFromHere":"View from here","picker.viewFromYourSeat":"view from your seat","picker.fromYourSeat":"from your seat","picker.viewFromThisSeat":"View from this seat","picker.wholeTypeWord":"Whole {typeWord}","picker.willChooseClosestGroup":"We\u2019ll choose the closest available group for you.","picker.willFindSeatsTogether":"We\u2019ll find {count} seats together.","picker.yourSeats":"Your seats","picker.zoomIn":"Zoom in","picker.zoomOut":"Zoom out","picker.closeVenueNav":"Close","picker.levelsAndAreas":"Levels & areas","picker.gaChooseTickets":"How many tickets?","picker.gaAdd.one":"Add {count} ticket \xB7 {price}","picker.gaAdd.other":"Add {count} tickets \xB7 {price}","picker.gaUpdate.one":"Update \xB7 {count} ticket","picker.gaUpdate.other":"Update \xB7 {count} tickets","picker.gaRemove":"Remove","picker.gaAreasHeading":"Areas","picker.gaTrayHintTapArea":"Tap an area on the map to choose tickets.","picker.gaAdded.one":"{count} {area} ticket added, {price}","picker.gaAdded.other":"{count} {area} tickets added, {price}","picker.gaRemoved":"{area} tickets removed","picker.gaChooseForArea":"Choose tickets for {area}","picker.holdSeatsForAllPerformances":"Hold seats for all {count} performances","picker.completeAllPerformances":"Complete all performances ({complete}/{total})","picker.groupTrayHint":"Choose seats once \u2014 the same seats will be held for every performance.","picker.groupPerPerformanceTrayHint":"Choose seats for this performance, then complete every date above.","picker.group.sameSeatSummary":"Choose once. The same seats will be held for all {count} performances.","picker.group.perPerformanceSummary":"Choose seats for each performance. All {count} selections are held together.","picker.group.allDates":"All {count} dates included","picker.group.flexibleDatesInView":"All {count} dates in view","picker.group.flexibleDatesSelected":"{selected} of {total} dates selected","picker.group.performances":"Performances","picker.group.heldForEveryPerformance":"Held for every performance","picker.group.notStarted":"Not started","picker.group.inProgress":"In progress","picker.group.complete":"Complete","picker.group.needsAttention":"Needs attention","picker.group.previousPerformance":"Previous performance","picker.group.nextPerformance":"Next performance","picker.group.performanceOpened":"Now choosing seats for {performance}.","picker.group.checkingAvailability":"Checking seats available for every performance\u2026","picker.group.securing":"Securing these seats for every performance. Please wait.","picker.group.commitPending":"We\u2019re still securing these seats for every performance. SeatLayer will keep working; this page is checking the result.","picker.group.outcomeUnknown":"We\u2019re checking whether your seats were secured. Don\u2019t choose other seats yet.","picker.group.longRunning":"This is taking longer than usual. We\u2019re still checking the same request. Don\u2019t submit it again. Reference: {reference}.","picker.group.abortPending":"We couldn\u2019t secure every performance. We\u2019re checking that all seats are released before you try again.","picker.group.secured":"Seats secured for every performance. Continue when you are ready.","picker.group.notSecured":"We couldn\u2019t secure these seats for every performance. Nothing is held. Try again.","picker.group.retry":"Try again","picker.group.salesClosed":"Seats for this performance set are not available now. Return to the event page for other options.","picker.group.revisionChanged":"This performance set changed. Review the included performances before choosing seats again.","picker.group.legendTitle":"Seat availability","picker.group.legendUnavailable":"Unavailable","picker.group.partlyAvailableTitle":"Free on some nights only","picker.group.notAvailableOn":"Not available on {dates}","picker.group.nightFree":"Free","picker.group.nightBlocked":"Not available","picker.group.pickSeatFreeEveryNight":"Pick a seat that is free every night.","picker.group.chooseNightByNight":"Choose seats night by night","picker.group.nightByNightStarted":"Now choosing seats for each performance separately. Your selection was cleared.","picker.group.yourSeatsByNight":"Your seats by night","picker.group.noSeatsChosenYet":"No seats yet","picker.group.chosenOfTotal":"{chosen} of {total}","picker.group.needsMoreSeats":"Needs {count} more","picker.group.closeSeatDetails":"Close seat details","picker.group.seatPartlyAvailable":"{label}: free on {free} of {total} performances. Not available on {dates}.","picker.group.selectAvailableDates":"Select for {count} available dates","picker.group.selectedAvailableDates":"Selected for {count} available dates.","picker.group.clearBeforePartial":"Clear your current seats before choosing a different date set.","picker.group.legendAvailable":"Available","picker.group.legendSelected":"Selected","picker.group.legendNotEveryDate":"Not open on every date","picker.group.progressLabel":"Booking steps","picker.group.stepPerformances":"Performances","picker.group.stepSeats":"Seats","picker.group.stepReview":"Review","picker.group.stepDone":"Done","picker.group.stepCurrent":"Current step","picker.group.includedNote":"All {count} performances are included \xB7 dates cannot be removed here","picker.group.flexibleDatesNote":"Choose a partial seat to include only the dates where it is available.","picker.group.flexibleSelectedNote":"Only these {count} dates will be held for this seat.","picker.group.yourSelection":"Your selection","picker.group.pricesPerPerformance":"Prices shown per performance","picker.group.total":"Total","picker.group.heldTogether":"All {count} performance selections are held together \xB7 {time} remaining","picker.group.completeWithSeats":"Complete \xB7 {seats}","picker.group.stillNeedsSeat":"Still needs a seat","picker.group.sameSeatMapHelp":"One chart shows only seats available for every selected performance.","picker.group.perPerformanceMapHelp":"Switch dates above; the map position and each choice stay saved.","picker.group.bookedAll":"You\u2019re all set \u2014 seats booked for all {count} performances.","picker.group.seatsEveryPerformance.one":"{count} seat \xB7 every performance","picker.group.seatsEveryPerformance.other":"{count} seats \xB7 every performance","picker.group.seatsPerPerformance.one":"{count} seat \xB7 {per} per performance","picker.group.seatsPerPerformance.other":"{count} seats \xB7 {per} per performance","picker.group.performancesChosenOf.one":"{chosen} of {total} performances chosen \xB7 {count} seat","picker.group.performancesChosenOf.other":"{chosen} of {total} performances chosen \xB7 {count} seats","picker.group.ticketsConfirmedAcross.one":"{count} ticket confirmed across {performances} performances","picker.group.ticketsConfirmedAcross.other":"{count} tickets confirmed across {performances} performances"};var gl=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hr","hu","it","ja","ku","lt","lv","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","uk","zh-Hans","zh-Hant"],Vd={ar:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",be:"\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F",bg:"\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438",ca:"Catal\xE0",cs:"\u010Ce\u0161tina",cy:"Cymraeg",da:"Dansk",de:"Deutsch",el:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",en:"English",es:"Espa\xF1ol",et:"Eesti",fa:"\u0641\u0627\u0631\u0633\u06CC",fi:"Suomi",fr:"Fran\xE7ais",he:"\u05E2\u05D1\u05E8\u05D9\u05EA",hr:"Hrvatski",hu:"Magyar",it:"Italiano",ja:"\u65E5\u672C\u8A9E",ku:"Kurd\xEE",lt:"Lietuvi\u0173",lv:"Latvie\u0161u",nl:"Nederlands",no:"Norsk",pl:"Polski",pt:"Portugu\xEAs",ro:"Rom\xE2n\u0103",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",sk:"Sloven\u010Dina",sl:"Sloven\u0161\u010Dina",sr:"\u0421\u0440\u043F\u0441\u043A\u0438",sv:"Svenska",tr:"T\xFCrk\xE7e",uk:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430","zh-Hans":"\u7B80\u4F53\u4E2D\u6587","zh-Hant":"\u7E41\u9AD4\u4E2D\u6587"},ss=["ar","be","bg","ca","cs","cy","da","de","el","en","es","et","fa","fi","fr","he","hr","hu","it","ja","ku","lt","lv","nl","no","pl","pt","ro","ru","sk","sl","sr","sv","tr","uk","zh-Hans","zh-Hant"],bl=new Set(["ar","fa","he"]),Oi={li:"lt",iw:"he",mo:"ro",sh:"sr",nb:"no",nn:"no",kmr:"ku",zh:"zh-Hans","zh-cn":"zh-Hans","zh-sg":"zh-Hans","zh-my":"zh-Hans","zh-tw":"zh-Hant","zh-hk":"zh-Hant","zh-mo":"zh-Hant"},Di=new Map(gl.map(i=>[i.toLowerCase(),i]));function Sl(i){let e=i.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let t=Di.get(e)??Oi[e];if(t)return t;let o=e.split("-");if(o.length>=2){let r=`${o[0]}-${o[1]}`,s=Di.get(r)??Oi[r];if(s)return s}return Di.get(o[0])??Oi[o[0]]}var De={en:ut},jt={},ce="en";function ns(i,e){let t=typeof navigator<"u"?navigator.languages?.length?navigator.languages:[navigator.language]:[];for(let o of[i,e,...t]){if(!o)continue;let r=Sl(o);if(r)return r}return"en"}function Kd(){return ce}function zd(i=ce){return bl.has(i)?"rtl":"ltr"}function Xd(i){return!!De[i]}function qe(i,e){e&&(De[i]={...De[i],...e}),ce=De[i]?i:"en",rs(ce),es(ce),typeof document<"u"&&(document.documentElement.lang=ce)}function Yd(i){jt=i}var as=/\{(\w+)\}/g;function $(i,e){let t=jt[i]??De[ce]?.[i]??ut[i]??i;return e?t.replace(as,(o,r)=>String(e[r]??`{${r}}`)):t}function Ud(i,e,t){let o=new Intl.PluralRules(ce).select(e);return(jt[`${i}.${o}`]??De[ce]?.[`${i}.${o}`]??ut[`${i}.${o}`]??jt[`${i}.other`]??De[ce]?.[`${i}.other`]??ut[`${i}.other`]??i).replace(as,(n,l)=>String({count:e,...t}[l]??`{${l}}`))}function $d(i,e){return ts(i,{...e??{dateStyle:"medium",timeStyle:"short"},locale:ce})}function cs(i,e,t,o=!1){let r=i.displayLabel?.trim()||i.label;return o?{title:r,detail:$("map.statusTaken"),sellable:!1}:e==="booked"?{title:r,detail:$("map.statusTaken"),sellable:!1}:e==="held"?{title:r,detail:$("map.statusHeld"),sellable:!1}:{title:r,detail:t()??"",sellable:!0}}var Ze=32,ls=70;function hs(i,e){let t=Ze+6,o=i.y-ls;return{x:Math.min(Math.max(i.x,t),Math.max(t,e.width-t)),y:o>=t?o:Math.min(i.y+ls,e.height-t)}}var Ll=220,Tl=.08,Jt=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.host=e}syncMarker(e,t,o){let r=o.get(e);if(o.delete(e),!t){this.retire(r);return}r?.destroy();let s=this.host,n=s.seat(e);if(!n)return;let l=s.seatShape(e)?.fill(),a=U(typeof l=="string"?l:"",s.selectionColor(),Bt),c=s.selectionFocusId()===e,h=s.boothDims(n.rowId),d=s.seatRadius(),u=s.seatPoint(n),f=new Gi({name:"selection-ring",x:u.x,y:u.y,rotation:h?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:s.selectionFocusId()&&!c?.2:1});if(s.viewMode()==="perspective"){let p=s.perspectiveSeatScale(e);f.scale({x:p,y:p})}f.setAttrs({seatId:e,ringColor:a});let y={name:"selection-halo",stroke:F(s.categoryColor(n.categoryKey),Zr(W(s.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(h){let p=d*1.2;f.add(new Ni({...y,width:h.width+p*2,height:h.height+p*2,offsetX:(h.width+p*2)/2,offsetY:(h.height+p*2)/2,cornerRadius:8,strokeWidth:Math.max(2,d*.5)}))}else f.add(new Ge({...y,radius:d*1.6,strokeWidth:Math.max(2,d*.55)}));let m={stroke:a,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(h)if(f.add(new Ni({...m,width:h.width,height:h.height,offsetX:h.width/2,offsetY:h.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)f.add(new Ni({...m,width:h.width+10,height:h.height+10,offsetX:(h.width+10)/2,offsetY:(h.height+10)/2,cornerRadius:7,strokeWidth:2,opacity:.55}));else{let p=Math.max(0,h.width/2-14),g=-Math.max(0,h.height/2-14);f.add(new Ge({x:p,y:g,radius:10,fill:a,listening:!1})),f.add(new Hi({x:p,y:g,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:W(a)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else f.add(new Ge({...m,radius:Math.max(1,d-1.25),strokeWidth:Math.min(2.5,Math.max(1.8,d*.22))})),c?f.add(new Ge({...m,radius:d+2,strokeWidth:2,opacity:.55})):f.add(new Hi({points:[-d*.52,0,-d*.12,d*.4,d*.6,-d*.46],stroke:"#ffffff",strokeWidth:Math.max(2.6,d*.34),lineCap:"round",lineJoin:"round",shadowColor:"#0b1220",shadowBlur:1.5,shadowOpacity:.55,listening:!1}));o.set(e,f),this.host.overlayLayer.add(f)}retire(e){let t=this.host;if(!e)return;if(t.reducedMotion()||t.isDestroyed()||typeof document<"u"&&document.hidden){e.destroy();return}let o=performance.now(),r=s=>{if(t.isDestroyed()||!e.getLayer()){e.destroy();return}let n=Math.min(1,(s-o)/160);e.opacity(1-n),t.overlayLayer.batchDraw(),n<1?requestAnimationFrame(r):(e.destroy(),t.overlayLayer.batchDraw())};requestAnimationFrame(r)}play(e){let t=this.host;if(t.reducedMotion()||t.isDestroyed()||typeof document<"u"&&document.hidden)return;let o=t.seat(e);if(!o)return;let r=t.seatRadius(),s=t.seatPoint(o);this.pulses.get(e)?.destroy();let n=new Ge({name:"selection-pulse",x:s.x,y:s.y,radius:r,stroke:t.categoryColor(o.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Bi(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,n),this.pulseHome().add(n);let l=t.isCached()?void 0:t.seatShape(e),a=performance.now(),c=()=>{l?.scale({x:1,y:1}),n.destroy(),this.pulses.get(e)===n&&this.pulses.delete(e),t.overlayLayer.batchDraw(),l&&!t.isCached()&&t.seatLayer.batchDraw()},h=d=>{if(t.isDestroyed()){c();return}n.getLayer()||this.pulseHome().add(n);let u=d-a,f=Bi(u/420);if(n.radius(r*f.radiusScale),n.opacity(f.opacity),l){let y=Qr(u/320);l.scale({x:y,y})}t.overlayLayer.batchDraw(),l&&!t.isCached()&&t.seatLayer.batchDraw(),u<420?requestAnimationFrame(h):c()};queueMicrotask(()=>{t.isDestroyed()||requestAnimationFrame(h)})}nudge(e){let t=this.host;if(t.reducedMotion()||t.isDestroyed()||t.isCached()||typeof document<"u"&&document.hidden)return;let o=t.seatShape(e);if(!o)return;let r=performance.now(),s=()=>{o.scale({x:1,y:1}),t.seatLayer.batchDraw()},n=l=>{if(t.isDestroyed()||t.isCached()||!o.getLayer()){s();return}let a=l-r,c=Math.min(1,a/Ll),h=1+Tl*Math.sin(Math.PI*c);o.scale({x:h,y:h}),t.seatLayer.batchDraw(),c<1?requestAnimationFrame(n):s()};requestAnimationFrame(n)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Gi({name:"seat-pulses",listening:!1})),this.pulseGroup.getLayer()||this.host.overlayLayer.add(this.pulseGroup),this.host.overlayLayer.isCached()&&this.host.overlayLayer.clearCache(),this.pulseGroup.moveToTop(),this.pulseGroup}showLoupe(e){let t=this.host;if(t.isExportMode()||t.isDestroyed())return;let o=t.nearestSeat(e,Ee),r=o?t.seat(o):void 0;if(!r){this.hideLoupe();return}let s=cs(r,t.seatStatus(r.id),()=>t.priceLabel(r),t.seatClosed(r.id)),n=hs(e,{width:t.stage.width(),height:t.stage.height()}),l=1/(t.stage.scaleX()||1),a=this.loupe??this.buildLoupe();a.seatId=r.id,a.group.position(t.screenToWorld(n)),a.group.scale({x:l,y:l}),a.group.opacity(s.sellable?1:.75),a.group.visible(!0),a.disc.fill(t.categoryColor(r.categoryKey)),a.title.text(s.title),a.title.offsetX(a.title.width()/2),a.detail.text(s.detail),a.detail.offsetX(a.detail.width()/2),t.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,t=e.canvasBackground(),o=U(t,te(t).sectionInk),r=new Gi({name:"touch-loupe",listening:!1,visible:!1});r.add(new Hi({points:[-7,Ze-4,0,Ze+12,7,Ze-4],closed:!0,fill:t,stroke:F(o,.25),strokeWidth:1,listening:!1})),r.add(new Ge({radius:Ze,fill:t,stroke:F(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let s=new Ge({y:-15,radius:6,fill:"#6e7bff",listening:!1}),n=new us({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),l=new us({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:F(o,.72),listening:!1,perfectDrawEnabled:!1});return r.add(s),r.add(n),r.add(l),e.overlayLayer.add(r),r.moveToTop(),this.loupe={group:r,title:n,detail:l,disc:s,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}};function ps(i,e){let t=i.width(),o=i.height(),r=1/0,s=1/0,n=-1/0,l=-1/0;for(let a of e){let c=a.getClientRect();if(!(!(c.width>1)||!(c.height>1))){if(c.x<-8||c.y<-8||c.x+c.width>t+8||c.y+c.height>o+8)return null;c.x<r&&(r=c.x),c.y<s&&(s=c.y),c.x+c.width>n&&(n=c.x+c.width),c.y+c.height>l&&(l=c.y+c.height)}}return isFinite(r)?{x:r,y:s,width:n-r,height:l-s}:null}var fs=8,xl=.5;function ys(i,e,t){let o=t??{x:0,y:0,width:i.width(),height:i.height()},r=ps(i,e);if(!r)return 0;ms(i,r,o);let s=Math.min((o.width-2*fs)/r.width,(o.height-2*fs)/r.height);if(!(Math.max(r.width-o.width,r.height-o.height)>xl)||!(s>0))return 1;let l=o.x+o.width/2,a=o.y+o.height/2;i.scale({x:i.scaleX()*s,y:i.scaleY()*s}),i.position({x:l+(i.x()-l)*s,y:a+(i.y()-a)*s});let c=ps(i,e);return c&&ms(i,c,o),s}function ms(i,e,t){let o=t.x+t.width/2-(e.x+e.width/2),r=t.y+t.height/2-(e.y+e.height/2);return o===0&&r===0?!1:(i.position({x:i.x()+o,y:i.y()+r}),!0)}function Wi(i){return`${i.x()},${i.y()},${i.scaleX()}`}import{Group as Cl}from"konva/lib/Group";import{Circle as gs}from"konva/lib/shapes/Circle";import{Line as Il}from"konva/lib/shapes/Line";import{Text as Pl}from"konva/lib/shapes/Text";var Ml=6;function Rl(i){return W(i)?"#0b1220":"#ffffff"}function bs(i){let{points:e}=i;if(!e.length)return null;let t=i.categoryColor??"#6e7bff",o=0,r=0;for(let s of e)o+=s.x,r+=s.y;return{count:e.length,centroid:{x:o/e.length,y:r/e.length},fill:t,ink:Rl(t)}}var ei=class{constructor(e){this.group=null;this.badges=[];this.host=e}anchorFor(e){for(let t of this.host.sections()){if(t.logicalId!==e&&t.id!==e)continue;let o=bs({points:this.host.ownedPoints(t),categoryColor:null});if(o)return o.centroid}return null}badgeAt(e){for(let t of this.badges)if(Math.hypot(e.x-t.centre.x,e.y-t.centre.y)<=t.radius)return t.id;return null}sync(e){if(this.group?.destroy(),this.group=null,this.badges=[],e>=Se){this.host.overlayLayer.batchDraw();return}let t=Math.max(this.host.stageScale(),1e-4),o=new Cl({listening:!1,name:"owned-sections"}),r=new Set;for(let s of this.host.sections()){let n=this.host.ownedPoints(s),l=bs({points:n,categoryColor:this.host.sectionColor(s)});if(!l)continue;let a=Math.max(Ml/2/t,1);for(let y of n)o.add(new gs({name:"owned-seat-dot",x:y.x,y:y.y,radius:a,fill:l.fill,stroke:F("#ffffff",.55),strokeWidth:Math.max(.5,a*.28),shadowColor:l.fill,shadowBlur:a*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(r.has(s.logicalId))continue;r.add(s.logicalId);let c=this.host.sections().filter(y=>y.logicalId===s.logicalId).reduce((y,m)=>y+this.host.ownedPoints(m).length,0),h=this.host.labelAnchor(s),d=11/t,u={x:h.x,y:h.y-d*2.1};o.add(new gs({name:"owned-section-badge",x:u.x,y:u.y,radius:d,fill:l.fill,stroke:F(l.ink,.35),strokeWidth:1/t,listening:!1,perfectDrawEnabled:!1})),o.add(new Il({x:u.x-d*.62,y:u.y,points:[-d*.22,0,-d*.02,d*.2,d*.34,-d*.26],stroke:l.ink,strokeWidth:Math.max(.6,d*.16),lineCap:"round",lineJoin:"round",listening:!1}));let f=new Pl({x:u.x+d*.12,y:u.y-d*.5,text:String(c),fontSize:d,fontStyle:"800",fontFamily:this.host.labelFont(),fill:l.ink,listening:!1,perfectDrawEnabled:!1});o.add(f),this.badges.push({id:s.logicalId,centre:u,radius:d*1.8})}if(!o.hasChildren()){o.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(o),o.moveToTop(),this.group=o,this.host.overlayLayer.batchDraw()}};function V(i){let e=Ko(i);return e?{x:e.x,y:e.y,width:Math.max(1,e.width),height:Math.max(1,e.height)}:{x:0,y:0,width:1,height:1}}function Qe(i,e,t,o){let r=o*Math.PI/180,s=Math.cos(r),n=Math.sin(r);return[{x:-e/2,y:-t/2},{x:e/2,y:-t/2},{x:e/2,y:t/2},{x:-e/2,y:t/2}].map(l=>({x:i.x+l.x*s-l.y*n,y:i.y+l.x*n+l.y*s}))}function ti(i,e,t,o,r,s){let n=o*Math.PI/180,l=Math.cos(n),a=Math.sin(n);for(let c=0;c<=4;c++)for(let h=0;h<=6;h++){let d=e*(h/6-.5),u=t*(c/4-.5),f={x:i.x+d*l-u*a,y:i.y+d*a+u*l};if(!oe(f,r,s))return!1}return!0}function Ss(i,e,t){let o=V(i),r=[t];for(let n=1;n<12;n+=1)for(let l=1;l<12;l+=1){let a={x:o.x+o.width*l/12,y:o.y+o.height*n/12};oe(a,i,e)&&r.push(a)}let s=[i,...e];return r.map(n=>({point:n,room:Co(n,s)})).sort((n,l)=>l.room-n.room).map(n=>n.point).filter((n,l,a)=>l===a.findIndex(c=>Math.abs(c.x-n.x)<1e-6&&Math.abs(c.y-n.y)<1e-6))}function vs(i,e){let{stageScale:t,stageX:o,stageY:r}=i;if(i.viewMode==="perspective"&&e.perspectiveAffine)return V(e.outline.map(n=>{let l=i.projectedSectionPoint(e,n);return{x:l.x*t+o,y:l.y*t+r}}));let s=e.liftWorld>0?i.isoLiftLocal(e.liftWorld):{x:0,y:0};return V(e.outline.map(n=>{let l={x:n.x+s.x,y:n.y+s.y},a=i.isoT===0?l:i.isoForward(l);return{x:a.x*t+o,y:a.y*t+r}}))}function Al(i,e){let t=i.width*i.height;if(t<=0)return 0;let o=Math.max(0,Math.min(i.x+i.width,e.width)-Math.max(i.x,0)),r=Math.max(0,Math.min(i.y+i.height,e.height)-Math.max(i.y,0));return o*r/t}function ws(i){let{current:e,viewport:t}=i,o=new Map;for(let l of i.sections){let a=Al(l.bounds,t)*l.members;a<=0||o.set(l.logicalId,(o.get(l.logicalId)??0)+a)}if(!o.size)return e;let r=null,s=0;for(let[l,a]of o)a>s&&(s=a,r=l);if(!r||r===e)return e;let n=e!=null?o.get(e)??0:0;return s>n*1.35?r:e}import{Text as _l}from"konva/lib/shapes/Text";function El(i,e){return i.x<e.x+e.width&&e.x<i.x+i.width&&i.y<e.y+e.height&&e.y<i.y+i.height}var je=class{constructor(){this.cells=new Map}insert(e){for(let t of this.keys(e)){let o=this.cells.get(t);o?o.push(e):this.cells.set(t,[e])}}collisionCount(e){let t=new Set,o=0;for(let r of this.keys(e))for(let s of this.cells.get(r)??[])t.has(s)||(t.add(s),El(e,s)&&o++);return o}keys(e){let t=Math.floor(e.x/at),o=Math.floor((e.x+Math.max(0,e.width))/at),r=Math.floor(e.y/at),s=Math.floor((e.y+Math.max(0,e.height))/at),n=[];for(let l=r;l<=s;l++)for(let a=t;a<=o;a++)n.push(`${a}:${l}`);return n}};function ks(i,e){let t=i.sections.filter(y=>y.id===e||y.logicalId===e),o=t.map(y=>{if(i.viewMode==="perspective"&&y.perspectiveAffine)return V(y.outline.map(g=>i.projectedSectionPoint(y,g)));let m=y.liftWorld>0?i.isoLiftLocal(y.liftWorld):{x:0,y:0},p=y.outline.map(g=>{let b={x:g.x+m.x,y:g.y+m.y};return i.isoT===0?b:i.isoForward(b)});return V(p)});if(!o.length)return null;let r=Math.min(...o.map(y=>y.x)),s=Math.min(...o.map(y=>y.y)),n=Math.max(...o.map(y=>y.x+y.width)),l=Math.max(...o.map(y=>y.y+y.height)),a=new Set(t.flatMap(y=>y.memberIds));for(let y of a){let m=i.seatById.get(y);if(!m)continue;let p=i.renderedSeatPoint(m);r=Math.min(r,p.x-i.seatR),s=Math.min(s,p.y-i.seatR),n=Math.max(n,p.x+i.seatR),l=Math.max(l,p.y+i.seatR)}let c=y=>{[y.x,y.y,y.width,y.height].every(Number.isFinite)&&(r=Math.min(r,y.x),s=Math.min(s,y.y),n=Math.max(n,y.x+y.width),l=Math.max(l,y.y+y.height))},h=y=>{let m={x:y.x+y.width/2,y:y.y+y.height/2};return t.some(p=>oe(m,p.outline,p.holes))};for(let{node:y,backdrop:m}of i.freeTextById.values()){let p=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});h(p)&&(c(p),m&&c(m.getClientRect({relativeTo:i.bgLayer,skipShadow:!0})))}for(let{node:y}of i.iconNodeById.values()){let m=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});h(m)&&c(m)}let d=new je;for(let{node:y}of i.freeTextById.values()){let m=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});d.insert({x:m.x-Q,y:m.y-Q,width:m.width+Q*2,height:m.height+Q*2})}for(let y of i.rowLabelPlan){let m=(y.focusKeys??[]).some(S=>S===e||t.some(v=>S===v.id||S===v.logicalId)),p=new _l({text:y.text,fontSize:y.fontSize,fontStyle:"700",fontFamily:i.labelFont(),rotation:y.rotation,listening:!1});p.offsetX(p.width()/2),p.offsetY(p.height()/2);let g=i.resolveAutomaticRowLabelPosition(p,y,d),b=i.rowLabelBox(p,g);m&&c(b),d.insert(b),p.destroy()}let u=Math.max(n-r,l-s),f=Math.max(i.seatR*2,Math.min(24,u*.025));return{x:r-f,y:s-f,width:Math.max(1,n-r+f*2),height:Math.max(1,l-s+f*2)}}import{Rect as Fl}from"konva/lib/shapes/Rect";import{Text as Ls}from"konva/lib/shapes/Text";function Ts(i,e){if(!e.zones?.length||!i.sections.length)return;let t=qr(i.canvasBackground),o=new Map;for(let r of i.sections)r.zone&&(o.get(r.zone)??o.set(r.zone,[]).get(r.zone)).push(r);for(let r of e.zones){let s=o.get(r.id);if(!s||!s.length)continue;let n=s[0];for(let f of s)f.centroid.y<n.centroid.y&&(n=f);let l=n.centroid.x,a=n.centroid.y,c=1/0;for(let f of s)for(let y of f.memberIds){let m=i.seatById.get(y),p=m&&i.catPrice.get(m.categoryKey);typeof p=="number"&&p<c&&(c=p)}let h=new Fl({x:l,y:a,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:t.plate,stroke:F(r.color??n.outlineTint,_r),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(h);let d=new Ls({x:l,y:a,text:r.label.toUpperCase(),fontSize:Kt,fontStyle:we,letterSpacing:.5,fontFamily:i.labelFont(),fill:t.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});d.offsetX(d.width()/2),d.offsetY(d.height()/2),i.bgLayer.add(d);let u=null;isFinite(c)&&(u=new Ls({x:l,y:a,text:$("map.fromPrice",{price:dt(c,i.currency)}),fontSize:zt,fontStyle:Xt,fontFamily:i.labelFont(),fill:t.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),u.offsetX(u.width()/2),i.bgLayer.add(u)),i.zones.push({id:r.id,anchor:{x:l,y:a},back:h,background:t.plate,name:r.label.toUpperCase(),label:d,sub:u})}}import{Circle as Wl}from"konva/lib/shapes/Circle";import{Line as Vl}from"konva/lib/shapes/Line";import{Rect as Kl}from"konva/lib/shapes/Rect";import{Text as zl}from"konva/lib/shapes/Text";function ke(i,e){return e.length===0?!!i.accessible:!!i.accessibility?.some(t=>e.includes(t))}function Vi(i,e){return ke(i,e)?"match":i.accessibility?.includes("companion")?"companion":"other"}var xs=.35,Cs=.7,pt="#0b1220",ft="#ffffff",Is="#0b1220",Ps="#232c40",Ms="#8b93a7";function Ki(i,e,t="normal"){let o=i?"bold":t;return e?`italic ${o}`.trim():o}var zi="#f7f8fb";import{Shape as Ol}from"konva/lib/Shape";import{Circle as Dl}from"konva/lib/shapes/Circle";import{Rect as Gl}from"konva/lib/shapes/Rect";var Bl={M:2,L:2,Q:4,C:6,Z:0},Xi=new Map;function Yi(i){let e=Xi.get(i);if(e)return e;let t=Dt(i);if(!t)return Xi.set(i,[]),[];let o=t.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],r=[],s=0;for(;s<o.length;){let n=o[s++],l=Bl[n];if(l===void 0||s+l>o.length)throw new Error(`Invalid path data for seat glyph "${i}".`);let a=o.slice(s,s+l).map(Number);if(a.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${i}".`);s+=l,n==="M"||n==="L"?r.push({command:n,points:a}):n==="Q"?r.push({command:n,points:a}):n==="C"?r.push({command:n,points:a}):r.push({command:"Z",points:[]})}return Xi.set(i,r),r}function Rs(i,e,t,o=0,r=0){let s=Yi(e),n=zo(e).bounds;if(!s.length||!n||!(t>0))return!1;let l=Xo(n,t);i.save(),i.translate(o,r),i.scale(l.scale,l.scale),i.translate(-l.centreX,-l.centreY);for(let a of s)a.command==="M"?i.moveTo(a.points[0],a.points[1]):a.command==="L"?i.lineTo(a.points[0],a.points[1]):a.command==="Q"?i.quadraticCurveTo(a.points[0],a.points[1],a.points[2],a.points[3]):a.command==="C"?i.bezierCurveTo(a.points[0],a.points[1],a.points[2],a.points[3],a.points[4],a.points[5]):i.closePath();return i.restore(),!0}function As(i,e){i.beginPath(),i.arc(0,0,e,0,Math.PI*2,!1),i.closePath()}var mt=class extends Ol{_sceneFunc(e){let t=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,r=Yi(o),s=this.attrs.seatGlyphDetail,n;if(s===void 0){let l=this.getAbsoluteScale(),a=Math.max(Math.abs(l.x),Math.abs(l.y)),c=Number.isFinite(a)&&a>0?a:1;n=t*2*c>=16}else n=s;if(!r.length||!n){As(e,t),e.fillStrokeShape(this);return}e.beginPath(),Rs(e,o,t),e.fillStrokeShape(this)}_hitFunc(e){As(e,this.attrs.seatRadius||1),e.fillStrokeShape(this)}getSelfRect(){let e=this.attrs.seatRadius||1;return{x:-e,y:-e,width:e*2,height:e*2}}};function Hl(i,e){return i==="circle"||!Dt(i)?null:new mt({x:e.x,y:e.y,seatRadius:e.radius,seatGlyph:i,...e.detail===void 0?{}:{seatGlyphDetail:e.detail},...e.fill?{fill:e.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Es(i){let{x:e,y:t,radius:o}=i;return i.wheelchairBay?new Gl({x:e,y:t,width:o*2,height:o*2,offsetX:o,offsetY:o,cornerRadius:2,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):Hl(i.glyph,{x:e,y:t,radius:o,detail:i.detail,fill:i.fill})??new Dl({x:e,y:t,radius:o,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Nl(i,e){return i*2*e>=16}function _s(i,e,t,o){let r=Nl(e,t);if(r===o||!i.length)return r;for(let s of i)s.setAttr("seatGlyphDetail",r);return r}function Fs(i){let e=[...i.seats].sort((t,o)=>(i.perspectiveSeatDepth.get(o.id)??0)-(i.perspectiveSeatDepth.get(t.id)??0));for(let t of e){if(t.kind==="booth"){Xl(i,t);continue}let o=i.seatContainer(t.id),r=Es({x:t.x,y:t.y,radius:i.seatR,detail:i.seatGlyphDetail,glyph:Yo(t.glyph,i.catByKey.get(t.categoryKey)),wheelchairBay:t.wheelchairSpaceType==="no-seat"});if(r instanceof mt&&i.glyphMarkers.push(r),r.setAttr("seatId",t.id),i.circleById.set(t.id,r),i.paintSeat(r,t.id),o.add(r),t.accessible){if(t.wheelchairSpaceType!=="no-seat"){let s=new Wl({x:t.x,y:t.y,radius:i.seatR+1.5,stroke:xt(t.accessibility),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});i.accessRingById.set(t.id,s),o.add(s)}if(t.accessibility?.includes("wheelchair")&&_t(t.accessibility)){let s=i.buildAccessGlyph(t,typeof r.fill()=="string"?r.fill():"");i.accessGlyphById.set(t.id,s),o.add(s)}}}}function Xl(i,e){let t=i.seatContainer(e.id),o=i.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},r=e.x,s=e.y,n;o.points&&o.points.length>=3?(n=new Vl({x:e.x,y:e.y,points:o.points.flatMap(a=>[a.x,a.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),r=e.x+o.points.reduce((a,c)=>a+c.x,0)/o.points.length,s=e.y+o.points.reduce((a,c)=>a+c.y,0)/o.points.length):n=new Kl({x:e.x,y:e.y,width:o.width,height:o.height,offsetX:o.width/2,offsetY:o.height/2,rotation:o.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),n.setAttr("seatId",e.id),i.circleById.set(e.id,n),t.add(n);let l=new zl({x:r,y:s,text:e.displayLabel??e.label,fontSize:Me,fontStyle:"600",fontFamily:i.labelFont(),fill:i.theme.seatLabelColor??pt,listening:!1,perfectDrawEnabled:!1});l.offsetX(l.width()/2),l.offsetY(l.height()/2),l.visible(!1),i.setHasBoothText(),i.boothLabelById.set(e.id,l),t.add(l),i.paintSeat(n,e.id)}function Bs(i,e,t,o){let r=null,s=1/0,n=i.stage.scaleX()||1;for(let l of i.seats){if(!o?.includeUnavailable&&!i.selection.has(l.id)&&!i.isSelectable(l.id))continue;let a=i.worldToScreen(l),c=i.viewMode==="perspective"?i.perspectiveSeatScale.get(l.id)??1:1,h=i.seatR*n*c+t,d=Math.hypot(a.x-e.x,a.y-e.y);d<=h&&d<s&&(s=d,r=l.id)}return r}function Os(i){if(!i.objectFloor.size)return null;let e=i.stage.getPointerPosition();if(!e)return null;let t=i.screenToWorld(e),o=null,r=1/0;for(let s of i.seats){let n=i.renderedSeatPoint(s),l=n.x-t.x,a=n.y-t.y,c=l*l+a*a;c<r&&(r=c,o=s.rowId)}return o?i.objectFloor.get(o)??null:null}import{Circle as ic}from"konva/lib/shapes/Circle";import{Group as Qs}from"konva/lib/Group";import{Rect as oc}from"konva/lib/shapes/Rect";import{Text as rc}from"konva/lib/shapes/Text";var Le=1.12;function Je(i,e,t,o){if(e.width<=0||e.height<=0)return i.scaleX();let r=o??{x:0,y:0,width:i.width(),height:i.height()},s=Math.min(r.width/(e.width*Le),r.height/(e.height*Le));return N(s,t.min,t.max)}function Ds(i){let{stage:e,box:t,bounds:o,viewport:r,centreScreen:s}=i,n=i.ratio??$e,l=e.scaleX(),a=Je(e,t,o,r)/Math.max(l,1e-4);if(a>=n||a<=1/n)return!1;let c=s.x-(r.x+r.width/2),h=s.y-(r.y+r.height/2);return Math.hypot(c,h)<=Math.min(r.width,r.height)*.02}function Gs(i,e,t,o){let r=N(e,o.min,o.max),s=i.scaleX();if(r===s)return!1;let n=(t.x-i.x())/s,l=(t.y-i.y())/s;return i.scale({x:r,y:r}),i.position({x:t.x-n*r,y:t.y-l*r}),!0}function Hs(i,e,t,o,r){let s=r??{x:0,y:0,width:i.width(),height:i.height()},n=Math.min(s.width/(e.width*Le),s.height/(e.height*Le)),l=N(Math.max(n,o??t.min),t.min,t.max);i.scale({x:l,y:l}),i.position({x:s.x+s.width/2-(e.x+e.width/2)*l,y:s.y+s.height/2-(e.y+e.height/2)*l})}function Ns(i,e){return i===null||e===null?i===e:i.size===e.size&&[...i].every(t=>e.has(t))}function Ws(i,e){let t=null;for(let o of i){let r=e.get(o)?.logicalId;if(!r||t!=null&&t!==r)return null;t=r}return t}function Vs(i,e){if(!e?.size)return!1;for(let t of i)if(e.has(t))return!1;return!0}function Ks(i,e){let t=i.sectionHeat.get(e.id)??i.sectionHeat.get(e.logicalId)??(e.zone?i.sectionHeat.get(e.zone):void 0);if(t==null||t<=0){e.outlinePoly.stroke(F(e.outlineTint,.5)),e.outlinePoly.fill(F(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=pe("#f4b740","#ef4444",t);e.outlinePoly.stroke(F(o,.72+t*.25)),e.outlinePoly.fill(F(o,.08+t*.13)),e.outlinePoly.strokeWidth(2+t*3.5),e.outlinePoly.shadowColor(o),e.outlinePoly.shadowBlur(4+t*12),e.outlinePoly.shadowOpacity(.25+t*.45)}function $i(i,e){return i.closedSections.has(e.id)||i.closedSections.has(e.logicalId)||e.zone!=null&&i.closedSections.has(e.zone)}function zs(i,e,t,o){if(!e)return 0;let r=0;for(let s of i){if(t(s)!=="free")continue;let n=o(s);n&&ke(n,e)&&(r+=1)}return r}function Xs(i,e){return $i(i,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Hr?"nearly-gone":"normal"}function Ys(i,e){let t=Xs(i,e),o=i.accessFilterActive&&i.sectionAccessibleFree(e)<=0,r=Ur(i.canvasBackground,t,o?null:e.shellCategoryColor);e.shellFill=r.fill,e.shellStroke=r.stroke,e.blockPoly.fill(r.fill),e.blockPoly.stroke(r.stroke),e.subLabel.text(t==="sold-out"?$("map.soldOut"):$("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function qi(i,e){return pe(e,W(i)?"#ffffff":"#000000",Dr)}function Zi(i,e,t=0){let o=Or-t;return!e||i.length<=o?i:`${i.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function Yl(i,e){return i.accessFilterActive&&i.sectionAccessibleFree(e)>0}function Ul(i,e,t){let o=Yl(i,e),r=Zi(e.label,t,o?2:0),s=o?`\u267F ${r}`:r;e.nameLabel.text()!==s&&e.nameLabel.text(s),e.nameLabel.fontStyle(t?Yt:we),e.nameLabel.letterSpacing(t?e.nameLabel.fontSize()*Be:0)}function $l(i,e,t){let o=i.stageWidth<se,r=e.nameLabel.opacity();if(!o||r<=.05||!e.nameLabel.visible()){e.namePlate.opacity(0),e.subLabel.opacity(0);return}let s=e.nameLabel.rotation(),n=s===0&&Xs(i,e)==="sold-out",l=ct/t,a=$t/t,c=n?2/t:0,h={x:e.nameLabel.x(),y:e.nameLabel.y()},d=e.nameLabel.height(),u=0;n?(He(e.subLabel,ve/t,h.y),u=e.subLabel.height(),e.subLabel.rotation(0),e.subLabel.x(h.x),e.subLabel.y(h.y+d/2+c+u/2),e.subLabel.opacity(r)):e.subLabel.opacity(0);let f=n?c+u:0,y=Math.max(e.nameLabel.width(),n?e.subLabel.width():0)+l*2,m=d+f+a*2;e.namePlate.position({x:h.x,y:h.y+f/2}),e.namePlate.rotation(s),e.namePlate.size({width:y,height:m}),e.namePlate.offset({x:y/2,y:m/2}),e.namePlate.cornerRadius(Gr/t),e.namePlate.opacity(r*Ut)}function Us(i,e){let t,o;i.reducedMotion?(t=e<=be?1:0,o=e<=Xe?1:0):(t=N((Se-e)/(Se-be),0,1),o=N((be-e)/(be-Xe),0,1)),(i.floorOverview||i.focusedSectionId)&&(t=0,o=0);let r=!i.floorOverview&&!i.focusedSectionId&&e<le;r&&(t=1),i.zones.length||(o=0);let s=i.viewMode==="perspective"&&i.glideInProgress&&i.seatCount>2500;i.seatLayer.opacity(r||s?0:1-t);let n=i.stageScaleX,l=!i.glideInProgress&&(i.lodScale===0||Math.abs(e-i.lodScale)/(i.lodScale||1)>.08);l&&i.setLodScale(e);let a=i.focusedSectionId,c=i.stageWidth<se,h=te(i.canvasBackground),d=N((t-.2)/.8,0,1);for(let f of i.sections){let y=i.hasFocusDimOverlay?1:a&&f.id!==a&&f.logicalId!==a&&f.zone!==a?Oe:1,m=Math.min(y,Vs(f.memberCategoryKeys,i.categoryFilter)?Oe:1);f.outlinePoly.opacity(r?0:(1-t)*m),f.blockPoly.opacity(Tr*t*m);let p=i.sectionIsOwned(f);f.blockPoly.stroke(p?i.selectionColor:f.shellStroke||h.sectionStroke),f.blockPoly.strokeWidth((p?xr:Fe)/Math.max(n,1e-4));let g=f.blockPoly.fill(),b=typeof g=="string"?g:f.baseFill,S=c?qi(i.canvasBackground,b):null;S&&f.namePlate.fill(S);let v=U(S??b,f.preferredInk);f.nameLabel.fill(v),f.subLabel.fill(v),Ul(i,f,c),l&&d>.01&&Ql(i,f,n),f.nameLabel.opacity(f.nameLabelFits?d*(1-o)*m:0),f.subLabel.opacity(0)}let u=o*(1-i.isoT);for(let f of i.zones)f.back.opacity(u),f.label.opacity(u),f.sub&&f.sub.opacity(i.stageWidth<se?0:u),l&&Jl(i,f,n);if(!i.glideInProgress&&(d>.01||u>.01)){Zl(i,n),ql(i.sections);for(let f of i.zones){let y=f.label.opacity();f.back.opacity(y),f.sub&&f.sub.opacity(i.stageWidth<se?0:y)}}for(let f of i.sections)$l(i,f,n);i.bgLayer.batchDraw()}function ql(i){let e=new Map;for(let t of i)(e.get(t.logicalId)??e.set(t.logicalId,[]).get(t.logicalId)).push(t);for(let t of e.values()){if(t.length<2)continue;let o=t.filter(r=>r.nameLabel.opacity()>.05).sort((r,s)=>{let n=V(r.outline),l=V(s.outline);return l.width*l.height-n.width*n.height});for(let r of o.slice(1))r.nameLabel.opacity(0)}}function Zl(i,e){let o=[],r=a=>{let c=i.worldToScreen({x:a.x(),y:a.y()}),h=V(Qe({x:0,y:0},a.width()*e,a.height()*e,a.rotation()));return{x:c.x-h.width/2,y:c.y-h.height/2,w:h.width,h:h.height}};for(let a of i.zones){if(a.label.opacity()<=.05)continue;let c=a.back.getAbsolutePosition(),h=a.back.width()*e,d=a.back.height()*e;o.push({node:a.label,tier:0,section:!1,zone:a,box:{x:c.x-h/2,y:c.y-d/2,w:h,h:d}})}for(let a of i.sections)a.nameLabel.opacity()>.05&&o.push({node:a.nameLabel,tier:1,section:!0,area:a.labelArea,box:r(a.nameLabel)});let s=i.landmarks.map(a=>{let c=i.worldToScreen({x:a.x,y:a.y}),h=i.worldToScreen({x:a.x+a.width,y:a.y+a.height});return{x:Math.min(c.x,h.x),y:Math.min(c.y,h.y),w:Math.abs(h.x-c.x),h:Math.abs(h.y-c.y)}});if(o.length<2&&!s.length)return;o.sort((a,c)=>a.tier-c.tier||(c.area??0)-(a.area??0)||a.box.y-c.box.y||a.box.x-c.box.x);let n=[...s],l=a=>n.some(c=>a.x<c.x+c.w+4&&c.x<a.x+a.w+4&&a.y<c.y+c.h+4&&c.y<a.y+a.h+4);for(let a of o){if(!l(a.box)){n.push(a.box);continue}let c=!1;if(a.zone)for(let h of Br){if(h===0)continue;let d={...a.box,y:a.box.y+h};if(!l(d)){Ui(a.zone,0,h/e),n.push(d),c=!0;break}}if(a.section){let h=a.node.fontSize(),d=a.node.y(),u=a.node.letterSpacing()>0;for(let f of Cr){let y=h*f;if(y*e<ve)break;He(a.node,y,d),u&&(a.node.letterSpacing(a.node.fontSize()*Be),a.node.offsetX(a.node.width()/2));let m=r(a.node);if(!l(m)){n.push(m),c=!0;break}}c||(He(a.node,h,d),u&&(a.node.letterSpacing(a.node.fontSize()*Be),a.node.offsetX(a.node.width()/2)))}c||a.node.opacity(0)}}function He(i,e,t){i.fontSize(Math.max(1,e)),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t)}function Ql(i,e,t){e.subLabelFits=!1;let o=i.stageWidth<se,r=o?ct*2:0,s=Ue(Ye*e.labelScale,i.stageWidth),n=ve;for(let l=s;l>=n;l-=1)for(let a of[0,-90]){e.nameLabel.rotation(a),He(e.nameLabel,l/t,e.nameLabel.y()),o&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Be),e.nameLabel.offsetX(e.nameLabel.width()/2));for(let c of e.labelAnchors){e.nameLabel.position(c);let h=(8+r)/t;if(ti(c,e.nameLabel.width()+h,e.nameLabel.height()+h,a,e.outline,e.holes)){e.nameLabelFits=!0;return}}}e.nameLabel.position(e.centroid),e.nameLabel.rotation(0),e.nameLabelFits=!1}function jl(i,e,t){let o=r=>(i.text(r),i.width());if(!(o(e)<=t)){for(let r=e.length-1;r>=1;r-=1)if(o(`${e.slice(0,r).trimEnd()}\u2026`)<=t)return;o("\u2026")}}function Jl(i,e,t){let o=Ai(i.stageWidth),r=e.sub!=null&&i.stageWidth>=se,s=i.stageWidth<se,n=(s?Pr:Rr)*o/t,l=(s?Mr:Ar)*o/t,a=r?3*o/t:0;if(e.label.text(e.name),He(e.label,Ue(Kt,i.stageWidth)/t,e.anchor.y),s){let b=i.stageWidth*Fr/t-n*2;jl(e.label,e.name,Math.max(b,1)),He(e.label,e.label.fontSize(),e.anchor.y)}e.label.x(e.anchor.x),r&&(He(e.sub,Ue(zt,i.stageWidth)/t,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*Ir),e.sub.offsetX(e.sub.width()/2),e.sub.x(e.anchor.x));let c=Math.max(e.label.width(),r?e.sub.width():0)+n*2,h=e.label.height()+(r?a+e.sub.height():0)+l*2;e.label.y(e.anchor.y-(r?(a+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+a)/2),e.back.position(e.anchor),e.back.size({width:c,height:h}),e.back.offset({x:c/2,y:h/2}),e.back.cornerRadius(Er*o/t),e.back.strokeWidth(1/t);let d=e.back.getAbsolutePosition(),u=6,f=c*t;if(f>i.stageWidth-u*2){e.label.opacity(0),e.back.opacity(0),e.sub&&e.sub.opacity(0);return}let y=f/2,p=(N(d.x,u+y,i.stageWidth-u-y)-d.x)/t;Math.abs(p)>.001&&Ui(e,p,0);let g=62+h*t/2;d.y<g&&Ui(e,0,(g-d.y)/t)}function Ui(i,e,t){i.label.x(i.label.x()+e),i.label.y(i.label.y()+t),i.sub&&(i.sub.x(i.sub.x()+e),i.sub.y(i.sub.y()+t)),i.back.x(i.back.x()+e),i.back.y(i.back.y()+t)}function ec(i,e){if(!i.length)return null;let t=1/0,o=1/0,r=-1/0,s=-1/0;for(let n of i)!Number.isFinite(n.x)||!Number.isFinite(n.y)||(n.x<t&&(t=n.x),n.y<o&&(o=n.y),n.x>r&&(r=n.x),n.y>s&&(s=n.y));return!Number.isFinite(t)||!Number.isFinite(o)?null:{x:t-e,y:o-e,width:r-t+e*2,height:s-o+e*2}}function Ji(i,e=0){let t=new Map;for(let r of i){let s=`${r.rowId}|${r.categoryKey}`,n=t.get(s);n||(n={categoryKey:r.categoryKey,points:[]},t.set(s,n)),n.points.push({x:r.x,y:r.y})}let o=[];for(let[r,s]of t){let n=ec(s.points,e);n&&o.push({id:r,categoryKey:s.categoryKey,seatCount:s.points.length,bounds:n})}return o}function Qi(i,e){let t=Math.max(0,Math.max(i.x-(e.x+e.width),e.x-(i.x+i.width))),o=Math.max(0,Math.max(i.y-(e.y+e.height),e.y-(i.y+i.height)));return Math.hypot(t,o)}function ji(i,e){let t=Math.min(i.x,e.x),o=Math.min(i.y,e.y);return{x:t,y:o,width:Math.max(i.x+i.width,e.x+e.width)-t,height:Math.max(i.y+i.height,e.y+e.height)-o}}function $s(i){if(!i.length)return 0;let e=[...i].sort((o,r)=>o-r),t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2}function tc(i){if(!i.length)return 0;let e=$s(i.map(o=>Math.min(o.bounds.width,o.bounds.height)));if(i.length<2)return e;let t=[];for(let o=0;o<i.length;o+=1){let r=1/0;for(let s=0;s<i.length;s+=1)o!==s&&(r=Math.min(r,Qi(i[o].bounds,i[s].bounds)));Number.isFinite(r)&&t.push(r)}return $s(t)+e}function eo(i,e){if(!i.length)return[];let t=tc(i)*(e?.gapRows??2),o=e?.minRows??2,r=e?.minSeats??12,s=new Map;for(let l of i){let a=s.get(l.categoryKey);a?a.push(l):s.set(l.categoryKey,[l])}let n=[];for(let[l,a]of s){let c=[...a].sort((u,f)=>u.bounds.y-f.bounds.y||u.bounds.x-f.bounds.x||u.id.localeCompare(f.id)),h=[];for(let u of c){let f=h.find(y=>Qi(y.bounds,u.bounds)<=t);f?(f.bounds=ji(f.bounds,u.bounds),f.rowIds.push(u.id),f.seatCount+=u.seatCount):h.push({categoryKey:l,bounds:{...u.bounds},rowIds:[u.id],seatCount:u.seatCount})}let d=!0;for(;d&&h.length>1;){d=!1;e:for(let u=0;u<h.length;u+=1)for(let f=u+1;f<h.length;f+=1)if(!(Qi(h[u].bounds,h[f].bounds)>t)){h[u].bounds=ji(h[u].bounds,h[f].bounds),h[u].rowIds.push(...h[f].rowIds),h[u].seatCount+=h[f].seatCount,h.splice(f,1),d=!0;break e}}for(let u of h)u.rowIds.length<o&&u.seatCount<r||(u.rowIds.sort(),n.push(u))}return n.sort((l,a)=>l.bounds.y-a.bounds.y||l.bounds.x-a.bounds.x||l.categoryKey.localeCompare(a.categoryKey)),n}function qs(i){let e=null;for(let t of i)e=e?ji(e,t.bounds):{...t.bounds};return e}function Zs(i,e){let t=null,o=1/0;for(let r of i){let{x:s,y:n,width:l,height:a}=r.bounds;if(e.x<s||e.x>s+l||e.y<n||e.y>n+a)continue;let c=l*a;c<o&&(t=r,o=c)}return t}function en(i){return i*.3}function js(i){return en(i)*2+i*.42}var ii=class{constructor(e){this.host=e;this.group=null;this.labels=[];this.revealed=!1;this.visible=!1;this.fadeRaf=0;this.lastFontKey=""}get all(){return this.labels.map(e=>e.cluster)}clear(){this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),this.group?.destroy(),this.group=null,this.labels=[],this.visible=!1,this.revealed=!1,this.lastFontKey=""}destroy(){this.clear()}rebuild(){if(this.clear(),this.syncCursor(!1),this.host.hasSections()||this.host.exportMode)return;let e=eo(Ji(this.host.seats(),this.host.seatR()));if(!e.length)return;let t=this.host.canvasBackground(),o=te(t),r=qi(t,t),s=U(r,o.sectionInk),n=new Qs({listening:!1,opacity:0,visible:!1});for(let l of e){let a=this.host.categoryLabel(l.categoryKey);if(!a)continue;let c={x:l.bounds.x+l.bounds.width/2,y:l.bounds.y+l.bounds.height/2},h=new Qs({listening:!1}),d=new oc({...c,width:0,height:0,fill:r,stroke:o.sectionStroke,strokeWidth:Fe,opacity:Ut,listening:!1,perfectDrawEnabled:!1}),u=new ic({...c,radius:0,fill:this.host.categoryColor(l.categoryKey),listening:!1,perfectDrawEnabled:!1}),f=this.host.categoryPriceLabel(l.categoryKey),y=new rc({...c,text:a,fontSize:Ye,fontStyle:we,fontFamily:this.host.labelFont(),fill:s,listening:!1,perfectDrawEnabled:!1});h.add(d),h.add(u),h.add(y),n.add(h),this.labels.push({cluster:l,pill:h,plate:d,swatch:u,text:y,label:a,price:f})}if(!this.labels.length){n.destroy();return}this.group=n,this.host.labelLayer.add(n)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let t=this.host.seatR()*2,o=this.host.exportMode||this.host.viewMode()!=="flat"||this.host.seatsPickable()&&e<_e;return this.revealed=o||pr(Pi(t,e),Pi(t,_e),this.revealed),!this.revealed&&this.size(this.host.stage.scaleX(),this.host.stage.width())&&this.host.labelLayer.batchDraw(),this.applyFilterDim(),this.applyVisibility(!this.revealed),!0}focusCluster(e){if(this.host.viewMode()!=="flat"||this.host.hasSections()||this.host.seatsPickable())return!1;let t=this.clusterAt(this.host.screenToWorld(e));if(!t)return!1;let o=this.host.seatR()*2,r={x:t.bounds.x-o,y:t.bounds.y-o,width:t.bounds.width+o*2,height:t.bounds.height+o*2},s=this.host.stage;if(Je(s,r,this.host.zoomBounds(),this.host.framingViewport())<=s.scaleX()*$e)return!1;let l=this.diveTarget(r);return l?(this.host.focusRegion(l,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,t){let o=this.host.stage,r=this.host.framingViewport(),s=this.host.zoomBounds(),n=Je(o,e,s,r),l=Math.min(this.host.readableScale(),s.max);if(n>=l)return e;let a=r.width/(l*Le),c=r.height/(l*Le);if(!(a>0)||!(c>0))return null;let h=t??{x:e.x+e.width/2,y:e.y+e.height/2};return{x:h.x-a/2,y:h.y-c/2,width:a,height:c}}glideTowardTap(e){if(this.host.viewMode()!=="flat")return!1;let t=this.host.stage.scaleX(),o=Nr(t,this.host.pickableScale());if(o==null||o<=t*$e)return!1;let r=this.host.screenToWorld(e),s=this.host.framingViewport(),n=s.width/(o*Le),l=s.height/(o*Le);return!(n>0)||!(l>0)?!1:(this.host.focusRegion({x:r.x-n/2,y:r.y-l/2,width:n,height:l}),!0)}syncCursor(e){if(this.host.exportMode)return;let t=this.host.viewMode()==="flat"&&!this.host.seatsPickable()?"zoom-in":e?"pointer":"default";for(let o of[this.host.stage.container(),this.host.stage.content])o&&o.style.cursor!==t&&(o.style.cursor=t)}clusterAt(e){let t=Zs(this.all,e);if(t)return t;if(!this.visible)return null;for(let o of this.labels){let r=o.plate.width()/2,s=o.plate.height()/2;if(Math.abs(e.x-o.text.x())<=r&&Math.abs(e.y-o.text.y())<=s)return o.cluster}return null}size(e,t){let o=Math.max(e,1e-4),r=t<se,s=`${o.toFixed(4)}|${t}`;if(s===this.lastFontKey)return!1;this.lastFontKey=s;let n=Ue(Ye,t),l=ct/o,a=$t/o;for(let c of this.labels){let{text:h,plate:d,swatch:u,cluster:f}=c,y=Zi(c.label,r);h.text(c.price?`${y} \xB7 ${c.price}`:y),h.fontStyle(r?Yt:we);let m=n,p=0;for(;h.fontSize(Math.max(1,m/o)),h.letterSpacing(h.fontSize()*Be),p=js(h.fontSize())+h.width()+l*2,!(p<=f.bounds.width||m<=ve);)m=Math.max(ve,m-1);let g={x:f.bounds.x+f.bounds.width/2,y:f.bounds.y+f.bounds.height/2},b=h.height()+a*2,S=p-l*2,v=g.x-S/2;u.radius(en(h.fontSize())),u.position({x:v+u.radius(),y:g.y}),h.offsetX(0),h.offsetY(h.height()/2),h.position({x:v+js(h.fontSize()),y:g.y}),d.size({width:p,height:b}),d.offset({x:p/2,y:b/2}),d.cornerRadius(b/2),d.strokeWidth(Fe/o),d.position(g)}return!0}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),t=!1;for(let o of this.labels){let r=e&&!e.has(o.cluster.categoryKey)?.22:1;o.pill.opacity()!==r&&(o.pill.opacity(r),t=!0)}t&&this.host.labelLayer.batchDraw()}boundsForSeats(e,t){if(!e.length)return null;let o=Ji(e,this.host.seatR()),r=eo(o);r.length||(r=o.map(l=>({categoryKey:l.categoryKey,bounds:l.bounds,rowIds:[l.id],seatCount:l.seatCount})));let s=qs(r);if(!s)return null;let n=r.reduce((l,a)=>a.seatCount>l.seatCount?a:l,r[0]);return{bounds:{x:s.x-t,y:s.y-t,width:s.width+t*2,height:s.height+t*2},anchor:{x:n.bounds.x+n.bounds.width/2,y:n.bounds.y+n.bounds.height/2}}}applyVisibility(e){let t=this.group;if(!t||e===this.visible)return;if(this.visible=e,this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),t.visible(!0),this.host.reducedMotion()){t.opacity(e?1:0),t.visible(e),this.host.labelLayer.batchDraw();return}let o=t.opacity(),r=e?1:0,s=performance.now(),n=l=>{if(this.host.destroyed()||!this.group){this.fadeRaf=0;return}let a=Math.min(1,(l-s)/150);t.opacity(o+(r-o)*a),a>=1&&t.visible(r>0),this.host.labelLayer.batchDraw(),this.fadeRaf=a<1?requestAnimationFrame(n):0};this.fadeRaf=requestAnimationFrame(n)}};import{Circle as sc}from"konva/lib/shapes/Circle";import{Line as nc}from"konva/lib/shapes/Line";function tn(i,e,t,o){let r=i.seatRadius(),s=new sc({x:t.x,y:t.y,radius:r,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),n=i.viewMode()==="perspective"?i.perspectiveSeatScale(e):1;s.scale({x:n,y:n}),i.overlayLayer.add(s);let l=performance.now(),a=620,c=h=>{if(!s.getLayer())return;let d=Math.min(1,(h-l)/a);s.radius(r*(1+d*1.8)),s.opacity(.9*(1-d)),i.overlayLayer.batchDraw(),d<1?requestAnimationFrame(c):(s.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(c)}function on(i,e,t){for(let o of e){let r=i.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(d=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,d))):o.outline.map(d=>{let u=o.liftWorld>0?i.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:d.x+u.x,y:d.y+u.y}}),s=r.reduce((d,u)=>({x:d.x+u.x,y:d.y+u.y}),{x:0,y:0});s.x/=r.length,s.y/=r.length;let n=new nc({x:s.x,y:s.y,points:r.flatMap(d=>[d.x-s.x,d.y-s.y]),closed:!0,stroke:t,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:t,shadowBlur:14,shadowOpacity:.7});i.overlayLayer.add(n),i.overlayLayer.batchDraw();let l=()=>{n.getLayer()&&(n.destroy(),i.overlayLayer.batchDraw())};if(i.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(l,520);continue}let a=performance.now(),c=820,h=d=>{if(i.isDestroyed()||!n.getLayer())return;let u=Math.min(1,(d-a)/c),y=1+(1-Math.pow(1-u,3))*.04;n.scale({x:y,y}),n.opacity(.92*(1-u)),i.overlayLayer.batchDraw(),u<1?requestAnimationFrame(h):l()};requestAnimationFrame(h)}}import{Group as hc}from"konva/lib/Group";import{Shape as dc}from"konva/lib/Shape";import{Group as ac}from"konva/lib/Group";import{Shape as lc}from"konva/lib/Shape";function cc(i,e,t){let o=e.length,r={x:(e[o-1].x+e[0].x)/2,y:(e[o-1].y+e[0].y)/2};i.moveTo(r.x,r.y);for(let s=0;s<o;s+=1){let n=e[s],l=e[(s+1)%o],a=e[(s-1+o)%o],c=Math.min(Math.hypot(n.x-a.x,n.y-a.y)/2,Math.hypot(l.x-n.x,l.y-n.y)/2);i.arcTo(n.x,n.y,l.x,l.y,Math.max(0,Math.min(t,c)))}i.closePath()}function Ne(i,e,t,o){let r=rt(i)>0,s=t.cornerRadius&&t.cornerRadius>0?t.cornerRadius:0;return new lc({...t,sceneFunc(n,l){n.beginPath();let a=h=>{if(h.length){if(s>0&&h.length>=3)return cc(n,h,s);n.moveTo(h[0].x,h[0].y);for(let d=1;d<h.length;d+=1)n.lineTo(h[d].x,h[d].y);n.closePath()}};o?(h=>{n.moveTo(h.start.x,h.start.y);let d=h.start;for(let u of h.segments)u.kind==="line"?n.lineTo(u.end.x,u.end.y):u.kind==="arc"?n.arc(u.center.x,u.center.y,u.radius,Math.atan2(d.y-u.center.y,d.x-u.center.x),Math.atan2(u.end.y-u.center.y,u.end.x-u.center.x),!u.clockwise):n.bezierCurveTo(u.control1.x,u.control1.y,u.control2.x,u.control2.y,u.end.x,u.end.y),d=u.end;n.closePath()})(o):a(i);for(let h of e??[]){let d=rt(h)>0;a(d===r?[...h].reverse():h)}n.fillStrokeShape(l)},perfectDrawEnabled:!1})}var yt=class extends ac{constructor(){super(...arguments);this.viewportCulled=!1}setViewportCulled(t){t!==this.viewportCulled&&(this.viewportCulled=t,t||super._clearSelfAndDescendantCache())}isViewportCulled(){return this.viewportCulled}drawScene(...t){return this.viewportCulled?this:super.drawScene(...t)}drawHit(...t){return this.viewportCulled?this:super.drawHit(...t)}_clearSelfAndDescendantCache(t){if(!this.viewportCulled){super._clearSelfAndDescendantCache(t);return}this._clearCache(t)}};function rn(i,e){if(!e.length)return null;let t=new hc({listening:!1});for(let o of e){let r=i.viewMode==="perspective"&&o.perspectiveAffine,s=r?o.outline.map(l=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,l))):o.outline,n=r?o.holes.map(l=>l.map(a=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,a)))):o.holes;t.add(Ne(s,n,{fill:Kr,stroke:F("#ffffff",.1),strokeWidth:1,listening:!1},r?void 0:o.outlinePath))}return i.bgLayer.add(t),t.moveToTop(),t}function sn(i,e){let{bounds:t}=i,r=Math.max(t.width,t.height,1)*4+1e3,s=[{x:t.x-r,y:t.y-r},{x:t.x+t.width+r,y:t.y-r},{x:t.x+t.width+r,y:t.y+t.height+r},{x:t.x-r,y:t.y+t.height+r}],n=new dc({fill:i.canvasBackground,opacity:1-Oe,listening:!1,perfectDrawEnabled:!1,sceneFunc:(l,a)=>{let c=h=>{if(h.length){l.moveTo(h[0].x,h[0].y);for(let d=1;d<h.length;d++)l.lineTo(h[d].x,h[d].y);l.closePath()}};l.beginPath(),c(s);for(let h of e){let d=i.viewMode==="perspective"&&h.perspectiveAffine?h.outline.map(u=>i.perspectiveLocalPoint(i.projectedSectionPoint(h,u))):h.outline.map(u=>{let f=h.liftWorld>0?i.isoLiftLocal(h.liftWorld):{x:0,y:0};return{x:u.x+f.x,y:u.y+f.y}});c(rt(d)>0?[...d].reverse():d)}l.fillStrokeShape(a)}});return i.overlayLayer.add(n),n.moveToTop(),n}import{Rect as ma}from"konva/lib/shapes/Rect";import{Line as rh}from"konva/lib/shapes/Line";import{Text as ya}from"konva/lib/shapes/Text";import{Path as sh}from"konva/lib/shapes/Path";import{Text as uc}from"konva/lib/shapes/Text";function nn(i){let e=Me,t=new uc({fontSize:fe,fontStyle:"600",fontFamily:i.labelFont(),listening:!1}),o=i.seatR*2-3;for(let r of i.seats){if(r.kind==="booth"){e=Math.min(e,Me);continue}let s=fe*i.seatLabelScale(r);t.fontSize(s),t.text(Ft(r.displayLabel??r.label));let n=t.width()>o?Math.max(nt,s*o/t.width()):s;e=Math.min(e,n)}return t.destroy(),G/Math.max(nt,e)}var to={top:0,right:0,bottom:0,left:0};function an(i){let e=t=>typeof t=="number"&&Number.isFinite(t)&&t>0?t:0;return i?{top:e(i.top),right:e(i.right),bottom:e(i.bottom),left:e(i.left)}:{...to}}var pc=.7;function ln(i,e,t){let{top:o,right:r,bottom:s,left:n}=t,l=(u,f,y)=>{let m=u+f,p=y*pc;if(m<=p||m<=0)return[u,f];let g=p/m;return[u*g,f*g]},[a,c]=l(n,r,i),[h,d]=l(o,s,e);return{x:a,y:h,width:Math.max(1,i-a-c),height:Math.max(1,e-h-d)}}function cn(i){return{x:i.x(),y:i.y(),scale:i.scaleX()}}function hn(i,e){return!Number.isFinite(e.x)||!Number.isFinite(e.y)||!(e.scale>0)?!1:(i.scale({x:e.scale,y:e.scale}),i.position({x:e.x,y:e.y}),!0)}function oi(i){return{x:i.x+i.width/2,y:i.y+i.height/2}}function dn(i,e){let t=e({x:i.x,y:i.y}),o=e({x:i.x+i.width,y:i.y+i.height});return{x:Math.min(t.x,o.x),y:Math.min(t.y,o.y),width:Math.abs(o.x-t.x),height:Math.abs(o.y-t.y)}}function pn(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?Lr:kr}function fn(i){return Math.max(i*1.05,yr,le*1.3)}function io(i,e){let t=1/0,o=-1/0,r=1/0,s=-1/0;for(let n of i)t=Math.min(t,n.x),o=Math.max(o,n.x),r=Math.min(r,n.y),s=Math.max(s,n.y);return t-=e,o+=e,r-=e,s+=e,{x:t,y:r,width:Math.max(40,o-t),height:Math.max(40,s-r)}}function mn(i){let{stageWidth:e,stageHeight:t,fullBounds:o,visibleBounds:r,seatPoints:s,minScale:n}=i;if(!s.length)return null;let l=1.12;if(Math.min(e/(o.width*l),t/(o.height*l))>=n)return null;let c=i.tapAnchor??{x:r.x+r.width/2,y:r.y+r.height/2},h=s[0],d=1/0;for(let m of s){let p=(m.x-c.x)**2+(m.y-c.y)**2;p<d&&(h=m,d=p)}let u=e/(n*l),f=t/(n*l),y=io(s,0);return{bounds:{x:un(h.x,u,y.x,y.width),y:un(h.y,f,y.y,y.height),width:u,height:f},minScale:n}}function un(i,e,t,o){return o<=e?t+o/2-e/2:Math.min(Math.max(i-e/2,t),t+o-e)}var vn=.5,H=Math.SQRT1_2,fc="#f3f4f6",yn=4;function mc(i){let e=i.fraction;return typeof e!="number"||!Number.isFinite(e)?vn:Math.min(1,Math.max(0,e))}function yc(i){return i==="booked"||i==="not_for_sale"?ht:qt}function gn(i,e){return Number.parseInt(i.slice(e,e+2),16)}function bn(i){let e=i.trim();if(!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e))return null;if(e.length===7)return e.toLowerCase();let[,t,o,r]=e.toLowerCase();return`#${t}${t}${o}${o}${r}${r}`}function gc(i,e,t){let o=bn(i),r=bn(e);if(!o||!r)return i;let s=Math.min(1,Math.max(0,t)),n="#";for(let l=1;l<7;l+=2){let a=Math.round(gn(o,l)*(1-s)+gn(r,l)*s);n+=a.toString(16).padStart(2,"0")}return n}function Sn(i,e,t,o){let r=t*4,s=e*H,n=-e*H,l=o*H*2*r,a=o*-H*2*r,c=s+r*H,h=n+r*H,d=s-r*H,u=n-r*H;i.beginPath(),i.moveTo(c,h),i.lineTo(d,u),i.lineTo(d+l,u+a),i.lineTo(c+l,h+a),i.closePath(),i.clip()}function bc(i,e){let t=e*4,o=Math.max(e*.45,1);i.beginPath();for(let r=-yn;r<=yn;r++){let s=r*o*2,n=s+o,l=s*H,a=-s*H,c=n*H,h=-n*H;i.moveTo(l+t*H,a+t*H),i.lineTo(l-t*H,a-t*H),i.lineTo(c-t*H,h-t*H),i.lineTo(c+t*H,h+t*H),i.closePath()}i.clip()}function ri(i,e){i._sceneFunc(e)}function wn(i){let e=this,t=e.attrs,o=t.markRadius||1,r=t.fill,s=e.getStage(),n=Math.abs((s?s.scaleX():1)*(e.scaleX()||1))||1;if(o*2*n<16){t.fill=t.markMidtone??r,ri(e,i),t.fill=r;return}let a=(1-2*(t.markFraction??vn))*o;i.save(),Sn(i,a,o,1),t.fill=t.markBase??r,ri(e,i),i.restore(),i.save(),Sn(i,a,o,-1),t.fill=t.markFill??r,ri(e,i),t.markHatch&&(bc(i,o),t.fill=fc,ri(e,i)),i.restore(),t.fill=r}function Sc(i,e,t,o,r,s){let n=mc(e),l=yc(t),a=i.attrs;a.markFraction=n,a.markBase=o,a.markFill=l,a.markMidtone=gc(o,l,1-n),a.markHatch=s,a.markRadius=r>0?r:1,i.fill(a.markMidtone),i.stroke(""),i.strokeWidth(0),i.dash([]),i.opacity(1),i.sceneFunc(wn)}function vc(i){i.setAttr("sceneFunc",void 0)}function oo(i){return i.attrs.sceneFunc===wn}var si=class{constructor(){this.marks=new Map}get size(){return this.marks.size}get(e){return this.marks.get(e)??null}has(e){return this.marks.has(e)}clear(){this.marks.clear()}merge(e,t){let o=new Set;for(let[r,s]of Object.entries(e))t.has(r)&&(s&&s.kind==="partial"?(this.marks.set(r,s),o.add(r)):this.marks.delete(r)&&o.add(r));return o}paint(e,t,o,r,s,n,l){let a=l?void 0:this.marks.get(t);if(!a){oo(e)&&vc(e);return}Sc(e,a,o,r,s,n)}};function ni(i){let e=i.getClientRect({skipTransform:!0,skipShadow:!0});!Number.isFinite(e.width)||!Number.isFinite(e.height)||(i.offsetX(e.x+e.width/2),i.offsetY(e.y+e.height/2))}var kn=.85,wc=[2,2],kc=1,Ln=.6;function Lc(i){return W(i)?"#334155":"#e2e8f0"}function Tn(i,e,t){return i==="held"?{fill:qt,stroke:Lc(e),strokeWidth:kc,dash:[...wc],opacity:1,scale:1}:i==="booked"||i==="not_for_sale"?t?{fill:"rgba(0,0,0,0)",stroke:ht,strokeWidth:1.5,dash:[],opacity:.9,scale:kn}:{fill:ht,stroke:"",strokeWidth:0,dash:[],opacity:i==="booked"?.45:.6,scale:kn}:null}var ro=1e6;function Tc(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}var ai=class{constructor(e,t=Tc()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.lastTapAt=0;this.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.beginPointer(e.pointerId,this.toLocal(e.clientX,e.clientY),e.pointerType,e.button)};this.onPointerMove=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId))return;e.preventDefault();let t=this.toLocal(e.clientX,e.clientY);this.updatePointer(e.pointerId,t)&&this.applyPointerMove(t)};this.onPointerEnd=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||this.endPointer(e.pointerId)};this.onTouchStart=e=>{e.preventDefault();for(let t=0;t<e.changedTouches.length;t+=1){let o=e.changedTouches.item(t);o&&this.beginPointer(ro+o.identifier,this.toLocal(o.clientX,o.clientY),"touch",0)}};this.onTouchMove=e=>{e.preventDefault();let t=null;for(let o=0;o<e.changedTouches.length;o+=1){let r=e.changedTouches.item(o);if(!r)continue;let s=this.toLocal(r.clientX,r.clientY);this.updatePointer(ro+r.identifier,s)&&(t=s)}t&&this.applyPointerMove(t)};this.onTouchEnd=e=>{e.preventDefault();for(let t=0;t<e.changedTouches.length;t+=1){let o=e.changedTouches.item(t);o&&this.endPointer(ro+o.identifier)}};this.host=e,this.useWebKitTouchEvents=t}get moved(){return this.movedPx}attach(){let{container:e}=this.host;e.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),e.addEventListener("pointermove",this.onPointerMove,{passive:!1}),e.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),e.addEventListener("pointercancel",this.onPointerEnd,{passive:!1}),this.useWebKitTouchEvents&&(e.addEventListener("touchstart",this.onTouchStart,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove,{passive:!1}),e.addEventListener("touchend",this.onTouchEnd,{passive:!1}),e.addEventListener("touchcancel",this.onTouchEnd,{passive:!1}))}detach(){let{container:e}=this.host;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerEnd),e.removeEventListener("pointercancel",this.onPointerEnd),this.useWebKitTouchEvents&&(e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("touchcancel",this.onTouchEnd))}resetPan(){this.panLast=null,this.panStart=null,this.panStarted=!1}isGhostClick(e){return e.type==="tap"?(this.lastTapAt=performance.now(),!1):this.lastTapAt>0&&performance.now()-this.lastTapAt<gr}toLocal(e,t){let o=this.host.container.getBoundingClientRect();return{x:e-o.left,y:t-o.top}}beginPointer(e,t,o,r){if(this.host.cancelGlide(),this.pointers.set(e,t),this.pointers.size===1)this.movedPx=0,this.singleTouch=o==="touch",this.singleTouch&&this.host.touchProbeStart?.(t),this.pinch=null,this.panStart=t,this.panStarted=!1,this.host.marqueeShouldStart({pointerType:o,button:r})?(this.host.beginMarquee(t),this.panLast=null):this.panLast=t;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee(),this.endTouchProbe();let[s,n]=[...this.pointers.values()],l={x:(s.x+n.x)/2,y:(s.y+n.y)/2},a=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(n.x-s.x,n.y-s.y),startScale:a,worldMid:{x:(l.x-this.host.stage.x())/a,y:(l.y-this.host.stage.y())/a}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=Ce+1}}updatePointer(e,t){return this.pointers.has(e)?(this.pointers.set(e,t),this.pointers.size===1&&this.panStart?this.movedPx=Math.max(this.movedPx,Math.hypot(t.x-this.panStart.x,t.y-this.panStart.y)):this.pointers.size>=2&&(this.movedPx=Ce+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>Ce?this.endTouchProbe():this.host.touchProbeMove?.(e)),this.host.marqueeActive()){this.host.updateMarquee(e);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();let[t,o]=[...this.pointers.values()],r=Math.hypot(o.x-t.x,o.y-t.y);if(this.pinch.startDist<1)return;let s={x:(t.x+o.x)/2,y:(t.y+o.y)/2},{min:n,max:l}=this.host.zoomBounds(),a=N(this.pinch.startScale*(r/this.pinch.startDist),n,l);this.host.stage.scale({x:a,y:a}),this.host.stage.position({x:s.x-this.pinch.worldMid.x*a,y:s.y-this.pinch.worldMid.y*a}),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=Ce)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}this.host.stage.position({x:this.host.stage.x()+(e.x-this.panLast.x),y:this.host.stage.y()+(e.y-this.panLast.y)}),this.panLast=e,this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}}endPointer(e){if(this.pointers.has(e)){if(this.host.marqueeActive()){this.endTouchProbe(),this.host.finishMarquee(),this.pointers.delete(e),this.pointers.size===0&&(this.panLast=null);return}this.pointers.delete(e),this.pointers.size<2&&(this.pinch=null),this.pointers.size===1&&(this.panLast=[...this.pointers.values()][0],this.panStart=this.panLast,this.panStarted=!0),this.pointers.size===0&&(this.panLast=null,this.panStart=null,this.panStarted=!1,this.endTouchProbe(),this.host.afterViewChange())}}endTouchProbe(){this.singleTouch&&(this.singleTouch=!1,this.host.touchProbeEnd?.())}};import{Circle as xc}from"konva/lib/shapes/Circle";import{Group as Cc}from"konva/lib/Group";import{Text as Ic}from"konva/lib/shapes/Text";var xn=13,Pc=15,Mc=.3,Rc=.08;function Mn(i,e,t){return!!(i&&t!==i||e&&!e.has(t))}function Ac(i,e){return!e||i.available==null?`cap ${i.capacity}`:i.available<=0?$("map.soldOut"):$("map.seatsLeft",{count:i.available})}function Ec(i,e){return e&&i.available!=null&&i.available<=0}function Rn(i){for(let e of i.gaById.values()){let t=i.filteredOut(e.categoryKey),o=i.overviewHidden(e),r=Ec(e,i.pickerMode),s=i.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:i.dimmed(e.categoryKey)?Re*Rc:r?Re*Mc:Re),e.polygon.listening(!i.exportMode&&!o&&!t&&!r),e.polygon.stroke(s>0?i.selectionColor:e.strokeColor),e.polygon.strokeWidth(s>0?3:1.5),_c(i,e,r,s,o,i.dimmed(e.categoryKey))}}function _c(i,e,t,o,r,s){if(e.capacityNode){let n=Ac(e,i.pickerMode);e.capacityNode.text()!==n&&(e.capacityNode.text(n),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(t?.75:1)}Fc(i,e,r||s),o>0&&!r?Oc(i,e,o):e.chip&&e.chip.visible(!1)}var so=9,Cn=.86;function Fc(i,e,t){let{labelNode:o,capacityNode:r}=e;if(!o&&!r)return;let s=Math.max(i.effScale(),1e-4);if(t){o?.visible(!1),r?.visible(!1);return}if(!i.pickerMode){o?.visible(i.labelLegible(o.fontSize())),r?.visible(i.labelLegible(r.fontSize()));return}let n=Bc(e,s),l=In(o,At,n.width*Cn,s),a=In(r,Et,n.width*Cn,s),c=l!=null,h=a!=null&&c&&l+a+so<=n.height;Pn(o,c?l:null,e.labelPoint.y-so/s,s),Pn(r,h?a:null,e.labelPoint.y+so/s,s)}function Bc(i,e){let t=1/0,o=-1/0,r=1/0,s=-1/0;for(let n of i.points)n.x<t&&(t=n.x),n.x>o&&(o=n.x),n.y<r&&(r=n.y),n.y>s&&(s=n.y);return Number.isFinite(t)?{width:(o-t)*e,height:(s-r)*e}:{width:0,height:0}}function In(i,e,t,o){if(!i||!i.text())return null;i.fontSize(e/o);let r=i.width()*o;if(r<=t||r<=0)return e;let s=e*(t/r);return s>=G?s:null}function Pn(i,e,t,o){if(i){if(e==null){i.visible(!1);return}i.fontSize(e/o),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t),i.visible(!0)}}function Oc(i,e,t){if(!e.chip){let o=new Cc({x:e.labelPoint.x,y:e.labelPoint.y-xn-16,listening:!1}),r=new xc({radius:xn,fill:i.selectionColor,listening:!1,perfectDrawEnabled:!1}),s=new Ic({text:String(t),fontSize:Pc,fontStyle:"800",fontFamily:i.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});o.add(r),o.add(s),i.bgLayer.add(o),e.chip=o,e.chipText=s}e.chipText&&e.chipText.text()!==String(t)&&e.chipText.text(String(t)),e.chipText&&(e.chipText.offsetX(e.chipText.width()/2),e.chipText.offsetY(e.chipText.height()/2)),e.chip.visible(!0),e.chip.moveToTop()}function An(i,e){let t=!1;for(let[o,r]of Object.entries(e)){let s=i.get(o);s&&(r.available!==void 0&&s.available!==r.available&&(s.available=r.available,t=!0),r.selected!==void 0&&s.selected!==r.selected&&(s.selected=r.selected,t=!0))}return t}import{Rect as En}from"konva/lib/shapes/Rect";import{Text as Dc}from"konva/lib/shapes/Text";function _n(i){let e=i.effScale(),t=i.stage.scaleX(),o={width:i.stage.width(),height:i.stage.height()},r=m=>Math.round(m*100)/100,s=new Map(i.overlayLayer.find(".selection-ring").map(m=>[String(m.getAttr("seatId")??""),String(m.getAttr("ringColor")??i.effSelection)])),n=i.seats.map(m=>{let p=i.circleById.get(m.id),g=i.boothLabelById.get(m.id)??i.seatLabelById.get(m.id),b=i.viewMode==="perspective"?i.perspectiveSeatScale.get(m.id)??1:1,S=(i.viewMode==="perspective"?t:e)*b,v=m.kind==="booth"?Me:fe*i.seatLabelScale(m),w=i.viewMode==="perspective"&&m.kind!=="booth"?e*b:S,k=r((g?.fontSize()??v)*w),L=i.worldToScreen(m),x=g?g.width()*t*b:0,T=g?g.height()*(i.viewMode==="perspective"&&m.kind==="booth"?t:e)*b:0,I=L.x-x/2<0||L.x+x/2>o.width||L.y-T/2<0||L.y+T/2>o.height,P=i.focusedSeatOpacity(m.id,p?.getAbsoluteOpacity()??0),M=i.seatSection.get(m.id),R=!!g?.isVisible()&&P>=.5&&!I,C;R||(P<.5?C="dimmed-or-unavailable":k<G?C="below-minimum-size":I?C="outside-viewport":g?C="renderer-hidden":C=i.seatLabelDrops.get(m.id)??(i.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let A=p instanceof En?p.width()*t*b:i.seatR*2*S,_=p instanceof En?p.height()*(i.viewMode==="perspective"?t:e)*b:i.seatR*2*S,j=2*(i.seatR*S+Ee),z=p?.fill(),X=g?.fill(),J=i.accessGlyphById.get(m.id),O=J?.getAbsoluteScale();return{seatId:m.id,label:m.label,kind:m.kind==="booth"?"booth":"seat",markerShape:m.kind==="booth"?"booth":m.wheelchairSpaceType==="no-seat"?"square":"circle",...m.wheelchairSpaceType?{wheelchairSpaceType:m.wheelchairSpaceType}:{},categoryKey:m.categoryKey,...M?{sectionId:M.id}:{},...M?.zone?{zoneId:M.zone}:{},status:i.statusById.get(m.id)??"free",selected:i.selection.has(m.id),visible:R,renderedFontPx:k,fill:typeof z=="string"?z:"",ink:typeof X=="string"?X:p?i.seatLabelInk(m,p):i.seatPreferredLabelInk(m),...s.has(m.id)?{selectionRingColor:s.get(m.id)}:{},opacity:r(P),...J?{accessibilityMarker:{glyphVisible:J.isVisible(),glyphWidthPx:r(xe*Math.abs(O?.x??0)),emphasizedByFilter:i.accessGlyphFilterEmphasized(m.id)}}:{},pointerTarget:{active:!i.cached&&!i.seatViewportCulled(m.id)&&!!p?.isVisible()&&!!p?.isListening()&&i.isSelectable(m.id),directWidthPx:r(A),directHeightPx:r(_),effectiveMinimumPx:r(Math.max(Math.min(A,_),j))},screenCenter:{x:r(L.x),y:r(L.y)},...R?{screenBox:{x:r(L.x-x/2),y:r(L.y-T/2),width:r(x),height:r(T)}}:{},...C?{hiddenReason:C}:{}}}),l=n.filter(m=>m.visible).length,a=(m,p,g,b,S,v)=>{let w=Qe({x:b.x(),y:b.y()},b.width(),b.height(),b.rotation()),k=v&&v.liftWorld>0?i.isoLiftLocal(v.liftWorld):{x:0,y:0},L=V(w.map(R=>i.worldToScreen({x:R.x+k.x,y:R.y+k.y}))),x=r(b.opacity()),T=b.fill(),I=L.x+L.width<0||L.x>o.width||L.y+L.height<0||L.y>o.height,P=b.isVisible()&&x>.05&&!I,M=v?ti({x:b.x(),y:b.y()},b.width(),b.height(),b.rotation(),v.outline,v.holes):void 0;return{id:m,kind:p,role:g,label:b.text(),visible:P,renderedFontPx:r(b.fontSize()*t),opacity:x,fill:S,ink:typeof T=="string"?T:"",...M==null?{}:{fitsContainer:M},...P?{screenBox:{x:r(L.x),y:r(L.y),width:r(L.width),height:r(L.height)}}:{}}},c=m=>{let p=m.namePlate.fill();if(m.namePlate.opacity()>.05&&typeof p=="string"&&p)return p;let g=m.blockPoly.fill();return typeof g=="string"?g:m.baseFill},h=[...i.sections.map(m=>a(m.id,"section","name",m.nameLabel,c(m),m)),...i.sections.map(m=>a(`${m.id}:availability`,"section","availability",m.subLabel,c(m),m)),...i.zones.flatMap(m=>[a(m.id,"zone","name",m.label,m.background),...m.sub?[a(`${m.id}:price`,"zone","price",m.sub,m.background)]:[]])],d=[...i.gaById].map(([m,p])=>{let g=p.points.map(I=>i.worldToScreen(I)),b=Math.min(...g.map(I=>I.x)),S=Math.min(...g.map(I=>I.y)),v=Math.max(...g.map(I=>I.x)),w=Math.max(...g.map(I=>I.y)),k=v<0||b>o.width||w<0||S>o.height,L=r(p.polygon.opacity()),x=L>=.1&&!k,T=p.polygon.fill();return{areaId:m,label:p.label,capacity:p.capacity,categoryKey:p.categoryKey,...p.sectionId?{sectionId:p.sectionId}:{},visible:x,interactive:p.polygon.listening(),opacity:L,fill:typeof T=="string"?T:"",effectiveBackground:p.effectiveBackground,...x?{screenBox:{x:r(b),y:r(S),width:r(v-b),height:r(w-S)}}:{}}}),u=[...i.freeTextById].map(([m,p])=>{let{node:g,background:b,kind:S}=p,v=i.worldToScreen({x:g.x(),y:g.y()}),w=g.width()*t,k=g.height()*e,L=v.x-g.offsetX()*t,x=v.y-g.offsetY()*e,T=r(g.fontSize()*e),I=L+w<0||L>o.width||x+k<0||x>o.height,P=g.isVisible()&&!I,M=g.fill(),R=r(g.getAbsoluteOpacity()),C;return P||(T<G?C="below-minimum-size":I?C="outside-viewport":C="renderer-hidden"),{objectId:p.objectId??m,kind:S,text:g.text(),visible:P,renderedFontPx:T,ink:typeof M=="string"?M:"",background:b,opacity:R,...P?{screenBox:{x:r(L),y:r(x),width:r(w),height:r(k)}}:{},...C?{hiddenReason:C}:{}}}),f=i.labelGroup.find(m=>m.getAttr("rowLabel")===!0).filter(m=>m instanceof Dc).map(m=>{let p=m.getClientRect({skipShadow:!0,skipStroke:!0}),g=p.x+p.width<0||p.x>o.width||p.y+p.height<0||p.y>o.height,b=m.fill();return{text:m.text(),visible:m.isVisible()&&!g,renderedFontPx:r(m.fontSize()*e),ink:typeof b=="string"?b:"",...g?{}:{screenBox:{x:r(p.x),y:r(p.y),width:r(p.width),height:r(p.height)}}}}),y=i.sections.filter(m=>m.blockPoly.opacity()>.05);return{viewport:o,projection:i.viewMode,...i.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:i.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:i.canvasBackground,effectiveScale:r(e),rung:i.getRung(),minimumVisibleLabelPx:G,totalLabelledBookableUnits:n.length,visibleLabels:l,hiddenLabels:n.length-l,totalBookableUnits:n.length+d.reduce((m,p)=>m+p.capacity,0),selectionRingSeatIds:i.overlayLayer.find(".selection-ring").map(m=>String(m.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:i.effSelection,focusedSectionId:i.focusedSectionId,focusBackdropVisible:!!i.focusBackdrop?.isVisible(),categoryFilterKeys:i.categoryFilter?[...i.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:y.length,categoryPaintedSectionShells:y.filter(m=>{let p=m.blockPoly.fill();return typeof p!="string"||!Fi(i.canvasBackground,p)}).length,tintedSectionShells:y.filter(m=>{let p=m.blockPoly.fill();return typeof p=="string"&&$r(i.canvasBackground,p)}).length,visibleCategoryDetailOutlines:i.sections.filter(m=>m.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:i.sections.filter(m=>m.subLabel.opacity()>.05).length,visibleSectionGADetails:[...i.gaById.values()].filter(m=>m.sectionId!=null&&m.polygon.opacity()>.05).length},labels:n,gaAreas:d,hierarchyLabels:h,freeTextLabels:u,rowLabels:f}}import{Circle as Gc}from"konva/lib/shapes/Circle";import{Ellipse as Hc}from"konva/lib/shapes/Ellipse";import{Line as Fn}from"konva/lib/shapes/Line";import{Arrow as Nc}from"konva/lib/shapes/Arrow";import{Path as Wc}from"konva/lib/shapes/Path";import{Rect as gt}from"konva/lib/shapes/Rect";import{Text as ao}from"konva/lib/shapes/Text";import{Image as Bn}from"konva/lib/shapes/Image";function On(i,e){if(!e.url||e.visible===!1)return;let t=new window.Image;i.trackAssetImage(t,e.url,"Buyer background image",()=>{let o=t.naturalWidth||4,r=t.naturalHeight||3,s=e.crop??{x:0,y:0,width:1,height:1},n=Math.max(0,Math.min(.99,s.x)),l=Math.max(0,Math.min(.99,s.y)),a={x:n,y:l,width:Math.max(.01,Math.min(1-n,s.width)),height:Math.max(.01,Math.min(1-l,s.height))},c=e.width,h=c*(r*a.height/(o*a.width)),d=new Bn({image:t,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:h/2,width:c,height:h,rotation:e.rotation??0,crop:{x:a.x*o,y:a.y*r,width:a.width*o,height:a.height*r},opacity:e.opacity,listening:!1});i.bgLayer.add(d),d.moveToBottom(),i.bgLayer.batchDraw()})}function Dn(i,e){let t=new window.Image,o=new Bn({image:t,x:e.x+e.width/2,y:e.y+e.height/2,offsetX:e.width/2,offsetY:e.height/2,width:e.width,height:e.height,rotation:e.rotation??0,opacity:N(e.opacity??1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?i.fgDecorGroup.add(o):i.bgLayer.add(o),e.role&&i.landmarkBoxes.push(V(Qe({x:e.x+e.width/2,y:e.y+e.height/2},e.width,e.height,e.rotation??0))),i.trackAssetImage(t,e.href,`Decor image \u201C${e.label||e.id}\u201D`,()=>{let r=o.getLayer();r&&r.batchDraw()})}function Gn(i,e){if(e.shape==="round")i.bgLayer.add(new Gc({x:e.center.x,y:e.center.y,radius:e.radius??40,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,listening:!1}));else{let o=e.width??80,r=e.height??50;i.bgLayer.add(new gt({x:e.center.x,y:e.center.y,width:o,height:r,offsetX:o/2,offsetY:r/2,rotation:e.rotation,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,cornerRadius:4,listening:!1}))}let t=bt(i,i.bgLayer,e.displayLabel??e.label,e.center.x,e.center.y,"#cbd5e1",12,!0);i.freeTextById.set(e.id,{node:t,background:"#232c40",kind:"table"})}var Vc=8,Kc=6;function Hn(i,e){let t=e.background?.color??i.canvasBackground,o=e.color??U(t,i.theme.textColor??Ms),r=e.semanticKind==="icon"?or(e.iconKey):void 0;if(r){let h=e.fontSize/24,d=new Wc({x:e.position.x,y:e.position.y,data:r,rotation:e.rotation,scaleX:h,scaleY:h,stroke:o,strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});i.iconNodeById.set(e.id,{node:d,fontSize:e.fontSize}),i.bgLayer.add(d);return}let s=e.background?.padding??0,n=e.opacity??1,l=$o(e),a=new ao({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:Ki(e.bold,e.italic,"600"),fill:o,fontFamily:e.fontFamily??i.labelFont(),...e.width!=null?{width:e.width}:{},align:e.align??"left",lineHeight:e.lineHeight??1.2,letterSpacing:e.letterSpacing??0,textDecoration:e.underline?"underline":"",padding:s,opacity:n,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;if(e.background){let h=a.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),d=Math.max(Vc,e.fontSize*.35),u=Math.max(Kc,e.fontSize*.28);c=new gt({x:e.position.x,y:e.position.y,offsetX:-(h.x-d),offsetY:-(h.y-u),width:h.width+d*2,height:h.height+u*2,rotation:e.rotation,fill:e.background.color,opacity:n*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),i.bgLayer.add(c)}i.freeTextById.set(e.id,{node:a,backdrop:c,background:t,kind:l?"direct-landmark":"free-text"}),i.bgLayer.add(a)}function Nn(i,e){let t=e.fill??i.theme.decorFill??Ps,o=e.role==="stage",r=e.role==="reference-focal",s=!!e.role&&!o,n=Uo(e),l=te(i.canvasBackground),a=r?l.focalFill:t,c=e.kind==="line"||e.kind==="polyline",h=e.stroke?.color??(o?Te(a,.28):r?l.focalStroke:c?"#9aa3b5":void 0),d=e.stroke?.width??(o?1:r||c?2:0),u=e.opacity!=null?N(e.opacity,.1,1):1,f=0,y=0,m=null;if(c&&e.points&&e.points.length>=2){f=e.points.reduce((S,v)=>S+v.x,0)/e.points.length,y=e.points.reduce((S,v)=>S+v.y,0)/e.points.length;let p=rr(e),g=sr(d),b=new Nc({points:e.points.flatMap(S=>[S.x,S.y]),closed:!1,x:f,y,offsetX:f,offsetY:y,rotation:e.rotation??0,stroke:h,fill:h,strokeWidth:d,opacity:u,lineCap:p.lineCap,lineJoin:p.lineJoin,pointerAtBeginning:p.startEnding==="arrow",pointerAtEnding:p.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path"});b.setAttr("shapeObjectId",e.id),i.bgLayer.add(b)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let p=o?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,ue(a,.3),1,Te(a,.12)]}:{fill:a};f=e.x+e.width/2,y=e.y+e.height/2,m={x:e.x,y:e.y,width:e.width,height:e.height},i.bgLayer.add(new gt({x:f,y,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...p,stroke:h,strokeWidth:d,cornerRadius:N(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:u,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){f=e.x+e.width/2,y=e.y+e.height/2,m={x:e.x,y:e.y,width:e.width,height:e.height};let p=o?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,ue(a,.3),1,Te(a,.12)]}:{fill:a};i.bgLayer.add(new Hc({x:f,y,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...p,stroke:h,strokeWidth:d,opacity:u,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let p=e.points.flatMap(S=>[S.x,S.y]),g=V(e.points);f=e.points.reduce((S,v)=>S+v.x,0)/e.points.length,y=e.points.reduce((S,v)=>S+v.y,0)/e.points.length,m=g;let b=o?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,ue(a,.3),1,Te(a,.12)]}:{fill:a};i.bgLayer.add(new Fn({points:p,closed:!0,x:f,y,offsetX:f,offsetY:y,rotation:e.rotation??0,...b,stroke:h,strokeWidth:d,opacity:u,listening:!1}))}m&&e.role&&i.landmarkBoxes.push(m);for(let p of ar(e))i.bgLayer.add(new Fn({points:p.points.flatMap(g=>[g.x,g.y]),closed:p.closed,x:f,y,offsetX:f,offsetY:y,rotation:e.rotation??0,stroke:p.ink??nr,fill:p.fill,strokeWidth:2,opacity:u*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:p,spec:g}=Xc(i,f,y,e.label,a,m,e.labelStyle);i.primaryFocalLabels.set(p,g),i.freeTextById.set(e.id,{node:p,background:a,kind:"stage"})}else if(s){let p=r||n,g=bt(i,i.bgLayer,e.label,f,y,p?U(a,"#e6e9f0"):"#9aa3b5",p?18:12,!1);p&&i.primaryFocalLabels.set(g,{targetPx:18,trackingRatio:0,ink:String(g.fill()??""),plateInk:String(g.fill()??""),plate:new gt({width:0,height:0,opacity:0,listening:!1})}),i.freeTextById.set(e.id,{node:g,background:a,kind:"decor"})}else{let p=bt(i,i.bgLayer,e.label,f,y,"#cbd5e1",16,!0);i.freeTextById.set(e.id,{node:p,background:a,kind:"decor"})}}var no=22,zc=G,li=6;function Xc(i,e,t,o,r,s,n){let l=n?.size??no,a=n?.color??i.theme.textColor??"#e6e9f0",c=n?.color??U(r,a),h=s?s.x+s.width/2:e,d=s?s.y+s.height/2:t,u=Yc(i.canvasBackground,r),f=new gt({x:h,y:d,width:0,height:0,cornerRadius:4,fill:u,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(f);let y=new ao({x:h,y:d,text:o,fontSize:l,fontStyle:Ki(n?.bold??!0,n?.italic,"normal"),letterSpacing:l*(4/no),fontFamily:n?.fontFamily??i.labelFont(),fill:c,textDecoration:n?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return y.offsetX(y.width()/2),y.offsetY(y.height()/2),i.bgLayer.add(y),{node:y,spec:{targetPx:l,...s?{bounds:s}:{},trackingRatio:4/no,ink:c,plateInk:n?.color??U(u,a),plate:f}}}function Yc(i,e){return pe(e,W(i)?"#ffffff":"#000000",.34)}function Wn(i,e,t,o){let r=Math.max(t,1e-4),s=e.targetPx/r,n=f=>{i.letterSpacing(f*e.trackingRatio),o(i,f)};n(s);let l=e.bounds;if(!l){e.plate.opacity(0),i.fill(e.ink);return}let a={width:l.width-li*2,height:l.height-li*2},c=Math.min(1,a.width/Math.max(i.width(),1e-6),a.height/Math.max(i.height(),1e-6));if(c<1&&(s=Math.max(zc/r,s*c),n(s)),i.width()<=a.width&&i.height()<=a.height){e.plate.opacity(0),i.fill(e.ink);return}let d=i.width()+li*2,u=i.height()+li;e.plate.size({width:d,height:u}),e.plate.offset({x:d/2,y:u/2}),e.plate.opacity(1),i.fill(e.plateInk)}function Vn(i,e){let t=i.catColor.get(e.categoryKey)??"#6e7bff",o=i.canvasBackground,r=Wo(t,o,Re),s=i.theme.textColor??"#e6e9f0",n=U(r,s),l=Ne(e.points,e.holes,{fill:t,opacity:Re,stroke:t,strokeWidth:1.5,cornerRadius:e.cornerRadius});l.setAttr("gaId",e.id),l.on("click tap",u=>{i.isGhostClick(u)||i.opts.onGAClick?.(e.id)}),l.on("mouseenter",()=>{i.container.style.cursor="pointer"}),l.on("mouseleave",()=>{i.container.style.cursor="default"}),i.bgLayer.add(l);let a=It(e.points,e.holes),c=i.sections.find(u=>oe(a,u.outline,u.holes)),h=bt(i,i.bgLayer,e.displayLabel??e.label,a.x,a.y-8,n,At,!1),d=bt(i,i.bgLayer,`cap ${e.capacity}`,a.x,a.y+10,n,Et,!1);i.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:h,background:r,kind:"ga-label",categoryKey:e.categoryKey}),i.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:d,background:r,kind:"ga-capacity",categoryKey:e.categoryKey}),i.gaById.set(e.id,{label:e.displayLabel??e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:l,effectiveBackground:r,strokeColor:t,labelPoint:a,labelNode:h,capacityNode:d,...c?{sectionId:c.logicalId}:{}})}function bt(i,e,t,o,r,s,n,l){let a=new ao({x:o,y:r,text:t,fontSize:n,fontStyle:l?"700":"500",fontFamily:i.labelFont(),fill:s,listening:!1,perfectDrawEnabled:!1});return a.offsetX(a.width()/2),a.offsetY(a.height()/2),e.add(a),a}import{Text as Uc}from"konva/lib/shapes/Text";var $c=4;function Kn(i){return W(i)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function qc(i,e,t,o){let r=Math.max(0,Math.min(o,e/2,t/2));i.beginPath(),i.moveTo(r,0),i.arcTo(e,0,e,t,r),i.arcTo(e,t,0,t,r),i.arcTo(0,t,0,0,r),i.arcTo(0,0,e,0,r),i.closePath()}function zn(i,e){i.padding($c),i.shadowBlur(0),i.shadowOpacity(0),i.sceneFunc(function(o){let r=this.width(),s=this.height();o.save(),qc(o,r,s,Math.min(s/2,8)),o.setAttr("fillStyle",e.plate),o.fill(),o.setAttr("strokeStyle",e.stroke),o.setAttr("lineWidth",1),o.stroke(),o.restore(),Uc.prototype._sceneFunc.call(this,o)})}var Xn=/^[\p{L}\p{N}]{1,4}$/u,Zc=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function Yn(i,e){let t=e?.trim();if(!t)return i;let o=i.toLocaleLowerCase("en-US"),r=t.toLocaleLowerCase("en-US");if(o.startsWith(`${r} `)){let n=i.slice(t.length).trim();if(Xn.test(n))return n}let s=Zc.exec(i);if(s){let n=s[1].toLocaleLowerCase("en-US"),l=s[2].trim();if((r.startsWith(n)||n.startsWith(r))&&Xn.test(l))return l}return i}function Un(i,e){let t=[],o=e.canvasBackground,r=new Map,s=(c,h)=>{let d=r.get(c)??[];d.push(h),r.set(c,d)};for(let c of e.seats){if(c.kind==="booth")continue;let h=c.logicalRowId??c.rowId;s(h,c),h!==c.rowId&&s(c.rowId,c)}let n=c=>c.logicalSeatIndex??Number(c.id.split(":").pop()??0);for(let c of i.objects){if(c.type!=="row")continue;let h=c.segmentedRow?.repeatLabelOnComponents===!0;if(c.segmentedRow&&!h&&c.segmentedRow.componentIndex!==0)continue;let d=h?c.labelPresentation:c.segmentedRow?.labelPresentation??c.labelPresentation;if(d?.visible===!1||d?.positionPreset==="none")continue;let u=c.segmentedRow&&!h?c.segmentedRow.groupId:c.id,f=(r.get(u)??[]).slice().sort((C,A)=>n(C)-n(A));if(!f.length)continue;let y=f[0],m=f[f.length-1],p=d?.labelStyle,g=d?.style==="pill"?Kn(o):null,b=g?g.plate:o,S=U(b,p?.color??e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Bt),v=p?.size??No,w=d?.rotation??0,k=e.objectFilteredOut(c)?.15:1,L=f.reduce((C,A)=>C??e.seatSection.get(A.id),void 0),T=c.segmentedRow?.displayLabel??c.displayLabel??Yn(c.label,L?.label);if(!T)continue;let I=L?[...new Set([L.id,L.logicalId,L.zone].filter(C=>!!C))]:void 0,P=(C,A,_)=>t.push({text:T,x:C,y:A,rotation:w,fontSize:v,ink:S,opacity:k,...g?{pill:g}:{},...I?.length?{focusKeys:I}:{},..._?{automaticAway:_}:{}});if(d?.position){P(d.position.x,d.position.y);continue}let M=e.seatR+12,R=d?.positionPreset??"start";if(R==="start"||R==="both"){let C=c.rotation*Math.PI/180,A={x:-Math.cos(C),y:-Math.sin(C)};P(y.x+A.x*M,y.y+A.y*M,A)}if(R==="end"||R==="both"){let C=(c.rotation+c.curve)*Math.PI/180,A={x:Math.cos(C),y:Math.sin(C)};P(m.x+A.x*M,m.y+A.y*M,A)}}let l=(e.seatR+12)*2.2,a=[];for(let c of t){let h=a.find(d=>d.text===c.text&&Math.hypot(d.x-c.x,d.y-c.y)<=l);if(h){h.x=(h.x+c.x)/2,h.y=(h.y+c.y)/2;continue}a.push(c)}return a}function lo(i,e,t=Q){let o=i.rotation()*Math.PI/180,r=Math.abs(Math.cos(o)),s=Math.abs(Math.sin(o)),n=(i.width()*r+i.height()*s)/2+t,l=(i.width()*s+i.height()*r)/2+t;return{x:e.x-n,y:e.y-l,width:n*2,height:l*2}}function $n(i,e,t,o){let r={x:e.x,y:e.y},s=e.automaticAway;if(!s)return r;let n={x:-s.y,y:s.x},l=Math.max(7,Math.min(16,e.fontSize*.75)),a=[{x:0,y:0}];for(let u=1;u<=4;u++){let f=l*u;a.push({x:n.x*f,y:n.y*f},{x:-n.x*f,y:-n.y*f},{x:s.x*f,y:s.y*f},{x:(s.x+n.x)*f,y:(s.y+n.y)*f},{x:(s.x-n.x)*f,y:(s.y-n.y)*f})}let c=r,h=1/0,d=1/0;for(let u of a){let f={x:r.x+u.x,y:r.y+u.y},y=lo(i,f),p=(o?Gt(o,y,{mode:"overlap"}).length:0)+t.collisionCount(y),g=Math.hypot(u.x,u.y);if((p<h||p===h&&g<d)&&(c=f,h=p,d=g),p===0)break}return c}function qn(i,e){let t=e,o=t._cache.get("canvas");if(!o)return;let r=[o.scene,o.filter,o.hit].map(s=>s?._canvas).filter(s=>!!s);r.length&&i.Util.releaseCanvas(...r),t._cache.delete("canvas")}function Zn(i,e){let t=0,o=0,r=s=>{t||(t=s),o+=1;let n=s-t;n>=1e3&&(i(Math.round(o*1e3/n)),o=0,t=s),e(requestAnimationFrame(r))};e(requestAnimationFrame(r))}import{Group as Qc}from"konva/lib/Group";import{Line as Qn}from"konva/lib/shapes/Line";import{Rect as jc}from"konva/lib/shapes/Rect";import{Text as jn}from"konva/lib/shapes/Text";function Jc(i,e){return i>=re||e&&i>=Wt}function eh(i){return i.effectiveScale<Wt?!1:i.focusActive||i.stageWidth<se}function th(i,e,t){return t&&e>=Wt?Math.max(i,Sr/Math.max(e,1e-4)):i}function ih(i){let{authoredFontSize:e,measuredWidth:t,maxWidth:o,effectiveScale:r}=i;if(!(t>o)||!(t>0))return e;let s=G/Math.max(r,1e-4),n=e*o/t;return Math.max(Math.min(nt,s),n)}function co(i,e){let t=(e?1:3)*Math.min(1,i/ge);return Math.max(1,i*2-t)}function Jn(i){let e=new Map;for(let r of i){let s=e.get(r.rowId);s?s.push(r):e.set(r.rowId,[r])}let t=[];for(let r of e.values())if(!(r.length<2))for(let s=1;s<r.length;s+=1){let n=Math.hypot(r[s].x-r[s-1].x,r[s].y-r[s-1].y);n>0&&Number.isFinite(n)&&t.push(n)}if(!t.length)return 0;t.sort((r,s)=>r-s);let o=Math.floor(t.length/2);return t.length%2?t[o]:(t[o-1]+t[o])/2}function ea(i,e){return e>0?Math.min(i,e/2):i}function ho(i){let e=Math.max(i*2,1e-4);return Math.max(_e,Vo/e)}function uo(i){let e=co(i,!1),t=co(ge,!1),o=e>0?t/e:1;return re*Math.max(1,o)/Mi(1,!1,G)}function ta(i){return uo(i)*Ei}function ia(i){let e=i.exportMode?Math.max(i.effScale(),re):i.effScale(),t=eh({effectiveScale:e,focusActive:i.focusedSectionId!=null,stageWidth:i.stage.width()}),o=i.exportMode?e:Mi(e,i.labelsWereVisible(),G),r=Jc(o,t);i.onLabelVisibilityChange(r),i.setSeatLabelRungOpen(r);let s=a=>{let c=a.getClientRect({skipShadow:!0,skipStroke:!0});return c.x>=0&&c.y>=0&&c.x+c.width<=i.stage.width()&&c.y+c.height<=i.stage.height()};for(let[a,c]of i.boothLabelById){let h=i.circleById.get(a);c.visible(me(c.fontSize(),o)&&!!h?.isVisible()&&i.focusedSeatOpacity(a,h?.getAbsoluteOpacity()??1)>=.5&&s(c))}i.labelGroup.destroyChildren(),i.labelLiftGroups.clear(),i.seatLabelById.clear(),i.seatLabelDrops.clear();let n=0;if(r)for(let a of i.visibleSeatCandidates()){if(a.kind==="booth")continue;let c=i.worldToScreen(a);if(c.x<-20||c.x>i.stage.width()+20||c.y<-20||c.y>i.stage.height()+20||i.accessGlyphById.has(a.id)&&i.accessGlyphShouldShow(a.id))continue;let h=i.circleById.get(a.id);if(!h?.isVisible()||i.focusedSeatOpacity(a.id,h.getAbsoluteOpacity())<.5){i.seatLabelDrops.set(a.id,"dimmed-or-unavailable");continue}let d=i.statusById.get(a.id)??"free",u=i.renderedSeatPoint(a),f=i.viewMode==="perspective"?i.perspectiveSeatScale.get(a.id)??1:1;if(!i.hasSeatMark(a.id)&&(d==="booked"||d==="held"&&!i.ownedHold.has(a.id)&&!i.opts.manageMode)){let b=new Qc({x:u.x,y:u.y,listening:!1});if(b.scale({x:f,y:f}),d==="held"?(b.add(new jc({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),b.add(new Qn({points:[-2.4,-.8,-2.4,-2.7,-1.2,-4,0,-4.35,1.2,-4,2.4,-2.7,2.4,-.8],stroke:"#ffffff",strokeWidth:1.2,lineCap:"round",lineJoin:"round",listening:!1}))):(b.opacity(Ln),b.add(new Qn({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1}))),ni(b),i.seatLabelContainer(a.id).add(b),++n>=Ri)break;continue}let m=th(fe*i.seatLabelScale(a),e,t),p=new jn({x:u.x,y:u.y,text:Ft(a.displayLabel??a.label),fontSize:m,fontStyle:"600",fontFamily:i.labelFont(),fill:h?i.seatLabelInk(a,h):i.seatPreferredLabelInk(a),listening:!1,perfectDrawEnabled:!1}),g=co(i.seatR,t);if(p.fontSize(ih({authoredFontSize:m,measuredWidth:p.width(),maxWidth:g,effectiveScale:e})),p.width()>g+.01){i.seatLabelDrops.set(a.id,"label-overflows-marker"),p.destroy();continue}if(!me(p.fontSize(),e)){i.seatLabelDrops.set(a.id,"below-minimum-size"),p.destroy();continue}if(p.offsetX(p.width()/2),p.offsetY(p.height()/2),p.scale({x:f,y:f}),i.seatLabelContainer(a.id).add(p),!s(p)){i.seatLabelDrops.set(a.id,"outside-viewport"),p.destroy();continue}if(i.seatLabelById.set(a.id,p),++n>=Ri)break}let l=new je;for(let{node:a}of i.freeTextById.values()){if(!a.isVisible())continue;let c=a.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});l.insert({x:c.x-Q,y:c.y-Q,width:c.width+Q*2,height:c.height+Q*2})}for(let a of i.rowLabelPlan){let c=i.focusedSectionId!=null&&a.focusKeys?.includes(i.focusedSectionId),h=c?Math.max(a.fontSize,br/Math.max(e,1e-4)):a.fontSize;if(!c&&!me(h,o))continue;let d=i.worldToScreen({x:a.x,y:a.y});if(d.x<-40||d.x>i.stage.width()+40||d.y<-40||d.y>i.stage.height()+40)continue;let u=new jn({x:a.x,y:a.y,text:a.text,fontSize:h,fontStyle:"700",fontFamily:i.labelFont(),fill:a.ink,rotation:a.rotation,opacity:a.opacity,shadowColor:"#05070c",shadowBlur:a.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:a.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});a.pill&&zn(u,a.pill),u.offsetX(u.width()/2),u.offsetY(u.height()/2);let f=i.resolveAutomaticRowLabelPosition(u,a,l);u.position(f),u.setAttr("rowLabel",!0),i.labelGroup.add(u);let y=u.getClientRect({skipShadow:!0,skipStroke:!0}),m=6,p=y.x<m?m-y.x:y.x+y.width>i.stage.width()-m?i.stage.width()-m-y.x-y.width:0,g=y.y<m?m-y.y:y.y+y.height>i.stage.height()-m?i.stage.height()-m-y.y-y.height:0,b=f;if(p||g){let v=i.labelGroup.getAbsoluteTransform(),w=v.point(f);b=v.copy().invert().point({x:w.x+p,y:w.y+g}),u.position(b)}let S=i.rowLabelBox(u,b);if(a.automaticAway&&l.collisionCount(S)>0){u.destroy();continue}l.insert(S)}i.isoT>0&&i.viewMode!=="perspective"&&i.applyUprightLabels(),i.overlayLayer.batchDraw()}function oa(i){let e=i.now??(()=>typeof performance<"u"?performance.now():Date.now()),t=i.budgetMs??8,o=i.reducedMotion===!0,r=i.chunks.length>1?Math.min(30,Math.max(0,840/(i.chunks.length-1))):0,s=0,n=!1,l=!1,a=null,c=[],h=typeof globalThis<"u"?globalThis:{},d=()=>{a&&(a.kind==="idle"?h.cancelIdleCallback?.(a.id):a.kind==="frame"?h.cancelAnimationFrame?.(a.id):clearTimeout(a.id),a=null)},u=p=>{if(!c.length&&typeof h.requestIdleCallback=="function"){a={kind:"idle",id:h.requestIdleCallback(()=>{a=null,p()},{timeout:120})};return}if(typeof h.requestAnimationFrame=="function"){a={kind:"frame",id:h.requestAnimationFrame(()=>{a=null,p()})};return}a={kind:"timer",id:setTimeout(()=>{a=null,p()},16)}},f=()=>{l||n||(l=!0,d(),i.done())},y=p=>{for(let g=c.length-1;g>=0;g--){let b=c[g],S=o?1:Math.min(1,(p-b.startedAt)/160);i.fade(b.work,S),S>=1&&c.splice(g,1)}return c.length>0},m=()=>{if(n)return;let p=e(),g=p;for(;s<i.chunks.length&&(s===0||e()-g<t);){let S=i.chunks[s++];if(i.build(S.work),i.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:p+(s-1)*r}),e()-g>=t)break}let b=y(p);i.draw(),s<i.chunks.length||b?u(m):f()};return u(m),{cancel(){if(!l){n=!0,d();for(let p of c)i.fade(p.work,1);c.length=0}},finishNow(){if(!(n||l)){for(;s<i.chunks.length;){let p=i.chunks[s++];i.build(p.work)}for(let p of i.chunks)i.fade(p.work,1);c.length=0,i.draw(),f()}},get done(){return l}}}function St(i){return{th:Vt*Math.PI/180*i.isoT,sg:1-(1-lt)*i.isoT}}function ra(i,e){let{th:t,sg:o}=St(e),r=e.centre,s=i.x-r.x,n=i.y-r.y,l=s*Math.cos(t)-n*Math.sin(t),a=(s*Math.sin(t)+n*Math.cos(t))*o;return{x:r.x+l,y:r.y+a}}function sa(i,e){let{th:t,sg:o}=St(e),r=e.centre,s=i.x-r.x,l=(i.y-r.y)/o,a=s*Math.cos(t)+l*Math.sin(t),c=-s*Math.sin(t)+l*Math.cos(t);return{x:r.x+a,y:r.y+c}}function na(i,e){let{th:t,sg:o}=St(e),r=i*e.isoT;return{x:-(r/o)*Math.sin(t),y:-(r/o)*Math.cos(t)}}function aa(i,e,t){let o=Jo(e);i.offset(t),i.position(ae(e,t)),i.rotation(o.rotationDeg),i.scale({x:o.scaleX,y:o.scaleY}),i.skewX(o.skewX),i.skewY(0)}function la(i){i.position({x:0,y:0}),i.offset({x:0,y:0}),i.scale({x:1,y:1}),i.rotation(0),i.skewX(0),i.skewY(0)}function ca(i,e){let t=Math.hypot(e.x-i.surfaceFocal.x,e.y-i.surfaceFocal.y),o=Math.max(0,t-i.frontDistanceWorld);return i.liftWorld+o*Math.tan(i.rakeDeg*Math.PI/180)}function ha(i,e,t){return i.perspectiveAffine?ae(i.perspectiveAffine,e):ae(t,e)}function da(i,e){return e?ae(e,i):i}function ua(i,e){let t=0;for(let d of i.seats){let u=Math.max(0,(d.eyeHeightM??ee)-ee);t=Math.max(t,u*Ke)}for(let d of i.objects)d.type==="section"&&(t=Math.max(t,Ct(d,{floorBaseHeightM:i.floorBaseHeightMFor(d.id)}).height*Ke));let o=Zo(i.bounds,t),r=Ht(o,o.target),s=Qo(r);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let n=1/0,l=1/0,a=-1/0,c=-1/0;for(let d of i.seats){let u=Math.max(0,(d.eyeHeightM??ee)-ee),f=ye(o,d,u*Ke),y={x:f.x,y:f.y};e.seatProjected.set(d.id,y),e.seatLocal.set(d.id,ae(s,y)),e.seatDepth.set(d.id,f.depth),e.seatScale.set(d.id,f.scale),n=Math.min(n,f.x),l=Math.min(l,f.y),a=Math.max(a,f.x),c=Math.max(c,f.y)}for(let d of[{x:i.bounds.x,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y+i.bounds.height},{x:i.bounds.x,y:i.bounds.y+i.bounds.height}]){let u=ye(o,d,0);n=Math.min(n,u.x),l=Math.min(l,u.y),a=Math.max(a,u.x),c=Math.max(c,u.y)}let h=Math.max(24,i.seatR*3);return{camera:o,baseAffine:r,baseInverse:s,bounds:Number.isFinite(n)?{x:n-h,y:l-h,width:Math.max(1,a-n+h*2),height:Math.max(1,c-l+h*2)}:null}}function pa(i,e,t){let o=t?[...t].map(r=>i.seatById.get(r)).filter(r=>!!r):e?i.seats:[...i.perspectiveAppliedSeats].map(r=>i.seatById.get(r)).filter(r=>!!r);for(let r of o){if(e&&i.perspectiveAppliedSeats.has(r.id))continue;let s=e?i.perspectiveSeatProjected.get(r.id)??r:r,n=e?i.perspectiveSeatScale.get(r.id)??1:1,l=i.circleById.get(r.id);l?.position(s),l?.scale({x:n,y:n});let a=i.accessRingById.get(r.id);a?.position(s),a?.scale({x:n,y:n});let c=i.accessGlyphById.get(r.id);if(c){let d=i.seatR*1.5/xe;c.position(s),c.scale({x:d*n,y:d*n})}let h=i.boothLabelById.get(r.id);h?.position(s),h?.scale({x:n,y:n}),e&&i.perspectiveAppliedSeats.add(r.id)}e||i.perspectiveAppliedSeats.clear()}function fo(i){return i?.getAttr?.("seatId")??void 0}var ga=Object.freeze([]),wt=class wt{constructor(e,t={}){this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;this.seatIndex=null;this.chartDoc=null;this.activeFloorId="";this.stacked=!1;this.floorOverview=!1;this.floorLabelStyle="number";this.circleById=new Map;this.glyphMarkers=[];this.seatGlyphDetail=!0;this.boothDims=new Map;this.boothLabelById=new Map;this.seatLabelById=new Map;this.seatLabelDrops=new Map;this.seatLabelRungOpen=!1;this.accessRingById=new Map;this.accessGlyphById=new Map;this.freeTextById=new Map;this.iconNodeById=new Map;this.primaryFocalLabels=new Map;this.gaById=new Map;this.statusById=new Map;this.catColor=new Map;this.catByKey=new Map;this.theme={};this.canvasBackground=zi;this.effSelection=ft;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.catOrder=[];this.selection=new Set;this.selectionMarkers=new Map;this.momentsCache=null;this.ownedCache=null;this.ownedHold=new Set;this.seatMarks=new si;this.selectionFocusId=null;this.hoveredId=null;this.focusedId=null;this.accessFilter=null;this.categoryHighlight=null;this.categoryFilter=null;this.commercialLimitedFilter=!1;this.sections=[];this.zones=[];this.landmarkBoxes=[];this.seatSection=new Map;this.unsectionedSeatGroup=null;this.catPrice=new Map;this.dimmedSections=new Set;this.sectionHeat=new Map;this.closedSections=new Set;this.focusedSectionId=null;this.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.objectFloor=new Map;this.zoneColor=new Map;this.hasSections=!1;this.hasBoothText=!1;this.isoT=0;this.isoTarget=0;this.isoRaf=0;this.viewMode="flat";this.perspectiveCamera=null;this.perspectiveBaseAffine=null;this.perspectiveBaseInverse=null;this.perspectiveSeatLocal=new Map;this.perspectiveSeatProjected=new Map;this.perspectiveSeatDepth=new Map;this.perspectiveSeatScale=new Map;this.perspectiveAppliedSeats=new Set;this.perspectiveBounds=null;this.isoCentre={x:0,y:0};this.glideRaf=0;this.labelsVisible=!1;this.labelFadeRaf=0;this.glideInProgress=!1;this.destroyed=!1;this.lodScale=0;this.reducedMotion=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.cameraGlideMs=pn();this.fitScale=1;this.fitPose="";this.viewportInsets={...to};this.seatR=ge;this.markerR=ge;this.bounds={x:0,y:0,width:1,height:1};this.cached=!1;this.dpr=Math.min(typeof window<"u"&&window.devicePixelRatio||1,2);this.assetGeneration=0;this.assetPromises=[];this.assetErrors=[];this.assetCancels=new Set;this.seatReveal=null;this.seatRevealPending=!1;this.progressiveSeatFloor=800;this.rafId=0;this.recacheTimer=null;this.mountCachePending=!1;this.resizeObs=null;this.viewChangeRaf=0;this.marquee=null;this.marqueeCur=null;this.onKeyDown=e=>{if(this.opts.manageMode){if((e.metaKey||e.ctrlKey)&&(e.key==="a"||e.key==="A")){e.preventDefault(),this.opts.onMarquee?.(this.selectAllSelectable());return}if(e.key==="Escape"&&this.selection.size){e.preventDefault(),this.clearSelection(),this.opts.onMarquee?.([]);return}}let t=e.key==="ArrowLeft"?{x:-1,y:0}:e.key==="ArrowRight"?{x:1,y:0}:e.key==="ArrowUp"?{x:0,y:-1}:e.key==="ArrowDown"?{x:0,y:1}:null;if(t){e.preventDefault();let o=this.focusedId?this.nearestSeat(this.focusedId,t):this.seats[0]?.id??null;o&&this.focusSeat(o);return}if((e.key==="Enter"||e.key===" ")&&this.focusedId){e.preventDefault(),this.toggleSeat(this.focusedId);let o=this.seatById.get(this.focusedId);o&&this.opts.onFocusSeat?.(o)}};this.seatAnchorContextCache=null;this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...t},this.exportMode=t.exportMode===!0,this.loadingReveal=t.loadingReveal??"progressive",this.onSeatsRevealed=t.onSeatsRevealed,this.currency=t.currency;let o=ci.pixelRatio;if(this.exportMode&&(this.dpr=1),ci.pixelRatio=this.dpr,this.stage=new oh({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new ai(this.pointerHost),this.exportMode||(e.style.touchAction="none",this.gestures.attach(),e.tabIndex<0&&(e.tabIndex=0),e.setAttribute("role","application"),e.getAttribute("aria-label")||e.setAttribute("aria-label",$("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new po({listening:!this.exportMode}),this.seatLayer=new po({listening:!this.exportMode}),this.overlayLayer=new po({listening:!1}),this.labelGroup=new vt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.fgDecorGroup=new vt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new ii({labelLayer:this.overlayLayer,stage:this.stage,exportMode:this.exportMode,canvasBackground:()=>this.canvasBackground,labelFont:()=>this.labelFont(),reducedMotion:()=>this.reducedMotion,destroyed:()=>this.destroyed,hasSections:()=>this.hasSections,seats:()=>this.seats,seatR:()=>this.seatR,readableScale:()=>uo(this.markerR),pickableScale:()=>ho(this.markerR),categoryLabel:r=>this.catByKey.get(r)?.label??"",categoryColor:r=>this.categoryDisplayColor(r),categoryPriceLabel:r=>this.categoryPriceLabel(r),categoryFilter:()=>this.categoryFilter,viewMode:()=>this.viewMode,seatsPickable:()=>this.seatsPickable(),screenToWorld:r=>this.screenToWorld(r),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(r,s)=>this.focusRegion(r,s),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new fa({radius:ge+2,stroke:"#ffffff",strokeWidth:2,opacity:.85,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new fa({radius:ge+3,stroke:"#38bdf8",strokeWidth:2.5,dash:[4,3],opacity:.95,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.focusRing),this.stage.add(this.bgLayer,this.seatLayer,this.overlayLayer),this.exportMode&&(ci.pixelRatio=o),!this.exportMode){this.wireInteraction();let r=this.opts.onFps;r&&Zn(r,s=>{this.rafId=s})}!this.exportMode&&typeof ResizeObserver<"u"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}get moved(){return this.gestures.moved}isGhostClick(e){return this.gestures.isGhostClick(e)}get moments(){return this.momentsCache||(this.momentsCache=new Jt({overlayLayer:this.overlayLayer,seatLayer:this.seatLayer,stage:this.stage,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,isCached:()=>this.cached,isExportMode:()=>this.exportMode,labelFont:()=>this.labelFont(),viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),seatPoint:e=>this.renderedSeatPoint(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.categoryPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,t)=>this.nearestSeatToScreen(e,t)})),this.momentsCache}get owned(){return this.ownedCache||(this.ownedCache=new ei({overlayLayer:this.overlayLayer,sections:()=>this.sections,ownedPoints:e=>this.ownedSeatPoints(e),sectionColor:e=>e.shellCategoryColor,labelAnchor:e=>({x:e.nameLabel.x(),y:e.nameLabel.y()}),stageScale:()=>this.stage.scaleX(),labelFont:()=>this.labelFont()})),this.ownedCache}sectionTapAnchor(e,t){return this.owned.anchorFor(e)??t}ownedSeatPoints(e){let t=[];for(let o of e.memberIds){if(!this.selection.has(o)&&!this.ownedHold.has(o))continue;let r=this.seatById.get(o);r&&t.push(this.renderedSeatPoint(r))}return t}get pointerHost(){return{container:this.container,stage:this.stage,cancelGlide:()=>this.cancelGlide(),releaseSectionFocusDim:()=>this.releaseSectionFocusDim(),updateSeatGroupVisibility:()=>this.updateSeatGroupVisibility(),scheduleViewChange:()=>this.scheduleViewChange(),afterViewChange:()=>this.afterViewChange(),zoomBounds:()=>this.zoomBounds(),marqueeActive:()=>!!this.marquee,marqueeShouldStart:e=>!!(this.opts.manageMode&&this.opts.marqueeSelect&&e.pointerType!=="touch"&&e.button===0&&this.getRung()==="seats"),beginMarquee:e=>this.beginMarquee(e),updateMarquee:e=>this.updateMarquee(e),finishMarquee:()=>this.finishMarquee(),cancelMarquee:()=>this.cancelMarquee(),touchProbeStart:e=>this.showTouchLoupe(e),touchProbeMove:e=>this.showTouchLoupe(e),touchProbeEnd:()=>this.hideTouchLoupe()}}setChart(e,t){if(e!==this.chartDoc&&(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.cancelSeatReveal(),this.chartDoc=e,this.activeFloorId=t?.floorId??Pt(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let s of e.floors)for(let n of s.objects)this.objectFloor.set(n.id,s.id),n.type==="section"&&n.logicalSectionId&&this.objectFloor.set(n.logicalSectionId,s.id);let o=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.fgDecorGroup.destroyChildren(),this.circleById.clear(),this.glyphMarkers=[],this.boothDims.clear(),this.boothLabelById.clear(),this.seatLabelById.clear(),this.accessRingById.clear(),this.accessGlyphById.clear(),this.freeTextById.clear(),this.iconNodeById.clear(),this.primaryFocalLabels.clear(),this.gaById.clear();for(let s of this.selectionMarkers.values())s.destroy();this.selectionMarkers.clear(),this.ownedHold.clear(),this.seatMarks.clear(),this.selectionFocusId=null,this.statusById.clear(),this.seatAnchorContextCache=null,this.selection.clear(),this.seatById.clear(),this.seatIndex=null,this.cached=!1,this.accessFilter=null,this.sections=[],this.zones=[],this.landmarkBoxes=[],this.seatSection.clear(),this.focusedSectionId=null,this.focusBackdrop=null,this.catPrice.clear(),this.zoneColor.clear(),this.lodScale=0,this.hasBoothText=!1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.isoT=0,this.isoTarget=0,this.viewMode="flat",this.perspectiveCamera=null,this.perspectiveBaseAffine=null,this.perspectiveBaseInverse=null,this.perspectiveSeatLocal.clear(),this.perspectiveSeatProjected.clear(),this.perspectiveSeatDepth.clear(),this.perspectiveSeatScale.clear(),this.perspectiveAppliedSeats.clear(),this.perspectiveBounds=null,this.resetLayerTransforms(),this.hasSections=o.objects.some(s=>s.type==="section");for(let s of e.zones??[])s.color&&this.zoneColor.set(s.id,s.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=er(this.theme.seatScale)*ge,this.container.style.background="",this.canvasBackground=this.resolveCanvasBackground(),this.container.style.background=this.canvasBackground,this.effSelection=this.resolveSelectionColor(),this.hoverRing.stroke(this.effSelection),this.hoverRing.radius(this.seatR+2),this.catColor.clear(),this.catByKey.clear(),this.catPrice.clear(),this.catOrder=e.categories.map(s=>s.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((s,n)=>{this.cbHueByKey.set(s,Zt[n%Zt.length])});for(let s of e.categories)this.catColor.set(s.key,s.color),this.catByKey.set(s.key,s),typeof s.price=="number"&&this.catPrice.set(s.key,s.price);for(let s of o.objects)s.type==="booth"&&this.boothDims.set(s.id,{width:s.width,height:s.height,rotation:s.rotation,...s.points&&s.points.length>=3?{points:s.points.map(n=>({x:n.x,y:n.y}))}:{}});this.seats=ze(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()});for(let s of this.seats)this.seatById.set(s.id,s),this.statusById.set(s.id,"free");this.seatIndex=qo(this.seats,{seatRadius:this.seatR}),this.markerR=ea(this.seatR,Jn(this.seats)),this.clusterLabels.rebuild(),this.bounds=Eo(o,{freeText:"exclude"}),this.isoCentre={x:this.bounds.x+this.bounds.width/2,y:this.bounds.y+this.bounds.height/2},this.buildPerspectiveProjection(o),this.renderBackground(o),this.unsectionedSeatGroup=new vt({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup);let r=this.seatRevealWanted();this.seatRevealPending=r,r||this.renderSeats(),this.buildRowLabelPlan(o),this.overlayLayer.add(this.labelGroup),this.overlayLayer.add(this.fgDecorGroup),this.overlayLayer.add(this.hoverRing),this.overlayLayer.add(this.focusRing),this.mountCachePending=!r,this.zoomToFit(),r&&this.startSeatReveal()}seatRevealWanted(){return this.loadingReveal==="progressive"&&!this.exportMode&&this.sections.length>1&&this.seats.length>=this.progressiveSeatFloor}startSeatReveal(){this.cancelSeatReveal();let e=this.viewportCentreInChartSpace(),t=new Map,o=[];for(let s of this.seats){let n=this.seatSection.get(s.id);if(!n){o.push(s);continue}let l=t.get(n.id);l?l.push(s):t.set(n.id,[s])}let r=[...t.entries()].map(([s,n])=>{let l=this.sections.find(a=>a.id===s);return{id:s,work:{seats:n,group:l.liftGroupSeat},distance:Math.hypot(l.centroid.x-e.x,l.centroid.y-e.y)}}).sort((s,n)=>s.distance-n.distance);o.length&&this.unsectionedSeatGroup&&r.push({id:"",work:{seats:o,group:this.unsectionedSeatGroup},distance:1/0}),this.seatReveal=oa({chunks:r.map(s=>({id:s.id,work:s.work})),build:s=>this.renderSeats(s.seats),fade:(s,n)=>s.group.opacity(n),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.updateLOD(),this.fitPose&&Wi(this.stage)===this.fitPose&&this.zoomToFit(),this.seatLayer.batchDraw(),this.onSeatsRevealed?.()}})}viewportCentreInChartSpace(){let e=this.stage.scaleX()||1;return{x:(this.stage.width()/2-this.stage.x())/e,y:(this.stage.height()/2-this.stage.y())/e}}cancelSeatReveal(e=!1){let t=this.seatReveal;this.seatRevealPending=!1,t&&(this.seatReveal=null,e?t.finishNow():t.cancel())}floorView(e){if(!e.floors?.length)return{...e,referenceImage:void 0,backgroundImage:st(e)};if(this.floorOverview&&e.floors.length>=2)return _o(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...Ao(e),referenceImage:void 0,backgroundImage:st(e)};let t=e.floors.find(o=>o.id===this.activeFloorId)??e.floors[0];return{...e,objects:t.objects,focalPoint:t.focalPoint,referenceImage:void 0,backgroundImage:st(t),floors:void 0}}floorBaseHeightMFor(e){let t=this.chartDoc?.floors;if(!t?.length)return 0;let o=this.stacked&&e?this.objectFloor.get(e)??this.activeFloorId:this.activeFloorId;return t.find(r=>r.id===o)?.baseHeightM??0}setStacked(e){!this.chartDoc||e===this.stacked||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.stacked=e,e&&(this.floorOverview=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isStacked(){return this.stacked}setFloorOverview(e){!this.chartDoc||e===this.floorOverview||!(this.chartDoc.floors&&this.chartDoc.floors.length>=2)||(this.floorOverview=e,e&&(this.stacked=!1),this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}isFloorOverview(){return this.floorOverview}setFloorLabelStyle(e){e===this.floorLabelStyle||!this.chartDoc||(this.floorLabelStyle=e,this.floorOverview&&this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}getFloorLabelStyle(){return this.floorLabelStyle}setActiveFloor(e){!this.chartDoc||e===this.activeFloorId&&!this.floorOverview&&!this.stacked||(this.floorOverview=!1,this.stacked=!1,this.setChart(this.chartDoc,{floorId:e}))}getFloors(){return this.chartDoc?Pt(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,t){let o=!1,r=this.hasSections?new Set:null;for(let s of e){if(!this.statusById.has(s))continue;let n=this.statusById.get(s);this.statusById.set(s,t);let l=this.circleById.get(s);if(l&&(this.paintSeat(l,s),o=!0),r){let a=this.seatSection.get(s);a&&(n==="free"!=(t==="free")&&(a.free+=t==="free"?1:-1),r.add(a))}}if(r&&r.size){for(let s of r)this.refreshSectionFill(s);this.bgLayer.batchDraw()}o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>re&&this.updateLabels())}setSeatCategories(e){let t=!1,o=new Set;for(let[s,n]of Object.entries(e)){let l=this.seatById.get(s);if(!l||!this.catColor.has(n)||l.categoryKey===n)continue;l.categoryKey=n;let a=this.circleById.get(s);a&&(this.paintSeat(a,s),t=!0);let c=this.seatSection.get(s);c&&o.add(c)}if(!t)return;let r=new Map((this.chartDoc?Pt(this.chartDoc):[]).flatMap(s=>s.objects).filter(s=>s.type==="section").map(s=>[s.id,s]));for(let s of o){if(!r.get(s.id)?.color){let l=new Map;for(let a of s.memberIds){let c=this.seatById.get(a)?.categoryKey;c&&l.set(c,(l.get(c)??0)+1)}s.baseFill=Li([...l].map(([a,c])=>({hex:this.catColor.get(a)??"#6e7bff",w:c})),"#3a4358")}s.shellCategoryColor=this.dominantSellableColor(s.memberIds),this.refreshSectionFill(s)}o.size&&this.bgLayer.batchDraw(),this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>re&&this.updateLabels()}setOwnedHold(e){let t=new Set((e??[]).filter(r=>this.statusById.has(r))),o=new Set([...this.ownedHold,...t]);this.ownedHold=t;for(let r of o){let s=this.circleById.get(r);s&&this.paintSeat(s,r),this.syncSelectionMarker(r)}o.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>re&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){let t=e&&this.selection.has(e)?e:null;if(t===this.selectionFocusId)return;let o=this.selectionFocusId;this.selectionFocusId=t;for(let r of this.seats){let s=this.circleById.get(r.id);s&&this.paintSeat(s,r.id)}o&&this.syncSelectionMarker(o),t&&this.syncSelectionMarker(t);for(let[r,s]of this.selectionMarkers)s.opacity(!t||r===t?1:.2);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}setSeatMarks(e){let t=this.seatMarks.merge(e,this.statusById);for(let o of t){let r=this.circleById.get(o);r&&this.paintSeat(r,o)}t.size&&(this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw())}getSeatMark(e){return this.seatMarks.get(e)}getStatus(e){return this.statusById.get(e)??"free"}getSelection(){let e=[];for(let t of this.selection){let o=this.seatById.get(t);o&&e.push(o)}return e}clearSelection(){let e=[...this.selection];for(let t of e)this.setSelected(t,!1,!0);this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){let t=[];for(let o of e){if(this.selection.has(o)||!this.isSelectable(o))continue;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);break}this.setSelected(o,!0,!0);let r=this.seatById.get(o);r&&t.push(r)}return t.length&&this.overlayLayer.batchDraw(),t}setManageInteraction(e){this.marquee&&this.cancelMarquee(),this.gestures.resetPan(),this.opts.manageMode=e.manageMode,this.opts.marqueeSelect=e.marqueeSelect,this.opts.selectableStatuses=[...e.selectableStatuses],e.maxSelection!=null&&(this.opts.maxSelection=e.maxSelection);let t=[...this.selection].filter(o=>!this.isSelectable(o));t.length&&this.deselect(t),!e.manageMode&&this.selection.size&&this.clearSelection(),this.clusterLabels.syncCursor(!1),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[t,o]of Object.entries(e??{}))Number.isFinite(o)&&this.sectionHeat.set(t,Math.max(0,Math.min(1,o)));for(let t of this.sections)this.refreshSectionHeat(t);this.bgLayer.batchDraw()}deselect(e){let t=!1;for(let o of e)this.selection.has(o)&&(this.setSelected(o,!1,!0),t=!0);t&&this.overlayLayer.batchDraw()}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let t of this.seats)this.isSelectable(t.id)&&e.push(t.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let t=new Set(e),o=[];for(let r of this.seats)t.has(r.label)&&this.isSelectable(r.id)&&o.push(r.id);return this.selectMany(o)}setEvidenceSelection(e){return!this.seatById.has(e)||!this.isSelectable(e)?!1:(this.selection.size&&this.clearSelection(),this.setSelected(e,!0),this.overlayLayer.batchDraw(),this.selection.has(e))}getSelectableInSection(e){let t=[],o=new Set;for(let r of this.sections)if(!(r.id!==e&&r.logicalId!==e&&r.zone!==e))for(let s of r.memberIds){if(o.has(s)||(o.add(s),!this.isSelectable(s)))continue;let n=this.seatById.get(s);n&&t.push(n)}return t}selectMany(e){let t=e.filter(r=>!this.selection.has(r));if(!t.length)return this.getSelection();let o=this.selection.size+t.length<=vr;for(let r of t)if(o)this.setSelected(r,!0,!0);else{this.selection.add(r);let s=this.circleById.get(r);s&&this.paintSeat(s,r)}return this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}beginMarquee(e){let t=this.screenToWorld(e),o=this.stage.scaleX()||1,r=new ma({x:t.x,y:t.y,width:0,height:0,stroke:this.effSelection,strokeWidth:1.5/o,dash:[5/o,4/o],fill:"rgba(110,123,255,0.10)",listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.overlayLayer.add(r),this.marquee={start:t,rect:r},this.marqueeCur=t,this.overlayLayer.batchDraw()}updateMarquee(e){if(!this.marquee)return;let t=this.screenToWorld(e),{start:o,rect:r}=this.marquee;r.setAttrs({x:Math.min(o.x,t.x),y:Math.min(o.y,t.y),width:Math.abs(t.x-o.x),height:Math.abs(t.y-o.y)}),this.marqueeCur=t,this.overlayLayer.batchDraw()}cancelMarquee(){this.marquee&&(this.marquee.rect.destroy(),this.marquee=null,this.marqueeCur=null,this.overlayLayer.batchDraw())}finishMarquee(){let e=this.marquee;if(this.marquee=null,!e)return;e.rect.destroy(),this.overlayLayer.batchDraw();let t=this.marqueeCur??e.start;this.marqueeCur=null;let o=Math.min(e.start.x,t.x),r=Math.max(e.start.x,t.x),s=Math.min(e.start.y,t.y),n=Math.max(e.start.y,t.y),l=this.stage.scaleX()||1;if((r-o)*l<4&&(n-s)*l<4){this.selection.size&&(this.clearSelection(),this.opts.onMarquee?.([]));return}let a=[];for(let c of this.seats){let h=this.renderedSeatPoint(c);h.x<o||h.x>r||h.y<s||h.y>n||this.isSelectable(c.id)&&a.push(c.id)}this.selectMany(a),this.opts.onMarquee?.(this.getSelection())}flashSeat(e,t="#f43f5e"){let o=this.seatById.get(e);o&&tn(this.flashHost,e,this.renderedSeatPoint(o),t)}flashSection(e,t="#22a06b"){on(this.flashHost,this.sections.filter(o=>o.id===e||o.zone===e),t)}get flashHost(){return{overlayLayer:this.overlayLayer,seatRadius:()=>this.seatR,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,t)=>this.projectedSectionPoint(e,t),isoLiftLocal:e=>this.isoLiftLocal(e)}}nearestSeat(e,t){let o=this.seatById.get(e);if(!o)return null;let r=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(o.id)??o:o,s=null,n=1/0;for(let l of this.seats){if(l.id===e)continue;let a=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(l.id)??l:l,c=a.x-r.x,h=a.y-r.y,d=c*t.x+h*t.y;if(d<=.5)continue;let u=Math.abs(c*t.y-h*t.x),f=d+u*2.5;f<n&&(n=f,s=l.id)}return s}focusSeat(e){let t=this.seatById.get(e);if(!t)return;this.focusedId=e,this.focusRing.radius(this.seatR+3),this.focusRing.position(this.renderedSeatPoint(t));let o=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;this.focusRing.scale({x:o,y:o}),this.focusRing.visible(!0),this.ensureVisible(t),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(t)}ensureVisible(e){let t=this.stage.width(),o=this.stage.height(),r=Math.max(this.stage.scaleX(),Ae*1.2),s=this.worldToScreen(e),n=70,l=s.x<n||s.x>t-n||s.y<n||s.y>o-n;if(this.stage.scaleX()<r||l){let a=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?ae(this.perspectiveBaseAffine,a):this.isoT===0?a:this.isoForward(a);this.stage.scale({x:r,y:r}),this.stage.position({x:t/2-c.x*r,y:o/2-c.y*r}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=an(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}framingViewport(){return ln(this.stage.width(),this.stage.height(),this.viewportInsets)}framingWorldRect(){return dn(this.framingViewport(),e=>this.screenToWorld(e))}zoomToFit(){let e=this.framingViewport(),t=e.width,o=e.height,r=this.viewMode==="perspective"&&this.perspectiveBounds?this.perspectiveBounds:this.bounds;if(this.fitScale=Math.min(t/r.width,o/r.height)||1,this.opts.portraitFitCrop&&!this.exportMode){let n=t/r.width<=o/r.height,l=r.height*this.fitScale;n&&l<.55*o&&(this.fitScale=Math.min(this.fitScale*1.3,.62*o/r.height))}let s=this.fitScale;if(this.stage.scale({x:s,y:s}),this.stage.position({x:e.x+(t-r.width*s)/2-r.x*s,y:e.y+(o-r.height*s)/2-r.y*s}),this.settleView(),!this.exportMode){let n=ys(this.stage,[this.bgLayer,this.seatLayer],e);n>0&&n!==1&&(this.fitScale*=n),n>0&&this.afterViewChange(),this.fitPose=Wi(this.stage)}this.stage.batchDraw()}refitCurrentView(){if(this.focusedSectionId&&this.sectionBounds(this.focusedSectionId)){this.focusSectionCamera(this.focusedSectionId,!1,this.focusAnchor);return}if(this.categoryFilter?.size){this.focusCategories([...this.categoryFilter],{animate:!1});return}this.zoomToFit()}getCameraPose(){return cn(this.stage)}setCameraPose(e){this.cancelGlide(),hn(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.zoomAbout(this.stage.scaleX()*wt.ZOOM_STEP,oi(this.framingViewport()))}zoomOut(){this.zoomAbout(this.stage.scaleX()/wt.ZOOM_STEP,oi(this.framingViewport()))}zoomOutLevel(){let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e),"section"):"venue":this.getRung()==="seats"?(this.setRung("sections"),"sections"):(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let t of this.gaById.values())e+=t.capacity;return e}worldToScreen(e){let t=this.stage.scaleX(),o=e.id,r=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let l=r?this.perspectiveSeatProjected.get(r.id)??ae(this.perspectiveBaseAffine,e):ae(this.perspectiveBaseAffine,e);return{x:l.x*t+this.stage.x(),y:l.y*t+this.stage.y()}}let s=r?this.renderedSeatPoint(r):e,n=this.isoT===0?s:this.isoForward(s);return{x:n.x*t+this.stage.x(),y:n.y*t+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let t=e===null?null:[...e];if(!this.sameAccessFilter(t)){this.accessFilter=t;for(let o of this.sections)this.refreshSectionFill(o);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale());for(let o of this.seats){let r=this.circleById.get(o.id);r&&this.paintSeat(r,o.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}sameAccessFilter(e){let t=this.accessFilter;return t===null||e===null?t===e:t.length===e.length&&t.every((o,r)=>o===e[r])}setCommercialLimitedFilter(e){if(this.commercialLimitedFilter!==e){this.commercialLimitedFilter=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setCategoryFilter(e){let t=e===null?null:new Set(e);if(!Ns(t,this.categoryFilter)){this.categoryFilter=t;for(let o of this.seats){let r=this.circleById.get(o.id);r&&this.paintSeat(r,o.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}applyGAFilterState(){this.clusterLabels.applyFilterDim(),this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){Rn({gaById:this.gaById,bgLayer:this.bgLayer,exportMode:this.exportMode,pickerMode:!!this.opts.gaPickerMode,selectionColor:this.effSelection,labelFont:()=>this.labelFont(),filteredOut:e=>!!(this.categoryFilter&&!this.categoryFilter.has(e)),dimmed:e=>Mn(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<le,effScale:()=>this.effScale(),labelLegible:e=>me(e,this.effScale())})}setGAStates(e){An(this.gaById,e)&&this.applyGAFilterState()}setGAState(e,t){this.setGAStates({[e]:t})}focusCategories(e,t){if(!e?.length){this.focusRegion(this.bounds,{animate:t?.animate,durationMs:this.cameraGlideMs});return}let o=new Set(e),r=this.seats.filter(f=>!o.has(f.categoryKey)||this.seatInClosedSection(f.id)?!1:(this.statusById.get(f.id)??"free")==="free"||this.ownedHold.has(f.id));if(!r.length)return;let s=Ws(r.map(f=>f.id),this.seatSection);s&&this.focusSection(s);let n=Math.max(24,this.seatR*3),l=r.map(f=>this.renderedSeatPoint(f)),a=this.clusterLabels.boundsForSeats(r.map((f,y)=>({...f,...l[y]})),n),c=a?.bounds??io(l,n);if(!this.hasSections&&a){let f=this.clusterLabels.diveTarget(c,a.anchor);f&&this.focusRegion(f,{animate:t?.animate,durationMs:this.cameraGlideMs});return}let h=this.narrowSeatDetailFocus(l,c,a?.anchor??null),d=h?.bounds??c,u={x:d.x+d.width/2,y:d.y+d.height/2};!h&&Ds({stage:this.stage,box:d,bounds:this.zoomBounds(),viewport:this.framingViewport(),centreScreen:this.worldToScreen(u)})||this.focusRegion(d,{animate:t?.animate,durationMs:this.cameraGlideMs,minScale:h?.minScale})}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let l=this.viewMode==="isometric"&&this.isoT>0;this.viewMode=e,this.isoTarget=1,this.isoT=1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.applyPerspective(l),this.zoomToFit();return}let t=e==="isometric"?1:0,o=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=t,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),o){this.isoT=t,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=t,this.applyIso(),this.afterViewChange();return}let r=this.isoT;if(r===t){this.applyIso(),this.afterViewChange();return}let s=performance.now(),n=l=>{if(this.destroyed)return;let a=Math.min(1,(l-s)/wr),c=a<.5?4*a*a*a:1-Math.pow(-2*a+2,3)/2;this.isoT=r+(this.isoTarget-r)*c,this.applyIso(),this.scheduleViewChange(),a<1?this.isoRaf=requestAnimationFrame(n):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(n)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}isoParams(){return St(this.isoState)}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),t=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,t)}return this.stage.scaleX()*(1-(1-lt)*this.isoT)}isoForward(e){return ra(e,this.isoState)}isoInverse(e){return sa(e,this.isoState)}buildPerspectiveProjection(e){let t=ua({seats:this.seats,objects:e.objects,bounds:this.bounds,seatR:this.seatR,floorBaseHeightMFor:o=>this.floorBaseHeightMFor(o)},{seatLocal:this.perspectiveSeatLocal,seatProjected:this.perspectiveSeatProjected,seatDepth:this.perspectiveSeatDepth,seatScale:this.perspectiveSeatScale});this.perspectiveCamera=t.camera,this.perspectiveBaseAffine=t.baseAffine,this.perspectiveBaseInverse=t.baseInverse,this.perspectiveBounds=t.bounds}setContainerAffine(e,t,o){aa(e,t,o)}resetContainerTransform(e){la(e)}sectionSurfaceHeight(e,t){return ca(e,t)}projectedSectionPoint(e,t){return ha(e,t,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return da(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return na(e,this.isoState)}resetLayerTransforms(e=!0){let t=e?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let o of t)o.position({x:0,y:0}),o.offset({x:0,y:0}),o.scale({x:1,y:1}),o.rotation(0),o.skewX(0),o.skewY(0)}resetSectionProjection(e=!0){for(let t of this.sections){this.resetContainerTransform(t.rootGroupBg),this.resetContainerTransform(t.liftGroupBg),e&&this.resetContainerTransform(t.liftGroupSeat),t.rootGroupBg.zIndex(t.bgZIndex),e&&t.liftGroupSeat.zIndex(t.seatZIndex);let o=this.labelLiftGroups.get(t.id);o&&e&&this.resetContainerTransform(o),t.perspectiveAffine=void 0,t.perspectiveCorrection=void 0,t.perspectiveDepth=void 0}}get seatAnchorContext(){return this.seatAnchorContextCache??={seats:this.seats,seatById:this.seatById,seatR:this.seatR,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,perspectiveAppliedSeats:this.perspectiveAppliedSeats,circleById:this.circleById,accessRingById:this.accessRingById,accessGlyphById:this.accessGlyphById,boothLabelById:this.boothLabelById}}applyExactSeatAnchors(e,t){pa(this.seatAnchorContext,e,t)}applyPerspective(e=!0){let t=this.perspectiveCamera,o=this.perspectiveBaseAffine,r=this.perspectiveBaseInverse;if(!t||!o||!r)return;let s=this.seats.length>2500&&this.sections.length>0;this.cached&&!s&&(this.seatLayer.clearCache(),this.seatLayer.listening(!0),this.cached=!1),this.resetLayerTransforms(e),this.resetSectionProjection(e);for(let l of[this.bgLayer,this.overlayLayer])this.setContainerAffine(l,o,t.target);this.perspectiveAppliedSeats.clear(),s||this.applyExactSeatAnchors(!0);for(let l of this.sections){let a=d=>this.sectionSurfaceHeight(l,d),c=Ht(t,l.centroid,a),h=jo(r,c);l.perspectiveAffine=c,l.perspectiveCorrection=h,l.perspectiveDepth=ye(t,l.centroid,a(l.centroid)).depth,this.setContainerAffine(l.liftGroupBg,h,l.centroid);for(let d=0;d<l.sideFaces.length;d++){let u=l.outline[d],f=l.outline[(d+1)%l.outline.length],y=this.perspectiveLocalPoint(ye(t,u,0)),m=this.perspectiveLocalPoint(ye(t,f,0)),p=this.perspectiveLocalPoint(ye(t,f,a(f))),g=this.perspectiveLocalPoint(ye(t,u,a(u)));l.sideFaces[d].points([y.x,y.y,m.x,m.y,p.x,p.y,g.x,g.y]),l.sideFaces[d].opacity(.9)}}let n=[...this.sections].sort((l,a)=>(a.perspectiveDepth??0)-(l.perspectiveDepth??0));for(let l of n)l.rootGroupBg.moveToTop(),l.liftGroupSeat.moveToTop();this.unsectionedSeatGroup?.moveToTop(),this.syncSeatOverlayPositions(),s||this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyIso(){if(this.resetSectionProjection(),this.applyExactSeatAnchors(!1),this.isoT===0)this.resetLayerTransforms();else{let{th:t,sg:o}=this.isoParams(),r=Math.cos(t),s=o*Math.sin(t),n=-Math.sin(t),l=o*Math.cos(t),a=Math.sqrt(r*r+s*s),c=r*l-s*n,h=Math.atan2(s,r)*180/Math.PI,d=a,u=c/a,f=(r*n+s*l)/c,y=this.isoCentre;for(let m of[this.bgLayer,this.seatLayer,this.overlayLayer])m.position({x:y.x,y:y.y}),m.offset({x:y.x,y:y.y}),m.rotation(h),m.scaleX(d),m.scaleY(u),m.skewX(f),m.skewY(0)}this.applyUprightLabels(),this.applyElevation(),this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyUprightLabels(){let e=Vt*this.isoT,t=1/(1-(1-lt)*this.isoT),o=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let r of o){let s=r.find("Text");for(let n of s){let l=n.getAttr("uprightBase");l==null&&(l=n.rotation(),n.setAttr("uprightBase",l)),n.rotation(l-e),n.scaleX(1),n.scaleY(t),n.skewX(0)}}}applyElevation(){let e=this.isoT;for(let t of this.sections){if(t.liftWorld<=0)continue;let o=this.isoLiftLocal(t.liftWorld);t.liftGroupBg?.position(o),t.liftGroupSeat.position(o),this.labelLiftGroups.get(t.id)?.position(o);let r=.9*e;for(let s=0;s<t.sideFaces.length;s++){let n=t.sideFaces[s],l=t.outline[s],a=t.outline[(s+1)%t.outline.length];n.points([l.x,l.y,a.x,a.y,a.x+o.x,a.y+o.y,l.x+o.x,l.y+o.y]),n.opacity(r)}}this.syncSeatOverlayPositions()}destroy(){this.destroyed=!0,this.cancelAssetLoads(),this.cancelSeatReveal(),this.rafId&&cancelAnimationFrame(this.rafId),this.isoRaf&&cancelAnimationFrame(this.isoRaf),this.glideRaf&&cancelAnimationFrame(this.glideRaf),this.viewChangeRaf&&cancelAnimationFrame(this.viewChangeRaf),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),this.clusterLabels.destroy(),this.container.removeEventListener("keydown",this.onKeyDown),this.stage.destroy()}labelFont(){return this.exportMode?this.theme.fontFamily?.toLowerCase().includes("jetbrains")?"JetBrains Mono, monospace":"Inter, sans-serif":this.theme.fontFamily||"Inter, sans-serif"}seatContainer(e){return this.seatSection.get(e)?.liftGroupSeat??this.unsectionedSeatGroup??this.seatLayer}sectionMatchesFocus(e){let t=this.focusedSectionId;return t==null||e.id===t||e.logicalId===t||e.zone===t}focusedSeatOpacity(e,t){if(!this.focusedSectionId||!this.focusDimOverlay)return t;let o=this.seatSection.get(e);return t*(o&&this.sectionMatchesFocus(o)?1:Oe)}sectionScreenBounds(e){return vs({viewMode:this.viewMode,isoT:this.isoT,stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y(),projectedSectionPoint:(t,o)=>this.projectedSectionPoint(t,o),isoLiftLocal:t=>this.isoLiftLocal(t),isoForward:t=>this.isoForward(t)},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=le,t=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,o=96,r=this.stage.width(),s=this.stage.height();for(let n of this.sections){let l=!0;if(e){let c=this.sectionScreenBounds(n);l=c.x+c.width>=-o&&c.y+c.height>=-o&&c.x<=r+o&&c.y<=s+o,l&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,n.memberIds)}n.liftGroupSeat.setViewportCulled(!l),this.labelLiftGroups.get(n.id)?.setViewportCulled(!l)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,this.seats.filter(n=>!this.seatSection.has(n.id)).map(n=>n.id))}visibleSeatCandidates(){if(!this.sections.length)return this.seats;let e=[];for(let t of this.sections)if(!t.liftGroupSeat.isViewportCulled())for(let o of t.memberIds){let r=this.seatById.get(o);r&&e.push(r)}for(let t of this.seats)this.seatSection.has(t.id)||e.push(t);return e}seatViewportCulled(e){return this.seatSection.get(e)?.liftGroupSeat.isViewportCulled()??!1}renderedSeatPoint(e){if(this.viewMode==="perspective")return this.perspectiveSeatLocal.get(e.id)??e;let t=this.seatSection.get(e.id);if(!t||t.liftWorld<=0||this.isoT===0)return e;let o=this.isoLiftLocal(t.liftWorld);return{x:e.x+o.x,y:e.y+o.y}}seatLabelContainer(e){let t=this.seatSection.get(e);if(!t)return this.labelGroup;let o=this.labelLiftGroups.get(t.id);return o||(o=new yt({listening:!1}),o.setViewportCulled(t.liftGroupSeat.isViewportCulled()),o.position(this.viewMode==="perspective"?{x:0,y:0}:this.isoLiftLocal(t.liftWorld)),this.labelGroup.add(o),this.labelLiftGroups.set(t.id,o)),o}syncSeatOverlayPositions(){if(this.hoveredId){let e=this.seatById.get(this.hoveredId);if(e){this.hoverRing.position(this.renderedSeatPoint(e));let t=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.hoverRing.scale({x:t,y:t})}}if(this.focusedId){let e=this.seatById.get(this.focusedId);if(e){this.focusRing.position(this.renderedSeatPoint(e));let t=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e.id)??1:1;this.focusRing.scale({x:t,y:t})}}for(let[e,t]of this.selectionMarkers){let o=this.seatById.get(e);if(o){t.position(this.renderedSeatPoint(o));let r=this.viewMode==="perspective"?this.perspectiveSeatScale.get(o.id)??1:1;t.scale({x:r,y:r})}}}renderSeats(e=this.seats){Fs({seats:e,seatR:this.seatR,theme:this.theme,seatGlyphDetail:this.seatGlyphDetail,setHasBoothText:()=>{this.hasBoothText=!0},circleById:this.circleById,glyphMarkers:this.glyphMarkers,boothDims:this.boothDims,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,accessRingById:this.accessRingById,catByKey:this.catByKey,perspectiveSeatDepth:this.perspectiveSeatDepth,seatContainer:t=>this.seatContainer(t),buildAccessGlyph:(t,o)=>this.buildAccessGlyph(t,o),paintSeat:(t,o)=>this.paintSeat(t,o),labelFont:()=>this.labelFont()})}buildAccessGlyph(e,t){let o=this.seatR*1.5/xe,r=new sh({x:e.x,y:e.y,data:_t(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:Ti(t),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return ni(r),r}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(let[t,o]of this.accessGlyphById){let r=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1,s=this.seatR*1.5/xe*r,l=this.accessGlyphFilterEmphasized(t)?mr:fr,a=Math.max(s,l/(xe*Math.max(e,.001)));o.scale({x:a,y:a}),o.visible(this.accessGlyphShouldShow(t))}}accessGlyphFilterEmphasized(e){let t=this.seatById.get(e),o=this.accessFilter;return!!t&&o!==null&&!!t.accessibility?.includes("wheelchair")&&(o.length===0||o.includes("wheelchair"))&&ke(t,o)}accessGlyphShouldShow(e){return this.accessGlyphById.has(e)&&this.accessGlyphEligible(e)}accessGlyphEligible(e){let t=this.statusById.get(e)??"free";return!(t==="booked"||t==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryPriceLabel(e){let t=this.catPrice.get(e);return typeof t=="number"?dt(t,this.currency):null}categoryDisplayColor(e){return this.colorblind?this.cbHueByKey.get(e)??Zt[0]:this.catColor.get(e)??"#6e7bff"}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??pt}seatLabelInk(e,t){let o=t.fill();return U(typeof o=="string"?o:"",this.seatPreferredLabelInk(e))}paintSeat(e,t){let o=this.seatById.get(t),r=this.statusById.get(t)??"free",s=this.selection.has(t),n=this.categoryDisplayColor(o.categoryKey),l=this.boothLabelById.get(t);e.dash(ga),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let a=r==="held"&&this.ownedHold.has(t),c=a?null:Tn(r,this.canvasBackground,this.colorblind);if(c?(e.fill(c.fill),e.stroke(c.stroke),e.strokeWidth(c.strokeWidth),e.dash(c.dash),e.opacity(c.opacity),c.scale!==1&&e.scale({x:c.scale,y:c.scale})):a?(e.fill(Te(n,this.effSelection===ft?.24:.1)),e.stroke(this.effSelection),e.strokeWidth(3)):e.fill(s&&this.effSelection===ft?Te(n,.28):n),this.seatMarks.paint(e,t,r,n,this.seatR,this.colorblind,this.seatInClosedSection(t)),oo(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&r==="free"&&(e.stroke(xt(o.accessibility)),e.strokeWidth(s?3:2),e.dash([3,2])),l&&(l.text(r==="booked"?"SOLD":r==="held"?"HELD":o.label),l.fontSize(r==="free"?10:Math.min(10,Math.max(6,this.boothDims.get(o.rowId)?.width??40)/6)),l.fontStyle(r==="free"?"600":"800"),l.fill(r==="free"?this.theme.seatLabelColor??pt:"#ffffff"),l.offsetX(l.width()/2),l.offsetY(l.height()/2)),this.accessFilter&&r==="free"&&!s){let u=Vi(o,this.accessFilter);u==="other"?e.opacity(xs):u==="companion"&&e.opacity(Cs)}if(this.categoryHighlight&&r==="free"&&!s&&o.categoryKey!==this.categoryHighlight&&e.opacity(.25),this.categoryFilter&&r==="free"&&!s&&!this.categoryFilter.has(o.categoryKey)&&e.opacity(.22),this.commercialLimitedFilter&&r==="free"&&!s&&(o.commercial?.restrictedView||o.commercial?.obstructedView)&&e.opacity(.22),this.dimmedSections.size){let u=this.seatSection.get(t);(u?this.dimmedSections.has(u.id)||this.dimmedSections.has(u.logicalId)||u.zone!=null&&this.dimmedSections.has(u.zone):this.dimmedSections.has(Bo))&&e.opacity(.18)}this.closedSections.size&&this.seatInClosedSection(t)&&(e.fill(Wr),e.stroke(""),e.strokeWidth(0),e.dash(ga),e.opacity(Vr),e.scale({x:1,y:1})),this.selectionFocusId&&t!==this.selectionFocusId&&e.opacity(Math.min(e.opacity(),.16));let h=this.boothLabelById.get(t)??this.seatLabelById.get(t);h&&(h.fill(this.seatLabelInk(o,e)),h.visible(me(h.fontSize(),this.effScale())&&e.opacity()>=.5));let d=this.accessGlyphById.get(t);if(d){let u=e.fill();d.fill(Ti(typeof u=="string"?u:"")),d.opacity(e.opacity()),d.visible(this.accessGlyphShouldShow(t))}this.accessRingById.get(t)?.opacity(e.opacity())}seatInClosedSection(e){if(!this.closedSections.size)return!1;let t=this.seatSection.get(e);return!!t&&(this.closedSections.has(t.id)||this.closedSections.has(t.logicalId)||t.zone!=null&&this.closedSections.has(t.zone))}setColorblindSafe(e){if(e!==this.colorblind){this.colorblind=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}for(let t of this.sections)t.shellCategoryColor=this.dominantSellableColor(t.memberIds),this.refreshSectionFill(t);this.bgLayer.batchDraw(),this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setDimmedSections(e){let t=new Set(e??[]);if(!(t.size===this.dimmedSections.size&&[...t].every(o=>this.dimmedSections.has(o)))){this.dimmedSections=t;for(let o of this.seats){let r=this.circleById.get(o.id);r&&this.paintSeat(r,o.id)}this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setClosedSections(e){let t=new Set(e??[]);t.size===this.closedSections.size&&[...t].every(o=>this.closedSections.has(o))||(this.closedSections=t,this.repaintSectionsAndSeats())}focusSection(e,t){this.sections.some(o=>o.id===e||o.logicalId===e)&&(this.focusedSectionId=e,this.focusAnchor=t?.anchor??null,this.focusRoams=!1,this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),this.focusSectionCamera(e,!0,t?.anchor))}focusSectionCamera(e,t=!0,o){let r=this.sectionBounds(e);if(!r)return;let s=this.sectionMembers(e).map(c=>this.seatById.get(c)).filter(c=>c!=null),n=s.filter(c=>(this.statusById.get(c.id)??"free")==="free"||this.ownedHold.has(c.id)),l=(n.length?n:s).map(c=>this.renderedSeatPoint(c)),a=this.narrowSeatDetailFocus(l,r,o);this.focusRegion(a?.bounds??r,{animate:t,minScale:a?.minScale})}releaseSectionFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusRoams=!0,this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}clearSectionFocus(){this.focusedSectionId&&(this.focusedSectionId=null,this.focusAnchor=null,this.focusRoams=!1,this.focusBackdrop&&(this.focusBackdrop.destroy(),this.focusBackdrop=null),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD())}getFocusedSection(){return this.focusedSectionId}seatsRevealed(){return this.focusedSectionId||this.floorOverview?!0:this.effScale()>=_e}seatsPickable(){return this.focusedSectionId||this.floorOverview?!0:this.effScale()>=ho(this.markerR)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let t=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=rn(this.focusBackdropHost,t),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=sn(this.focusBackdropHost,t);for(let o of this.selectionMarkers.values())o.moveToTop();this.hoverRing.moveToTop(),this.focusRing.moveToTop()}}get focusBackdropHost(){return{bgLayer:this.bgLayer,overlayLayer:this.overlayLayer,bounds:this.bounds,canvasBackground:this.canvasBackground,viewMode:this.viewMode,perspectiveLocalPoint:e=>this.perspectiveLocalPoint(e),projectedSectionPoint:(e,t)=>this.projectedSectionPoint(e,t),isoLiftLocal:e=>this.isoLiftLocal(e)}}repaintSectionsAndSeats(){for(let e of this.seats){let t=this.circleById.get(e.id);t&&this.paintSeat(t,e.id)}for(let e of this.sections)this.refreshSectionFill(e);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){let e=this.screenToWorld({x:0,y:0}),t=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),width:Math.abs(t.x-e.x),height:Math.abs(t.y-e.y)}}getWorldBounds(){let e=1/0,t=1/0,o=-1/0,r=-1/0,s=(n,l)=>{n<e&&(e=n),l<t&&(t=l),n>o&&(o=n),l>r&&(r=l)};for(let n of this.seats)s(n.x,n.y);for(let n of this.sections)for(let l of n.outline)s(l.x,l.y);for(let n of this.gaById.values())for(let l of n.points)s(l.x,l.y);return Number.isFinite(e)?{x:e,y:t,width:Math.max(1,o-e),height:Math.max(1,r-t)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){let e=this.sections.map(t=>{let o=this.isSectionClosed(t)||t.free<=0,r=t.memberIds.some(l=>this.selection.has(l)),s=r||t.memberIds.some(l=>this.ownedHold.has(l)),n=this.focusedSectionId===t.id||this.focusedSectionId===t.logicalId;return{id:t.logicalId,label:t.label,outline:t.outline.map(l=>({...l})),...this.objectFloor.get(t.id)?{floorId:this.objectFloor.get(t.id)}:{},state:r?"selected":o?"inactive":"available",active:n,paint:{fill:t.shellFill,stroke:t.shellStroke},owned:s}});return{sections:e,seats:e.length?[]:this.seats.map(t=>({x:t.x,y:t.y,categoryKey:t.categoryKey,state:this.selection.has(t.id)?"selected":this.statusById.get(t.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();let t=this.worldToScreen(e);this.stage.position({x:this.stage.x()+this.stage.width()/2-t.x,y:this.stage.y()+this.stage.height()/2-t.y}),this.afterViewChange(),this.stage.batchDraw()}setCategoryHighlight(e){if(this.categoryHighlight!==e){this.categoryHighlight=e;for(let t of this.seats){let o=this.circleById.get(t.id);o&&this.paintSeat(o,t.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}renderBackground(e){let t=st(e);t&&this.renderBackgroundImage(t);for(let o of e.objects)o.type==="decorImage"&&this.renderDecorImage(o);for(let o of e.objects)o.type==="section"&&this.renderSection(o);for(let o of e.objects)o.type==="shape"?this.renderShape(o):o.type==="gaArea"?this.renderGA(o):o.type==="table"?this.renderTable(o):o.type==="text"&&this.renderText(o);this.renderZones(e)}trackAssetImage(e,t,o,r){let s=this.assetGeneration;/^https?:\/\//i.test(t)&&(e.crossOrigin="anonymous");let n=new Promise(l=>{let a=!1,c=()=>{a||(a=!0,this.assetCancels.delete(h),l())},h=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}c()};this.assetCancels.add(h),e.onload=()=>{if(!this.exportMode){s===this.assetGeneration&&r(),c();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{s===this.assetGeneration&&r()}).catch(()=>{s===this.assetGeneration&&this.assetErrors.push(`${o} could not be decoded.`)}).finally(c)},e.onerror=()=>{s===this.assetGeneration&&this.assetErrors.push(`${o} could not be loaded.`),c()},e.src=t});this.assetPromises.push(n)}cancelAssetLoads(){this.assetGeneration++;for(let e of[...this.assetCancels])e();this.assetCancels.clear(),this.assetPromises=[],this.assetErrors=[]}renderBackgroundImage(e){On(this.objectDrawContext,e)}get objectDrawContext(){return{bgLayer:this.bgLayer,fgDecorGroup:this.fgDecorGroup,container:this.container,opts:this.opts,theme:this.theme,canvasBackground:this.canvasBackground,catColor:this.catColor,sections:this.sections,freeTextById:this.freeTextById,gaById:this.gaById,iconNodeById:this.iconNodeById,primaryFocalLabels:this.primaryFocalLabels,landmarkBoxes:this.landmarkBoxes,labelFont:()=>this.labelFont(),trackAssetImage:(e,t,o,r)=>this.trackAssetImage(e,t,o,r),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){Dn(this.objectDrawContext,e)}renderTable(e){Gn(this.objectDrawContext,e)}renderText(e){Hn(this.objectDrawContext,e)}renderShape(e){Nn(this.objectDrawContext,e)}renderGA(e){Vn(this.objectDrawContext,e)}renderSection(e){let t=It(e.outline,e.holes),o=te(this.canvasBackground),r=[],s=new Map,n=0,l=V(e.outline),a=this.seatIndex?Gt(this.seatIndex,l).map(C=>this.seatById.get(C)).filter(C=>!!C):this.seats;for(let C of a)this.seatSection.has(C.id)||oe(C,e.outline,e.holes)&&(r.push(C.id),s.set(C.categoryKey,(s.get(C.categoryKey)??0)+1),(this.statusById.get(C.id)??"free")==="free"&&n++);let c=e.color??Li([...s].map(([C,A])=>({hex:this.catColor.get(C)??"#6e7bff",w:A})),"#3a4358"),h=Mo(e.elevation),d=Ct(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),u=d.height*Ke,f=new vt({listening:!1});this.bgLayer.add(f);let y=new vt({listening:!1});f.add(y);let m=new yt({listening:!0});this.seatLayer.add(m);let p=[];if(u>0){let C=ue(this.zoneColor.get(e.zone??"")??c,.42);for(let A=0;A<e.outline.length;A++){let _=new rh({points:[],closed:!0,fill:C,stroke:F("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});p.push(_),f.add(_)}}y.moveToTop();let g=y,b=e.color??this.zoneColor.get(e.zone??"")??"#3a4358",S=Ne(e.outline,e.holes,{stroke:F(b,.5),strokeWidth:1,fill:F(b,.08),listening:!1},e.outlinePath);g.add(S);let v=Ne(e.outline,e.holes,{fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Fe,opacity:0,listening:!1},e.outlinePath);g.add(v);let w=e.labelPresentation?.labelStyle,k=w?.color??o.sectionInk,L=(w?.size??18)/18,x=new ma({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});g.add(x);let T=new ya({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*L,fontStyle:we,fontFamily:this.labelFont(),fill:U(o.sectionFill,k),listening:!1,perfectDrawEnabled:!1});T.offsetX(T.width()/2),T.offsetY(T.height()/2),g.add(T);let I=new ya({x:t.x,y:t.y,text:$("map.seatsLeft",{count:n}),fontSize:12,fontStyle:Xt,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});I.offsetX(I.width()/2),g.add(I);let P={id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:t,labelAnchors:Ss(e.outline,e.holes??[],t),memberCategoryKeys:new Set(r.map(C=>this.seatById.get(C)?.categoryKey).filter(Boolean)),shellCategoryColor:this.dominantSellableColor(r),shellFill:o.sectionFill,shellStroke:o.sectionStroke,labelArea:Io(e.outline,e.holes),zone:e.zone,memberIds:r,total:r.length,free:n,baseFill:c,outlineTint:b,outlinePoly:S,blockPoly:v,namePlate:x,nameLabel:T,subLabel:I,preferredInk:k,labelScale:L,nameLabelFits:!1,subLabelFits:!0,elevation:h,liftWorld:u,rakeDeg:d.rake,surfaceFocal:r.length?{...this.seatById.get(r[0])?.focalPoint??this.isoCentre}:{...this.chartDoc?.focalPoint??this.isoCentre},frontDistanceWorld:0,rootGroupBg:f,bgZIndex:f.zIndex(),seatZIndex:m.zIndex(),liftGroupBg:y,liftGroupSeat:m,sideFaces:p},M=r.map(C=>this.seatById.get(C)).filter(C=>!!C),R=M.length?M:e.outline;P.frontDistanceWorld=Math.min(...R.map(C=>Math.hypot(C.x-P.surfaceFocal.x,C.y-P.surfaceFocal.y)));for(let C of r)this.seatSection.set(C,P);this.refreshSectionFill(P),this.refreshSectionHeat(P),this.sections.push(P)}refreshSectionHeat(e){Ks(this.sectionLodPaintContext,e)}refreshSectionFill(e){Ys(this.sectionLodPaintContext,e)}isSectionClosed(e){return $i(this.sectionLodPaintContext,e)}dominantSellableColor(e){let t=zr(e,o=>this.seatById.get(o)?.categoryKey,o=>this.catByKey.get(o)?.notForSale===!0);return t?this.categoryDisplayColor(t):null}sectionAccessibleFree(e){return zs(e.memberIds,this.accessFilter,t=>this.statusById.get(t)??"free",t=>this.seatById.get(t))}get sectionLodPaintContext(){return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:e=>e.memberIds.some(t=>this.selection.has(t)||this.ownedHold.has(t)),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:e=>this.sectionAccessibleFree(e),selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.floorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,viewMode:this.viewMode,glideInProgress:this.glideInProgress,reducedMotion:this.reducedMotion,isoT:this.isoT,seatCount:this.seats.length,lodScale:this.lodScale,setLodScale:e=>{this.lodScale=e},worldToScreen:e=>this.worldToScreen(e)}}renderZones(e){Ts({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let t=this.stage.scaleX(),o={x:(e.x-this.stage.x())/t,y:(e.y-this.stage.y())/t};return this.viewMode==="perspective"&&this.perspectiveBaseInverse?ae(this.perspectiveBaseInverse,o):this.isoT===0?o:this.isoInverse(o)}sectionAt(e){if(!this.sections.length)return null;let t=this.screenToWorld(e),o=this.sections.find(r=>{if(this.viewMode==="perspective"&&r.perspectiveAffine)return oe(t,r.outline.map(n=>this.perspectiveLocalPoint(this.projectedSectionPoint(r,n))),r.holes.map(n=>n.map(l=>this.perspectiveLocalPoint(this.projectedSectionPoint(r,l)))));let s=r.liftWorld>0?this.isoLiftLocal(r.liftWorld):{x:0,y:0};return oe({x:t.x-s.x,y:t.y-s.y},r.outline,r.holes)});return o?o.logicalId:null}sectionMembers(e){return[...new Set(this.sections.filter(t=>t.id===e||t.logicalId===e||t.zone===e).flatMap(t=>t.memberIds))]}isSelectable(e){return this.seatInClosedSection(e)||!(this.opts.selectableStatuses??["free"]).includes(this.statusById.get(e)??"free")?!1:!this.hiddenByAccessFilter(e)}hiddenByAccessFilter(e){if(!this.accessFilter||this.selection.has(e))return!1;let t=this.seatById.get(e);return t?Vi(t,this.accessFilter)==="other":!1}toggleSeat(e){if(this.selection.has(e)){this.setSelected(e,!1);let t=this.seatById.get(e);t&&this.opts.onDeselect?.(t)}else{if(!this.isSelectable(e))return;if(this.selection.size>=this.opts.maxSelection){this.opts.onSelectionLimit?.(this.opts.maxSelection);return}this.setSelected(e,!0),this.playSeatPickMoment(e);let t=this.seatById.get(e);t&&this.opts.onSelect?.(t)}this.overlayLayer.batchDraw()}resolveCanvasBackground(){let e=this.theme.background?ki(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let t=this.container;for(;t;){let o=ki(getComputedStyle(t).backgroundColor);if(o)return o;t=t.parentElement}}return zi}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:W(this.canvasBackground)?Is:ft}setSelected(e,t,o=!1){let r=this.circleById.get(e);t?this.selection.add(e):(this.selectionFocusId===e&&this.setSelectionFocus(null),this.selection.delete(e)),r&&(this.paintSeat(r,e),!o&&!this.cached&&this.seatLayer.batchDraw()),this.syncSelectionMarker(e)}syncSelectionMarker(e){this.moments.syncMarker(e,this.selection.has(e)||this.ownedHold.has(e),this.selectionMarkers),this.hasSections&&this.owned.sync(this.effScale())}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){return ks({sections:this.sections,viewMode:this.viewMode,isoT:this.isoT,seatR:this.seatR,bgLayer:this.bgLayer,seatById:this.seatById,freeTextById:this.freeTextById,iconNodeById:this.iconNodeById,rowLabelPlan:this.rowLabelPlan,projectedSectionPoint:(t,o)=>this.projectedSectionPoint(t,o),isoLiftLocal:t=>this.isoLiftLocal(t),isoForward:t=>this.isoForward(t),renderedSeatPoint:t=>this.renderedSeatPoint(t),labelFont:()=>this.labelFont(),resolveAutomaticRowLabelPosition:(t,o,r)=>this.resolveAutomaticRowLabelPosition(t,o,r),rowLabelBox:(t,o)=>this.rowLabelBox(t,o)},e)}sectionFrameScale(e){let t=this.sectionBounds(e);return t?Je(this.stage,t,this.zoomBounds(),this.framingViewport()):this.stage.scaleX()}handleSeatTap(e){if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let o=this.objectFloor.get(this.seatById.get(e)?.rowId??"");if(o){this.opts.onDeckTap(o);return}}if(this.effScale()<re&&this.sections.length){let o=this.seatSection.get(e);if(o){let r=this.focusedSectionId===o.logicalId,s=this.sectionFrameScale(o.logicalId)>this.stage.scaleX()*1.02;if(!r&&s){let n=this.seatById.get(e),l=n?this.renderedSeatPoint(n):void 0;this.opts.onSectionTap?this.opts.onSectionTap(o.logicalId,l):this.focusSection(o.logicalId,{anchor:l});return}}}if(!(this.selection.has(e)||this.isSelectable(e))){let o=this.seatById.get(e)??null;o&&(this.opts.onHover?.(o,{mark:this.seatMarks.get(e)??null,interaction:"press",unavailable:!0,...this.hiddenByAccessFilter(e)?{filteredOut:!0}:{}}),this.moments.nudge(e));return}this.seatMarks.has(e)&&this.opts.onHover?.(this.seatById.get(e)??null,{mark:this.seatMarks.get(e),interaction:"press"}),this.toggleSeat(e)}deckFloorAt(){return Os(this.screenPickingHost)}nearestSeatToScreen(e,t,o=!1){return Bs(this.screenPickingHost,e,t,{includeUnavailable:o})}get screenPickingHost(){return{seats:this.seats,stage:this.stage,seatR:this.seatR,viewMode:this.viewMode,selection:this.selection,objectFloor:this.objectFloor,perspectiveSeatScale:this.perspectiveSeatScale,renderedSeatPoint:e=>this.renderedSeatPoint(e),screenToWorld:e=>this.screenToWorld(e),worldToScreen:e=>this.worldToScreen(e),isSelectable:e=>this.isSelectable(e)}}wireInteraction(){this.seatLayer.on("click tap",e=>{if(this.moved>Ce||this.isGhostClick(e))return;let t=fo(e.target);t&&this.seatsPickable()&&this.handleSeatTap(t)}),this.seatLayer.on("mouseover",e=>{let t=fo(e.target);if(!t)return;let o=this.seatById.get(t);if(!o)return;this.hoveredId=t,this.hoverRing.position(this.renderedSeatPoint(o));let r=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1;this.hoverRing.scale({x:r,y:r}),this.hoverRing.visible(!0),this.overlayLayer.batchDraw(),this.clusterLabels.syncCursor(!0),this.opts.onHover?.(o,{mark:this.seatMarks.get(t),interaction:"hover"})}),this.seatLayer.on("mouseout",()=>{this.hoveredId=null,this.hoverRing.visible(!1),this.overlayLayer.batchDraw(),this.clusterLabels.syncCursor(!1),this.opts.onHover?.(null,{mark:null})}),this.stage.on("wheel",e=>{e.evt.preventDefault(),this.releaseSectionFocusDim();let t=this.container.getBoundingClientRect(),o={x:e.evt.clientX-t.left,y:e.evt.clientY-t.top},r=Math.exp(-e.evt.deltaY*.002);this.zoomAbout(this.stage.scaleX()*N(r,.5,2),o)}),this.stage.on("click tap",e=>{if(this.moved>Ce||this.isGhostClick(e))return;let t=this.stage.getPointerPosition();if(!t)return;if(!this.cached){if(fo(e.target)&&this.seatsPickable())return;if(this.seatsPickable()){let r=this.focusedSectionId,s=this.nearestSeatToScreen(t,Ee),n=s?this.seatSection.get(s):null;if(s&&(!r||n&&this.sectionMatchesFocus(n))){this.handleSeatTap(s);return}let l=s?null:this.nearestSeatToScreen(t,Ee,!0),a=l?this.seatSection.get(l):null;if(l&&(!r||a&&this.sectionMatchesFocus(a))){this.handleSeatTap(l);return}if(r&&this.opts.onBackdropTap&&!this.floorOverview){let h=this.sectionAt(t);if(h&&h!==r){let d=this.sectionTapAnchor(h,this.screenToWorld(t));this.opts.onSectionTap?this.opts.onSectionTap(h,d):this.focusSection(h,{anchor:d})}else h||this.opts.onBackdropTap();return}if(r)return;let c=this.sections.length?this.sectionAt(t):null;if(!c||this.effScale()>=re||this.sectionFrameScale(c)<=this.stage.scaleX()*1.02)return}}if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let r=this.floorOverview?this.sectionAt(t):null,s=(r?this.objectFloor.get(r):null)??this.deckFloorAt();if(s){this.opts.onDeckTap(s);return}}if(this.sections.length){let r=this.screenToWorld(t),s=this.owned.badgeAt(r)??this.sectionAt(t);if(s){let n=this.sectionTapAnchor(s,r);this.opts.onSectionTap?this.opts.onSectionTap(s,n):this.focusSection(s,{anchor:n});return}}if(this.clusterLabels.focusCluster(t)||this.clusterLabels.glideTowardTap(t))return;let o=Math.max(Ae*1.2,this.stage.scaleX()*2.5);this.zoomAbout(o,t)})}zoomBounds(){let e=.5*this.fitScale;return this.zones.length&&(e=Math.min(e,Xe*.9)),{min:e,max:Math.max(10*this.fitScale,4,ta(this.markerR))}}zoomAbout(e,t){Gs(this.stage,e,t,this.zoomBounds())&&(this.afterViewChange(),this.stage.batchDraw())}zoomToBounds(e,t){Hs(this.stage,e,this.zoomBounds(),t,this.framingViewport()),this.settleView(),this.stage.batchDraw()}focusRegion(e,t){let o=typeof e=="string"?this.sectionBounds(e):e;if(!o)return;if(this.cancelGlide(),t?.animate===!1||this.reducedMotion){this.zoomToBounds(o,t?.minScale);return}let r=this.framingViewport(),s=r.width,n=r.height,{min:l,max:a}=this.zoomBounds(),c=1.12,h=Math.min(s/(o.width*c),n/(o.height*c)),d=N(Math.max(h,t?.minScale??l),l,a),u=r.x+s/2-(o.x+o.width/2)*d,f=r.y+n/2-(o.y+o.height/2)*d,y=this.stage.scaleX(),m=this.stage.x(),p=this.stage.y();if(Math.abs(d-y)<1e-4&&Math.abs(u-m)<.5&&Math.abs(f-p)<.5){this.settleView();return}let g=performance.now(),b=Math.max(180,Math.min(1200,t?.durationMs??this.cameraGlideMs));this.glideInProgress=!0;let S=v=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let w=Math.min(1,(v-g)/b),k=w<.5?4*w*w*w:1-Math.pow(-2*w+2,3)/2,L=y+(d-y)*k;this.stage.scale({x:L,y:L}),this.stage.position({x:m+(u-m)*k,y:p+(f-p)*k}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),w<1?this.glideRaf=requestAnimationFrame(S):(this.glideRaf=0,this.glideInProgress=!1,this.settleView())};this.glideRaf=requestAnimationFrame(S)}applyLabelVisibility(e){let t=e!==this.labelsVisible;if(this.labelsVisible=e,!t||!e)return;if(this.labelFadeRaf&&(cancelAnimationFrame(this.labelFadeRaf),this.labelFadeRaf=0),this.reducedMotion){this.labelGroup.opacity(1);return}let o=performance.now();this.labelGroup.opacity(0);let r=s=>{if(this.destroyed){this.labelFadeRaf=0;return}let n=Math.min(1,(s-o)/150);this.labelGroup.opacity(n),this.stage.batchDraw(),this.labelFadeRaf=n<1?requestAnimationFrame(r):0};this.labelFadeRaf=requestAnimationFrame(r)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){let e=this.effScale();return e>=le?"seats":this.zones.length&&e<Xe?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,viewMode:this.viewMode,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(e),isoLiftLocal:e=>this.isoLiftLocal(e),seats:this.seats,sections:this.sections,zones:this.zones,seatSection:this.seatSection,statusById:this.statusById,selection:this.selection,circleById:this.circleById,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,seatLabelRungOpen:()=>this.seatLabelRungOpen,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,freeTextById:this.freeTextById,gaById:this.gaById,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,seatR:this.seatR,canvasBackground:this.canvasBackground,effSelection:this.effSelection,categoryFilter:this.categoryFilter,focusedSectionId:this.focusedSectionId,focusBackdrop:this.focusBackdrop,isSelectable:e=>this.isSelectable(e),seatViewportCulled:e=>this.seatViewportCulled(e),focusedSeatOpacity:(e,t)=>this.focusedSeatOpacity(e,t),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),_n(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let t=e==="sections"?(be+le)/2:this.seatRungScale(),o=this.framingViewport(),r=o.width,s=o.height,n=oi(this.framingWorldRect()),l=n.x,a=n.y;if(e==="sections"&&this.sections.length>0){let u=this.sections.map(p=>{let g=V(p.outline);return{x:g.x+g.width/2,y:g.y+g.height/2}}),f=r/(t*2),y=s/(t*2);if(!u.some(p=>Math.abs(p.x-n.x)<=f&&Math.abs(p.y-n.y)<=y)){let p=u.reduce((g,b)=>{let S=(b.x-n.x)**2+(b.y-n.y)**2;return S<g.distance?{point:b,distance:S}:g},{point:u[0],distance:1/0});l=p.point.x,a=p.point.y}}let c=e==="seats"?this.seats.filter(u=>u.kind!=="booth"):[];if(c.length>0){let u=c[0],f=1/0;for(let y of c){let m=y.x-n.x,p=y.y-n.y,g=m*m+p*p;g<f&&(u=y,f=g)}l=u.x,a=u.y}let h=r/(t*1.12),d=s/(t*1.12);this.focusRegion({x:l-h/2,y:a-d/2,width:h,height:d})}seatRungScale(){return fn(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,t,o){let r=this.framingViewport();return mn({stageWidth:r.width,stageHeight:r.height,fullBounds:t,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}seatLabelTargetScale(){return nn({seats:this.seats,seatR:this.seatR,labelFont:()=>this.labelFont(),seatLabelScale:e=>this.seatLabelScale(e)})}afterViewChange(){this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){if(!this.focusRoams||!this.focusedSectionId||this.floorOverview)return;let e=ws({sections:this.sections.map(t=>({logicalId:t.logicalId,members:t.memberIds.length,bounds:this.sectionScreenBounds(t)})),viewport:{width:this.stage.width(),height:this.stage.height()},current:this.focusedSectionId});!e||e===this.focusedSectionId||(this.focusedSectionId=e,this.focusAnchor=null,this.opts.onFocusedSectionChange?.(e))}scheduleViewChange(){this.exportMode||this.viewChangeRaf||(this.viewChangeRaf=requestAnimationFrame(()=>{this.viewChangeRaf=0,this.opts.onViewChange?.()}))}sizeLabel(e,t,o){e.fontSize(Math.max(1,t)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(o)}updateLOD(){let e=this.exportMode?Math.max(this.effScale(),Se+.01,re):this.effScale(),t=Math.max(e,1e-4);for(let[s,n]of this.primaryFocalLabels)Wn(s,n,t,(l,a)=>{this.sizeLabel(l,a,l.y())});this.hasSections?(Us(this.sectionLodPaintContext,e),this.owned.sync(e)):(this.clusterLabels.syncForCamera(e)||this.primaryFocalLabels.size)&&this.bgLayer.batchDraw(),this.clusterLabels.syncCursor(this.hoveredId!=null),this.paintGAStateForView(),this.updateAccessGlyphs(e),this.seatGlyphDetail=_s(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail);let o=!this.exportMode&&e<le;if(this.viewMode==="perspective"&&this.hasSections&&this.seats.length>2500&&o){this.seatLayer.listening(!1);return}if(o&&!this.cached){if(this.mountCachePending){this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>{this.recacheTimer=null,this.cacheSeatLayer()},0);return}this.cacheSeatLayer()}else!o&&(this.cached||!this.seatLayer.listening())&&(this.cached&&this.releaseSeatLayerBitmap(),this.seatLayer.listening(!this.exportMode),this.cached=!1,this.seatLayer.batchDraw())}rebuildSeatCache(){if(this.seatReveal||this.seatRevealPending)return;this.updateSeatGroupVisibility();let e=N(this.stage.scaleX()*this.dpr,.15,2);this.seatLayer.clearCache(),this.seatLayer.cache({pixelRatio:e}),this.seatLayer.listening(!1),this.cached=!0,this.mountCachePending=!1}cacheSeatLayer(){this.rebuildSeatCache(),this.seatLayer.batchDraw()}releaseSeatLayerBitmap(){qn(ci,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<le?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){this.cancelSeatReveal(!0);let e=this.assetGeneration,t=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assetPromises.slice(),...t?[t.ready.then(()=>{}),t.load("700 24px Inter").then(()=>{}),t.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assetGeneration)throw new Error("The chart changed while its export assets were loading.");if(this.assetErrors.length)throw new Error(`Export stopped because ${this.assetErrors.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(n=>n.getClientRect({relativeTo:this.stage})).filter(n=>n.width>0&&n.height>0);if(!e.length)return this.bounds;let t=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y)),r=Math.max(...e.map(n=>n.x+n.width)),s=Math.max(...e.map(n=>n.y+n.height));return{x:t,y:o,width:Math.max(1,r-t),height:Math.max(1,s-o)}}fitExportContent(){if(!this.exportMode)return;let e=this.stage.width(),t=this.stage.height(),o=Math.max(12,Math.min(36,Math.min(e,t)*.025)),r=()=>{let s=this.exportSceneBounds(),n=Math.max(1,e-o*2),l=Math.max(1,t-o*2),a=Math.min(n/s.width,l/s.height)||1;this.fitScale=a,this.stage.scale({x:a,y:a}),this.stage.position({x:(e-s.width*a)/2-s.x*a,y:(t-s.height*a)/2-s.y*a}),this.afterViewChange()};r(),r()}captureCanvas(){if(!this.exportMode)throw new Error("captureCanvas() is available only on a renderer created with exportMode.");this.forceDraw();let e;try{e=this.stage.toCanvas({pixelRatio:1,imageSmoothingEnabled:!0})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${s}`)}let t=document.createElement("canvas");t.width=this.stage.width(),t.height=this.stage.height();let o=t.getContext("2d");if(!o)throw new Error("Canvas 2D is unavailable; this browser cannot create an export.");o.fillStyle=this.canvasBackground,o.fillRect(0,0,t.width,t.height);try{o.drawImage(e,0,0)}finally{e.width=1,e.height=1}return t}updateFreeTextVisibility(){let e=this.exportMode?Math.max(this.effScale(),re):this.effScale();for(let{node:t,backdrop:o,kind:r}of this.freeTextById.values()){if(r==="ga-label"||r==="ga-capacity")continue;let s=r==="free-text"&&this.nodeBelongsToFocusedSection(t),n=r==="direct-landmark";if(n){let a=Number(t.getAttr("directLandmarkBaseFontSize"))||t.fontSize();t.setAttr("directLandmarkBaseFontSize",a),t.fontSize(Math.max(a,G/e))}let l=n||s||me(t.fontSize(),e);t.visible(l),o?.visible(l)}for(let{node:t,fontSize:o}of this.iconNodeById.values())t.visible(this.nodeBelongsToFocusedSection(t)||me(o,e))}nodeBelongsToFocusedSection(e){let t=this.focusedSectionId;if(!t)return!1;let o=this.sections.filter(n=>n.id===t||n.logicalId===t||n.zone===t);if(!o.length)return!1;let r=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),s={x:r.x+r.width/2,y:r.y+r.height/2};return o.some(n=>oe(s,n.outline,n.holes))}buildRowLabelPlan(e){this.rowLabelPlan=Un(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:t=>this.objectFilteredOut(t)})}rowLabelBox(e,t,o=Q){return lo(e,t,o)}resolveAutomaticRowLabelPosition(e,t,o){return $n(e,t,o,this.seatIndex)}objectFilteredOut(e){let t=e.categoryKey;return t?!!(this.categoryHighlight&&t!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(t)):!1}updateLabels(){ia(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,t)=>this.focusedSeatOpacity(e,t),labelGroup:this.labelGroup,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,setSeatLabelRungOpen:e=>{this.seatLabelRungOpen=e},visibleSeatCandidates:()=>this.visibleSeatCandidates(),worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,renderedSeatPoint:e=>this.renderedSeatPoint(e),viewMode:this.viewMode,perspectiveSeatScale:this.perspectiveSeatScale,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,t,o)=>this.resolveAutomaticRowLabelPosition(e,t,o),rowLabelBox:(e,t)=>this.rowLabelBox(e,t),isoT:this.isoT,applyUprightLabels:()=>this.applyUprightLabels(),overlayLayer:this.overlayLayer}}handleResize(){let e=this.container.clientWidth||1,t=this.container.clientHeight||1;e===this.stage.width()&&t===this.stage.height()||(this.stage.size({width:e,height:t}),this.refitCurrentView())}};wt.ZOOM_STEP=1.4;var mo=wt;function ba(i,e){return new mo(i,e)}function Sa(i,e,t){let o=new Map,r=new Map,s=new Map,n=new Map,l=[],a=new Map(Ro(i).map(d=>[d.id,d])),c=Rt(i),h=new Map([...c.sections,...c.ungrouped?[c.ungrouped]:[]].map(d=>[d.id,d.label]));for(let d of e){o.set(d.label,d.id),r.set(d.label,d),s.set(d.id,d),l.push(d.id);let u=a.get(d.rowId),f=u&&"label"in u&&typeof u.label=="string"?u.label:void 0,y=u?.type==="row"?u.segmentedRow:void 0,m=y?.displayLabel??(u&&"displayLabel"in u&&typeof u.displayLabel=="string"&&u.displayLabel?u.displayLabel:f),p=t.get(d.rowId),g=u?.type==="table"?"table":u?.type==="booth"?"booth":"seat",b=m,S=y?.displayType?.trim()||(u&&"displayType"in u&&typeof u.displayType=="string"&&u.displayType.trim()?u.displayType.trim():void 0),v=d.displayLabel??d.label,w=v.split("-"),k=p||d.kind==="booth"?void 0:m&&v.startsWith(`${m}-`)?v.slice(m.length+1):w[w.length-1]??v;n.set(d.id,{objectId:d.rowId,objectType:g,sectionLabel:h.get(c.objectToSection.get(d.rowId)??""),rowLabel:b,seatNumber:k,...S?{displayType:S,rowType:S}:{}})}return{labelToId:o,labelToSeat:r,seatById:s,seatContext:n,allIds:l}}function va(i,e={}){let{baseMs:t=1e3,factor:o=2,maxMs:r=1/0,jitter:s=0,random:n=Math.random}=e,l=Math.min(t*o**Math.max(0,i),r);if(s<=0)return l;let a=Math.min(1,s);return l*(1-a+a*n())}function wa(i,e,t){return ot(i).map(o=>{let r=i.categories.find(s=>s.key===o.categoryKey);return{id:o.id,label:o.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},capacity:Math.max(0,Math.floor(o.capacity)),available:Mt(o).filter(s=>t(s)==="free").length,categoryKey:o.categoryKey,tiers:r?.tiers,price:r?.tiers?.[0]?.price??r?.price??0,currency:e}})}function ka(i,e){let t={};for(let o of i)t[o.id]=e?{available:o.available,selected:e.get(o.id)??0}:{available:o.available};return t}function La(i){let e={};for(let[t,o]of i.seatById)i.groupedTableBySeatId.has(t)||i.closedMembers.has(t)||(i.statusOf(t)??"free")==="free"&&(e[o.categoryKey]=(e[o.categoryKey]??0)+1);for(let t of i.groupedTablesByLabel.values()){if(t.chairs.some(r=>i.closedMembers.has(r.id)))continue;let o=t.chairs[0];o&&(i.statusOf(o.id)??"free")==="free"&&(e[t.categoryKey]=(e[t.categoryKey]??0)+t.maxOccupancy)}for(let t of i.gaAreas??[])e[t.categoryKey]=(e[t.categoryKey]??0)+t.available;return e}function nh(i){return i.accessibility?.length?i.accessibility:i.accessible?["wheelchair"]:[]}function Ta(i,e){let t=new Set,o=new Map;for(let r of i){let s=nh(r);if(!s.length)continue;let n=e(r.id)==="free";for(let l of s)t.add(l),n&&o.set(l,(o.get(l)??0)+1)}return t.size?xo.filter(r=>t.has(r.key)).map(r=>({key:r.key,count:o.get(r.key)??0})):[]}var By=5e3,Oy={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function ah(i){if(!i.holdActive||i.holdLabels.length===0)return!1;let e=i.now??Date.now();return i.holdExpiresAt!=null&&e>=i.holdExpiresAt+5e3||i.serverHoldActive===!1?!0:!i.holdLabels.some(t=>i.statusOf(t)==="held")}function xa(i){let e=new Set(i.holdLabels),t=i.selection.filter(r=>!e.has(r)&&i.statusOf(r)!=="free");if(!ah(i))return{lost:t,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let o=[...i.holdLabels];return{lost:t,holdLapsed:!0,lapsedLabels:o,recoverable:o.filter(r=>i.statusOf(r)==="free")}}function Dy(i){return i.lost.length>0||i.holdLapsed}function Gy(i){return!i.lapsedLabels.length||!i.recoverable.length?"none":i.recoverable.length===i.lapsedLabels.length?"all":"partial"}function Ca(i,e,t=Date.now()){return e&&t<i+5e3}function Ia(i){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let e=()=>{document.visibilityState==="visible"&&i()};return document.addEventListener("visibilitychange",e),()=>{typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",e)}}function Pa(i){if(!i?.zones?.length)return[];let e=new Set(Rt(i).sections.filter(t=>t.seatCount>0&&!!t.zone).map(t=>t.zone));return i.zones.filter(t=>e.has(t.id)).map(t=>({id:t.id,label:t.label}))}function Ma(i){let e=i.doc;if(!e?.objects?.length)return null;let t=e.focalPoint??{x:0,y:0},o=ze(e).filter(n=>!i.groupedObjectIds.has(n.rowId)),r=new Set;for(let n of o)i.heldLabels.has(n.label)||i.tierApplies(n)&&(i.accessFilter&&!ke(n,i.accessFilter)||i.statusOfLabel(n.label)==="free"&&r.add(n.label));let s=hr(o,r,{qty:i.qty,categoryKey:i.categoryKey,zoneId:i.zoneId,focal:t,preferPremium:!0});return s.labels.length!==i.qty?null:s.labels.every(n=>i.isPremium(n))?[...s.labels]:null}var yo=["background","rowLabelColor","textColor","selectionColor"];function Ra(i,e){return!i||!e?!i&&!e:yo.every(t=>i[t]===e[t])}function kt(i){let e=i??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function hi(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function Aa(i,e,t){let o=Fo(e,t);o==="all"?i.setFloorOverview?.(!0):o&&i.setActiveFloor?.(o)}var Ie=class extends Error{constructor(t){super(t.message);this.status=422;this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function Ea(i,e){return!e||i.eventConfigurationId===e.id&&i.eventConfigurationVersion===e.version?i:{...i,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var di=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,t){if(!this.ref||!e.eventConfiguration)return Promise.resolve(null);if(!this.pending){let o=this.ref;this.pending=e.eventConfiguration(t).then(r=>{if(r.reference.id!==o.id||r.reference.version!==o.version||r.configuration.id!==o.id||r.configuration.version!==o.version)throw new Error("seatlayer: Event configuration response did not match the chart reference");return r.configuration})}return this.pending}};function _a(i){if(i!=null&&(!Number.isInteger(i)||i<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return i??null}function Fa(i,e,t,o){if(t!=null&&!Array.isArray(t))throw new TypeError("picker: `selectionValidators` must be an array");let r=[],s=0,n=!1,l=!1;for(let c of t??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");s=Math.max(s,Number(c.minimum))}else if(c?.type==="consecutiveSeats")n=!0;else if(c?.type==="noOrphanSeats")l=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(s&&r.push({type:"minimumSelectedPlaces",minimum:s}),n&&r.push({type:"consecutiveSeats"}),l&&r.push({type:"noOrphanSeats"}),i!=null&&s>i)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let a=Math.max(0,Math.floor(e??i??Math.max(o,s)));if(i!=null&&a<i)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&a<s)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:r,maxSelection:i??a}}function lh(i){let e=Number(i.slice(i.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function ch(i){if(i.length<=1)return!1;let e=i[0]?.objectId,t=i[0]?.categoryKey;if(!e||i.some(r=>r.objectId!==e||r.categoryKey!==t))return!0;let o=i.map(r=>lh(r.id)).sort((r,s)=>r-s);return o.some((r,s)=>r<0||s>0&&r!==o[s-1]+1)}function Ba(i,e,t,o,r){let s=o.find(a=>a.type==="minimumSelectedPlaces")?.minimum??0,n=t??s,l=[];return t!=null&&e!==t&&l.push("numberOfPlacesToSelect"),s&&e<s&&l.push("minimumSelectedPlaces"),o.some(a=>a.type==="consecutiveSeats")&&ch(i)&&l.push("consecutiveSeats"),o.some(a=>a.type==="noOrphanSeats")&&r()&&l.push("noOrphanSeats"),{isValid:l.length===0,count:e,required:n,remaining:Math.max(0,n-e),seats:i,violations:l}}function Oa(i){let{id:e,doc:t,seatById:o,groupedTableBySeatId:r}=i,s=t.objects.find(v=>v.type==="section"&&v.id===e);if(!s)return null;let n=i.sectionMembers(e),l=new Map,a=new Map,c=new Set,h=0,d=0;for(let v of n){let w=o.get(v);if(!w)continue;i.matchesAccessFilter&&i.statusOf(v)==="free"&&i.matchesAccessFilter(w)&&(d+=1);let k=r.get(v);if(k){if(c.has(k.label))continue;c.add(k.label),l.set(k.categoryKey,(l.get(k.categoryKey)??0)+k.maxOccupancy),i.statusOf(k.chairs[0]?.id??v)==="free"&&(h+=k.maxOccupancy,a.set(k.categoryKey,(a.get(k.categoryKey)??0)+k.maxOccupancy))}else l.set(w.categoryKey,(l.get(w.categoryKey)??0)+1),i.statusOf(v)==="free"&&(h++,a.set(w.categoryKey,(a.get(w.categoryKey)??0)+1))}let u=[...l.entries()].map(([v,w])=>{let k=t.categories.find(I=>I.key===v),L=k?.tiers?.length?k.tiers.map(I=>I.price):[k?.price??0],x=Math.min(...L),T=Math.max(...L);return{key:v,count:w,label:k?.label??v,color:k?.color??"#6e7bff",price:x,priceMin:x,priceMax:T}}).sort((v,w)=>v.price-w.price),f=u.map(v=>v.priceMin),y=u.map(v=>v.priceMax),m=s.zone?t.zones?.find(v=>v.id===s.zone):void 0,p=v=>{let w=null,k=0;for(let[L,x]of v)(x>k||x===k&&w!=null&&L<w)&&(w=L,k=x);return w},g=p(a)??p(l),S=(g?u.find(v=>v.key===g)?.color:void 0)??m?.color??s.color??"#6e7bff";return{id:e,...g?{dominantCategoryKey:g}:{},...i.matchesAccessFilter?{accessibleLeft:d}:{},label:s.displayLabel??s.label,zoneLabel:m?.label??"",...s.entrance&&s.entrance.trim()?{entrance:s.entrance.trim()}:{},color:S,seatsLeft:h,priceMin:f.length?Math.min(...f):0,priceMax:y.length?Math.max(...y):0,categories:u}}var ui=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,t=!1){if(!t){if(this.inFlight)return this.inFlight;if(this.now()-this.lastSettledAt<this.windowMs)return Promise.resolve()}let o=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===o&&(this.inFlight=null)});return this.inFlight=o,o}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};var hh=10,dh=15e3,Da=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new di;this.hidden=new Set;this.mapTheme=null;this.closedSections=new Set;this.labelToId=new Map;this.labelToSeat=new Map;this.expandedSeats=[];this.seatTiers=new Map;this.seatById=new Map;this.seatContext=new Map;this.allIds=[];this.groupedTablesByObject=new Map;this.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.detachVisibility=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.snapshots=new ui;this.accessFilter=null;this.viewportInsets=null;this.hintShown=!1;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=_a(e.numberOfPlacesToSelect);let t=Fa(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,hh);this.selectionValidators=t.validators,this.maxSelection=t.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(o=>typeof o=="string"&&!!o))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=Oo(this._doc,this.hidden);if(!this.mapTheme)return e;let t={...e.theme??{}};for(let o of yo){let r=this.mapTheme[o];r&&(t[o]=r)}return{...e,theme:t}}setMapTheme(e){return Ra(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let t=e.getSelection().map(l=>l.id),o=this.getActiveFloorId(),r=e.isFloorOverview?.()??!1,s=e.getFocusedSection?.()??null,n=e.getCameraPose?.();return e.setChart(this.visibleDoc(),o?{floorId:o}:void 0),r&&e.setFloorOverview?.(!0),this.opts.colorblindSafe&&e.setColorblindSafe?.(!0),this.closedSections.size&&e.setClosedSections?.([...this.closedSections]),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),t.length&&e.select?.(t),s&&e.focusSection?.(s),n&&e.setCameraPose&&e.setCameraPose(n),!0}refreshMapCopy(){this.rebuildPreservingState()&&this.renderer?.forceDraw()}syncHidden(e){let t=e.filter(r=>typeof r=="string");if(t.length===this.hidden.size&&t.every(r=>this.hidden.has(r)))return!1;this.hidden=new Set(t);let o=this.renderer?.isFloorOverview?.()??!1;return this.renderer?.setChart(this.visibleDoc()),o&&this.renderer?.setFloorOverview?.(!0),!0}syncClosed(e){let t=(e??[]).filter(o=>typeof o=="string");return t.length===this.closedSections.size&&t.every(o=>this.closedSections.has(o))?!1:(this.closedSections=new Set(t),this.renderer?.setClosedSections?.(t),!0)}isSectionClosed(e){return this.closedSections.has(e)}currentHold(){return this.hold_}getRenderer(){return this.renderer}seatByLabel(e){return this.labelToSeat.get(e)}getExpandedSeats(){return this.expandedSeats}loadEventConfiguration(){return this.eventConfiguration.load(this.api,this.key)}idForLabel(e){return this.labelToId.get(e)}idsForLabel(e){let t=this.groupedTablesByLabel.get(e);if(t)return t.chairs.map(r=>r.id);let o=this.labelToId.get(e);return o?[o]:[]}idsForLabels(e){return[...new Set([...e].flatMap(t=>this.idsForLabel(t)))]}tableSelection(e){let t=this.groupedTableBySeatId.get(e)??this.groupedTablesByLabel.get(e);return t?this.toTableSeat(t):null}lineItemDisplay(e){if(e.objectType==="ga"){let r=this.visibleDoc(),s=ot(r).find(n=>n.id===e.objectId);return{...s?.displayLabel?{displayLabel:s.displayLabel}:{},...s?.displayType?{displayType:s.displayType}:{}}}if(e.objectType==="table"){let r=this.groupedTablesByLabel.get(e.label);return{...r?.displayLabel&&r.displayLabel!==r.label?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.displayType}:{}}}let t=this.labelToSeat.get(e.label),o=t?this.seatContext.get(t.id):void 0;return{...t?.displayLabel?{displayLabel:t.displayLabel}:{},...o?.displayType?{displayType:o.displayType}:{}}}async render(e){if(this.renderer)return null;let t=performance.now(),o={},r=x=>Math.round((performance.now()-x)*100)/100;this.closed=!1;let s=performance.now(),n=(async()=>this.api.chart(this.key))().then(x=>({ok:!0,res:x,elapsed:r(s)}),x=>({ok:!1,error:x,elapsed:r(s)})),l=performance.now(),a=(async()=>this.api.objects(this.key))().then(x=>({ok:!0,objects:x,elapsed:r(l)}),()=>({ok:!1,elapsed:r(l)})),c=await n;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let h=c.res;if(this.closed)return null;this._doc=Ea(h.doc,h.event.eventConfiguration),this.eventConfiguration.reset(h.event.eventConfiguration);let d=performance.now();try{let x=dr(h.doc,h.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(x.map(T=>[T.objectId,T])),this.groupedTablesByLabel=new Map(x.map(T=>[T.label,T])),this.groupedTableBySeatId=new Map(x.flatMap(T=>T.chairs.map(I=>[I.id,T]))),this.tableQuantities=new Map(x.map(T=>[T.label,T.mode==="whole"?T.capacity:T.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=x.reduce((T,I)=>T+Math.max(0,I.chairs.length-1),0)}catch(x){return this.emitError(x),null}this.expandedSeats=ze(h.doc);let u=Sa(h.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=u.labelToId,this.labelToSeat=u.labelToSeat,this.seatById=u.seatById,this.seatContext=u.seatContext,this.allIds=u.allIds;for(let x of this.groupedTablesByLabel.values()){let T=x.chairs[0];T&&(this.labelToId.set(x.label,T.id),this.labelToSeat.set(x.label,T))}o.normalizeBuyerModel=r(d);let f=h.event.currency??this.opts.currency;this.currency=f??"USD";let y=performance.now(),m=ba(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:f,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=r(t),this.opts.onSeatsRevealed?.()},onSelect:x=>{this.handleRendererSelect(x)},onDeselect:x=>{this.handleRendererDeselect(x)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(x,T)=>{this.opts.onHover?.(x),this.opts.onSeatHover&&this.opts.onSeatHover(x?this.describeSeat(x,T):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(x,T)=>this.handleSectionTap(x,T),onBackdropTap:()=>this.overview(),onFocusedSectionChange:x=>this.opts.onSectionFocus?.(this.isSectionClosed(x)?null:this.sectionSummary(x)),onDeckTap:x=>this.handleDeckTap(x),onFps:this.opts.onFps});if(o.createRenderer=r(y),this.closed)return m.destroy(),null;this.renderer=m,this.viewportInsets&&m.setViewportInsets?.(this.viewportInsets);let p=null,g="free",b=[],S=await a;if(S.ok){let x=S.objects;this.hidden=new Set(x.hidden??[]),b=(x.closed??[]).filter(T=>typeof T=="string"),p=x.seats,g=x.default??"free"}if(o.loadStatuses=S.elapsed,this.closed)return m.destroy(),this.renderer=null,null;let v=performance.now();m.setChart(this.visibleDoc()),Aa(m,h.doc,e.clientWidth),this.opts.colorblindSafe&&m.setColorblindSafe?.(!0),o.buildScene=r(v),this.closedSections=new Set(b);let w=performance.now();b.length&&m.setClosedSections?.(b),p&&this.applySeatsMap(p,g),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=r(w);let k=performance.now();m.forceDraw(),o.firstPaint=r(k);let L=performance.now();return this.attachVisibility(),this.connect(),o.startRealtime=r(L),o.controllerTotal=r(t),{doc:h.doc,salesClosed:!!h.event.salesClosed,eventName:h.event.name,venue:h.event.venue,startsAt:h.event.startsAt,timezone:h.event.timezone??null,currency:f,mode:h.event.mode??"live",locale:h.event.locale??null,posterUrl:h.event.posterUrl??null,chartDelivery:h.chartDelivery,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],t=new Set;for(let o of this.renderer.getSelection()){let r=this.groupedTableBySeatId.get(o.id);r?t.has(r.label)||(t.add(r.label),e.push(this.toTableSeat(r))):e.push(this.toSeat(o))}return e}seatDetails(e){let t=this.seatById.get(e);return t?this.describeSeat(t):null}clearSelection(){this.renderer?.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(e){let t=new Set;for(let o of e){let r=this.groupedTableBySeatId.get(o)??this.groupedTablesByLabel.get(o);if(r)r.chairs.forEach(s=>t.add(s.id)),this.hold_?.labels.includes(r.label)||(this.tableQuantities.set(r.label,r.mode==="whole"?r.capacity:r.minOccupancy),r.mode==="variable"&&this.confirmedVariableTables.delete(r.label));else{let s=this.seatById.has(o)?o:this.labelToId.get(o);s&&t.add(s)}}this.renderer?.deselect([...t]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let t=new Set(this.getSelection().map(n=>n.label)),o=new Set,r=[];for(let n of e){let l=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(l)this.tableTierResolution(l).kind==="invalid"?r.push(l.label):l.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let a=this.seatById.has(n)?n:this.labelToId.get(n);if(!a||!this.isSelectableByPolicy(a))continue;let c=this.seatById.get(a);c&&this.seatTierResolution(c).kind==="invalid"?r.push(c.label):o.add(a)}}if(r.length&&this.emitError(new Ie(Ci(r))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let s=this.getSelection().filter(n=>!t.has(n.label));return s.length&&this.emitSelectionChange(),s}selectCategories(e){let t=new Set(e);return this.select([...this.seatById.values()].filter(o=>t.has(o.categoryKey)).map(o=>o.id))}deselectCategories(e){let t=new Set(e);this.deselect(this.getSelection().filter(o=>t.has(o.categoryKey)).map(o=>o.id))}setSelectableObjects(e){this.selectableObjectRefs=e==null?null:[...new Set(e.filter(o=>typeof o=="string"&&!!o))],this.rebuildSelectableSeatIds();let t=this.renderer?.getSelection().filter(o=>!this.isSelectableByPolicy(o.id)).map(o=>o.id)??[];t.length&&this.deselect(t)}getSelectionValidity(e){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;let t=this.getSelection(),o=e??t.reduce((r,s)=>r+(s.quantity??1),0);return Ba(t,o,this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){let e=this.renderer;if(!e)return!1;let t=new Set(e.getSelection().map(o=>o.id));return t.size>0&&xi(this.seatById.values(),o=>e.getStatus(o),t).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}let e=new Set;for(let t of this.selectableObjectRefs){let o=this.groupedTableBySeatId.get(t)??this.groupedTablesByLabel.get(t);if(o){o.chairs.forEach(s=>e.add(s.id));continue}let r=this.seatById.has(t)?t:this.labelToId.get(t);r&&e.add(r)}this.selectableSeatIds=e}isSelectableByPolicy(e){return this.selectableSeatIds==null||this.selectableSeatIds.has(e)}setTableQuantity(e,t){let o=this.groupedTablesByLabel.get(e);if(!o)return!1;let r=o.mode==="whole"?o.capacity:Math.floor(t);if(!Number.isInteger(r)||r<o.minOccupancy||r>o.maxOccupancy)return!1;let s=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,r),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,s),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,t,o){let r=this.groupedTablesByLabel.get(e),s=this.hold_;if(!r||r.mode!=="variable"||!s?.labels.includes(e))return null;let n=Math.floor(t);if(!Number.isInteger(n)||n<r.minOccupancy||n>r.maxOccupancy)return null;if((s.items??[]).filter(h=>h.label!==e).reduce((h,d)=>h+(d.quantity??1),0)+n>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let a=(s.items??[]).map(h=>({label:h.label,tierId:h.tierId,quantity:h.label===e?n:h.quantity}));if(!a.some(h=>h.label===e))return null;let c=await this.api.hold(this.key,a,o,s.holdId);return this.tableQuantities.set(e,n),this.setHold({holdId:c.holdId,labels:a.map(h=>h.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,t)=>e+(t.quantity??1),0)}handleRendererSelect(e){let t=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(t?t.chairs.map(r=>r.id):[e.id]),this.emitSelectionChange();return}if((t?this.tableTierResolution(t):this.seatTierResolution(e)).kind==="invalid"){this.renderer?.deselect(t?t.chairs.map(r=>r.id):[e.id]),this.emitError(new Ie(Ci([t?.label??e.label]))),this.emitSelectionChange();return}if(t){if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect(t.chairs.map(r=>r.id)),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.renderer?.select?.(t.chairs.map(r=>r.id)),this.opts.onSelect?.(t.chairs[0]??e),this.opts.onTableSelectionRequest?.(this.toTableSeat(t)),this.emitSelectionChange();return}if(this.selectionGuestCount()>this.maxSelection){this.renderer?.deselect([e.id]),this.opts.onSelectionLimit?.(this.maxSelection),this.emitSelectionChange();return}this.opts.onSelect?.(e),this.emitSelectionChange()}handleRendererDeselect(e){let t=this.groupedTableBySeatId.get(e.id);t?(this.renderer?.deselect(t.chairs.map(o=>o.id)),this.hold_?.labels.includes(t.label)||(this.tableQuantities.set(t.label,t.mode==="whole"?t.capacity:t.minOccupancy),t.mode==="variable"&&this.confirmedVariableTables.delete(t.label)),this.opts.onDeselect?.(t.chairs[0]??e)):this.opts.onDeselect?.(e),this.emitSelectionChange()}resetUnheldTableQuantities(){for(let e of this.groupedTablesByLabel.values())this.hold_?.labels.includes(e.label)||(this.tableQuantities.set(e.label,e.mode==="whole"?e.capacity:e.minOccupancy),e.mode==="variable"&&this.confirmedVariableTables.delete(e.label))}resetTableQuantitiesForLabels(e){for(let t of e){let o=this.groupedTablesByLabel.get(t);o&&(this.tableQuantities.set(t,o.mode==="whole"?o.capacity:o.minOccupancy),o.mode==="variable"&&this.confirmedVariableTables.delete(t))}}tableQuantityRequest(e){if(e?.objectType!=="table")return{};if(e.bookingMode==="variable"&&!this.confirmedVariableTables.has(e.label))throw new Error("picker: confirm a variable table guest quantity before holding");return{quantity:e.quantity}}async hold(e,t){if(!this.renderer)return null;let r=e??this.getSelection().map(a=>a.label),s=(this.hold_?.items??[]).filter(a=>a.objectType==="ga"),n=[...new Set([...s.map(a=>a.label),...r])];if(!n.length)return null;let l=this.ticketIssue(n);if(l)throw new Ie(l);if(this.hold_&&this.holdCovers(n))return this.hold_;try{let a=n.map(h=>{let d=s.find(y=>y.label===h);if(d)return{label:h,tierId:d.tierId,quantity:d.quantity};let u=this.labelToSeat.get(h),f=u?this.toSeat(u):null;return{label:h,...f?.tierId?{tierId:f.tierId}:{},...this.tableQuantityRequest(f)}}),c=await this.api.hold(this.key,a,t,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:n,expiresAt:c.expiresAt,items:c.items}),this.hold_}catch(a){throw this.handle409Conflicts(a),a}}async resumeHold(e){if(this.closed||!e||!this.api.resume)return null;let t=await this.api.resume(this.key,e);if(this.closed)return null;let o=[...new Set(t.items.map(r=>r.label))];return o.length?(this.setHold({holdId:t.holdId,labels:o,expiresAt:t.expiresAt,items:t.items},"restored"),this.hold_):null}async extendHold(e){let t=this.hold_;if(!t||!this.api.extend)return null;try{let o=await this.api.extend(this.key,t.holdId,e);return this.hold_?.holdId!==t.holdId?this.hold_:(this.setHold({holdId:t.holdId,labels:t.labels,expiresAt:o.expiresAt,items:t.items}),this.hold_)}catch{return null}}categoryAvailability(){return La({seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,groupedTablesByLabel:this.groupedTablesByLabel,closedMembers:this.closedMemberIds(),statusOf:e=>this.getStatus(e),gaAreas:this.getGAAreas()})}closedMemberIds(){let e=new Set,t=this.renderer;if(!t||!this.closedSections.size)return e;for(let o of this.closedSections)for(let r of t.sectionMembers?.(o)??[])e.add(r);return e}getGAAreas(){let e=this.visibleDoc();return e?wa(e,this.currency,t=>this.statusOf(t)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(ka(this.getGAAreas(),this.gaSelected))}async holdGA(e,t,o={}){let r=this.visibleDoc();if(!r||!Number.isFinite(t)||t<1)return null;let s=ot(r).find(h=>h.id===e);if(!s)return null;let n=Mt(s).filter(h=>!this.hold_?.labels.includes(h)&&this.statusOf(h)==="free").slice(0,Math.floor(t));if(n.length!==Math.floor(t))return null;let l=new Map;for(let h of this.hold_?.items??[])l.set(h.label,{label:h.label,tierId:h.tierId,quantity:h.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let h of this.hold_.seats)l.set(h.label,{label:h.label,...h.tierId?{tierId:h.tierId}:{}});for(let h of this.getSelection())l.set(h.label,{label:h.label,...h.tierId?{tierId:h.tierId}:{},...this.tableQuantityRequest(h)});for(let h of n)l.set(h,{label:h,...o.tierId?{tierId:o.tierId}:{}});let a=[...l.values()],c=await this.api.hold(this.key,a,o.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:a.map(h=>h.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}hasPremiumSeats(){for(let e of this.labelToSeat.values())if(e.commercial?.premium)return!0;return!1}getBestAvailableZones(){return Pa(this.visibleDoc())}pickPremiumBlock(e,t,o){return Ma({doc:this.visibleDoc(),qty:e,categoryKey:t,zoneId:o,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:r=>this.seatTierResolution(r).kind!=="invalid",statusOfLabel:r=>this.getStatus(this.labelToId.get(r)??"")??"free",isPremium:r=>!!this.labelToSeat.get(r)?.commercial?.premium})}async bestAvailable(e,t,o={}){let r=this.renderer;if(!r)return null;if(o.preferPremium){let s=this.pickPremiumBlock(e,t,o.zoneId);if(s){if(this.hold_&&!await this.release())return null;try{let n=s.map(h=>{let d=this.labelToSeat.get(h),u=d?this.toSeat(d):null;return{label:h,...u?.tierId?{tierId:u.tierId}:{}}}),l=await this.api.hold(this.key,n,o.ttlMs);r.clearSelection();let a=this.idsForLabels(s);a.length&&r.setStatus(a,"held"),this.setHold({holdId:l.holdId,labels:[...s],expiresAt:l.expiresAt,items:l.items});let c=s.map(h=>this.labelToSeat.get(h)).filter(h=>!!h).map(h=>this.toSeat(h));return this.opts.onSelectionChange?.(c),this.hold_}catch(n){let{status:l,reason:a}=kt(n);if(l===409&&a==="event_closed")throw this.opts.onSalesClosed?.(),n}}}if(this.hold_&&!await this.release())return null;try{let s=await this.api.bestAvailable(this.key,e,t,o.zoneId,o.ttlMs);r.clearSelection();let n=this.idsForLabels(s.labels);n.length&&r.setStatus(n,"held"),this.setHold({holdId:s.holdId,labels:[...s.labels],expiresAt:s.expiresAt,items:s.items});let l=s.labels.map(a=>this.labelToSeat.get(a)).filter(a=>!!a).map(a=>this.toSeat(a));return this.opts.onSelectionChange?.(l),this.hold_}catch(s){let{status:n,reason:l}=kt(s);throw n===409&&l==="event_closed"&&this.opts.onSalesClosed?.(),s}}async book(e,t,o){let r=this.renderer;if(!r)return null;if(!this.api.book)throw new Error("picker: transport has no book() \u2014 hold-only mode");let s=t??this.getSelection().map(c=>c.label);if(!s.length)return null;let n=this.ticketIssue(s);if(n)throw new Ie(n);let l;try{if(this.hold_&&this.holdCovers(s))l=this.hold_.holdId;else{let c=this.hold_?.holdId,h=await this.api.hold(this.key,s.map(d=>{let u=this.labelToSeat.get(d),f=u?this.toSeat(u):null;return{label:d,...f?.tierId?{tierId:f.tierId}:{},...this.tableQuantityRequest(f)}}),o,c);l=h.holdId,this.setHold({holdId:l,labels:[...s],expiresAt:h.expiresAt,items:h.items})}await this.api.book(this.key,s,l,e)}catch(c){let{status:h,conflicts:d,reason:u}=kt(c);if(this.clearHold(),h===409&&u==="event_closed")this.opts.onSalesClosed?.();else if(h===409&&d?.length){let f=new Set(d.map(p=>p.label)),y=this.idsForLabels(f);y.length&&(r.setStatus(y,"booked"),r.deselect(y),this.resetTableQuantitiesForLabels(f));let m=s.filter(p=>!f.has(p));m.length&&l&&this.api.release(this.key,m,l).catch(()=>{}),this.emitSelectionChange()}else l&&this.api.release(this.key,s,l).catch(()=>{});throw c}let a=this.idsForLabels(s);return a.length&&(r.setStatus(a,"booked"),r.deselect(a)),this.clearHold(),this.resetTableQuantitiesForLabels(s),this.emitSelectionChange(),this.opts.onBook?.(e),s}async release(){let e=this.hold_;if(!e)return!0;try{let o=await this.api.release(this.key,e.labels,e.holdId);if(!this.releaseConfirmed(o,e.labels))return await this.resnapshot(),!1}catch(o){return this.emitError(o),!1}if(this.hold_?.holdId!==e.holdId)return!0;this.clearHold(),this.resetTableQuantitiesForLabels(e.labels);let t=this.idsForLabels(e.labels);return t.length&&(this.renderer?.deselect(t),this.renderer?.setStatus(t,"free")),!0}async releaseLabels(e){let t=this.hold_;if(!t)return!0;let o=e.filter(l=>t.labels.includes(l));if(!o.length)return!0;try{let l=await this.api.release(this.key,o,t.holdId);if(!this.releaseConfirmed(l,o))return await this.resnapshot(),!1}catch(l){return this.emitError(l),!1}if(this.hold_?.holdId!==t.holdId)return!0;let r=t.labels.filter(l=>!o.includes(l)),s=t.items?.filter(l=>!o.includes(l.label));r.length?this.setHold({...t,labels:r,items:s}):this.clearHold(),this.resetTableQuantitiesForLabels(o);let n=this.idsForLabels(o);return n.length&&(this.renderer?.deselect(n),this.renderer?.setStatus(n,"free")),!0}releaseConfirmed(e,t){let o=e?.released;return!Array.isArray(o)||t.every(r=>o.includes(r))}setStatus(e,t){this.renderer?.setStatus(e,t)}getStatus(e){return this.renderer?.getStatus(e)}notForSaleCategorySeatIds(){let e=this.doc;if(!e)return[];let t=new Set(e.categories.filter(r=>r.notForSale).map(r=>r.key));if(!t.size)return[];let o=[];for(let[r,s]of this.seatById)t.has(s.categoryKey)&&o.push(r);return o}flashSeat(e,t){this.renderer?.flashSeat(e,t)}zoomIn(){this.renderer?.zoomIn()}zoomOut(){let e=this.renderer;if(!e?.zoomOutLevel)return void e?.zoomOut();let t=!!e.getFocusedSection?.();e.zoomOutLevel()==="venue"&&t&&this.overview()}zoomToFit(){this.renderer?.zoomToFit()}refitCurrentView(){this.renderer?.refitCurrentView?this.renderer.refitCurrentView():this.renderer?.zoomToFit()}setViewportInsets(e){this.viewportInsets=e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:null,this.renderer?.setViewportInsets?.(this.viewportInsets)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){this.accessFilter=e===null?null:[...e],this.renderer?.setAccessibilityFilter?.(e);let t=this.renderer?.getFocusedSection?.()??null;t&&this.opts.onSectionFocus?.(this.sectionSummary(t))}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}setCommercialLimitedFilter(e){this.renderer?.setCommercialLimitedFilter?.(e)}getFloors(){return this.renderer?.getFloors?.()??[]}getActiveFloorId(){return this.renderer?.getActiveFloorId?.()??""}setFloor(e){let t=this.renderer;!t?.setActiveFloor||e===t.getActiveFloorId?.()&&!t.isFloorOverview?.()||(t.setFloorOverview?.(!1),t.setStacked?.(!1),t.setActiveFloor(e),this.resnapshot(),this.emitSelectionChange())}setStacked(e){let t=this.renderer;!t?.setStacked||e===t.isStacked?.()||(t.setStacked(e),this.resnapshot())}isMultiFloor(){return(this._doc?.floors?.length??0)>1}setFloorOverview(e){let t=this.renderer;!t?.setFloorOverview||e===t.isFloorOverview?.()||(t.setFloorOverview(e),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){return this.renderer?.isFloorOverview?.()??!1}handleDeckTap(e){let t=this.renderer;t&&(t.setViewMode?.("flat"),t.setFloorOverview?.(!1),t.setStacked?.(!1),t.setActiveFloor?.(e),this.resnapshot(),this.emitSelectionChange(),this.opts.onDeckTap?.(e))}setViewMode(e){this.renderer?.setViewMode?.(e)}getViewMode(){return this.renderer?.getViewMode?.()??"flat"}getRung(){return this.renderer?.getRung?.()??"seats"}getFocusedSection(){return this.renderer?.getFocusedSection?.()??null}seatsRevealed(){let e=this.renderer;return e?.seatsRevealed?e.seatsRevealed():this.getRung()==="seats"||!!this.getFocusedSection()}setRung(e){if(e==="zones"){this.overview();return}this.renderer?.setRung?.(e)}setCategoryFilter(e){this.renderer?.setCategoryFilter?.(e)}focusCategoryFilter(e){let t=this.renderer;if(t){if(t.clearSectionFocus?.(),this.opts.onSectionFocus?.(null),e?.length){let o=this.floorForCategories(e);o&&this.setFloor(o)}t.focusCategories?t.focusCategories(e):t.zoomToFit()}}floorForCategories(e){let t=this._doc;if(!t?.floors||t.floors.length<2)return null;let o=new Set(e),r=l=>l.some(a=>a.type==="row"&&(o.has(a.categoryKey)||(a.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||a.type==="gaArea"&&o.has(a.categoryKey)),s=this.getActiveFloorId(),n=t.floors.find(l=>l.id===s);return n&&r(n.objects)?null:t.floors.find(l=>r(l.objects))?.id??null}getViewport(){let e=this.renderer;return!e?.getVisibleWorldRect||!e.getWorldBounds?null:{visible:e.getVisibleWorldRect(),bounds:e.getWorldBounds()}}getMinimapSnapshot(){return this.renderer?.getMinimapSnapshot?.()??{sections:[],seats:[]}}panToWorld(e){this.renderer?.panToWorld?.(e)}clearSectionFocus(){this.renderer?.clearSectionFocus?.(),this.opts.onSectionFocus?.(null)}getRenderedQualityEvidence(){return this.renderer?.getRenderedQualityEvidence()??null}focusSection(e,t){this.handleSectionTap(e,t)}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}handleSectionTap(e,t){let o=this.renderer;if(o){if(o.focusSection?o.focusSection(e,t?{anchor:t}:void 0):o.focusRegion?.(e),this.isSectionClosed(e)){this.opts.onSectionFocus?.(null);return}this.opts.onSectionFocus?.(this.sectionSummary(e))}}sectionSummary(e){return!this.renderer||!this._doc?null:Oa({id:e,doc:this._doc,sectionMembers:t=>this.renderer?.sectionMembers?.(t)??[],statusOf:t=>this.renderer?.getStatus(t)??"free",seatById:this.seatById,groupedTableBySeatId:this.groupedTableBySeatId,...this.accessFilter?{matchesAccessFilter:t=>ke(t,this.accessFilter)}:{}})}destroy(){if(this.closed=!0,this.detachVisibility?.(),this.detachVisibility=null,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null),this.realtime){try{this.realtime.stop()}catch{}this.realtime=null}if(this.ws){try{this.ws.close()}catch{}this.ws=null}this.renderer?.destroy(),this.renderer=null}toSeat(e){let t=this.groupedTableBySeatId.get(e.id);if(t)return this.toTableSeat(t);let o=e.commercial?{commercial:e.commercial}:void 0,r=e.displayLabel?{displayLabel:e.displayLabel}:void 0,s=e.accessibility?.length?{accessibility:e.accessibility}:void 0,n=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,l=this.seatContext.get(e.id),a=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!a)return{id:e.id,label:e.label,...r,...l,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...s,...n};let h=c.tier;return{id:e.id,label:e.label,...r,...l,categoryKey:e.categoryKey,price:h.price,currency:this.currency,tiers:a,tierId:h.id,...o,...s,...n}}toTableSeat(e){let t=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(n=>Nt(this._doc,this.tableTierSeat(e),n.id).kind==="resolved"),r=this.tableTierResolution(e),s=r.kind==="resolved"?r.tier:void 0;return{id:t?.id??e.objectId,label:e.label,displayLabel:e.displayLabel??e.label,...e.displayType?{displayType:e.displayType,rowType:e.displayType}:{},objectId:e.objectId,sectionLabel:t?this.seatContext.get(t.id)?.sectionLabel:void 0,rowLabel:e.displayLabel??e.label,categoryKey:e.categoryKey,price:s?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:s?.id}:{},objectType:"table",bookingMode:e.mode,quantity:this.tableQuantities.get(e.label)??(e.mode==="whole"?e.capacity:e.minOccupancy),capacity:e.capacity,minOccupancy:e.minOccupancy,maxOccupancy:e.maxOccupancy,physicalSeatIds:e.chairs.map(n=>n.id)}}describeSeat(e,t){let o=this._doc?.categories.find(r=>r.key===e.categoryKey);return{...this.toSeat(e),categoryLabel:o?.label??e.categoryKey,categoryColor:o?.color??"#6e7bff",status:this.renderer?.getStatus(e.id)??"free",mark:this.renderer?.getSeatMark?.(e.id)??null,...t?.interaction?{interaction:t.interaction}:{},...t?.unavailable?{unavailable:!0}:{},...t?.filteredOut?{filteredOut:!0}:{},currency:this.currency,...this.seatContext.get(e.id)}}priceFor(e){return this._doc?.categories.find(t=>t.key===e)?.price??0}tiersFor(e){let t=this._doc?.categories.find(o=>o.key===e)?.tiers;return t&&t.length?t:void 0}tiersForSeat(e){if(!this._doc)return;let t=lr(this._doc,e);return t.length?t:void 0}seatTierResolution(e){return this._doc?Nt(this._doc,e,this.seatTiers.get(e.id)):{kind:"none"}}tableTierSeat(e){return{label:e.label,categoryKey:e.categoryKey,accessibility:e.chairs.flatMap(t=>t.accessibility??[])}}tableTierResolution(e){if(!this._doc)return{kind:"none"};let t=e.chairs[0]?.id??"";return Nt(this._doc,this.tableTierSeat(e),this.seatTiers.get(t))}setSeatTier(e,t){let o=this.seatById.get(e);if(!o)return;let r=this.tiersForSeat(o);if(r){if(t==null)this.seatTiers.delete(e);else if(r.some(s=>s.id===t))this.seatTiers.set(e,t);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(e){let t=[];for(let o of e){let r=this.labelToSeat.get(o);r&&t.push(this.toSeat(r))}return t}emitSelectionChange(){let e=this.getSelection();this.opts.onSelectionChange?.(e),this.emitSelectionValidity(),this.emitOrphanHint()}emitSelectionValidity(){let e=this.getSelectionValidity();e&&(this.opts.onSelectionValidityChange?.(e),e.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(e.seats):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(e),this.lastSelectionValidity=e.isValid)}ticketIssue(e){if(!this._doc)return null;let t=e?this.seatsForLabels(e):this.getSelection();return cr(this._doc,t.map(o=>({label:o.label,...o.tierId?{tierId:o.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;let e=this.renderer;if(!e)return;let t=this.ticketIssue();if(t){this.hintShown=!0,this.opts.onHint(t.code==="companion_pair_required"?$("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=new Set(e.getSelection().map(s=>s.id));(o.size?xi(this.seatById.values(),s=>e.getStatus(s),o):[]).length>0?(this.hintShown=!0,this.opts.onHint($("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(e){this.renderer?.setColorblindSafe?.(e)}emitError(e){this.opts.onError?this.opts.onError(e):console.error("[picker]",e)}holdCovers(e){let t=this.hold_;if(!t||t.labels.length!==e.length||!e.every(s=>t.labels.includes(s)))return!1;let o=new Map((t.items??[]).map(s=>[s.label,s.tierId])),r=new Map((t.items??[]).map(s=>[s.label,s.quantity??1]));return e.every(s=>{let n=this.labelToSeat.get(s),l=n?this.toSeat(n):null,a=l?.tierId??null;return(l?.objectType!=="table"||(l.bookingMode!=="variable"||this.confirmedVariableTables.has(s))&&(!r.has(s)||r.get(s)===l.quantity))&&(!o.has(s)||o.get(s)===a)})}handle409Conflicts(e){let{status:t,conflicts:o}=kt(e);if(t!==409||!o?.length)return;let r=this.renderer;if(!r)return;let s=this.idsForLabels(o.map(n=>n.label));s.length&&(r.deselect(s),r.setStatus(s,"held"),this.resetTableQuantitiesForLabels(o.map(n=>n.label))),this.emitSelectionChange()}setHold(e,t="created"){for(let s of e.items??[])this.groupedTablesByLabel.has(s.label)&&s.quantity!=null&&(this.tableQuantities.set(s.label,s.quantity),this.groupedTablesByLabel.get(s.label)?.mode==="variable"&&this.confirmedVariableTables.add(s.label));let o={...e,seats:this.seatsForLabels(e.labels)};this.hold_=o,this.renderer?.setOwnedHold?.(this.idsForLabels(o.labels)),this.expiryTimer&&clearTimeout(this.expiryTimer);let r=Math.max(0,o.expiresAt-Date.now());this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},r),t==="restored"?this.opts.onHoldRestored?.(o):this.opts.onHold?.(o)}clearHold(){this.hold_=null,this.renderer?.setOwnedHold?.(null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null)}async expireActiveHold(){let e=this.hold_;if(e){try{let t=await this.api.objects(this.key);if(this.hold_?.holdId!==e.holdId)return;this.applySeatsMap(t.seats,t.default??"free")}catch{this.hold_?.holdId===e.holdId&&(this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},2e3));return}if(this.hold_?.holdId===e.holdId){if(Ca(e.expiresAt,e.labels.some(t=>this.statusOf(t)==="held"))){this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},1e3);return}this.clearHold(),this.opts.onHoldExpired?.()}}}applySeatsMap(e,t="free"){let o=this.renderer;if(!o)return;this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=t;let r=hi(t);this.allIds.length&&o.setStatus(this.allIds,r),o.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let s={free:[],held:[],booked:[],not_for_sale:[]};for(let[l,a]of Object.entries(e))s[hi(a)].push(...this.idsForLabel(l));["free","held","booked","not_for_sale"].forEach(l=>{l!==r&&s[l].length&&o.setStatus(s[l],l)});let n=this.notForSaleCategorySeatIds();n.length&&o.setStatus(n,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(t=>this.statusOf(t)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let t=await this.api.objects(this.key);this.applySeatsMap(t.seats,t.default??"free")},e)}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,t=xa({selection:this.getSelection().map(o=>o.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:o=>this.statusOf(o)});if(t.lost.length&&this.deselect(t.lost),t.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(t.lapsedLabels);let o=this.idsForLabels(t.lapsedLabels);o.length&&this.renderer?.deselect(o),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(t),t}getAccessNeeds(){return Ta(this.seatById.values(),e=>this.getStatus(e)??"free")}attachVisibility(){this.detachVisibility||(this.detachVisibility=Ia(()=>{this.closed||this.refreshAvailability().then(()=>{this.closed||this.renderer?.forceDraw()})}))}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applySeatsMap(e.exceptions,e.default),resync:()=>this.resnapshot(),onSections:(e,t)=>{let o=this.syncHidden(e),r=this.syncClosed(t);o&&this.resnapshot(),(o||r)&&this.opts.onStatusChange?.()}}}applyStatusChanges(e){let t=this.renderer;if(t){for(let o of e){this.liveStatuses.set(o.label,o.status);let r=this.idsForLabel(o.label);if(!r.length)continue;let s=hi(o.status);this.opts.flashOnLiveChange&&s!=="free"&&r.some(n=>t.getStatus(n)==="free")&&!this.hold_?.labels.includes(o.label)&&r.forEach(n=>t.flashSeat(n,s==="held"?"#f4b740":"#f43f5e")),t.setStatus(r,s)}this.opts.keepLiveWhileHidden&&typeof document<"u"&&document.visibilityState==="hidden"&&t.forceDraw(),this.pushGAState(),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}}connect(){if(this.closed)return;let e=this.api.socketUrl(this.key);if(!e)return;if(!this.realtime&&this.api.createRealtime){let o=null;try{o=this.api.createRealtime(this.key,this.realtimeSink())}catch{o=null}if(o){this.realtime=o,o.start();return}}if(this.realtime)return;let t;try{let o=this.api.socketProtocols?.(this.key);t=o&&o.length?new WebSocket(e,o):new WebSocket(e)}catch{this.scheduleReconnect();return}this.ws=t,t.onopen=()=>{this.attempt=0,this.resnapshot()},t.onmessage=o=>{let r;try{r=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(!this.renderer||!r||typeof r!="object")return;let n=r;Array.isArray(n.hidden)&&this.syncHidden(n.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.()),Array.isArray(n.closed)&&this.syncClosed(n.closed)&&this.opts.onStatusChange?.(),n.type!=="hidden"&&(n.seats&&typeof n.seats=="object"?this.applySeatsMap(n.seats):Array.isArray(n.changes)&&this.applyStatusChanges(n.changes))},t.onclose=()=>{this.ws===t&&(this.ws=null),this.scheduleReconnect()},t.onerror=()=>{try{t.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=va(e,{baseMs:1e3,maxMs:dh,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}};var uh=5,ph=-1.1,go=35;function bo(i,e){let t=i-ee,o=Math.atan2(uh-t,e)*180/Math.PI,r=Math.atan2(ph-t,e)*180/Math.PI;return r<-go&&(o+=-go-r,r=-go),{topPitch:o,basePitch:r}}var q=2048,he=1024,Tt=Po,E=Math.PI*2,fh=he/180,tt=i=>(i+180)/360*q,K=i=>(90-i)/180*he;function Va(i){let e=2166136261;for(let t=0;t<i.length;t++)e^=i.charCodeAt(t),e=Math.imul(e,16777619);return e>>>0}function Ka(i){let e=i>>>0;return()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}var pi=96,wo=360/pi,mh=.6,So=[17,23,42];function vo(i,e,t=1){let o=Math.max(0,Math.min(.58,e)),r=Math.round(i[0]+(So[0]-i[0])*o),s=Math.round(i[1]+(So[1]-i[1])*o),n=Math.round(i[2]+(So[2]-i[2])*o);return`rgba(${r},${s},${n},${t})`}function Ga(i,e,t){return[Math.round(i[0]+(e[0]-i[0])*t),Math.round(i[1]+(e[1]-i[1])*t),Math.round(i[2]+(e[2]-i[2])*t)]}function ie(i,e,t){let o=(1-Math.abs(2*t-1))*e,r=(i%360+360)%360/60,s=o*(1-Math.abs(r%2-1)),n=0,l=0,a=0;r<1?[n,l,a]=[o,s,0]:r<2?[n,l,a]=[s,o,0]:r<3?[n,l,a]=[0,o,s]:r<4?[n,l,a]=[0,s,o]:r<5?[n,l,a]=[s,0,o]:[n,l,a]=[o,0,s];let c=t-o/2;return[Math.round((n+c)*255),Math.round((l+c)*255),Math.round((a+c)*255)]}var Ha=new Map;function Na(i){if(!i)return null;let e=Ha.get(i);if(e)return e;let t=2166136261;for(let s=0;s<i.length;s++)t^=i.charCodeAt(s),t=Math.imul(t,16777619);let o=(t>>>0)%360,r=ie(o,.3,.42);return Ha.set(i,r),r}function yh(i,e,t,o){let r=new Array(pi).fill(null),s=0,n=i.sectionId;for(let l of e){if(l.id===i.id)continue;let a=l.sectionId;if(!a||n&&a===n)continue;let c=l.x-i.x,h=l.y-i.y,d=Math.hypot(c,h)*Tt;if(d<1.5||d>95)continue;let u=l.eyeHeightM??ee,f=u-o;Math.abs(f)>s&&(s=Math.abs(f));let y=Math.atan2(f,d)*180/Math.PI,m=Math.atan2(u-ee-o,d)*180/Math.PI,g=((Math.atan2(c,-h)-t)*180/Math.PI+540)%360-180,b=Math.min(pi-1,Math.max(0,Math.floor((g+180)/wo))),S=y>34&&d<16,v=r[b];v?(y>v.top&&(v.top=y),m<v.base&&(v.base=m),d<v.nearM&&(v.nearM=d,v.tint=Na(l.categoryKey)),v.overhead=v.overhead||S):r[b]={top:y,base:m,nearM:d,overhead:S,tint:Na(l.categoryKey)}}return{bins:r,maxDelta:s}}function gh(i,e,t,o){for(let r=0;r<pi;r++){let s=e[r];if(!s)continue;let n=-180+r*wo,l=t(n),a=t(n+wo);if(!(a>l))continue;let c=Math.min(72,s.top),h=Math.min(s.base,-4),d=o(c),u=o(h);if(u<=d)continue;let f=s.nearM/95,y=s.tint,m=y?Ga([44,54,80],y,.34):[44,54,80],p=y?Ga([24,30,48],y,.28):[24,30,48],g=i.createLinearGradient(0,d,0,u);g.addColorStop(0,vo(m,f)),g.addColorStop(.24,vo(p,f)),g.addColorStop(1,vo([10,13,22],f)),i.fillStyle=g,i.fillRect(l,d,a-l+1,u-d),i.fillStyle=`rgba(150,165,205,${.35*(1-f*.55)})`,i.fillRect(l,d,a-l+1,1.5);let S=Math.min(u,o(0))-d;if(S>8){let w=1-f*.4;for(let k=1;k<6;k++){let L=d+S*k/6;i.fillStyle=`rgba(0,0,0,${.16*w})`,i.fillRect(l,L,a-l+1,1.5),i.fillStyle=`rgba(120,134,170,${.1*w})`,i.fillRect(l,L+1.5,a-l+1,1.2)}}if(s.overhead){let v=o(Math.min(86,c+12)),w=i.createLinearGradient(0,v,0,d);w.addColorStop(0,"rgba(3,4,8,0.9)"),w.addColorStop(1,"rgba(3,4,8,0)"),i.fillStyle=w,i.fillRect(l,v,a-l+1,d-v),i.fillStyle="rgba(120,130,160,0.14)",i.fillRect(l,d-1.5,a-l+1,1.5)}}}function bh(i,e,t){let r=new Array(72).fill(!1),s=new Array(72).fill(1/0),n=new Set,l=0;for(let g of t){l++,g.sectionId&&n.add(g.sectionId);let b=g.x-e.x,S=g.y-e.y,v=Math.hypot(b,S)*Tt;if(v<.5)continue;let w=Math.atan2(b,-S),k=Math.floor((w+Math.PI)/E*72);k<0?k=0:k>=72&&(k=71),r[k]=!0,v<s[k]&&(s[k]=v)}let a=0,c=[];for(let g=0;g<72;g++)r[g]&&(a++,c.push(s[g]));let h=a/72*360;c.sort((g,b)=>g-b);let d=c.length?c[c.length>>1]:0,u=c.length?c[Math.floor(c.length*.15)]??d:0,f=c.length?c[Math.floor(c.length*.85)]??d:0,y=u>.5?f/u:1,m=Va(`${l}|${[...n].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),p;return h>=300&&d>11&&y>1.35?p="sport":h>=285?p="arena":p="proscenium",{mode:p,seed:m,voidRadiusM:d,aspect:y}}var Sh=5;function vh(i,e,t){switch(t){case 1:i.beginPath(),i.ellipse(0,-e*.14,e*1.16,e*1.16,0,0,E),i.fill();break;case 2:i.beginPath(),i.ellipse(0,-e*1.02,e*.42,e*.42,0,0,E),i.fill(),i.beginPath(),i.ellipse(0,-e*.2,e*.98,e*1.02,0,0,E),i.fill();break;case 3:i.beginPath(),i.ellipse(0,-e*.36,e*1.04,e*.6,0,Math.PI,E),i.fill(),i.beginPath(),i.ellipse(0,-e*.52,e*1.22,e*.24,0,0,E),i.fill();break;case 4:i.beginPath(),i.ellipse(-e*.66,e*.5,e*.5,e*1.35,0,0,E),i.fill(),i.beginPath(),i.ellipse(e*.66,e*.5,e*.5,e*1.35,0,0,E),i.fill(),i.beginPath(),i.ellipse(0,-e*.08,e*1.06,e*1.08,0,0,E),i.fill();break;default:break}}function wh(i,e,t,o,r){let s=o*.44,n=o*r.shoulderK,l=o*.66,a=o*1.68,c=o*5.4,h=`rgba(${r.clothing[0]},${r.clothing[1]},${r.clothing[2]},${r.alpha})`,d=`rgba(${r.tone[0]},${r.tone[1]},${r.tone[2]},${r.alpha})`;i.save(),i.translate(e,t);let u=r.lean*o;i.fillStyle=h,i.beginPath(),i.moveTo(-s,l),i.quadraticCurveTo(-s*1.18,a-u-o*.6,-n,a-u),i.quadraticCurveTo(-n*1.05,a+o*1.2,-n*.94,c),i.lineTo(n*.94,c),i.quadraticCurveTo(n*1.05,a+o*1.2,n,a+u),i.quadraticCurveTo(s*1.18,a+u-o*.6,s,l),i.closePath(),i.fill(),i.fillStyle=d,i.fillRect(-s*.82,o*.5,s*1.64,o*.9),i.save(),i.rotate(r.tilt),i.translate(r.turn*o,0),i.fillStyle=d,o>=18?(i.beginPath(),i.moveTo(-o*.9,-o*.15),i.quadraticCurveTo(-o*.96,-o*1.12,0,-o*1.06),i.quadraticCurveTo(o*.96,-o*1.12,o*.9,-o*.15),i.quadraticCurveTo(o*.86,o*.55,o*.36,o*.98),i.quadraticCurveTo(0,o*1.14,-o*.36,o*.98),i.quadraticCurveTo(-o*.86,o*.55,-o*.9,-o*.15),i.closePath(),i.fill(),o>=22&&(i.beginPath(),i.ellipse(-o*.9,o*.18,o*.13,o*.22,0,0,E),i.ellipse(o*.9,o*.18,o*.13,o*.22,0,0,E),i.fill())):(i.beginPath(),i.ellipse(0,0,o*.9,o*1.06,0,0,E),i.fill()),vh(i,o,r.hair),r.rim>.01&&(i.strokeStyle=`rgba(245,205,150,${(.5*r.rim).toFixed(3)})`,i.lineWidth=Math.max(1,o*.14),i.beginPath(),i.ellipse(0,-o*.06,o*.86,o*1,0,Math.PI*1.12,Math.PI*1.9),i.stroke()),i.restore(),r.rim>.01&&(i.strokeStyle=`rgba(240,200,150,${(.28*r.rim).toFixed(3)})`,i.lineWidth=Math.max(1,o*.12),i.beginPath(),i.moveTo(-n*.8,a-o*.05),i.quadraticCurveTo(-s,a-o*.75,0,a-o*.82),i.quadraticCurveTo(s,a-o*.75,n*.8,a-o*.05),i.stroke()),i.restore()}function kh(i,e,t,o,r,s,n){i.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${n})`,i.beginPath(),i.moveTo(e-o*1.72,t+o*4),i.quadraticCurveTo(e-o*1.78,t+o*1.55,e-o*.46,t+o*1.02),i.lineTo(e-o*.4,t+o*.62),i.lineTo(e+o*.4,t+o*.62),i.lineTo(e+o*.46,t+o*1.02),i.quadraticCurveTo(e+o*1.78,t+o*1.55,e+o*1.72,t+o*4),i.closePath(),i.fill(),i.fillStyle=`rgba(${s[0]},${s[1]},${s[2]},${n})`,i.beginPath(),i.ellipse(e,t,o*.9,o*1.05,0,0,E),i.fill()}function Lo(i,e,t,o,r){let s=o*.1,n=t-o*.9,l=t-o*.74,a=t-o*.46,c=o*.13,h=o*.09,d=`rgba(${r.tone[0]},${r.tone[1]},${r.tone[2]},${r.alpha})`,u=i.createRadialGradient(e,t,1,e,t,o*.24);u.addColorStop(0,"rgba(0,0,0,0.4)"),u.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.scale(1,.28),i.fillStyle=u,i.beginPath(),i.ellipse(e,t/.28,o*.24,o*.24,0,0,E),i.fill(),i.restore(),i.fillStyle=d,i.beginPath(),i.moveTo(e-h,a),i.lineTo(e-h*.7,t),i.lineTo(e-h*.1,t),i.lineTo(e-h*.1,a+o*.02),i.lineTo(e+h*.1,a+o*.02),i.lineTo(e+h*.1,t),i.lineTo(e+h*.7,t),i.lineTo(e+h,a),i.closePath(),i.fill(),i.beginPath(),i.moveTo(e-c,l),i.quadraticCurveTo(e-c*.9,a-o*.12,e-h,a),i.lineTo(e+h,a),i.quadraticCurveTo(e+c*.9,a-o*.12,e+c,l),i.quadraticCurveTo(e,l-o*.05,e-c,l),i.closePath(),i.fill(),i.lineCap="round",i.lineJoin="round",i.strokeStyle=d,i.lineWidth=o*.055;let f=l+o*.02;r.pose===1?(i.beginPath(),i.moveTo(e-c*.8,f),i.lineTo(e-c*1.5,t-o*1.02),i.moveTo(e+c*.8,f),i.lineTo(e+c*1.5,t-o*1.02),i.stroke()):r.pose===2?(i.beginPath(),i.moveTo(e-c*.8,f),i.lineTo(e+h*1.4,a-o*.02),i.moveTo(e+c*.8,f),i.lineTo(e-h*.4,a-o*.06),i.stroke(),i.fillStyle=d,i.beginPath(),i.ellipse(e+h*1.5,a-o*.04,o*.07,o*.09,-.5,0,E),i.fill()):r.pose===3?(i.beginPath(),i.moveTo(e-c*.8,f),i.lineTo(e-c*.2,n+s*.6),i.moveTo(e+c*.8,f),i.lineTo(e+c*1.1,a),i.stroke(),i.lineWidth=o*.02,i.beginPath(),i.moveTo(e-c*.2,n+s*.9),i.lineTo(e-c*.2,t-o*.02),i.stroke()):(i.beginPath(),i.moveTo(e-c*.85,f),i.lineTo(e-c*.95,a+o*.02),i.moveTo(e+c*.85,f),i.lineTo(e+c*.95,a+o*.02),i.stroke()),i.fillStyle=d,i.fillRect(e-s*.34,n+s*.6,s*.68,s*.9),i.beginPath(),i.ellipse(e,n,s*.86,s*1.05,0,0,E),i.fill(),r.rimStrength>.01&&(i.strokeStyle=`rgba(${r.rim[0]},${r.rim[1]},${r.rim[2]},${(.6*r.rimStrength).toFixed(3)})`,i.lineWidth=Math.max(1,o*.02),i.beginPath(),i.moveTo(e-c,l),i.lineTo(e-s*.6,n+s*.4),i.moveTo(e-s*.7,n),i.ellipse(e,n,s*.84,s*1.02,0,Math.PI*1.05,Math.PI*1.55),i.stroke())}function fi(i,e,t,o,r,s,n,l,a){i.save(),i.globalCompositeOperation="lighter";let c=i.createLinearGradient(0,t,0,r);c.addColorStop(0,`rgba(${l},${a})`),c.addColorStop(.5,`rgba(${l},${(a*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${l},0)`),i.fillStyle=c,i.beginPath(),i.moveTo(e-s,t),i.lineTo(o-n,r),i.lineTo(o+n,r),i.lineTo(e+s,t),i.closePath(),i.fill(),i.restore()}function To(i,e,t,o,r){let s=i.createRadialGradient(e,t,0,e,t,o*3);s.addColorStop(0,`rgba(${r},0.9)`),s.addColorStop(.4,`rgba(${r},0.35)`),s.addColorStop(1,`rgba(${r},0)`),i.fillStyle=s,i.beginPath(),i.arc(e,t,o*3,0,E),i.fill(),i.fillStyle=`rgba(${r},1)`,i.beginPath(),i.arc(e,t,o,0,E),i.fill()}function Ig(i,e,t){let o=document.createElement("canvas");o.width=q,o.height=he;let r=o.getContext("2d"),s=e.x-i.x,n=e.y-i.y,l=Math.hypot(s,n),a=Math.max(2,l*Tt),c=i.eyeHeightM??ee,h=bh(i,e,t),d=Ka(h.seed),u=210+d()*150,f=ie(220+(d()-.5)*60,.55,.82),y=`${f[0]},${f[1]},${f[2]}`,m=r.createLinearGradient(0,0,0,he);m.addColorStop(0,"#080b12"),m.addColorStop(.42,"#12182c"),m.addColorStop(.5,"#1c2440"),m.addColorStop(.56,"#151b2c"),m.addColorStop(.78,"#171e30"),m.addColorStop(1,"#131829"),r.fillStyle=m,r.fillRect(0,0,q,he);let p=r.createLinearGradient(0,K(-6),0,he);p.addColorStop(0,"rgba(30, 37, 56, 0)"),p.addColorStop(.55,"rgba(30, 37, 56, 0.22)"),p.addColorStop(1,"rgba(22, 28, 44, 0.12)"),r.fillStyle=p,r.fillRect(0,K(-6),q,he-K(-6));let g=Math.atan2(s,-n),b=yh(i,t,g,c),S=b.maxDelta>=mh;S&&gh(r,b.bins,tt,K);let v=Math.max(.3,Math.min(1,1-(a-6)/60)),w=bo(c,a),k=Math.min(80,Math.atan2(4,a)*180/Math.PI),L=Math.min(45,w.topPitch),x=w.basePitch;h.mode==="sport"?xh(r,a,c,h,v,u,y,d):h.mode==="arena"?Th(r,a,c,h,v,y,d):Lh(r,k,L,x,v,u,y,d);let T=h.mode==="sport"?34:24+Math.floor(d()*8);r.fillStyle=`rgba(${y},0.8)`;for(let P=0;P<T;P++){let M=(P+.5)/T*q,R=K(h.mode==="sport"?58:54+P*7%3*6);r.beginPath(),r.arc(M,R,h.mode==="sport"?2.6:3.2,0,E),r.fill()}Ch(r,i,t,e,g,c,s,n,S,h);let I=r.createLinearGradient(0,0,0,he);return I.addColorStop(0,"rgba(0,0,0,0.85)"),I.addColorStop(.12,"rgba(0,0,0,0)"),I.addColorStop(.9,"rgba(0,0,0,0)"),I.addColorStop(1,"rgba(0,0,0,0.55)"),r.fillStyle=I,r.fillRect(0,0,q,he),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(a)}}function Lh(i,e,t,o,r,s,n,l){let a=tt(-e),c=tt(e),h=K(t),d=K(o),u=c-a,f=d-h,y=K(Math.min(50,t+10)),m=u*(1.1+(1-r)*.5),p=i.createRadialGradient(q/2,(h+d)/2,8,q/2,(h+d)/2,m);p.addColorStop(0,"rgba(255, 214, 150, 0.34)"),p.addColorStop(.28,"rgba(150, 150, 230, 0.3)"),p.addColorStop(.6,"rgba(99, 102, 241, 0.12)"),p.addColorStop(1,"rgba(99, 102, 241, 0)"),i.fillStyle=p,i.fillRect(a-u*.6,h-f*1.2,u*2.2,f*3.4);let g=ie(s,.62,.55),b=ie(s+40,.7,.5),S=ie(s+70,.78,.52);i.save(),i.beginPath(),i.rect(a,h,u,f),i.clip();let v=i.createLinearGradient(0,h,0,d);v.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),v.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),v.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),i.globalAlpha=.8,i.fillStyle=v,i.fillRect(a,h,u,f),i.globalAlpha=1;let w=i.createRadialGradient(q/2,(h+d)/2,u*.12,q/2,(h+d)/2,u*.62);w.addColorStop(0,"rgba(6,8,14,0)"),w.addColorStop(.7,"rgba(6,8,14,0.15)"),w.addColorStop(1,"rgba(5,6,11,0.92)"),i.fillStyle=w,i.fillRect(a,h,u,f),i.restore();let k=3+Math.floor(l()*3),L=f*.46,x=d-f*.08;for(let _=0;_<k;_++){let j=(_+1)/(k+1),z=a+u*(.22+j*.56+(l()-.5)*.06);Lo(i,z,x,L*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:ie(s+20,.5,.7),rimStrength:.7})}i.fillStyle="#05070d",i.fillRect(a-u*.5,y,u*.5,d-y),i.fillRect(c,y,u*.5,d-y);let T=u*.055+3,I=T*1.35;i.fillStyle="#03050a",i.beginPath(),i.moveTo(a,d),i.lineTo(a-T,d),i.lineTo(a-I,y),i.lineTo(a+u*.012,y),i.closePath(),i.fill(),i.beginPath(),i.moveTo(c,d),i.lineTo(c+T,d),i.lineTo(c+I,y),i.lineTo(c-u*.012,y),i.closePath(),i.fill(),i.fillRect(a-I,y,u+I*2,(d-y)*.12);let P=f*.14,M=y+(d-y)*.12;i.fillStyle="rgba(4,6,12,0.96)";let R=7;i.beginPath(),i.moveTo(a-I,M);for(let _=0;_<=R;_++){let j=a-I+(u+I*2)*_/R;i.quadraticCurveTo(j-(u+I*2)/R/2,M+P,j,M)}i.lineTo(c+I,M),i.lineTo(c+I,y),i.lineTo(a-I,y),i.closePath(),i.fill(),i.fillStyle=`rgba(${n},0.12)`,i.fillRect(a-1.5,M,1.5,d-M),i.fillRect(c,M,1.5,d-M),i.fillStyle="#0b0f18",i.fillRect(a-T,d-f*.05,u+T*2,f*.05+3);let C=i.createLinearGradient(0,d-f*.05,0,d+f*.12);C.addColorStop(0,`rgba(255,206,140,${(.5*r).toFixed(3)})`),C.addColorStop(1,"rgba(255,206,140,0)"),i.fillStyle=C,i.fillRect(a-T,d-f*.05,u+T*2,f*.2);let A=3+Math.floor(l()*2);for(let _=0;_<A;_++){let j=(_+1)/(A+1),z=a+u*(j+(l()-.5)*.08),X=K(Math.min(62,t+26)),J=(l()-.5)*u*.16;fi(i,z,X,z+J,d,4,u*.09,n,.16*(.7+r*.5)),To(i,z,X,2.4,n)}}function Th(i,e,t,o,r,s,n){let l=Math.min(e*.6,Math.max(3,o.voidRadiusM)),a=Math.min(55,Math.atan2(l,e)*180/Math.PI),c=q/2,h=1.2,d=Math.max(e*.45,e-l),u=e+l,f=Math.atan2(h-t,d)*180/Math.PI,y=Math.atan2(h-t,u)*180/Math.PI,m=Math.atan2(-t,d)*180/Math.PI,p=K(f),g=K(y),b=K(m),S=tt(a)-c,v=Math.max(6,(p-g)/2),w=(p+g)/2,k=i.createRadialGradient(c,b,4,c,b,S*2.6);k.addColorStop(0,`rgba(255,206,150,${(.2*r).toFixed(3)})`),k.addColorStop(.5,"rgba(150,140,190,0.08)"),k.addColorStop(1,"rgba(40,44,60,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=k,i.fillRect(c-S*2.6,g-v,S*5.2,b-g+v+40),i.restore(),i.fillStyle="#0c1019",i.beginPath(),i.moveTo(c-S,w),i.ellipse(c,w,S,v,0,Math.PI,0,!1),i.lineTo(c+S,b),i.ellipse(c,b,S,v,0,0,Math.PI,!1),i.closePath(),i.fill();let L=i.createLinearGradient(0,w,0,b);L.addColorStop(0,`rgba(${s},0.14)`),L.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=L,i.fillRect(c-S,w,S*2,b-w);let x=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],T=x[Math.floor(n()*x.length)],I=n()<.5?-1:1,P=B=>c+B.u*I*S*.84,M=B=>w+B.v*v*.8,R=T.find(B=>B.lead)??T[0],C=P(R),A=i.createLinearGradient(0,w-v,0,w+v);A.addColorStop(0,"#3d4a72"),A.addColorStop(1,"#232b47"),i.fillStyle=A,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.fill();let _=i.createRadialGradient(C,w,2,C,w,S);_.addColorStop(0,`rgba(255,214,160,${(.5*r).toFixed(3)})`),_.addColorStop(1,"rgba(255,214,160,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=_,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.fill(),i.restore(),i.strokeStyle=`rgba(${s},0.7)`,i.lineWidth=2,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.stroke();let j=Math.max(24,(b-g)*1.3),z=T.length>=3?3:2;for(let B=0;B<z;B++){let de=(-.62+B*.52+(n()-.5)*.12)*-I,Pe=c+de*S*.7,it=w-v*(.45+n()*.18),Ve=S*(.07+n()*.04),vi=j*(.26+n()*.12);i.fillStyle="#0a0e18",i.fillRect(Pe-Ve/2,it-vi,Ve,vi),i.fillStyle=`rgba(${s},0.3)`,i.fillRect(Pe-Ve/2,it-vi,Ve,1.5)}if(T.length>=3){let B=c-R.u*I*S*.4;i.fillStyle="#0b0f1a",i.beginPath(),i.ellipse(B,w-v*.34,S*.08,v*.1,0,0,E),i.fill(),i.strokeStyle=`rgba(${s},0.35)`,i.lineWidth=1,i.stroke()}for(let B of[...T].sort((de,Pe)=>de.v-Pe.v)){let de=.82+(B.v+1)*.14;Lo(i,P(B),M(B),j*de*(B.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:B.pose,rim:ie(40,.72,.8),rimStrength:B.lead?1.4:.9})}let X=K(Math.min(60,y+34)),J=v*1.1+6;i.strokeStyle="rgba(60,68,92,0.85)",i.lineWidth=3,i.beginPath(),i.ellipse(c,X,S*1.15,J,0,0,E),i.stroke();let O=4+Math.floor(n()*3);for(let B=0;B<O;B++){let de=B/O*E,Pe=c+Math.cos(de)*S*1.15,it=X+Math.sin(de)*J;if(Math.sin(de)>-.2){let Ve=c+(n()-.5)*S*.8;fi(i,Pe,it,Ve,w,3,S*.32,s,.2*(.7+r*.4))}To(i,Pe,it,3,s)}let Y=K(Math.min(52,y+24)),D=Math.max(60,S*.4),Z=Math.max(24,D*.34);i.strokeStyle="rgba(70,78,102,0.6)",i.lineWidth=1.5,i.beginPath(),i.moveTo(c-D*.3,Y-Z/2),i.lineTo(c-D*.16,Y-Z*2.2),i.moveTo(c+D*.3,Y-Z/2),i.lineTo(c+D*.16,Y-Z*2.2),i.stroke(),i.fillStyle="#0d1220",i.fillRect(c-D/2,Y-Z/2,D,Z);let yi=i.createLinearGradient(0,Y-Z*.3,0,Y+Z*.42);yi.addColorStop(0,`rgba(${s},0.5)`),yi.addColorStop(1,"rgba(255,214,160,0.32)"),i.fillStyle=yi,i.fillRect(c-D*.42,Y-Z*.3,D*.84,Z*.72),i.fillStyle="rgba(255,214,160,0.55)",i.fillRect(c-D/2,Y+Z/2-2,D,2);let gi=i.createRadialGradient(c,Y,4,c,Y,D*1.1);gi.addColorStop(0,`rgba(${s},0.2)`),gi.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=gi,i.fillRect(c-D*1.1,Y-D*.8,D*2.2,D*1.6);let bi=i.createRadialGradient(c,(X+w)/2,6,c,(X+w)/2,S*1.5);bi.addColorStop(0,`rgba(${s},${(.1*(.6+r*.5)).toFixed(3)})`),bi.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=bi,i.fillRect(c-S*1.5,X-40,S*3,w-X+80),i.restore();let Xa=c+Math.sign(C-c||1)*S*.5;fi(i,Xa,X-J*.4,C,M(R),2.5,S*.16,"255,224,178",.42*(.7+r*.4));let Si=i.createRadialGradient(C,M(R),1,C,M(R),S*.2);Si.addColorStop(0,`rgba(255,228,185,${(.4*r).toFixed(3)})`),Si.addColorStop(1,"rgba(255,228,185,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=Si,i.beginPath(),i.ellipse(C,M(R),S*.2,v*.24,0,0,E),i.fill(),i.restore()}function xh(i,e,t,o,r,s,n,l){let a=q/2,c=Math.max(10,o.voidRadiusM),h=Math.max(2,e-c),d=e+c,u=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),f=Math.atan2(-t,h)*180/Math.PI,y=Math.atan2(-t,d)*180/Math.PI,m=K(f),p=K(y),g=tt(u)-a,b=(m+p)/2,S=Math.max(10,(m-p)/2),v=i.createRadialGradient(a,b,4,a,b,g);v.addColorStop(0,"#e8f0fb"),v.addColorStop(.7,"#b9c9e2"),v.addColorStop(1,"#8fa3c4"),i.save(),i.beginPath(),i.ellipse(a,b,g,S,0,0,E),i.clip(),i.fillStyle=v,i.fillRect(a-g,b-S,g*2,S*2),i.strokeStyle="rgba(90,120,170,0.5)",i.lineWidth=3,i.beginPath(),i.moveTo(a,b-S),i.lineTo(a,b+S),i.moveTo(a-g*.5,b-S),i.lineTo(a-g*.5,b+S),i.moveTo(a+g*.5,b-S),i.lineTo(a+g*.5,b+S),i.stroke(),i.strokeStyle="rgba(180,90,110,0.45)",i.beginPath(),i.ellipse(a,b,S*.9,S*.5,0,0,E),i.stroke(),i.restore(),i.strokeStyle="rgba(210,225,245,0.6)",i.lineWidth=2.5,i.beginPath(),i.ellipse(a,b,g,S,0,0,E),i.stroke(),i.fillStyle="rgba(20,26,40,0.8)";for(let P=0;P<5;P++){let M=a+(l()-.5)*g*1.4,R=b+(l()-.5)*S*1.1,C=Math.max(2,S*.06);i.beginPath(),i.ellipse(M,R,C*.6,C,0,0,E),i.fill()}let w=i.createRadialGradient(a,b,4,a,b,g*1.4);w.addColorStop(0,"rgba(200,220,255,0.12)"),w.addColorStop(1,"rgba(200,220,255,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=w,i.fillRect(a-g*1.4,p-S,g*2.8,m-p+S*2),i.restore();let k=K(Math.min(66,y+60)),L=Math.max(80,g*.7),x=L*.5,T=i.createRadialGradient(a,k,4,a,k,L*1.6);T.addColorStop(0,`rgba(${n},0.3)`),T.addColorStop(1,`rgba(${n},0)`),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=T,i.fillRect(a-L*1.6,k-L*1.2,L*3.2,L*2.4),i.restore(),i.fillStyle="#080b12",i.beginPath(),i.moveTo(a-L/2,k-x/2),i.lineTo(a+L/2,k-x/2),i.lineTo(a+L*.6,k),i.lineTo(a+L/2,k+x/2),i.lineTo(a-L/2,k+x/2),i.lineTo(a-L*.6,k),i.closePath(),i.fill();let I=s;for(let P=0;P<3;P++){let M=ie(I+P*30,.5,.5);i.fillStyle=`rgba(${M[0]},${M[1]},${M[2]},0.75)`;let R=L*.26;i.fillRect(a-L*.42+P*(R+L*.06),k-x*.32,R,x*.64)}i.fillStyle=`rgba(${n},0.9)`;for(let P=0;P<8;P++){let M=a-L*.6+L*1.2*P/7;i.beginPath(),i.arc(M,k+x*.62,2.4,0,E),i.fill()}}function Ch(i,e,t,o,r,s,n,l,a,c){let h=e.sectionId,d=!1,u=[];for(let m of t){if(m.id===e.id)continue;let p=m.x-e.x,g=m.y-e.y,b=Math.hypot(p,g)*Tt;if(h&&m.sectionId===h&&b<3&&p*n+g*l>0&&(d=!0),b<.3||b>32)continue;let v=((Math.atan2(p,-g)-r)*180/Math.PI+540)%360-180,w=a?(m.eyeHeightM??ee)-s:0,k=Math.atan2(w-.28,b)*180/Math.PI;if(k>10&&b>5)continue;let L=0;for(let I=0;I<m.id.length;I++)L=L*31+m.id.charCodeAt(I)&65535;let x=.9+(L&15)/40,T=Math.min(78,Math.atan2(.16,b)*180/Math.PI*fh*x);T<1.2||u.push({hx:tt(v),hy:K(k),r:T,d:b,hash:L})}u.sort((m,p)=>p.d-m.d);let f=[];{let m=[...u].sort((b,S)=>b.hy-S.hy),p=[],g=()=>{if(!p.length)return;let b=p.reduce((w,k)=>w+k.d,0)/p.length,S=p.reduce((w,k)=>w+k.hy,0)/p.length,v=p.reduce((w,k)=>w+k.r,0)/p.length;f.push({figs:p.sort((w,k)=>k.d-w.d),d:b,hy:S,r:v}),p=[]};for(let b of m){let S=p[p.length-1];S&&Math.abs(b.hy-S.hy)>Math.max(5,(S.r+b.r)/2*1.7)&&g(),p.push(b)}g()}f.sort((m,p)=>p.d-m.d);let y=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let m of f){if(m.figs.length>=3&&m.r>=1.6&&m.r<26){let p=[],g=[...m.figs].sort((v,w)=>v.hx-w.hx),b=[];for(let v of g){let w=b[b.length-1];w&&v.hx-w.hx>Math.max(14,v.r*7)&&(b.length>=3&&p.push(b),b=[]),b.push(v)}b.length>=3&&p.push(b);let S=Math.min(.42,.5*(1-m.d/42));if(S>.05){i.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let v of p){let w=v[0].hx-m.r*1.6,k=v[v.length-1].hx+m.r*1.6;i.beginPath(),i.roundRect(w,m.hy+m.r*.8,k-w,m.r*2.4,m.r*.8),i.fill()}}}for(let p of m.figs){let g=p.d<12?.95:p.d<17?Math.max(.66,.95-(p.d-12)/18):Math.max(.3,.68-(p.d-17)/34),b=Math.round((1-Math.min(1,p.d/16))*10),S=[14+(p.hash>>4&6)+b,17+(p.hash>>4&6)+b,25+(p.hash>>4&6)+b],v=y[p.hash%y.length],w=[v[0]+b,v[1]+b,v[2]+b];if(p.r>=13){let k=p.d<9?.16*(1-p.d/9)+(c.mode==="proscenium"?.06:0):0;wh(i,p.hx,p.hy,p.r,{tone:S,clothing:w,alpha:g,tilt:((p.hash>>2&7)-3.5)*.018,shoulderK:1.72+(p.hash>>5&7)/22,hair:p.hash%Sh,rim:k,turn:((p.hash>>8&7)-3.5)*.034,lean:((p.hash>>10&3)-1.5)*.09})}else p.r>=5.5?kh(i,p.hx,p.hy,p.r,w,S,g):(i.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.toFixed(3)})`,i.beginPath(),i.arc(p.hx,p.hy,p.r,0,E),i.fill(),i.beginPath(),i.ellipse(p.hx,p.hy+p.r*1.4,p.r*1.85,p.r*.95,0,Math.PI,0,!0),i.fill())}}if(d){let m=K(-34);i.fillStyle="rgba(6, 8, 14, 0.92)",i.fillRect(0,m,q,he-m),i.fillStyle="rgba(24, 30, 46, 0.9)";let p=16;for(let g=0;g<p;g++){let b=(g+.5)/p*q;i.beginPath(),i.ellipse(b,m+6,q/p*.42,22,0,Math.PI,0,!0),i.fill()}}}var ne=480,et=270,ko=50,We=30,Wa=i=>(i+ko)/(2*ko)*ne,Lt=i=>(We-i)/(2*We)*et;function Pg(i,e,t){let o=document.createElement("canvas");o.width=ne,o.height=et;let r=o.getContext("2d"),s=e.x-i.x,n=e.y-i.y,l=Math.max(2,Math.hypot(s,n)*Tt),a=Ka(Va(`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+a()*150,h=ie(220+(a()-.5)*60,.55,.82),d=`${h[0]},${h[1]},${h[2]}`,u=r.createLinearGradient(0,0,0,et);u.addColorStop(0,"#080b12"),u.addColorStop(.44,"#151c32"),u.addColorStop(.5,"#1d2644"),u.addColorStop(.58,"#161c2e"),u.addColorStop(1,"#131829"),r.fillStyle=u,r.fillRect(0,0,ne,et);let f=i.eyeHeightM??ee,y=bo(f,l),m=Math.min(ko-2,Math.atan2(4,l)*180/Math.PI),p=Math.min(We-2,y.topPitch),g=Math.max(-We+2,y.basePitch),b=Wa(-m),S=Wa(m),v=Lt(p),w=Lt(g),k=S-b,L=w-v,x=Math.max(.35,Math.min(1,1-(l-6)/60)),T=Lt(Math.min(We-1,p+8)),I=r.createRadialGradient(ne/2,(v+w)/2,4,ne/2,(v+w)/2,k*1.15);I.addColorStop(0,"rgba(255,214,150,0.34)"),I.addColorStop(.28,"rgba(150,150,230,0.3)"),I.addColorStop(.6,"rgba(99,102,241,0.12)"),I.addColorStop(1,"rgba(99,102,241,0)"),r.fillStyle=I,r.fillRect(b-k*.6,v-L*1.2,k*2.2,L*3.4);let P=ie(c,.62,.55),M=ie(c+40,.7,.5),R=ie(c+70,.78,.52);r.save(),r.beginPath(),r.rect(b,v,k,L),r.clip();let C=r.createLinearGradient(0,v,0,w);C.addColorStop(0,`rgb(${P[0]},${P[1]},${P[2]})`),C.addColorStop(.5,`rgb(${M[0]},${M[1]},${M[2]})`),C.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),r.globalAlpha=.8,r.fillStyle=C,r.fillRect(b,v,k,L),r.globalAlpha=1;let A=r.createRadialGradient(ne/2,(v+w)/2,k*.12,ne/2,(v+w)/2,k*.6);A.addColorStop(0,"rgba(6,8,14,0)"),A.addColorStop(.7,"rgba(6,8,14,0.15)"),A.addColorStop(1,"rgba(5,6,11,0.9)"),r.fillStyle=A,r.fillRect(b,v,k,L),r.restore();let _=3,j=w-L*.08;for(let O=0;O<_;O++){let Y=(O+1)/(_+1);Lo(r,b+k*(.24+Y*.52),j,L*.46*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:ie(c+20,.5,.7),rimStrength:.7})}r.fillStyle="#05070d",r.fillRect(b-k*.5,T,k*.5,w-T),r.fillRect(S,T,k*.5,w-T);let z=k*.05+2,X=z*1.35;r.fillStyle="#03050a",r.beginPath(),r.moveTo(b,w),r.lineTo(b-z,w),r.lineTo(b-X,T),r.lineTo(b+k*.012,T),r.closePath(),r.fill(),r.beginPath(),r.moveTo(S,w),r.lineTo(S+z,w),r.lineTo(S+X,T),r.lineTo(S-k*.012,T),r.closePath(),r.fill(),r.fillRect(b-X,T,k+X*2,(w-T)*.13),r.fillStyle=`rgba(${d},0.12)`,r.fillRect(b-1.2,T,1.2,w-T),r.fillRect(S,T,1.2,w-T),r.fillStyle="#0b0f18",r.fillRect(b-z,w-L*.05,k+z*2,L*.05+2);let J=r.createLinearGradient(0,w-L*.05,0,w+L*.14);J.addColorStop(0,`rgba(255,206,140,${(.5*x).toFixed(3)})`),J.addColorStop(1,"rgba(255,206,140,0)"),r.fillStyle=J,r.fillRect(b-z,w-L*.05,k+z*2,L*.22);for(let O=0;O<3;O++){let Y=(O+1)/4,D=b+k*Y,Z=Lt(Math.min(We-1,p+20));fi(r,D,Z,D+(a()-.5)*k*.14,w,3,k*.09,d,.17*x),To(r,D,Z,1.8,d)}r.fillStyle=`rgba(${d},0.75)`;for(let O=0;O<8;O++)r.beginPath(),r.arc((O+.5)/8*ne,Lt(We-4-O%2*3),2.2,0,E),r.fill();r.fillStyle="rgba(10,13,20,0.9)",r.fillRect(0,et-26,ne,26),r.fillStyle="rgba(30,37,54,0.9)";for(let O=0;O<9;O++){let Y=O*(ne/9)+ne/18;r.beginPath(),r.ellipse(Y,et-22,ne/9*.4,15,0,Math.PI,0,!0),r.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(l)}}var za=new Set(["en"]),mi=new Map;async function Ih(i){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(ur(`i18n/${i}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-VULFUGJH.js"),t=e[i];return t?await t():null}async function Eg(i,e){let t=ns(i,e);if(t==="en"||za.has(t))return qe(t),t;if(!ss.includes(t))return qe("en"),"en";try{let o=mi.get(t);o||(o=Ih(t),mi.set(t,o));let r=await o;return mi.delete(t),r?(qe(t,r),za.add(t),t):(qe("en"),"en")}catch{return mi.delete(t),qe("en"),"en"}}export{Ah as ACCESSIBILITY_RING_COLOR,xo as ACCESSIBILITY_TYPES,Mh as CHART_STORAGE_KEY,Fd as CURRENCY_CHOICES,_d as DEFAULT_CURRENCY,Oy as EMPTY_AVAILABILITY_REFRESH,Hh as EVENT_CONFIGURATION_EXPORT_SCHEMA,Gh as EVENT_CONFIGURATION_SCHEMA,cd as FLOOR_STACK_GAP_RATIO,ud as FLOOR_STACK_MIN_SURFACE_PX,By as HOLD_CLOCK_SKEW_MS,Ii as LABEL_FADE_MS,Bh as LABEL_STYLE_MAX_SIZE,Fh as LABEL_STYLE_MIN_SIZE,Td as LEGIBILITY_HYSTERESIS_PX,Vd as LOCALE_NAMES,fd as MAX_EVENT_INVENTORY,pd as MAX_GA_CAPACITY,Vo as MIN_POINTER_TARGET_PX,Da as PickerController,Ie as PickerSelectionError,kd as RENDERED_QUALITY_REPORT_VERSION,Eh as SEAT_COMMERCIAL_MARKS,Ph as STAGE_LABEL_STYLE_MAX_SIZE,gl as SUPPORTED_LOCALES,Oh as SURROUNDINGS_SHAPE_ROLES,mo as SeatmapRenderer,$h as TABLE_SEAT_OFFSET,Uh as TIER_HEIGHT_M,ss as TRANSLATED_LOCALES,Bo as UNGROUPED_ID,Ta as accessNeedsFor,Rh as accessibilityMeta,xt as accessibilityRingColor,Ro as allObjects,Oo as applyHidden,Ia as attachVisibilityCatchUp,zh as canTransitionEventConfiguration,Vh as canonicalEventConfigurationJson,Eo as chartBounds,Yn as compactRowLabel,Rt as computeSections,ba as createRenderer,pr as crossesThreshold,ml as currencyExponent,Od as currencySymbol,od as expandBooth,ze as expandChart,jh as expandRow,Qh as expandRowSlots,id as expandTable,ed as expandTableSlots,ad as floorObjects,hd as floorStackPlacements,Pt as floorsOf,$d as formatDate,Bd as formatMinor,dt as formatMoney,yl as fromMinorUnits,ot as gaAreasOf,gd as gaInventorySegments,md as gaUnitLabel,Mt as gaUnitLabels,Ig as generateSeatPanorama,Pg as generateSeatThumb,Kd as getLocale,bd as growJoinedGAInventory,wd as hiddenObjectIds,ah as holdHasLapsed,Gy as holdRecoveryShape,Mi as hysteresisScale,Fo as initialFloorMode,Kh as inspectEventConfigurationCompatibility,Ld as inspectRenderedQualityEvidence,Sd as isGaUnitLabel,Xd as isLocaleLoaded,vd as isSectionHidden,Dh as layerOf,_o as layoutFloorStack,Eg as loadLocale,zd as localeDirection,dd as mainFloorId,Yh as migrateLegacyEventConfigurations,sd as objectCenter,nd as owningSectionForObject,Wh as parseEventConfigurationExport,Nh as parseEventConfigurationVersion,rd as pointInPolygon,oe as pointInPolygonWithHoles,It as polygonLabelPoint,xa as reconcileAvailability,Dy as refreshChangedSomething,Pi as renderedPx,Xh as resolveEventConfigurationRollback,ns as resolveLocale,Zh as rowInventoryCount,qh as rowSeatPositions,_h as seatCommercialMeta,Ct as sectionGeometry,qe as setLocale,rs as setMoneyLocale,Yd as setStringOverrides,Ca as shouldWaitForHoldExpiry,Ao as stackFloors,$ as t,Ud as tCount,td as tableInventoryCount,Jh as tableSeatCountsBySide,ld as translateObject,yd as validGAInventorySegments,xd as zoomTowardPoint};
1
+ import{a as Ri,b as Ai,d as ys,e as Wt,g as gs,h as bs,k as Ss}from"./chunk-OGIAQX62.js";import{a as Yd,b as Ud,c as Ko,d as $d,e as qd,f as zo,h as rs,k as Ht,m as ns,n as ge,o as ae,p as as,q as ls,r as Gt,s as cs}from"./chunk-UVAV3E7K.js";import{a as ru,b as Qo,c as nu}from"./chunk-3L4M7L5I.js";import{b as vs}from"./chunk-FOYQOIWG.js";import{a as me,b as Zo,c as Me,d as Et,e as _t,f as Re,g as H,m as ye,n as Te,q as Bt,r as Ft,t as jo,u as Ot,v as $,w as Mi}from"./chunk-FMZ6HLDH.js";import{A as fs,B as ms,b as os,c as ss,e as rt,i as ds,j as us,p as ps}from"./chunk-QLDV5ZGA.js";import{a as Zd,b as jd,c as Qd,d as Jd,e as eu,f as Rt,g as tu,h as ot,i as iu,j as Xo,k as At,l as ou,m as su,n as Yo}from"./chunk-N3DPHRJ3.js";import{a as dd,b as ud,c as _o,d as pd,e as fd,f as Ct,g as md,h as yd,i as gd,j as bd,k as Sd,l as vd,n as Jo,q as st,u as hs}from"./chunk-YACNGDTE.js";import{b as Dt,f as es,h as Nt,i as ts,k as is}from"./chunk-UL5OIGIF.js";import{Aa as Ho,Ba as Ad,Ca as Ed,Da as _d,E as Bo,Ea as Bd,Fa as Fd,G as Fo,Ga as Od,Ha as Dd,I as V,Ia as Nd,Ja as Hd,Ka as Gd,La as Wd,Ma as oe,Na as Pt,Oa as Vd,Pa as Kd,Qa as Mt,Ra as zd,Sa as Go,Ta as Xd,Ua as Wo,Va as ze,Wa as Vo,d as wd,e as kd,f as Ld,g as Td,ga as Oo,h as xd,ha as Ke,i as Cd,ia as Rd,j as Id,k as Pd,l as Md,qa as ee,ra as Do,sa as It,ya as No}from"./chunk-QUOAQQMP.js";import{C as _,c as Ci,h as Ii,m as Uo,o as $o,t as D,u as Le,v as fe,w as ne,x as Pi,z as qo}from"./chunk-JBOTRSMY.js";import"./chunk-CRCGO52K.js";var au=1,Ei=90;function _i(i,e){return!Number.isFinite(i)||!Number.isFinite(e)?0:Math.max(0,i*e)}function ws(i,e,t,o=1){if(!Number.isFinite(i))return t;let s=Math.max(0,o);return t?i>=e-s:i>=e+s}function Bi(i,e,t,o=1){if(!Number.isFinite(i)||!(t>0))return i;let s=Math.max(0,o)/t;return e?i*(1+s):i*(1-s)}function lu(i){let{point:e,camera:t,scale:o,nextScale:s}=i;if(!Number.isFinite(o)||o<=0||!Number.isFinite(s))return{...t};let r=(e.x-t.x)/o,n=(e.y-t.y)/o;return{x:e.x-r*s,y:e.y-n*s}}import{Konva as fi}from"konva/lib/Core";import{Stage as Nh}from"konva/lib/Stage";import{Layer as vo}from"konva/lib/Layer";import{Group as wt}from"konva/lib/Group";import{Circle as Da}from"konva/lib/shapes/Circle";import{Group as Xi}from"konva/lib/Group";import{Circle as He}from"konva/lib/shapes/Circle";import{Line as Yi}from"konva/lib/shapes/Line";import{Rect as Ui}from"konva/lib/shapes/Rect";import{Text as Mr}from"konva/lib/shapes/Text";var be=9,Ae=.9,le=.55*Ae,se=H/me,nt=4,Ee=14,ks=10,Ls=14,Se=.45*Ae,ve=.9*Ae,_e=(Se+ve)/2,Ts=Math.max(Ae*1.1,ve),xe=8,xs=700,j=2,Cs=H,Vt=.85,Is=H,at=64,Xe=.55*Se,Fi=700,Ps=2500,Kt=-11.5,lt=.58,Ms=320,Rs=420,As=420,Es=1,Be=1,_s=2,Ye=16,he=12,Oi=[.85,.72,.62],zt=13,Xt=12,Bs=0,Fs="700",Os="600",Ds=8,Ns=5,Hs=10,Gs=6,Ws=8,Vs=.6,Ks=.6,zs=.7,Xs=[0,18,-18,36,-36,54,-54],Fe="600",Ys="500",de=640,Yt="700",Oe=.02,Us=14,$s=.34,Ut=.92,ct=7,$t=3,qs=6;function Di(i){return Math.min(1,Math.max(he/Ye,i/900))}function Ue(i,e){return Math.max(he,i*Di(e))}var Zs=.1,ht=1.02;var js=2;function Qs(i,e){return!(i>0)||!(e>0)||i>=e?null:e}var ml="#e5e7eb",yl="#c7cbd1",gl="#595f69",bl="#d1d5db",Sl="#b8bdc4",vl="#273142",wl="#526078",kl="#f1f5f9",Ll="#374151",Tl="#64748b",xl="#111827",qt="#6b7280",dt="#374151";var Js="#4b5563",er=.4,De=.16,tr="rgba(244,246,248,0.06)",Zt=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function ir(i,e,t){let o=new Map;for(let n of i){let l=e(n);!l||t(l)||o.set(l,(o.get(l)??0)+1)}let s=null,r=0;for(let[n,l]of o)(l>r||l===r&&s!=null&&n<s)&&(s=n,r=l);return s}function te(i){return D(i)?{sectionFill:ml,sectionStroke:yl,sectionInk:gl,focalFill:bl,focalStroke:Sl}:{sectionFill:vl,sectionStroke:wl,sectionInk:kl,focalFill:Ll,focalStroke:Tl}}function Ni(i,e){let t=i.sectionFill,o=qo(fe(t,.2),.85);switch(e){case"closed":return fe(t,.12);case"sold-out":return o;case"nearly-gone":return ne(t,o,.4);default:return t}}var or=.28,sr=.32,Cl=.55,Il=.7;function rr(i,e,t){let o=te(i),s=Ni(o,e);if(!t||e==="sold-out"||e==="closed")return{fill:s,stroke:o.sectionStroke};let r=D(i);return{fill:ne(s,t,r?sr:or),stroke:_(t,r?Il:Cl)}}var Pl=.03;function nr(i,e){let t=te(i);return!["normal","nearly-gone","sold-out","closed"].map(s=>Ni(t,s).toLowerCase()).includes(e.trim().toLowerCase())&&Hi(i,e)}function Hi(i,e){let t=Ci(e);if(!t)return!1;let o=te(i),s=Math.max(or,sr)+Pl;return["normal","nearly-gone","sold-out","closed"].some(r=>{let n=Ci(Ni(o,r));return n?Math.max(Math.abs(n[0]-t[0]),Math.abs(n[1]-t[1]),Math.abs(n[2]-t[2]))/255<=s:!1})}var Ml="#f8fafc",Rl="#f4f6fb",Al="#111827",El=.72;function ar(i){let e=D(i),t=e?Ml:xl,o=e?Al:Rl,s=ne(o,t,1-El);return{plate:t,ink:o,subInk:Uo(s,t)>=$o?s:o}}function jt(i){return i?.35:.3}function hr(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 Gi(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 dr=700,_l=2400,Wi=12,ur=30,lr=1,Bl=1.16,cr=.5,Fl=1;function Vi(i){return i*.61803398875%1}function pr(i,e){let o=((i/_l+e)%1+1)%1,s=(1-Math.cos(o*2*Math.PI))/2;return{scale:lr+(Bl-lr)*s,opacity:cr+(Fl-cr)*s}}var mr;function yr(i){mr=i}function Ol(i){return typeof i=="number"?i:i instanceof Date?i.getTime():Date.parse(i)}var fr=new Map;function Dl(i,e){let t=i??mr,o=`${t??""}|${JSON.stringify(e)}`,s=fr.get(o);return s||(s=new Intl.DateTimeFormat(t,e),fr.set(o,s)),s}var Nl={dateStyle:"medium",timeStyle:"short"};function gr(i,e={}){let{locale:t,...o}=e,s=Ol(i);if(!Number.isFinite(s))return"";let r=Object.keys(o).length?o:Nl;return Dl(t,r).format(s)}var yu="USD",gu=["USD","EUR","GBP","CAD","AUD","INR","AED","SGD","JPY","CHF","SEK","NZD","ZAR","MXN","BRL"],Sr;function vr(i){Sr=i}var br=new Map;function Qt(i,e,t,o){let s=o??Sr,r=`${s??""}|${i}|${e??"auto"}|${t??"auto"}`,n=br.get(r);return n||(n=new Intl.NumberFormat(s,{style:"currency",currency:i,minimumFractionDigits:e,maximumFractionDigits:t}),br.set(r,n)),n}function ut(i,e="USD",t,o){if(typeof t=="object"){let r=t;try{return Qt(e,r.minimumFractionDigits,r.maximumFractionDigits,r.locale).format(i)}catch(n){if(r.fallback)return r.fallback(i,e);throw n}}let s=t??(Number.isInteger(i)?0:void 0);return Qt(e,s,s,o).format(i)}function Hl(i="USD"){try{return Qt(i,void 0,void 0).resolvedOptions().maximumFractionDigits??2}catch{return 2}}function Gl(i,e="USD"){return i/10**Hl(e)}function bu(i,e="USD",t){return ut(Gl(i,e),e,void 0,t)}function Su(i="USD"){return Qt(i,0,0).formatToParts(0).find(t=>t.type==="currency")?.value??i}var pt={"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.testModeExplained":"Bookings here are not real and no card is charged","picker.seatsTogether":"Seats together","picker.findClosestSeatsTogether":"Find the closest seats together","picker.addSeat":"Add seat","picker.added":"Added","picker.findSeats":"Find seats","picker.displayOptions":"Display options","picker.closeVenueNavigation":"Close venue navigation","picker.orphanHint":"This leaves a single seat stranded \u2014 consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.beaconAria":"Go to your {seats} in {name}","map.seatsLeft":"{count} LEFT","map.soldOut":"SOLD OUT","map.fromPrice":"FROM {price}","map.statusHeld":"On hold","map.statusTaken":"Taken","picker.floor":"Floor","picker.zoomLevel":"Zoom level","picker.rungTip.zones":"Venue overview \u2014 groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks \u2014 sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats \u2014 blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.seatsLeftShort":"{count} left","picker.overview":"Venue","picker.entrance":"Entrance","picker.turnOffAccessibilityFilter":"Turn off the wheelchair filter to pick this seat","picker.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":"Reload the seat map to continue. Seats already in your cart stay held until the timer ends.","picker.accessExpiredTitle":"Your seat session has expired","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":"Reload seat map","picker.accessRevokedBody":"Ask whoever sent you here for a new link to keep booking these seats.","picker.accessRevokedTitle":"This access link is no longer active","picker.accessiblePhysicalSeat":"Accessible physical seat","picker.addTime":"Add time","picker.accessibilityOptions":"Accessibility and colour options","picker.addingEllipsis":"Adding\u2026","picker.allLevels":"All levels","picker.allPlacesBookedTogether":"All {count} places are booked together as one exclusive table.","picker.allPrices":"All prices","picker.allSeats":"All seats","picker.allSetTitle":"You\u2019re all set","picker.anyTicketType":"Any ticket type","picker.anyVenueZone":"Any venue zone","picker.areas":"Areas","picker.available":"Available","picker.backToMap":"Back to map","picker.backToVenue":"Back to venue","picker.bestSeatsStar":"\u2726 Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.change":"Change","picker.chartDerivedModel":"Chart-derived model","picker.chartDerivedSeatEye":"Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed","picker.checkConnection":"Check your connection and try again.","picker.checkoutCouldNotBeOpened":"Checkout could not be opened. Your seats are still held \u2014 please try again.","picker.chooseAnotherToCompare":"Choose another seat to compare.","picker.chooseGuestsCopy":"Choose how many guests will sit together. This table is held exclusively for your party.","picker.chooseMinMaxGuests":"Choose {min}\u2013{max} guests","picker.clearSavedSeatComparison":"Clear saved seat comparison","picker.close":"Close","picker.closeSeatStatus":"Close seat status","picker.closestGroupChosenInstantly":"Closest available group, chosen instantly.","picker.collapseTicketPanel":"Collapse ticket panel","picker.colorblindColors":"Colourblind-friendly colours","picker.companionSeatsNote":"Companion places beside them stay selectable","picker.accessFreeCount":"{count} free","picker.accessNoneLeft":"None left","picker.holdLapsedStillFree.one":"Your hold ended while you were away. That seat is still free.","picker.holdLapsedStillFree.other":"Your hold ended while you were away. Those seats are still free.","picker.holdLapsedSomeTaken.one":"Your hold ended while you were away, and {count} of those seats has been taken. The rest are still free.","picker.holdLapsedSomeTaken.other":"Your hold ended while you were away, and {count} of those seats have been taken. The rest are still free.","picker.holdLapsedAllTaken.one":"Your hold ended while you were away, and that seat has been taken.","picker.holdLapsedAllTaken.other":"Your hold ended while you were away, and those seats have been taken.","picker.holdLapsedSelectAgain.one":"Select it again","picker.holdLapsedSelectAgain.other":"Select them again","picker.compareCount":"Compare {count}","picker.compareWithSaved":"Compare with saved","picker.confirmOrCancelSeat":"Confirm or cancel this seat","picker.confirmSeatLabel":"Confirm seat {label}","picker.confirmYourTable":"Confirm your table","picker.confirmedAndOnWay":"confirmed. A confirmation is on its way.","picker.continue":"Continue","picker.continueToCheckout":"Continue to checkout","picker.couldNotAddMoreTime":"Couldn\u2019t add more time \u2014 please head to checkout now.","picker.couldNotFindSeatsTogether":"We couldn\u2019t find {count} seats together. Try fewer seats or another ticket type.","picker.couldNotReleaseTickets":"Couldn\u2019t release your tickets. Your hold is unchanged.","picker.couldNotRemoveLabel":"Couldn\u2019t remove {label}. Your hold is unchanged.","picker.currentOffer":"Current offer","picker.currentTicketOffer":"Current ticket offer","picker.dragToLookAround":"Drag to look around \xB7 scroll to zoom","picker.dragToLookTouch":"Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close","picker.dragToLookMouse":"Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close","picker.emptyWheelchairSpace":"Empty wheelchair space","picker.exitFullScreen":"Exit full screen","picker.fewer":"Fewer","picker.fewerGuests":"Fewer guests","picker.fewerSeats":"Fewer seats","picker.filterAndFocusByPrice":"Filter and focus seats by price","picker.filters":"Filters","picker.findBestSeatsCount.one":"Find {count} best seat","picker.findBestSeatsCount.other":"Find {count} best seats","picker.findBestSeatsTogether":"Find the best seats together","picker.findNewSeats":"Find new seats","picker.findingBestSeats":"Finding the best seats\u2026","picker.findingEllipsis":"Finding\u2026","picker.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 Wl=["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"],xu={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"},wr=["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"],Vl=new Set(["ar","fa","he"]),Ki={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"},zi=new Map(Wl.map(i=>[i.toLowerCase(),i]));function Kl(i){let e=i.trim().toLowerCase().replace(/_/g,"-");if(!e)return;let t=zi.get(e)??Ki[e];if(t)return t;let o=e.split("-");if(o.length>=2){let s=`${o[0]}-${o[1]}`,r=zi.get(s)??Ki[s];if(r)return r}return zi.get(o[0])??Ki[o[0]]}var Ne={en:pt},Jt={},ce="en";function kr(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=Kl(o);if(s)return s}return"en"}function Cu(){return ce}function Iu(i=ce){return Vl.has(i)?"rtl":"ltr"}function Pu(i){return!!Ne[i]}function $e(i,e){e&&(Ne[i]={...Ne[i],...e}),ce=Ne[i]?i:"en",vr(ce),yr(ce),typeof document<"u"&&(document.documentElement.lang=ce)}function Mu(i){Jt=i}var Lr=/\{(\w+)\}/g;function G(i,e){let t=Jt[i]??Ne[ce]?.[i]??pt[i]??i;return e?t.replace(Lr,(o,s)=>String(e[s]??`{${s}}`)):t}function Tr(i,e,t){let o=new Intl.PluralRules(ce).select(e);return(Jt[`${i}.${o}`]??Ne[ce]?.[`${i}.${o}`]??pt[`${i}.${o}`]??Jt[`${i}.other`]??Ne[ce]?.[`${i}.other`]??pt[`${i}.other`]??i).replace(Lr,(n,l)=>String({count:e,...t}[l]??`{${l}}`))}function Ru(i,e){return gr(i,{...e??{dateStyle:"medium",timeStyle:"short"},locale:ce})}function Cr(i,e,t,o=!1){let s=i.displayLabel?.trim()||i.label;return o?{title:s,detail:G("map.statusTaken"),sellable:!1}:e==="booked"?{title:s,detail:G("map.statusTaken"),sellable:!1}:e==="held"?{title:s,detail:G("map.statusHeld"),sellable:!1}:{title:s,detail:t()??"",sellable:!0}}var qe=32,xr=70;function Ir(i,e){let t=qe+6,o=i.y-xr;return{x:Math.min(Math.max(i.x,t),Math.max(t,e.width-t)),y:o>=t?o:Math.min(i.y+xr,e.height-t)}}var Ul=220,$l=.08,ei=class{constructor(e){this.pulses=new Map;this.pulseGroup=null;this.loupe=null;this.echoTimers=new Map;this.host=e}syncMarker(e,t,o){let s=o.get(e);if(o.delete(e),!t){this.retire(s);return}s?.destroy();let r=this.host,n=r.seat(e);if(!n)return;let l=r.seatShape(e)?.fill(),a=$(typeof l=="string"?l:"",r.selectionColor(),Ot),c=r.selectionFocusId()===e,h=r.boothDims(n.rowId),d=r.seatRadius(),u=r.seatPoint(n),p=new Xi({name:"selection-ring",x:u.x,y:u.y,rotation:h?.rotation??0,listening:!1,perfectDrawEnabled:!1,opacity:r.selectionFocusId()&&!c?.2:1});if(r.viewMode()==="perspective"){let f=r.perspectiveSeatScale(e);p.scale({x:f,y:f})}p.setAttrs({seatId:e,ringColor:a});let y={name:"selection-halo",stroke:_(r.categoryColor(n.categoryKey),jt(D(r.canvasBackground()))),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(h){let f=d*1.2;p.add(new Ui({...y,width:h.width+f*2,height:h.height+f*2,offsetX:(h.width+f*2)/2,offsetY:(h.height+f*2)/2,cornerRadius:8,strokeWidth:Math.max(2,d*.5)}))}else p.add(new He({...y,radius:d*1.6,strokeWidth:Math.max(2,d*.55)}));let m={stroke:a,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(h)if(p.add(new Ui({...m,width:h.width,height:h.height,offsetX:h.width/2,offsetY:h.height/2,cornerRadius:4,strokeWidth:c?4:3})),c)p.add(new Ui({...m,width:h.width+10,height:h.height+10,offsetX:(h.width+10)/2,offsetY:(h.height+10)/2,cornerRadius:7,strokeWidth:2,opacity:.55}));else{let f=Math.max(0,h.width/2-14),g=-Math.max(0,h.height/2-14);p.add(new He({x:f,y:g,radius:10,fill:a,listening:!1})),p.add(new Yi({x:f,y:g,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:D(a)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else p.add(new He({...m,radius:Math.max(1,d-1.25),strokeWidth:Math.min(2.5,Math.max(1.8,d*.22))})),c?p.add(new He({...m,radius:d+2,strokeWidth:2,opacity:.55})):p.add(new Yi({points:[-d*.52,0,-d*.12,d*.4,d*.6,-d*.46],stroke:"#ffffff",strokeWidth:Math.max(2.6,d*.34),lineCap:"round",lineJoin:"round",shadowColor:"#0b1220",shadowBlur:1.5,shadowOpacity:.55,listening:!1}));o.set(e,p),this.host.overlayLayer.add(p)}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=r=>{if(t.isDestroyed()||!e.getLayer()){e.destroy();return}let n=Math.min(1,(r-o)/160);e.opacity(1-n),t.overlayLayer.batchDraw(),n<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||!t.seat(e))return;this.emitPulse(e,!0);let o=this.echoTimers.get(e);o&&clearTimeout(o),this.echoTimers.set(e,setTimeout(()=>{this.echoTimers.delete(e),!(t.isDestroyed()||t.reducedMotion())&&(typeof document<"u"&&document.hidden||this.emitPulse(e,!1))},dr))}emitPulse(e,t){let o=this.host,s=o.seat(e);if(!s)return;let r=o.seatRadius(),n=o.seatPoint(s);this.pulses.get(e)?.destroy();let l=new He({name:"selection-pulse",x:n.x,y:n.y,radius:r,stroke:o.categoryColor(s.categoryKey),strokeWidth:Math.max(1.5,r*.24),opacity:Gi(0).opacity,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.pulses.set(e,l),this.pulseHome().add(l);let a=t&&!o.isCached()?o.seatShape(e):void 0,c=performance.now(),h=()=>{a?.scale({x:1,y:1}),l.destroy(),this.pulses.get(e)===l&&this.pulses.delete(e),o.overlayLayer.batchDraw(),a&&!o.isCached()&&o.seatLayer.batchDraw()},d=u=>{if(o.isDestroyed()){h();return}l.getLayer()||this.pulseHome().add(l);let p=u-c,y=Gi(p/420);if(l.radius(r*y.radiusScale),l.opacity(y.opacity),a){let m=hr(p/320);a.scale({x:m,y:m})}o.overlayLayer.batchDraw(),a&&!o.isCached()&&o.seatLayer.batchDraw(),p<420?requestAnimationFrame(d):h()};queueMicrotask(()=>{o.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(),r=()=>{o.scale({x:1,y:1}),t.seatLayer.batchDraw()},n=l=>{if(t.isDestroyed()||t.isCached()||!o.getLayer()){r();return}let a=l-s,c=Math.min(1,a/Ul),h=1+$l*Math.sin(Math.PI*c);o.scale({x:h,y:h}),t.seatLayer.batchDraw(),c<1?requestAnimationFrame(n):r()};requestAnimationFrame(n)}pulseHome(){return(!this.pulseGroup||!this.pulseGroup.getLayer())&&(this.pulseGroup=new Xi({name:"seat-pulses",listening:!1})),this.pulseGroup.getLayer()||this.host.overlayLayer.add(this.pulseGroup),this.host.overlayLayer.isCached()&&this.host.overlayLayer.clearCache(),this.pulseGroup.moveToTop(),this.pulseGroup}showLoupe(e){let t=this.host;if(t.isExportMode()||t.isDestroyed())return;let o=t.nearestSeat(e,Ee),s=o?t.seat(o):void 0;if(!s){this.hideLoupe();return}let r=Cr(s,t.seatStatus(s.id),()=>t.priceLabel(s),t.seatClosed(s.id)),n=Ir(e,{width:t.stage.width(),height:t.stage.height()}),l=1/(t.stage.scaleX()||1),a=this.loupe??this.buildLoupe();a.seatId=s.id,a.group.position(t.screenToWorld(n)),a.group.scale({x:l,y:l}),a.group.opacity(r.sellable?1:.75),a.group.visible(!0),a.disc.fill(t.categoryColor(s.categoryKey)),a.title.text(r.title),a.title.offsetX(a.title.width()/2),a.detail.text(r.detail),a.detail.offsetX(a.detail.width()/2),t.overlayLayer.batchDraw()}buildLoupe(){let e=this.host,t=e.canvasBackground(),o=$(t,te(t).sectionInk),s=new Xi({name:"touch-loupe",listening:!1,visible:!1});s.add(new Yi({points:[-7,qe-4,0,qe+12,7,qe-4],closed:!0,fill:t,stroke:_(o,.25),strokeWidth:1,listening:!1})),s.add(new He({radius:qe,fill:t,stroke:_(o,.28),strokeWidth:1.25,shadowColor:"#000000",shadowBlur:16,shadowOpacity:.45,listening:!1}));let r=new He({y:-15,radius:6,fill:"#6e7bff",listening:!1}),n=new Mr({y:-6,text:"",fontSize:15,fontStyle:"800",fontFamily:e.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1}),l=new Mr({y:12,text:"",fontSize:10.5,fontStyle:"700",fontFamily:e.labelFont(),fill:_(o,.72),listening:!1,perfectDrawEnabled:!1});return s.add(r),s.add(n),s.add(l),e.overlayLayer.add(s),s.moveToTop(),this.loupe={group:s,title:n,detail:l,disc:r,seatId:""},this.loupe}hideLoupe(){this.loupe?.group.visible()&&(this.loupe.group.visible(!1),this.host.overlayLayer.batchDraw())}destroy(){for(let e of this.echoTimers.values())clearTimeout(e);this.echoTimers.clear()}};import{Animation as ql}from"konva/lib/Animation";var Zl=1e3/ur;function Rr(i){return i.findOne(".selection-halo")??null}var ti=class{constructor(e){this.animation=null;this.targets=[];this.startedAt=0;this.lastFrameAt=0;this.visibilityBound=!1;this.onVisibilityChange=()=>{this.refresh()};this.markers=new Map;this.beaconRings=[];this.host=e}sync(e){this.markers=e,this.refresh()}syncBeacons(e){this.beaconRings=e,this.refresh()}refresh(){let e=this.host,t=this.markers.size>0||this.beaconRings.length>0;if(t&&!e.isDestroyed()&&!e.reducedMotion()&&this.bindVisibility(),e.isDestroyed()||e.reducedMotion()||!this.pageVisible()||!t){this.stop(),this.rest(),(!t||e.isDestroyed()||e.reducedMotion())&&this.unbindVisibility();return}let o=[],s=0;for(let[n,l]of this.markers){let a=Rr(l);if(a){if(this.paintHalo(n,a),s>=Wi){a.scale({x:1,y:1}),a.opacity(1);continue}o.push({node:a,phase:Vi(s)}),s+=1}}let r=0;for(let n of this.beaconRings){if(r>=Wi){n.scale({x:1,y:1}),n.opacity(1);continue}o.push({node:n,phase:Vi(r)}),r+=1}if(this.targets=o,!o.length){this.stop();return}this.animation||(this.startedAt=performance.now(),this.lastFrameAt=0,this.animation=new ql(()=>this.frame(),e.overlayLayer),this.animation.start())}stop(){this.targets=[],this.animation&&(this.animation.stop(),this.animation=null)}destroy(){this.stop(),this.markers=new Map,this.beaconRings=[],this.unbindVisibility()}isRunning(){return!!this.animation?.isRunning()}paintHalo(e,t){let o=this.host,s=jt(D(o.canvasBackground())),r=o.seatCategoryKey(e),n=o.isOwnedHold(e)?ne(o.selectionColor(),o.canvasBackground(),.55):r?o.categoryColor(r):o.selectionColor();t.stroke(_(n,s))}rest(){let e=!1;for(let[t,o]of this.markers){let s=Rr(o);s&&(this.paintHalo(t,s),s.scale({x:1,y:1}),s.opacity(1),e=!0)}for(let t of this.beaconRings)t.scale({x:1,y:1}),t.opacity(1),e=!0;e&&!this.host.isDestroyed()&&this.host.overlayLayer.batchDraw()}frame(){if(this.host.isDestroyed()||!this.targets.length)return this.stop(),!1;let t=performance.now();if(t-this.lastFrameAt<Zl)return!1;this.lastFrameAt=t;let o=t-this.startedAt;for(let s of this.targets){let{scale:r,opacity:n}=pr(o,s.phase);s.node.scale({x:r,y:r}),s.node.opacity(n)}return!0}pageVisible(){return typeof document>"u"?!0:document.visibilityState==="visible"}bindVisibility(){this.visibilityBound||typeof document>"u"||(document.addEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!0)}unbindVisibility(){!this.visibilityBound||typeof document>"u"||(document.removeEventListener("visibilitychange",this.onVisibilityChange),this.visibilityBound=!1)}};import{Group as jl}from"konva/lib/Group";import{Circle as Ar}from"konva/lib/shapes/Circle";import{Text as Ql}from"konva/lib/shapes/Text";var ii=28,Jl=12,ec="800",tc=44;function Er(i){if(i.rung==="seats")return[];let e=new Map,t=new Map(i.zones.map(s=>[s.id,s.name])),o=new Map(i.zones.map(s=>[s.id,s.anchor]));for(let s of i.sections){let r=i.ownedSeatIds(s);if(!r.length)continue;let n=i.rung==="zones"&&s.zone!=null&&t.has(s.zone),l=n?s.zone:s.logicalId,a=e.get(l);if(a){a.count+=r.length;continue}e.set(l,{id:l,kind:n?"zone":"section",name:n?t.get(s.zone):i.sectionName(s),count:r.length,seatId:r[0],anchor:n?o.get(s.zone):i.sectionAnchor(s)})}return[...e.values()]}function ic(i,e){return G("map.beaconAria",{seats:Tr("picker.seatCount",i),name:e})}var oc="selection-beacon-ring",oi=class{constructor(e){this.group=null;this.buttons=[];this.centres=[];this.rings=[];this.targets=[];this.signature="";this.host=e}breathingRings(){return this.rings}current(){return this.targets}sync(e){let t=Math.max(this.host.stageScale(),1e-4),o=`${t.toFixed(4)}|${e.map(a=>`${a.id}:${a.count}:${a.seatId}`).join(",")}`;if(o===this.signature&&this.buttons.length===e.length){this.targets=e,this.repositionButtons();return}if(this.clear(),this.signature=o,this.targets=e,!e.length){this.host.overlayLayer.batchDraw();return}let s=ii/2/t,r=this.host.accent(),n=this.host.accentInk(),l=new jl({listening:!1,name:"selection-beacons"});for(let a of e){let c={x:a.anchor.x,y:a.anchor.y-s*1.6},h=new Ar({name:oc,x:c.x,y:c.y,radius:s*1.25,stroke:_(r,.55),strokeWidth:Math.max(1,s*.22),listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});l.add(h),l.add(new Ar({name:"selection-beacon-disc",x:c.x,y:c.y,radius:s,fill:r,stroke:_(n,.28),strokeWidth:1/t,listening:!1,perfectDrawEnabled:!1}));let d=new Ql({x:c.x,y:c.y,text:String(a.count),fontSize:Jl/t,fontStyle:ec,fontFamily:this.host.labelFont(),fill:n,listening:!1,perfectDrawEnabled:!1});d.offsetX(d.width()/2),d.offsetY(d.height()/2),l.add(d),this.rings.push(h),this.centres.push(c),this.buttons.push(this.buildButton(a,c))}this.host.overlayLayer.add(l),l.moveToTop(),this.group=l,this.host.overlayLayer.batchDraw()}clear(){this.group?.destroy(),this.group=null,this.rings=[],this.targets=[],this.centres=[],this.signature="";for(let e of this.buttons)e.remove();this.buttons=[]}repositionButtons(){for(let e=0;e<this.buttons.length;e+=1){let t=this.buttons[e],o=this.host.worldToScreen(this.centres[e]),s=t.offsetWidth||parseFloat(t.style.width)||ii;t.style.left=`${o.x-s/2}px`,t.style.top=`${o.y-s/2}px`}}buildButton(e,t){let o=this.host.worldToScreen(t),s=typeof globalThis.matchMedia=="function"&&globalThis.matchMedia("(pointer: coarse)").matches,r=Math.max(ii,s?tc:ii),n=document.createElement("button");return n.type="button",n.className="sl-beacon",n.dataset.beacon=e.id,n.setAttribute("aria-label",ic(e.count,e.name)),Object.assign(n.style,{position:"absolute",left:`${o.x-r/2}px`,top:`${o.y-r/2}px`,width:`${r}px`,height:`${r}px`,padding:"0",margin:"0",border:"none",borderRadius:"50%",background:"transparent",cursor:"pointer",touchAction:"manipulation",zIndex:"3"}),n.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),this.host.activate(e)}),n.addEventListener("pointerdown",l=>l.stopPropagation()),this.host.container.appendChild(n),n}};function _r(i,e){let t=i.width(),o=i.height(),s=1/0,r=1/0,n=-1/0,l=-1/0;for(let a of e){let c=a.getClientRect();if(!(!(c.width>1)||!(c.height>1))){if(c.x<-8||c.y<-8||c.x+c.width>t+8||c.y+c.height>o+8)return null;c.x<s&&(s=c.x),c.y<r&&(r=c.y),c.x+c.width>n&&(n=c.x+c.width),c.y+c.height>l&&(l=c.y+c.height)}}return isFinite(s)?{x:s,y:r,width:n-s,height:l-r}:null}var Br=8,sc=.5;function Or(i,e,t){let o=t??{x:0,y:0,width:i.width(),height:i.height()},s=_r(i,e);if(!s)return 0;Fr(i,s,o);let r=Math.min((o.width-2*Br)/s.width,(o.height-2*Br)/s.height);if(!(Math.max(s.width-o.width,s.height-o.height)>sc)||!(r>0))return 1;let l=o.x+o.width/2,a=o.y+o.height/2;i.scale({x:i.scaleX()*r,y:i.scaleY()*r}),i.position({x:l+(i.x()-l)*r,y:a+(i.y()-a)*r});let c=_r(i,e);return c&&Fr(i,c,o),r}function Fr(i,e,t){let o=t.x+t.width/2-(e.x+e.width/2),s=t.y+t.height/2-(e.y+e.height/2);return o===0&&s===0?!1:(i.position({x:i.x()+o,y:i.y()+s}),!0)}function $i(i){return`${i.x()},${i.y()},${i.scaleX()}`}import{Group as rc}from"konva/lib/Group";import{Circle as Dr}from"konva/lib/shapes/Circle";import{Line as nc}from"konva/lib/shapes/Line";import{Text as ac}from"konva/lib/shapes/Text";var lc=6;function qi(i){return D(i)?"#0b1220":"#ffffff"}function Nr(i){let{points:e}=i;if(!e.length)return null;let t=i.categoryColor??"#6e7bff",o=0,s=0;for(let r of e)o+=r.x,s+=r.y;return{count:e.length,centroid:{x:o/e.length,y:s/e.length},fill:t,ink:qi(t)}}var si=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=Nr({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,t="seats"){if(this.group?.destroy(),this.group=null,this.badges=[],e>=ve){this.host.overlayLayer.batchDraw();return}let o=Math.max(this.host.stageScale(),1e-4),s=new rc({listening:!1,name:"owned-sections"}),r=new Set;for(let n of this.host.sections()){let l=this.host.ownedPoints(n),a=Nr({points:l,categoryColor:this.host.sectionColor(n)});if(!a)continue;let c=Math.max(lc/2/o,1);for(let m of l)s.add(new Dr({name:"owned-seat-dot",x:m.x,y:m.y,radius:c,fill:a.fill,stroke:_("#ffffff",.55),strokeWidth:Math.max(.5,c*.28),shadowColor:a.fill,shadowBlur:c*2.4,shadowOpacity:.7,listening:!1,perfectDrawEnabled:!1}));if(t!=="seats"||r.has(n.logicalId))continue;r.add(n.logicalId);let h=this.host.sections().filter(m=>m.logicalId===n.logicalId).reduce((m,f)=>m+this.host.ownedPoints(f).length,0),d=this.host.labelAnchor(n),u=11/o,p={x:d.x,y:d.y-u*2.1};s.add(new Dr({name:"owned-section-badge",x:p.x,y:p.y,radius:u,fill:a.fill,stroke:_(a.ink,.35),strokeWidth:1/o,listening:!1,perfectDrawEnabled:!1})),s.add(new nc({x:p.x-u*.62,y:p.y,points:[-u*.22,0,-u*.02,u*.2,u*.34,-u*.26],stroke:a.ink,strokeWidth:Math.max(.6,u*.16),lineCap:"round",lineJoin:"round",listening:!1}));let y=new ac({x:p.x+u*.12,y:p.y-u*.5,text:String(h),fontSize:u,fontStyle:"800",fontFamily:this.host.labelFont(),fill:a.ink,listening:!1,perfectDrawEnabled:!1});s.add(y),this.badges.push({id:n.logicalId,centre:p,radius:u*1.8})}if(!s.hasChildren()){s.destroy(),this.host.overlayLayer.batchDraw();return}this.host.overlayLayer.add(s),s.moveToTop(),this.group=s,this.host.overlayLayer.batchDraw()}};function K(i){let e=Jo(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,r=Math.cos(s),n=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(l=>({x:i.x+l.x*r-l.y*n,y:i.y+l.x*n+l.y*r}))}function ri(i,e,t,o,s,r){let n=o*Math.PI/180,l=Math.cos(n),a=Math.sin(n);for(let c=0;c<=4;c++)for(let h=0;h<=6;h++){let d=e*(h/6-.5),u=t*(c/4-.5),p={x:i.x+d*l-u*a,y:i.y+d*a+u*l};if(!oe(p,s,r))return!1}return!0}function Hr(i,e,t){let o=K(i),s=[t];for(let n=1;n<12;n+=1)for(let l=1;l<12;l+=1){let a={x:o.x+o.width*l/12,y:o.y+o.height*n/12};oe(a,i,e)&&s.push(a)}let r=[i,...e];return s.map(n=>({point:n,room:Bo(n,r)})).sort((n,l)=>l.room-n.room).map(n=>n.point).filter((n,l,a)=>l===a.findIndex(c=>Math.abs(c.x-n.x)<1e-6&&Math.abs(c.y-n.y)<1e-6))}function Gr(i,e){let{stageScale:t,stageX:o,stageY:s}=i;if(i.viewMode==="perspective"&&e.perspectiveAffine)return K(e.outline.map(n=>{let l=i.projectedSectionPoint(e,n);return{x:l.x*t+o,y:l.y*t+s}}));let r=e.liftWorld>0?i.isoLiftLocal(e.liftWorld):{x:0,y:0};return K(e.outline.map(n=>{let l={x:n.x+r.x,y:n.y+r.y},a=i.isoT===0?l:i.isoForward(l);return{x:a.x*t+o,y:a.y*t+s}}))}function cc(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 Wr(i){let{current:e,viewport:t}=i,o=new Map;for(let l of i.sections){let a=cc(l.bounds,t)*l.members;a<=0||o.set(l.logicalId,(o.get(l.logicalId)??0)+a)}if(!o.size)return e;let s=null,r=0;for(let[l,a]of o)a>r&&(r=a,s=l);if(!s||s===e)return e;let n=e!=null?o.get(e)??0:0;return r>n*1.35?s:e}import{Text as dc}from"konva/lib/shapes/Text";function hc(i,e){return i.x<e.x+e.width&&e.x<i.x+i.width&&i.y<e.y+e.height&&e.y<i.y+i.height}var je=class{constructor(){this.cells=new Map}insert(e){for(let t of this.keys(e)){let o=this.cells.get(t);o?o.push(e):this.cells.set(t,[e])}}collisionCount(e){let t=new Set,o=0;for(let s of this.keys(e))for(let r of this.cells.get(s)??[])t.has(r)||(t.add(r),hc(e,r)&&o++);return o}keys(e){let t=Math.floor(e.x/at),o=Math.floor((e.x+Math.max(0,e.width))/at),s=Math.floor(e.y/at),r=Math.floor((e.y+Math.max(0,e.height))/at),n=[];for(let l=s;l<=r;l++)for(let a=t;a<=o;a++)n.push(`${a}:${l}`);return n}};function Vr(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 K(y.outline.map(g=>i.projectedSectionPoint(y,g)));let m=y.liftWorld>0?i.isoLiftLocal(y.liftWorld):{x:0,y:0},f=y.outline.map(g=>{let b={x:g.x+m.x,y:g.y+m.y};return i.isoT===0?b:i.isoForward(b)});return K(f)});if(!o.length)return null;let s=Math.min(...o.map(y=>y.x)),r=Math.min(...o.map(y=>y.y)),n=Math.max(...o.map(y=>y.x+y.width)),l=Math.max(...o.map(y=>y.y+y.height)),a=new Set(t.flatMap(y=>y.memberIds));for(let y of a){let m=i.seatById.get(y);if(!m)continue;let f=i.renderedSeatPoint(m);s=Math.min(s,f.x-i.seatR),r=Math.min(r,f.y-i.seatR),n=Math.max(n,f.x+i.seatR),l=Math.max(l,f.y+i.seatR)}let c=y=>{[y.x,y.y,y.width,y.height].every(Number.isFinite)&&(s=Math.min(s,y.x),r=Math.min(r,y.y),n=Math.max(n,y.x+y.width),l=Math.max(l,y.y+y.height))},h=y=>{let m={x:y.x+y.width/2,y:y.y+y.height/2};return t.some(f=>oe(m,f.outline,f.holes))};for(let{node:y,backdrop:m}of i.freeTextById.values()){let f=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});h(f)&&(c(f),m&&c(m.getClientRect({relativeTo:i.bgLayer,skipShadow:!0})))}for(let{node:y}of i.iconNodeById.values()){let m=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0});h(m)&&c(m)}let d=new je;for(let{node:y}of i.freeTextById.values()){let m=y.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});d.insert({x:m.x-j,y:m.y-j,width:m.width+j*2,height:m.height+j*2})}for(let y of i.rowLabelPlan){let m=(y.focusKeys??[]).some(S=>S===e||t.some(v=>S===v.id||S===v.logicalId)),f=new dc({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 g=i.resolveAutomaticRowLabelPosition(f,y,d),b=i.rowLabelBox(f,g);m&&c(b),d.insert(b),f.destroy()}let u=Math.max(n-s,l-r),p=Math.max(i.seatR*2,Math.min(24,u*.025));return{x:s-p,y:r-p,width:Math.max(1,n-s+p*2),height:Math.max(1,l-r+p*2)}}import{Rect as uc}from"konva/lib/shapes/Rect";import{Text as Kr}from"konva/lib/shapes/Text";var Zi="\0";function pc(i){let t=[...G("map.fromPrice",{price:Zi}).toLocaleLowerCase()],o=t.findIndex(s=>s!==Zi&&s.toLocaleUpperCase()!==s.toLocaleLowerCase());return o>=0&&(t[o]=t[o].toLocaleUpperCase()),t.join("").split(Zi).join(i)}function zr(i,e){if(!e.zones?.length||!i.sections.length)return;let t=ar(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 r=o.get(s.id);if(!r||!r.length)continue;let n=r[0];for(let f of r)f.centroid.y<n.centroid.y&&(n=f);let l=n.centroid.x,a=n.centroid.y,c=1/0,h=-1/0;for(let f of r)for(let g of f.outline)g.x<c&&(c=g.x),g.x>h&&(h=g.x);let d=isFinite(c)&&h>c?h-c:0,u=1/0;for(let f of r)for(let g of f.memberIds){let b=i.seatById.get(g),S=b&&i.catPrice.get(b.categoryKey);typeof S=="number"&&S<u&&(u=S)}let p=new uc({x:l,y:a,width:1,height:1,offsetX:.5,offsetY:.5,cornerRadius:1,fill:t.plate,stroke:_(s.color??n.outlineTint,Vs),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(p);let y=new Kr({x:l,y:a,text:s.label,fontSize:zt,fontStyle:Fs,letterSpacing:0,fontFamily:i.labelFont(),fill:t.ink,opacity:0,listening:!1,perfectDrawEnabled:!1});y.offsetX(y.width()/2),y.offsetY(y.height()/2),i.bgLayer.add(y);let m=null;isFinite(u)&&(m=new Kr({x:l,y:a,text:pc(ut(u,i.currency)),fontSize:Xt,fontStyle:Os,fontFamily:i.labelFont(),fill:t.subInk,opacity:0,listening:!1,perfectDrawEnabled:!1}),m.offsetX(m.width()/2),i.bgLayer.add(m)),i.zones.push({id:s.id,anchor:{x:l,y:a},back:p,background:t.plate,name:s.label,spanWorld:d,label:y,sub:m})}}import{Circle as vc}from"konva/lib/shapes/Circle";import{Line as wc}from"konva/lib/shapes/Line";import{Rect as kc}from"konva/lib/shapes/Rect";import{Text as Lc}from"konva/lib/shapes/Text";function we(i,e){return e.length===0?!!i.accessible:!!i.accessibility?.some(t=>e.includes(t))}function Qe(i,e){return we(i,e)?"match":i.accessibility?.includes("companion")?"companion":"other"}var Xr=.35,Yr=.7,ft="#0b1220",mt="#ffffff",Ur="#0b1220",$r="#232c40",qr="#8b93a7";function ji(i,e,t="normal"){let o=i?"bold":t;return e?`italic ${o}`.trim():o}var Qi="#f7f8fb";import{Shape as mc}from"konva/lib/Shape";import{Circle as yc}from"konva/lib/shapes/Circle";import{Rect as gc}from"konva/lib/shapes/Rect";var fc={M:2,L:2,Q:4,C:6,Z:0},Ji=new Map;function eo(i){let e=Ji.get(i);if(e)return e;let t=Nt(i);if(!t)return Ji.set(i,[]),[];let o=t.match(/[MLQCZ]|-?(?:\d+(?:\.\d+)?|\.\d+)/g)??[],s=[],r=0;for(;r<o.length;){let n=o[r++],l=fc[n];if(l===void 0||r+l>o.length)throw new Error(`Invalid path data for seat glyph "${i}".`);let a=o.slice(r,r+l).map(Number);if(a.some(c=>!Number.isFinite(c)))throw new Error(`Invalid coordinate in seat glyph "${i}".`);r+=l,n==="M"||n==="L"?s.push({command:n,points:a}):n==="Q"?s.push({command:n,points:a}):n==="C"?s.push({command:n,points:a}):s.push({command:"Z",points:[]})}return Ji.set(i,s),s}function Zr(i,e,t,o=0,s=0){let r=eo(e),n=es(e).bounds;if(!r.length||!n||!(t>0))return!1;let l=ts(n,t);i.save(),i.translate(o,s),i.scale(l.scale,l.scale),i.translate(-l.centreX,-l.centreY);for(let a of r)a.command==="M"?i.moveTo(a.points[0],a.points[1]):a.command==="L"?i.lineTo(a.points[0],a.points[1]):a.command==="Q"?i.quadraticCurveTo(a.points[0],a.points[1],a.points[2],a.points[3]):a.command==="C"?i.bezierCurveTo(a.points[0],a.points[1],a.points[2],a.points[3],a.points[4],a.points[5]):i.closePath();return i.restore(),!0}function jr(i,e){i.beginPath(),i.arc(0,0,e,0,Math.PI*2,!1),i.closePath()}var yt=class extends mc{_sceneFunc(e){let t=this.attrs.seatRadius||1,o=this.attrs.seatGlyph,s=eo(o),r=this.attrs.seatGlyphDetail,n;if(r===void 0){let l=this.getAbsoluteScale(),a=Math.max(Math.abs(l.x),Math.abs(l.y)),c=Number.isFinite(a)&&a>0?a:1;n=t*2*c>=16}else n=r;if(!s.length||!n){jr(e,t),e.fillStrokeShape(this);return}e.beginPath(),Zr(e,o,t),e.fillStrokeShape(this)}_hitFunc(e){jr(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 bc(i,e){return i==="circle"||!Nt(i)?null:new yt({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 Qr(i){let{x:e,y:t,radius:o}=i;return i.wheelchairBay?new gc({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}):bc(i.glyph,{x:e,y:t,radius:o,detail:i.detail,fill:i.fill})??new yc({x:e,y:t,radius:o,...i.fill?{fill:i.fill}:{},perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0})}function Sc(i,e){return i*2*e>=16}function Jr(i,e,t,o){let s=Sc(e,t);if(s===o||!i.length)return s;for(let r of i)r.setAttr("seatGlyphDetail",s);return s}function en(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"){Tc(i,t);continue}let o=i.seatContainer(t.id),s=Qr({x:t.x,y:t.y,radius:i.seatR,detail:i.seatGlyphDetail,glyph:is(t.glyph,i.catByKey.get(t.categoryKey)),wheelchairBay:t.wheelchairSpaceType==="no-seat"});if(s instanceof yt&&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 r=new vc({x:t.x,y:t.y,radius:i.seatR+1.5,stroke:Ct(t.accessibility),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});i.accessRingById.set(t.id,r),o.add(r)}if(t.accessibility?.includes("wheelchair")&&Bt(t.accessibility)){let r=i.buildAccessGlyph(t,typeof s.fill()=="string"?s.fill():"");i.accessGlyphById.set(t.id,r),o.add(r)}}}}function Tc(i,e){let t=i.seatContainer(e.id),o=i.boothDims.get(e.rowId)??{width:40,height:30,rotation:0},s=e.x,r=e.y,n;o.points&&o.points.length>=3?(n=new wc({x:e.x,y:e.y,points:o.points.flatMap(a=>[a.x,a.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),s=e.x+o.points.reduce((a,c)=>a+c.x,0)/o.points.length,r=e.y+o.points.reduce((a,c)=>a+c.y,0)/o.points.length):n=new kc({x:e.x,y:e.y,width:o.width,height:o.height,offsetX:o.width/2,offsetY:o.height/2,rotation:o.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),n.setAttr("seatId",e.id),i.circleById.set(e.id,n),t.add(n);let l=new Lc({x:s,y:r,text:e.displayLabel??e.label,fontSize:Me,fontStyle:"600",fontFamily:i.labelFont(),fill:i.theme.seatLabelColor??ft,listening:!1,perfectDrawEnabled:!1});l.offsetX(l.width()/2),l.offsetY(l.height()/2),l.visible(!1),i.setHasBoothText(),i.boothLabelById.set(e.id,l),t.add(l),i.paintSeat(n,e.id)}function tn(i,e,t,o){let s=null,r=1/0,n=i.stage.scaleX()||1;for(let l of i.seats){if(!o?.includeUnavailable&&!i.selection.has(l.id)&&!i.isSelectable(l.id))continue;let a=i.worldToScreen(l),c=i.viewMode==="perspective"?i.perspectiveSeatScale.get(l.id)??1:1,h=i.seatR*n*c+t,d=Math.hypot(a.x-e.x,a.y-e.y);d<=h&&d<r&&(r=d,s=l.id)}return s}function on(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 r of i.seats){let n=i.renderedSeatPoint(r),l=n.x-t.x,a=n.y-t.y,c=l*l+a*a;c<s&&(s=c,o=r.rowId)}return o?i.objectFloor.get(o)??null:null}import{Circle as Oc}from"konva/lib/shapes/Circle";import{Group as wn}from"konva/lib/Group";import{Rect as Dc}from"konva/lib/shapes/Rect";import{Text as Nc}from"konva/lib/shapes/Text";var ke=1.12;function Je(i,e,t,o){if(e.width<=0||e.height<=0)return i.scaleX();let s=o??{x:0,y:0,width:i.width(),height:i.height()},r=Math.min(s.width/(e.width*ke),s.height/(e.height*ke));return V(r,t.min,t.max)}function sn(i){let{stage:e,box:t,bounds:o,viewport:s,centreScreen:r}=i,n=i.ratio??ht,l=e.scaleX(),a=Je(e,t,o,s)/Math.max(l,1e-4);if(a>=n||a<=1/n)return!1;let c=r.x-(s.x+s.width/2),h=r.y-(s.y+s.height/2);return Math.hypot(c,h)<=Math.min(s.width,s.height)*.02}function rn(i,e,t,o){let s=V(e,o.min,o.max),r=i.scaleX();if(s===r)return!1;let n=(t.x-i.x())/r,l=(t.y-i.y())/r;return i.scale({x:s,y:s}),i.position({x:t.x-n*s,y:t.y-l*s}),!0}function nn(i,e,t,o,s){let r=s??{x:0,y:0,width:i.width(),height:i.height()},n=Math.min(r.width/(e.width*ke),r.height/(e.height*ke)),l=V(Math.max(n,o??t.min),t.min,t.max);i.scale({x:l,y:l}),i.position({x:r.x+r.width/2-(e.x+e.width/2)*l,y:r.y+r.height/2-(e.y+e.height/2)*l})}function an(i,e){return i===null||e===null?i===e:i.size===e.size&&[...i].every(t=>e.has(t))}function ln(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 cn(i,e){if(!e?.size)return!1;for(let t of i)if(e.has(t))return!1;return!0}function pn(i,e){let t=i.sectionHeat.get(e.id)??i.sectionHeat.get(e.logicalId)??(e.zone?i.sectionHeat.get(e.zone):void 0);if(t==null||t<=0){e.outlinePoly.stroke(_(e.outlineTint,.5)),e.outlinePoly.fill(_(e.outlineTint,.08)),e.outlinePoly.strokeWidth(1.75),e.outlinePoly.shadowOpacity(0);return}let o=ne("#f4b740","#ef4444",t);e.outlinePoly.stroke(_(o,.72+t*.25)),e.outlinePoly.fill(_(o,.08+t*.13)),e.outlinePoly.strokeWidth(2+t*3.5),e.outlinePoly.shadowColor(o),e.outlinePoly.shadowBlur(4+t*12),e.outlinePoly.shadowOpacity(.25+t*.45)}function io(i,e){return i.closedSections.has(e.id)||i.closedSections.has(e.logicalId)||e.zone!=null&&i.closedSections.has(e.zone)}function fn(i,e,t,o){if(!e)return 0;let s=0;for(let r of i){if(t(r)!=="free")continue;let n=o(r);n&&we(n,e)&&(s+=1)}return s}function mn(i,e){return io(i,e)?"closed":e.total<=0?"normal":e.free<=0?"sold-out":e.free<=e.total*Zs?"nearly-gone":"normal"}function yn(i,e){let t=mn(i,e),o=i.accessFilterActive&&i.sectionAccessibleFree(e)<=0,s=rr(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"?G("map.soldOut"):G("map.seatsLeft",{count:e.free})),e.subLabel.offsetX(e.subLabel.width()/2)}function oo(i,e){return ne(e,D(i)?"#ffffff":"#000000",$s)}function so(i,e,t=0){let o=Us-t;return!e||i.length<=o?i:`${i.slice(0,Math.max(1,o-1)).trimEnd()}\u2026`}function xc(i,e){return i.accessFilterActive&&i.sectionAccessibleFree(e)>0}function Cc(i,e,t){let o=xc(i,e),s=so(e.label,t,o?2:0),r=o?`\u267F ${s}`:s;e.nameLabel.text()!==r&&e.nameLabel.text(r),e.nameLabel.fontStyle(t?Yt:Fe),e.nameLabel.letterSpacing(t?e.nameLabel.fontSize()*Oe:0)}function Ic(i,e,t){let o=i.stageWidth<de,s=e.nameLabel.opacity();if(!o||s<=.05||!e.nameLabel.visible()){e.namePlate.opacity(0),e.subLabel.opacity(0);return}let r=e.nameLabel.rotation(),n=r===0&&mn(i,e)==="sold-out",l=ct/t,a=$t/t,c=n?2/t:0,h={x:e.nameLabel.x(),y:e.nameLabel.y()},d=e.nameLabel.height(),u=0;n?(Ce(e.subLabel,he/t,h.y),u=e.subLabel.height(),e.subLabel.rotation(0),e.subLabel.x(h.x),e.subLabel.y(h.y+d/2+c+u/2),e.subLabel.opacity(s)):e.subLabel.opacity(0);let p=n?c+u:0,y=Math.max(e.nameLabel.width(),n?e.subLabel.width():0)+l*2,m=d+p+a*2;e.namePlate.position({x:h.x,y:h.y+p/2}),e.namePlate.rotation(r),e.namePlate.size({width:y,height:m}),e.namePlate.offset({x:y/2,y:m/2}),e.namePlate.cornerRadius(qs/t),e.namePlate.opacity(s*Ut)}function gn(i,e){let t,o;i.reducedMotion?(t=e<=Se?1:0,o=e<=Xe?1:0):(t=V((ve-e)/(ve-Se),0,1),o=V((Se-e)/(Se-Xe),0,1)),(i.floorOverview||i.focusedSectionId)&&(t=0,o=0);let s=!i.floorOverview&&!i.focusedSectionId&&e<le;s&&(t=1),i.zones.length||(o=0);let r=i.viewMode==="perspective"&&i.glideInProgress&&i.seatCount>2500;i.seatLayer.opacity(s||r?0:1-t);let n=i.stageScaleX,l=!i.glideInProgress&&(i.lodScale===0||Math.abs(e-i.lodScale)/(i.lodScale||1)>.08);l&&i.setLodScale(e);let a=i.focusedSectionId,c=i.stageWidth<de,h=te(i.canvasBackground),d=V((t-.2)/.8,0,1);for(let p of i.sections){let y=i.hasFocusDimOverlay?1:a&&p.id!==a&&p.logicalId!==a&&p.zone!==a?De:1,m=Math.min(y,cn(p.memberCategoryKeys,i.categoryFilter)?De:1);p.outlinePoly.opacity(s?0:(1-t)*m),p.blockPoly.opacity(Es*t*m);let f=i.sectionIsOwned(p);p.blockPoly.stroke(f?i.selectionColor:p.shellStroke||h.sectionStroke),p.blockPoly.strokeWidth((f?_s:Be)/Math.max(n,1e-4));let g=p.blockPoly.fill(),b=typeof g=="string"?g:p.baseFill,S=c?oo(i.canvasBackground,b):null;S&&p.namePlate.fill(S);let v=$(S??b,p.preferredInk);p.nameLabel.fill(v),p.subLabel.fill(v),Cc(i,p,c),l&&d>.01&&Rc(i,p,n),p.nameLabel.opacity(p.nameLabelFits?d*(1-o)*m:0),p.subLabel.opacity(0)}let u=o*(1-i.isoT);for(let p of i.zones){let y=p.label.visible()?u:0;p.back.opacity(y),p.label.opacity(y),p.sub&&p.sub.opacity(hn(i,p)?0:y),l&&Ac(i,p,n)}if(!i.glideInProgress&&(d>.01||u>.01)){Mc(i,n),Pc(i.sections);for(let p of i.zones){let y=p.label.opacity();p.back.opacity(y),p.sub&&p.sub.opacity(hn(i,p)?0:y)}}for(let p of i.sections)Ic(i,p,n);i.bgLayer.batchDraw()}function hn(i,e){return i.stageWidth<de||!e.sub||!e.sub.visible()}function Pc(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,r)=>{let n=K(s.outline),l=K(r.outline);return l.width*l.height-n.width*n.height});for(let s of o.slice(1))s.nameLabel.opacity(0)}}function Mc(i,e){let o=[],s=a=>{let c=i.worldToScreen({x:a.x(),y:a.y()}),h=K(Ze({x:0,y:0},a.width()*e,a.height()*e,a.rotation()));return{x:c.x-h.width/2,y:c.y-h.height/2,w:h.width,h:h.height}};for(let a of i.zones){if(a.label.opacity()<=.05)continue;let c=a.back.getAbsolutePosition(),h=a.back.width()*e,d=a.back.height()*e;o.push({node:a.label,tier:0,section:!1,zone:a,box:{x:c.x-h/2,y:c.y-d/2,w:h,h:d}})}for(let a of i.sections)a.nameLabel.opacity()>.05&&o.push({node:a.nameLabel,tier:1,section:!0,area:a.labelArea,box:s(a.nameLabel)});let r=i.landmarks.map(a=>{let c=i.worldToScreen({x:a.x,y:a.y}),h=i.worldToScreen({x:a.x+a.width,y:a.y+a.height});return{x:Math.min(c.x,h.x),y:Math.min(c.y,h.y),w:Math.abs(h.x-c.x),h:Math.abs(h.y-c.y)}});if(o.length<2&&!r.length)return;o.sort((a,c)=>a.tier-c.tier||(c.area??0)-(a.area??0)||a.box.y-c.box.y||a.box.x-c.box.x);let n=[...r],l=a=>n.some(c=>a.x<c.x+c.w+4&&c.x<a.x+a.w+4&&a.y<c.y+c.h+4&&c.y<a.y+a.h+4);for(let a of o){if(!l(a.box)){n.push(a.box);continue}let c=!1;if(a.zone)for(let h of Xs){if(h===0)continue;let d={...a.box,y:a.box.y+h};if(!l(d)){to(a.zone,0,h/e),n.push(d),c=!0;break}}if(a.section){let h=a.node.fontSize(),d=a.node.y(),u=a.node.letterSpacing()>0;for(let p of Oi){let y=h*p;if(y*e<he)break;Ce(a.node,y,d),u&&(a.node.letterSpacing(a.node.fontSize()*Oe),a.node.offsetX(a.node.width()/2));let m=s(a.node);if(!l(m)){n.push(m),c=!0;break}}c||(Ce(a.node,h,d),u&&(a.node.letterSpacing(a.node.fontSize()*Oe),a.node.offsetX(a.node.width()/2)))}c||a.node.opacity(0)}}function Ce(i,e,t){i.fontSize(Math.max(1,e)),i.offsetX(i.width()/2),i.offsetY(i.height()/2),i.y(t)}function Rc(i,e,t){e.subLabelFits=!1;let o=i.stageWidth<de,s=o?ct*2:0,r=Ue(Ye*e.labelScale,i.stageWidth),n=he;for(let l=r;l>=n;l-=1)for(let a of[0,-90]){e.nameLabel.rotation(a),Ce(e.nameLabel,l/t,e.nameLabel.y()),o&&(e.nameLabel.letterSpacing(e.nameLabel.fontSize()*Oe),e.nameLabel.offsetX(e.nameLabel.width()/2));for(let c of e.labelAnchors){e.nameLabel.position(c);let h=(8+s)/t;if(ri(c,e.nameLabel.width()+h,e.nameLabel.height()+h,a,e.outline,e.holes)){e.nameLabelFits=!0;return}}}e.nameLabel.position(e.centroid),e.nameLabel.rotation(0),e.nameLabelFits=!1}function dn(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 Ac(i,e,t){let o=Di(i.stageWidth),s=i.stageWidth<de,r=e.sub!=null&&!s,n=(s?Ds:Hs)*o/t,l=(s?Ns:Gs)*o/t,a=Ue(zt,i.stageWidth);e.label.text(e.name),Ce(e.label,a/t,e.anchor.y),r&&(Ce(e.sub,Ue(Xt,i.stageWidth)/t,e.anchor.y),e.sub.letterSpacing(e.sub.fontSize()*Bs),e.sub.offsetX(e.sub.width()/2));let c=s?i.stageWidth*Ks/t-n*2:1/0,h=!s&&e.spanWorld>0?e.spanWorld*zs-n*2:1/0,d=Math.min(c,h),u=()=>Math.max(e.label.width(),r?e.sub.width():0);if(r&&u()>d&&(r=!1),u()>d)for(let L of Oi){let x=Math.max(he,a*L);if(x>=e.label.fontSize()*t-.001||(Ce(e.label,x/t,e.anchor.y),e.label.width()<=d))break}if(e.label.width()>d&&(dn(e.label,e.name,Math.max(d,1)),Ec(e.label.text())<_c(e.name)&&dn(e.label,e.name,Math.max(c,1)),Ce(e.label,e.label.fontSize(),e.anchor.y)),e.sub&&e.sub.visible(r),c<=0||e.label.width()>c+.001){un(e);return}e.label.visible(!0),e.back.visible(!0);let p=r?3*o/t:0;e.label.x(e.anchor.x),r?e.sub.x(e.anchor.x):e.sub&&e.sub.opacity(0);let y=Math.max(e.label.width(),r?e.sub.width():0)+n*2,m=e.label.height()+(r?p+e.sub.height():0)+l*2;e.label.y(e.anchor.y-(r?(p+e.sub.height())/2:0)),r&&e.sub.y(e.anchor.y+(e.label.height()+p)/2),e.back.position(e.anchor),e.back.size({width:y,height:m}),e.back.offset({x:y/2,y:m/2}),e.back.cornerRadius(Ws*o/t),e.back.strokeWidth(1/t);let f=e.back.getAbsolutePosition(),g=6,b=y*t;if(b>i.stageWidth-g*2){un(e);return}let S=b/2,w=(V(f.x,g+S,i.stageWidth-g-S)-f.x)/t;Math.abs(w)>.001&&to(e,w,0);let k=62+m*t/2;f.y<k&&to(e,0,(k-f.y)/t)}function Ec(i){return i.endsWith("\u2026")?i.slice(0,-1).trimEnd().length:i.length}function _c(i){return Math.min(i.length,Math.max(6,Math.ceil(i.length/2)))}function un(i){i.label.visible(!1),i.label.opacity(0),i.back.visible(!1),i.back.opacity(0),i.sub&&(i.sub.visible(!1),i.sub.opacity(0))}function to(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 Bc(i,e){if(!i.length)return null;let t=1/0,o=1/0,s=-1/0,r=-1/0;for(let n of i)!Number.isFinite(n.x)||!Number.isFinite(n.y)||(n.x<t&&(t=n.x),n.y<o&&(o=n.y),n.x>s&&(s=n.x),n.y>r&&(r=n.y));return!Number.isFinite(t)||!Number.isFinite(o)?null:{x:t-e,y:o-e,width:s-t+e*2,height:r-o+e*2}}function ao(i,e=0){let t=new Map;for(let s of i){let r=`${s.rowId}|${s.categoryKey}`,n=t.get(r);n||(n={categoryKey:s.categoryKey,points:[]},t.set(r,n)),n.points.push({x:s.x,y:s.y})}let o=[];for(let[s,r]of t){let n=Bc(r.points,e);n&&o.push({id:s,categoryKey:r.categoryKey,seatCount:r.points.length,bounds:n})}return o}function ro(i,e){let t=Math.max(0,Math.max(i.x-(e.x+e.width),e.x-(i.x+i.width))),o=Math.max(0,Math.max(i.y-(e.y+e.height),e.y-(i.y+i.height)));return Math.hypot(t,o)}function no(i,e){let t=Math.min(i.x,e.x),o=Math.min(i.y,e.y);return{x:t,y:o,width:Math.max(i.x+i.width,e.x+e.width)-t,height:Math.max(i.y+i.height,e.y+e.height)-o}}function bn(i){if(!i.length)return 0;let e=[...i].sort((o,s)=>o-s),t=Math.floor(e.length/2);return e.length%2?e[t]:(e[t-1]+e[t])/2}function Fc(i){if(!i.length)return 0;let e=bn(i.map(o=>Math.min(o.bounds.width,o.bounds.height)));if(i.length<2)return e;let t=[];for(let o=0;o<i.length;o+=1){let s=1/0;for(let r=0;r<i.length;r+=1)o!==r&&(s=Math.min(s,ro(i[o].bounds,i[r].bounds)));Number.isFinite(s)&&t.push(s)}return bn(t)+e}function lo(i,e){if(!i.length)return[];let t=Fc(i)*(e?.gapRows??2),o=e?.minRows??2,s=e?.minSeats??12,r=new Map;for(let l of i){let a=r.get(l.categoryKey);a?a.push(l):r.set(l.categoryKey,[l])}let n=[];for(let[l,a]of r){let c=[...a].sort((u,p)=>u.bounds.y-p.bounds.y||u.bounds.x-p.bounds.x||u.id.localeCompare(p.id)),h=[];for(let u of c){let p=h.find(y=>ro(y.bounds,u.bounds)<=t);p?(p.bounds=no(p.bounds,u.bounds),p.rowIds.push(u.id),p.seatCount+=u.seatCount):h.push({categoryKey:l,bounds:{...u.bounds},rowIds:[u.id],seatCount:u.seatCount})}let d=!0;for(;d&&h.length>1;){d=!1;e:for(let u=0;u<h.length;u+=1)for(let p=u+1;p<h.length;p+=1)if(!(ro(h[u].bounds,h[p].bounds)>t)){h[u].bounds=no(h[u].bounds,h[p].bounds),h[u].rowIds.push(...h[p].rowIds),h[u].seatCount+=h[p].seatCount,h.splice(p,1),d=!0;break e}}for(let u of h)u.rowIds.length<o&&u.seatCount<s||(u.rowIds.sort(),n.push(u))}return n.sort((l,a)=>l.bounds.y-a.bounds.y||l.bounds.x-a.bounds.x||l.categoryKey.localeCompare(a.categoryKey)),n}function Sn(i){let e=null;for(let t of i)e=e?no(e,t.bounds):{...t.bounds};return e}function vn(i,e){let t=null,o=1/0;for(let s of i){let{x:r,y:n,width:l,height:a}=s.bounds;if(e.x<r||e.x>r+l||e.y<n||e.y>n+a)continue;let c=l*a;c<o&&(t=s,o=c)}return t}function Tn(i){return i*.3}function kn(i){return Tn(i)*2+i*.42}var ni=class{constructor(e){this.host=e;this.group=null;this.labels=[];this.revealed=!1;this.visible=!1;this.fadeRaf=0;this.lastFontKey=""}get all(){return this.labels.map(e=>e.cluster)}clear(){this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),this.group?.destroy(),this.group=null,this.labels=[],this.visible=!1,this.revealed=!1,this.lastFontKey=""}destroy(){this.clear()}rebuild(){if(this.clear(),this.syncCursor(!1),this.host.hasSections()||this.host.exportMode)return;let e=lo(ao(this.host.seats(),this.host.seatR()));if(!e.length)return;let t=this.host.canvasBackground(),o=te(t),s=oo(t,t),r=$(s,o.sectionInk),n=new wn({listening:!1,opacity:0,visible:!1});for(let l of e){let a=this.host.categoryLabel(l.categoryKey);if(!a)continue;let c={x:l.bounds.x+l.bounds.width/2,y:l.bounds.y+l.bounds.height/2},h=new wn({listening:!1}),d=new Dc({...c,width:0,height:0,fill:s,stroke:o.sectionStroke,strokeWidth:Be,opacity:Ut,listening:!1,perfectDrawEnabled:!1}),u=new Oc({...c,radius:0,fill:this.host.categoryColor(l.categoryKey),listening:!1,perfectDrawEnabled:!1}),p=this.host.categoryPriceLabel(l.categoryKey),y=new Nc({...c,text:a,fontSize:Ye,fontStyle:Fe,fontFamily:this.host.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});h.add(d),h.add(u),h.add(y),n.add(h),this.labels.push({cluster:l,pill:h,plate:d,swatch:u,text:y,label:a,price:p})}if(!this.labels.length){n.destroy();return}this.group=n,this.host.labelLayer.add(n)}syncForCamera(e){if(!this.group||!this.labels.length)return!1;let t=this.host.seatR()*2,o=this.host.exportMode||this.host.viewMode()!=="flat"||this.host.seatsPickable()&&e<_e;return this.revealed=o||ws(_i(t,e),_i(t,_e),this.revealed),!this.revealed&&this.size(this.host.stage.scaleX(),this.host.stage.width())&&this.host.labelLayer.batchDraw(),this.applyFilterDim(),this.applyVisibility(!this.revealed),!0}focusCluster(e){if(this.host.viewMode()!=="flat"||this.host.hasSections()||this.host.seatsPickable())return!1;let t=this.clusterAt(this.host.screenToWorld(e));if(!t)return!1;let o=this.host.seatR()*2,s={x:t.bounds.x-o,y:t.bounds.y-o,width:t.bounds.width+o*2,height:t.bounds.height+o*2},r=this.host.stage;if(Je(r,s,this.host.zoomBounds(),this.host.framingViewport())<=r.scaleX()*ht)return!1;let l=this.diveTarget(s);return l?(this.host.focusRegion(l,{durationMs:this.host.cameraGlideMs()}),!0):!1}diveTarget(e,t){let o=this.host.stage,s=this.host.framingViewport(),r=this.host.zoomBounds(),n=Je(o,e,r,s),l=Math.min(Math.max(this.host.readableScale(),this.host.pickableScale()),r.max);if(n>=l)return e;let a=s.width/(l*ke),c=s.height/(l*ke);if(!(a>0)||!(c>0))return null;let h=t??{x:e.x+e.width/2,y:e.y+e.height/2};return{x:h.x-a/2,y:h.y-c/2,width:a,height:c}}glideTowardTap(e){if(this.host.viewMode()!=="flat")return!1;let t=this.host.stage.scaleX(),o=Qs(t,this.host.pickableScale());if(o==null||o<=t*ht)return!1;let s=this.host.screenToWorld(e),r=this.host.framingViewport(),n=r.width/(o*ke),l=r.height/(o*ke);return!(n>0)||!(l>0)?!1:(this.host.focusRegion({x:s.x-n/2,y:s.y-l/2,width:n,height:l}),!0)}syncCursor(e){if(this.host.exportMode)return;let t=this.host.viewMode()==="flat"&&!this.host.seatsPickable()?"zoom-in":e?"pointer":"default";for(let o of[this.host.stage.container(),this.host.stage.content])o&&o.style.cursor!==t&&(o.style.cursor=t)}clusterAt(e){let t=vn(this.all,e);if(t)return t;if(!this.visible)return null;for(let o of this.labels){let s=o.plate.width()/2,r=o.plate.height()/2;if(Math.abs(e.x-o.text.x())<=s&&Math.abs(e.y-o.text.y())<=r)return o.cluster}return null}size(e,t){let o=Math.max(e,1e-4),s=t<de,r=`${o.toFixed(4)}|${t}`;if(r===this.lastFontKey)return!1;this.lastFontKey=r;let n=Ue(Ye,t),l=ct/o,a=$t/o;for(let c of this.labels){let{text:h,plate:d,swatch:u,cluster:p}=c,y=so(c.label,s);h.text(c.price?`${y} \xB7 ${c.price}`:y),h.fontStyle(s?Yt:Fe);let m=n,f=0;for(;h.fontSize(Math.max(1,m/o)),h.letterSpacing(h.fontSize()*Oe),f=kn(h.fontSize())+h.width()+l*2,!(f<=p.bounds.width||m<=he);)m=Math.max(he,m-1);let g={x:p.bounds.x+p.bounds.width/2,y:p.bounds.y+p.bounds.height/2},b=h.height()+a*2,S=f-l*2,v=g.x-S/2;u.radius(Tn(h.fontSize())),u.position({x:v+u.radius(),y:g.y}),h.offsetX(0),h.offsetY(h.height()/2),h.position({x:v+kn(h.fontSize()),y:g.y}),d.size({width:f,height:b}),d.offset({x:f/2,y:b/2}),d.cornerRadius(b/2),d.strokeWidth(Be/o),d.position(g)}return!0}applyFilterDim(){if(!this.labels.length)return;let e=this.host.categoryFilter(),t=!1;for(let o of this.labels){let s=e&&!e.has(o.cluster.categoryKey)?.22:1;o.pill.opacity()!==s&&(o.pill.opacity(s),t=!0)}t&&this.host.labelLayer.batchDraw()}boundsForSeats(e,t){if(!e.length)return null;let o=ao(e,this.host.seatR()),s=lo(o);s.length||(s=o.map(l=>({categoryKey:l.categoryKey,bounds:l.bounds,rowIds:[l.id],seatCount:l.seatCount})));let r=Sn(s);if(!r)return null;let n=s.reduce((l,a)=>a.seatCount>l.seatCount?a:l,s[0]);return{bounds:{x:r.x-t,y:r.y-t,width:r.width+t*2,height:r.height+t*2},anchor:{x:n.bounds.x+n.bounds.width/2,y:n.bounds.y+n.bounds.height/2}}}applyVisibility(e){let t=this.group;if(!t||e===this.visible)return;if(this.visible=e,this.fadeRaf&&(cancelAnimationFrame(this.fadeRaf),this.fadeRaf=0),t.visible(!0),this.host.reducedMotion()){t.opacity(e?1:0),t.visible(e),this.host.labelLayer.batchDraw();return}let o=t.opacity(),s=e?1:0,r=performance.now(),n=l=>{if(this.host.destroyed()||!this.group){this.fadeRaf=0;return}let a=Math.min(1,(l-r)/90);t.opacity(o+(s-o)*a),a>=1&&t.visible(s>0),this.host.labelLayer.batchDraw(),this.fadeRaf=a<1?requestAnimationFrame(n):0};this.fadeRaf=requestAnimationFrame(n)}};import{Circle as Hc}from"konva/lib/shapes/Circle";import{Line as Gc}from"konva/lib/shapes/Line";function xn(i,e,t,o){let s=i.seatRadius(),r=new Hc({x:t.x,y:t.y,radius:s,stroke:o,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),n=i.viewMode()==="perspective"?i.perspectiveSeatScale(e):1;r.scale({x:n,y:n}),i.overlayLayer.add(r);let l=performance.now(),a=620,c=h=>{if(!r.getLayer())return;let d=Math.min(1,(h-l)/a);r.radius(s*(1+d*1.8)),r.opacity(.9*(1-d)),i.overlayLayer.batchDraw(),d<1?requestAnimationFrame(c):(r.destroy(),i.overlayLayer.batchDraw())};requestAnimationFrame(c)}function Cn(i,e,t){for(let o of e){let s=i.viewMode()==="perspective"&&o.perspectiveAffine?o.outline.map(d=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,d))):o.outline.map(d=>{let u=o.liftWorld>0?i.isoLiftLocal(o.liftWorld):{x:0,y:0};return{x:d.x+u.x,y:d.y+u.y}}),r=s.reduce((d,u)=>({x:d.x+u.x,y:d.y+u.y}),{x:0,y:0});r.x/=s.length,r.y/=s.length;let n=new Gc({x:r.x,y:r.y,points:s.flatMap(d=>[d.x-r.x,d.y-r.y]),closed:!0,stroke:t,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:t,shadowBlur:14,shadowOpacity:.7});i.overlayLayer.add(n),i.overlayLayer.batchDraw();let l=()=>{n.getLayer()&&(n.destroy(),i.overlayLayer.batchDraw())};if(i.reducedMotion()||typeof document<"u"&&document.hidden){setTimeout(l,520);continue}let a=performance.now(),c=820,h=d=>{if(i.isDestroyed()||!n.getLayer())return;let u=Math.min(1,(d-a)/c),y=1+(1-Math.pow(1-u,3))*.04;n.scale({x:y,y}),n.opacity(.92*(1-u)),i.overlayLayer.batchDraw(),u<1?requestAnimationFrame(h):l()};requestAnimationFrame(h)}}import{Group as zc}from"konva/lib/Group";import{Shape as Xc}from"konva/lib/Shape";import{Group as Wc}from"konva/lib/Group";import{Shape as Vc}from"konva/lib/Shape";function Kc(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 r=0;r<o;r+=1){let n=e[r],l=e[(r+1)%o],a=e[(r-1+o)%o],c=Math.min(Math.hypot(n.x-a.x,n.y-a.y)/2,Math.hypot(l.x-n.x,l.y-n.y)/2);i.arcTo(n.x,n.y,l.x,l.y,Math.max(0,Math.min(t,c)))}i.closePath()}function Ge(i,e,t,o){let s=st(i)>0,r=t.cornerRadius&&t.cornerRadius>0?t.cornerRadius:0;return new Vc({...t,sceneFunc(n,l){n.beginPath();let a=h=>{if(h.length){if(r>0&&h.length>=3)return Kc(n,h,r);n.moveTo(h[0].x,h[0].y);for(let d=1;d<h.length;d+=1)n.lineTo(h[d].x,h[d].y);n.closePath()}};o?(h=>{n.moveTo(h.start.x,h.start.y);let d=h.start;for(let u of h.segments)u.kind==="line"?n.lineTo(u.end.x,u.end.y):u.kind==="arc"?n.arc(u.center.x,u.center.y,u.radius,Math.atan2(d.y-u.center.y,d.x-u.center.x),Math.atan2(u.end.y-u.center.y,u.end.x-u.center.x),!u.clockwise):n.bezierCurveTo(u.control1.x,u.control1.y,u.control2.x,u.control2.y,u.end.x,u.end.y),d=u.end;n.closePath()})(o):a(i);for(let h of e??[]){let d=st(h)>0;a(d===s?[...h].reverse():h)}n.fillStrokeShape(l)},perfectDrawEnabled:!1})}var gt=class extends Wc{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 In(i,e){if(!e.length)return null;let t=new zc({listening:!1});for(let o of e){let s=i.viewMode==="perspective"&&o.perspectiveAffine,r=s?o.outline.map(l=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,l))):o.outline,n=s?o.holes.map(l=>l.map(a=>i.perspectiveLocalPoint(i.projectedSectionPoint(o,a)))):o.holes;t.add(Ge(r,n,{fill:tr,stroke:_("#ffffff",.1),strokeWidth:1,listening:!1},s?void 0:o.outlinePath))}return i.bgLayer.add(t),t.moveToTop(),t}function Pn(i,e){let{bounds:t}=i,s=Math.max(t.width,t.height,1)*4+1e3,r=[{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}],n=new Xc({fill:i.canvasBackground,opacity:1-De,listening:!1,perfectDrawEnabled:!1,sceneFunc:(l,a)=>{let c=h=>{if(h.length){l.moveTo(h[0].x,h[0].y);for(let d=1;d<h.length;d++)l.lineTo(h[d].x,h[d].y);l.closePath()}};l.beginPath(),c(r);for(let h of e){let d=i.viewMode==="perspective"&&h.perspectiveAffine?h.outline.map(u=>i.perspectiveLocalPoint(i.projectedSectionPoint(h,u))):h.outline.map(u=>{let p=h.liftWorld>0?i.isoLiftLocal(h.liftWorld):{x:0,y:0};return{x:u.x+p.x,y:u.y+p.y}});c(st(d)>0?[...d].reverse():d)}l.fillStrokeShape(a)}});return i.overlayLayer.add(n),n.moveToTop(),n}import{Rect as Na}from"konva/lib/shapes/Rect";import{Line as Hh}from"konva/lib/shapes/Line";import{Text as Ha}from"konva/lib/shapes/Text";import{Path as Gh}from"konva/lib/shapes/Path";import{Text as Yc}from"konva/lib/shapes/Text";function Mn(i){let e=Me,t=new Yc({fontSize:me,fontStyle:"600",fontFamily:i.labelFont(),listening:!1}),o=i.seatR*2-3;for(let s of i.seats){if(s.kind==="booth"){e=Math.min(e,Me);continue}let r=me*i.seatLabelScale(s);t.fontSize(r),t.text(Ft(s.displayLabel??s.label));let n=t.width()>o?Math.max(nt,r*o/t.width()):r;e=Math.min(e,n)}return t.destroy(),H/Math.max(nt,e)}var co={top:0,right:0,bottom:0,left:0};function Rn(i){let e=t=>typeof t=="number"&&Number.isFinite(t)&&t>0?t:0;return i?{top:e(i.top),right:e(i.right),bottom:e(i.bottom),left:e(i.left)}:{...co}}var Uc=.7;function An(i,e,t){let{top:o,right:s,bottom:r,left:n}=t,l=(u,p,y)=>{let m=u+p,f=y*Uc;if(m<=f||m<=0)return[u,p];let g=f/m;return[u*g,p*g]},[a,c]=l(n,s,i),[h,d]=l(o,r,e);return{x:a,y:h,width:Math.max(1,i-a-c),height:Math.max(1,e-h-d)}}function En(i){return{x:i.x(),y:i.y(),scale:i.scaleX()}}function _n(i,e){return!Number.isFinite(e.x)||!Number.isFinite(e.y)||!(e.scale>0)?!1:(i.scale({x:e.scale,y:e.scale}),i.position({x:e.x,y:e.y}),!0)}function ai(i){return{x:i.x+i.width/2,y:i.y+i.height/2}}function Bn(i,e){let t=e({x:i.x,y:i.y}),o=e({x:i.x+i.width,y:i.y+i.height});return{x:Math.min(t.x,o.x),y:Math.min(t.y,o.y),width:Math.abs(o.x-t.x),height:Math.abs(o.y-t.y)}}function On(){return typeof navigator<"u"&&navigator.maxTouchPoints>0?As:Rs}function Dn(i){return Math.max(i*1.05,Ts,le*1.3)}function li(i,e){let t=1/0,o=-1/0,s=1/0,r=-1/0;for(let n of i)t=Math.min(t,n.x),o=Math.max(o,n.x),s=Math.min(s,n.y),r=Math.max(r,n.y);return t-=e,o+=e,s-=e,r+=e,{x:t,y:s,width:Math.max(40,o-t),height:Math.max(40,r-s)}}function Nn(i){let{stageWidth:e,stageHeight:t,fullBounds:o,visibleBounds:s,seatPoints:r,minScale:n}=i;if(!r.length)return null;let l=1.12;if(Math.min(e/(o.width*l),t/(o.height*l))>=n)return null;let c=i.tapAnchor??{x:s.x+s.width/2,y:s.y+s.height/2},h=r[0],d=1/0;for(let m of r){let f=(m.x-c.x)**2+(m.y-c.y)**2;f<d&&(h=m,d=f)}let u=e/(n*l),p=t/(n*l),y=li(r,0);return{bounds:{x:Fn(h.x,u,y.x,y.width),y:Fn(h.y,p,y.y,y.height),width:u,height:p},minScale:n}}function Fn(i,e,t,o){return o<=e?t+o/2-e/2:Math.min(Math.max(i-e/2,t),t+o-e)}var Kn=.5,W=Math.SQRT1_2,$c="#f3f4f6",Hn=4;function qc(i){let e=i.fraction;return typeof e!="number"||!Number.isFinite(e)?Kn:Math.min(1,Math.max(0,e))}function Zc(i){return i==="booked"||i==="not_for_sale"?dt:qt}function Gn(i,e){return Number.parseInt(i.slice(e,e+2),16)}function Wn(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 jc(i,e,t){let o=Wn(i),s=Wn(e);if(!o||!s)return i;let r=Math.min(1,Math.max(0,t)),n="#";for(let l=1;l<7;l+=2){let a=Math.round(Gn(o,l)*(1-r)+Gn(s,l)*r);n+=a.toString(16).padStart(2,"0")}return n}function Vn(i,e,t,o){let s=t*4,r=e*W,n=-e*W,l=o*W*2*s,a=o*-W*2*s,c=r+s*W,h=n+s*W,d=r-s*W,u=n-s*W;i.beginPath(),i.moveTo(c,h),i.lineTo(d,u),i.lineTo(d+l,u+a),i.lineTo(c+l,h+a),i.closePath(),i.clip()}function Qc(i,e){let t=e*4,o=Math.max(e*.45,1);i.beginPath();for(let s=-Hn;s<=Hn;s++){let r=s*o*2,n=r+o,l=r*W,a=-r*W,c=n*W,h=-n*W;i.moveTo(l+t*W,a+t*W),i.lineTo(l-t*W,a-t*W),i.lineTo(c-t*W,h-t*W),i.lineTo(c+t*W,h+t*W),i.closePath()}i.clip()}function ci(i,e){i._sceneFunc(e)}function zn(i){let e=this,t=e.attrs,o=t.markRadius||1,s=t.fill,r=e.getStage(),n=Math.abs((r?r.scaleX():1)*(e.scaleX()||1))||1;if(o*2*n<16){t.fill=t.markMidtone??s,ci(e,i),t.fill=s;return}let a=(1-2*(t.markFraction??Kn))*o;i.save(),Vn(i,a,o,1),t.fill=t.markBase??s,ci(e,i),i.restore(),i.save(),Vn(i,a,o,-1),t.fill=t.markFill??s,ci(e,i),t.markHatch&&(Qc(i,o),t.fill=$c,ci(e,i)),i.restore(),t.fill=s}function Jc(i,e,t,o,s,r){let n=qc(e),l=Zc(t),a=i.attrs;a.markFraction=n,a.markBase=o,a.markFill=l,a.markMidtone=jc(o,l,1-n),a.markHatch=r,a.markRadius=s>0?s:1,i.fill(a.markMidtone),i.stroke(""),i.strokeWidth(0),i.dash([]),i.opacity(1),i.sceneFunc(zn)}function eh(i){i.setAttr("sceneFunc",void 0)}function ho(i){return i.attrs.sceneFunc===zn}var hi=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,r]of Object.entries(e))t.has(s)&&(r&&r.kind==="partial"?(this.marks.set(s,r),o.add(s)):this.marks.delete(s)&&o.add(s));return o}paint(e,t,o,s,r,n,l){let a=l?void 0:this.marks.get(t);if(!a){ho(e)&&eh(e);return}Jc(e,a,o,s,r,n)}};function di(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 Xn=.85,th=[2,2],ih=1,Yn=.6;function oh(i){return D(i)?"#334155":"#e2e8f0"}function Un(i,e,t){return i==="held"?{fill:qt,stroke:oh(e),strokeWidth:ih,dash:[...th],opacity:1,scale:1}:i==="booked"||i==="not_for_sale"?t?{fill:"rgba(0,0,0,0)",stroke:dt,strokeWidth:1.5,dash:[],opacity:.9,scale:Xn}:{fill:dt,stroke:"",strokeWidth:0,dash:[],opacity:i==="booked"?.45:.6,scale:Xn}:null}var uo=1e6;function sh(){return typeof navigator>"u"?!1:navigator.maxTouchPoints>0&&/AppleWebKit/i.test(navigator.userAgent)}var ui=class{constructor(e,t=sh()){this.pointers=new Map;this.pinch=null;this.panLast=null;this.panStart=null;this.panStarted=!1;this.movedPx=0;this.singleTouch=!1;this.lastTapAt=0;this.rect=null;this.onLayoutChanged=()=>{this.rect=null};this.onPointerDown=e=>{this.useWebKitTouchEvents&&e.pointerType==="touch"||(this.rect=null,this.beginPointer(e.pointerId,this.toLocal(e.clientX,e.clientY),e.pointerType,e.button))};this.onPointerMove=e=>{if(this.useWebKitTouchEvents&&e.pointerType==="touch"||!this.pointers.has(e.pointerId))return;e.preventDefault();let 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(),this.rect=null;for(let t=0;t<e.changedTouches.length;t+=1){let o=e.changedTouches.item(t);o&&this.beginPointer(uo+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 r=this.toLocal(s.clientX,s.clientY);this.updatePointer(uo+s.identifier,r)&&(t=r)}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(uo+o.identifier)}};this.host=e,this.useWebKitTouchEvents=t}get moved(){return this.movedPx}attach(){let{container:e}=this.host;this.rect=null,typeof window<"u"&&(window.addEventListener("scroll",this.onLayoutChanged,{capture:!0,passive:!0}),window.addEventListener("resize",this.onLayoutChanged,{passive:!0}),window.visualViewport?.addEventListener("resize",this.onLayoutChanged),window.visualViewport?.addEventListener("scroll",this.onLayoutChanged)),e.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),e.addEventListener("pointermove",this.onPointerMove,{passive:!1}),e.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),e.addEventListener("pointercancel",this.onPointerEnd,{passive:!1}),this.useWebKitTouchEvents&&(e.addEventListener("touchstart",this.onTouchStart,{passive:!1}),e.addEventListener("touchmove",this.onTouchMove,{passive:!1}),e.addEventListener("touchend",this.onTouchEnd,{passive:!1}),e.addEventListener("touchcancel",this.onTouchEnd,{passive:!1}))}detach(){let{container:e}=this.host;typeof window<"u"&&(window.removeEventListener("scroll",this.onLayoutChanged,{capture:!0}),window.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("resize",this.onLayoutChanged),window.visualViewport?.removeEventListener("scroll",this.onLayoutChanged)),e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerEnd),e.removeEventListener("pointercancel",this.onPointerEnd),this.useWebKitTouchEvents&&(e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd),e.removeEventListener("touchcancel",this.onTouchEnd))}resetPan(){this.panLast=null,this.panStart=null,this.panStarted=!1}isGhostClick(e){return e.type==="tap"?(this.lastTapAt=performance.now(),!1):this.lastTapAt>0&&performance.now()-this.lastTapAt<xs}invalidateRect(){this.rect=null}toLocal(e,t){let o=this.rect;if(!o){let s=this.host.container.getBoundingClientRect();o={left:s.left,top:s.top},this.rect=o}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[r,n]=[...this.pointers.values()],l={x:(r.x+n.x)/2,y:(r.y+n.y)/2},a=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(n.x-r.x,n.y-r.y),startScale:a,worldMid:{x:(l.x-this.host.stage.x())/a,y:(l.y-this.host.stage.y())/a}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=xe+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=xe+1),!0):!1}applyPointerMove(e){if(this.singleTouch&&this.pointers.size===1&&(this.panStarted||this.movedPx>xe?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 r={x:(t.x+o.x)/2,y:(t.y+o.y)/2},{min:n,max:l}=this.host.zoomBounds(),a=V(this.pinch.startScale*(s/this.pinch.startDist),n,l);this.host.stage.scale({x:a,y:a}),this.host.stage.position({x:r.x-this.pinch.worldMid.x*a,y:r.y-this.pinch.worldMid.y*a}),this.host.updateSeatGroupVisibility(),this.host.stage.batchDraw(),this.host.scheduleViewChange()}else if(this.panLast&&this.pointers.size===1){if(!this.panStarted){if(this.movedPx<=xe)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 rh}from"konva/lib/shapes/Circle";import{Group as nh}from"konva/lib/Group";import{Text as ah}from"konva/lib/shapes/Text";var $n=13,lh=15,ch=.3,hh=.08;function Qn(i,e,t){return!!(i&&t!==i||e&&!e.has(t))}function dh(i,e){return!e||i.available==null?`cap ${i.capacity}`:i.available<=0?G("map.soldOut"):G("map.seatsLeft",{count:i.available})}function uh(i,e){return e&&i.available!=null&&i.available<=0}function Jn(i){for(let e of i.gaById.values()){let t=i.filteredOut(e.categoryKey),o=i.overviewHidden(e),s=uh(e,i.pickerMode),r=i.pickerMode?e.selected??0:0;e.polygon.opacity(o?0:i.dimmed(e.categoryKey)?Re*hh:s?Re*ch:Re),e.polygon.listening(!i.exportMode&&!o&&!t&&!s),e.polygon.stroke(r>0?i.selectionColor:e.strokeColor),e.polygon.strokeWidth(r>0?3:1.5),ph(i,e,s,r,o,i.dimmed(e.categoryKey))}}function ph(i,e,t,o,s,r){if(e.capacityNode){let n=dh(e,i.pickerMode);e.capacityNode.text()!==n&&(e.capacityNode.text(n),e.capacityNode.offsetX(e.capacityNode.width()/2)),e.capacityNode.opacity(t?.75:1)}fh(i,e,s||r),o>0&&!s?yh(i,e,o):e.chip&&e.chip.visible(!1)}var po=9,qn=.86;function fh(i,e,t){let{labelNode:o,capacityNode:s}=e;if(!o&&!s)return;let r=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 n=mh(e,r),l=Zn(o,Et,n.width*qn,r),a=Zn(s,_t,n.width*qn,r),c=l!=null,h=a!=null&&c&&l+a+po<=n.height;jn(o,c?l:null,e.labelPoint.y-po/r,r),jn(s,h?a:null,e.labelPoint.y+po/r,r)}function mh(i,e){let t=1/0,o=-1/0,s=1/0,r=-1/0;for(let n of i.points)n.x<t&&(t=n.x),n.x>o&&(o=n.x),n.y<s&&(s=n.y),n.y>r&&(r=n.y);return Number.isFinite(t)?{width:(o-t)*e,height:(r-s)*e}:{width:0,height:0}}function Zn(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 r=e*(t/s);return r>=H?r:null}function jn(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 yh(i,e,t){if(!e.chip){let o=new nh({x:e.labelPoint.x,y:e.labelPoint.y-$n-16,listening:!1}),s=new rh({radius:$n,fill:i.selectionColor,listening:!1,perfectDrawEnabled:!1}),r=new ah({text:String(t),fontSize:lh,fontStyle:"800",fontFamily:i.labelFont(),fill:"#0b0d12",listening:!1,perfectDrawEnabled:!1});o.add(s),o.add(r),i.bgLayer.add(o),e.chip=o,e.chipText=r}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 ea(i,e){let t=!1;for(let[o,s]of Object.entries(e)){let r=i.get(o);r&&(s.available!==void 0&&r.available!==s.available&&(r.available=s.available,t=!0),s.selected!==void 0&&r.selected!==s.selected&&(r.selected=s.selected,t=!0))}return t}import{Rect as ta}from"konva/lib/shapes/Rect";import{Text as gh}from"konva/lib/shapes/Text";function ia(i){let e=i.effScale(),t=i.stage.scaleX(),o={width:i.stage.width(),height:i.stage.height()},s=m=>Math.round(m*100)/100,r=new Map(i.overlayLayer.find(".selection-ring").map(m=>[String(m.getAttr("seatId")??""),String(m.getAttr("ringColor")??i.effSelection)])),n=i.seats.map(m=>{let f=i.circleById.get(m.id),g=i.boothLabelById.get(m.id)??i.seatLabelById.get(m.id),b=i.viewMode==="perspective"?i.perspectiveSeatScale.get(m.id)??1:1,S=(i.viewMode==="perspective"?t:e)*b,v=m.kind==="booth"?Me:me*i.seatLabelScale(m),w=i.viewMode==="perspective"&&m.kind!=="booth"?e*b:S,k=s((g?.fontSize()??v)*w),L=i.worldToScreen(m),x=g?g.width()*t*b:0,T=g?g.height()*(i.viewMode==="perspective"&&m.kind==="booth"?t:e)*b:0,I=L.x-x/2<0||L.x+x/2>o.width||L.y-T/2<0||L.y+T/2>o.height,P=i.focusedSeatOpacity(m.id,f?.getAbsoluteOpacity()??0),M=i.seatSection.get(m.id),R=!!g?.isVisible()&&P>=.5&&!I,C;R||(P<.5?C="dimmed-or-unavailable":k<H?C="below-minimum-size":I?C="outside-viewport":g?C="renderer-hidden":C=i.seatLabelDrops.get(m.id)??(i.seatLabelRungOpen()?"clutter-or-fit":"below-label-rung"));let A=f instanceof ta?f.width()*t*b:i.seatR*2*S,B=f instanceof ta?f.height()*(i.viewMode==="perspective"?t:e)*b:i.seatR*2*S,Q=2*(i.seatR*S+Ee),X=f?.fill(),Y=g?.fill(),J=i.accessGlyphById.get(m.id),O=J?.getAbsoluteScale();return{seatId:m.id,label:m.label,kind:m.kind==="booth"?"booth":"seat",markerShape:m.kind==="booth"?"booth":m.wheelchairSpaceType==="no-seat"?"square":"circle",...m.wheelchairSpaceType?{wheelchairSpaceType:m.wheelchairSpaceType}:{},categoryKey:m.categoryKey,...M?{sectionId:M.id}:{},...M?.zone?{zoneId:M.zone}:{},status:i.statusById.get(m.id)??"free",selected:i.selection.has(m.id),visible:R,renderedFontPx:k,fill:typeof X=="string"?X:"",ink:typeof Y=="string"?Y:f?i.seatLabelInk(m,f):i.seatPreferredLabelInk(m),...r.has(m.id)?{selectionRingColor:r.get(m.id)}:{},opacity:s(P),...J?{accessibilityMarker:{glyphVisible:J.isVisible(),glyphWidthPx:s(Te*Math.abs(O?.x??0)),emphasizedByFilter:i.accessGlyphFilterEmphasized(m.id)}}:{},pointerTarget:{active:!i.cached&&!i.seatViewportCulled(m.id)&&!!f?.isVisible()&&!!f?.isListening()&&i.isSelectable(m.id),directWidthPx:s(A),directHeightPx:s(B),effectiveMinimumPx:s(Math.max(Math.min(A,B),Q))},screenCenter:{x:s(L.x),y:s(L.y)},...R?{screenBox:{x:s(L.x-x/2),y:s(L.y-T/2),width:s(x),height:s(T)}}:{},...C?{hiddenReason:C}:{}}}),l=n.filter(m=>m.visible).length,a=(m,f,g,b,S,v)=>{let w=Ze({x:b.x(),y:b.y()},b.width(),b.height(),b.rotation()),k=v&&v.liftWorld>0?i.isoLiftLocal(v.liftWorld):{x:0,y:0},L=K(w.map(R=>i.worldToScreen({x:R.x+k.x,y:R.y+k.y}))),x=s(b.opacity()),T=b.fill(),I=L.x+L.width<0||L.x>o.width||L.y+L.height<0||L.y>o.height,P=b.isVisible()&&x>.05&&!I,M=v?ri({x:b.x(),y:b.y()},b.width(),b.height(),b.rotation(),v.outline,v.holes):void 0;return{id:m,kind:f,role:g,label:b.text(),visible:P,renderedFontPx:s(b.fontSize()*t),opacity:x,fill:S,ink:typeof T=="string"?T:"",...M==null?{}:{fitsContainer:M},...P?{screenBox:{x:s(L.x),y:s(L.y),width:s(L.width),height:s(L.height)}}:{}}},c=m=>{let f=m.namePlate.fill();if(m.namePlate.opacity()>.05&&typeof f=="string"&&f)return f;let g=m.blockPoly.fill();return typeof g=="string"?g:m.baseFill},h=[...i.sections.map(m=>a(m.id,"section","name",m.nameLabel,c(m),m)),...i.sections.map(m=>a(`${m.id}:availability`,"section","availability",m.subLabel,c(m),m)),...i.zones.flatMap(m=>[a(m.id,"zone","name",m.label,m.background),...m.sub?[a(`${m.id}:price`,"zone","price",m.sub,m.background)]:[]])],d=[...i.gaById].map(([m,f])=>{let g=f.points.map(I=>i.worldToScreen(I)),b=Math.min(...g.map(I=>I.x)),S=Math.min(...g.map(I=>I.y)),v=Math.max(...g.map(I=>I.x)),w=Math.max(...g.map(I=>I.y)),k=v<0||b>o.width||w<0||S>o.height,L=s(f.polygon.opacity()),x=L>=.1&&!k,T=f.polygon.fill();return{areaId:m,label:f.label,capacity:f.capacity,categoryKey:f.categoryKey,...f.sectionId?{sectionId:f.sectionId}:{},visible:x,interactive:f.polygon.listening(),opacity:L,fill:typeof T=="string"?T:"",effectiveBackground:f.effectiveBackground,...x?{screenBox:{x:s(b),y:s(S),width:s(v-b),height:s(w-S)}}:{}}}),u=[...i.freeTextById].map(([m,f])=>{let{node:g,background:b,kind:S}=f,v=i.worldToScreen({x:g.x(),y:g.y()}),w=g.width()*t,k=g.height()*e,L=v.x-g.offsetX()*t,x=v.y-g.offsetY()*e,T=s(g.fontSize()*e),I=L+w<0||L>o.width||x+k<0||x>o.height,P=g.isVisible()&&!I,M=g.fill(),R=s(g.getAbsoluteOpacity()),C;return P||(T<H?C="below-minimum-size":I?C="outside-viewport":C="renderer-hidden"),{objectId:f.objectId??m,kind:S,text:g.text(),visible:P,renderedFontPx:T,ink:typeof M=="string"?M:"",background:b,opacity:R,...P?{screenBox:{x:s(L),y:s(x),width:s(w),height:s(k)}}:{},...C?{hiddenReason:C}:{}}}),p=i.labelGroup.find(m=>m.getAttr("rowLabel")===!0).filter(m=>m instanceof gh).map(m=>{let f=m.getClientRect({skipShadow:!0,skipStroke:!0}),g=f.x+f.width<0||f.x>o.width||f.y+f.height<0||f.y>o.height,b=m.fill();return{text:m.text(),visible:m.isVisible()&&!g,renderedFontPx:s(m.fontSize()*e),ink:typeof b=="string"?b:"",...g?{}:{screenBox:{x:s(f.x),y:s(f.y),width:s(f.width),height:s(f.height)}}}}),y=i.sections.filter(m=>m.blockPoly.opacity()>.05);return{viewport:o,projection:i.viewMode,...i.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:i.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:i.canvasBackground,effectiveScale:s(e),rung:i.getRung(),minimumVisibleLabelPx:H,totalLabelledBookableUnits:n.length,visibleLabels:l,hiddenLabels:n.length-l,totalBookableUnits:n.length+d.reduce((m,f)=>m+f.capacity,0),selectionRingSeatIds:i.overlayLayer.find(".selection-ring").map(m=>String(m.getAttr("seatId")??"")).filter(Boolean),selectionRingColor:i.effSelection,focusedSectionId:i.focusedSectionId,focusBackdropVisible:!!i.focusBackdrop?.isVisible(),categoryFilterKeys:i.categoryFilter?[...i.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:y.length,categoryPaintedSectionShells:y.filter(m=>{let f=m.blockPoly.fill();return typeof f!="string"||!Hi(i.canvasBackground,f)}).length,tintedSectionShells:y.filter(m=>{let f=m.blockPoly.fill();return typeof f=="string"&&nr(i.canvasBackground,f)}).length,visibleCategoryDetailOutlines:i.sections.filter(m=>m.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:i.sections.filter(m=>m.subLabel.opacity()>.05).length,visibleSectionGADetails:[...i.gaById.values()].filter(m=>m.sectionId!=null&&m.polygon.opacity()>.05).length},labels:n,gaAreas:d,hierarchyLabels:h,freeTextLabels:u,rowLabels:p}}import{Circle as bh}from"konva/lib/shapes/Circle";import{Ellipse as Sh}from"konva/lib/shapes/Ellipse";import{Line as oa}from"konva/lib/shapes/Line";import{Arrow as vh}from"konva/lib/shapes/Arrow";import{Path as wh}from"konva/lib/shapes/Path";import{Rect as bt}from"konva/lib/shapes/Rect";import{Text as mo}from"konva/lib/shapes/Text";import{Image as sa}from"konva/lib/shapes/Image";function ra(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,r=e.crop??{x:0,y:0,width:1,height:1},n=Math.max(0,Math.min(.99,r.x)),l=Math.max(0,Math.min(.99,r.y)),a={x:n,y:l,width:Math.max(.01,Math.min(1-n,r.width)),height:Math.max(.01,Math.min(1-l,r.height))},c=e.width,h=c*(s*a.height/(o*a.width)),d=new sa({image:t,x:e.center.x,y:e.center.y,offsetX:c/2,offsetY:h/2,width:c,height:h,rotation:e.rotation??0,crop:{x:a.x*o,y:a.y*s,width:a.width*o,height:a.height*s},opacity:e.opacity,listening:!1});i.bgLayer.add(d),d.moveToBottom(),i.bgLayer.batchDraw()})}function na(i,e){let t=new window.Image,o=new sa({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:V(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(K(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 aa(i,e){if(e.shape==="round")i.bgLayer.add(new bh({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 bt({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=St(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 kh=8,Lh=6;function la(i,e){let t=e.background?.color??i.canvasBackground,o=e.color??$(t,i.theme.textColor??qr),s=e.semanticKind==="icon"?ps(e.iconKey):void 0;if(s){let h=e.fontSize/24,d=new wh({x:e.position.x,y:e.position.y,data:s,rotation:e.rotation,scaleX:h,scaleY:h,stroke:o,strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});i.iconNodeById.set(e.id,{node:d,fontSize:e.fontSize}),i.bgLayer.add(d);return}let r=e.background?.padding??0,n=e.opacity??1,l=ss(e),a=new mo({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:ji(e.bold,e.italic,"600"),fill:o,fontFamily:e.fontFamily??i.labelFont(),...e.width!=null?{width:e.width}:{},align:e.align??"left",lineHeight:e.lineHeight??1.2,letterSpacing:e.letterSpacing??0,textDecoration:e.underline?"underline":"",padding:r,opacity:n,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"}),c;if(e.background){let h=a.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:!0}),d=Math.max(kh,e.fontSize*.35),u=Math.max(Lh,e.fontSize*.28);c=new bt({x:e.position.x,y:e.position.y,offsetX:-(h.x-d),offsetY:-(h.y-u),width:h.width+d*2,height:h.height+u*2,rotation:e.rotation,fill:e.background.color,opacity:n*(e.background.opacity??.9),cornerRadius:e.background.cornerRadius??4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),i.bgLayer.add(c)}i.freeTextById.set(e.id,{node:a,backdrop:c,background:t,kind:l?"direct-landmark":"free-text"}),i.bgLayer.add(a)}function ca(i,e){let t=e.fill??i.theme.decorFill??$r,o=e.role==="stage",s=e.role==="reference-focal",r=!!e.role&&!o,n=os(e),l=te(i.canvasBackground),a=s?l.focalFill:t,c=e.kind==="line"||e.kind==="polyline",h=e.stroke?.color??(o?Le(a,.28):s?l.focalStroke:c?"#9aa3b5":void 0),d=e.stroke?.width??(o?1:s||c?2:0),u=e.opacity!=null?V(e.opacity,.1,1):1,p=0,y=0,m=null;if(c&&e.points&&e.points.length>=2){p=e.points.reduce((S,v)=>S+v.x,0)/e.points.length,y=e.points.reduce((S,v)=>S+v.y,0)/e.points.length;let f=fs(e),g=ms(d),b=new vh({points:e.points.flatMap(S=>[S.x,S.y]),closed:!1,x:p,y,offsetX:p,offsetY:y,rotation:e.rotation??0,stroke:h,fill:h,strokeWidth:d,opacity:u,lineCap:f.lineCap,lineJoin:f.lineJoin,pointerAtBeginning:f.startEnding==="arrow",pointerAtEnding:f.endEnding==="arrow",...g,listening:!1,name:"buyer-shape-open-path"});b.setAttr("shapeObjectId",e.id),i.bgLayer.add(b)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){let f=o?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,fe(a,.3),1,Le(a,.12)]}:{fill:a};p=e.x+e.width/2,y=e.y+e.height/2,m={x:e.x,y:e.y,width:e.width,height:e.height},i.bgLayer.add(new bt({x:p,y,offsetX:e.width/2,offsetY:e.height/2,rotation:e.rotation??0,width:e.width,height:e.height,...f,stroke:h,strokeWidth:d,cornerRadius:V(e.cornerRadius??4,0,Math.min(e.width,e.height)/2),opacity:u,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){p=e.x+e.width/2,y=e.y+e.height/2,m={x:e.x,y:e.y,width:e.width,height:e.height};let f=o?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,fe(a,.3),1,Le(a,.12)]}:{fill:a};i.bgLayer.add(new Sh({x:p,y,rotation:e.rotation??0,radiusX:e.width/2,radiusY:e.height/2,...f,stroke:h,strokeWidth:d,opacity:u,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){let f=e.points.flatMap(S=>[S.x,S.y]),g=K(e.points);p=e.points.reduce((S,v)=>S+v.x,0)/e.points.length,y=e.points.reduce((S,v)=>S+v.y,0)/e.points.length,m=g;let b=o?{fillLinearGradientStartPoint:{x:0,y:g.y},fillLinearGradientEndPoint:{x:0,y:g.y+g.height},fillLinearGradientColorStops:[0,fe(a,.3),1,Le(a,.12)]}:{fill:a};i.bgLayer.add(new oa({points:f,closed:!0,x:p,y,offsetX:p,offsetY:y,rotation:e.rotation??0,...b,stroke:h,strokeWidth:d,opacity:u,listening:!1}))}m&&e.role&&i.landmarkBoxes.push(m);for(let f of Ho(e))i.bgLayer.add(new oa({points:f.points.flatMap(g=>[g.x,g.y]),closed:f.closed,x:p,y,offsetX:p,offsetY:y,rotation:e.rotation??0,stroke:f.ink??No,fill:f.fill,strokeWidth:2,opacity:u*.85,listening:!1,perfectDrawEnabled:!1,name:"buyer-stage-marking"}));if(e.label)if(o){let{node:f,spec:g}=xh(i,p,y,e.label,a,m,e.labelStyle);i.primaryFocalLabels.set(f,g),i.freeTextById.set(e.id,{node:f,background:a,kind:"stage"})}else if(r){let f=s||n,g=St(i,i.bgLayer,e.label,p,y,f?$(a,"#e6e9f0"):"#9aa3b5",f?18:12,!1);f&&i.primaryFocalLabels.set(g,{targetPx:18,trackingRatio:0,ink:String(g.fill()??""),plateInk:String(g.fill()??""),plate:new bt({width:0,height:0,opacity:0,listening:!1})}),i.freeTextById.set(e.id,{node:g,background:a,kind:"decor"})}else{let f=St(i,i.bgLayer,e.label,p,y,"#cbd5e1",16,!0);i.freeTextById.set(e.id,{node:f,background:a,kind:"decor"})}}var fo=22,Th=H,pi=6;function xh(i,e,t,o,s,r,n){let l=n?.size??fo,a=n?.color??i.theme.textColor??"#e6e9f0",c=n?.color??$(s,a),h=r?r.x+r.width/2:e,d=r?r.y+r.height/2:t,u=Ch(i.canvasBackground,s),p=new bt({x:h,y:d,width:0,height:0,cornerRadius:4,fill:u,opacity:0,listening:!1,perfectDrawEnabled:!1});i.bgLayer.add(p);let y=new mo({x:h,y:d,text:o,fontSize:l,fontStyle:ji(n?.bold??!0,n?.italic,"normal"),letterSpacing:l*(4/fo),fontFamily:n?.fontFamily??i.labelFont(),fill:c,textDecoration:n?.underline?"underline":"",listening:!1,perfectDrawEnabled:!1});return y.offsetX(y.width()/2),y.offsetY(y.height()/2),i.bgLayer.add(y),{node:y,spec:{targetPx:l,...r?{bounds:r}:{},trackingRatio:4/fo,ink:c,plateInk:n?.color??$(u,a),plate:p}}}function Ch(i,e){return ne(e,D(i)?"#ffffff":"#000000",.34)}function ha(i,e,t,o){let s=Math.max(t,1e-4),r=e.targetPx/s,n=p=>{i.letterSpacing(p*e.trackingRatio),o(i,p)};n(r);let l=e.bounds;if(!l){e.plate.opacity(0),i.fill(e.ink);return}let a={width:l.width-pi*2,height:l.height-pi*2},c=Math.min(1,a.width/Math.max(i.width(),1e-6),a.height/Math.max(i.height(),1e-6));if(c<1&&(r=Math.max(Th/s,r*c),n(r)),i.width()<=a.width&&i.height()<=a.height){e.plate.opacity(0),i.fill(e.ink);return}let d=i.width()+pi*2,u=i.height()+pi;e.plate.size({width:d,height:u}),e.plate.offset({x:d/2,y:u/2}),e.plate.opacity(1),i.fill(e.plateInk)}function da(i,e){let t=i.catColor.get(e.categoryKey)??"#6e7bff",o=i.canvasBackground,s=jo(t,o,Re),r=i.theme.textColor??"#e6e9f0",n=$(s,r),l=Ge(e.points,e.holes,{fill:t,opacity:Re,stroke:t,strokeWidth:1.5,cornerRadius:e.cornerRadius});l.setAttr("gaId",e.id),l.on("click tap",u=>{i.isGhostClick(u)||i.opts.onGAClick?.(e.id)}),l.on("mouseenter",()=>{i.container.style.cursor="pointer"}),l.on("mouseleave",()=>{i.container.style.cursor="default"}),i.bgLayer.add(l);let a=Pt(e.points,e.holes),c=i.sections.find(u=>oe(a,u.outline,u.holes)),h=St(i,i.bgLayer,e.displayLabel??e.label,a.x,a.y-8,n,Et,!1),d=St(i,i.bgLayer,`cap ${e.capacity}`,a.x,a.y+10,n,_t,!1);i.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:h,background:s,kind:"ga-label",categoryKey:e.categoryKey}),i.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:d,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:l,effectiveBackground:s,strokeColor:t,labelPoint:a,labelNode:h,capacityNode:d,...c?{sectionId:c.logicalId}:{}})}function St(i,e,t,o,s,r,n,l){let a=new mo({x:o,y:s,text:t,fontSize:n,fontStyle:l?"700":"500",fontFamily:i.labelFont(),fill:r,listening:!1,perfectDrawEnabled:!1});return a.offsetX(a.width()/2),a.offsetY(a.height()/2),e.add(a),a}import{Text as Ih}from"konva/lib/shapes/Text";var Ph=4;function ua(i){return D(i)?{plate:"#ffffff",stroke:"rgba(15,23,42,0.18)"}:{plate:"#0f1622",stroke:"rgba(226,232,240,0.22)"}}function Mh(i,e,t,o){let s=Math.max(0,Math.min(o,e/2,t/2));i.beginPath(),i.moveTo(s,0),i.arcTo(e,0,e,t,s),i.arcTo(e,t,0,t,s),i.arcTo(0,t,0,0,s),i.arcTo(0,0,e,0,s),i.closePath()}function pa(i,e){i.padding(Ph),i.shadowBlur(0),i.shadowOpacity(0),i.sceneFunc(function(o){let s=this.width(),r=this.height();o.save(),Mh(o,s,r,Math.min(r/2,8)),o.setAttr("fillStyle",e.plate),o.fill(),o.setAttr("strokeStyle",e.stroke),o.setAttr("lineWidth",1),o.stroke(),o.restore(),Ih.prototype._sceneFunc.call(this,o)})}var fa=/^[\p{L}\p{N}]{1,4}$/u,Rh=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function ma(i,e){let t=e?.trim();if(!t)return i;let o=i.toLocaleLowerCase("en-US"),s=t.toLocaleLowerCase("en-US");if(o.startsWith(`${s} `)){let n=i.slice(t.length).trim();if(fa.test(n))return n}let r=Rh.exec(i);if(r){let n=r[1].toLocaleLowerCase("en-US"),l=r[2].trim();if((s.startsWith(n)||n.startsWith(s))&&fa.test(l))return l}return i}function ya(i,e){let t=[],o=e.canvasBackground,s=new Map,r=(c,h)=>{let d=s.get(c)??[];d.push(h),s.set(c,d)};for(let c of e.seats){if(c.kind==="booth")continue;let h=c.logicalRowId??c.rowId;r(h,c),h!==c.rowId&&r(c.rowId,c)}let n=c=>c.logicalSeatIndex??Number(c.id.split(":").pop()??0);for(let c of i.objects){if(c.type!=="row")continue;let h=c.segmentedRow?.repeatLabelOnComponents===!0;if(c.segmentedRow&&!h&&c.segmentedRow.componentIndex!==0)continue;let d=h?c.labelPresentation:c.segmentedRow?.labelPresentation??c.labelPresentation;if(d?.visible===!1||d?.positionPreset==="none")continue;let u=c.segmentedRow&&!h?c.segmentedRow.groupId:c.id,p=(s.get(u)??[]).slice().sort((C,A)=>n(C)-n(A));if(!p.length)continue;let y=p[0],m=p[p.length-1],f=d?.labelStyle,g=d?.style==="pill"?ua(o):null,b=g?g.plate:o,S=$(b,f?.color??e.theme.rowLabelColor??e.theme.textColor??"#e6e9f0",Ot),v=f?.size??Zo,w=d?.rotation??0,k=e.objectFilteredOut(c)?.15:1,L=p.reduce((C,A)=>C??e.seatSection.get(A.id),void 0),T=c.segmentedRow?.displayLabel??c.displayLabel??ma(c.label,L?.label);if(!T)continue;let I=L?[...new Set([L.id,L.logicalId,L.zone].filter(C=>!!C))]:void 0,P=(C,A,B)=>t.push({text:T,x:C,y:A,rotation:w,fontSize:v,ink:S,opacity:k,...g?{pill:g}:{},...I?.length?{focusKeys:I}:{},...B?{automaticAway:B}:{}});if(d?.position){P(d.position.x,d.position.y);continue}let M=e.seatR+12,R=d?.positionPreset??"start";if(R==="start"||R==="both"){let C=c.rotation*Math.PI/180,A={x:-Math.cos(C),y:-Math.sin(C)};P(y.x+A.x*M,y.y+A.y*M,A)}if(R==="end"||R==="both"){let C=(c.rotation+c.curve)*Math.PI/180,A={x:Math.cos(C),y:Math.sin(C)};P(m.x+A.x*M,m.y+A.y*M,A)}}let l=(e.seatR+12)*2.2,a=[];for(let c of t){let h=a.find(d=>d.text===c.text&&Math.hypot(d.x-c.x,d.y-c.y)<=l);if(h){h.x=(h.x+c.x)/2,h.y=(h.y+c.y)/2;continue}a.push(c)}return a}function yo(i,e,t=j){let o=i.rotation()*Math.PI/180,s=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),n=(i.width()*s+i.height()*r)/2+t,l=(i.width()*r+i.height()*s)/2+t;return{x:e.x-n,y:e.y-l,width:n*2,height:l*2}}function ga(i,e,t,o){let s={x:e.x,y:e.y},r=e.automaticAway;if(!r)return s;let n={x:-r.y,y:r.x},l=Math.max(7,Math.min(16,e.fontSize*.75)),a=[{x:0,y:0}];for(let u=1;u<=4;u++){let p=l*u;a.push({x:n.x*p,y:n.y*p},{x:-n.x*p,y:-n.y*p},{x:r.x*p,y:r.y*p},{x:(r.x+n.x)*p,y:(r.y+n.y)*p},{x:(r.x-n.x)*p,y:(r.y-n.y)*p})}let c=s,h=1/0,d=1/0;for(let u of a){let p={x:s.x+u.x,y:s.y+u.y},y=yo(i,p),f=(o?Ht(o,y,{mode:"overlap"}).length:0)+t.collisionCount(y),g=Math.hypot(u.x,u.y);if((f<h||f===h&&g<d)&&(c=p,h=f,d=g),f===0)break}return c}function ba(i,e){let t=e,o=t._cache.get("canvas");if(!o)return;let s=[o.scene,o.filter,o.hit].map(r=>r?._canvas).filter(r=>!!r);s.length&&i.Util.releaseCanvas(...s),t._cache.delete("canvas")}function Sa(i,e){let t=0,o=0,s=r=>{t||(t=r),o+=1;let n=r-t;n>=1e3&&(i(Math.round(o*1e3/n)),o=0,t=r),e(requestAnimationFrame(s))};e(requestAnimationFrame(s))}import{Group as Ah}from"konva/lib/Group";import{Line as va}from"konva/lib/shapes/Line";import{Rect as Eh}from"konva/lib/shapes/Rect";import{Text as wa}from"konva/lib/shapes/Text";var _h=.6;function Bh(i,e){return i>=se||e&&i>=Vt}function Fh(i){return i.effectiveScale<Vt?!1:i.focusActive||i.stageWidth<de}function Oh(i,e,t){return t&&e>=Vt?Math.max(i,Is/Math.max(e,1e-4)):i}function Dh(i){let{authoredFontSize:e,measuredWidth:t,maxWidth:o,effectiveScale:s}=i;if(!(t>o)||!(t>0))return e;let r=H/Math.max(s,1e-4),n=e*o/t;return Math.max(Math.min(nt,r),n)}function go(i,e){let t=(e?1:3)*Math.min(1,i/be);return Math.max(1,i*2-t)}function ka(i){let e=new Map;for(let s of i){let r=e.get(s.rowId);r?r.push(s):e.set(s.rowId,[s])}let t=[];for(let s of e.values())if(!(s.length<2))for(let r=1;r<s.length;r+=1){let n=Math.hypot(s[r].x-s[r-1].x,s[r].y-s[r-1].y);n>0&&Number.isFinite(n)&&t.push(n)}if(!t.length)return 0;t.sort((s,r)=>s-r);let o=Math.floor(t.length/2);return t.length%2?t[o]:(t[o-1]+t[o])/2}function La(i,e){return e>0?Math.min(i,e/2):i}function bo(i){let e=Math.max(i*2,1e-4);return Math.max(_e,Qo/e)}function So(i){let e=go(i,!1),t=go(be,!1),o=e>0?t/e:1;return se*Math.max(1,o)/Bi(1,!1,H)}function Ta(i){return So(i)*js}function xa(i){let e=i.exportMode?Math.max(i.effScale(),se):i.effScale(),t=Fh({effectiveScale:e,focusActive:i.focusedSectionId!=null,stageWidth:i.stage.width()}),o=i.exportMode?e:Bi(e,i.labelsWereVisible(),H),s=Bh(o,t);i.onLabelVisibilityChange(s),i.setSeatLabelRungOpen(s);let r=a=>{let c=a.getClientRect({skipShadow:!0,skipStroke:!0});return c.x>=0&&c.y>=0&&c.x+c.width<=i.stage.width()&&c.y+c.height<=i.stage.height()};for(let[a,c]of i.boothLabelById){let h=i.circleById.get(a);c.visible(ye(c.fontSize(),o)&&!!h?.isVisible()&&i.focusedSeatOpacity(a,h?.getAbsoluteOpacity()??1)>=.5&&r(c))}i.labelGroup.destroyChildren(),i.labelLiftGroups.clear(),i.seatLabelById.clear(),i.seatLabelDrops.clear();let n=0;if(s)for(let a of i.visibleSeatCandidates()){if(a.kind==="booth")continue;let c=i.worldToScreen(a);if(c.x<-20||c.x>i.stage.width()+20||c.y<-20||c.y>i.stage.height()+20||i.accessGlyphById.has(a.id)&&i.accessGlyphShouldShow(a.id))continue;let h=i.circleById.get(a.id);if(!h?.isVisible()){i.seatLabelDrops.set(a.id,"dimmed-or-unavailable");continue}let d=i.statusById.get(a.id)??"free",u=d==="held"&&!i.ownedHold.has(a.id)&&!i.opts.manageMode&&!i.hasSeatMark(a.id)&&i.accessFilterDimmed(a.id);if(i.focusedSeatOpacity(a.id,h.getAbsoluteOpacity())<.5&&!u){i.seatLabelDrops.set(a.id,"dimmed-or-unavailable");continue}let p=i.renderedSeatPoint(a),y=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 S=new Ah({x:p.x,y:p.y,listening:!1});if(S.scale({x:y,y}),u&&S.opacity(_h),d==="held"?(S.add(new Eh({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),S.add(new va({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}))):(S.opacity(Yn),S.add(new va({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1}))),di(S),i.seatLabelContainer(a.id).add(S),++n>=Fi)break;continue}let f=Oh(me*i.seatLabelScale(a),e,t),g=new wa({x:p.x,y:p.y,text:Ft(a.displayLabel??a.label),fontSize:f,fontStyle:"600",fontFamily:i.labelFont(),fill:h?i.seatLabelInk(a,h):i.seatPreferredLabelInk(a),listening:!1,perfectDrawEnabled:!1}),b=go(i.seatR,t);if(g.fontSize(Dh({authoredFontSize:f,measuredWidth:g.width(),maxWidth:b,effectiveScale:e})),g.width()>b+.01){i.seatLabelDrops.set(a.id,"label-overflows-marker"),g.destroy();continue}if(!ye(g.fontSize(),e)){i.seatLabelDrops.set(a.id,"below-minimum-size"),g.destroy();continue}if(g.offsetX(g.width()/2),g.offsetY(g.height()/2),g.scale({x:y,y}),i.seatLabelContainer(a.id).add(g),!r(g)){i.seatLabelDrops.set(a.id,"outside-viewport"),g.destroy();continue}if(i.seatLabelById.set(a.id,g),++n>=Fi)break}let l=new je;for(let{node:a}of i.freeTextById.values()){if(!a.isVisible())continue;let c=a.getClientRect({relativeTo:i.bgLayer,skipShadow:!0,skipStroke:!0});l.insert({x:c.x-j,y:c.y-j,width:c.width+j*2,height:c.height+j*2})}for(let a of i.rowLabelPlan){let c=i.focusedSectionId!=null&&a.focusKeys?.includes(i.focusedSectionId),h=c?Math.max(a.fontSize,Cs/Math.max(e,1e-4)):a.fontSize;if(!c&&!ye(h,o))continue;let d=i.worldToScreen({x:a.x,y:a.y});if(d.x<-40||d.x>i.stage.width()+40||d.y<-40||d.y>i.stage.height()+40)continue;let u=new wa({x:a.x,y:a.y,text:a.text,fontSize:h,fontStyle:"700",fontFamily:i.labelFont(),fill:a.ink,rotation:a.rotation,opacity:a.opacity,shadowColor:"#05070c",shadowBlur:a.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:a.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});a.pill&&pa(u,a.pill),u.offsetX(u.width()/2),u.offsetY(u.height()/2);let p=i.resolveAutomaticRowLabelPosition(u,a,l);u.position(p),u.setAttr("rowLabel",!0),i.labelGroup.add(u);let y=u.getClientRect({skipShadow:!0,skipStroke:!0}),m=6,f=y.x<m?m-y.x:y.x+y.width>i.stage.width()-m?i.stage.width()-m-y.x-y.width:0,g=y.y<m?m-y.y:y.y+y.height>i.stage.height()-m?i.stage.height()-m-y.y-y.height:0,b=p;if(f||g){let v=i.labelGroup.getAbsoluteTransform(),w=v.point(p);b=v.copy().invert().point({x:w.x+f,y:w.y+g}),u.position(b)}let S=i.rowLabelBox(u,b);if(a.automaticAway&&l.collisionCount(S)>0){u.destroy();continue}l.insert(S)}i.isoT>0&&i.viewMode!=="perspective"&&i.applyUprightLabels(),i.overlayLayer.batchDraw()}function Ca(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,r=0,n=!1,l=!1,a=null,c=[],h=typeof globalThis<"u"?globalThis:{},d=()=>{a&&(a.kind==="idle"?h.cancelIdleCallback?.(a.id):a.kind==="frame"?h.cancelAnimationFrame?.(a.id):clearTimeout(a.id),a=null)},u=f=>{if(!c.length&&typeof h.requestIdleCallback=="function"){a={kind:"idle",id:h.requestIdleCallback(()=>{a=null,f()},{timeout:120})};return}if(typeof h.requestAnimationFrame=="function"){a={kind:"frame",id:h.requestAnimationFrame(()=>{a=null,f()})};return}a={kind:"timer",id:setTimeout(()=>{a=null,f()},16)}},p=()=>{l||n||(l=!0,d(),i.done())},y=f=>{for(let g=c.length-1;g>=0;g--){let b=c[g],S=o?1:Math.min(1,(f-b.startedAt)/160);i.fade(b.work,S),S>=1&&c.splice(g,1)}return c.length>0},m=()=>{if(n)return;let f=e(),g=f;for(;r<i.chunks.length&&(r===0||e()-g<t);){let S=i.chunks[r++];if(i.build(S.work),i.fade(S.work,o?1:0),o||c.push({work:S.work,startedAt:f+(r-1)*s}),e()-g>=t)break}let b=y(f);i.draw(),r<i.chunks.length||b?u(m):p()};return u(m),{cancel(){if(!l){n=!0,d();for(let f of c)i.fade(f.work,1);c.length=0}},finishNow(){if(!(n||l)){for(;r<i.chunks.length;){let f=i.chunks[r++];i.build(f.work)}for(let f of i.chunks)i.fade(f.work,1);c.length=0,i.draw(),p()}},get done(){return l}}}function vt(i){return{th:Kt*Math.PI/180*i.isoT,sg:1-(1-lt)*i.isoT}}function Ia(i,e){let{th:t,sg:o}=vt(e),s=e.centre,r=i.x-s.x,n=i.y-s.y,l=r*Math.cos(t)-n*Math.sin(t),a=(r*Math.sin(t)+n*Math.cos(t))*o;return{x:s.x+l,y:s.y+a}}function Pa(i,e){let{th:t,sg:o}=vt(e),s=e.centre,r=i.x-s.x,l=(i.y-s.y)/o,a=r*Math.cos(t)+l*Math.sin(t),c=-r*Math.sin(t)+l*Math.cos(t);return{x:s.x+a,y:s.y+c}}function Ma(i,e){let{th:t,sg:o}=vt(e),s=i*e.isoT;return{x:-(s/o)*Math.sin(t),y:-(s/o)*Math.cos(t)}}function Ra(i,e,t){let o=cs(e);i.offset(t),i.position(ae(e,t)),i.rotation(o.rotationDeg),i.scale({x:o.scaleX,y:o.scaleY}),i.skewX(o.skewX),i.skewY(0)}function Aa(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 Ea(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 _a(i,e,t){return i.perspectiveAffine?ae(i.perspectiveAffine,e):ae(t,e)}function Ba(i,e){return e?ae(e,i):i}function Fa(i,e){let t=0;for(let d of i.seats){let u=Math.max(0,(d.eyeHeightM??ee)-ee);t=Math.max(t,u*Ke)}for(let d of i.objects)d.type==="section"&&(t=Math.max(t,It(d,{floorBaseHeightM:i.floorBaseHeightMFor(d.id)}).height*Ke));let o=ns(i.bounds,t),s=Gt(o,o.target),r=as(s);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let n=1/0,l=1/0,a=-1/0,c=-1/0;for(let d of i.seats){let u=Math.max(0,(d.eyeHeightM??ee)-ee),p=ge(o,d,u*Ke),y={x:p.x,y:p.y};e.seatProjected.set(d.id,y),e.seatLocal.set(d.id,ae(r,y)),e.seatDepth.set(d.id,p.depth),e.seatScale.set(d.id,p.scale),n=Math.min(n,p.x),l=Math.min(l,p.y),a=Math.max(a,p.x),c=Math.max(c,p.y)}for(let d of[{x:i.bounds.x,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y},{x:i.bounds.x+i.bounds.width,y:i.bounds.y+i.bounds.height},{x:i.bounds.x,y:i.bounds.y+i.bounds.height}]){let u=ge(o,d,0);n=Math.min(n,u.x),l=Math.min(l,u.y),a=Math.max(a,u.x),c=Math.max(c,u.y)}let h=Math.max(24,i.seatR*3);return{camera:o,baseAffine:s,baseInverse:r,bounds:Number.isFinite(n)?{x:n-h,y:l-h,width:Math.max(1,a-n+h*2),height:Math.max(1,c-l+h*2)}:null}}function Oa(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 r=e?i.perspectiveSeatProjected.get(s.id)??s:s,n=e?i.perspectiveSeatScale.get(s.id)??1:1,l=i.circleById.get(s.id);l?.position(r),l?.scale({x:n,y:n});let a=i.accessRingById.get(s.id);a?.position(r),a?.scale({x:n,y:n});let c=i.accessGlyphById.get(s.id);if(c){let d=i.seatR*1.5/Te;c.position(r),c.scale({x:d*n,y:d*n})}let h=i.boothLabelById.get(s.id);h?.position(r),h?.scale({x:n,y:n}),e&&i.perspectiveAppliedSeats.add(s.id)}e||i.perspectiveAppliedSeats.clear()}function wo(i){return i?.getAttr?.("seatId")??void 0}var ko=Object.freeze([]),Ga=.85,Wh=.38,Vh=Object.freeze([3,3]),kt=class kt{constructor(e,t={}){this.labelLiftGroups=new Map;this.seats=[];this.seatById=new Map;this.seatIndex=null;this.chartDoc=null;this.activeFloorId="";this.stacked=!1;this.floorOverview=!1;this.floorLabelStyle="number";this.circleById=new Map;this.glyphMarkers=[];this.seatGlyphDetail=!0;this.boothDims=new Map;this.boothLabelById=new Map;this.seatLabelById=new Map;this.seatLabelDrops=new Map;this.seatLabelRungOpen=!1;this.accessRingById=new Map;this.accessGlyphById=new Map;this.freeTextById=new Map;this.iconNodeById=new Map;this.primaryFocalLabels=new Map;this.gaById=new Map;this.statusById=new Map;this.catColor=new Map;this.catByKey=new Map;this.theme={};this.canvasBackground=Qi;this.effSelection=mt;this.colorblind=!1;this.cbHueByKey=new Map;this.rowLabelPlan=[];this.catOrder=[];this.selection=new Set;this.selectionMarkers=new Map;this.momentsCache=null;this.breathCache=null;this.ownedCache=null;this.beaconsCache=null;this.ownedHold=new Set;this.seatMarks=new hi;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.focusMembership=new Map;this.focusMembershipKey=null;this.focusAnchor=null;this.focusRoams=!1;this.focusBackdrop=null;this.focusDimOverlay=null;this.objectFloor=new Map;this.unsectionedSeatIds=null;this.zoneColor=new Map;this.hasSections=!1;this.hasBoothText=!1;this.isoT=0;this.isoTarget=0;this.isoRaf=0;this.viewMode="flat";this.perspectiveCamera=null;this.perspectiveBaseAffine=null;this.perspectiveBaseInverse=null;this.perspectiveSeatLocal=new Map;this.perspectiveSeatProjected=new Map;this.perspectiveSeatDepth=new Map;this.perspectiveSeatScale=new Map;this.perspectiveAppliedSeats=new Set;this.perspectiveBounds=null;this.isoCentre={x:0,y:0};this.glideRaf=0;this.labelsVisible=!1;this.labelFadeRaf=0;this.glideInProgress=!1;this.destroyed=!1;this.lodScale=0;this.reducedMotion=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;this.cameraGlideMs=On();this.fitScale=1;this.fitPose="";this.viewportInsets={...co};this.seatR=be;this.markerR=be;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.zoomSettleRaf=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=fi.pixelRatio;if(this.exportMode&&(this.dpr=1),fi.pixelRatio=this.dpr,this.stage=new Nh({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new ui(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",G("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new vo({listening:!this.exportMode}),this.seatLayer=new vo({listening:!this.exportMode}),this.overlayLayer=new vo({listening:!1}),this.labelGroup=new wt({listening:!1}),this.overlayLayer.add(this.labelGroup),this.fgDecorGroup=new wt({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.clusterLabels=new ni({labelLayer:this.overlayLayer,stage:this.stage,exportMode:this.exportMode,canvasBackground:()=>this.canvasBackground,labelFont:()=>this.labelFont(),reducedMotion:()=>this.reducedMotion,destroyed:()=>this.destroyed,hasSections:()=>this.hasSections,seats:()=>this.seats,seatR:()=>this.seatR,readableScale:()=>So(this.markerR),pickableScale:()=>bo(this.markerR),categoryLabel:s=>this.catByKey.get(s)?.label??"",categoryColor:s=>this.categoryDisplayColor(s),categoryPriceLabel:s=>this.categoryPriceLabel(s),categoryFilter:()=>this.categoryFilter,viewMode:()=>this.viewMode,seatsPickable:()=>this.seatsPickable(),screenToWorld:s=>this.screenToWorld(s),zoomBounds:()=>this.zoomBounds(),framingViewport:()=>this.framingViewport(),focusRegion:(s,r)=>this.focusRegion(s,r),cameraGlideMs:()=>this.cameraGlideMs}),this.hoverRing=new Da({radius:be+2,stroke:"#ffffff",strokeWidth:2,opacity:Ga,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new Da({radius:be+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&&(fi.pixelRatio=o),!this.exportMode){this.wireInteraction();let s=this.opts.onFps;s&&Sa(s,r=>{this.rafId=r})}!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 ei({overlayLayer:this.overlayLayer,seatLayer:this.seatLayer,stage:this.stage,seatRadius:()=>this.seatR,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed,isCached:()=>this.cached,isExportMode:()=>this.exportMode,labelFont:()=>this.labelFont(),viewMode:()=>this.viewMode,perspectiveSeatScale:e=>this.perspectiveSeatScale.get(e)??1,seat:e=>this.seatById.get(e),seatStatus:e=>this.statusById.get(e)??"free",seatShape:e=>this.circleById.get(e),seatPoint:e=>this.renderedSeatPoint(e),boothDims:e=>this.boothDims.get(e),selectionFocusId:()=>this.selectionFocusId,categoryColor:e=>this.categoryDisplayColor(e),priceLabel:e=>this.categoryPriceLabel(e.categoryKey),seatClosed:e=>this.seatInClosedSection(e),screenToWorld:e=>this.screenToWorld(e),nearestSeat:(e,t)=>this.nearestSeatToScreen(e,t)})),this.momentsCache}get breath(){return this.breathCache||(this.breathCache=new ti({overlayLayer:this.overlayLayer,canvasBackground:()=>this.canvasBackground,selectionColor:()=>this.effSelection,categoryColor:e=>this.categoryDisplayColor(e),seatCategoryKey:e=>this.seatById.get(e)?.categoryKey??null,isOwnedHold:e=>this.ownedHold.has(e),reducedMotion:()=>this.reducedMotion,isDestroyed:()=>this.destroyed})),this.breathCache}get beacons(){return this.beaconsCache||(this.beaconsCache=new oi({overlayLayer:this.overlayLayer,container:this.container,accent:()=>this.effSelection,accentInk:()=>qi(this.effSelection),labelFont:()=>this.labelFont(),stageScale:()=>this.stage.scaleX(),worldToScreen:e=>this.worldToScreen(e),activate:e=>this.activateBeacon(e)})),this.beaconsCache}activateBeacon(e){let t=e.kind==="section"?e.id:this.seatSection.get(e.seatId)?.logicalId??null;if(t){let o=this.sectionTapAnchor(t,this.renderedSeatPoint(this.seatById.get(e.seatId)??{x:0,y:0}));this.opts.onSectionTap?this.opts.onSectionTap(t,o):this.focusSection(t,{anchor:o})}this.focusSeat(e.seatId,{move:!t})}syncBeacons(){if(!this.beaconsCache&&!this.selectionMarkers.size)return;let e=this.beacons;e.sync(Er({rung:this.getRung(),sections:this.sections,zones:this.zones,ownedSeatIds:t=>this.ownedSeatIds(t),sectionName:t=>t.nameLabel.text()||t.logicalId,sectionAnchor:t=>({x:t.nameLabel.x(),y:t.nameLabel.y()})})),this.breath.syncBeacons(e.breathingRings())}ownedSeatIds(e){return e.memberIds.filter(t=>this.selection.has(t)||this.ownedHold.has(t))}get owned(){return this.ownedCache||(this.ownedCache=new si({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??Mt(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(let r of e.floors)for(let n of r.objects)this.objectFloor.set(n.id,r.id),n.type==="section"&&n.logicalSectionId&&this.objectFloor.set(n.logicalSectionId,r.id);let o=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),this.clusterLabels.clear(),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.seatLayer.clearCache(),this.seatLayer.listening(!this.exportMode),this.seatLayer.destroyChildren(),this.unsectionedSeatGroup=null,this.labelGroup.destroyChildren(),this.labelLiftGroups.clear(),this.fgDecorGroup.destroyChildren(),this.circleById.clear(),this.glyphMarkers=[],this.boothDims.clear(),this.boothLabelById.clear(),this.seatLabelById.clear(),this.accessRingById.clear(),this.accessGlyphById.clear(),this.freeTextById.clear(),this.iconNodeById.clear(),this.focusMembership.clear(),this.focusMembershipKey=null,this.unsectionedSeatIds=null,this.primaryFocalLabels.clear(),this.gaById.clear();for(let r of this.selectionMarkers.values())r.destroy();this.selectionMarkers.clear(),this.beaconsCache?.clear(),this.breathCache?.syncBeacons([]),this.breathCache?.sync(this.selectionMarkers),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(r=>r.type==="section");for(let r of e.zones??[])r.color&&this.zoneColor.set(r.id,r.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=e.theme??{},this.seatR=hs(this.theme.seatScale)*be,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(r=>r.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((r,n)=>{this.cbHueByKey.set(r,Zt[n%Zt.length])});for(let r of e.categories)this.catColor.set(r.key,r.color),this.catByKey.set(r.key,r),typeof r.price=="number"&&this.catPrice.set(r.key,r.price);for(let r of o.objects)r.type==="booth"&&this.boothDims.set(r.id,{width:r.width,height:r.height,rotation:r.rotation,...r.points&&r.points.length>=3?{points:r.points.map(n=>({x:n.x,y:n.y}))}:{}});this.seats=ze(o,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()});for(let r of this.seats)this.seatById.set(r.id,r),this.statusById.set(r.id,"free");this.seatIndex=rs(this.seats,{seatRadius:this.seatR}),this.markerR=La(this.seatR,ka(this.seats)),this.clusterLabels.rebuild(),this.bounds=Vo(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 wt({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 r of this.seats){let n=this.seatSection.get(r.id);if(!n){o.push(r);continue}let l=t.get(n.id);l?l.push(r):t.set(n.id,[r])}let s=[...t.entries()].map(([r,n])=>{let l=this.sections.find(a=>a.id===r);return{id:r,work:{seats:n,group:l.liftGroupSeat},distance:Math.hypot(l.centroid.x-e.x,l.centroid.y-e.y)}}).sort((r,n)=>r.distance-n.distance);o.length&&this.unsectionedSeatGroup&&s.push({id:"",work:{seats:o,group:this.unsectionedSeatGroup},distance:1/0}),this.seatReveal=Ca({chunks:s.map(r=>({id:r.id,work:r.work})),build:r=>this.renderSeats(r.seats),fade:(r,n)=>r.group.opacity(n),draw:()=>{this.seatLayer.batchDraw()},reducedMotion:this.reducedMotion,done:()=>{this.seatReveal=null,this.seatRevealPending=!1,this.updateLOD(),this.fitPose&&$i(this.stage)===this.fitPose&&this.zoomToFit(),this.seatLayer.batchDraw(),this.onSeatsRevealed?.()}})}viewportCentreInChartSpace(){let e=this.stage.scaleX()||1;return{x:(this.stage.width()/2-this.stage.x())/e,y:(this.stage.height()/2-this.stage.y())/e}}cancelSeatReveal(e=!1){let t=this.seatReveal;this.seatRevealPending=!1,t&&(this.seatReveal=null,e?t.finishNow():t.cancel())}floorView(e){if(!e.floors?.length)return{...e,referenceImage:void 0,backgroundImage:rt(e)};if(this.floorOverview&&e.floors.length>=2)return Ko(e,{labelStyle:this.floorLabelStyle});if(this.stacked&&e.floors.length>=2)return{...Wo(e),referenceImage:void 0,backgroundImage:rt(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:rt(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}setFloorLabelStyle(e){e===this.floorLabelStyle||!this.chartDoc||(this.floorLabelStyle=e,this.floorOverview&&this.setChart(this.chartDoc,{floorId:this.activeFloorId}))}getFloorLabelStyle(){return this.floorLabelStyle}setActiveFloor(e){!this.chartDoc||e===this.activeFloorId&&!this.floorOverview&&!this.stacked||(this.floorOverview=!1,this.stacked=!1,this.setChart(this.chartDoc,{floorId:e}))}getFloors(){return this.chartDoc?Mt(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 r of e){if(!this.statusById.has(r))continue;let n=this.statusById.get(r);if(n===t)continue;this.statusById.set(r,t);let l=this.circleById.get(r);if(l&&(this.paintSeat(l,r),o=!0),s){let a=this.seatSection.get(r);a&&(n==="free"!=(t==="free")&&(a.free+=t==="free"?1:-1),s.add(a))}}if(s&&s.size){for(let r of s)this.refreshSectionFill(r);this.bgLayer.batchDraw()}o&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>se&&this.updateLabels())}setSeatCategories(e){let t=!1,o=new Set;for(let[r,n]of Object.entries(e)){let l=this.seatById.get(r);if(!l||!this.catColor.has(n)||l.categoryKey===n)continue;l.categoryKey=n;let a=this.circleById.get(r);a&&(this.paintSeat(a,r),t=!0);let c=this.seatSection.get(r);c&&o.add(c)}if(!t)return;let s=new Map((this.chartDoc?Mt(this.chartDoc):[]).flatMap(r=>r.objects).filter(r=>r.type==="section").map(r=>[r.id,r]));for(let r of o){if(!s.get(r.id)?.color){let l=new Map;for(let a of r.memberIds){let c=this.seatById.get(a)?.categoryKey;c&&l.set(c,(l.get(c)??0)+1)}r.baseFill=Pi([...l].map(([a,c])=>({hex:this.catColor.get(a)??"#6e7bff",w:c})),"#3a4358")}r.shellCategoryColor=this.dominantSellableColor(r.memberIds),this.refreshSectionFill(r)}o.size&&this.bgLayer.batchDraw(),this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>se&&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 r=this.circleById.get(s);r&&this.paintSeat(r,s),this.syncSelectionMarker(s)}o.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>se&&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;let s=o&&t?[o,t]:this.seats.map(r=>r.id);for(let r of s){let n=this.circleById.get(r);n&&this.paintSeat(n,r)}o&&this.syncSelectionMarker(o),t&&this.syncSelectionMarker(t);for(let[r,n]of this.selectionMarkers)n.opacity(!t||r===t?1:.2);this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):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.clusterLabels.syncCursor(!1),this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(let[t,o]of Object.entries(e??{}))Number.isFinite(o)&&this.sectionHeat.set(t,Math.max(0,Math.min(1,o)));for(let t of this.sections)this.refreshSectionHeat(t);this.bgLayer.batchDraw()}deselect(e){let t=!1;for(let o of e)this.selection.has(o)&&(this.setSelected(o,!1,!0),t=!0);t&&this.overlayLayer.batchDraw()}selectAllSelectable(){if(!this.opts.manageMode)return[];let e=[];for(let t of this.seats)this.isSelectable(t.id)&&e.push(t.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];let t=new Set(e),o=[];for(let 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 r of s.memberIds){if(o.has(r)||(o.add(r),!this.isSelectable(r)))continue;let n=this.seatById.get(r);n&&t.push(n)}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<=Ps;for(let s of t)if(o)this.setSelected(s,!0,!0);else{this.selection.add(s);let r=this.circleById.get(s);r&&this.paintSeat(r,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 Na({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),r=Math.min(e.start.y,t.y),n=Math.max(e.start.y,t.y),l=this.stage.scaleX()||1;if((s-o)*l<4&&(n-r)*l<4){this.selection.size&&(this.clearSelection(),this.opts.onMarquee?.([]));return}let a=[];for(let c of this.seats){let h=this.renderedSeatPoint(c);h.x<o||h.x>s||h.y<r||h.y>n||this.isSelectable(c.id)&&a.push(c.id)}this.selectMany(a),this.opts.onMarquee?.(this.getSelection())}flashSeat(e,t="#f43f5e"){let o=this.seatById.get(e);o&&xn(this.flashHost,e,this.renderedSeatPoint(o),t)}flashSection(e,t="#22a06b"){Cn(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,r=null,n=1/0;for(let l of this.seats){if(l.id===e)continue;let a=this.viewMode==="perspective"?this.perspectiveSeatProjected.get(l.id)??l:l,c=a.x-s.x,h=a.y-s.y,d=c*t.x+h*t.y;if(d<=.5)continue;let u=Math.abs(c*t.y-h*t.x),p=d+u*2.5;p<n&&(n=p,r=l.id)}return r}focusSeat(e,t){let o=this.seatById.get(e);if(!o)return;this.focusedId=e,this.focusRing.radius(this.seatR+3),this.focusRing.position(this.renderedSeatPoint(o));let s=this.viewMode==="perspective"?this.perspectiveSeatScale.get(e)??1:1;this.focusRing.scale({x:s,y:s}),this.focusRing.visible(!0),t?.move!==!1&&this.ensureVisible(o),this.overlayLayer.batchDraw(),this.opts.onFocusSeat?.(o)}ensureVisible(e){let t=this.stage.width(),o=this.stage.height(),s=Math.max(this.stage.scaleX(),Ae*1.2),r=this.worldToScreen(e),n=70,l=r.x<n||r.x>t-n||r.y<n||r.y>o-n;if(this.stage.scaleX()<s||l){let a=this.renderedSeatPoint(e),c=this.viewMode==="perspective"&&this.perspectiveBaseAffine?ae(this.perspectiveBaseAffine,a):this.isoT===0?a:this.isoForward(a);this.stage.scale({x:s,y:s}),this.stage.position({x:t/2-c.x*s,y:o/2-c.y*s}),this.afterViewChange(),this.stage.batchDraw()}}setViewportInsets(e){this.viewportInsets=Rn(e),this.refitCurrentView()}getViewportInsets(){return{...this.viewportInsets}}framingViewport(){return An(this.stage.width(),this.stage.height(),this.viewportInsets)}framingWorldRect(){return Bn(this.framingViewport(),e=>this.screenToWorld(e))}zoomToFit(){let e=this.framingViewport(),t=e.width,o=e.height,s=this.viewMode==="perspective"&&this.perspectiveBounds?this.perspectiveBounds:this.bounds;if(this.fitScale=Math.min(t/s.width,o/s.height)||1,this.opts.portraitFitCrop&&!this.exportMode){let n=t/s.width<=o/s.height,l=s.height*this.fitScale;n&&l<.55*o&&(this.fitScale=Math.min(this.fitScale*1.3,.62*o/s.height))}let r=this.fitScale;if(this.stage.scale({x:r,y:r}),this.stage.position({x:e.x+(t-s.width*r)/2-s.x*r,y:e.y+(o-s.height*r)/2-s.y*r}),this.settleView(),!this.exportMode){let n=Or(this.stage,[this.bgLayer,this.seatLayer],e);n>0&&n!==1&&(this.fitScale*=n),n>0&&this.afterViewChange(),this.fitPose=$i(this.stage)}this.stage.batchDraw()}refitCurrentView(){if(this.focusedSectionId&&this.sectionBounds(this.focusedSectionId)){this.focusSectionCamera(this.focusedSectionId,!1,this.focusAnchor);return}if(this.categoryFilter?.size){this.focusCategories([...this.categoryFilter],{animate:!1});return}this.zoomToFit()}getCameraPose(){return En(this.stage)}setCameraPose(e){this.cancelGlide(),_n(this.stage,e)&&(this.settleView(),this.stage.batchDraw())}zoomIn(){this.zoomAbout(this.stage.scaleX()*kt.ZOOM_STEP,ai(this.framingViewport()))}zoomOut(){this.zoomAbout(this.stage.scaleX()/kt.ZOOM_STEP,ai(this.framingViewport()))}zoomOutLevel(){let e=this.focusedSectionId;return e?this.sectionBounds(e)&&this.stage.scaleX()>this.sectionFrameScale(e)*1.05?(this.focusRegion(e),"section"):"venue":this.getRung()==="seats"?(this.setRung("sections"),"sections"):(this.cancelGlide(),this.zoomToFit(),"venue")}seatCount(){return this.seats.length}bookableCount(){let e=this.seats.length;for(let t of this.gaById.values())e+=t.capacity;return e}worldToScreen(e){let t=this.stage.scaleX(),o=e.id,s=typeof o=="string"?this.seatById.get(o):void 0;if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let l=s?this.perspectiveSeatProjected.get(s.id)??ae(this.perspectiveBaseAffine,e):ae(this.perspectiveBaseAffine,e);return{x:l.x*t+this.stage.x(),y:l.y*t+this.stage.y()}}let r=s?this.renderedSeatPoint(s):e,n=this.isoT===0?r:this.isoForward(r);return{x:n.x*t+this.stage.x(),y:n.y*t+this.stage.y()}}setAccessibleFilter(e){this.setAccessibilityFilter(e?[]:null)}setAccessibilityFilter(e){let t=e===null?null:[...e];if(!this.sameAccessFilter(t)){this.accessFilter=t;for(let o of this.sections)this.refreshSectionFill(o);this.lodScale=0,this.updateLOD(),this.updateAccessGlyphs(this.effScale());for(let o of this.seats){let 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(!an(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.clusterLabels.applyFilterDim(),this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){Jn({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=>Qn(this.categoryHighlight,this.categoryFilter,e),overviewHidden:e=>!this.exportMode&&e.sectionId!=null&&this.effScale()<le,effScale:()=>this.effScale(),labelLegible:e=>ye(e,this.effScale())})}setGAStates(e){ea(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(p=>!o.has(p.categoryKey)||this.seatInClosedSection(p.id)?!1:(this.statusById.get(p.id)??"free")==="free"||this.ownedHold.has(p.id));if(!s.length)return;let r=ln(s.map(p=>p.id),this.seatSection);r&&this.focusSection(r);let n=Math.max(24,this.seatR*3),l=s.map(p=>this.renderedSeatPoint(p)),a=this.clusterLabels.boundsForSeats(s.map((p,y)=>({...p,...l[y]})),n),c=a?.bounds??li(l,n);if(!this.hasSections&&a){let p=this.clusterLabels.diveTarget(c,a.anchor);p&&this.focusRegion(p,{animate:t?.animate,durationMs:this.cameraGlideMs});return}let h=this.narrowSeatDetailFocus(l,c,a?.anchor??null),d=h?.bounds??c,u={x:d.x+d.width/2,y:d.y+d.height/2};!h&&sn({stage:this.stage,box:d,bounds:this.zoomBounds(),viewport:this.framingViewport(),centreScreen:this.worldToScreen(u)})||this.focusRegion(d,{animate:t?.animate,durationMs:this.cameraGlideMs,minScale:h?.minScale})}focusAccessibleSeats(e){let t=e===void 0?this.accessFilter:e;if(!t)return!1;let o=this.seats.filter(n=>this.seatInClosedSection(n.id)||Qe(n,t)!=="match"?!1:(this.statusById.get(n.id)??"free")==="free"||this.ownedHold.has(n.id));if(!o.length)return!1;this.clearSectionFocus();let s=Math.max(24,this.seatR*3),r=li(o.map(n=>this.renderedSeatPoint(n)),s);return this.focusRegion(r,{durationMs:this.cameraGlideMs}),!0}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}let l=this.viewMode==="isometric"&&this.isoT>0;this.viewMode=e,this.isoTarget=1,this.isoT=1,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),this.applyPerspective(l),this.zoomToFit();return}let t=e==="isometric"?1:0,o=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=t,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),o){this.isoT=t,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=t,this.applyIso(),this.afterViewChange();return}let s=this.isoT;if(s===t){this.applyIso(),this.afterViewChange();return}let r=performance.now(),n=l=>{if(this.destroyed)return;let a=Math.min(1,(l-r)/Ms),c=a<.5?4*a*a*a:1-Math.pow(-2*a+2,3)/2;this.isoT=s+(this.isoTarget-s)*c,this.applyIso(),this.scheduleViewChange(),a<1?this.isoRaf=requestAnimationFrame(n):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(n)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}isoParams(){return vt(this.isoState)}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){let e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),t=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,t)}return this.stage.scaleX()*(1-(1-lt)*this.isoT)}isoForward(e){return Ia(e,this.isoState)}isoInverse(e){return Pa(e,this.isoState)}buildPerspectiveProjection(e){let t=Fa({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){Ra(e,t,o)}resetContainerTransform(e){Aa(e)}sectionSurfaceHeight(e,t){return Ea(e,t)}projectedSectionPoint(e,t){return _a(e,t,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return Ba(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return Ma(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){Oa(this.seatAnchorContext,e,t)}applyPerspective(e=!0){let t=this.perspectiveCamera,o=this.perspectiveBaseAffine,s=this.perspectiveBaseInverse;if(!t||!o||!s)return;let r=this.seats.length>2500&&this.sections.length>0;this.cached&&!r&&(this.seatLayer.clearCache(),this.seatLayer.listening(!0),this.cached=!1),this.resetLayerTransforms(e),this.resetSectionProjection(e);for(let l of[this.bgLayer,this.overlayLayer])this.setContainerAffine(l,o,t.target);this.perspectiveAppliedSeats.clear(),r||this.applyExactSeatAnchors(!0);for(let l of this.sections){let a=d=>this.sectionSurfaceHeight(l,d),c=Gt(t,l.centroid,a),h=ls(s,c);l.perspectiveAffine=c,l.perspectiveCorrection=h,l.perspectiveDepth=ge(t,l.centroid,a(l.centroid)).depth,this.setContainerAffine(l.liftGroupBg,h,l.centroid);for(let d=0;d<l.sideFaces.length;d++){let u=l.outline[d],p=l.outline[(d+1)%l.outline.length],y=this.perspectiveLocalPoint(ge(t,u,0)),m=this.perspectiveLocalPoint(ge(t,p,0)),f=this.perspectiveLocalPoint(ge(t,p,a(p))),g=this.perspectiveLocalPoint(ge(t,u,a(u)));l.sideFaces[d].points([y.x,y.y,m.x,m.y,f.x,f.y,g.x,g.y]),l.sideFaces[d].opacity(.9)}}let n=[...this.sections].sort((l,a)=>(a.perspectiveDepth??0)-(l.perspectiveDepth??0));for(let l of n)l.rootGroupBg.moveToTop(),l.liftGroupSeat.moveToTop();this.unsectionedSeatGroup?.moveToTop(),this.syncSeatOverlayPositions(),r||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),r=o*Math.sin(t),n=-Math.sin(t),l=o*Math.cos(t),a=Math.sqrt(s*s+r*r),c=s*l-r*n,h=Math.atan2(r,s)*180/Math.PI,d=a,u=c/a,p=(s*n+r*l)/c,y=this.isoCentre;for(let m of[this.bgLayer,this.seatLayer,this.overlayLayer])m.position({x:y.x,y:y.y}),m.offset({x:y.x,y:y.y}),m.rotation(h),m.scaleX(d),m.scaleY(u),m.skewX(p),m.skewY(0)}this.applyUprightLabels(),this.applyElevation(),this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyUprightLabels(){let e=Kt*this.isoT,t=1/(1-(1-lt)*this.isoT),o=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(let s of o){let r=s.find("Text");for(let n of r){let l=n.getAttr("uprightBase");l==null&&(l=n.rotation(),n.setAttr("uprightBase",l)),n.rotation(l-e),n.scaleX(1),n.scaleY(t),n.skewX(0)}}}applyElevation(){let e=this.isoT;for(let t of this.sections){if(t.liftWorld<=0)continue;let o=this.isoLiftLocal(t.liftWorld);t.liftGroupBg?.position(o),t.liftGroupSeat.position(o),this.labelLiftGroups.get(t.id)?.position(o);let s=.9*e;for(let r=0;r<t.sideFaces.length;r++){let n=t.sideFaces[r],l=t.outline[r],a=t.outline[(r+1)%t.outline.length];n.points([l.x,l.y,a.x,a.y,a.x+o.x,a.y+o.y,l.x+o.x,l.y+o.y]),n.opacity(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.zoomSettleRaf&&cancelAnimationFrame(this.zoomSettleRaf),this.breathCache?.destroy(),this.momentsCache?.destroy(),this.beaconsCache?.clear(),this.recacheTimer&&clearTimeout(this.recacheTimer),this.resizeObs?.disconnect(),this.gestures.detach(),this.clusterLabels.destroy(),this.container.removeEventListener("keydown",this.onKeyDown),this.stage.destroy()}labelFont(){return this.exportMode?this.theme.fontFamily?.toLowerCase().includes("jetbrains")?"JetBrains Mono, monospace":"Inter, sans-serif":this.theme.fontFamily||"Inter, sans-serif"}seatContainer(e){return this.seatSection.get(e)?.liftGroupSeat??this.unsectionedSeatGroup??this.seatLayer}sectionMatchesFocus(e){let t=this.focusedSectionId;return t==null||e.id===t||e.logicalId===t||e.zone===t}focusedSeatOpacity(e,t){if(!this.focusedSectionId||!this.focusDimOverlay)return t;let o=this.seatSection.get(e);return t*(o&&this.sectionMatchesFocus(o)?1:De)}sectionScreenBounds(e){return Gr({viewMode:this.viewMode,isoT:this.isoT,stageScale:this.stage.scaleX(),stageX:this.stage.x(),stageY:this.stage.y(),projectedSectionPoint:(t,o)=>this.projectedSectionPoint(t,o),isoLiftLocal:t=>this.isoLiftLocal(t),isoForward:t=>this.isoForward(t)},e)}updateSeatGroupVisibility(){let e=this.exportMode||this.effScale()>=le,t=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,o=96,s=this.stage.width(),r=this.stage.height();for(let n of this.sections){let l=!0;if(e){let c=this.sectionScreenBounds(n);l=c.x+c.width>=-o&&c.y+c.height>=-o&&c.x<=s+o&&c.y<=r+o,l&&this.viewMode==="perspective"&&!t&&this.applyExactSeatAnchors(!0,n.memberIds)}n.liftGroupSeat.setViewportCulled(!l),this.labelLiftGroups.get(n.id)?.setViewportCulled(!l)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!t&&(this.unsectionedSeatIds||(this.unsectionedSeatIds=this.seats.filter(n=>!this.seatSection.has(n.id)).map(n=>n.id)),this.applyExactSeatAnchors(!0,this.unsectionedSeatIds))}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 gt({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){en({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/Te,s=new Gh({x:e.x,y:e.y,data:Bt(e.accessibility??[])??"",scaleX:o,scaleY:o,fill:Mi(t),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});return di(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,r=this.seatR*1.5/Te*s,l=this.accessGlyphFilterEmphasized(t)?Ls:ks,a=Math.max(r,l/(Te*Math.max(e,.001)));o.scale({x:a,y:a}),o.visible(this.accessGlyphShouldShow(t))}}accessGlyphFilterEmphasized(e){let t=this.seatById.get(e),o=this.accessFilter;return!!t&&o!==null&&!!t.accessibility?.includes("wheelchair")&&(o.length===0||o.includes("wheelchair"))&&we(t,o)}accessGlyphShouldShow(e){return this.accessGlyphById.has(e)&&this.accessGlyphEligible(e)}accessGlyphEligible(e){let t=this.statusById.get(e)??"free";return!(t==="booked"||t==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryPriceLabel(e){let t=this.catPrice.get(e);return typeof t=="number"?ut(t,this.currency):null}categoryDisplayColor(e){return this.colorblind?this.cbHueByKey.get(e)??Zt[0]:this.catColor.get(e)??"#6e7bff"}seatLabelScale(e){return(e.labelStyle?.size??18)/18}seatPreferredLabelInk(e){return e.labelStyle?.color??this.theme.seatLabelColor??ft}seatLabelInk(e,t){let o=t.fill();return $(typeof o=="string"?o:"",this.seatPreferredLabelInk(e))}paintSeat(e,t){let o=this.seatById.get(t),s=this.statusById.get(t)??"free",r=this.selection.has(t),n=this.categoryDisplayColor(o.categoryKey),l=this.boothLabelById.get(t);e.dash(ko),e.strokeWidth(0),e.stroke(""),e.opacity(1),e.scale({x:1,y:1});let a=s==="held"&&this.ownedHold.has(t),c=a?null:Un(s,this.canvasBackground,this.colorblind);c?(e.fill(c.fill),e.stroke(c.stroke),e.strokeWidth(c.strokeWidth),e.dash(c.dash),e.opacity(c.opacity),c.scale!==1&&e.scale({x:c.scale,y:c.scale})):a?(e.fill(Le(n,this.effSelection===mt?.24:.1)),e.stroke(this.effSelection),e.strokeWidth(3)):e.fill(r&&this.effSelection===mt?Le(n,.28):n),this.seatMarks.paint(e,t,s,n,this.seatR,this.colorblind,this.seatInClosedSection(t)),ho(e)&&e.scale({x:1,y:1}),o.wheelchairSpaceType==="no-seat"&&s==="free"&&(e.stroke(Ct(o.accessibility)),e.strokeWidth(r?3:2),e.dash([3,2])),l&&(l.text(s==="booked"?"SOLD":s==="held"?"HELD":o.label),l.fontSize(s==="free"?10:Math.min(10,Math.max(6,this.boothDims.get(o.rowId)?.width??40)/6)),l.fontStyle(s==="free"?"600":"800"),l.fill(s==="free"?this.theme.seatLabelColor??ft:"#ffffff"),l.offsetX(l.width()/2),l.offsetY(l.height()/2));let h=s==="free"||s==="held"&&!this.ownedHold.has(t);if(this.accessFilter&&h&&!r){let p=Qe(o,this.accessFilter);p==="other"?e.opacity(Math.min(e.opacity(),Xr)):p==="companion"&&e.opacity(Math.min(e.opacity(),Yr))}if(this.categoryHighlight&&s==="free"&&!r&&o.categoryKey!==this.categoryHighlight&&e.opacity(.25),this.categoryFilter&&s==="free"&&!r&&!this.categoryFilter.has(o.categoryKey)&&e.opacity(.22),this.commercialLimitedFilter&&s==="free"&&!r&&(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(Xo))&&e.opacity(.18)}this.closedSections.size&&this.seatInClosedSection(t)&&(e.fill(Js),e.stroke(""),e.strokeWidth(0),e.dash(ko),e.opacity(er),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(ye(d.fontSize(),this.effScale())&&e.opacity()>=.5));let u=this.accessGlyphById.get(t);if(u){let p=e.fill();u.fill(Mi(typeof p=="string"?p:"")),u.opacity(e.opacity()),u.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 r=this.sectionMembers(e).map(c=>this.seatById.get(c)).filter(c=>c!=null),n=r.filter(c=>(this.statusById.get(c.id)??"free")==="free"||this.ownedHold.has(c.id)),l=(n.length?n:r).map(c=>this.renderedSeatPoint(c)),a=this.narrowSeatDetailFocus(l,s,o);this.focusRegion(a?.bounds??s,{animate:t,minScale:a?.minScale})}releaseSectionFocusDim(){!this.focusBackdrop&&!this.focusDimOverlay||(this.focusRoams=!0,this.focusBackdrop?.destroy(),this.focusBackdrop=null,this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}clearSectionFocus(){this.focusedSectionId&&(this.focusedSectionId=null,this.focusAnchor=null,this.focusRoams=!1,this.focusBackdrop&&(this.focusBackdrop.destroy(),this.focusBackdrop=null),this.focusDimOverlay?.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD())}getFocusedSection(){return this.focusedSectionId}seatsRevealed(){return this.focusedSectionId||this.floorOverview?!0:this.effScale()>=_e}seatsPickable(){return this.focusedSectionId||this.floorOverview?!0:this.effScale()>=bo(this.markerR)}drawFocusBackdrop(e){this.focusBackdrop?.destroy(),this.focusBackdrop=null;let t=this.sections.filter(o=>o.id===e||o.logicalId===e);if(this.focusBackdrop=In(this.focusBackdropHost,t),!!this.focusBackdrop){this.focusDimOverlay?.destroy(),this.focusDimOverlay=Pn(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,r=(n,l)=>{n<e&&(e=n),l<t&&(t=l),n>o&&(o=n),l>s&&(s=l)};for(let n of this.seats)r(n.x,n.y);for(let n of this.sections)for(let l of n.outline)r(l.x,l.y);for(let n of this.gaById.values())for(let l of n.points)r(l.x,l.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(l=>this.selection.has(l)),r=s||t.memberIds.some(l=>this.ownedHold.has(l)),n=this.focusedSectionId===t.id||this.focusedSectionId===t.logicalId;return{id:t.logicalId,label:t.label,outline:t.outline.map(l=>({...l})),...this.objectFloor.get(t.id)?{floorId:this.objectFloor.get(t.id)}:{},state:s?"selected":o?"inactive":"available",active:n,paint:{fill:t.shellFill,stroke:t.shellStroke},owned:r}});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=rt(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 r=this.assetGeneration;/^https?:\/\//i.test(t)&&(e.crossOrigin="anonymous");let n=new Promise(l=>{let a=!1,c=()=>{a||(a=!0,this.assetCancels.delete(h),l())},h=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}c()};this.assetCancels.add(h),e.onload=()=>{if(!this.exportMode){r===this.assetGeneration&&s(),c();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{r===this.assetGeneration&&s()}).catch(()=>{r===this.assetGeneration&&this.assetErrors.push(`${o} could not be decoded.`)}).finally(c)},e.onerror=()=>{r===this.assetGeneration&&this.assetErrors.push(`${o} could not be loaded.`),c()},e.src=t});this.assetPromises.push(n)}cancelAssetLoads(){this.assetGeneration++;for(let e of[...this.assetCancels])e();this.assetCancels.clear(),this.assetPromises=[],this.assetErrors=[]}renderBackgroundImage(e){ra(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){na(this.objectDrawContext,e)}renderTable(e){aa(this.objectDrawContext,e)}renderText(e){la(this.objectDrawContext,e)}renderShape(e){ca(this.objectDrawContext,e)}renderGA(e){da(this.objectDrawContext,e)}renderSection(e){let t=Pt(e.outline,e.holes),o=te(this.canvasBackground),s=[],r=new Map,n=0,l=K(e.outline),a=this.seatIndex?Ht(this.seatIndex,l).map(C=>this.seatById.get(C)).filter(C=>!!C):this.seats;for(let C of a)this.seatSection.has(C.id)||oe(C,e.outline,e.holes)&&(s.push(C.id),r.set(C.categoryKey,(r.get(C.categoryKey)??0)+1),(this.statusById.get(C.id)??"free")==="free"&&n++);let c=e.color??Pi([...r].map(([C,A])=>({hex:this.catColor.get(C)??"#6e7bff",w:A})),"#3a4358"),h=Do(e.elevation),d=It(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),u=d.height*Ke,p=new wt({listening:!1});this.bgLayer.add(p);let y=new wt({listening:!1});p.add(y);let m=new gt({listening:!0});this.seatLayer.add(m);let f=[];if(u>0){let C=fe(this.zoneColor.get(e.zone??"")??c,.42);for(let A=0;A<e.outline.length;A++){let B=new Hh({points:[],closed:!0,fill:C,stroke:_("#000000",.25),strokeWidth:1,opacity:0,listening:!1,perfectDrawEnabled:!1});f.push(B),p.add(B)}}y.moveToTop();let g=y,b=e.color??this.zoneColor.get(e.zone??"")??"#3a4358",S=Ge(e.outline,e.holes,{stroke:_(b,.5),strokeWidth:1,fill:_(b,.08),listening:!1},e.outlinePath);g.add(S);let v=Ge(e.outline,e.holes,{fill:o.sectionFill,stroke:o.sectionStroke,strokeWidth:Be,opacity:0,listening:!1},e.outlinePath);g.add(v);let w=e.labelPresentation?.labelStyle,k=w?.color??o.sectionInk,L=(w?.size??18)/18,x=new Na({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,width:0,height:0,opacity:0,listening:!1,perfectDrawEnabled:!1});g.add(x);let T=new Ha({x:e.labelPresentation?.position?.x??t.x,y:e.labelPresentation?.position?.y??t.y,text:e.displayLabel??e.label,rotation:e.labelPresentation?.rotation??0,visible:e.labelPresentation?.visible!==!1,fontSize:18*L,fontStyle:Fe,fontFamily:this.labelFont(),fill:$(o.sectionFill,k),listening:!1,perfectDrawEnabled:!1});T.offsetX(T.width()/2),T.offsetY(T.height()/2),g.add(T);let I=new Ha({x:t.x,y:t.y,text:G("map.seatsLeft",{count:n}),fontSize:12,fontStyle:Ys,fontFamily:"JetBrains Mono, ui-monospace, monospace",fill:o.sectionInk,opacity:0,listening:!1,perfectDrawEnabled:!1});I.offsetX(I.width()/2),g.add(I);let P={id:e.id,logicalId:e.logicalSectionId??e.id,label:e.displayLabel??e.label,outline:e.outline,...e.outlinePath?{outlinePath:e.outlinePath}:{},holes:e.holes??[],centroid:t,labelAnchors:Hr(e.outline,e.holes??[],t),memberCategoryKeys:new Set(s.map(C=>this.seatById.get(C)?.categoryKey).filter(Boolean)),shellCategoryColor:this.dominantSellableColor(s),shellFill:o.sectionFill,shellStroke:o.sectionStroke,labelArea:Fo(e.outline,e.holes),zone:e.zone,memberIds:s,total:s.length,free:n,baseFill:c,outlineTint:b,outlinePoly:S,blockPoly:v,namePlate:x,nameLabel:T,subLabel:I,preferredInk:k,labelScale:L,nameLabelFits:!1,subLabelFits:!0,elevation:h,liftWorld:u,rakeDeg:d.rake,surfaceFocal:s.length?{...this.seatById.get(s[0])?.focalPoint??this.isoCentre}:{...this.chartDoc?.focalPoint??this.isoCentre},frontDistanceWorld:0,rootGroupBg:p,bgZIndex:p.zIndex(),seatZIndex:m.zIndex(),liftGroupBg:y,liftGroupSeat:m,sideFaces:f},M=s.map(C=>this.seatById.get(C)).filter(C=>!!C),R=M.length?M:e.outline;P.frontDistanceWorld=Math.min(...R.map(C=>Math.hypot(C.x-P.surfaceFocal.x,C.y-P.surfaceFocal.y)));for(let C of s)this.seatSection.set(C,P);this.unsectionedSeatIds=null,this.refreshSectionFill(P),this.refreshSectionHeat(P),this.sections.push(P)}refreshSectionHeat(e){pn(this.sectionLodPaintContext,e)}refreshSectionFill(e){yn(this.sectionLodPaintContext,e)}isSectionClosed(e){return io(this.sectionLodPaintContext,e)}dominantSellableColor(e){let t=ir(e,o=>this.seatById.get(o)?.categoryKey,o=>this.catByKey.get(o)?.notForSale===!0);return t?this.categoryDisplayColor(t):null}sectionAccessibleFree(e){return fn(e.memberIds,this.accessFilter,t=>this.statusById.get(t)??"free",t=>this.seatById.get(t))}get sectionLodPaintContext(){return{sections:this.sections,zones:this.zones,sectionHeat:this.sectionHeat,closedSections:this.closedSections,canvasBackground:this.canvasBackground,sectionIsOwned:e=>e.memberIds.some(t=>this.selection.has(t)||this.ownedHold.has(t)),accessFilterActive:this.accessFilter!=null,sectionAccessibleFree:e=>this.sectionAccessibleFree(e),selectionColor:this.effSelection,bgLayer:this.bgLayer,seatLayer:this.seatLayer,stageScaleX:this.stage.scaleX(),stageWidth:this.stage.width(),floorOverview:this.floorOverview,focusedSectionId:this.focusedSectionId,categoryFilter:this.categoryFilter,landmarks:this.landmarkBoxes,hasFocusDimOverlay:!!this.focusDimOverlay,viewMode:this.viewMode,glideInProgress:this.glideInProgress,reducedMotion:this.reducedMotion,isoT:this.isoT,seatCount:this.seats.length,lodScale:this.lodScale,setLodScale:e=>{this.lodScale=e},worldToScreen:e=>this.worldToScreen(e)}}renderZones(e){zr({bgLayer:this.bgLayer,canvasBackground:this.canvasBackground,catPrice:this.catPrice,currency:this.currency,seatById:this.seatById,sections:this.sections,zones:this.zones,labelFont:()=>this.labelFont()},e)}screenToWorld(e){let t=this.stage.scaleX(),o={x:(e.x-this.stage.x())/t,y:(e.y-this.stage.y())/t};return this.viewMode==="perspective"&&this.perspectiveBaseInverse?ae(this.perspectiveBaseInverse,o):this.isoT===0?o:this.isoInverse(o)}sectionAt(e){if(!this.sections.length)return null;let t=this.screenToWorld(e),o=this.sections.find(s=>{if(this.viewMode==="perspective"&&s.perspectiveAffine)return oe(t,s.outline.map(n=>this.perspectiveLocalPoint(this.projectedSectionPoint(s,n))),s.holes.map(n=>n.map(l=>this.perspectiveLocalPoint(this.projectedSectionPoint(s,l)))));let r=s.liftWorld>0?this.isoLiftLocal(s.liftWorld):{x:0,y:0};return oe({x:t.x-r.x,y:t.y-r.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?Qe(t,this.accessFilter)==="other":!1}toggleSeat(e){if(this.ownedHold.has(e)){let t=this.seatById.get(e);t&&this.opts.onDeselect?.(t);return}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?Ii(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let t=this.container;for(;t;){let o=Ii(getComputedStyle(t).backgroundColor);if(o)return o;t=t.parentElement}}return Qi}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:D(this.canvasBackground)?Ur:mt}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(),this.getRung()),this.syncBeacons()),(this.breathCache||this.selectionMarkers.size)&&this.breath.sync(this.selectionMarkers)}playSeatPickMoment(e){this.moments.play(e)}showTouchLoupe(e){this.moments.showLoupe(e)}hideTouchLoupe(){this.moments.hideLoupe()}sectionBounds(e){return Vr({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?Je(this.stage,t,this.zoomBounds(),this.framingViewport()):this.stage.scaleX()}handleSeatTap(e){if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){let o=this.objectFloor.get(this.seatById.get(e)?.rowId??"");if(o){this.opts.onDeckTap(o);return}}if(this.effScale()<se&&this.sections.length){let o=this.seatSection.get(e);if(o){let s=this.focusedSectionId===o.logicalId,r=this.sectionFrameScale(o.logicalId)>this.stage.scaleX()*1.02;if(!s&&r){let n=this.seatById.get(e),l=n?this.renderedSeatPoint(n):void 0;this.opts.onSectionTap?this.opts.onSectionTap(o.logicalId,l):this.focusSection(o.logicalId,{anchor:l});return}}}if(!(this.ownedHold.has(e)||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 on(this.screenPickingHost)}nearestSeatToScreen(e,t,o=!1){return tn(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)}}hoverAffordance(e){return this.ownedHold.has(e)||this.selection.has(e)||this.isSelectable(e)?"full":this.seatInClosedSection(e)?"none":(this.statusById.get(e)??"free")==="held"?"muted":"none"}wireInteraction(){this.seatLayer.on("click tap",e=>{if(this.moved>xe||this.isGhostClick(e))return;let t=wo(e.target);t&&this.seatsPickable()&&this.handleSeatTap(t)}),this.seatLayer.on("mouseover",e=>{let t=wo(e.target);if(!t)return;let o=this.seatById.get(t);if(!o)return;this.hoveredId=t;let s=this.hoverAffordance(t);this.hoverRing.position(this.renderedSeatPoint(o));let r=this.viewMode==="perspective"?this.perspectiveSeatScale.get(t)??1:1;this.hoverRing.scale({x:r,y:r}),this.hoverRing.opacity(s==="muted"?Wh:Ga),this.hoverRing.dash(s==="muted"?Vh:ko),this.hoverRing.visible(s!=="none"),this.overlayLayer.batchDraw(),this.clusterLabels.syncCursor(s==="full"),this.opts.onHover?.(o,{mark:this.seatMarks.get(t),interaction:"hover"})}),this.seatLayer.on("mouseout",()=>{this.hoveredId=null,this.hoverRing.visible(!1),this.overlayLayer.batchDraw(),this.clusterLabels.syncCursor(!1),this.opts.onHover?.(null,{mark:null})}),this.stage.on("wheel",e=>{e.evt.preventDefault(),this.releaseSectionFocusDim();let t=this.container.getBoundingClientRect(),o={x:e.evt.clientX-t.left,y:e.evt.clientY-t.top},s=Math.exp(-e.evt.deltaY*.002);this.zoomAbout(this.stage.scaleX()*V(s,.5,2),o,"frame")}),this.stage.on("click tap",e=>{if(this.moved>xe||this.isGhostClick(e))return;let t=this.stage.getPointerPosition();if(!t)return;if(!this.cached){if(wo(e.target)&&this.seatsPickable())return;if(this.seatsPickable()){let s=this.focusedSectionId,r=this.nearestSeatToScreen(t,Ee),n=r?this.seatSection.get(r):null;if(r&&(!s||n&&this.sectionMatchesFocus(n))){this.handleSeatTap(r);return}let l=r?null:this.nearestSeatToScreen(t,Ee,!0),a=l?this.seatSection.get(l):null;if(l&&(!s||a&&this.sectionMatchesFocus(a))){this.handleSeatTap(l);return}if(s&&this.opts.onBackdropTap&&!this.floorOverview){let h=this.sectionAt(t);if(h&&h!==s){let d=this.sectionTapAnchor(h,this.screenToWorld(t));this.opts.onSectionTap?this.opts.onSectionTap(h,d):this.focusSection(h,{anchor:d})}else h||this.opts.onBackdropTap();return}if(s)return;let c=this.sections.length?this.sectionAt(t):null;if(!c||this.effScale()>=se||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,r=(s?this.objectFloor.get(s):null)??this.deckFloorAt();if(r){this.opts.onDeckTap(r);return}}if(this.sections.length){let s=this.screenToWorld(t),r=this.owned.badgeAt(s)??this.sectionAt(t);if(r){let n=this.sectionTapAnchor(r,s);this.opts.onSectionTap?this.opts.onSectionTap(r,n):this.focusSection(r,{anchor:n});return}}if(this.clusterLabels.focusCluster(t)||this.clusterLabels.glideTowardTap(t))return;let o=Math.max(Ae*1.2,this.stage.scaleX()*2.5);this.zoomAbout(o,t)})}zoomBounds(){let e=.5*this.fitScale;return this.zones.length&&(e=Math.min(e,Xe*.9)),{min:e,max:Math.max(10*this.fitScale,4,Ta(this.markerR))}}zoomAbout(e,t,o="now"){rn(this.stage,e,t,this.zoomBounds())&&(o==="frame"?(this.updateSeatGroupVisibility(),this.scheduleZoomSettle()):this.afterViewChange(),this.stage.batchDraw())}scheduleZoomSettle(){if(this.exportMode||typeof requestAnimationFrame!="function"){this.afterViewChange();return}this.zoomSettleRaf||(this.zoomSettleRaf=requestAnimationFrame(()=>{this.zoomSettleRaf=0,!this.destroyed&&this.afterViewChange()}))}cancelZoomSettle(){this.zoomSettleRaf&&(cancelAnimationFrame(this.zoomSettleRaf),this.zoomSettleRaf=0)}zoomToBounds(e,t){nn(this.stage,e,this.zoomBounds(),t,this.framingViewport()),this.settleView(),this.stage.batchDraw()}focusRegion(e,t){let o=typeof e=="string"?this.sectionBounds(e):e;if(!o)return;if(this.cancelGlide(),t?.animate===!1||this.reducedMotion){this.zoomToBounds(o,t?.minScale);return}let s=this.framingViewport(),r=s.width,n=s.height,{min:l,max:a}=this.zoomBounds(),c=1.12,h=Math.min(r/(o.width*c),n/(o.height*c)),d=V(Math.max(h,t?.minScale??l),l,a),u=s.x+r/2-(o.x+o.width/2)*d,p=s.y+n/2-(o.y+o.height/2)*d,y=this.stage.scaleX(),m=this.stage.x(),f=this.stage.y();if(Math.abs(d-y)<1e-4&&Math.abs(u-m)<.5&&Math.abs(p-f)<.5){this.settleView();return}let g=performance.now(),b=Math.max(180,Math.min(1200,t?.durationMs??this.cameraGlideMs));this.glideInProgress=!0;let S=v=>{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}let w=Math.min(1,(v-g)/b),k=w<.5?4*w*w*w:1-Math.pow(-2*w+2,3)/2,L=y+(d-y)*k;this.stage.scale({x:L,y:L}),this.stage.position({x:m+(u-m)*k,y:f+(p-f)*k}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),w<1?this.glideRaf=requestAnimationFrame(S):(this.glideRaf=0,this.glideInProgress=!1,this.settleView())};this.glideRaf=requestAnimationFrame(S)}applyLabelVisibility(e){let t=e!==this.labelsVisible;if(this.labelsVisible=e,!t||!e)return;if(this.labelFadeRaf&&(cancelAnimationFrame(this.labelFadeRaf),this.labelFadeRaf=0),this.reducedMotion){this.labelGroup.opacity(1);return}let o=performance.now();this.labelGroup.opacity(0);let s=r=>{if(this.destroyed){this.labelFadeRaf=0;return}let n=Math.min(1,(r-o)/90);this.labelGroup.opacity(n),this.stage.batchDraw(),this.labelFadeRaf=n<1?requestAnimationFrame(s):0};this.labelFadeRaf=requestAnimationFrame(s)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){let e=this.effScale();return e>=le?"seats":this.zones.length&&e<Xe?"zones":"sections"}get renderedQualityContext(){return{stage:this.stage,overlayLayer:this.overlayLayer,labelGroup:this.labelGroup,viewMode:this.viewMode,cached:this.cached,effScale:()=>this.effScale(),getRung:()=>this.getRung(),worldToScreen:e=>this.worldToScreen(e),isoLiftLocal:e=>this.isoLiftLocal(e),seats:this.seats,sections:this.sections,zones:this.zones,seatSection:this.seatSection,statusById:this.statusById,selection:this.selection,circleById:this.circleById,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,seatLabelRungOpen:()=>this.seatLabelRungOpen,boothLabelById:this.boothLabelById,accessGlyphById:this.accessGlyphById,freeTextById:this.freeTextById,gaById:this.gaById,perspectiveSeatProjected:this.perspectiveSeatProjected,perspectiveSeatScale:this.perspectiveSeatScale,seatR:this.seatR,canvasBackground:this.canvasBackground,effSelection:this.effSelection,categoryFilter:this.categoryFilter,focusedSectionId:this.focusedSectionId,focusBackdrop:this.focusBackdrop,isSelectable:e=>this.isSelectable(e),seatViewportCulled:e=>this.seatViewportCulled(e),focusedSeatOpacity:(e,t)=>this.focusedSeatOpacity(e,t),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,t)=>this.seatLabelInk(e,t),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return this.cancelSeatReveal(!0),ia(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}let t=e==="sections"?(Se+le)/2:this.seatRungScale(),o=this.framingViewport(),s=o.width,r=o.height,n=ai(this.framingWorldRect()),l=n.x,a=n.y;if(e==="sections"&&this.sections.length>0){let u=this.sections.map(f=>{let g=K(f.outline);return{x:g.x+g.width/2,y:g.y+g.height/2}}),p=s/(t*2),y=r/(t*2);if(!u.some(f=>Math.abs(f.x-n.x)<=p&&Math.abs(f.y-n.y)<=y)){let f=u.reduce((g,b)=>{let S=(b.x-n.x)**2+(b.y-n.y)**2;return S<g.distance?{point:b,distance:S}:g},{point:u[0],distance:1/0});l=f.point.x,a=f.point.y}}let c=e==="seats"?this.seats.filter(u=>u.kind!=="booth"):[];if(c.length>0){let u=c[0],p=1/0;for(let y of c){let m=y.x-n.x,f=y.y-n.y,g=m*m+f*f;g<p&&(u=y,p=g)}l=u.x,a=u.y}let h=s/(t*1.12),d=r/(t*1.12);this.focusRegion({x:l-h/2,y:a-d/2,width:h,height:d})}seatRungScale(){return Dn(this.seatLabelTargetScale())}narrowSeatDetailFocus(e,t,o){let s=this.framingViewport();return Nn({stageWidth:s.width,stageHeight:s.height,fullBounds:t,seatPoints:e,visibleBounds:this.framingWorldRect(),minScale:this.seatRungScale(),tapAnchor:o})}seatLabelTargetScale(){return Mn({seats:this.seats,seatR:this.seatR,labelFont:()=>this.labelFont(),seatLabelScale:e=>this.seatLabelScale(e)})}afterViewChange(){this.retargetRoamingFocus(),this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}settleView(){this.cancelZoomSettle(),this.viewChangeRaf&&(cancelAnimationFrame(this.viewChangeRaf),this.viewChangeRaf=0),this.afterViewChange()}retargetRoamingFocus(){if(!this.focusRoams||!this.focusedSectionId||this.floorOverview)return;let e=Wr({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(),ve+.01,se):this.effScale(),t=Math.max(e,1e-4);for(let[r,n]of this.primaryFocalLabels)ha(r,n,t,(l,a)=>{this.sizeLabel(l,a,l.y())});this.hasSections?(gn(this.sectionLodPaintContext,e),this.owned.sync(e,this.getRung()),this.syncBeacons()):(this.clusterLabels.syncForCamera(e)||this.primaryFocalLabels.size)&&this.bgLayer.batchDraw(),this.clusterLabels.syncCursor(this.hoveredId!=null),this.paintGAStateForView(),this.updateAccessGlyphs(e),this.seatGlyphDetail=Jr(this.glyphMarkers,this.seatR,e,this.seatGlyphDetail);let o=!this.exportMode&&e<le;if(this.viewMode==="perspective"&&this.hasSections&&this.seats.length>2500&&o){this.seatLayer.listening(!1);return}if(o&&!this.cached){if(this.mountCachePending){this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>{this.recacheTimer=null,this.cacheSeatLayer()},0);return}this.cacheSeatLayer()}else!o&&(this.cached||!this.seatLayer.listening())&&(this.cached&&this.releaseSeatLayerBitmap(),this.seatLayer.listening(!this.exportMode),this.cached=!1,this.seatLayer.batchDraw())}rebuildSeatCache(){if(this.seatReveal||this.seatRevealPending)return;this.updateSeatGroupVisibility();let e=V(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(){ba(fi,this.seatLayer)}forceDraw(){this.loadingReveal==="plain"&&this.cancelSeatReveal(!0),this.zoomSettleRaf&&(this.cancelZoomSettle(),this.afterViewChange()),this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<le?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){this.cancelSeatReveal(!0);let e=this.assetGeneration,t=typeof document<"u"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assetPromises.slice(),...t?[t.ready.then(()=>{}),t.load("700 24px Inter").then(()=>{}),t.load('600 12px "JetBrains Mono"').then(()=>{})]:[]]),e!==this.assetGeneration)throw new Error("The chart changed while its export assets were loading.");if(this.assetErrors.length)throw new Error(`Export stopped because ${this.assetErrors.join(" ")}`);this.exportMode&&(this.fitExportContent(),this.forceDraw())}exportSceneBounds(){let e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(n=>n.getClientRect({relativeTo:this.stage})).filter(n=>n.width>0&&n.height>0);if(!e.length)return this.bounds;let t=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y)),s=Math.max(...e.map(n=>n.x+n.width)),r=Math.max(...e.map(n=>n.y+n.height));return{x:t,y:o,width:Math.max(1,s-t),height:Math.max(1,r-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 r=this.exportSceneBounds(),n=Math.max(1,e-o*2),l=Math.max(1,t-o*2),a=Math.min(n/r.width,l/r.height)||1;this.fitScale=a,this.stage.scale({x:a,y:a}),this.stage.position({x:(e-r.width*a)/2-r.x*a,y:(t-r.height*a)/2-r.y*a}),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 r=s instanceof Error?s.message:String(s);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${r}`)}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(),se):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),n=s==="direct-landmark";if(n){let a=Number(t.getAttr("directLandmarkBaseFontSize"))||t.fontSize();t.setAttr("directLandmarkBaseFontSize",a),t.fontSize(Math.max(a,H/e))}let l=n||r||ye(t.fontSize(),e);t.visible(l),o?.visible(l)}for(let{node:t,fontSize:o}of this.iconNodeById.values())t.visible(this.nodeBelongsToFocusedSection(t)||ye(o,e))}nodeBelongsToFocusedSection(e){let t=this.focusedSectionId;if(!t)return!1;this.focusMembershipKey!==t&&(this.focusMembership.clear(),this.focusMembershipKey=t);let o=this.focusMembership.get(e);if(o!==void 0)return o;let s=this.sections.filter(n=>n.id===t||n.logicalId===t||n.zone===t),r=!1;if(s.length){let n=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),l={x:n.x+n.width/2,y:n.y+n.height/2};r=s.some(a=>oe(l,a.outline,a.holes))}return this.focusMembership.set(e,r),r}buildRowLabelPlan(e){this.rowLabelPlan=ya(e,{theme:this.theme,canvasBackground:this.canvasBackground,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:t=>this.objectFilteredOut(t)})}rowLabelBox(e,t,o=j){return yo(e,t,o)}resolveAutomaticRowLabelPosition(e,t,o){return ga(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(){xa(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),labelsWereVisible:()=>this.labelsVisible,onLabelVisibilityChange:e=>this.applyLabelVisibility(e),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,t)=>this.focusedSeatOpacity(e,t),labelGroup:this.labelGroup,labelLiftGroups:this.labelLiftGroups,seatLabelById:this.seatLabelById,seatLabelDrops:this.seatLabelDrops,setSeatLabelRungOpen:e=>{this.seatLabelRungOpen=e},visibleSeatCandidates:()=>this.visibleSeatCandidates(),worldToScreen:e=>this.worldToScreen(e),stage:this.stage,accessGlyphById:this.accessGlyphById,accessGlyphShouldShow:e=>this.accessGlyphShouldShow(e),statusById:this.statusById,renderedSeatPoint:e=>this.renderedSeatPoint(e),viewMode:this.viewMode,perspectiveSeatScale:this.perspectiveSeatScale,ownedHold:this.ownedHold,hasSeatMark:e=>this.seatMarks.has(e),accessFilterDimmed:e=>this.hiddenByAccessFilter(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(){this.gestures.invalidateRect();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())}};kt.ZOOM_STEP=1.4;var Lo=kt;function Wa(i,e){return new Lo(i,e)}function Va(i,e,t){let o=new Map,s=new Map,r=new Map,n=new Map,l=[],a=new Map(Go(i).map(d=>[d.id,d])),c=At(i),h=new Map(c.sections.map(d=>[d.id,d.label]));for(let d of e){o.set(d.label,d.id),s.set(d.label,d),r.set(d.id,d),l.push(d.id);let u=a.get(d.rowId),p=u&&"label"in u&&typeof u.label=="string"?u.label:void 0,y=u?.type==="row"?u.segmentedRow:void 0,m=y?.displayLabel??(u&&"displayLabel"in u&&typeof u.displayLabel=="string"&&u.displayLabel?u.displayLabel:p),f=t.get(d.rowId),g=u?.type==="table"?"table":u?.type==="booth"?"booth":"seat",b=m,S=y?.displayType?.trim()||(u&&"displayType"in u&&typeof u.displayType=="string"&&u.displayType.trim()?u.displayType.trim():void 0),v=d.displayLabel??d.label,w=v.split("-"),k=f||d.kind==="booth"?void 0:m&&v.startsWith(`${m}-`)?v.slice(m.length+1):w[w.length-1]??v;n.set(d.id,{objectId:d.rowId,objectType:g,sectionLabel:h.get(c.objectToSection.get(d.rowId)??""),rowLabel:b,seatNumber:k,...S?{displayType:S,rowType:S}:{}})}return{labelToId:o,labelToSeat:s,seatById:r,seatContext:n,allIds:l}}function Ka(i,e={}){let{baseMs:t=1e3,factor:o=2,maxMs:s=1/0,jitter:r=0,random:n=Math.random}=e,l=Math.min(t*o**Math.max(0,i),s);if(r<=0)return l;let a=Math.min(1,r);return l*(1-a+a*n())}function za(i,e,t){return ot(i).map(o=>{let s=i.categories.find(r=>r.key===o.categoryKey);return{id:o.id,label:o.label,...o.displayLabel?{displayLabel:o.displayLabel}:{},...o.displayType?{displayType:o.displayType}:{},capacity:Math.max(0,Math.floor(o.capacity)),available:Rt(o).filter(r=>t(r)==="free").length,categoryKey:o.categoryKey,tiers:s?.tiers,price:s?.tiers?.[0]?.price??s?.price??0,currency:e}})}function Xa(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 Ya(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}function Kh(i){return i.accessibility?.length?i.accessibility:i.accessible?["wheelchair"]:[]}function Ua(i,e){let t=new Set,o=new Map;for(let s of i){let r=Kh(s);if(!r.length)continue;let n=e(s.id)==="free";for(let l of r)t.add(l),n&&o.set(l,(o.get(l)??0)+1)}return t.size?_o.filter(s=>t.has(s.key)).map(s=>({key:s.key,count:o.get(s.key)??0})):[]}var Mg=5e3,Rg={lost:[],holdLapsed:!1,lapsedLabels:[],recoverable:[]};function zh(i){if(!i.holdActive||i.holdLabels.length===0)return!1;let e=i.now??Date.now();return i.holdExpiresAt!=null&&e>=i.holdExpiresAt+5e3||i.serverHoldActive===!1?!0:!i.holdLabels.some(t=>i.statusOf(t)==="held")}function $a(i){let e=new Set(i.holdLabels),t=i.selection.filter(s=>!e.has(s)&&i.statusOf(s)!=="free");if(!zh(i))return{lost:t,holdLapsed:!1,lapsedLabels:[],recoverable:[]};let o=[...i.holdLabels];return{lost:t,holdLapsed:!0,lapsedLabels:o,recoverable:o.filter(s=>i.statusOf(s)==="free")}}function Ag(i){return i.lost.length>0||i.holdLapsed}function Eg(i){return!i.lapsedLabels.length||!i.recoverable.length?"none":i.recoverable.length===i.lapsedLabels.length?"all":"partial"}function qa(i,e,t=Date.now()){return e&&t<i+5e3}function Za(i){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let e=()=>{document.visibilityState==="visible"&&i()};return document.addEventListener("visibilitychange",e),()=>{typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",e)}}function ja(i){if(!i?.zones?.length)return[];let e=new Set(At(i).sections.filter(t=>t.seatCount>0&&!!t.zone).map(t=>t.zone));return i.zones.filter(t=>e.has(t.id)).map(t=>({id:t.id,label:t.label}))}function Qa(i){let e=i.doc;if(!e?.objects?.length)return null;let t=e.focalPoint??{x:0,y:0},o=ze(e).filter(n=>!i.groupedObjectIds.has(n.rowId)),s=new Set;for(let n of o)i.heldLabels.has(n.label)||i.tierApplies(n)&&(i.accessFilter&&!we(n,i.accessFilter)||i.statusOfLabel(n.label)==="free"&&s.add(n.label));let r=bs(o,s,{qty:i.qty,categoryKey:i.categoryKey,zoneId:i.zoneId,focal:t,preferPremium:!0});return r.labels.length!==i.qty?null:r.labels.every(n=>i.isPremium(n))?[...r.labels]:null}var To=["background","rowLabelColor","textColor","selectionColor"];function Ja(i,e){return!i||!e?!i&&!e:To.every(t=>i[t]===e[t])}function Lt(i){let e=i??{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function mi(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function el(i,e,t){let o=zo(e,t);o==="all"?i.setFloorOverview?.(!0):o&&i.setActiveFloor?.(o)}var Ie=class extends Error{constructor(t){super(t.message);this.status=422;this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function tl(i,e){return!e||i.eventConfigurationId===e.id&&i.eventConfigurationVersion===e.version?i:{...i,eventConfigurationId:e.id,eventConfigurationVersion:e.version}}var yi=class{constructor(){this.ref=null;this.pending=null}reset(e){this.ref=e??null,this.pending=null}load(e,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 il(i){if(i!=null&&(!Number.isInteger(i)||i<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return i??null}function ol(i,e,t,o){if(t!=null&&!Array.isArray(t))throw new TypeError("picker: `selectionValidators` must be an array");let s=[],r=0,n=!1,l=!1;for(let c of t??[])if(c?.type==="minimumSelectedPlaces"){if(!Number.isInteger(c.minimum)||Number(c.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");r=Math.max(r,Number(c.minimum))}else if(c?.type==="consecutiveSeats")n=!0;else if(c?.type==="noOrphanSeats")l=!0;else throw new TypeError(`picker: unsupported selection validator "${String(c?.type??"")}"`);if(r&&s.push({type:"minimumSelectedPlaces",minimum:r}),n&&s.push({type:"consecutiveSeats"}),l&&s.push({type:"noOrphanSeats"}),i!=null&&r>i)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let a=Math.max(0,Math.floor(e??i??Math.max(o,r)));if(i!=null&&a<i)throw new Error("picker: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e!=null&&a<r)throw new Error("picker: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");return{validators:s,maxSelection:i??a}}function Xh(i){let e=Number(i.slice(i.lastIndexOf(":")+1));return Number.isInteger(e)?e:-1}function Yh(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=>Xh(s.id)).sort((s,r)=>s-r);return o.some((s,r)=>s<0||r>0&&s!==o[r-1]+1)}function sl(i,e,t,o,s){let r=o.find(a=>a.type==="minimumSelectedPlaces")?.minimum??0,n=t??r,l=[];return t!=null&&e!==t&&l.push("numberOfPlacesToSelect"),r&&e<r&&l.push("minimumSelectedPlaces"),o.some(a=>a.type==="consecutiveSeats")&&Yh(i)&&l.push("consecutiveSeats"),o.some(a=>a.type==="noOrphanSeats")&&s()&&l.push("noOrphanSeats"),{isValid:l.length===0,count:e,required:n,remaining:Math.max(0,n-e),seats:i,violations:l}}function rl(i){let{id:e,doc:t,seatById:o,groupedTableBySeatId:s}=i,r=t.objects.find(v=>v.type==="section"&&v.id===e);if(!r)return null;let n=i.sectionMembers(e),l=new Map,a=new Map,c=new Set,h=0,d=0;for(let v of n){let w=o.get(v);if(!w)continue;i.matchesAccessFilter&&i.statusOf(v)==="free"&&i.matchesAccessFilter(w)&&(d+=1);let k=s.get(v);if(k){if(c.has(k.label))continue;c.add(k.label),l.set(k.categoryKey,(l.get(k.categoryKey)??0)+k.maxOccupancy),i.statusOf(k.chairs[0]?.id??v)==="free"&&(h+=k.maxOccupancy,a.set(k.categoryKey,(a.get(k.categoryKey)??0)+k.maxOccupancy))}else l.set(w.categoryKey,(l.get(w.categoryKey)??0)+1),i.statusOf(v)==="free"&&(h++,a.set(w.categoryKey,(a.get(w.categoryKey)??0)+1))}let u=[...l.entries()].map(([v,w])=>{let k=t.categories.find(I=>I.key===v),L=k?.tiers?.length?k.tiers.map(I=>I.price):[k?.price??0],x=Math.min(...L),T=Math.max(...L);return{key:v,count:w,label:k?.label??v,color:k?.color??"#6e7bff",price:x,priceMin:x,priceMax:T}}).sort((v,w)=>v.price-w.price),p=u.map(v=>v.priceMin),y=u.map(v=>v.priceMax),m=r.zone?t.zones?.find(v=>v.id===r.zone):void 0,f=v=>{let w=null,k=0;for(let[L,x]of v)(x>k||x===k&&w!=null&&L<w)&&(w=L,k=x);return w},g=f(a)??f(l),S=(g?u.find(v=>v.key===g)?.color:void 0)??m?.color??r.color??"#6e7bff";return{id:e,...g?{dominantCategoryKey:g}:{},...i.matchesAccessFilter?{accessibleLeft:d}:{},label:r.displayLabel??r.label,zoneLabel:m?.label??"",...r.entrance&&r.entrance.trim()?{entrance:r.entrance.trim()}:{},color:S,seatsLeft:h,priceMin:p.length?Math.min(...p):0,priceMax:y.length?Math.max(...y):0,categories:u}}var gi=class{constructor(e={}){this.inFlight=null;this.lastSettledAt=Number.NEGATIVE_INFINITY;this.windowMs=e.windowMs??250,this.now=e.now??(()=>Date.now())}run(e,t=!1){if(!t){if(this.inFlight)return this.inFlight;if(this.now()-this.lastSettledAt<this.windowMs)return Promise.resolve()}let o=e().then(()=>{this.lastSettledAt=this.now()},()=>{}).finally(()=>{this.inFlight===o&&(this.inFlight=null)});return this.inFlight=o,o}markSettled(){this.lastSettledAt=this.now()}reset(){this.inFlight=null,this.lastSettledAt=Number.NEGATIVE_INFINITY}};var Uh=10,$h=15e3,nl=class{constructor(e){this.selectableSeatIds=null;this.lastSelectionValidity=null;this.renderer=null;this.gaSelected=null;this._doc=null;this.eventConfiguration=new yi;this.hidden=new Set;this.mapTheme=null;this.closedSections=new Set;this.labelToId=new Map;this.labelToSeat=new Map;this.expandedSeats=[];this.seatTiers=new Map;this.seatById=new Map;this.seatContext=new Map;this.allIds=[];this.groupedTablesByObject=new Map;this.groupedTablesByLabel=new Map;this.groupedTableBySeatId=new Map;this.tableQuantities=new Map;this.confirmedVariableTables=new Set;this.groupedSelectionOverhead=0;this.ws=null;this.realtime=null;this.reconnectTimer=null;this.attempt=0;this.closed=!1;this.detachVisibility=null;this.hold_=null;this.liveStatuses=new Map;this.liveDefault="free";this.currency="USD";this.expiryTimer=null;this.snapshots=new gi;this.accessFilter=null;this.viewportInsets=null;this.hintShown=!1;this.opts=e,this.api=e.transport,this.key=e.eventKey,this.numberOfPlacesToSelect=il(e.numberOfPlacesToSelect);let t=ol(this.numberOfPlacesToSelect,e.maxSelection,e.selectionValidators,Uh);this.selectionValidators=t.validators,this.maxSelection=t.maxSelection,this.selectableObjectRefs=e.selectableObjects==null?null:[...new Set(e.selectableObjects.filter(o=>typeof o=="string"&&!!o))],this.mapTheme=e.mapTheme??null}get doc(){return this._doc}visibleDoc(){if(!this._doc)return{objects:[]};let e=Yo(this._doc,this.hidden);if(!this.mapTheme)return e;let t={...e.theme??{}};for(let o of To){let s=this.mapTheme[o];s&&(t[o]=s)}return{...e,theme:t}}setMapTheme(e){return Ja(this.mapTheme,e??null)?!1:(this.mapTheme=e??null,this.rebuildPreservingState(),!0)}rebuildPreservingState(){let e=this.renderer;if(!e)return!1;let t=e.getSelection().map(l=>l.id),o=this.getActiveFloorId(),s=e.isFloorOverview?.()??!1,r=e.getFocusedSection?.()??null,n=e.getCameraPose?.();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),r&&e.focusSection?.(r),n&&e.setCameraPose&&e.setCameraPose(n),!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(),r=ot(s).find(n=>n.id===e.objectId);return{...r?.displayLabel?{displayLabel:r.displayLabel}:{},...r?.displayType?{displayType:r.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=x=>Math.round((performance.now()-x)*100)/100;this.closed=!1;let r=performance.now(),n=(async()=>this.api.chart(this.key))().then(x=>({ok:!0,res:x,elapsed:s(r)}),x=>({ok:!1,error:x,elapsed:s(r)})),l=performance.now(),a=(async()=>this.api.objects(this.key))().then(x=>({ok:!0,objects:x,elapsed:s(l)}),()=>({ok:!1,elapsed:s(l)})),c=await n;if(o.loadChart=c.elapsed,!c.ok)return this.emitError(c.error),null;let h=c.res;if(this.closed)return null;this._doc=tl(h.doc,h.event.eventConfiguration),this.eventConfiguration.reset(h.event.eventConfiguration);let d=performance.now();try{let x=Ss(h.doc,h.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(x.map(T=>[T.objectId,T])),this.groupedTablesByLabel=new Map(x.map(T=>[T.label,T])),this.groupedTableBySeatId=new Map(x.flatMap(T=>T.chairs.map(I=>[I.id,T]))),this.tableQuantities=new Map(x.map(T=>[T.label,T.mode==="whole"?T.capacity:T.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=x.reduce((T,I)=>T+Math.max(0,I.chairs.length-1),0)}catch(x){return this.emitError(x),null}this.expandedSeats=ze(h.doc,{deriveRestrictedView:h.doc.derivedRestrictedView===!0});let u=Va(h.doc,this.expandedSeats,this.groupedTablesByObject);this.labelToId=u.labelToId,this.labelToSeat=u.labelToSeat,this.seatById=u.seatById,this.seatContext=u.seatContext,this.allIds=u.allIds;for(let x of this.groupedTablesByLabel.values()){let T=x.chairs[0];T&&(this.labelToId.set(x.label,T.id),this.labelToSeat.set(x.label,T))}o.normalizeBuyerModel=s(d);let p=h.event.currency??this.opts.currency;this.currency=p??"USD";let y=performance.now(),m=Wa(e,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,gaPickerMode:!0,currency:p,...this.opts.loadingReveal?{loadingReveal:this.opts.loadingReveal}:{},onSeatsRevealed:()=>{o.seatsComplete=s(t),this.opts.onSeatsRevealed?.()},onSelect:x=>{this.handleRendererSelect(x)},onDeselect:x=>{this.handleRendererDeselect(x)},onSelectionLimit:this.opts.onSelectionLimit,onHover:(x,T)=>{this.opts.onHover?.(x),this.opts.onSeatHover&&this.opts.onSeatHover(x?this.describeSeat(x,T):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:(x,T)=>this.handleSectionTap(x,T),onBackdropTap:()=>this.overview(),onFocusedSectionChange:x=>this.opts.onSectionFocus?.(this.isSectionClosed(x)?null:this.sectionSummary(x)),onDeckTap:x=>this.handleDeckTap(x),onFps:this.opts.onFps});if(o.createRenderer=s(y),this.closed)return m.destroy(),null;this.renderer=m,this.viewportInsets&&m.setViewportInsets?.(this.viewportInsets);let f=null,g="free",b=[],S=await a;if(S.ok){let x=S.objects;this.hidden=new Set(x.hidden??[]),b=(x.closed??[]).filter(T=>typeof T=="string"),f=x.seats,g=x.default??"free"}if(o.loadStatuses=S.elapsed,this.closed)return m.destroy(),this.renderer=null,null;let v=performance.now();m.setChart(this.visibleDoc()),el(m,h.doc,e.clientWidth),this.opts.colorblindSafe&&m.setColorblindSafe?.(!0),o.buildScene=s(v),this.closedSections=new Set(b);let w=performance.now();b.length&&m.setClosedSections?.(b),f&&this.applySeatsMap(f,g),this.rebuildSelectableSeatIds(),this.opts.selectedObjects?.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),this.pushGAState(),o.applyInitialState=s(w);let k=performance.now();m.forceDraw(),o.firstPaint=s(k);let L=performance.now();return S.ok&&this.snapshots.markSettled(),this.attachVisibility(),this.connect(),o.startRealtime=s(L),o.controllerTotal=s(t),{doc:h.doc,salesClosed:!!h.event.salesClosed,eventName:h.event.name,venue:h.event.venue,startsAt:h.event.startsAt,timezone:h.event.timezone??null,currency:p,mode:h.event.mode??"live",locale:h.event.locale??null,posterUrl:h.event.posterUrl??null,chartDelivery:h.chartDelivery,performanceProfile:o}}getSelection(){if(!this.renderer)return[];let e=[],t=new Set;for(let o of this.renderer.getSelection()){let 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(r=>t.add(r.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 r=this.seatById.has(o)?o:this.labelToId.get(o);r&&t.add(r)}}this.renderer?.deselect([...t]),this.emitSelectionChange()}setMaxSelection(e){this.maxSelection=Math.max(0,Math.floor(e)),this.renderer?.setMaxSelection?.(this.rendererSelectionCap())}select(e){let t=new Set(this.getSelection().map(n=>n.label)),o=new Set,s=[];for(let n of e){let l=this.groupedTableBySeatId.get(n)??this.groupedTablesByLabel.get(n);if(l)this.tableTierResolution(l).kind==="invalid"?s.push(l.label):l.chairs.forEach(c=>{this.isSelectableByPolicy(c.id)&&o.add(c.id)});else{let a=this.seatById.has(n)?n:this.labelToId.get(n);if(!a||!this.isSelectableByPolicy(a))continue;let c=this.seatById.get(a);c&&this.seatTierResolution(c).kind==="invalid"?s.push(c.label):o.add(a)}}if(s.length&&this.emitError(new Ie(Ai(s))),!o.size)return[];if(this.renderer?.select?.([...o]),this.selectionGuestCount()>this.maxSelection)return this.renderer?.deselect([...o]),this.opts.onSelectionLimit?.(this.maxSelection),[];let r=this.getSelection().filter(n=>!t.has(n.label));return r.length&&this.emitSelectionChange(),r}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,r)=>s+(r.quantity??1),0);return sl(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&&Ri(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(r=>e.add(r.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 r=this.tableQuantities.get(e)??o.minOccupancy;return this.tableQuantities.set(e,s),this.selectionGuestCount()>this.maxSelection?(this.tableQuantities.set(e,r),this.opts.onSelectionLimit?.(this.maxSelection),!1):(o.mode==="variable"&&this.confirmedVariableTables.add(e),this.emitSelectionChange(),!0)}async replaceTableQuantity(e,t,o){let s=this.groupedTablesByLabel.get(e),r=this.hold_;if(!s||s.mode!=="variable"||!r?.labels.includes(e))return null;let n=Math.floor(t);if(!Number.isInteger(n)||n<s.minOccupancy||n>s.maxOccupancy)return null;if((r.items??[]).filter(h=>h.label!==e).reduce((h,d)=>h+(d.quantity??1),0)+n>this.maxSelection)return this.opts.onSelectionLimit?.(this.maxSelection),null;let a=(r.items??[]).map(h=>({label:h.label,tierId:h.tierId,quantity:h.label===e?n:h.quantity}));if(!a.some(h=>h.label===e))return null;let c=await this.api.hold(this.key,a,o,r.holdId);return this.tableQuantities.set(e,n),this.setHold({holdId:c.holdId,labels:a.map(h=>h.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((e,t)=>e+(t.quantity??1),0)}handleRendererSelect(e){let t=this.groupedTableBySeatId.get(e.id);if(!this.isSelectableByPolicy(e.id)){this.renderer?.deselect(t?t.chairs.map(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 Ie(Ai([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),o=t?.label??e.label;if(this.hold_?.labels.includes(o)){this.opts.onDeselect?.(t?{...e,label:o}:e);return}t?(this.renderer?.deselect(t.chairs.map(s=>s.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(a=>a.label),r=(this.hold_?.items??[]).filter(a=>a.objectType==="ga"),n=[...new Set([...r.map(a=>a.label),...s])];if(!n.length)return null;let l=this.ticketIssue(n);if(l)throw new Ie(l);if(this.hold_&&this.holdCovers(n))return this.hold_;try{let a=n.map(h=>{let d=r.find(y=>y.label===h);if(d)return{label:h,tierId:d.tierId,quantity:d.quantity};let u=this.labelToSeat.get(h),p=u?this.toSeat(u):null;return{label:h,...p?.tierId?{tierId:p.tierId}:{},...this.tableQuantityRequest(p)}}),c=await this.api.hold(this.key,a,t,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:n,expiresAt:c.expiresAt,items:c.items}),this.hold_}catch(a){throw this.handle409Conflicts(a),a}}async resumeHold(e){if(this.closed||!e||!this.api.resume)return null;let t=await this.api.resume(this.key,e);if(this.closed)return null;let o=[...new Set(t.items.map(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 Ya({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?za(e,this.currency,t=>this.statusOf(t)):[]}setGASelection(e){this.gaSelected=e?new Map(e):null,this.pushGAState()}pushGAState(){this.renderer?.setGAStates?.(Xa(this.getGAAreas(),this.gaSelected))}async holdGA(e,t,o={}){let s=this.visibleDoc();if(!s||!Number.isFinite(t)||t<1)return null;let r=ot(s).find(h=>h.id===e);if(!r)return null;let n=Rt(r).filter(h=>!this.hold_?.labels.includes(h)&&this.statusOf(h)==="free").slice(0,Math.floor(t));if(n.length!==Math.floor(t))return null;let l=new Map;for(let h of this.hold_?.items??[])l.set(h.label,{label:h.label,tierId:h.tierId,quantity:h.quantity});if(this.hold_&&!this.hold_?.items?.length)for(let h of this.hold_.seats)l.set(h.label,{label:h.label,...h.tierId?{tierId:h.tierId}:{}});for(let h of this.getSelection())l.set(h.label,{label:h.label,...h.tierId?{tierId:h.tierId}:{},...this.tableQuantityRequest(h)});for(let h of n)l.set(h,{label:h,...o.tierId?{tierId:o.tierId}:{}});let a=[...l.values()],c=await this.api.hold(this.key,a,o.ttlMs,this.hold_?.holdId);return this.setHold({holdId:c.holdId,labels:a.map(h=>h.label),expiresAt:c.expiresAt,items:c.items}),this.hold_}hasPremiumSeats(){for(let e of this.labelToSeat.values())if(e.commercial?.premium)return!0;return!1}getBestAvailableZones(){return ja(this.visibleDoc())}pickPremiumBlock(e,t,o){return Qa({doc:this.visibleDoc(),qty:e,categoryKey:t,zoneId:o,groupedObjectIds:new Set(this.groupedTablesByObject.keys()),heldLabels:new Set(this.hold_?.labels??[]),accessFilter:this.accessFilter,tierApplies:s=>this.seatTierResolution(s).kind!=="invalid",statusOfLabel:s=>this.getStatus(this.labelToId.get(s)??"")??"free",isPremium:s=>!!this.labelToSeat.get(s)?.commercial?.premium})}async bestAvailable(e,t,o={}){let s=this.renderer;if(!s)return null;if(o.preferPremium){let r=this.pickPremiumBlock(e,t,o.zoneId);if(r){if(this.hold_&&!await this.release())return null;try{let n=r.map(h=>{let d=this.labelToSeat.get(h),u=d?this.toSeat(d):null;return{label:h,...u?.tierId?{tierId:u.tierId}:{}}}),l=await this.api.hold(this.key,n,o.ttlMs);s.clearSelection();let a=this.idsForLabels(r);a.length&&s.setStatus(a,"held"),this.setHold({holdId:l.holdId,labels:[...r],expiresAt:l.expiresAt,items:l.items});let c=r.map(h=>this.labelToSeat.get(h)).filter(h=>!!h).map(h=>this.toSeat(h));return this.opts.onSelectionChange?.(c),this.hold_}catch(n){let{status:l,reason:a}=Lt(n);if(l===409&&a==="event_closed")throw this.opts.onSalesClosed?.(),n}}}if(this.hold_&&!await this.release())return null;try{let r=await this.api.bestAvailable(this.key,e,t,o.zoneId,o.ttlMs);s.clearSelection();let n=this.idsForLabels(r.labels);n.length&&s.setStatus(n,"held"),this.setHold({holdId:r.holdId,labels:[...r.labels],expiresAt:r.expiresAt,items:r.items});let l=r.labels.map(a=>this.labelToSeat.get(a)).filter(a=>!!a).map(a=>this.toSeat(a));return this.opts.onSelectionChange?.(l),this.hold_}catch(r){let{status:n,reason:l}=Lt(r);throw n===409&&l==="event_closed"&&this.opts.onSalesClosed?.(),r}}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 r=t??this.getSelection().map(c=>c.label);if(!r.length)return null;let n=this.ticketIssue(r);if(n)throw new Ie(n);let l;try{if(this.hold_&&this.holdCovers(r))l=this.hold_.holdId;else{let c=this.hold_?.holdId,h=await this.api.hold(this.key,r.map(d=>{let u=this.labelToSeat.get(d),p=u?this.toSeat(u):null;return{label:d,...p?.tierId?{tierId:p.tierId}:{},...this.tableQuantityRequest(p)}}),o,c);l=h.holdId,this.setHold({holdId:l,labels:[...r],expiresAt:h.expiresAt,items:h.items})}await this.api.book(this.key,r,l,e)}catch(c){let{status:h,conflicts:d,reason:u}=Lt(c);if(this.clearHold(),h===409&&u==="event_closed")this.opts.onSalesClosed?.();else if(h===409&&d?.length){let p=new Set(d.map(f=>f.label)),y=this.idsForLabels(p);y.length&&(s.setStatus(y,"booked"),s.deselect(y),this.resetTableQuantitiesForLabels(p));let m=r.filter(f=>!p.has(f));m.length&&l&&this.api.release(this.key,m,l).catch(()=>{}),this.emitSelectionChange()}else l&&this.api.release(this.key,r,l).catch(()=>{});throw c}let a=this.idsForLabels(r);return a.length&&(s.setStatus(a,"booked"),s.deselect(a)),this.clearHold(),this.resetTableQuantitiesForLabels(r),this.emitSelectionChange(),this.opts.onBook?.(e),r}async release(){let e=this.hold_;if(!e)return!0;try{let o=await this.api.release(this.key,e.labels,e.holdId);if(!this.releaseConfirmed(o,e.labels))return await this.resnapshot(),!1}catch(o){return this.emitError(o),!1}if(this.hold_?.holdId!==e.holdId)return!0;this.clearHold(),this.resetTableQuantitiesForLabels(e.labels);let t=this.idsForLabels(e.labels);return t.length&&(this.renderer?.deselect(t),this.renderer?.setStatus(t,"free")),!0}async releaseLabels(e){let t=this.hold_;if(!t)return!0;let o=e.filter(l=>t.labels.includes(l));if(!o.length)return!0;try{let l=await this.api.release(this.key,o,t.holdId);if(!this.releaseConfirmed(l,o))return await this.resnapshot(),!1}catch(l){return this.emitError(l),!1}if(this.hold_?.holdId!==t.holdId)return!0;let s=t.labels.filter(l=>!o.includes(l)),r=t.items?.filter(l=>!o.includes(l.label));s.length?this.setHold({...t,labels:s,items:r}):this.clearHold(),this.resetTableQuantitiesForLabels(o);let n=this.idsForLabels(o);return n.length&&(this.renderer?.deselect(n),this.renderer?.setStatus(n,"free")),!0}releaseConfirmed(e,t){let o=e?.released;return!Array.isArray(o)||t.every(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,r]of this.seatById)t.has(r.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()}setViewportInsets(e){this.viewportInsets=e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:null,this.renderer?.setViewportInsets?.(this.viewportInsets)}getViewportInsets(){return this.renderer?.getViewportInsets?.()??this.viewportInsets??{top:0,right:0,bottom:0,left:0}}worldToScreen(e){return this.renderer?.worldToScreen(e)??{x:0,y:0}}setSelectionFocus(e){this.renderer?.setSelectionFocus?.(e)}setAccessibilityFilter(e){this.accessFilter=e===null?null:[...e],this.renderer?.setAccessibilityFilter?.(e);let t=this.renderer?.getFocusedSection?.()??null;t&&this.opts.onSectionFocus?.(this.sectionSummary(t))}getAccessibilityFilter(){return this.accessFilter?[...this.accessFilter]:null}focusAccessibilityFilter(e){let t=this.renderer;if(!t?.focusAccessibleSeats)return!1;let o=e===void 0?this.accessFilter:e;if(!o)return!1;let s=this.floorForAccessibility(o);s&&this.setFloor(s);let r=t.focusAccessibleSeats(o);return r&&this.opts.onSectionFocus?.(null),r}floorForAccessibility(e){let t=this._doc;if(!t?.floors||t.floors.length<2)return null;let o=new Set(e),s=a=>o.size===0?!!a.accessible:!!a.accessibility?.some(c=>o.has(c)),r=a=>a.some(c=>c.type==="row"&&(c.overrides??[]).some(s)),n=this.getActiveFloorId(),l=t.floors.find(a=>a.id===n);return l&&r(l.objects)?null:t.floors.find(a=>r(a.objects))?.id??null}accessibilityFilterDims(e){return this.accessFilter?Qe(e,this.accessFilter)==="other":!1}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)}!e?.length&&this.accessFilter&&this.focusAccessibilityFilter()||(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=l=>l.some(a=>a.type==="row"&&(o.has(a.categoryKey)||(a.overrides??[]).some(c=>c.categoryKey!=null&&o.has(c.categoryKey)))||a.type==="gaArea"&&o.has(a.categoryKey)),r=this.getActiveFloorId(),n=t.floors.find(l=>l.id===r);return n&&s(n.objects)?null:t.floors.find(l=>s(l.objects))?.id??null}getViewport(){let e=this.renderer;return!e?.getVisibleWorldRect||!e.getWorldBounds?null:{visible:e.getVisibleWorldRect(),bounds:e.getWorldBounds()}}getMinimapSnapshot(){return this.renderer?.getMinimapSnapshot?.()??{sections:[],seats:[]}}panToWorld(e){this.renderer?.panToWorld?.(e)}clearSectionFocus(){this.renderer?.clearSectionFocus?.(),this.opts.onSectionFocus?.(null)}getRenderedQualityEvidence(){return this.renderer?.getRenderedQualityEvidence()??null}focusSection(e,t){this.handleSectionTap(e,t)}getSectionSeatCount(e){return this.renderer?.sectionMembers?.(e)?.length??0}overview(){this.renderer?.clearSectionFocus?.(),this.renderer?.zoomToFit(),this.opts.onSectionFocus?.(null)}handleSectionTap(e,t){let o=this.renderer;if(o){if(o.focusSection?o.focusSection(e,t?{anchor:t}:void 0):o.focusRegion?.(e),this.isSectionClosed(e)){this.opts.onSectionFocus?.(null);return}this.opts.onSectionFocus?.(this.sectionSummary(e))}}sectionSummary(e){return!this.renderer||!this._doc?null:rl({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=>we(t,this.accessFilter)}:{}})}destroy(){if(this.closed=!0,this.detachVisibility?.(),this.detachVisibility=null,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null),this.realtime){try{this.realtime.stop()}catch{}this.realtime=null}if(this.ws){try{this.ws.close()}catch{}this.ws=null}this.renderer?.destroy(),this.renderer=null}toSeat(e){let t=this.groupedTableBySeatId.get(e.id);if(t)return this.toTableSeat(t);let o=e.commercial?{commercial:e.commercial}:void 0,s=e.displayLabel?{displayLabel:e.displayLabel}:void 0,r=e.accessibility?.length?{accessibility:e.accessibility}:void 0,n=e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:void 0,l=this.seatContext.get(e.id),a=this.tiersForSeat(e),c=this.seatTierResolution(e);if(c.kind!=="resolved"||!a)return{id:e.id,label:e.label,...s,...l,categoryKey:e.categoryKey,price:this.priceFor(e.categoryKey),currency:this.currency,...o,...r,...n};let h=c.tier;return{id:e.id,label:e.label,...s,...l,categoryKey:e.categoryKey,price:h.price,currency:this.currency,tiers:a,tierId:h.id,...o,...r,...n}}toTableSeat(e){let t=e.chairs[0],o=this.tiersFor(e.categoryKey)?.filter(n=>Wt(this._doc,this.tableTierSeat(e),n.id).kind==="resolved"),s=this.tableTierResolution(e),r=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:r?.price??this.priceFor(e.categoryKey),currency:this.currency,...o?{tiers:o,tierId:r?.id}:{},objectType:"table",bookingMode:e.mode,quantity:this.tableQuantities.get(e.label)??(e.mode==="whole"?e.capacity:e.minOccupancy),capacity:e.capacity,minOccupancy:e.minOccupancy,maxOccupancy:e.maxOccupancy,physicalSeatIds:e.chairs.map(n=>n.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=ys(this._doc,e);return t.length?t:void 0}seatTierResolution(e){return this._doc?Wt(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 Wt(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(r=>r.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 gs(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"?G("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}let o=new Set(e.getSelection().map(r=>r.id));(o.size?Ri(this.seatById.values(),r=>e.getStatus(r),o):[]).length>0?(this.hintShown=!0,this.opts.onHint(G("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(r=>t.labels.includes(r)))return!1;let o=new Map((t.items??[]).map(r=>[r.label,r.tierId])),s=new Map((t.items??[]).map(r=>[r.label,r.quantity??1]));return e.every(r=>{let n=this.labelToSeat.get(r),l=n?this.toSeat(n):null,a=l?.tierId??null;return(l?.objectType!=="table"||(l.bookingMode!=="variable"||this.confirmedVariableTables.has(r))&&(!s.has(r)||s.get(r)===l.quantity))&&(!o.has(r)||o.get(r)===a)})}handle409Conflicts(e){let{status:t,conflicts:o}=Lt(e);if(t!==409||!o?.length)return;let s=this.renderer;if(!s)return;let r=this.idsForLabels(o.map(n=>n.label));r.length&&(s.deselect(r),s.setStatus(r,"held"),this.resetTableQuantitiesForLabels(o.map(n=>n.label))),this.emitSelectionChange()}setHold(e,t="created"){for(let r of e.items??[])this.groupedTablesByLabel.has(r.label)&&r.quantity!=null&&(this.tableQuantities.set(r.label,r.quantity),this.groupedTablesByLabel.get(r.label)?.mode==="variable"&&this.confirmedVariableTables.add(r.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(qa(e.expiresAt,e.labels.some(t=>this.statusOf(t)==="held"))){this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},1e3);return}this.clearHold(),this.opts.onHoldExpired?.()}}}applySeatsMap(e,t="free"){let o=this.renderer;if(!o)return;this.liveStatuses=new Map(Object.entries(e)),this.liveDefault=t;let s=mi(t);this.allIds.length&&o.setStatus(this.allIds,s),o.setOwnedHold?.(this.idsForLabels(this.hold_?.labels??[]));let r={free:[],held:[],booked:[],not_for_sale:[]};for(let[l,a]of Object.entries(e))r[mi(a)].push(...this.idsForLabel(l));["free","held","booked","not_for_sale"].forEach(l=>{l!==s&&r[l].length&&o.setStatus(r[l],l)});let n=this.notForSaleCategorySeatIds();n.length&&o.setStatus(n,"not_for_sale"),this.clearBookedHoldIfSettled(),this.opts.onStatusChange?.()}statusOf(e){return this.liveStatuses.get(e)??this.liveDefault}clearBookedHoldIfSettled(){let e=this.hold_;e?.labels.every(t=>this.statusOf(t)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(e.labels))}resnapshot(e=!1){return this.snapshots.run(async()=>{let t=await this.api.objects(this.key);this.applySeatsMap(t.seats,t.default??"free")},e)}refresh(){return this.resnapshot(!0)}async refreshAvailability(){await this.resnapshot();let e=this.hold_,t=$a({selection:this.getSelection().map(o=>o.label),holdLabels:e?.labels??[],holdActive:!!e,holdExpiresAt:e?.expiresAt??null,statusOf:o=>this.statusOf(o)});if(t.lost.length&&this.deselect(t.lost),t.holdLapsed){this.clearHold(),this.resetTableQuantitiesForLabels(t.lapsedLabels);let o=this.idsForLabels(t.lapsedLabels);o.length&&this.renderer?.deselect(o),this.opts.onHoldExpired?.()}return this.opts.onAvailabilityRefresh?.(t),t}getAccessNeeds(){return Ua(this.seatById.values(),e=>this.getStatus(e)??"free")}attachVisibility(){this.detachVisibility||(this.detachVisibility=Za(()=>{this.closed||this.refreshAvailability().then(()=>{this.closed||this.renderer?.forceDraw()})}))}realtimeSink(){return{applyStatuses:e=>this.applyStatusChanges(e),applyProjection:e=>this.applySeatsMap(e.exceptions,e.default),resync:()=>this.resnapshot(),onSections:(e,t)=>{let o=this.syncHidden(e),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 r=mi(o.status);this.opts.flashOnLiveChange&&r!=="free"&&s.some(n=>t.getStatus(n)==="free")&&!this.hold_?.labels.includes(o.label)&&s.forEach(n=>t.flashSeat(n,r==="held"?"#f4b740":"#f43f5e")),t.setStatus(s,r)}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 n=s;Array.isArray(n.hidden)&&this.syncHidden(n.hidden)&&(this.resnapshot(),this.opts.onStatusChange?.()),Array.isArray(n.closed)&&this.syncClosed(n.closed)&&this.opts.onStatusChange?.(),n.type!=="hidden"&&(n.seats&&typeof n.seats=="object"?this.applySeatsMap(n.seats):Array.isArray(n.changes)&&this.applyStatusChanges(n.changes))},t.onclose=()=>{this.ws===t&&(this.ws=null),this.scheduleReconnect()},t.onerror=()=>{try{t.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Ka(e,{baseMs:1e3,maxMs:$h,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}};var qh=5,Zh=-1.1,xo=35;function Co(i,e){let t=i-ee,o=Math.atan2(qh-t,e)*180/Math.PI,s=Math.atan2(Zh-t,e)*180/Math.PI;return s<-xo&&(o+=-xo-s,s=-xo),{topPitch:o,basePitch:s}}var q=2048,ue=1024,xt=Oo,E=Math.PI*2,jh=ue/180,tt=i=>(i+180)/360*q,z=i=>(90-i)/180*ue;function dl(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 ul(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 bi=96,Mo=360/bi,Qh=.6,Io=[17,23,42];function Po(i,e,t=1){let o=Math.max(0,Math.min(.58,e)),s=Math.round(i[0]+(Io[0]-i[0])*o),r=Math.round(i[1]+(Io[1]-i[1])*o),n=Math.round(i[2]+(Io[2]-i[2])*o);return`rgba(${s},${r},${n},${t})`}function al(i,e,t){return[Math.round(i[0]+(e[0]-i[0])*t),Math.round(i[1]+(e[1]-i[1])*t),Math.round(i[2]+(e[2]-i[2])*t)]}function ie(i,e,t){let o=(1-Math.abs(2*t-1))*e,s=(i%360+360)%360/60,r=o*(1-Math.abs(s%2-1)),n=0,l=0,a=0;s<1?[n,l,a]=[o,r,0]:s<2?[n,l,a]=[r,o,0]:s<3?[n,l,a]=[0,o,r]:s<4?[n,l,a]=[0,r,o]:s<5?[n,l,a]=[r,0,o]:[n,l,a]=[o,0,r];let c=t-o/2;return[Math.round((n+c)*255),Math.round((l+c)*255),Math.round((a+c)*255)]}var ll=new Map;function cl(i){if(!i)return null;let e=ll.get(i);if(e)return e;let t=2166136261;for(let r=0;r<i.length;r++)t^=i.charCodeAt(r),t=Math.imul(t,16777619);let o=(t>>>0)%360,s=ie(o,.3,.42);return ll.set(i,s),s}function Jh(i,e,t,o){let s=new Array(bi).fill(null),r=0,n=i.sectionId;for(let l of e){if(l.id===i.id)continue;let a=l.sectionId;if(!a||n&&a===n)continue;let c=l.x-i.x,h=l.y-i.y,d=Math.hypot(c,h)*xt;if(d<1.5||d>95)continue;let u=l.eyeHeightM??ee,p=u-o;Math.abs(p)>r&&(r=Math.abs(p));let y=Math.atan2(p,d)*180/Math.PI,m=Math.atan2(u-ee-o,d)*180/Math.PI,g=((Math.atan2(c,-h)-t)*180/Math.PI+540)%360-180,b=Math.min(bi-1,Math.max(0,Math.floor((g+180)/Mo))),S=y>34&&d<16,v=s[b];v?(y>v.top&&(v.top=y),m<v.base&&(v.base=m),d<v.nearM&&(v.nearM=d,v.tint=cl(l.categoryKey)),v.overhead=v.overhead||S):s[b]={top:y,base:m,nearM:d,overhead:S,tint:cl(l.categoryKey)}}return{bins:s,maxDelta:r}}function ed(i,e,t,o){for(let s=0;s<bi;s++){let r=e[s];if(!r)continue;let n=-180+s*Mo,l=t(n),a=t(n+Mo);if(!(a>l))continue;let c=Math.min(72,r.top),h=Math.min(r.base,-4),d=o(c),u=o(h);if(u<=d)continue;let p=r.nearM/95,y=r.tint,m=y?al([44,54,80],y,.34):[44,54,80],f=y?al([24,30,48],y,.28):[24,30,48],g=i.createLinearGradient(0,d,0,u);g.addColorStop(0,Po(m,p)),g.addColorStop(.24,Po(f,p)),g.addColorStop(1,Po([10,13,22],p)),i.fillStyle=g,i.fillRect(l,d,a-l+1,u-d),i.fillStyle=`rgba(150,165,205,${.35*(1-p*.55)})`,i.fillRect(l,d,a-l+1,1.5);let S=Math.min(u,o(0))-d;if(S>8){let w=1-p*.4;for(let k=1;k<6;k++){let L=d+S*k/6;i.fillStyle=`rgba(0,0,0,${.16*w})`,i.fillRect(l,L,a-l+1,1.5),i.fillStyle=`rgba(120,134,170,${.1*w})`,i.fillRect(l,L+1.5,a-l+1,1.2)}}if(r.overhead){let v=o(Math.min(86,c+12)),w=i.createLinearGradient(0,v,0,d);w.addColorStop(0,"rgba(3,4,8,0.9)"),w.addColorStop(1,"rgba(3,4,8,0)"),i.fillStyle=w,i.fillRect(l,v,a-l+1,d-v),i.fillStyle="rgba(120,130,160,0.14)",i.fillRect(l,d-1.5,a-l+1,1.5)}}}function td(i,e,t){let s=new Array(72).fill(!1),r=new Array(72).fill(1/0),n=new Set,l=0;for(let g of t){l++,g.sectionId&&n.add(g.sectionId);let b=g.x-e.x,S=g.y-e.y,v=Math.hypot(b,S)*xt;if(v<.5)continue;let w=Math.atan2(b,-S),k=Math.floor((w+Math.PI)/E*72);k<0?k=0:k>=72&&(k=71),s[k]=!0,v<r[k]&&(r[k]=v)}let a=0,c=[];for(let g=0;g<72;g++)s[g]&&(a++,c.push(r[g]));let h=a/72*360;c.sort((g,b)=>g-b);let d=c.length?c[c.length>>1]:0,u=c.length?c[Math.floor(c.length*.15)]??d:0,p=c.length?c[Math.floor(c.length*.85)]??d:0,y=u>.5?p/u:1,m=dl(`${l}|${[...n].sort().join(",")}|${Math.round(e.x)},${Math.round(e.y)}`),f;return h>=300&&d>11&&y>1.35?f="sport":h>=285?f="arena":f="proscenium",{mode:f,seed:m,voidRadiusM:d,aspect:y}}var id=5;function od(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 sd(i,e,t,o,s){let r=o*.44,n=o*s.shoulderK,l=o*.66,a=o*1.68,c=o*5.4,h=`rgba(${s.clothing[0]},${s.clothing[1]},${s.clothing[2]},${s.alpha})`,d=`rgba(${s.tone[0]},${s.tone[1]},${s.tone[2]},${s.alpha})`;i.save(),i.translate(e,t);let u=s.lean*o;i.fillStyle=h,i.beginPath(),i.moveTo(-r,l),i.quadraticCurveTo(-r*1.18,a-u-o*.6,-n,a-u),i.quadraticCurveTo(-n*1.05,a+o*1.2,-n*.94,c),i.lineTo(n*.94,c),i.quadraticCurveTo(n*1.05,a+o*1.2,n,a+u),i.quadraticCurveTo(r*1.18,a+u-o*.6,r,l),i.closePath(),i.fill(),i.fillStyle=d,i.fillRect(-r*.82,o*.5,r*1.64,o*.9),i.save(),i.rotate(s.tilt),i.translate(s.turn*o,0),i.fillStyle=d,o>=18?(i.beginPath(),i.moveTo(-o*.9,-o*.15),i.quadraticCurveTo(-o*.96,-o*1.12,0,-o*1.06),i.quadraticCurveTo(o*.96,-o*1.12,o*.9,-o*.15),i.quadraticCurveTo(o*.86,o*.55,o*.36,o*.98),i.quadraticCurveTo(0,o*1.14,-o*.36,o*.98),i.quadraticCurveTo(-o*.86,o*.55,-o*.9,-o*.15),i.closePath(),i.fill(),o>=22&&(i.beginPath(),i.ellipse(-o*.9,o*.18,o*.13,o*.22,0,0,E),i.ellipse(o*.9,o*.18,o*.13,o*.22,0,0,E),i.fill())):(i.beginPath(),i.ellipse(0,0,o*.9,o*1.06,0,0,E),i.fill()),od(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(-n*.8,a-o*.05),i.quadraticCurveTo(-r,a-o*.75,0,a-o*.82),i.quadraticCurveTo(r,a-o*.75,n*.8,a-o*.05),i.stroke()),i.restore()}function rd(i,e,t,o,s,r,n){i.fillStyle=`rgba(${s[0]},${s[1]},${s[2]},${n})`,i.beginPath(),i.moveTo(e-o*1.72,t+o*4),i.quadraticCurveTo(e-o*1.78,t+o*1.55,e-o*.46,t+o*1.02),i.lineTo(e-o*.4,t+o*.62),i.lineTo(e+o*.4,t+o*.62),i.lineTo(e+o*.46,t+o*1.02),i.quadraticCurveTo(e+o*1.78,t+o*1.55,e+o*1.72,t+o*4),i.closePath(),i.fill(),i.fillStyle=`rgba(${r[0]},${r[1]},${r[2]},${n})`,i.beginPath(),i.ellipse(e,t,o*.9,o*1.05,0,0,E),i.fill()}function Ao(i,e,t,o,s){let r=o*.1,n=t-o*.9,l=t-o*.74,a=t-o*.46,c=o*.13,h=o*.09,d=`rgba(${s.tone[0]},${s.tone[1]},${s.tone[2]},${s.alpha})`,u=i.createRadialGradient(e,t,1,e,t,o*.24);u.addColorStop(0,"rgba(0,0,0,0.4)"),u.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.scale(1,.28),i.fillStyle=u,i.beginPath(),i.ellipse(e,t/.28,o*.24,o*.24,0,0,E),i.fill(),i.restore(),i.fillStyle=d,i.beginPath(),i.moveTo(e-h,a),i.lineTo(e-h*.7,t),i.lineTo(e-h*.1,t),i.lineTo(e-h*.1,a+o*.02),i.lineTo(e+h*.1,a+o*.02),i.lineTo(e+h*.1,t),i.lineTo(e+h*.7,t),i.lineTo(e+h,a),i.closePath(),i.fill(),i.beginPath(),i.moveTo(e-c,l),i.quadraticCurveTo(e-c*.9,a-o*.12,e-h,a),i.lineTo(e+h,a),i.quadraticCurveTo(e+c*.9,a-o*.12,e+c,l),i.quadraticCurveTo(e,l-o*.05,e-c,l),i.closePath(),i.fill(),i.lineCap="round",i.lineJoin="round",i.strokeStyle=d,i.lineWidth=o*.055;let p=l+o*.02;s.pose===1?(i.beginPath(),i.moveTo(e-c*.8,p),i.lineTo(e-c*1.5,t-o*1.02),i.moveTo(e+c*.8,p),i.lineTo(e+c*1.5,t-o*1.02),i.stroke()):s.pose===2?(i.beginPath(),i.moveTo(e-c*.8,p),i.lineTo(e+h*1.4,a-o*.02),i.moveTo(e+c*.8,p),i.lineTo(e-h*.4,a-o*.06),i.stroke(),i.fillStyle=d,i.beginPath(),i.ellipse(e+h*1.5,a-o*.04,o*.07,o*.09,-.5,0,E),i.fill()):s.pose===3?(i.beginPath(),i.moveTo(e-c*.8,p),i.lineTo(e-c*.2,n+r*.6),i.moveTo(e+c*.8,p),i.lineTo(e+c*1.1,a),i.stroke(),i.lineWidth=o*.02,i.beginPath(),i.moveTo(e-c*.2,n+r*.9),i.lineTo(e-c*.2,t-o*.02),i.stroke()):(i.beginPath(),i.moveTo(e-c*.85,p),i.lineTo(e-c*.95,a+o*.02),i.moveTo(e+c*.85,p),i.lineTo(e+c*.95,a+o*.02),i.stroke()),i.fillStyle=d,i.fillRect(e-r*.34,n+r*.6,r*.68,r*.9),i.beginPath(),i.ellipse(e,n,r*.86,r*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,l),i.lineTo(e-r*.6,n+r*.4),i.moveTo(e-r*.7,n),i.ellipse(e,n,r*.84,r*1.02,0,Math.PI*1.05,Math.PI*1.55),i.stroke())}function Si(i,e,t,o,s,r,n,l,a){i.save(),i.globalCompositeOperation="lighter";let c=i.createLinearGradient(0,t,0,s);c.addColorStop(0,`rgba(${l},${a})`),c.addColorStop(.5,`rgba(${l},${(a*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${l},0)`),i.fillStyle=c,i.beginPath(),i.moveTo(e-r,t),i.lineTo(o-n,s),i.lineTo(o+n,s),i.lineTo(e+r,t),i.closePath(),i.fill(),i.restore()}function Eo(i,e,t,o,s){let r=i.createRadialGradient(e,t,0,e,t,o*3);r.addColorStop(0,`rgba(${s},0.9)`),r.addColorStop(.4,`rgba(${s},0.35)`),r.addColorStop(1,`rgba(${s},0)`),i.fillStyle=r,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 wb(i,e,t){let o=document.createElement("canvas");o.width=q,o.height=ue;let s=o.getContext("2d"),r=e.x-i.x,n=e.y-i.y,l=Math.hypot(r,n),a=Math.max(2,l*xt),c=i.eyeHeightM??ee,h=td(i,e,t),d=ul(h.seed),u=210+d()*150,p=ie(220+(d()-.5)*60,.55,.82),y=`${p[0]},${p[1]},${p[2]}`,m=s.createLinearGradient(0,0,0,ue);m.addColorStop(0,"#080b12"),m.addColorStop(.42,"#12182c"),m.addColorStop(.5,"#1c2440"),m.addColorStop(.56,"#151b2c"),m.addColorStop(.78,"#171e30"),m.addColorStop(1,"#131829"),s.fillStyle=m,s.fillRect(0,0,q,ue);let f=s.createLinearGradient(0,z(-6),0,ue);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,z(-6),q,ue-z(-6));let g=Math.atan2(r,-n),b=Jh(i,t,g,c),S=b.maxDelta>=Qh;S&&ed(s,b.bins,tt,z);let v=Math.max(.3,Math.min(1,1-(a-6)/60)),w=Co(c,a),k=Math.min(80,Math.atan2(4,a)*180/Math.PI),L=Math.min(45,w.topPitch),x=w.basePitch;h.mode==="sport"?ld(s,a,c,h,v,u,y,d):h.mode==="arena"?ad(s,a,c,h,v,y,d):nd(s,k,L,x,v,u,y,d);let T=h.mode==="sport"?34:24+Math.floor(d()*8);s.fillStyle=`rgba(${y},0.8)`;for(let P=0;P<T;P++){let M=(P+.5)/T*q,R=z(h.mode==="sport"?58:54+P*7%3*6);s.beginPath(),s.arc(M,R,h.mode==="sport"?2.6:3.2,0,E),s.fill()}cd(s,i,t,e,g,c,r,n,S,h);let I=s.createLinearGradient(0,0,0,ue);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,q,ue),{url:o.toDataURL("image/jpeg",.82),distanceM:Math.round(a)}}function nd(i,e,t,o,s,r,n,l){let a=tt(-e),c=tt(e),h=z(t),d=z(o),u=c-a,p=d-h,y=z(Math.min(50,t+10)),m=u*(1.1+(1-s)*.5),f=i.createRadialGradient(q/2,(h+d)/2,8,q/2,(h+d)/2,m);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(a-u*.6,h-p*1.2,u*2.2,p*3.4);let g=ie(r,.62,.55),b=ie(r+40,.7,.5),S=ie(r+70,.78,.52);i.save(),i.beginPath(),i.rect(a,h,u,p),i.clip();let v=i.createLinearGradient(0,h,0,d);v.addColorStop(0,`rgb(${g[0]},${g[1]},${g[2]})`),v.addColorStop(.5,`rgb(${b[0]},${b[1]},${b[2]})`),v.addColorStop(1,`rgb(${S[0]},${S[1]},${S[2]})`),i.globalAlpha=.8,i.fillStyle=v,i.fillRect(a,h,u,p),i.globalAlpha=1;let w=i.createRadialGradient(q/2,(h+d)/2,u*.12,q/2,(h+d)/2,u*.62);w.addColorStop(0,"rgba(6,8,14,0)"),w.addColorStop(.7,"rgba(6,8,14,0.15)"),w.addColorStop(1,"rgba(5,6,11,0.92)"),i.fillStyle=w,i.fillRect(a,h,u,p),i.restore();let k=3+Math.floor(l()*3),L=p*.46,x=d-p*.08;for(let B=0;B<k;B++){let Q=(B+1)/(k+1),X=a+u*(.22+Q*.56+(l()-.5)*.06);Ao(i,X,x,L*(.9+l()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(l()*4),rim:ie(r+20,.5,.7),rimStrength:.7})}i.fillStyle="#05070d",i.fillRect(a-u*.5,y,u*.5,d-y),i.fillRect(c,y,u*.5,d-y);let T=u*.055+3,I=T*1.35;i.fillStyle="#03050a",i.beginPath(),i.moveTo(a,d),i.lineTo(a-T,d),i.lineTo(a-I,y),i.lineTo(a+u*.012,y),i.closePath(),i.fill(),i.beginPath(),i.moveTo(c,d),i.lineTo(c+T,d),i.lineTo(c+I,y),i.lineTo(c-u*.012,y),i.closePath(),i.fill(),i.fillRect(a-I,y,u+I*2,(d-y)*.12);let P=p*.14,M=y+(d-y)*.12;i.fillStyle="rgba(4,6,12,0.96)";let R=7;i.beginPath(),i.moveTo(a-I,M);for(let B=0;B<=R;B++){let Q=a-I+(u+I*2)*B/R;i.quadraticCurveTo(Q-(u+I*2)/R/2,M+P,Q,M)}i.lineTo(c+I,M),i.lineTo(c+I,y),i.lineTo(a-I,y),i.closePath(),i.fill(),i.fillStyle=`rgba(${n},0.12)`,i.fillRect(a-1.5,M,1.5,d-M),i.fillRect(c,M,1.5,d-M),i.fillStyle="#0b0f18",i.fillRect(a-T,d-p*.05,u+T*2,p*.05+3);let C=i.createLinearGradient(0,d-p*.05,0,d+p*.12);C.addColorStop(0,`rgba(255,206,140,${(.5*s).toFixed(3)})`),C.addColorStop(1,"rgba(255,206,140,0)"),i.fillStyle=C,i.fillRect(a-T,d-p*.05,u+T*2,p*.2);let A=3+Math.floor(l()*2);for(let B=0;B<A;B++){let Q=(B+1)/(A+1),X=a+u*(Q+(l()-.5)*.08),Y=z(Math.min(62,t+26)),J=(l()-.5)*u*.16;Si(i,X,Y,X+J,d,4,u*.09,n,.16*(.7+s*.5)),Eo(i,X,Y,2.4,n)}}function ad(i,e,t,o,s,r,n){let l=Math.min(e*.6,Math.max(3,o.voidRadiusM)),a=Math.min(55,Math.atan2(l,e)*180/Math.PI),c=q/2,h=1.2,d=Math.max(e*.45,e-l),u=e+l,p=Math.atan2(h-t,d)*180/Math.PI,y=Math.atan2(h-t,u)*180/Math.PI,m=Math.atan2(-t,d)*180/Math.PI,f=z(p),g=z(y),b=z(m),S=tt(a)-c,v=Math.max(6,(f-g)/2),w=(f+g)/2,k=i.createRadialGradient(c,b,4,c,b,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,g-v,S*5.2,b-g+v+40),i.restore(),i.fillStyle="#0c1019",i.beginPath(),i.moveTo(c-S,w),i.ellipse(c,w,S,v,0,Math.PI,0,!1),i.lineTo(c+S,b),i.ellipse(c,b,S,v,0,0,Math.PI,!1),i.closePath(),i.fill();let L=i.createLinearGradient(0,w,0,b);L.addColorStop(0,`rgba(${r},0.14)`),L.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=L,i.fillRect(c-S,w,S*2,b-w);let x=[[{u:-.24,v:.4,lead:!0,pose:3},{u:.34,v:-.04,pose:2},{u:-.52,v:-.38,pose:0}],[{u:.2,v:.34,lead:!0,pose:3},{u:-.3,v:-.08,pose:2}],[{u:-.1,v:.28,lead:!0,pose:1},{u:.44,v:-.2,pose:2},{u:-.46,v:-.14,pose:2},{u:.08,v:-.46,pose:0}]],T=x[Math.floor(n()*x.length)],I=n()<.5?-1:1,P=F=>c+F.u*I*S*.84,M=F=>w+F.v*v*.8,R=T.find(F=>F.lead)??T[0],C=P(R),A=i.createLinearGradient(0,w-v,0,w+v);A.addColorStop(0,"#3d4a72"),A.addColorStop(1,"#232b47"),i.fillStyle=A,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.fill();let B=i.createRadialGradient(C,w,2,C,w,S);B.addColorStop(0,`rgba(255,214,160,${(.5*s).toFixed(3)})`),B.addColorStop(1,"rgba(255,214,160,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=B,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.fill(),i.restore(),i.strokeStyle=`rgba(${r},0.7)`,i.lineWidth=2,i.beginPath(),i.ellipse(c,w,S,v,0,0,E),i.stroke();let Q=Math.max(24,(b-g)*1.3),X=T.length>=3?3:2;for(let F=0;F<X;F++){let pe=(-.62+F*.52+(n()-.5)*.12)*-I,Pe=c+pe*S*.7,it=w-v*(.45+n()*.18),Ve=S*(.07+n()*.04),xi=Q*(.26+n()*.12);i.fillStyle="#0a0e18",i.fillRect(Pe-Ve/2,it-xi,Ve,xi),i.fillStyle=`rgba(${r},0.3)`,i.fillRect(Pe-Ve/2,it-xi,Ve,1.5)}if(T.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(${r},0.35)`,i.lineWidth=1,i.stroke()}for(let F of[...T].sort((pe,Pe)=>pe.v-Pe.v)){let pe=.82+(F.v+1)*.14;Ao(i,P(F),M(F),Q*pe*(F.lead?1.06:.92),{tone:[18,21,34],alpha:.95,pose:F.pose,rim:ie(40,.72,.8),rimStrength:F.lead?1.4:.9})}let Y=z(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,Y,S*1.15,J,0,0,E),i.stroke();let O=4+Math.floor(n()*3);for(let F=0;F<O;F++){let pe=F/O*E,Pe=c+Math.cos(pe)*S*1.15,it=Y+Math.sin(pe)*J;if(Math.sin(pe)>-.2){let Ve=c+(n()-.5)*S*.8;Si(i,Pe,it,Ve,w,3,S*.32,r,.2*(.7+s*.4))}Eo(i,Pe,it,3,r)}let U=z(Math.min(52,y+24)),N=Math.max(60,S*.4),Z=Math.max(24,N*.34);i.strokeStyle="rgba(70,78,102,0.6)",i.lineWidth=1.5,i.beginPath(),i.moveTo(c-N*.3,U-Z/2),i.lineTo(c-N*.16,U-Z*2.2),i.moveTo(c+N*.3,U-Z/2),i.lineTo(c+N*.16,U-Z*2.2),i.stroke(),i.fillStyle="#0d1220",i.fillRect(c-N/2,U-Z/2,N,Z);let wi=i.createLinearGradient(0,U-Z*.3,0,U+Z*.42);wi.addColorStop(0,`rgba(${r},0.5)`),wi.addColorStop(1,"rgba(255,214,160,0.32)"),i.fillStyle=wi,i.fillRect(c-N*.42,U-Z*.3,N*.84,Z*.72),i.fillStyle="rgba(255,214,160,0.55)",i.fillRect(c-N/2,U+Z/2-2,N,2);let ki=i.createRadialGradient(c,U,4,c,U,N*1.1);ki.addColorStop(0,`rgba(${r},0.2)`),ki.addColorStop(1,"rgba(0,0,0,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=ki,i.fillRect(c-N*1.1,U-N*.8,N*2.2,N*1.6);let Li=i.createRadialGradient(c,(Y+w)/2,6,c,(Y+w)/2,S*1.5);Li.addColorStop(0,`rgba(${r},${(.1*(.6+s*.5)).toFixed(3)})`),Li.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=Li,i.fillRect(c-S*1.5,Y-40,S*3,w-Y+80),i.restore();let fl=c+Math.sign(C-c||1)*S*.5;Si(i,fl,Y-J*.4,C,M(R),2.5,S*.16,"255,224,178",.42*(.7+s*.4));let Ti=i.createRadialGradient(C,M(R),1,C,M(R),S*.2);Ti.addColorStop(0,`rgba(255,228,185,${(.4*s).toFixed(3)})`),Ti.addColorStop(1,"rgba(255,228,185,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=Ti,i.beginPath(),i.ellipse(C,M(R),S*.2,v*.24,0,0,E),i.fill(),i.restore()}function ld(i,e,t,o,s,r,n,l){let a=q/2,c=Math.max(10,o.voidRadiusM),h=Math.max(2,e-c),d=e+c,u=Math.min(78,Math.atan2(c*1.15,e)*180/Math.PI),p=Math.atan2(-t,h)*180/Math.PI,y=Math.atan2(-t,d)*180/Math.PI,m=z(p),f=z(y),g=tt(u)-a,b=(m+f)/2,S=Math.max(10,(m-f)/2),v=i.createRadialGradient(a,b,4,a,b,g);v.addColorStop(0,"#e8f0fb"),v.addColorStop(.7,"#b9c9e2"),v.addColorStop(1,"#8fa3c4"),i.save(),i.beginPath(),i.ellipse(a,b,g,S,0,0,E),i.clip(),i.fillStyle=v,i.fillRect(a-g,b-S,g*2,S*2),i.strokeStyle="rgba(90,120,170,0.5)",i.lineWidth=3,i.beginPath(),i.moveTo(a,b-S),i.lineTo(a,b+S),i.moveTo(a-g*.5,b-S),i.lineTo(a-g*.5,b+S),i.moveTo(a+g*.5,b-S),i.lineTo(a+g*.5,b+S),i.stroke(),i.strokeStyle="rgba(180,90,110,0.45)",i.beginPath(),i.ellipse(a,b,S*.9,S*.5,0,0,E),i.stroke(),i.restore(),i.strokeStyle="rgba(210,225,245,0.6)",i.lineWidth=2.5,i.beginPath(),i.ellipse(a,b,g,S,0,0,E),i.stroke(),i.fillStyle="rgba(20,26,40,0.8)";for(let P=0;P<5;P++){let M=a+(l()-.5)*g*1.4,R=b+(l()-.5)*S*1.1,C=Math.max(2,S*.06);i.beginPath(),i.ellipse(M,R,C*.6,C,0,0,E),i.fill()}let w=i.createRadialGradient(a,b,4,a,b,g*1.4);w.addColorStop(0,"rgba(200,220,255,0.12)"),w.addColorStop(1,"rgba(200,220,255,0)"),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=w,i.fillRect(a-g*1.4,f-S,g*2.8,m-f+S*2),i.restore();let k=z(Math.min(66,y+60)),L=Math.max(80,g*.7),x=L*.5,T=i.createRadialGradient(a,k,4,a,k,L*1.6);T.addColorStop(0,`rgba(${n},0.3)`),T.addColorStop(1,`rgba(${n},0)`),i.save(),i.globalCompositeOperation="lighter",i.fillStyle=T,i.fillRect(a-L*1.6,k-L*1.2,L*3.2,L*2.4),i.restore(),i.fillStyle="#080b12",i.beginPath(),i.moveTo(a-L/2,k-x/2),i.lineTo(a+L/2,k-x/2),i.lineTo(a+L*.6,k),i.lineTo(a+L/2,k+x/2),i.lineTo(a-L/2,k+x/2),i.lineTo(a-L*.6,k),i.closePath(),i.fill();let I=r;for(let P=0;P<3;P++){let M=ie(I+P*30,.5,.5);i.fillStyle=`rgba(${M[0]},${M[1]},${M[2]},0.75)`;let R=L*.26;i.fillRect(a-L*.42+P*(R+L*.06),k-x*.32,R,x*.64)}i.fillStyle=`rgba(${n},0.9)`;for(let P=0;P<8;P++){let M=a-L*.6+L*1.2*P/7;i.beginPath(),i.arc(M,k+x*.62,2.4,0,E),i.fill()}}function cd(i,e,t,o,s,r,n,l,a,c){let h=e.sectionId,d=!1,u=[];for(let m of t){if(m.id===e.id)continue;let f=m.x-e.x,g=m.y-e.y,b=Math.hypot(f,g)*xt;if(h&&m.sectionId===h&&b<3&&f*n+g*l>0&&(d=!0),b<.3||b>32)continue;let v=((Math.atan2(f,-g)-s)*180/Math.PI+540)%360-180,w=a?(m.eyeHeightM??ee)-r:0,k=Math.atan2(w-.28,b)*180/Math.PI;if(k>10&&b>5)continue;let L=0;for(let I=0;I<m.id.length;I++)L=L*31+m.id.charCodeAt(I)&65535;let x=.9+(L&15)/40,T=Math.min(78,Math.atan2(.16,b)*180/Math.PI*jh*x);T<1.2||u.push({hx:tt(v),hy:z(k),r:T,d:b,hash:L})}u.sort((m,f)=>f.d-m.d);let p=[];{let m=[...u].sort((b,S)=>b.hy-S.hy),f=[],g=()=>{if(!f.length)return;let b=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;p.push({figs:f.sort((w,k)=>k.d-w.d),d:b,hy:S,r:v}),f=[]};for(let b of m){let S=f[f.length-1];S&&Math.abs(b.hy-S.hy)>Math.max(5,(S.r+b.r)/2*1.7)&&g(),f.push(b)}g()}p.sort((m,f)=>f.d-m.d);let y=[[22,26,40],[28,27,42],[24,31,46],[31,30,47],[20,24,36]];for(let m of p){if(m.figs.length>=3&&m.r>=1.6&&m.r<26){let f=[],g=[...m.figs].sort((v,w)=>v.hx-w.hx),b=[];for(let v of g){let w=b[b.length-1];w&&v.hx-w.hx>Math.max(14,v.r*7)&&(b.length>=3&&f.push(b),b=[]),b.push(v)}b.length>=3&&f.push(b);let S=Math.min(.42,.5*(1-m.d/42));if(S>.05){i.fillStyle=`rgba(15, 19, 31, ${S.toFixed(3)})`;for(let v of f){let w=v[0].hx-m.r*1.6,k=v[v.length-1].hx+m.r*1.6;i.beginPath(),i.roundRect(w,m.hy+m.r*.8,k-w,m.r*2.4,m.r*.8),i.fill()}}}for(let f of m.figs){let g=f.d<12?.95:f.d<17?Math.max(.66,.95-(f.d-12)/18):Math.max(.3,.68-(f.d-17)/34),b=Math.round((1-Math.min(1,f.d/16))*10),S=[14+(f.hash>>4&6)+b,17+(f.hash>>4&6)+b,25+(f.hash>>4&6)+b],v=y[f.hash%y.length],w=[v[0]+b,v[1]+b,v[2]+b];if(f.r>=13){let k=f.d<9?.16*(1-f.d/9)+(c.mode==="proscenium"?.06:0):0;sd(i,f.hx,f.hy,f.r,{tone:S,clothing:w,alpha:g,tilt:((f.hash>>2&7)-3.5)*.018,shoulderK:1.72+(f.hash>>5&7)/22,hair:f.hash%id,rim:k,turn:((f.hash>>8&7)-3.5)*.034,lean:((f.hash>>10&3)-1.5)*.09})}else f.r>=5.5?rd(i,f.hx,f.hy,f.r,w,S,g):(i.fillStyle=`rgba(${S[0]},${S[1]},${S[2]},${g.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(d){let m=z(-34);i.fillStyle="rgba(6, 8, 14, 0.92)",i.fillRect(0,m,q,ue-m),i.fillStyle="rgba(24, 30, 46, 0.9)";let f=16;for(let g=0;g<f;g++){let b=(g+.5)/f*q;i.beginPath(),i.ellipse(b,m+6,q/f*.42,22,0,Math.PI,0,!0),i.fill()}}}var re=480,et=270,Ro=50,We=30,hl=i=>(i+Ro)/(2*Ro)*re,Tt=i=>(We-i)/(2*We)*et;function kb(i,e,t){let o=document.createElement("canvas");o.width=re,o.height=et;let s=o.getContext("2d"),r=e.x-i.x,n=e.y-i.y,l=Math.max(2,Math.hypot(r,n)*xt),a=ul(dl(`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`)),c=210+a()*150,h=ie(220+(a()-.5)*60,.55,.82),d=`${h[0]},${h[1]},${h[2]}`,u=s.createLinearGradient(0,0,0,et);u.addColorStop(0,"#080b12"),u.addColorStop(.44,"#151c32"),u.addColorStop(.5,"#1d2644"),u.addColorStop(.58,"#161c2e"),u.addColorStop(1,"#131829"),s.fillStyle=u,s.fillRect(0,0,re,et);let p=i.eyeHeightM??ee,y=Co(p,l),m=Math.min(Ro-2,Math.atan2(4,l)*180/Math.PI),f=Math.min(We-2,y.topPitch),g=Math.max(-We+2,y.basePitch),b=hl(-m),S=hl(m),v=Tt(f),w=Tt(g),k=S-b,L=w-v,x=Math.max(.35,Math.min(1,1-(l-6)/60)),T=Tt(Math.min(We-1,f+8)),I=s.createRadialGradient(re/2,(v+w)/2,4,re/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(b-k*.6,v-L*1.2,k*2.2,L*3.4);let P=ie(c,.62,.55),M=ie(c+40,.7,.5),R=ie(c+70,.78,.52);s.save(),s.beginPath(),s.rect(b,v,k,L),s.clip();let C=s.createLinearGradient(0,v,0,w);C.addColorStop(0,`rgb(${P[0]},${P[1]},${P[2]})`),C.addColorStop(.5,`rgb(${M[0]},${M[1]},${M[2]})`),C.addColorStop(1,`rgb(${R[0]},${R[1]},${R[2]})`),s.globalAlpha=.8,s.fillStyle=C,s.fillRect(b,v,k,L),s.globalAlpha=1;let A=s.createRadialGradient(re/2,(v+w)/2,k*.12,re/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(b,v,k,L),s.restore();let B=3,Q=w-L*.08;for(let O=0;O<B;O++){let U=(O+1)/(B+1);Ao(s,b+k*(.24+U*.52),Q,L*.46*(.9+a()*.24),{tone:[8,10,16],alpha:.9,pose:Math.floor(a()*4),rim:ie(c+20,.5,.7),rimStrength:.7})}s.fillStyle="#05070d",s.fillRect(b-k*.5,T,k*.5,w-T),s.fillRect(S,T,k*.5,w-T);let X=k*.05+2,Y=X*1.35;s.fillStyle="#03050a",s.beginPath(),s.moveTo(b,w),s.lineTo(b-X,w),s.lineTo(b-Y,T),s.lineTo(b+k*.012,T),s.closePath(),s.fill(),s.beginPath(),s.moveTo(S,w),s.lineTo(S+X,w),s.lineTo(S+Y,T),s.lineTo(S-k*.012,T),s.closePath(),s.fill(),s.fillRect(b-Y,T,k+Y*2,(w-T)*.13),s.fillStyle=`rgba(${d},0.12)`,s.fillRect(b-1.2,T,1.2,w-T),s.fillRect(S,T,1.2,w-T),s.fillStyle="#0b0f18",s.fillRect(b-X,w-L*.05,k+X*2,L*.05+2);let J=s.createLinearGradient(0,w-L*.05,0,w+L*.14);J.addColorStop(0,`rgba(255,206,140,${(.5*x).toFixed(3)})`),J.addColorStop(1,"rgba(255,206,140,0)"),s.fillStyle=J,s.fillRect(b-X,w-L*.05,k+X*2,L*.22);for(let O=0;O<3;O++){let U=(O+1)/4,N=b+k*U,Z=Tt(Math.min(We-1,f+20));Si(s,N,Z,N+(a()-.5)*k*.14,w,3,k*.09,d,.17*x),Eo(s,N,Z,1.8,d)}s.fillStyle=`rgba(${d},0.75)`;for(let O=0;O<8;O++)s.beginPath(),s.arc((O+.5)/8*re,Tt(We-4-O%2*3),2.2,0,E),s.fill();s.fillStyle="rgba(10,13,20,0.9)",s.fillRect(0,et-26,re,26),s.fillStyle="rgba(30,37,54,0.9)";for(let O=0;O<9;O++){let U=O*(re/9)+re/18;s.beginPath(),s.ellipse(U,et-22,re/9*.4,15,0,Math.PI,0,!0),s.fill()}return{url:o.toDataURL("image/jpeg",.8),distanceM:Math.round(l)}}var pl=new Set(["en"]),vi=new Map;async function hd(i){if(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__)return(await import(vs(`i18n/${i}.mjs`))).default??null;let{LOADERS:e}=await import("./localeLoaders-ETY2H7H3.js"),t=e[i];return t?await t():null}async function Cb(i,e){let t=kr(i,e);if(t==="en"||pl.has(t))return $e(t),t;if(!wr.includes(t))return $e("en"),"en";try{let o=vi.get(t);o||(o=hd(t),vi.set(t,o));let s=await o;return vi.delete(t),s?($e(t,s),pl.add(t),t):($e("en"),"en")}catch{return vi.delete(t),$e("en"),"en"}}export{fd as ACCESSIBILITY_RING_COLOR,_o as ACCESSIBILITY_TYPES,ud as CHART_STORAGE_KEY,gu as CURRENCY_CHOICES,yu as DEFAULT_CURRENCY,Rg as EMPTY_AVAILABILITY_REFRESH,kd as EVENT_CONFIGURATION_EXPORT_SCHEMA,wd as EVENT_CONFIGURATION_SCHEMA,Yd as FLOOR_STACK_GAP_RATIO,qd as FLOOR_STACK_MIN_SURFACE_PX,Mg as HOLD_CLOCK_SKEW_MS,Ei as LABEL_FADE_MS,bd as LABEL_STYLE_MAX_SIZE,gd as LABEL_STYLE_MIN_SIZE,au as LEGIBILITY_HYSTERESIS_PX,xu as LOCALE_NAMES,jd as MAX_EVENT_INVENTORY,Zd as MAX_GA_CAPACITY,Qo as MIN_POINTER_TARGET_PX,nl as PickerController,Ie as PickerSelectionError,ru as RENDERED_QUALITY_REPORT_VERSION,md as SEAT_COMMERCIAL_MARKS,dd as STAGE_LABEL_STYLE_MAX_SIZE,Wl as SUPPORTED_LOCALES,Sd as SURROUNDINGS_SHAPE_ROLES,Lo as SeatmapRenderer,Ad as TABLE_SEAT_OFFSET,Rd as TIER_HEIGHT_M,wr as TRANSLATED_LOCALES,Xo as UNGROUPED_ID,Ua as accessNeedsFor,pd as accessibilityMeta,Ct as accessibilityRingColor,Go as allObjects,Yo as applyHidden,Za as attachVisibilityCatchUp,Id as canTransitionEventConfiguration,xd as canonicalEventConfigurationJson,Vo as chartBounds,ma as compactRowLabel,At as computeSections,Wa as createRenderer,ws as crossesThreshold,Hl as currencyExponent,Su as currencySymbol,Gd as expandBooth,ze as expandChart,Fd as expandRow,Bd as expandRowSlots,Hd as expandTable,Dd as expandTableSlots,zd as floorObjects,Ud as floorStackPlacements,Mt as floorsOf,Ru as formatDate,bu as formatMinor,ut as formatMoney,Gl as fromMinorUnits,ot as gaAreasOf,eu as gaInventorySegments,Qd as gaUnitLabel,Rt as gaUnitLabels,wb as generateSeatPanorama,kb as generateSeatThumb,Cu as getLocale,tu as growJoinedGAInventory,su as hiddenObjectIds,zh as holdHasLapsed,Eg as holdRecoveryShape,Bi as hysteresisScale,zo as initialFloorMode,Cd as inspectEventConfigurationCompatibility,nu as inspectRenderedQualityEvidence,iu as isGaUnitLabel,Pu as isLocaleLoaded,ou as isSectionHidden,vd as layerOf,Ko as layoutFloorStack,Cb as loadLocale,Iu as localeDirection,$d as mainFloorId,Md as migrateLegacyEventConfigurations,Vd as objectCenter,Kd as owningSectionForObject,Td as parseEventConfigurationExport,Ld as parseEventConfigurationVersion,Wd as pointInPolygon,oe as pointInPolygonWithHoles,Pt as polygonLabelPoint,$a as reconcileAvailability,Ag as refreshChangedSomething,_i as renderedPx,Pd as resolveEventConfigurationRollback,kr as resolveLocale,_d as rowInventoryCount,Ed as rowSeatPositions,yd as seatCommercialMeta,It as sectionGeometry,$e as setLocale,vr as setMoneyLocale,Mu as setStringOverrides,qa as shouldWaitForHoldExpiry,Wo as stackFloors,G as t,Tr as tCount,Nd as tableInventoryCount,Od as tableSeatCountsBySide,Xd as translateObject,Jd as validGAInventorySegments,lu as zoomTowardPoint};