@seatlayer/core 0.101.0 → 0.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/dist/ar-TGXEBJUB.js +1 -0
  2. package/dist/be-JIDOHWF6.js +1 -0
  3. package/dist/bg-ODVJNCC2.js +1 -0
  4. package/dist/ca-3I7TMWYU.js +1 -0
  5. package/dist/{categoryInventory-H77A_8pF.d.cts → categoryInventory-7gSFTu0l.d.cts} +1 -1
  6. package/dist/{categoryInventory-DZ5IcDOy.d.ts → categoryInventory-hJxuFF9L.d.ts} +1 -1
  7. package/dist/chunk-254ABRJF.js +1 -0
  8. package/dist/{chunk-5HXTEMRE.js → chunk-4DYJCT62.js} +1 -1
  9. package/dist/chunk-4R6TXHY2.js +1 -0
  10. package/dist/{chunk-D723OZEY.js → chunk-66T4EAUA.js} +1 -1
  11. package/dist/{chunk-GLGXP5I7.js → chunk-AFJWTB7L.js} +1 -1
  12. package/dist/chunk-COECA63Q.js +1 -0
  13. package/dist/chunk-EIV3CAGV.js +1 -0
  14. package/dist/chunk-FOIYJ5NT.js +1 -0
  15. package/dist/chunk-FUFRWRPM.js +1 -0
  16. package/dist/{chunk-2RNZOV5I.js → chunk-GPZFVQXV.js} +1 -1
  17. package/dist/{chunk-L34T3APU.js → chunk-GTRYL7YV.js} +1 -1
  18. package/dist/chunk-JRZHC75P.js +1 -0
  19. package/dist/chunk-KTMZ3QAO.js +1 -0
  20. package/dist/chunk-PHV2U54Y.js +1 -0
  21. package/dist/chunk-TAMY7HTV.js +1 -0
  22. package/dist/chunk-UEDS3HJ3.js +1 -0
  23. package/dist/{chunk-P4J57TK6.js → chunk-YPVYZYMH.js} +1 -1
  24. package/dist/chunk-ZS5YFXSE.js +1 -0
  25. package/dist/core/chart-ops/index.cjs +1 -1
  26. package/dist/core/chart-ops/index.d.cts +30 -9
  27. package/dist/core/chart-ops/index.d.ts +30 -9
  28. package/dist/core/chart-ops/index.js +1 -1
  29. package/dist/core/inventory/index.cjs +1 -1
  30. package/dist/core/inventory/index.d.cts +72 -5
  31. package/dist/core/inventory/index.d.ts +72 -5
  32. package/dist/core/inventory/index.js +1 -1
  33. package/dist/core/layout/index.cjs +1 -1
  34. package/dist/core/layout/index.d.cts +63 -6
  35. package/dist/core/layout/index.d.ts +63 -6
  36. package/dist/core/layout/index.js +1 -1
  37. package/dist/core/quality/index.cjs +1 -1
  38. package/dist/core/quality/index.d.cts +18 -4
  39. package/dist/core/quality/index.d.ts +18 -4
  40. package/dist/core/quality/index.js +1 -1
  41. package/dist/core/render-assets/index.cjs +1 -1
  42. package/dist/core/render-assets/index.d.cts +2 -2
  43. package/dist/core/render-assets/index.d.ts +2 -2
  44. package/dist/core/render-assets/index.js +1 -1
  45. package/dist/core/seatConfidence.d.cts +1 -1
  46. package/dist/core/seatConfidence.d.ts +1 -1
  47. package/dist/core/sections/index.cjs +1 -1
  48. package/dist/core/sections/index.d.cts +5 -5
  49. package/dist/core/sections/index.d.ts +5 -5
  50. package/dist/core/sections/index.js +1 -1
  51. package/dist/cs-XXB624Z3.js +1 -0
  52. package/dist/cy-W2QNU2GO.js +1 -0
  53. package/dist/da-Q47YPK2E.js +1 -0
  54. package/dist/de-TS3DPLM5.js +1 -0
  55. package/dist/{el-ZPFVDCWA.js → el-3JQUH6DB.js} +1 -1
  56. package/dist/es-GP7VOX7S.js +1 -0
  57. package/dist/et-A22OMZ6V.js +1 -0
  58. package/dist/{eventConfigurations-ClFqXQi9.d.cts → eventConfigurations-BHIfPJJJ.d.cts} +1 -1
  59. package/dist/{eventConfigurations-B6aS6c-_.d.ts → eventConfigurations-I5UBS6r9.d.ts} +1 -1
  60. package/dist/fa-5MS3C6YX.js +1 -0
  61. package/dist/fi-OJLAOJO2.js +1 -0
  62. package/dist/fr-7ATOYJCF.js +1 -0
  63. package/dist/he-37LKRY5W.js +1 -0
  64. package/dist/hi-YXZ5EWK7.js +1 -0
  65. package/dist/hr-QFOPGLMR.js +1 -0
  66. package/dist/hu-RHRBK46E.js +1 -0
  67. package/dist/id-A5Q3MLSX.js +1 -0
  68. package/dist/index.cjs +1 -1
  69. package/dist/index.d.cts +57 -16
  70. package/dist/index.d.ts +57 -16
  71. package/dist/index.js +1 -1
  72. package/dist/it-KG53QPQF.js +1 -0
  73. package/dist/ja-CC6EPUSN.js +1 -0
  74. package/dist/ko-7H4RGYFK.js +1 -0
  75. package/dist/ku-HFYWPSS4.js +1 -0
  76. package/dist/{labeling-ByEZkLee.d.cts → labeling-2A31f781.d.cts} +11 -3
  77. package/dist/{labeling-CP3GhUrf.d.ts → labeling-CDKZ9TO1.d.ts} +11 -3
  78. package/dist/localeLoaders-4YMC7FIZ.js +1 -0
  79. package/dist/lt-HQXE7W47.js +1 -0
  80. package/dist/lv-AN25XXPB.js +1 -0
  81. package/dist/ms-CWAYSF6E.js +1 -0
  82. package/dist/nl-63QBRZSZ.js +1 -0
  83. package/dist/no-RAPQMKWU.js +1 -0
  84. package/dist/pl-ILSTD4ZV.js +1 -0
  85. package/dist/pt-WF3US5D7.js +1 -0
  86. package/dist/{renderedQuality--H0toc-2.d.cts → renderedQuality-CwZ8hY-5.d.cts} +1 -1
  87. package/dist/{renderedQuality-Bo4k99GE.d.ts → renderedQuality-wDIiUId3.d.ts} +1 -1
  88. package/dist/{renderer-CWbam_zr.d.ts → renderer-CdJx5l3B.d.ts} +8 -1
  89. package/dist/{renderer-BPhSZUGh.d.cts → renderer-D6ggv3bV.d.cts} +8 -1
  90. package/dist/ro-XR3HT6DE.js +1 -0
  91. package/dist/ru-TLJEWDPA.js +1 -0
  92. package/dist/{seatTypeIcons-CSt1isBY.d.ts → seatTypeIcons-DMJX4rVN.d.cts} +2 -2
  93. package/dist/{seatTypeIcons-B2tvcQ0H.d.cts → seatTypeIcons-UpUTD8Xf.d.ts} +2 -2
  94. package/dist/{sections-JHox6Lsw.d.ts → sections-CempT5a0.d.cts} +5 -2
  95. package/dist/{sections-C_AKwOIh.d.cts → sections-lpdfwSdO.d.ts} +5 -2
  96. package/dist/{segmentedRowModel-CZ0Ciea-.d.cts → segmentedRowModel-Ddx5ol8T.d.cts} +1 -1
  97. package/dist/{segmentedRowModel-DQO0vHR1.d.ts → segmentedRowModel-HwY4XuYa.d.ts} +1 -1
  98. package/dist/sk-OJC2EL3Z.js +1 -0
  99. package/dist/sl-7RGTVXCV.js +1 -0
  100. package/dist/sr-NHDJ54BS.js +1 -0
  101. package/dist/sv-ZODCCBCU.js +1 -0
  102. package/dist/{tableSizing-Cp5T_6Lw.d.cts → tableSizing-BJqAuJDg.d.cts} +3 -3
  103. package/dist/{tableSizing-ClgbhNks.d.ts → tableSizing-C0zx97eg.d.ts} +3 -3
  104. package/dist/th-VCZA4MP5.js +1 -0
  105. package/dist/{ticketRestrictions-BHNbxzFT.d.cts → ticketRestrictions-AU8UUmdL.d.ts} +39 -3
  106. package/dist/{ticketRestrictions-DUdzkp4F.d.ts → ticketRestrictions-DDQHiKF-.d.cts} +39 -3
  107. package/dist/tr-ROKZO3HC.js +1 -0
  108. package/dist/{types-5AlKCD4j.d.cts → types-DL7qIUrD.d.cts} +68 -2
  109. package/dist/{types-5AlKCD4j.d.ts → types-DL7qIUrD.d.ts} +68 -2
  110. package/dist/uk-LP2DPUHC.js +1 -0
  111. package/dist/vi-JDK3JRJR.js +1 -0
  112. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  113. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  114. package/dist/view3d/index.cjs +54 -54
  115. package/dist/view3d/index.d.cts +9 -3
  116. package/dist/view3d/index.d.ts +9 -3
  117. package/dist/view3d/index.js +10 -10
  118. package/dist/view3d/scene/scene.worker.cjs +1 -1
  119. package/dist/view3d/scene/scene.worker.js +1 -1
  120. package/dist/zh-Hans-P3GB3FAZ.js +1 -0
  121. package/dist/zh-Hant-YU4OKSFZ.js +1 -0
  122. package/package.json +1 -1
  123. package/dist/ar-Q44JP5JY.js +0 -1
  124. package/dist/be-CGFFSIQL.js +0 -1
  125. package/dist/bg-WOYK6OLH.js +0 -1
  126. package/dist/ca-77ZVI3X5.js +0 -1
  127. package/dist/chunk-52XO3LA7.js +0 -1
  128. package/dist/chunk-5BMXWOE7.js +0 -1
  129. package/dist/chunk-5ITK5236.js +0 -1
  130. package/dist/chunk-5PFYIYM5.js +0 -1
  131. package/dist/chunk-CTIGUXXK.js +0 -1
  132. package/dist/chunk-FLZKBXHA.js +0 -1
  133. package/dist/chunk-HO4MFTVX.js +0 -1
  134. package/dist/chunk-JK3DUFRX.js +0 -1
  135. package/dist/chunk-N4J4CT6P.js +0 -1
  136. package/dist/chunk-NO6OLVTT.js +0 -1
  137. package/dist/chunk-UISTXRO5.js +0 -1
  138. package/dist/cs-OSBZYCSR.js +0 -1
  139. package/dist/cy-ZCOJW2WH.js +0 -1
  140. package/dist/da-2PDK6JTR.js +0 -1
  141. package/dist/de-R5LLVFUU.js +0 -1
  142. package/dist/es-7YASJP32.js +0 -1
  143. package/dist/et-J4TV6KQL.js +0 -1
  144. package/dist/fa-4TEO7UGM.js +0 -1
  145. package/dist/fi-GIUDDKMH.js +0 -1
  146. package/dist/fr-J5J2XJLA.js +0 -1
  147. package/dist/he-OCEHSVUJ.js +0 -1
  148. package/dist/hi-EK5CTBW5.js +0 -1
  149. package/dist/hr-SLDTQOYC.js +0 -1
  150. package/dist/hu-2QNE77NO.js +0 -1
  151. package/dist/id-LGDAFQJK.js +0 -1
  152. package/dist/it-DT4Y3IYB.js +0 -1
  153. package/dist/ja-D5EY2XCQ.js +0 -1
  154. package/dist/ko-DD2NV45Q.js +0 -1
  155. package/dist/ku-KZCMVLBE.js +0 -1
  156. package/dist/localeLoaders-GGAKX22E.js +0 -1
  157. package/dist/lt-QWGTJ47Y.js +0 -1
  158. package/dist/lv-LYAIG3VK.js +0 -1
  159. package/dist/ms-XTF4KNGD.js +0 -1
  160. package/dist/nl-QEXY6XHS.js +0 -1
  161. package/dist/no-HCOXN2CN.js +0 -1
  162. package/dist/pl-BWY53TSD.js +0 -1
  163. package/dist/pt-2UJUBCPL.js +0 -1
  164. package/dist/ro-GGXOLTED.js +0 -1
  165. package/dist/ru-ZTFK3WCU.js +0 -1
  166. package/dist/sk-KU543Y2U.js +0 -1
  167. package/dist/sl-FT576R7A.js +0 -1
  168. package/dist/sr-WE3J46JE.js +0 -1
  169. package/dist/sv-YEAOPSEB.js +0 -1
  170. package/dist/th-BEBRDHJA.js +0 -1
  171. package/dist/tr-LOAHUPSH.js +0 -1
  172. package/dist/uk-2GMICSHN.js +0 -1
  173. package/dist/vi-TC5B6AUR.js +0 -1
  174. package/dist/zh-Hans-TSZWTZQY.js +0 -1
  175. package/dist/zh-Hant-TLB4FZYM.js +0 -1
@@ -1,4 +1,4 @@
1
- import{A as $t,B as ao,C as tt,D as Kt,E as io,F as so,a as Qe,b as _e,c as gt,d as qt,e as Yn,f as Xn,g as ye,h as qn,i as jn,j as yt,k as Le,l as Je,m as $n,n as jt,o as la,p as Kn,q as Zn,r as Qn,s as Jn,t as Me,u as eo,v as to,w as no,x as oo,y as ro,z as et}from"../chunk-NO6OLVTT.js";import"../chunk-5PFYIYM5.js";import"../chunk-L34T3APU.js";import{d as Xt}from"../chunk-P4J57TK6.js";import"../chunk-FLZKBXHA.js";import"../chunk-5HXTEMRE.js";import"../chunk-JK3DUFRX.js";import"../chunk-D723OZEY.js";import"../chunk-52XO3LA7.js";import"../chunk-N4J4CT6P.js";import"../chunk-4N5CHKHD.js";import"../chunk-TQN2VWQO.js";import"../chunk-5BMXWOE7.js";import"../chunk-HO4MFTVX.js";import{Va as Bn}from"../chunk-UISTXRO5.js";import"../chunk-5ITK5236.js";import{d as Wn,l as Un}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";function lo(t,e,n){let r=Math.floor(e.length/3),a=n.center[0],o=n.center[2];if(r>0){let l=Math.max(1,Math.floor(r/4e3)),m=0,v=0,d=0;for(let c=0;c<r;c+=l)m+=e[c*3],v+=e[c*3+2],d++;a=m/d,o=v/d}let i=t[0]-a,s=t[2]-o;return Math.hypot(i,s)>n.radius*.12?Math.atan2(i,s):void 0}import{Mat4 as Hs}from"ogl";function co(t,e,n="#ffffff"){let{iPosition:r,count:a}=e.seats;if(a<2||typeof document>"u")return null;let o=1/0,i=-1/0,s=1/0,l=-1/0;for(let w=0;w<a;w++){let R=r[w*3],V=r[w*3+2];R<o&&(o=R),R>i&&(i=R),V<s&&(s=V),V>l&&(l=V)}for(let w of e.stages)o=Math.min(o,w.cx-w.halfX),i=Math.max(i,w.cx+w.halfX),s=Math.min(s,w.cz-w.halfZ),l=Math.max(l,w.cz+w.halfZ);let m=Math.min(130/Math.max(.001,i-o),86/Math.max(.001,l-s)),v=(148-(i-o)*m)/2,d=(104-(l-s)*m)/2,c=w=>v+(w-o)*m,h=w=>d+(w-s)*m,u=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),b=document.createElement("canvas");b.width=Math.round(148*u),b.height=Math.round(104*u),b.setAttribute("aria-hidden","true"),b.setAttribute("data-seat-locator","");let p=b.style;p.position="absolute",p.left="12px",p.bottom="12px",p.width="148px",p.height="104px",p.borderRadius="10px",p.background="rgba(10,14,22,.72)",p.border="1px solid rgba(255,255,255,.14)",p.boxShadow="0 4px 14px rgba(0,0,0,.35)",p.pointerEvents="none",p.zIndex="3",p.display="none",t.appendChild(b);let x=document.createElement("canvas");x.width=b.width,x.height=b.height;let P=x.getContext("2d");if(P){P.scale(u,u),P.fillStyle="rgba(214,222,234,.28)";let w=Math.max(1,Math.ceil(a/6e3));for(let R=0;R<a;R+=w)P.fillRect(c(r[R*3])-.6,h(r[R*3+2])-.6,1.2,1.2);P.fillStyle="rgba(236,240,246,.16)",P.strokeStyle="rgba(236,240,246,.55)",P.lineWidth=1;for(let R of e.stages){let V=c(R.cx-R.halfX),g=h(R.cz-R.halfZ),E=R.halfX*2*m,M=R.halfZ*2*m;P.fillRect(V,g,E,M),P.strokeRect(V+.5,g+.5,Math.max(0,E-1),Math.max(0,M-1))}}let S=b.getContext("2d"),I="";return{el:b,update(w,R){if(!w||!S||t.clientWidth>0&&t.clientWidth<560){p.display!=="none"&&(p.display="none"),I="";return}let V=c(w[0]),g=h(w[2]),E=R?Math.atan2(R[2],R[0]):0,M=`${V.toFixed(1)},${g.toFixed(1)},${E.toFixed(2)}`;if(M!==I){if(I=M,p.display="block",S.setTransform(1,0,0,1,0,0),S.clearRect(0,0,b.width,b.height),S.drawImage(x,0,0),S.setTransform(u,0,0,u,0,0),R){let D=S.createRadialGradient(V,g,0,V,g,26);D.addColorStop(0,"rgba(255,255,255,.55)"),D.addColorStop(1,"rgba(255,255,255,0)"),S.fillStyle=D,S.beginPath(),S.moveTo(V,g),S.arc(V,g,26,E-.5,E+.5),S.closePath(),S.fill()}S.fillStyle=n,S.strokeStyle="rgba(10,14,22,.9)",S.lineWidth=1.5,S.beginPath(),S.arc(V,g,3.6,0,Math.PI*2),S.fill(),S.stroke()}},dispose(){b.remove()}}}var Zt=78,uo=18;function mo(){let t=[],e=[],n=[],r=[],a=[],o=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,_e,-1],max:[1,gt,-.72]}])for(let l of o){let m=t.length/3,v=l.n[1]+(s.part===2?Math.abs(l.n[0])*(1-qt)/(gt-_e):0),d=Math.hypot(l.n[0],v,l.n[2]),c=[l.n[0]/d,v/d,l.n[2]/d];for(let[h,u]of l.c.entries()){let b=u.map((p,x)=>s.min[x]+p*(s.max[x]-s.min[x]));s.part===2&&(b[0]*=1-u[1]*(1-qt)),t.push(...b),e.push(...c),n.push(s.part),r.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][h])}a.push(m,m+1,m+2,m,m+2,m+3)}let i=t.length/3;for(let[s,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])t.push(s,l,0),e.push(0,1,0),n.push(0),r.push(s,l);return a.push(i,i+1,i+2,i,i+2,i+3),a.push(...a.slice(12,18),...a.slice(60,66),...a.slice(72,78)),{position:new Float32Array(t),normal:new Float32Array(e),surface:new Float32Array(n),uv:new Float32Array(r),index:new Uint16Array(a)}}import{Renderer as ca}from"ogl";function ua(){let t=typeof window<"u"&&window.devicePixelRatio||1,e=navigator.deviceMemory,n=typeof e=="number"&&e<=4?1.5:2;return Math.min(t,n)}var xt=class{constructor(e,n){this.clearRgb=[0,0,0];this.container=e,this.canvas=document.createElement("canvas"),this.canvas.style.display="block",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.touchAction="none",this.canvas.tabIndex=0,this.canvas.setAttribute("role","application"),this.canvas.setAttribute("aria-label","Interactive 3D venue. Drag or use arrow keys to look around; pinch, scroll, plus or minus to zoom."),this.renderer=new ca({canvas:this.canvas,dpr:ua(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[yt.top[0],yt.top[1],yt.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(e){this.clearRgb=[e[0],e[1],e[2]],this.gl.clearColor(e[0],e[1],e[2],1)}get clearColor(){return this.clearRgb}resize(){let e=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(e,n),{width:e,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let e=this.gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let e=this.gl.getExtension("WEBGL_lose_context");e&&(e.loseContext(),setTimeout(()=>{e.restoreContext&&e.restoreContext()},300))}};import{Camera as da,Vec3 as Qt}from"ogl";var ue=Math.PI/180,Jt=15*ue,en=80*ue,Oe=.12,ho=35,tn=1.25,po=.006,ma=4,ze=.82,nt=1/ze,ha=.12,pa=2;function fa(t,e){return{azimuth:0-t*po,polar:-e*po}}function fo(t,e,n){let r=Math.max(pa,Math.max(1,e)*ha),a=n*ma;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,a):a}}var va=1.5;function ba(t,e,n){let r=Math.max(1,n)*va;if(!t)return{anchor:[e[0],e[1],e[2]],limit:r};let[a,o,i]=t.anchor,s=e[1]-o,l=Math.max(Math.abs(e[0]-a),Math.abs(e[2]-i),s>=0?s:-s*2);return{anchor:t.anchor,limit:Math.max(t.limit,l+r)}}function ga(t,e,n,r,a,o,i,s){let l=Math.sin(n),m=[l*Math.sin(e),Math.cos(n),l*Math.cos(e)],v=[t[0]+r*m[0],t[1]+r*m[1],t[2]+r*m[2]],d=[-m[0],-m[1],-m[2]],c=[-d[2],0,d[0]],h=Math.hypot(c[0],c[2])||1;c=[c[0]/h,0,c[2]/h];let u=[c[1]*d[2]-c[2]*d[1],c[2]*d[0]-c[0]*d[2],c[0]*d[1]-c[1]*d[0]],b=Math.tan(a*ue/2),p=b*(o>0?o:1),x=[0,1,2].map(I=>d[I]+i*p*c[I]+s*b*u[I]);if(x[1]>=-1e-6)return null;let P=(t[1]-v[1])/x[1],S=Math.hypot(x[0],x[1],x[2]);return!(P>0)||P*S>r*ya?null:[v[0]+x[0]*P,t[1],v[2]+x[2]*P]}var vo=3,ya=4,bo=.72,xa=.6;function Sa(t,e,n){return t!=="auto"?t:n!==null&&e<n*xa?"pan":"orbit"}function go(t,e){let n=Math.sin(e),r=-n*Math.sin(t),a=-Math.cos(e),o=-n*Math.cos(t);if(Math.abs(a)>.999)return null;let i=-o,s=r,l=Math.hypot(i,s);return i/=l,s/=l,{fx:r,fy:a,fz:o,rx:i,rz:s,ux:-s*a,uy:s*r-i*o,uz:i*a}}var wa=.4;function Ma(t,e,n,r,a,o){let i=[t.center[0],t.center[1],t.center[2]],s=o(i),l=t.fitPoints,m=go(r,a);if(!l||l.length<9||!m)return{center:i,distance:s};let{fx:v,fy:d,fz:c,rx:h,rz:u,ux:b,uy:p,uz:x}=m,P=Math.hypot(v,c),S=v/P,I=c/P,w=S*b+I*x,R=wa*Math.max(1,t.radius);for(let V=0;V<3;V++){let g=1/0,E=-1/0,M=1/0,D=-1/0;for(let W=0;W+2<l.length;W+=3){let N=l[W]-i[0],ee=l[W+1]-i[1],Z=l[W+2]-i[2],Y=s+N*v+ee*d+Z*c;if(!(Y>.001))continue;let T=(N*h+Z*u)/(Y*e),C=(N*b+ee*p+Z*x)/(Y*n);T<g&&(g=T),T>E&&(E=T),C<M&&(M=C),C>D&&(D=C)}if(!Number.isFinite(g))break;let H=(g+E)/2*s*e,F=Math.abs(w)>.1?(M+D)/2*s*n/w:0,z=H*h+F*S,B=H*u+F*I;if(Math.hypot(i[0]+z-t.center[0],i[2]+B-t.center[2])>R){let W=i[0]-t.center[0],N=i[2]-t.center[2],ee=W+z,Z=N+B,Y=R/Math.hypot(ee,Z);z=ee*Y-W,B=Z*Y-N}i=[i[0]+z,i[1],i[2]+B],s=o(i)}return{center:i,distance:s}}var St=class{constructor(e,n,r,a){this.fovY=ho;this.target=new Qt;this.azimuth=-30*ue;this.polar=55*ue;this.distance=10;this.azT=-30*ue;this.polT=55*ue;this.distT=10;this.minDist=1;this.maxDist=100;this.envelope=null;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new Qt;this.panAnchor=new Qt;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new da(e,{fov:ho,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=a,this.onPointerDown=o=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(o.pointerId)}catch{}if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size===1){let i=this.dragAction(),s=i==="orbit"?"pan":"orbit",l=o.button===2||o.button===1||o.shiftKey?s:i;this.panning=l==="pan",this.dragging=!this.panning,this.lastX=o.clientX,this.lastY=o.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let i=this.pinchCentroid();this.pinchCx=i.x,this.pinchCy=i.y}}},this.onPointerMove=o=>{if(!this.interactionEnabled||!this.activePointers.has(o.pointerId))return;if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size>=2){let m=this.currentPinchDistance(),v=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-m)*.005),v.x,v.y),this.fireGesture()),this.pinchDist=m;let d=this.currentPinchAngle(),c=d-this.pinchAngle;c>Math.PI&&(c-=2*Math.PI),c<-Math.PI&&(c+=2*Math.PI),this.pinchAngle=d,Math.abs(c)>1e-4&&Math.abs(c)<.5&&(this.azT+=c,this.fireGesture()),this.panBy(v.x-this.pinchCx,v.y-this.pinchCy),this.pinchCx=v.x,this.pinchCy=v.y;return}let i=o.clientX-this.lastX,s=o.clientY-this.lastY;if(this.panning){this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&(this.panBy(i,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&this.fireGesture();let l=fa(i,s);this.azT+=l.azimuth,this.polT=Math.max(Jt,Math.min(en,this.polT+l.polar)),this.requestRender()},this.onPointerUp=o=>{this.activePointers.delete(o.pointerId);try{this.canvas.releasePointerCapture?.(o.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=o=>{o.preventDefault()},this.onWheel=o=>{if(o.preventDefault(),!this.interactionEnabled)return;let i=o.deltaMode===1?16:o.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,o.deltaY*i/100));this.dollyAt(Math.exp(s*.22),o.clientX,o.clientY),this.fireGesture()},this.onKeyDown=o=>{if(!this.interactionEnabled)return;let i=7*ue;if(o.shiftKey&&(o.key==="ArrowLeft"||o.key==="ArrowRight"||o.key==="ArrowUp"||o.key==="ArrowDown"))this.panBy(o.key==="ArrowLeft"?-32:o.key==="ArrowRight"?32:0,o.key==="ArrowUp"?-32:o.key==="ArrowDown"?32:0);else if(o.key==="ArrowLeft"||o.key==="ArrowRight")this.azT+=o.key==="ArrowLeft"?i:-i;else if(o.key==="ArrowUp"||o.key==="ArrowDown")this.polT=Math.max(Jt,Math.min(en,this.polT+(o.key==="ArrowUp"?-i:i)));else if(o.key==="+"||o.key==="=")this.dollyBy(ze);else if(o.key==="-"||o.key==="_")this.dollyBy(nt);else return;o.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let e=[...this.activePointers.values()];if(!e.length)return{x:0,y:0};let n=0,r=0;for(let a of e)n+=a.x,r+=a.y;return{x:n/e.length,y:r/e.length}}panBy(e,n){let r=this.canvas.clientHeight||1,a=2*this.distance*Math.tan(this.fovY*ue/2)/r,o=Math.sin(this.azimuth),i=Math.cos(this.azimuth),s=i,l=-o,m=Math.cos(this.polar),v=Math.sin(this.polar),d=-o*m,c=-i*m;this.targetT.x+=(-e*s+n*d)*a,this.targetT.z+=(-e*l+n*c)*a,this.targetT.y+=n*v*a,this.clampPan(),this.requestRender()}widenPanBox(e){this.panBox=ba(this.panBox,e.center,e.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,n=this.panAnchor.x,r=this.panAnchor.y,a=this.panAnchor.z;this.targetT.x=Math.max(n-e,Math.min(n+e,this.targetT.x)),this.targetT.z=Math.max(a-e,Math.min(a+e,this.targetT.z)),this.targetT.y=Math.max(r-e*.5,Math.min(r+e,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[e,n]=[...this.activePointers.values()];return e&&n?Math.atan2(n.y-e.y,n.x-e.x):0}dragAction(){return Sa(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let e=[...this.activePointers.values()];return e.length<2?0:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)}dollyBy(e){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*e)),this.requestRender()}dollyAt(e,n,r){let a=this.distT,o=this.canvas.getBoundingClientRect?.(),i=this.zoomPointResolver?.(n,r)??null;if(i){this.distT=Math.max(vo,Math.min(this.maxDist,this.distT*e)),this.minDist=Math.min(this.minDist,Math.max(vo,this.distT)),this.requestRender(),this.scaleTargetAbout(i,this.distT/a);return}let s=o&&o.width>0&&o.height>0?ga([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||o.width/o.height,(n-o.left)/o.width*2-1,1-(r-o.top)/o.height*2):null;this.dollyBy(e),s&&this.scaleTargetAbout(s,this.distT/a)}scaleTargetAbout(e,n){!Number.isFinite(n)||n===1||(this.targetT.x=e[0]+(this.targetT.x-e[0])*n,this.targetT.y=e[1]+(this.targetT.y-e[1])*n,this.targetT.z=e[2]+(this.targetT.z-e[2])*n,this.clampPan())}setZoomPointResolver(e){this.zoomPointResolver=e}zoomBy(e){this.interactionEnabled&&(this.dollyBy(e),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(e){this.primaryDragMode=e}setInteractionEnabled(e){this.interactionEnabled=e,!e&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(e,n=!1,r,a=!1,o){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e);let i=Math.max(1,e.radius),s=this.fovY*ue/2,l=a?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,m=Math.atan(Math.tan(s)*l);this.azT=r??-30*ue,this.polT=Math.max(15,Math.min(80,o?.polarDeg??55))*ue;let v=this.framedOn(e,s,m),d=v.distance;this.target.set(v.center[0],v.center[1],v.center[2]),this.targetT.copy(this.target),this.distT=d*Math.max(1.05,Math.min(2,o?.margin??tn)),this.envelope=fo(this.envelope,i,d),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*ue,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){if(!(e>0)||!Number.isFinite(e))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let r=Math.min(n,1)/Math.min(e,1);this.distance*=r,this.distT*=r,this.overviewDist!==null&&(this.overviewDist*=r),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:e})}glideTo(e,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(e),this.targetT.set(e.center[0],e.center[1],e.center[2]);let r=this.fovY*ue/2,a=Math.atan(Math.tan(r)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*ue;let o=this.framedOn(e,r,a),i=o.distance;this.targetT.set(o.center[0],o.center[1],o.center[2]),this.distT=i*Math.max(1.05,Math.min(2,n?.margin??tn)),this.envelope=fo(this.envelope,Math.max(1,e.radius),i),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(e,n,r=!1,a){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let o=this.fovY*ue/2,i=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(o)*i);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,a?.polarDeg??55))*ue;let l=this.framedOn(e,o,s);this.targetT.set(l.center[0],l.center[1],l.center[2]),this.distT=l.distance*Math.max(1.05,Math.min(2,a?.margin??tn))}framedOn(e,n,r){return Ma(e,Math.tan(r),Math.tan(n),this.azT,this.polT,a=>this.fitDistance({...e,center:a},n,r,this.azT,this.polT))}fitDistance(e,n,r,a,o){let i=Math.max(1,e.radius),s=Math.max(i/Math.tan(n),i/Math.tan(r)),l=e.box;if(!l)return s;let m=go(a,o);if(!m)return s;let{fx:v,fy:d,fz:c,rx:h,rz:u,ux:b,uy:p,uz:x}=m,P=Math.tan(r),S=Math.tan(n),I=1;for(let M=0;M<8;M++){let D=(M&1?l.max[0]:l.min[0])-e.center[0],H=(M&2?l.max[1]:l.min[1])-e.center[1],F=(M&4?l.max[2]:l.min[2])-e.center[2],z=D*v+H*d+F*c,B=Math.abs(D*h+F*u),U=Math.abs(D*b+H*p+F*x);I=Math.max(I,B/P-z,U/S-z)}let w=Math.min(s,Math.max(I,i*.35)),R=e.fitPoints;if(!R||R.length<9)return w;let V=0,g=1/(P*bo),E=1/(S*bo);for(let M=0;M+2<R.length;M+=3){let D=R[M]-e.center[0],H=R[M+1]-e.center[1],F=R[M+2]-e.center[2],z=D*v+H*d+F*c,B=Math.abs(D*h+F*u),U=Math.abs(D*b+H*p+F*x);V=Math.max(V,B*g-z,U*E-z)}return Math.min(w*1.5,Math.max(w*.55,V))}updateClipping(e){let n=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],a=this.camera.position.z-e.center[2],o=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),i=this.interactionEnabled&&Math.abs(o-this.distance)<=this.distance*.01,{near:s,far:l}=Ca(Math.hypot(n,r,a),e.radius,i?this.distance:null);this.camera.perspective({near:s,far:l,aspect:this.camera.aspect})}update(){let e=this.azT-this.azimuth,n=this.polT-this.polar,r=this.distT-this.distance,a=this.targetT.x-this.target.x,o=this.targetT.y-this.target.y,i=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),l=Math.abs(e)>1e-4||Math.abs(n)>1e-4||Math.abs(r)>1e-4||Math.abs(a)>s||Math.abs(o)>s||Math.abs(i)>s;return this.azimuth+=e*Oe,this.polar+=n*Oe,this.distance+=r*Oe,this.target.x+=a*Oe,this.target.y+=o*Oe,this.target.z+=i*Oe,l&&this.applyPosition(),l}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let e=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,a=Math.hypot(e,n,r)||1,o=Math.max(Jt,Math.min(en,Math.acos(Math.max(-1,Math.min(1,n/a)))));this.distance=this.distT=a,this.polar=this.polT=o,this.azimuth=this.azT=Math.atan2(e,r)}snapshot(){let e=this.target.clone(),n=this.targetT.clone(),{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}=this,m=this.camera.position.clone(),v=[...this.camera.quaternion],d=this.camera.fov;return()=>{this.target.copy(e),this.targetT.copy(n),Object.assign(this,{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}),this.camera.position.copy(m),this.camera.quaternion.set(v[0],v[1],v[2],v[3]),this.camera.perspective({fov:d,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(e){this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target)}resumeAfterFlight(e){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),e&&this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let e=Math.sin(this.polar),n=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),a=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(n,r,a),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}},Pa=.1,Aa=.25;function Ca(t,e,n){let r=Math.max(1,e)*1.18,a=n==null?Aa:Math.max(.05,n*Pa),o=Math.max(a,t-r),i=Math.max(o+10,t+r);return{near:o,far:i}}var wt=class{constructor(e){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=e=>{let n=this.lastTime?(e-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=e,n>0){let a=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+a*.1:a}this.rendered++,this.frame(n)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=e}requestRender(){this.running||(this.running=!0,this.lastTime=0,this.rafId=requestAnimationFrame(this.tick))}stats(){return{fps:this.running?Math.round(this.fpsEma):0,rendered:this.rendered,idle:!this.running}}stop(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.running=!1}};function yo(t){let e=!1;return n=>{n!==e&&(e=n,n?t.dataset.slReady="1":delete t.dataset.slReady)}}var Ne=2.5,Ea=1.15,ot=12,He=22,xo=6,So=9.5,wo=.9,Mo=2.2,nn=30,on=4,Mt=8192;var al=He+on;function Po(t,e){let n=e*1.4,r=e*3.2;if(t<=n)return{scale:1,fade:0,minPixels:Ne};let a=Math.min(1,(t-n)/Math.max(.001,r-n));return{scale:1-a*.4,fade:a*.55,minPixels:Ne+a*(Ea-Ne)}}function Ao(t,e,n){return!(t>0)||!(e>0)||!(n>0)?!1:e*n/t>=64}var Ra=12;function Co(t,e,n,r,a){if(!(t>0)||!(e>0)||!(n>0)||!(r>0)||!(a>0))return!1;let o=Math.tan(r/2*Math.PI/180);if(!(o>0))return!1;let i=e/(n*o)*(a/2);return Math.PI*i*i/t>=Ra}import{Geometry as Ta,Mesh as _a,Program as Ia,Transform as Fa}from"ogl";var Da=.05,Va=1.1,ka=12,La=1.6,Oa=1,za=2.5,Na=650,Ro=[[-.15,0,0,.15,.13,.42],[-.13,-.45,.36,.13,.02,.47]],To={centre:[0,0,-.05],hipRadius:.15,shoulderRadius:.2,height:.56,sides:8,depth:.62},rn={centre:[0,.74,-.04],radii:[.1,.12,.11]},Ge={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40},Ha=90,ll={height:rn.centre[1]+rn.radii[1],radius:Math.max(To.shoulderRadius,...Ro.map(t=>Math.max(Math.abs(t[0]),Math.abs(t[3]))))};function Ga(t,e){if(e)return 0;let n=(t-Ge.fadeInFromM)/(Ge.fullByM-Ge.fadeInFromM);return Math.max(0,Math.min(1,n))}function Ba(t,e){return!e&&t<Ha}var Eo=24;function Wa(t){let e=[],n=[],r=[],a=(d,c,h)=>{e.push(...d),n.push(...c),r.push(h)};for(let d=0;d<16;d++){let c=d/16*Math.PI*2,h=(d+1)/16*Math.PI*2,u=S=>[Math.cos(S),0,Math.sin(S)],b=[Math.cos(c)*.012,0,Math.sin(c)*.012],p=[Math.cos(h)*.012,0,Math.sin(h)*.012],x=[Math.cos(c)*.03,1,Math.sin(c)*.03],P=[Math.cos(h)*.03,1,Math.sin(h)*.03];a(b,u(c),0),a(x,u(c),0),a(P,u(h),0),a(b,u(c),0),a(P,u(h),0),a(p,u(h),0)}let l=.16,m=.24,v=.01;for(let d=0;d<48;d++){let c=d/48*Math.PI*2,h=(d+1)/48*Math.PI*2,u=[Math.cos(c)*l,v,Math.sin(c)*l],b=[Math.cos(c)*m,v,Math.sin(c)*m],p=[Math.cos(h)*m,v,Math.sin(h)*m],x=[Math.cos(h)*l,v,Math.sin(h)*l];for(let P of[u,b,p,u,p,x])a(P,[0,1,0],1)}for(let[d,c,h,u,b,p]of Ro){let x=[[[0,0,1],[[d,c,p],[u,c,p],[u,b,p],[d,b,p]]],[[0,0,-1],[[u,c,h],[d,c,h],[d,b,h],[u,b,h]]],[[1,0,0],[[u,c,p],[u,c,h],[u,b,h],[u,b,p]]],[[-1,0,0],[[d,c,h],[d,c,p],[d,b,p],[d,b,h]]],[[0,1,0],[[d,b,p],[u,b,p],[u,b,h],[d,b,h]]],[[0,-1,0],[[d,c,h],[u,c,h],[u,c,p],[d,c,p]]]];for(let[P,[S,I,w,R]]of x)for(let V of[S,I,w,S,w,R])a(V,P,2)}{let{centre:d,hipRadius:c,shoulderRadius:h,height:u,sides:b,depth:p}=To,x=(P,S,I)=>{let w=P/b*Math.PI*2+Math.PI/b;return[d[0]+Math.cos(w)*S,d[1]+I,d[2]+Math.sin(w)*S*p]};for(let P=0;P<b;P++){let S=x(P,c,0),I=x(P+1,c,0),w=x(P+1,h,u),R=x(P,h,u),V=[I[0]-S[0],I[1]-S[1],I[2]-S[2]],g=[R[0]-S[0],R[1]-S[1],R[2]-S[2]],E=[V[1]*g[2]-V[2]*g[1],V[2]*g[0]-V[0]*g[2],V[0]*g[1]-V[1]*g[0]],M=Math.hypot(...E)||1;E=[E[0]/M,E[1]/M,E[2]/M],E[0]*(S[0]-d[0])+E[2]*(S[2]-d[2])<0&&(E=[-E[0],-E[1],-E[2]]);for(let D of[S,I,w,S,w,R])a(D,E,2);a([d[0],d[1]+u,d[2]],[0,1,0],2),a(R,[0,1,0],2),a(w,[0,1,0],2)}}{let{centre:d,radii:c}=rn,h=8,u=(b,p)=>{let x=b/16*Math.PI*2,P=p/h*Math.PI,S=[Math.sin(P)*Math.cos(x),Math.cos(P),Math.sin(P)*Math.sin(x)];return[[d[0]+S[0]*c[0],d[1]+S[1]*c[1],d[2]+S[2]*c[2]],S]};for(let b=0;b<16;b++)for(let p=0;p<h;p++){let x=u(b,p),P=u(b+1,p),S=u(b+1,p+1),I=u(b,p+1);for(let[w,R]of[x,P,S,x,S,I])a(w,R,2)}}for(let d=0;d<32;d++){let c=d/32*Math.PI*2,h=(d+1)/32*Math.PI*2,u=Ge.baseRadius,b=Ge.topRadius,p=[Math.cos(c)*u,0,Math.sin(c)*u],x=[Math.cos(h)*u,0,Math.sin(h)*u],P=[Math.cos(c)*b,1,Math.sin(c)*b],S=[Math.cos(h)*b,1,Math.sin(h)*b],I=[Math.cos(c),0,Math.sin(c)],w=[Math.cos(h),0,Math.sin(h)];a(p,I,3),a(P,I,3),a(S,w,3),a(p,I,3),a(S,w,3),a(x,w,3)}return new Ta(t,{position:{size:3,data:new Float32Array(e)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(r)}})}var Ua=`#version 300 es
1
+ import{A as $t,B as io,C as tt,D as Kt,E as so,F as lo,a as Qe,b as _e,c as gt,d as qt,e as Xn,f as qn,g as ye,h as jn,i as $n,j as yt,k as Le,l as Je,m as Kn,n as jt,o as la,p as Zn,q as Qn,r as Jn,s as eo,t as Me,u as to,v as no,w as oo,x as ro,y as ao,z as et}from"../chunk-TAMY7HTV.js";import"../chunk-254ABRJF.js";import"../chunk-GTRYL7YV.js";import{d as Xt}from"../chunk-YPVYZYMH.js";import"../chunk-FUFRWRPM.js";import"../chunk-4DYJCT62.js";import"../chunk-4R6TXHY2.js";import"../chunk-66T4EAUA.js";import"../chunk-PHV2U54Y.js";import"../chunk-JRZHC75P.js";import"../chunk-UEDS3HJ3.js";import"../chunk-4N5CHKHD.js";import"../chunk-TQN2VWQO.js";import"../chunk-FOIYJ5NT.js";import"../chunk-COECA63Q.js";import{Wa as Wn}from"../chunk-EIV3CAGV.js";import"../chunk-KTMZ3QAO.js";import{d as Un,l as Yn}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";function co(t,e,n){let r=Math.floor(e.length/3),a=n.center[0],o=n.center[2];if(r>0){let l=Math.max(1,Math.floor(r/4e3)),m=0,v=0,d=0;for(let c=0;c<r;c+=l)m+=e[c*3],v+=e[c*3+2],d++;a=m/d,o=v/d}let i=t[0]-a,s=t[2]-o;return Math.hypot(i,s)>n.radius*.12?Math.atan2(i,s):void 0}import{Mat4 as Hs}from"ogl";function uo(t,e,n="#ffffff"){let{iPosition:r,count:a}=e.seats;if(a<2||typeof document>"u")return null;let o=1/0,i=-1/0,s=1/0,l=-1/0;for(let w=0;w<a;w++){let R=r[w*3],V=r[w*3+2];R<o&&(o=R),R>i&&(i=R),V<s&&(s=V),V>l&&(l=V)}for(let w of e.stages)o=Math.min(o,w.cx-w.halfX),i=Math.max(i,w.cx+w.halfX),s=Math.min(s,w.cz-w.halfZ),l=Math.max(l,w.cz+w.halfZ);let m=Math.min(130/Math.max(.001,i-o),86/Math.max(.001,l-s)),v=(148-(i-o)*m)/2,d=(104-(l-s)*m)/2,c=w=>v+(w-o)*m,h=w=>d+(w-s)*m,u=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),b=document.createElement("canvas");b.width=Math.round(148*u),b.height=Math.round(104*u),b.setAttribute("aria-hidden","true"),b.setAttribute("data-seat-locator","");let p=b.style;p.position="absolute",p.left="12px",p.bottom="12px",p.width="148px",p.height="104px",p.borderRadius="10px",p.background="rgba(10,14,22,.72)",p.border="1px solid rgba(255,255,255,.14)",p.boxShadow="0 4px 14px rgba(0,0,0,.35)",p.pointerEvents="none",p.zIndex="3",p.display="none",t.appendChild(b);let x=document.createElement("canvas");x.width=b.width,x.height=b.height;let P=x.getContext("2d");if(P){P.scale(u,u),P.fillStyle="rgba(214,222,234,.28)";let w=Math.max(1,Math.ceil(a/6e3));for(let R=0;R<a;R+=w)P.fillRect(c(r[R*3])-.6,h(r[R*3+2])-.6,1.2,1.2);P.fillStyle="rgba(236,240,246,.16)",P.strokeStyle="rgba(236,240,246,.55)",P.lineWidth=1;for(let R of e.stages){let V=c(R.cx-R.halfX),g=h(R.cz-R.halfZ),E=R.halfX*2*m,M=R.halfZ*2*m;P.fillRect(V,g,E,M),P.strokeRect(V+.5,g+.5,Math.max(0,E-1),Math.max(0,M-1))}}let S=b.getContext("2d"),I="";return{el:b,update(w,R){if(!w||!S||t.clientWidth>0&&t.clientWidth<560){p.display!=="none"&&(p.display="none"),I="";return}let V=c(w[0]),g=h(w[2]),E=R?Math.atan2(R[2],R[0]):0,M=`${V.toFixed(1)},${g.toFixed(1)},${E.toFixed(2)}`;if(M!==I){if(I=M,p.display="block",S.setTransform(1,0,0,1,0,0),S.clearRect(0,0,b.width,b.height),S.drawImage(x,0,0),S.setTransform(u,0,0,u,0,0),R){let D=S.createRadialGradient(V,g,0,V,g,26);D.addColorStop(0,"rgba(255,255,255,.55)"),D.addColorStop(1,"rgba(255,255,255,0)"),S.fillStyle=D,S.beginPath(),S.moveTo(V,g),S.arc(V,g,26,E-.5,E+.5),S.closePath(),S.fill()}S.fillStyle=n,S.strokeStyle="rgba(10,14,22,.9)",S.lineWidth=1.5,S.beginPath(),S.arc(V,g,3.6,0,Math.PI*2),S.fill(),S.stroke()}},dispose(){b.remove()}}}var Zt=78,mo=18;function ho(){let t=[],e=[],n=[],r=[],a=[],o=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,_e,-1],max:[1,gt,-.72]}])for(let l of o){let m=t.length/3,v=l.n[1]+(s.part===2?Math.abs(l.n[0])*(1-qt)/(gt-_e):0),d=Math.hypot(l.n[0],v,l.n[2]),c=[l.n[0]/d,v/d,l.n[2]/d];for(let[h,u]of l.c.entries()){let b=u.map((p,x)=>s.min[x]+p*(s.max[x]-s.min[x]));s.part===2&&(b[0]*=1-u[1]*(1-qt)),t.push(...b),e.push(...c),n.push(s.part),r.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][h])}a.push(m,m+1,m+2,m,m+2,m+3)}let i=t.length/3;for(let[s,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])t.push(s,l,0),e.push(0,1,0),n.push(0),r.push(s,l);return a.push(i,i+1,i+2,i,i+2,i+3),a.push(...a.slice(12,18),...a.slice(60,66),...a.slice(72,78)),{position:new Float32Array(t),normal:new Float32Array(e),surface:new Float32Array(n),uv:new Float32Array(r),index:new Uint16Array(a)}}import{Renderer as ca}from"ogl";function ua(){let t=typeof window<"u"&&window.devicePixelRatio||1,e=navigator.deviceMemory,n=typeof e=="number"&&e<=4?1.5:2;return Math.min(t,n)}var xt=class{constructor(e,n){this.clearRgb=[0,0,0];this.container=e,this.canvas=document.createElement("canvas"),this.canvas.style.display="block",this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.touchAction="none",this.canvas.tabIndex=0,this.canvas.setAttribute("role","application"),this.canvas.setAttribute("aria-label","Interactive 3D venue. Drag or use arrow keys to look around; pinch, scroll, plus or minus to zoom."),this.renderer=new ca({canvas:this.canvas,dpr:ua(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[yt.top[0],yt.top[1],yt.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(e){this.clearRgb=[e[0],e[1],e[2]],this.gl.clearColor(e[0],e[1],e[2],1)}get clearColor(){return this.clearRgb}resize(){let e=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(e,n),{width:e,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let e=this.gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let e=this.gl.getExtension("WEBGL_lose_context");e&&(e.loseContext(),setTimeout(()=>{e.restoreContext&&e.restoreContext()},300))}};import{Camera as da,Vec3 as Qt}from"ogl";var ue=Math.PI/180,Jt=15*ue,en=80*ue,Oe=.12,po=35,tn=1.25,fo=.006,ma=4,ze=.82,nt=1/ze,ha=.12,pa=2;function fa(t,e){return{azimuth:0-t*fo,polar:-e*fo}}function vo(t,e,n){let r=Math.max(pa,Math.max(1,e)*ha),a=n*ma;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,a):a}}var va=1.5;function ba(t,e,n){let r=Math.max(1,n)*va;if(!t)return{anchor:[e[0],e[1],e[2]],limit:r};let[a,o,i]=t.anchor,s=e[1]-o,l=Math.max(Math.abs(e[0]-a),Math.abs(e[2]-i),s>=0?s:-s*2);return{anchor:t.anchor,limit:Math.max(t.limit,l+r)}}function ga(t,e,n,r,a,o,i,s){let l=Math.sin(n),m=[l*Math.sin(e),Math.cos(n),l*Math.cos(e)],v=[t[0]+r*m[0],t[1]+r*m[1],t[2]+r*m[2]],d=[-m[0],-m[1],-m[2]],c=[-d[2],0,d[0]],h=Math.hypot(c[0],c[2])||1;c=[c[0]/h,0,c[2]/h];let u=[c[1]*d[2]-c[2]*d[1],c[2]*d[0]-c[0]*d[2],c[0]*d[1]-c[1]*d[0]],b=Math.tan(a*ue/2),p=b*(o>0?o:1),x=[0,1,2].map(I=>d[I]+i*p*c[I]+s*b*u[I]);if(x[1]>=-1e-6)return null;let P=(t[1]-v[1])/x[1],S=Math.hypot(x[0],x[1],x[2]);return!(P>0)||P*S>r*ya?null:[v[0]+x[0]*P,t[1],v[2]+x[2]*P]}var bo=3,ya=4,go=.72,xa=.6;function Sa(t,e,n){return t!=="auto"?t:n!==null&&e<n*xa?"pan":"orbit"}function yo(t,e){let n=Math.sin(e),r=-n*Math.sin(t),a=-Math.cos(e),o=-n*Math.cos(t);if(Math.abs(a)>.999)return null;let i=-o,s=r,l=Math.hypot(i,s);return i/=l,s/=l,{fx:r,fy:a,fz:o,rx:i,rz:s,ux:-s*a,uy:s*r-i*o,uz:i*a}}var wa=.4;function Ma(t,e,n,r,a,o){let i=[t.center[0],t.center[1],t.center[2]],s=o(i),l=t.fitPoints,m=yo(r,a);if(!l||l.length<9||!m)return{center:i,distance:s};let{fx:v,fy:d,fz:c,rx:h,rz:u,ux:b,uy:p,uz:x}=m,P=Math.hypot(v,c),S=v/P,I=c/P,w=S*b+I*x,R=wa*Math.max(1,t.radius);for(let V=0;V<3;V++){let g=1/0,E=-1/0,M=1/0,D=-1/0;for(let W=0;W+2<l.length;W+=3){let N=l[W]-i[0],ee=l[W+1]-i[1],Z=l[W+2]-i[2],Y=s+N*v+ee*d+Z*c;if(!(Y>.001))continue;let T=(N*h+Z*u)/(Y*e),C=(N*b+ee*p+Z*x)/(Y*n);T<g&&(g=T),T>E&&(E=T),C<M&&(M=C),C>D&&(D=C)}if(!Number.isFinite(g))break;let H=(g+E)/2*s*e,F=Math.abs(w)>.1?(M+D)/2*s*n/w:0,z=H*h+F*S,B=H*u+F*I;if(Math.hypot(i[0]+z-t.center[0],i[2]+B-t.center[2])>R){let W=i[0]-t.center[0],N=i[2]-t.center[2],ee=W+z,Z=N+B,Y=R/Math.hypot(ee,Z);z=ee*Y-W,B=Z*Y-N}i=[i[0]+z,i[1],i[2]+B],s=o(i)}return{center:i,distance:s}}var St=class{constructor(e,n,r,a){this.fovY=po;this.target=new Qt;this.azimuth=-30*ue;this.polar=55*ue;this.distance=10;this.azT=-30*ue;this.polT=55*ue;this.distT=10;this.minDist=1;this.maxDist=100;this.envelope=null;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new Qt;this.panAnchor=new Qt;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new da(e,{fov:po,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=a,this.onPointerDown=o=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(o.pointerId)}catch{}if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size===1){let i=this.dragAction(),s=i==="orbit"?"pan":"orbit",l=o.button===2||o.button===1||o.shiftKey?s:i;this.panning=l==="pan",this.dragging=!this.panning,this.lastX=o.clientX,this.lastY=o.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let i=this.pinchCentroid();this.pinchCx=i.x,this.pinchCy=i.y}}},this.onPointerMove=o=>{if(!this.interactionEnabled||!this.activePointers.has(o.pointerId))return;if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size>=2){let m=this.currentPinchDistance(),v=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-m)*.005),v.x,v.y),this.fireGesture()),this.pinchDist=m;let d=this.currentPinchAngle(),c=d-this.pinchAngle;c>Math.PI&&(c-=2*Math.PI),c<-Math.PI&&(c+=2*Math.PI),this.pinchAngle=d,Math.abs(c)>1e-4&&Math.abs(c)<.5&&(this.azT+=c,this.fireGesture()),this.panBy(v.x-this.pinchCx,v.y-this.pinchCy),this.pinchCx=v.x,this.pinchCy=v.y;return}let i=o.clientX-this.lastX,s=o.clientY-this.lastY;if(this.panning){this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&(this.panBy(i,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&this.fireGesture();let l=fa(i,s);this.azT+=l.azimuth,this.polT=Math.max(Jt,Math.min(en,this.polT+l.polar)),this.requestRender()},this.onPointerUp=o=>{this.activePointers.delete(o.pointerId);try{this.canvas.releasePointerCapture?.(o.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=o=>{o.preventDefault()},this.onWheel=o=>{if(o.preventDefault(),!this.interactionEnabled)return;let i=o.deltaMode===1?16:o.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,o.deltaY*i/100));this.dollyAt(Math.exp(s*.22),o.clientX,o.clientY),this.fireGesture()},this.onKeyDown=o=>{if(!this.interactionEnabled)return;let i=7*ue;if(o.shiftKey&&(o.key==="ArrowLeft"||o.key==="ArrowRight"||o.key==="ArrowUp"||o.key==="ArrowDown"))this.panBy(o.key==="ArrowLeft"?-32:o.key==="ArrowRight"?32:0,o.key==="ArrowUp"?-32:o.key==="ArrowDown"?32:0);else if(o.key==="ArrowLeft"||o.key==="ArrowRight")this.azT+=o.key==="ArrowLeft"?i:-i;else if(o.key==="ArrowUp"||o.key==="ArrowDown")this.polT=Math.max(Jt,Math.min(en,this.polT+(o.key==="ArrowUp"?-i:i)));else if(o.key==="+"||o.key==="=")this.dollyBy(ze);else if(o.key==="-"||o.key==="_")this.dollyBy(nt);else return;o.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let e=[...this.activePointers.values()];if(!e.length)return{x:0,y:0};let n=0,r=0;for(let a of e)n+=a.x,r+=a.y;return{x:n/e.length,y:r/e.length}}panBy(e,n){let r=this.canvas.clientHeight||1,a=2*this.distance*Math.tan(this.fovY*ue/2)/r,o=Math.sin(this.azimuth),i=Math.cos(this.azimuth),s=i,l=-o,m=Math.cos(this.polar),v=Math.sin(this.polar),d=-o*m,c=-i*m;this.targetT.x+=(-e*s+n*d)*a,this.targetT.z+=(-e*l+n*c)*a,this.targetT.y+=n*v*a,this.clampPan(),this.requestRender()}widenPanBox(e){this.panBox=ba(this.panBox,e.center,e.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,n=this.panAnchor.x,r=this.panAnchor.y,a=this.panAnchor.z;this.targetT.x=Math.max(n-e,Math.min(n+e,this.targetT.x)),this.targetT.z=Math.max(a-e,Math.min(a+e,this.targetT.z)),this.targetT.y=Math.max(r-e*.5,Math.min(r+e,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[e,n]=[...this.activePointers.values()];return e&&n?Math.atan2(n.y-e.y,n.x-e.x):0}dragAction(){return Sa(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let e=[...this.activePointers.values()];return e.length<2?0:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)}dollyBy(e){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*e)),this.requestRender()}dollyAt(e,n,r){let a=this.distT,o=this.canvas.getBoundingClientRect?.(),i=this.zoomPointResolver?.(n,r)??null;if(i){this.distT=Math.max(bo,Math.min(this.maxDist,this.distT*e)),this.minDist=Math.min(this.minDist,Math.max(bo,this.distT)),this.requestRender(),this.scaleTargetAbout(i,this.distT/a);return}let s=o&&o.width>0&&o.height>0?ga([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||o.width/o.height,(n-o.left)/o.width*2-1,1-(r-o.top)/o.height*2):null;this.dollyBy(e),s&&this.scaleTargetAbout(s,this.distT/a)}scaleTargetAbout(e,n){!Number.isFinite(n)||n===1||(this.targetT.x=e[0]+(this.targetT.x-e[0])*n,this.targetT.y=e[1]+(this.targetT.y-e[1])*n,this.targetT.z=e[2]+(this.targetT.z-e[2])*n,this.clampPan())}setZoomPointResolver(e){this.zoomPointResolver=e}zoomBy(e){this.interactionEnabled&&(this.dollyBy(e),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(e){this.primaryDragMode=e}setInteractionEnabled(e){this.interactionEnabled=e,!e&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(e,n=!1,r,a=!1,o){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e);let i=Math.max(1,e.radius),s=this.fovY*ue/2,l=a?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,m=Math.atan(Math.tan(s)*l);this.azT=r??-30*ue,this.polT=Math.max(15,Math.min(80,o?.polarDeg??55))*ue;let v=this.framedOn(e,s,m),d=v.distance;this.target.set(v.center[0],v.center[1],v.center[2]),this.targetT.copy(this.target),this.distT=d*Math.max(1.05,Math.min(2,o?.margin??tn)),this.envelope=vo(this.envelope,i,d),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*ue,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){if(!(e>0)||!Number.isFinite(e))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let r=Math.min(n,1)/Math.min(e,1);this.distance*=r,this.distT*=r,this.overviewDist!==null&&(this.overviewDist*=r),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:e})}glideTo(e,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(e),this.targetT.set(e.center[0],e.center[1],e.center[2]);let r=this.fovY*ue/2,a=Math.atan(Math.tan(r)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*ue;let o=this.framedOn(e,r,a),i=o.distance;this.targetT.set(o.center[0],o.center[1],o.center[2]),this.distT=i*Math.max(1.05,Math.min(2,n?.margin??tn)),this.envelope=vo(this.envelope,Math.max(1,e.radius),i),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(e,n,r=!1,a){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let o=this.fovY*ue/2,i=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(o)*i);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,a?.polarDeg??55))*ue;let l=this.framedOn(e,o,s);this.targetT.set(l.center[0],l.center[1],l.center[2]),this.distT=l.distance*Math.max(1.05,Math.min(2,a?.margin??tn))}framedOn(e,n,r){return Ma(e,Math.tan(r),Math.tan(n),this.azT,this.polT,a=>this.fitDistance({...e,center:a},n,r,this.azT,this.polT))}fitDistance(e,n,r,a,o){let i=Math.max(1,e.radius),s=Math.max(i/Math.tan(n),i/Math.tan(r)),l=e.box;if(!l)return s;let m=yo(a,o);if(!m)return s;let{fx:v,fy:d,fz:c,rx:h,rz:u,ux:b,uy:p,uz:x}=m,P=Math.tan(r),S=Math.tan(n),I=1;for(let M=0;M<8;M++){let D=(M&1?l.max[0]:l.min[0])-e.center[0],H=(M&2?l.max[1]:l.min[1])-e.center[1],F=(M&4?l.max[2]:l.min[2])-e.center[2],z=D*v+H*d+F*c,B=Math.abs(D*h+F*u),U=Math.abs(D*b+H*p+F*x);I=Math.max(I,B/P-z,U/S-z)}let w=Math.min(s,Math.max(I,i*.35)),R=e.fitPoints;if(!R||R.length<9)return w;let V=0,g=1/(P*go),E=1/(S*go);for(let M=0;M+2<R.length;M+=3){let D=R[M]-e.center[0],H=R[M+1]-e.center[1],F=R[M+2]-e.center[2],z=D*v+H*d+F*c,B=Math.abs(D*h+F*u),U=Math.abs(D*b+H*p+F*x);V=Math.max(V,B*g-z,U*E-z)}return Math.min(w*1.5,Math.max(w*.55,V))}updateClipping(e){let n=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],a=this.camera.position.z-e.center[2],o=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),i=this.interactionEnabled&&Math.abs(o-this.distance)<=this.distance*.01,{near:s,far:l}=Ca(Math.hypot(n,r,a),e.radius,i?this.distance:null);this.camera.perspective({near:s,far:l,aspect:this.camera.aspect})}update(){let e=this.azT-this.azimuth,n=this.polT-this.polar,r=this.distT-this.distance,a=this.targetT.x-this.target.x,o=this.targetT.y-this.target.y,i=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),l=Math.abs(e)>1e-4||Math.abs(n)>1e-4||Math.abs(r)>1e-4||Math.abs(a)>s||Math.abs(o)>s||Math.abs(i)>s;return this.azimuth+=e*Oe,this.polar+=n*Oe,this.distance+=r*Oe,this.target.x+=a*Oe,this.target.y+=o*Oe,this.target.z+=i*Oe,l&&this.applyPosition(),l}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let e=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,a=Math.hypot(e,n,r)||1,o=Math.max(Jt,Math.min(en,Math.acos(Math.max(-1,Math.min(1,n/a)))));this.distance=this.distT=a,this.polar=this.polT=o,this.azimuth=this.azT=Math.atan2(e,r)}snapshot(){let e=this.target.clone(),n=this.targetT.clone(),{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}=this,m=this.camera.position.clone(),v=[...this.camera.quaternion],d=this.camera.fov;return()=>{this.target.copy(e),this.targetT.copy(n),Object.assign(this,{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}),this.camera.position.copy(m),this.camera.quaternion.set(v[0],v[1],v[2],v[3]),this.camera.perspective({fov:d,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(e){this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target)}resumeAfterFlight(e){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),e&&this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let e=Math.sin(this.polar),n=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),a=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(n,r,a),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}},Pa=.1,Aa=.25;function Ca(t,e,n){let r=Math.max(1,e)*1.18,a=n==null?Aa:Math.max(.05,n*Pa),o=Math.max(a,t-r),i=Math.max(o+10,t+r);return{near:o,far:i}}var wt=class{constructor(e){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=e=>{let n=this.lastTime?(e-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=e,n>0){let a=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+a*.1:a}this.rendered++,this.frame(n)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=e}requestRender(){this.running||(this.running=!0,this.lastTime=0,this.rafId=requestAnimationFrame(this.tick))}stats(){return{fps:this.running?Math.round(this.fpsEma):0,rendered:this.rendered,idle:!this.running}}stop(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.running=!1}};function xo(t){let e=!1;return n=>{n!==e&&(e=n,n?t.dataset.slReady="1":delete t.dataset.slReady)}}var Ne=2.5,Ea=1.15,ot=12,He=22,So=6,wo=9.5,Mo=.9,Po=2.2,nn=30,on=4,Mt=8192;var al=He+on;function Ao(t,e){let n=e*1.4,r=e*3.2;if(t<=n)return{scale:1,fade:0,minPixels:Ne};let a=Math.min(1,(t-n)/Math.max(.001,r-n));return{scale:1-a*.4,fade:a*.55,minPixels:Ne+a*(Ea-Ne)}}function Co(t,e,n){return!(t>0)||!(e>0)||!(n>0)?!1:e*n/t>=64}var Ra=12;function Eo(t,e,n,r,a){if(!(t>0)||!(e>0)||!(n>0)||!(r>0)||!(a>0))return!1;let o=Math.tan(r/2*Math.PI/180);if(!(o>0))return!1;let i=e/(n*o)*(a/2);return Math.PI*i*i/t>=Ra}import{Geometry as Ta,Mesh as _a,Program as Ia,Transform as Fa}from"ogl";var Da=.05,Va=1.1,ka=12,La=1.6,Oa=1,za=2.5,Na=650,To=[[-.15,0,0,.15,.13,.42],[-.13,-.45,.36,.13,.02,.47]],_o={centre:[0,0,-.05],hipRadius:.15,shoulderRadius:.2,height:.56,sides:8,depth:.62},rn={centre:[0,.74,-.04],radii:[.1,.12,.11]},Ge={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40},Ha=90,ll={height:rn.centre[1]+rn.radii[1],radius:Math.max(_o.shoulderRadius,...To.map(t=>Math.max(Math.abs(t[0]),Math.abs(t[3]))))};function Ga(t,e){if(e)return 0;let n=(t-Ge.fadeInFromM)/(Ge.fullByM-Ge.fadeInFromM);return Math.max(0,Math.min(1,n))}function Ba(t,e){return!e&&t<Ha}var Ro=24;function Wa(t){let e=[],n=[],r=[],a=(d,c,h)=>{e.push(...d),n.push(...c),r.push(h)};for(let d=0;d<16;d++){let c=d/16*Math.PI*2,h=(d+1)/16*Math.PI*2,u=S=>[Math.cos(S),0,Math.sin(S)],b=[Math.cos(c)*.012,0,Math.sin(c)*.012],p=[Math.cos(h)*.012,0,Math.sin(h)*.012],x=[Math.cos(c)*.03,1,Math.sin(c)*.03],P=[Math.cos(h)*.03,1,Math.sin(h)*.03];a(b,u(c),0),a(x,u(c),0),a(P,u(h),0),a(b,u(c),0),a(P,u(h),0),a(p,u(h),0)}let l=.16,m=.24,v=.01;for(let d=0;d<48;d++){let c=d/48*Math.PI*2,h=(d+1)/48*Math.PI*2,u=[Math.cos(c)*l,v,Math.sin(c)*l],b=[Math.cos(c)*m,v,Math.sin(c)*m],p=[Math.cos(h)*m,v,Math.sin(h)*m],x=[Math.cos(h)*l,v,Math.sin(h)*l];for(let P of[u,b,p,u,p,x])a(P,[0,1,0],1)}for(let[d,c,h,u,b,p]of To){let x=[[[0,0,1],[[d,c,p],[u,c,p],[u,b,p],[d,b,p]]],[[0,0,-1],[[u,c,h],[d,c,h],[d,b,h],[u,b,h]]],[[1,0,0],[[u,c,p],[u,c,h],[u,b,h],[u,b,p]]],[[-1,0,0],[[d,c,h],[d,c,p],[d,b,p],[d,b,h]]],[[0,1,0],[[d,b,p],[u,b,p],[u,b,h],[d,b,h]]],[[0,-1,0],[[d,c,h],[u,c,h],[u,c,p],[d,c,p]]]];for(let[P,[S,I,w,R]]of x)for(let V of[S,I,w,S,w,R])a(V,P,2)}{let{centre:d,hipRadius:c,shoulderRadius:h,height:u,sides:b,depth:p}=_o,x=(P,S,I)=>{let w=P/b*Math.PI*2+Math.PI/b;return[d[0]+Math.cos(w)*S,d[1]+I,d[2]+Math.sin(w)*S*p]};for(let P=0;P<b;P++){let S=x(P,c,0),I=x(P+1,c,0),w=x(P+1,h,u),R=x(P,h,u),V=[I[0]-S[0],I[1]-S[1],I[2]-S[2]],g=[R[0]-S[0],R[1]-S[1],R[2]-S[2]],E=[V[1]*g[2]-V[2]*g[1],V[2]*g[0]-V[0]*g[2],V[0]*g[1]-V[1]*g[0]],M=Math.hypot(...E)||1;E=[E[0]/M,E[1]/M,E[2]/M],E[0]*(S[0]-d[0])+E[2]*(S[2]-d[2])<0&&(E=[-E[0],-E[1],-E[2]]);for(let D of[S,I,w,S,w,R])a(D,E,2);a([d[0],d[1]+u,d[2]],[0,1,0],2),a(R,[0,1,0],2),a(w,[0,1,0],2)}}{let{centre:d,radii:c}=rn,h=8,u=(b,p)=>{let x=b/16*Math.PI*2,P=p/h*Math.PI,S=[Math.sin(P)*Math.cos(x),Math.cos(P),Math.sin(P)*Math.sin(x)];return[[d[0]+S[0]*c[0],d[1]+S[1]*c[1],d[2]+S[2]*c[2]],S]};for(let b=0;b<16;b++)for(let p=0;p<h;p++){let x=u(b,p),P=u(b+1,p),S=u(b+1,p+1),I=u(b,p+1);for(let[w,R]of[x,P,S,x,S,I])a(w,R,2)}}for(let d=0;d<32;d++){let c=d/32*Math.PI*2,h=(d+1)/32*Math.PI*2,u=Ge.baseRadius,b=Ge.topRadius,p=[Math.cos(c)*u,0,Math.sin(c)*u],x=[Math.cos(h)*u,0,Math.sin(h)*u],P=[Math.cos(c)*b,1,Math.sin(c)*b],S=[Math.cos(h)*b,1,Math.sin(h)*b],I=[Math.cos(c),0,Math.sin(c)],w=[Math.cos(h),0,Math.sin(h)];a(p,I,3),a(P,I,3),a(S,w,3),a(p,I,3),a(S,w,3),a(x,w,3)}return new Ta(t,{position:{size:3,data:new Float32Array(e)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(r)}})}var Ua=`#version 300 es
2
2
  precision highp float;
3
3
  in vec3 position; in vec3 normal; in float part;
4
4
  uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat3 normalMatrix;
@@ -57,15 +57,15 @@ void main() {
57
57
  float key = max(dot(normalize(vNormal), normalize(vec3(-0.4, 0.7, 0.6))), 0.0);
58
58
  vec3 c = uColor * (0.55 + 0.5 * key) + vec3(0.12) * pow(key, 12.0);
59
59
  fragColor = vec4(c, 1.0);
60
- }`;function Xa(t){if(t>=1)return 1;if(t<.72){let n=t/.72;return 1-(1-n)*(1-n)}let e=(t-.72)/.28;return 1-.08*Math.sin(e*Math.PI)}function an(t){return Math.max(Va,Math.min(ka,t*Da))}function qa(t){let e=.2126*t[0]+.7152*t[1]+.0722*t[2],n=e>=.25?0:Math.min(.45,(.25-e)*2.2);return t.map(r=>r+(1-r)*n)}function _o(t,e,n=[.24,.74,1]){n=qa(n);let r=new Fa,a=Wa(t),o=new Map,i=(s,l,m)=>{let v=new Ia(t,{vertex:Ua,fragment:Ya,uniforms:{uSeat:{value:s},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uFigure:{value:1},uYaw:{value:m},uBeamHeight:{value:Ge.height},uBeam:{value:0},uFigureColor:{value:n},uColor:{value:e},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),d=new _a(t,{geometry:a,program:v});return d.frustumCulled=!1,d.setParent(r),{mesh:d,program:v,seat:s,start:l}};return{root:r,setSeats(s,l,m){let v=new Set(s.slice(0,Eo).map(d=>d.id));for(let[d,c]of o)v.has(d)||(c.mesh.setParent(null),o.delete(d));for(let d of s.slice(0,Eo))o.has(d.id)||o.set(d.id,i(d.position,m?l:-1/0,d.facing??0))},update(s,l,m,v=!1){let d=!1;for(let c of o.values()){let h=l[0]-c.seat[0],u=l[1]-c.seat[1],b=l[2]-c.seat[2],p=Math.hypot(h,u,b);c.mesh.visible=!m&&p>(v?Oa:za);let x=an(p),P=Math.max(0,Math.min(1,(s-c.start)/Na));P<1&&(d=!0),c.program.uniforms.uHeight.value=x,c.program.uniforms.uRingScale.value=Math.min(x,La),c.program.uniforms.uLift.value=v?1:1-Xa(P),c.program.uniforms.uFigure.value=Ba(p,v)?1:0,c.program.uniforms.uBeam.value=Ga(p,v),c.program.uniforms.uRingAlpha.value=.55+.4*(P<1?Math.sin(P*Math.PI):0)}return d},dispose(){for(let s of o.values())s.mesh.setParent(null);o.clear(),a.remove()}}}var rt="#ffffff",Io="#0b1220",at=6,ja=80,Fo=14,Do=88,Vo=20,ko={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},$a=640,Ka=.8,Za=11,Qa="3px 7px",Ja="2px 5px",Lo="rgba(10,14,22,.62)",ei="#f4f7fb",Oo=5,zo=2,ti=6,it=new Set(["row","seat","access"]),No={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},Be={row:{x:66,y:20},seat:{x:52,y:22}},Ie=Wn,sn=t=>Un(t);function Fe(t,e){let n=sn(t),r=sn(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ni(t){let e=Ie(t);if(!e)return null;let n=o=>`#${o.map(i=>Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")).join("")}`,r=e.map(o=>o+(1-o)*.78),a=e.map(o=>o*.62);for(let o=0;o<12&&Fe(a,r)<4.5;o++)a=a.map(i=>i*.8);return{fill:n(r),ink:n(a),border:n(e.map(o=>o+(1-o)*.35)),contrast:Fe(a,r)}}var oi=30;function ln(t,e){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(t.replace(/\s/g,""));if(!n)return e;let r=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(a=>Number(n[a])/255*r+e[a-1]*(1-r))}function ri(t,e=[.04,.06,.1],n=!0){let r=sn(e)<.42,a=r?"#f4f7fb":"#0b1220",o=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",i=n?ln(o,e):e,s=Ie(t),l=n?7:4.5,m=s&&Fe(s,i)>=l?t:a;return r?{ink:m,backing:o,border:"rgba(210,222,245,.24)"}:{ink:m,backing:o,border:"rgba(11,18,32,.22)"}}function ai(t,e=[.04,.06,.1]){let n=ln(Lo,e),r=Ie(t);return{ink:r&&Fe(r,n)>=4.5?t:ei,backing:Lo}}var ii=.8,We=20,si=14,li=60,ci='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Pt=class{constructor(e,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let r=this.root.style;r.position="absolute",r.inset="0",r.pointerEvents="none",r.overflow="hidden",r.fontFamily=n.fontFamily||ci,e.appendChild(this.root)}setVisible(e){this.root.style.visibility=e?"":"hidden"}setLabels(e){this.labels=e;let n=new Set(e.map(r=>r.id));for(let[r,a]of this.nodes)n.has(r)||(a.remove(),this.nodes.delete(r))}setForcedDense(e){this.forcedDense=e}setOverviewDistance(e){this.overviewDistance=e>0?e:null}setSeatNumberRow(e){return e===this.seatNumberRow?!1:(this.seatNumberRow=e,!0)}setSeatNumberSeat(e){let n=e?`seat:${e}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(e){let n=e.size!==this.wheelchairFree.size;if(!n){for(let[r,a]of e)if(this.wheelchairFree.get(r)!==a){n=!0;break}}return n&&(this.wheelchairFree=new Map(e)),n}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,n=>`seat:${n}`))}sizeFor(e){let n=ko[e].size;return!this.narrowStage||it.has(e)?n:Math.max(Za,n*Ka)}qualityEvidence(){let e=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let a=this.nodes.get(r.id),o=a?.getBoundingClientRect(),i=!!(n&&a&&a.style.display!=="none"&&o&&o.width>0&&o.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:i,renderedFontPx:a&&Number.parseFloat(a.style.fontSize)||0,contrast:a?Number(a.dataset.qualityContrast??0):0,...i&&o?{screenBox:{x:o.x-e.x,y:o.y-e.y,width:o.width,height:o.height}}:{}}})}update(e,n,r,a,o,i){if(!this.labels.length)return;this.narrowStage=n>0&&n<$a;let s=Qn(a,o,{hasZoneLabels:this.labels.some(g=>g.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&a>this.overviewDistance*ii&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(g=>g.kind==="section")&&s.delete("zone");let l=[];for(let g of this.labels){if(!s.has(g.kind)&&!(g.kind==="seat"&&this.selectedSeatLabelIds.has(g.id)))continue;let E=g.kind==="seat"&&i&&this.selectedSeatLabelIds.has(g.id)?g.pinBase:void 0,M=E&&i?[E[0],E[1]+an(Math.hypot(E[0]-i[0],E[1]-i[1],E[2]-i[2])),E[2]]:g.anchor,D=Me(e,M,n,r);if(!D.visible)continue;let H=it.has(g.kind),F=this.sizeFor(g.kind),z=g.kind==="access"?We:no(g.text,F,!H)+(H?Oo*2:0)+((this.wheelchairFree.get(g.id)??0)>0?oi:0);if(g.kind==="access"&&g.seatWidthM!==void 0&&$t(e,g.anchor,g.seatWidthM,n)<si||g.kind==="seat"&&g.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(g.id)&&$t(e,g.anchor,g.seatWidthM,n)<Math.max(22,z))continue;let B=Jn(D,z/2,F/2+(H?zo:4),n,r),U=i?Math.hypot(g.anchor[0]-i[0],g.anchor[1]-i[1],g.anchor[2]-i[2]):1;l.push({label:g,screen:B,focus:ro(B,U,n,r),halfWidth:z/2,...this.selectedSeatLabelIds.has(g.id)?{priority:1}:{}})}let m=Zn(l.filter(g=>g.label.kind==="floor"),n),v=[...l.filter(g=>!it.has(g.label.kind)&&g.label.kind!=="floor"),...m],d=oo(n),c=l.filter(g=>g.label.kind==="seat"&&this.selectedSeatLabelIds.has(g.label.id)),h=et(c,Be.seat.x,Be.seat.y,d.seat);this.placePinHeads(c.filter(g=>g.label.pinBase&&!h.includes(g)).map(g=>g.screen));let u=eo(v,Do,Vo).filter(g=>!h.some(E=>to(g,E,Do,Vo))),b=et(l.filter(g=>g.label.kind==="access"),We,We,li,[...u,...h]),p=et(l.filter(g=>g.label.kind==="row"),Be.row.x,Be.row.y,d.row,[...u,...h,...b]),x=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,P=et(l.filter(g=>g.label.kind==="seat"&&!this.selectedSeatLabelIds.has(g.label.id)&&(this.seatNumberSeat!==null?g.label.id===this.seatNumberSeat:!x||this.seatNumberRow!==null&&g.label.rowId===this.seatNumberRow)),Be.seat.x,Be.seat.y,x?ja:d.seat-h.length,[...u,...h,...b,...p]),S=[...u,...b,...p,...h,...P],I=new Set(S.map(g=>g.label.id));for(let{label:g,screen:E}of S){let D=this.nodeFor(g).style;D.display=g.kind==="access"?"flex":g.kind==="gate"?"inline-flex":"";let H=!!g.pinBase&&this.selectedSeatLabelIds.has(g.id);D.transform=H?`translate(-50%, -100%) translate(${E.x.toFixed(1)}px, ${(E.y-at).toFixed(1)}px)`:`translate(-50%, -50%) translate(${E.x.toFixed(1)}px, ${E.y.toFixed(1)}px)`}let R=S.filter(({label:g})=>!it.has(g.kind)).sort((g,E)=>No[E.label.kind]-No[g.label.kind]||g.screen.depth-E.screen.depth||g.focus-E.focus).flatMap(({label:g})=>{let E=this.nodes.get(g.id);return E&&E.style.display!=="none"?[{node:E,box:E.getBoundingClientRect()}]:[]}),V=[];for(let{node:g,box:E}of R)V.some(D=>E.left<D.right+3&&E.right+3>D.left&&E.top<D.bottom+3&&E.bottom+3>D.top)?g.style.display="none":V.push(E);for(let[g,E]of this.nodes)I.has(g)||(E.style.display="none")}nodeFor(e){let n=this.nodes.get(e.id);if(!n){n=document.createElement("div");let x=n.style;x.position="absolute",x.left="0",x.top="0",x.whiteSpace="nowrap",x.display="none",this.root.appendChild(n),this.nodes.set(e.id,n)}let r=this.selectedSeatLabelIds.has(e.id),a=this.nodeAppearance.get(n),o=this.wheelchairFree.get(e.id)??0,i=e.text+(e.icon??"")+(e.tint??"")+(o>0?`|${o}`:"");if(a&&a.text===i&&a.kind===e.kind&&a.color===e.color&&a.selected===r&&a.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:i,kind:e.kind,color:e.color,selected:r,narrow:this.narrowStage}),e.kind==="access")return this.paintAccessChip(n,e);if(n.textContent=e.text,r){let x=document.createElement("span"),P=x.style;P.position="absolute",P.left="50%",P.bottom=`-${at}px`,P.transform="translateX(-50%)",P.borderLeft=`${at}px solid transparent`,P.borderRight=`${at}px solid transparent`,P.borderTop=`${at}px solid ${rt}`,n.appendChild(x)}n.setAttribute("data-label-kind",e.kind),n.toggleAttribute("data-selected-seat",r);let s=ko[e.kind],l=n.style;l.fontSize=`${this.sizeFor(e.kind)}px`,l.fontWeight=r?"800":s.weight,l.opacity=r?"1":String(s.opacity);let m=it.has(e.kind),v=!m,d=ri(e.color??this.opts.ink,this.opts.backgroundRgb,!0),c=m?ai(e.color??this.opts.ink,this.opts.backgroundRgb):d;l.color=r?Io:c.ink,l.background=r?rt:c.backing,l.border=r?`1px solid ${rt}`:v?`1px solid ${d.border}`:"",l.borderRadius=r||v?"999px":`${ti}px`;let h=this.narrowStage?Ja:Qa;l.padding=r||v?h:`${zo}px ${Oo}px`,l.lineHeight=m?"1.1":"",l.boxShadow=r?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":v?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",l.textShadow=r||v?"none":"0 1px 1px rgba(0,0,0,0.4)",l.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let u=this.opts.backgroundRgb??[.04,.06,.1],b=Ie(r?Io:c.ink)??[1,1,1],p=ln(r?rt:c.backing,u);return n.dataset.qualityContrast=Fe(b,p).toFixed(3),l.textTransform=e.kind==="zone"||e.kind==="floor"?"uppercase":"",e.kind==="section"&&this.dressSectionTag(n,e,o),e.kind==="gate"&&this.dressGateTag(n,e),n}dressGateTag(e,n){let r=e.style;r.background="#0f172a",r.color="#ffffff",r.border="1px solid rgba(255,255,255,0.28)",r.textTransform="uppercase",r.letterSpacing="0.06em",r.display="inline-flex",r.alignItems="center",r.gap="5px";let a=document.createElement("span");a.setAttribute("aria-hidden","true"),a.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),a.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',e.prepend(a),e.dataset.qualityContrast=Fe([1,1,1],Ie("#0f172a")).toFixed(3)}dressSectionTag(e,n,r){let a=n.tint?ni(n.tint):null,o=e.style;if(a&&(o.background=a.fill,o.color=a.ink,o.border=`1px solid ${a.border}`,e.dataset.qualityContrast=a.contrast.toFixed(3)),r<=0)return;let i=document.createElement("span");i.setAttribute("data-wheelchair-free",String(r)),i.setAttribute("aria-label",`${r} wheelchair ${r===1?"place":"places"} free`),i.innerHTML=`${Xt("wheelchair",{size:11})}<span>${r}</span>`;let s=i.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",e.appendChild(i)}paintAccessChip(e,n){e.setAttribute("data-label-kind","access"),e.setAttribute("data-access-type",n.icon??""),e.innerHTML=n.icon?Xt(n.icon,{size:We-6}):"",e.setAttribute("role","img"),e.setAttribute("aria-label",n.text);let r=e.style;return r.width=`${We}px`,r.height=`${We}px`,r.alignItems="center",r.justifyContent="center",r.borderRadius="50%",r.background=n.color??"#3b82f6",r.color=n.ink??"#ffffff",r.border="1.5px solid #ffffff",r.boxShadow="0 2px 6px rgba(0,0,0,.35)",r.padding="0",r.lineHeight="0",r.boxSizing="border-box",e.dataset.qualityContrast=Fe(Ie(n.ink??"#ffffff")??[1,1,1],Ie(n.color??"#3b82f6")??[.23,.51,.96]).toFixed(3),e}placePinHeads(e){for(;this.pinHeads.length<e.length;){let n=document.createElement("div");n.setAttribute("data-pin-head",""),n.setAttribute("aria-hidden","true");let r=n.style;r.position="absolute",r.left="0",r.top="0",r.width=`${Fo}px`,r.height=`${Fo}px`,r.borderRadius="50%",r.background=rt,r.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",r.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,r)=>{let a=e[r];n.style.display=a?"":"none",a&&(n.style.transform=`translate(-50%, -100%) translate(${a.x.toFixed(1)}px, ${a.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var ui=1;var di=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function mi(t){return t.every(e=>Number.isFinite(e))}function hi(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Ho(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function De(t){return Math.round(t*1e4)/1e4}function pi(t){if(t)return{box:{x:De(t.box.x),y:De(t.box.y),width:De(t.box.width),height:De(t.box.height)},horizontalFillRatio:De(t.horizontalFillRatio),verticalFillRatio:De(t.verticalFillRatio),visibleAreaRatio:De(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function Pe(t,e,n){return n.length?{code:t,message:e,count:n.length,samples:n.slice(0,20)}:null}function cn(t){let e=t.labels.filter(s=>s.visible&&s.screenBox),n=e.filter(s=>di.has(s.kind)),r=t.scene.floorCount>1?t.scene.floorCount:t.scene.zoneCount||t.scene.sectionCount,a=[];for(let s=0;s<n.length;s+=1)for(let l=0;l<s;l+=1)hi(n[s].screenBox,n[l].screenBox)&&a.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[l].id});let o=[...t.camera.position,t.camera.distance,t.camera.verticalFovDeg],i=[Pe("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),Pe("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),Pe("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),Pe("viewport-empty","The 3D viewport must have visible dimensions",t.viewport.width>1&&t.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${t.viewport.width}\xD7${t.viewport.height}`}]),Pe("camera-invalid","The capture camera must have a finite physical pose",mi(o)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),Pe("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!t.scene.authoredRelief||t.scene.renderedVerticalSpanM>.05&&t.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:t.scene.projectedReliefPx,minimum:2}]),Pe("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),Pe("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",n.filter(s=>s.renderedFontPx<11).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.renderedFontPx,minimum:11}))),Pe("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",n.filter(s=>s.contrast<4.5).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.contrast,minimum:4.5}))),Pe("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",a)].filter(s=>!!s);return{version:1,state:"venue3d",passed:i.length===0,resolvedRules:["rendered-3d-webgl-context","rendered-3d-stable-frame","rendered-3d-camera-pose","rendered-3d-relief-projection","rendered-3d-label-size","rendered-3d-label-contrast","rendered-3d-label-collision"],viewport:t.viewport,context:t.context,frame:t.frame,camera:t.camera,scene:t.scene,composition:{visibleLabels:e.map(({id:s,kind:l,text:m})=>({id:s,kind:l,text:m})).sort((s,l)=>s.kind.localeCompare(l.kind)||s.id.localeCompare(l.id)),framing:pi(t.framing)},metrics:{minimumHierarchyFontPx:Ho(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:Ho(n.map(s=>s.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:i}}function Go(t,e,n){t.fill(0);for(let r=0;r<Math.min(n,e.length);r++)t[e[r]]=1}import{Geometry as st,Mesh as lt,Program as Ni,Texture as Hi,Transform as nr}from"ogl";import{Program as Ve}from"ogl";var At=`
60
+ }`;function Xa(t){if(t>=1)return 1;if(t<.72){let n=t/.72;return 1-(1-n)*(1-n)}let e=(t-.72)/.28;return 1-.08*Math.sin(e*Math.PI)}function an(t){return Math.max(Va,Math.min(ka,t*Da))}function qa(t){let e=.2126*t[0]+.7152*t[1]+.0722*t[2],n=e>=.25?0:Math.min(.45,(.25-e)*2.2);return t.map(r=>r+(1-r)*n)}function Io(t,e,n=[.24,.74,1]){n=qa(n);let r=new Fa,a=Wa(t),o=new Map,i=(s,l,m)=>{let v=new Ia(t,{vertex:Ua,fragment:Ya,uniforms:{uSeat:{value:s},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uFigure:{value:1},uYaw:{value:m},uBeamHeight:{value:Ge.height},uBeam:{value:0},uFigureColor:{value:n},uColor:{value:e},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),d=new _a(t,{geometry:a,program:v});return d.frustumCulled=!1,d.setParent(r),{mesh:d,program:v,seat:s,start:l}};return{root:r,setSeats(s,l,m){let v=new Set(s.slice(0,Ro).map(d=>d.id));for(let[d,c]of o)v.has(d)||(c.mesh.setParent(null),o.delete(d));for(let d of s.slice(0,Ro))o.has(d.id)||o.set(d.id,i(d.position,m?l:-1/0,d.facing??0))},update(s,l,m,v=!1){let d=!1;for(let c of o.values()){let h=l[0]-c.seat[0],u=l[1]-c.seat[1],b=l[2]-c.seat[2],p=Math.hypot(h,u,b);c.mesh.visible=!m&&p>(v?Oa:za);let x=an(p),P=Math.max(0,Math.min(1,(s-c.start)/Na));P<1&&(d=!0),c.program.uniforms.uHeight.value=x,c.program.uniforms.uRingScale.value=Math.min(x,La),c.program.uniforms.uLift.value=v?1:1-Xa(P),c.program.uniforms.uFigure.value=Ba(p,v)?1:0,c.program.uniforms.uBeam.value=Ga(p,v),c.program.uniforms.uRingAlpha.value=.55+.4*(P<1?Math.sin(P*Math.PI):0)}return d},dispose(){for(let s of o.values())s.mesh.setParent(null);o.clear(),a.remove()}}}var rt="#ffffff",Fo="#0b1220",at=6,ja=80,Do=14,Vo=88,ko=20,Lo={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},$a=640,Ka=.8,Za=11,Qa="3px 7px",Ja="2px 5px",Oo="rgba(10,14,22,.62)",ei="#f4f7fb",zo=5,No=2,ti=6,it=new Set(["row","seat","access"]),sn={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},Be={row:{x:66,y:20},seat:{x:52,y:22}},Ie=Un,ln=t=>Yn(t);function Fe(t,e){let n=ln(t),r=ln(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ni(t){let e=Ie(t);if(!e)return null;let n=o=>`#${o.map(i=>Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")).join("")}`,r=e.map(o=>o+(1-o)*.78),a=e.map(o=>o*.62);for(let o=0;o<12&&Fe(a,r)<4.5;o++)a=a.map(i=>i*.8);return{fill:n(r),ink:n(a),border:n(e.map(o=>o+(1-o)*.35)),contrast:Fe(a,r)}}var oi=30;function cn(t,e){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(t.replace(/\s/g,""));if(!n)return e;let r=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(a=>Number(n[a])/255*r+e[a-1]*(1-r))}function ri(t,e=[.04,.06,.1],n=!0){let r=ln(e)<.42,a=r?"#f4f7fb":"#0b1220",o=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",i=n?cn(o,e):e,s=Ie(t),l=n?7:4.5,m=s&&Fe(s,i)>=l?t:a;return r?{ink:m,backing:o,border:"rgba(210,222,245,.24)"}:{ink:m,backing:o,border:"rgba(11,18,32,.22)"}}function ai(t,e=[.04,.06,.1]){let n=cn(Oo,e),r=Ie(t);return{ink:r&&Fe(r,n)>=4.5?t:ei,backing:Oo}}var ii=.8,We=20,si=14,li=60,ci='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Pt=class{constructor(e,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let r=this.root.style;r.position="absolute",r.inset="0",r.pointerEvents="none",r.overflow="hidden",r.fontFamily=n.fontFamily||ci,e.appendChild(this.root)}setVisible(e){this.root.style.visibility=e?"":"hidden"}setLabels(e){this.labels=e;let n=new Set(e.map(r=>r.id));for(let[r,a]of this.nodes)n.has(r)||(a.remove(),this.nodes.delete(r))}setForcedDense(e){this.forcedDense=e}setOverviewDistance(e){this.overviewDistance=e>0?e:null}setSeatNumberRow(e){return e===this.seatNumberRow?!1:(this.seatNumberRow=e,!0)}setSeatNumberSeat(e){let n=e?`seat:${e}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(e){let n=e.size!==this.wheelchairFree.size;if(!n){for(let[r,a]of e)if(this.wheelchairFree.get(r)!==a){n=!0;break}}return n&&(this.wheelchairFree=new Map(e)),n}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,n=>`seat:${n}`))}sizeFor(e){let n=Lo[e].size;return!this.narrowStage||it.has(e)?n:Math.max(Za,n*Ka)}qualityEvidence(){let e=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let a=this.nodes.get(r.id),o=a?.getBoundingClientRect(),i=!!(n&&a&&a.style.display!=="none"&&o&&o.width>0&&o.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:i,renderedFontPx:a&&Number.parseFloat(a.style.fontSize)||0,contrast:a?Number(a.dataset.qualityContrast??0):0,...i&&o?{screenBox:{x:o.x-e.x,y:o.y-e.y,width:o.width,height:o.height}}:{}}})}update(e,n,r,a,o,i){if(!this.labels.length)return;this.narrowStage=n>0&&n<$a;let s=Jn(a,o,{hasZoneLabels:this.labels.some(g=>g.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&a>this.overviewDistance*ii&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(g=>g.kind==="section")&&s.delete("zone");let l=[];for(let g of this.labels){if(!s.has(g.kind)&&!(g.kind==="seat"&&this.selectedSeatLabelIds.has(g.id)))continue;let E=g.kind==="seat"&&i&&this.selectedSeatLabelIds.has(g.id)?g.pinBase:void 0,M=E&&i?[E[0],E[1]+an(Math.hypot(E[0]-i[0],E[1]-i[1],E[2]-i[2])),E[2]]:g.anchor,D=Me(e,M,n,r);if(!D.visible)continue;let H=it.has(g.kind),F=this.sizeFor(g.kind),z=g.kind==="access"?We:oo(g.text,F,!H)+(H?zo*2:0)+((this.wheelchairFree.get(g.id)??0)>0?oi:0);if(g.kind==="access"&&g.seatWidthM!==void 0&&$t(e,g.anchor,g.seatWidthM,n)<si||g.kind==="seat"&&g.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(g.id)&&$t(e,g.anchor,g.seatWidthM,n)<Math.max(22,z))continue;let B=eo(D,z/2,F/2+(H?No:4),n,r),U=i?Math.hypot(g.anchor[0]-i[0],g.anchor[1]-i[1],g.anchor[2]-i[2]):1;l.push({label:g,screen:B,focus:ao(B,U,n,r),halfWidth:z/2,...this.selectedSeatLabelIds.has(g.id)?{priority:1}:{}})}let m=Qn(l.filter(g=>g.label.kind==="floor"),n),v=[...l.filter(g=>!it.has(g.label.kind)&&g.label.kind!=="floor"),...m],d=ro(n),c=l.filter(g=>g.label.kind==="seat"&&this.selectedSeatLabelIds.has(g.label.id)),h=et(c,Be.seat.x,Be.seat.y,d.seat);this.placePinHeads(c.filter(g=>g.label.pinBase&&!h.includes(g)).map(g=>g.screen));let u=to(v,Vo,ko,g=>sn[g.label.kind]??0).filter(g=>!h.some(E=>no(g,E,Vo,ko))),b=et(l.filter(g=>g.label.kind==="access"),We,We,li,[...u,...h]),p=et(l.filter(g=>g.label.kind==="row"),Be.row.x,Be.row.y,d.row,[...u,...h,...b]),x=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,P=et(l.filter(g=>g.label.kind==="seat"&&!this.selectedSeatLabelIds.has(g.label.id)&&(this.seatNumberSeat!==null?g.label.id===this.seatNumberSeat:!x||this.seatNumberRow!==null&&g.label.rowId===this.seatNumberRow)),Be.seat.x,Be.seat.y,x?ja:d.seat-h.length,[...u,...h,...b,...p]),S=[...u,...b,...p,...h,...P],I=new Set(S.map(g=>g.label.id));for(let{label:g,screen:E}of S){let D=this.nodeFor(g).style;D.display=g.kind==="access"?"flex":g.kind==="gate"?"inline-flex":"";let H=!!g.pinBase&&this.selectedSeatLabelIds.has(g.id);D.transform=H?`translate(-50%, -100%) translate(${E.x.toFixed(1)}px, ${(E.y-at).toFixed(1)}px)`:`translate(-50%, -50%) translate(${E.x.toFixed(1)}px, ${E.y.toFixed(1)}px)`}let R=S.filter(({label:g})=>!it.has(g.kind)).sort((g,E)=>sn[E.label.kind]-sn[g.label.kind]||g.screen.depth-E.screen.depth||g.focus-E.focus).flatMap(({label:g})=>{let E=this.nodes.get(g.id);return E&&E.style.display!=="none"?[{node:E,box:E.getBoundingClientRect()}]:[]}),V=[];for(let{node:g,box:E}of R)V.some(D=>E.left<D.right+3&&E.right+3>D.left&&E.top<D.bottom+3&&E.bottom+3>D.top)?g.style.display="none":V.push(E);for(let[g,E]of this.nodes)I.has(g)||(E.style.display="none")}nodeFor(e){let n=this.nodes.get(e.id);if(!n){n=document.createElement("div");let x=n.style;x.position="absolute",x.left="0",x.top="0",x.whiteSpace="nowrap",x.display="none",this.root.appendChild(n),this.nodes.set(e.id,n)}let r=this.selectedSeatLabelIds.has(e.id),a=this.nodeAppearance.get(n),o=this.wheelchairFree.get(e.id)??0,i=e.text+(e.icon??"")+(e.tint??"")+(o>0?`|${o}`:"");if(a&&a.text===i&&a.kind===e.kind&&a.color===e.color&&a.selected===r&&a.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:i,kind:e.kind,color:e.color,selected:r,narrow:this.narrowStage}),e.kind==="access")return this.paintAccessChip(n,e);if(n.textContent=e.text,r){let x=document.createElement("span"),P=x.style;P.position="absolute",P.left="50%",P.bottom=`-${at}px`,P.transform="translateX(-50%)",P.borderLeft=`${at}px solid transparent`,P.borderRight=`${at}px solid transparent`,P.borderTop=`${at}px solid ${rt}`,n.appendChild(x)}n.setAttribute("data-label-kind",e.kind),n.toggleAttribute("data-selected-seat",r);let s=Lo[e.kind],l=n.style;l.fontSize=`${this.sizeFor(e.kind)}px`,l.fontWeight=r?"800":s.weight,l.opacity=r?"1":String(s.opacity);let m=it.has(e.kind),v=!m,d=ri(e.color??this.opts.ink,this.opts.backgroundRgb,!0),c=m?ai(e.color??this.opts.ink,this.opts.backgroundRgb):d;l.color=r?Fo:c.ink,l.background=r?rt:c.backing,l.border=r?`1px solid ${rt}`:v?`1px solid ${d.border}`:"",l.borderRadius=r||v?"999px":`${ti}px`;let h=this.narrowStage?Ja:Qa;l.padding=r||v?h:`${No}px ${zo}px`,l.lineHeight=m?"1.1":"",l.boxShadow=r?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":v?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",l.textShadow=r||v?"none":"0 1px 1px rgba(0,0,0,0.4)",l.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let u=this.opts.backgroundRgb??[.04,.06,.1],b=Ie(r?Fo:c.ink)??[1,1,1],p=cn(r?rt:c.backing,u);return n.dataset.qualityContrast=Fe(b,p).toFixed(3),l.textTransform=e.kind==="zone"||e.kind==="floor"?"uppercase":"",e.kind==="section"&&this.dressSectionTag(n,e,o),e.kind==="gate"&&this.dressGateTag(n,e),n}dressGateTag(e,n){let r=e.style;r.background="#0f172a",r.color="#ffffff",r.border="1px solid rgba(255,255,255,0.28)",r.textTransform="uppercase",r.letterSpacing="0.06em",r.display="inline-flex",r.alignItems="center",r.gap="5px";let a=document.createElement("span");a.setAttribute("aria-hidden","true"),a.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),a.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',e.prepend(a),e.dataset.qualityContrast=Fe([1,1,1],Ie("#0f172a")).toFixed(3)}dressSectionTag(e,n,r){let a=n.tint?ni(n.tint):null,o=e.style;if(a&&(o.background=a.fill,o.color=a.ink,o.border=`1px solid ${a.border}`,e.dataset.qualityContrast=a.contrast.toFixed(3)),r<=0)return;let i=document.createElement("span");i.setAttribute("data-wheelchair-free",String(r)),i.setAttribute("aria-label",`${r} wheelchair ${r===1?"place":"places"} free`),i.innerHTML=`${Xt("wheelchair",{size:11})}<span>${r}</span>`;let s=i.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",e.appendChild(i)}paintAccessChip(e,n){e.setAttribute("data-label-kind","access"),e.setAttribute("data-access-type",n.icon??""),e.innerHTML=n.icon?Xt(n.icon,{size:We-6}):"",e.setAttribute("role","img"),e.setAttribute("aria-label",n.text);let r=e.style;return r.width=`${We}px`,r.height=`${We}px`,r.alignItems="center",r.justifyContent="center",r.borderRadius="50%",r.background=n.color??"#3b82f6",r.color=n.ink??"#ffffff",r.border="1.5px solid #ffffff",r.boxShadow="0 2px 6px rgba(0,0,0,.35)",r.padding="0",r.lineHeight="0",r.boxSizing="border-box",e.dataset.qualityContrast=Fe(Ie(n.ink??"#ffffff")??[1,1,1],Ie(n.color??"#3b82f6")??[.23,.51,.96]).toFixed(3),e}placePinHeads(e){for(;this.pinHeads.length<e.length;){let n=document.createElement("div");n.setAttribute("data-pin-head",""),n.setAttribute("aria-hidden","true");let r=n.style;r.position="absolute",r.left="0",r.top="0",r.width=`${Do}px`,r.height=`${Do}px`,r.borderRadius="50%",r.background=rt,r.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",r.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,r)=>{let a=e[r];n.style.display=a?"":"none",a&&(n.style.transform=`translate(-50%, -100%) translate(${a.x.toFixed(1)}px, ${a.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var ui=1;var di=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function mi(t){return t.every(e=>Number.isFinite(e))}function hi(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Ho(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function De(t){return Math.round(t*1e4)/1e4}function pi(t){if(t)return{box:{x:De(t.box.x),y:De(t.box.y),width:De(t.box.width),height:De(t.box.height)},horizontalFillRatio:De(t.horizontalFillRatio),verticalFillRatio:De(t.verticalFillRatio),visibleAreaRatio:De(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function Pe(t,e,n){return n.length?{code:t,message:e,count:n.length,samples:n.slice(0,20)}:null}function un(t){let e=t.labels.filter(s=>s.visible&&s.screenBox),n=e.filter(s=>di.has(s.kind)),r=t.scene.floorCount>1?t.scene.floorCount:t.scene.zoneCount||t.scene.sectionCount,a=[];for(let s=0;s<n.length;s+=1)for(let l=0;l<s;l+=1)hi(n[s].screenBox,n[l].screenBox)&&a.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[l].id});let o=[...t.camera.position,t.camera.distance,t.camera.verticalFovDeg],i=[Pe("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),Pe("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),Pe("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),Pe("viewport-empty","The 3D viewport must have visible dimensions",t.viewport.width>1&&t.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${t.viewport.width}\xD7${t.viewport.height}`}]),Pe("camera-invalid","The capture camera must have a finite physical pose",mi(o)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),Pe("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!t.scene.authoredRelief||t.scene.renderedVerticalSpanM>.05&&t.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:t.scene.projectedReliefPx,minimum:2}]),Pe("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),Pe("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",n.filter(s=>s.renderedFontPx<11).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.renderedFontPx,minimum:11}))),Pe("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",n.filter(s=>s.contrast<4.5).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.contrast,minimum:4.5}))),Pe("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",a)].filter(s=>!!s);return{version:1,state:"venue3d",passed:i.length===0,resolvedRules:["rendered-3d-webgl-context","rendered-3d-stable-frame","rendered-3d-camera-pose","rendered-3d-relief-projection","rendered-3d-label-size","rendered-3d-label-contrast","rendered-3d-label-collision"],viewport:t.viewport,context:t.context,frame:t.frame,camera:t.camera,scene:t.scene,composition:{visibleLabels:e.map(({id:s,kind:l,text:m})=>({id:s,kind:l,text:m})).sort((s,l)=>s.kind.localeCompare(l.kind)||s.id.localeCompare(l.id)),framing:pi(t.framing)},metrics:{minimumHierarchyFontPx:Ho(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:Ho(n.map(s=>s.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:i}}function Go(t,e,n){t.fill(0);for(let r=0;r<Math.min(n,e.length);r++)t[e[r]]=1}import{Geometry as st,Mesh as lt,Program as Ni,Texture as Hi,Transform as nr}from"ogl";import{Program as Ve}from"ogl";var At=`
61
61
  float chairWeight(float depth) {
62
62
  return 1.0 - smoothstep(uChairFull, uChairNone, depth);
63
63
  }`,Bo=`
64
64
  float occupantWeight(float depth) {
65
- float nearWeight = smoothstep(${wo.toFixed(1)}, ${Mo.toFixed(1)}, depth);
66
- float farWeight = 1.0 - smoothstep(${xo.toFixed(1)}, ${So.toFixed(1)}, depth);
65
+ float nearWeight = smoothstep(${Mo.toFixed(1)}, ${Po.toFixed(1)}, depth);
66
+ float farWeight = 1.0 - smoothstep(${So.toFixed(1)}, ${wo.toFixed(1)}, depth);
67
67
  return nearWeight * farWeight;
68
- }`,un=`
68
+ }`,dn=`
69
69
  float glyphEq(float glyph, float expected) {
70
70
  return 1.0 - step(0.25, abs(glyph - expected));
71
71
  }
@@ -324,7 +324,7 @@ void main() {
324
324
  base = mix(base, display, poweredDisplay * verticalFace * 0.92);
325
325
  fragColor = vec4(base, 1.0);
326
326
  }`,Uo=`
327
- ${un}
327
+ ${dn}
328
328
  vec4 seatSurface(vec3 source, float radius) {
329
329
  vec4 origin = modelViewMatrix * vec4(iOffset, 1.0);
330
330
  if (iPhysicalSeat < 0.5) {
@@ -548,7 +548,7 @@ out vec3 vOccupantTint;
548
548
  out float vTaken; // 1 = sold or held: not for sale
549
549
  ${At}
550
550
  ${Bo}
551
- ${un}
551
+ ${dn}
552
552
  uniform vec3 cameraPosition;
553
553
  ${Ue}
554
554
  void main() {
@@ -851,7 +851,7 @@ out float vHidden;
851
851
  uniform vec3 cameraPosition;
852
852
  ${At}
853
853
  ${Bo}
854
- ${un}
854
+ ${dn}
855
855
  ${Ue}
856
856
  void main() {
857
857
  if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
@@ -946,7 +946,7 @@ void main() {
946
946
  void main() {
947
947
  if (abs(vMaterial - 6.0) < 0.5) discard;
948
948
  fragColor = vec4(1.0);
949
- }`}),d=new ki,c=new Fi(t,{geometry:e,program:v});c.frustumCulled=!1,c.setParent(d);let h=t.getParameter(t.COLOR_CLEAR_VALUE),u=t.isEnabled(t.DITHER);try{t.disable(t.DITHER),t.clearColor(1,1,1,1),t.renderer.render({scene:d,camera:l,target:m})}finally{u&&t.enable(t.DITHER),t.clearColor(h[0],h[1],h[2],h[3]),v.remove()}let b=new Ii().multiply(l.projectionMatrix,l.viewMatrix);return{texture:m.depthTexture,matrix:b,dispose(){for(let p of m.textures)t.deleteTexture(p.texture);t.deleteTexture(m.depthTexture.texture),t.deleteFramebuffer(m.buffer),m.depthBuffer&&t.deleteRenderbuffer(m.depthBuffer)}}}var Li=.65,Oi=new Set(["dimmed","sold"]),zi=new Set(["dimmed","sold","held"]);function er(t,e,n){let r=new Set,a=!1,o=ye.indexOf("dimmed"),i=!1;for(let l=0;l<n.length;l+=1)if(n[l]===o){i=!0;break}let s=i?zi:Oi;for(let l of t){let m=e.get(l.sectionId);if(!m||!m.length){r.add(l.sectionId);continue}let v=!1;for(let d of m){let c=ye[n[d]]??"available";if(!s.has(c)){v=!0;break}}v?r.add(l.sectionId):a=!0}return{lit:r,anyUnlit:a}}function tr(t,e,n,r,a,o){let i=[];for(let s of t){let l=a===null||a.has(s.sectionId);if(r.get(s.sectionId)===l)continue;r.set(s.sectionId,l);let m=(s.start+s.count)*3;for(let v=s.start*3;v<m;v++)e[v]=l?n[v]:n[v]+(o[v%3]-n[v])*Li;i.push(s)}return i}var or=ye.indexOf("selected");function Gi(t,e){return[0,1,2].map(n=>t[n]*.15+.75+e[n]*.1)}function rr(t,e,n,r,a,o){for(let i=n;i<n+r;i++){let s=o&&e[i]===0,l=o&&e[i]===or?Gi([o[i*3],o[i*3+1],o[i*3+2]],a[or]??a[0]):s?null:a[e[i]]??a[0];t[i*3]=l?l[0]:o[i*3],t[i*3+1]=l?l[1]:o[i*3+1],t[i*3+2]=l?l[2]:o[i*3+2]}}var Bi=new Float32Array([-1,-1,3,-1,-1,3]);function ar(t,e){let n=new nr,r=new nr,a=new st(t,{position:{size:2,data:Bi}}),o=Qo(t,e.theme.background.top,e.theme.background.bottom,e.outdoor?e.theme.sky:null),i=new lt(t,{geometry:a,program:o});i.frustumCulled=!1,i.setParent(r);let s=new st(t,{position:{size:3,data:e.solids.position},normal:{size:3,data:e.solids.normal},color:{size:3,data:e.solids.color},floorIndex:{size:1,data:e.solids.floor},materialIndex:{size:1,data:e.solids.material}}),l=Jo(t,s,e.renderBounds),m=$o(t,e.theme.materials.roughness,e.theme.structure.tierTop);m.uniforms.tVenueShadow={value:l.texture},m.uniforms.uShadowMatrix={value:l.matrix},e.room&&m.uniforms.uRoomCentre.value.set(e.room.centre);let v=new lt(t,{geometry:s,program:m});v.frustumCulled=!1,v.setParent(n);let d=Ko(t),c=new Float32Array(e.seats.count*3),h=ye.map(L=>e.theme.seatStates[L]),u=e.seats.iCategory.slice();for(let L=0;L<e.seats.count;L++){if(e.seats.iPhysicalSeat[L]<.5)continue;let J=e.theme.materials.seat??jn([u[L*3],u[L*3+1],u[L*3+2]]);u.set(J,L*3)}rr(c,e.seats.iState,0,e.seats.count,h,u);let b=mo(),p=new Uint8Array(e.seats.count),x=new st(t,{position:{size:3,data:b.position},normal:{size:3,data:b.normal},uv:{size:2,data:b.uv},index:{size:1,data:b.index},surface:{size:1,data:b.surface},iYaw:{size:1,data:e.seats.iYaw,instanced:1},iChairWidth:{size:1,data:e.seats.iChairWidth,instanced:1},iGlyph:{size:1,data:e.seats.iGlyph,instanced:1},iOffset:{size:3,data:e.seats.iPosition,instanced:1},iColor:{size:3,data:c,instanced:1},iMaxRadius:{size:1,data:e.seats.iMaxRadius,instanced:1},iHasChair:{size:1,data:p,type:t.UNSIGNED_BYTE,usage:t.DYNAMIC_DRAW,instanced:1},iPhysicalSeat:{size:1,data:e.seats.iPhysicalSeat,instanced:1},iRing:{size:3,data:e.seats.iRing,instanced:1},iFloor:{size:1,data:e.seats.iFloor,instanced:1},iSection:{size:1,data:e.seats.iSection,instanced:1}}),P=new lt(t,{geometry:x,program:d});P.frustumCulled=!1,e.seats.count>0&&P.setParent(n);let S=x.attributes.iColor,I=e.solids.color.slice(),w=e.theme.structure.ground,R=new Map(e.sectionSolidRanges.map(L=>[L.sectionId,!0])),V=Xn(),g=Zo(t,e.theme.materials.roughness),E=Mt,M=new Float32Array(E*3),D=new Float32Array(E*3),H=new Float32Array(E),F=new Float32Array(E),z=new Float32Array(E),B=new Float32Array(E*3),U=new Float32Array(E),W=new Float32Array(E),N=new Float32Array(E),ee=new Float32Array(E),Z=new Float32Array(E),Y=new st(t,{position:{size:3,data:V.position},normal:{size:3,data:V.normal},part:{size:1,data:V.part},index:{data:V.index},iOffset:{size:3,data:M,instanced:1},iColor:{size:3,data:D,instanced:1},iRadius:{size:1,data:H,instanced:1},iYaw:{size:1,data:F,instanced:1},iGlyph:{size:1,data:z,instanced:1},iRing:{size:3,data:B,instanced:1},iFloor:{size:1,data:U,instanced:1},iSection:{size:1,data:W,instanced:1},iPhysicalSeat:{size:1,data:N,instanced:1},iSeed:{size:1,data:Z,instanced:1},iPickIndex:{size:1,data:ee,instanced:1}}),T=new lt(t,{geometry:Y,program:g});T.frustumCulled=!1;let C=0,A=!1,X=!1,Q=null,ve=null,se=null,be=new Int32Array(0),te=()=>{let L=e.seats;for(let J=0;J<C;J++){let K=be[J];Z[J]=$n(L.iState[K],K),D[J*3]=c[K*3],D[J*3+1]=c[K*3+1],D[J*3+2]=c[K*3+2]}Y.attributes.iColor.needsUpdate=!0,Y.attributes.iSeed.needsUpdate=!0},me={main:n,background:r,backgroundProgram:o,seatProgram:d,solidProgram:m,chairProgram:g,seatGeometry:x,chairGeometry:Y,solidGeometry:s,drawCalls:3,setNearSeats(L,J){let K=Math.min(J,E,L.length);if(Go(p,L,K),x.attributes.iHasChair.needsUpdate=!0,be=L,C=K,K===0){T.parent&&T.setParent(null),Y.instancedCount=0,me.drawCalls=3+(A?1:0);return}let ne=e.seats;for(let q=0;q<K;q++){let le=L[q];M[q*3]=ne.iPosition[le*3],M[q*3+1]=ne.iPosition[le*3+1],M[q*3+2]=ne.iPosition[le*3+2],H[q]=ne.iChairWidth[le],F[q]=ne.iYaw[le],z[q]=ne.iGlyph[le],B[q*3]=ne.iRing[le*3],B[q*3+1]=ne.iRing[le*3+1],B[q*3+2]=ne.iRing[le*3+2],U[q]=ne.iFloor[le],W[q]=ne.iSection[le],N[q]=ne.iPhysicalSeat[le],ee[q]=le+1}te(),Y.attributes.iOffset.needsUpdate=!0,Y.attributes.iRadius.needsUpdate=!0,Y.attributes.iYaw.needsUpdate=!0,Y.attributes.iGlyph.needsUpdate=!0,Y.attributes.iRing.needsUpdate=!0,Y.attributes.iFloor.needsUpdate=!0,Y.attributes.iSection.needsUpdate=!0,Y.attributes.iPhysicalSeat.needsUpdate=!0,Y.attributes.iSeed.needsUpdate=!0,Y.attributes.iPickIndex.needsUpdate=!0,Y.instancedCount=K,T.parent||T.setParent(n),me.drawCalls=4+(A?1:0)},nearSeatCount(){return C},setSectionShellLit(L){m.uniforms.uSectionFilter.value=L===null?0:1;let J=tr(e.sectionSolidRanges,e.solids.color,I,R,L,w);if(!J.length)return;let K=s.attributes.color,ne=K.buffer;if(!ne){K.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,ne);for(let q of J){let le=e.solids.color.subarray(q.start*3,(q.start+q.count)*3);t.bufferSubData(t.ARRAY_BUFFER,q.start*3*Float32Array.BYTES_PER_ELEMENT,le)}},uploadSeatStateRuns(L){if(!L.length)return;C&&te();for(let K of L)rr(c,e.seats.iState,K.start,K.length,h,u);let J=S.buffer;if(!J){S.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,J);for(let K of L){let ne=c.subarray(K.start*3,(K.start+K.length)*3);t.bufferSubData(t.ARRAY_BUFFER,K.start*3*Float32Array.BYTES_PER_ELEMENT,ne)}},dispose(){X=!0,l.dispose(),a.remove(),o.remove(),s.remove(),m.remove(),x.remove(),d.remove(),Y.remove(),g.remove(),Q?.remove(),ve?.remove(),se?.texture&&t.deleteTexture(se.texture)}},he=e.productionElements.find(L=>L.contentImageUrl&&L.contentPlane);if(he?.contentImageUrl&&he.contentPlane?.length===4&&typeof Image<"u"){let L=new Image;L.crossOrigin="anonymous",L.onload=()=>{if(X)return;let J=he.contentPlane;Q=new st(t,{position:{size:3,data:new Float32Array(J.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill(he.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),se=new Hi(t,{image:L,generateMipmaps:!0,wrapS:t.CLAMP_TO_EDGE,wrapT:t.CLAMP_TO_EDGE,flipY:!1}),ve=new Ni(t,{vertex:`#version 300 es
949
+ }`}),d=new ki,c=new Fi(t,{geometry:e,program:v});c.frustumCulled=!1,c.setParent(d);let h=t.getParameter(t.COLOR_CLEAR_VALUE),u=t.isEnabled(t.DITHER);try{t.disable(t.DITHER),t.clearColor(1,1,1,1),t.renderer.render({scene:d,camera:l,target:m})}finally{u&&t.enable(t.DITHER),t.clearColor(h[0],h[1],h[2],h[3]),v.remove()}let b=new Ii().multiply(l.projectionMatrix,l.viewMatrix);return{texture:m.depthTexture,matrix:b,dispose(){for(let p of m.textures)t.deleteTexture(p.texture);t.deleteTexture(m.depthTexture.texture),t.deleteFramebuffer(m.buffer),m.depthBuffer&&t.deleteRenderbuffer(m.depthBuffer)}}}var Li=.65,Oi=new Set(["dimmed","sold"]),zi=new Set(["dimmed","sold","held"]);function er(t,e,n){let r=new Set,a=!1,o=ye.indexOf("dimmed"),i=!1;for(let l=0;l<n.length;l+=1)if(n[l]===o){i=!0;break}let s=i?zi:Oi;for(let l of t){let m=e.get(l.sectionId);if(!m||!m.length){r.add(l.sectionId);continue}let v=!1;for(let d of m){let c=ye[n[d]]??"available";if(!s.has(c)){v=!0;break}}v?r.add(l.sectionId):a=!0}return{lit:r,anyUnlit:a}}function tr(t,e,n,r,a,o){let i=[];for(let s of t){let l=a===null||a.has(s.sectionId);if(r.get(s.sectionId)===l)continue;r.set(s.sectionId,l);let m=(s.start+s.count)*3;for(let v=s.start*3;v<m;v++)e[v]=l?n[v]:n[v]+(o[v%3]-n[v])*Li;i.push(s)}return i}var or=ye.indexOf("selected");function Gi(t,e){return[0,1,2].map(n=>t[n]*.15+.75+e[n]*.1)}function rr(t,e,n,r,a,o){for(let i=n;i<n+r;i++){let s=o&&e[i]===0,l=o&&e[i]===or?Gi([o[i*3],o[i*3+1],o[i*3+2]],a[or]??a[0]):s?null:a[e[i]]??a[0];t[i*3]=l?l[0]:o[i*3],t[i*3+1]=l?l[1]:o[i*3+1],t[i*3+2]=l?l[2]:o[i*3+2]}}var Bi=new Float32Array([-1,-1,3,-1,-1,3]);function ar(t,e){let n=new nr,r=new nr,a=new st(t,{position:{size:2,data:Bi}}),o=Qo(t,e.theme.background.top,e.theme.background.bottom,e.outdoor?e.theme.sky:null),i=new lt(t,{geometry:a,program:o});i.frustumCulled=!1,i.setParent(r);let s=new st(t,{position:{size:3,data:e.solids.position},normal:{size:3,data:e.solids.normal},color:{size:3,data:e.solids.color},floorIndex:{size:1,data:e.solids.floor},materialIndex:{size:1,data:e.solids.material}}),l=Jo(t,s,e.renderBounds),m=$o(t,e.theme.materials.roughness,e.theme.structure.tierTop);m.uniforms.tVenueShadow={value:l.texture},m.uniforms.uShadowMatrix={value:l.matrix},e.room&&m.uniforms.uRoomCentre.value.set(e.room.centre);let v=new lt(t,{geometry:s,program:m});v.frustumCulled=!1,v.setParent(n);let d=Ko(t),c=new Float32Array(e.seats.count*3),h=ye.map(L=>e.theme.seatStates[L]),u=e.seats.iCategory.slice();for(let L=0;L<e.seats.count;L++){if(e.seats.iPhysicalSeat[L]<.5)continue;let J=e.theme.materials.seat??$n([u[L*3],u[L*3+1],u[L*3+2]]);u.set(J,L*3)}rr(c,e.seats.iState,0,e.seats.count,h,u);let b=ho(),p=new Uint8Array(e.seats.count),x=new st(t,{position:{size:3,data:b.position},normal:{size:3,data:b.normal},uv:{size:2,data:b.uv},index:{size:1,data:b.index},surface:{size:1,data:b.surface},iYaw:{size:1,data:e.seats.iYaw,instanced:1},iChairWidth:{size:1,data:e.seats.iChairWidth,instanced:1},iGlyph:{size:1,data:e.seats.iGlyph,instanced:1},iOffset:{size:3,data:e.seats.iPosition,instanced:1},iColor:{size:3,data:c,instanced:1},iMaxRadius:{size:1,data:e.seats.iMaxRadius,instanced:1},iHasChair:{size:1,data:p,type:t.UNSIGNED_BYTE,usage:t.DYNAMIC_DRAW,instanced:1},iPhysicalSeat:{size:1,data:e.seats.iPhysicalSeat,instanced:1},iRing:{size:3,data:e.seats.iRing,instanced:1},iFloor:{size:1,data:e.seats.iFloor,instanced:1},iSection:{size:1,data:e.seats.iSection,instanced:1}}),P=new lt(t,{geometry:x,program:d});P.frustumCulled=!1,e.seats.count>0&&P.setParent(n);let S=x.attributes.iColor,I=e.solids.color.slice(),w=e.theme.structure.ground,R=new Map(e.sectionSolidRanges.map(L=>[L.sectionId,!0])),V=qn(),g=Zo(t,e.theme.materials.roughness),E=Mt,M=new Float32Array(E*3),D=new Float32Array(E*3),H=new Float32Array(E),F=new Float32Array(E),z=new Float32Array(E),B=new Float32Array(E*3),U=new Float32Array(E),W=new Float32Array(E),N=new Float32Array(E),ee=new Float32Array(E),Z=new Float32Array(E),Y=new st(t,{position:{size:3,data:V.position},normal:{size:3,data:V.normal},part:{size:1,data:V.part},index:{data:V.index},iOffset:{size:3,data:M,instanced:1},iColor:{size:3,data:D,instanced:1},iRadius:{size:1,data:H,instanced:1},iYaw:{size:1,data:F,instanced:1},iGlyph:{size:1,data:z,instanced:1},iRing:{size:3,data:B,instanced:1},iFloor:{size:1,data:U,instanced:1},iSection:{size:1,data:W,instanced:1},iPhysicalSeat:{size:1,data:N,instanced:1},iSeed:{size:1,data:Z,instanced:1},iPickIndex:{size:1,data:ee,instanced:1}}),T=new lt(t,{geometry:Y,program:g});T.frustumCulled=!1;let C=0,A=!1,X=!1,Q=null,ve=null,se=null,be=new Int32Array(0),te=()=>{let L=e.seats;for(let J=0;J<C;J++){let K=be[J];Z[J]=Kn(L.iState[K],K),D[J*3]=c[K*3],D[J*3+1]=c[K*3+1],D[J*3+2]=c[K*3+2]}Y.attributes.iColor.needsUpdate=!0,Y.attributes.iSeed.needsUpdate=!0},me={main:n,background:r,backgroundProgram:o,seatProgram:d,solidProgram:m,chairProgram:g,seatGeometry:x,chairGeometry:Y,solidGeometry:s,drawCalls:3,setNearSeats(L,J){let K=Math.min(J,E,L.length);if(Go(p,L,K),x.attributes.iHasChair.needsUpdate=!0,be=L,C=K,K===0){T.parent&&T.setParent(null),Y.instancedCount=0,me.drawCalls=3+(A?1:0);return}let ne=e.seats;for(let q=0;q<K;q++){let le=L[q];M[q*3]=ne.iPosition[le*3],M[q*3+1]=ne.iPosition[le*3+1],M[q*3+2]=ne.iPosition[le*3+2],H[q]=ne.iChairWidth[le],F[q]=ne.iYaw[le],z[q]=ne.iGlyph[le],B[q*3]=ne.iRing[le*3],B[q*3+1]=ne.iRing[le*3+1],B[q*3+2]=ne.iRing[le*3+2],U[q]=ne.iFloor[le],W[q]=ne.iSection[le],N[q]=ne.iPhysicalSeat[le],ee[q]=le+1}te(),Y.attributes.iOffset.needsUpdate=!0,Y.attributes.iRadius.needsUpdate=!0,Y.attributes.iYaw.needsUpdate=!0,Y.attributes.iGlyph.needsUpdate=!0,Y.attributes.iRing.needsUpdate=!0,Y.attributes.iFloor.needsUpdate=!0,Y.attributes.iSection.needsUpdate=!0,Y.attributes.iPhysicalSeat.needsUpdate=!0,Y.attributes.iSeed.needsUpdate=!0,Y.attributes.iPickIndex.needsUpdate=!0,Y.instancedCount=K,T.parent||T.setParent(n),me.drawCalls=4+(A?1:0)},nearSeatCount(){return C},setSectionShellLit(L){m.uniforms.uSectionFilter.value=L===null?0:1;let J=tr(e.sectionSolidRanges,e.solids.color,I,R,L,w);if(!J.length)return;let K=s.attributes.color,ne=K.buffer;if(!ne){K.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,ne);for(let q of J){let le=e.solids.color.subarray(q.start*3,(q.start+q.count)*3);t.bufferSubData(t.ARRAY_BUFFER,q.start*3*Float32Array.BYTES_PER_ELEMENT,le)}},uploadSeatStateRuns(L){if(!L.length)return;C&&te();for(let K of L)rr(c,e.seats.iState,K.start,K.length,h,u);let J=S.buffer;if(!J){S.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,J);for(let K of L){let ne=c.subarray(K.start*3,(K.start+K.length)*3);t.bufferSubData(t.ARRAY_BUFFER,K.start*3*Float32Array.BYTES_PER_ELEMENT,ne)}},dispose(){X=!0,l.dispose(),a.remove(),o.remove(),s.remove(),m.remove(),x.remove(),d.remove(),Y.remove(),g.remove(),Q?.remove(),ve?.remove(),se?.texture&&t.deleteTexture(se.texture)}},he=e.productionElements.find(L=>L.contentImageUrl&&L.contentPlane);if(he?.contentImageUrl&&he.contentPlane?.length===4&&typeof Image<"u"){let L=new Image;L.crossOrigin="anonymous",L.onload=()=>{if(X)return;let J=he.contentPlane;Q=new st(t,{position:{size:3,data:new Float32Array(J.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill(he.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),se=new Hi(t,{image:L,generateMipmaps:!0,wrapS:t.CLAMP_TO_EDGE,wrapT:t.CLAMP_TO_EDGE,flipY:!1}),ve=new Ni(t,{vertex:`#version 300 es
950
950
  precision highp float;
951
951
  in vec3 position; in vec2 uv; in float floorIndex;
952
952
  uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform float uFocusFloor;
@@ -954,4 +954,4 @@ void main() {
954
954
  void main(){ vUv=uv; vDim=(uFocusFloor < -0.5 || abs(floorIndex-uFocusFloor)<0.5)?0.0:1.0; gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.0); }`,fragment:`#version 300 es
955
955
  precision highp float;
956
956
  in vec2 vUv; in float vDim; uniform sampler2D uImage; out vec4 fragColor;
957
- void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:se},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let K=new lt(t,{geometry:Q,program:ve});K.frustumCulled=!1,K.setParent(n),me.screenProgram=ve,A=!0,me.drawCalls=3+(C?1:0)+1},L.src=he.contentImageUrl}return me}import{Mesh as dn,RenderTarget as Ui,Transform as mn}from"ogl";function Wi(t,e,n){let r=t+(e<<8)+(n<<16);return r===0?-1:r-1}function ir(t,e,n,r,a,o){let i=-1,s=1/0;for(let l=0;l<n;l++)for(let m=0;m<e;m++){let v=(l*e+m)*4,d=Wi(t[v],t[v+1],t[v+2]);if(d<0||d>=o)continue;let c=m-r,h=l-a,u=c*c+h*h;u<s&&(s=u,i=d)}return i}function sr(t,e,n,r,a,o){let i=t-n.left,s=e-n.top,l=Math.round(i*r),m=Math.round((n.height-s)*r);return{x:Math.max(0,Math.min(a-1,l)),y:Math.max(0,Math.min(o-1,m))}}var Yi=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],Ct=class{constructor(e,n,r,a,o){this.seatScene=new mn;this.chairScene=new mn;this.solidScene=new mn;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=o,this.seatProg=Xo(this.gl),this.chairProg=qo(this.gl),this.depthProg=jo(this.gl);let i=new dn(this.gl,{geometry:n,program:this.seatProg});i.frustumCulled=!1,i.setParent(this.seatScene);let s=new dn(this.gl,{geometry:r,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let l=new dn(this.gl,{geometry:a,program:this.depthProg});l.frustumCulled=!1,l.setParent(this.solidScene)}setRoomCentre(e){this.depthProg.uniforms.uRoomCentre.value.set(e??[0,0])}setRestoreClear(e){this.restoreClear=[e[0],e[1],e[2]]}syncFromSeatProgram(e){for(let a of Yi)this.seatProg.uniforms[a].value=e.uniforms[a].value;let n=e.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=n,this.chairProg.uniforms.uFocusFloor.value=n,this.depthProg.uniforms.uFocusFloor.value=n;let r=e.uniforms.uSeeThrough?.value;if(r)for(let a of[this.seatProg,this.chairProg,this.depthProg])a.uniforms.uSeeThrough.value=r}ensureTarget(){let e=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==e||this.target.height!==n)&&this.destroyTarget(),this.target||(this.target=new Ui(this.gl,{width:e,height:n,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let e=this.gl;this.target.buffer&&e.deleteFramebuffer(this.target.buffer);for(let n of this.target.textures??[])n.texture&&e.deleteTexture(n.texture);this.target.depthBuffer&&e.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(e,n,r,a){let o=this.gl,i=this.ensureTarget(),s=o.drawingBufferWidth,l=o.drawingBufferHeight,m=Math.max(0,n-a),v=Math.max(0,r-a),d=Math.max(1,Math.min(s,n+a+1)-m),c=Math.max(1,Math.min(l,r+a+1)-v);o.enable(o.SCISSOR_TEST),o.scissor(m,v,d,c);let[h,u,b]=this.restoreClear;o.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:e,target:i,clear:!0}),this.renderer.render({scene:this.seatScene,camera:e,target:i,clear:!1}),this.renderer.render({scene:this.chairScene,camera:e,target:i,clear:!1}),o.clearColor(h,u,b,1),o.disable(o.SCISSOR_TEST);let p=new Uint8Array(d*c*4);return this.renderer.bindFramebuffer(i),o.readPixels(m,v,d,c,o.RGBA,o.UNSIGNED_BYTE,p),this.renderer.bindFramebuffer(),ir(p,d,c,n-m,r-v,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function lr(t,e){let n=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,qn(r.state)):n.push(r);return n}function cr(t,e,n){let r=new Set;for(let i of e)(t.has(i)||n(i)!==void 0)&&r.add(i);let a=new Map(t),o=[];for(let[i,s]of t)r.has(i)||(o.push({seatId:i,state:ye[s]??"available"}),a.delete(i));for(let i of r){if(a.has(i))continue;let s=n(i);s!==void 0&&(a.set(i,s),o.push({seatId:i,state:"selected"}))}return{updates:o,next:a}}import{Quat as ct,Vec3 as ji}from"ogl";function Xi(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function ur(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function qi(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function dr(t){let e=Math.hypot(t[0],t[1],t[2]);return e>1e-6?[t[0]/e,t[1]/e,t[2]/e]:[0,0,0]}function hn(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function pn(t,e){return Math.max(0,Math.min(1,t+e))}function mr(t,e){let n=t.length;if(n===0)return[0,0,0];if(n===1)return[...t[0]];let r=Math.max(0,Math.min(1,e)),a=n-1,o=Math.floor(r*a);o>=a&&(o=a-1);let i=r*a-o,s=t[Math.max(0,o-1)],l=t[o],m=t[o+1],v=t[Math.min(n-1,o+2)],d=i*i,c=d*i,h=[0,0,0];for(let u=0;u<3;u++)h[u]=.5*(2*l[u]+(-s[u]+m[u])*i+(2*s[u]-5*l[u]+4*m[u]-v[u])*d+(-s[u]+3*l[u]-3*m[u]+v[u])*c);return h}function fn(t,e,n,r,a){let o=dr(Xi(e,n));o[0]===0&&o[1]===0&&o[2]===0&&(o=[0,0,1]);let i=ur(ur(e,qi(o,2.5)),[0,1.5,0]),s=[e[0]-r[0],0,e[2]-r[2]],l=dr(s);l[0]===0&&l[2]===0&&(l=[o[0],0,o[2]]);let m=Math.max(1,a),v=[r[0]+l[0]*m*1.3,r[1]+m*.75,r[2]+l[2]*m*1.3];return{waypoints:[t,v,i],finalPos:i}}function vn(t,e,n=35,r=28){let a=hn(e),o=mr(t,a),i=hn(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:o,fov:n+(r-n)*i,eased:a}}function vr(t,e,n){let r=t.position.clone(),a=new ct().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new ji(n[0],n[1],n[2]));let o=new ct().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(a),o}var Et=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new ct;this.endQuat=new ct;this.outQuat=new ct;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=e}start(e,n,r,a=2500,o=28){return this.settle(),this.waypoints=e,this.startQuat.copy(n),this.endQuat.copy(r),this.duration=a,this.endFov=o,this.startTime=performance.now(),this.active=!0,new Promise(i=>{this.resolveFn=i})}update(e){if(!this.active)return!1;let n=Math.min(1,(e-this.startTime)/this.duration),{pos:r,fov:a,eased:o}=vn(this.waypoints,n,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,pn(o,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=a,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let e=this.resolveFn;this.resolveFn=null,e&&e()}};var br=Yn,$i=.12,Ki=1.6,gr=.12;function yr(t,e,n){let r=t[e*3],a=t[e*3+1],o=t[e*3+2],i=n[0]-r,s=n[2]-o,l=Math.hypot(i,s);if(!(l>.001))return null;let m=i/l,v=s/l,d=1/0,c=null;for(let h=0;h*3<t.length;h++){if(h===e)continue;let u=t[h*3]-r,b=t[h*3+2]-o,p=u*m+b*v;p<.3||p>1.6||Math.abs(u*v-b*m)>.6||p<d&&(d=p,c=a-t[h*3+1])}return c}var Zi=.25,Qi=1.5;function xr(t,e,n=0,r,a,o=!1){let i=[e.x*Le,n+Qi,e.y*Le],s=a?[a[0],a[1],a[2]]:i,l=t[1],m=Number.isFinite(l)?l+(o?Ki:br):Number.isFinite(r)?n+r:n+br,v=i[0]-t[0],d=i[2]-t[2],c=Math.hypot(v,d),h=c>.001?Math.min($i,c*Zi):0,u=c>.001?v/c:0,b=c>.001?d/c:0;return{eye:[t[0]+u*h,m,t[2]+b*h],focal:s}}var Ce=Math.PI/180,Ji=45,bn=80,Rt=70,es=1,ts=.99;function ns(t,e){if(!(t<es))return bn;if(!(Number.isFinite(e)&&e>0))return Rt;let n=2*Math.atan(e/(2*Tt*ts)/Math.max(.05,t))/Ce;return Math.max(Rt,Math.min(bn,n))}var os=.25,Tt=1,rs=.25,as=12*Ce,is=.2,ss=1.5,Sr=.8,wr=6,Rr=1.9,ls=2/3,cs=.12,us=.9,ds=1.2,ms=2,Tr=.05,hs=6;function _r(t,e,n=0){if(!t.length)return{min:[e[0]-6,n,e[2]-6],max:[e[0]+6,Math.max(n+Sr,e[1]),e[2]+6]};let r=1/0,a=-1/0,o=1/0,i=-1/0,s=n;for(let u of t)r=Math.min(r,u.cx-u.halfX),a=Math.max(a,u.cx+u.halfX),o=Math.min(o,u.cz-u.halfZ),i=Math.max(i,u.cz+u.halfZ),s=Math.max(s,u.y);let l=a-r,m=i-o,v=Math.max(l,Math.min(m,wr))/2,d=Math.max(m,Math.min(l,wr))/2,c=(r+a)/2,h=(o+i)/2;return{min:[c-v,n,h-d],max:[c+v,Math.max(n+Sr,s),h+d]}}function ps(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+Rr,t.max[2]]}}function gn(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+ss,e+is,e+Rr*ls),(t.min[2]+t.max[2])/2]}function Ir(t,e){let n=t[0]-e[0],r=t[2]-e[2],a=Math.hypot(n,r);return a<.001?{x:0,z:1}:{x:n/a,z:r/a}}function Mr(t,e,n){let r=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],i=Math.hypot(r,a,o)||1;r/=i,a/=i,o/=i;let s=-o,l=r,m=Math.hypot(s,l);if(m<1e-6)return 1/0;s/=m,l/=m;let v=1/0,d=-1/0;for(let c=0;c<8;c++){let h=(c&1?n.max[0]:n.min[0])-t[0],u=(c&2?n.max[1]:n.min[1])-t[1],b=(c&4?n.max[2]:n.min[2])-t[2],p=Math.max(Tr,h*r+u*a+b*o),x=(h*s+b*l)/p;x<v&&(v=x),x>d&&(d=x)}return d-v}function Pr(t,e,n){let r=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],i=Math.hypot(r,a,o)||1;r/=i,a/=i,o/=i;let s=-o,l=r,m=Math.hypot(s,l);if(m<1e-6)return 1/0;s/=m,l/=m;let v=-l*a,d=l*r-s*o,c=s*a,h=1/0,u=-1/0;for(let b=0;b<8;b++){let p=(b&1?n.max[0]:n.min[0])-t[0],x=(b&2?n.max[1]:n.min[1])-t[1],P=(b&4?n.max[2]:n.min[2])-t[2],S=Math.max(Tr,p*r+x*a+P*o),I=(p*v+x*d+P*c)/S;I<h&&(h=I),I>u&&(u=I)}return u-h}function _t(t,e){return Math.tan(t*Ce/2)*Math.max(.05,e)}function Ar(t,e,n){let r=ns(n,t),a=l=>Math.max(Ji,Math.min(r,l)),o=l=>2*Math.atan(l)/Ce,i=Number.isFinite(t)&&t>0?a(o(t/(2*os)/Math.max(.05,n))):r;if(!(Number.isFinite(e)&&e>0))return i;let s=Math.min(i,a(o(e/(2*cs))));return t/(2*_t(s,n))>Tt?i:s}function Fr(t,e,n,r={}){let a=gn(e),o=[t[0],t[1],t[2]],i=0,s=0,l=u=>{if(!(u>0))return;let b=Ir(o,a);o[0]+=b.x*u,o[2]+=b.z*u,s+=u},m=r.preserveEye?0:e.max[1]+rs-o[1];m>0&&(o[1]+=m,i=m,l(m/Math.tan(as)));let v=ps(e),d=Mr(o,a,e),c=Ar(d,Pr(o,a,v),n),h=d/(2*_t(c,n));for(let u=0;!r.preserveEye&&u<hs&&h>Tt;u++){let b=Math.max(1,Math.hypot(o[0]-a[0],o[2]-a[2])),p=Number.isFinite(h)?h/Tt:2;l(Math.min(60,b*(Math.min(4,p)-1)+.5)),d=Mr(o,a,e),c=Ar(d,Pr(o,a,v),n),h=d/(2*_t(c,n))}return{eye:o,focal:a,fov:c,raisedM:i,pulledBackM:s,stageFrameWidth:h}}function fs(t,e,n){let r=Math.tan(e*Ce/2),a=_t(e,n);return Math.max(1,t/Math.max(.05,Math.min(r,a)))}var vs=.7,Cr=.5,bs=.8;function Er(t,e,n){let r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],a=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],o=r[0]*a[0]+r[1]*a[1]+r[2]*a[2],i=Math.hypot(r[0],r[1],r[2])*Math.hypot(a[0],a[1],a[2])||1;return Math.acos(Math.max(-1,Math.min(1,o/i)))/Ce}function gs(t,e,n){let r=m=>{let v=Math.hypot(m[0],m[1],m[2])||1;return[m[0]/v,m[1]/v,m[2]/v]},a=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],o=Math.hypot(a[0],a[1],a[2]),i=r(a),s=r([n[0]-t[0],n[1]-t[1],n[2]-t[2]]),l=r([0,1,2].map(m=>i[m]*(1-Cr)+s[m]*Cr));return[t[0]+l[0]*o,t[1]+l[1]*o,t[2]+l[2]*o]}function Dr(t,e){let{aspect:n,venue:r}=e,a=t.focal,o=Ir(t.eye,a),i=b=>(b[0]-a[0])*o.x+(b[2]-a[2])*o.z,s=[{name:"seat",eye:t.eye,focal:a,fov:t.fov}],l=ms*(e.rowDepthM??us),m=[t.eye[0]+o.x*l,t.eye[1]+ds,t.eye[2]+o.z*l],v=[t.eye[0],t.eye[1]-vs,t.eye[2]],d=gs(m,a,v);s.push({name:"row",eye:m,focal:d,fov:Math.min(bn,Math.max(t.fov,2*Math.max(Er(m,d,v),Er(m,d,a))/bs))});let c=(b,p,x,P)=>{let S=fs(x,t.fov,n)*1.08,I=S*Math.sin(P*Ce),w=Number.isFinite(e.seatingTopY)?e.seatingTopY+2:-1/0,R=Math.max(I,w-p[1]),V=S*Math.cos(P*Ce);return{name:b,eye:[p[0]+o.x*V,p[1]+R,p[2]+o.z*V],focal:p,fov:t.fov}};e.section&&e.section.radius>0&&s.push(c("section",e.section.center,e.section.radius,35)),s.push(c("venue",r.center,Math.max(1,r.radius),40));let h=[],u=-1/0;for(let b of s){let p=i(b.eye);h.length&&p<=u+.5||(h.push(b),u=p)}return h}import{Vec3 as ys}from"ogl";var dt=Math.PI/180,yn=320,Vr=70*dt,xs=32*dt,Ss=24*dt,kr=.0026,ws=.22,Ms=.006,Ps=180,As=900,Cs=1100,Es=4,fe=(t,e,n)=>Math.max(e,Math.min(n,t)),Lr=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function Or(t){let{canvas:e,camera:n}=t,r=[],a=!1,o=0,i=0,s=0,l=0,m=0,v=0,d=yn,c=null,h=()=>{c&&(clearTimeout(c),c=null)},u=!1,b=[0,0],p=0,x=!1,P=null,S=null,I=new Map,w=!1,R=0,V=0,g=0,E=0,M=()=>a&&r.length?r[fe(Math.round(o),0,r.length-1)].name:null,D=()=>{let T=M();T!==P&&(P=T,t.onStopChange?.(T))},H=()=>{if(!a||!r.length)return;let T=r[fe(Math.floor(o),0,r.length-1)],C=r[fe(Math.ceil(o),0,r.length-1)],A=fe(o-Math.floor(o),0,1),X=(q,le)=>q+(le-q)*A,Q=[X(T.eye[0],C.eye[0]),X(T.eye[1],C.eye[1]),X(T.eye[2],C.eye[2])],ve=[X(T.focal[0],C.focal[0]),X(T.focal[1],C.focal[1]),X(T.focal[2],C.focal[2])],se=ve[0]-Q[0],be=ve[1]-Q[1],te=ve[2]-Q[2],me=Math.hypot(se,be,te)||1,he=Math.atan2(se,te),L=Math.asin(fe(be/me,-1,1)),J=he+i,K=fe(L+s,-80*dt,80*dt),ne=Math.cos(K)*me;se=Math.sin(J)*ne,be=Math.sin(K)*me,te=Math.cos(J)*ne,n.position.set(Q[0],Q[1],Q[2]),n.fov=X(T.fov,C.fov),n.updateProjectionMatrix(),n.lookAt(new ys(Q[0]+se,Q[1]+be,Q[2]+te)),t.onApplied?.()},F=()=>{if(!a||!r.length)return;let T=fe(Math.round(o),0,r.length-1);if(t.reducedMotion()){u=!1,o=T,H(),D(),t.requestRender();return}if(Math.abs(T-o)<.001){u=!1,D();return}l=o,m=T,v=performance.now(),d=yn,u=!0,t.requestRender()},z=T=>{!a||r.length<2||(h(),u=!1,o=fe(o+T,0,r.length-1),H(),D(),t.requestRender())},B=(T,C)=>{a&&(h(),u=!1,x=!1,i=fe(i-T*kr,-Vr,Vr),s=fe(s-C*kr,-Ss,xs),H(),t.requestRender())},U=T=>{a&&(I.set(T.pointerId,{x:T.clientX,y:T.clientY}),I.size===1?(w=!0,E=0,R=T.clientX,V=T.clientY):I.size===2&&(w=!1,g=W()))},W=()=>{let T=[...I.values()];return T.length<2?0:Math.hypot(T[0].x-T[1].x,T[0].y-T[1].y)},N=T=>{if(!a||!I.has(T.pointerId))return;if(I.set(T.pointerId,{x:T.clientX,y:T.clientY}),I.size>=2){let X=W();g>0&&z((g-X)*Ms),g=X;return}if(!w)return;let C=T.clientX-R,A=T.clientY-V;R=T.clientX,V=T.clientY,E+=Math.abs(C)+Math.abs(A),!(E<=Es)&&B(C,A)},ee=T=>{I.delete(T.pointerId)&&(I.size<2&&(g=0),I.size===0&&(w=!1,F()))},Z=T=>{if(!a)return;T.preventDefault();let C=T.deltaMode===1?16:T.deltaMode===2?100:1,A=fe(T.deltaY*C/100,-2,2);z(A*ws),S&&clearTimeout(S),S=setTimeout(()=>{S=null,F()},Ps)},Y=()=>{h(),a&&(a=!1,u=!1,x=!1,r=[],I.clear(),w=!1,S&&(clearTimeout(S),S=null),P!==null&&(P=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",U),e.addEventListener("pointermove",N),e.addEventListener("pointerup",ee),e.addEventListener("pointercancel",ee),e.addEventListener("wheel",Z,{passive:!1}),{get active(){return a},enter(T,C=0){if(T.length<2){Y();return}h(),r=T,a=!0,o=t.reducedMotion()?0:fe(C,0,T.length-1),o>0&&(c=setTimeout(()=>{c=null,a&&(l=o,m=0,v=performance.now(),d=Cs,u=!0,t.requestRender())},As)),i=0,s=0,u=!1,x=!1,P=null,H(),D(),t.requestRender()},exit:Y,recentre(){return a?Math.abs(i)<1e-4&&Math.abs(s)<1e-4?!0:t.reducedMotion()?(x=!1,i=0,s=0,H(),t.requestRender(),!0):(b=[i,s],p=performance.now(),x=!0,t.requestRender(),!0):!1},update(T){if(!a)return!1;let C=!1;if(x){let A=fe((T-p)/yn,0,1),X=1-Lr(A);i=b[0]*X,s=b[1]*X,A>=1?(x=!1,i=0,s=0):C=!0}if(u){let A=fe((T-v)/d,0,1);o=l+(m-l)*Lr(A),A>=1?(u=!1,o=m,D()):C=!0}return H(),C},currentStop:M,dispose(){Y(),e.removeEventListener("pointerdown",U),e.removeEventListener("pointermove",N),e.removeEventListener("pointerup",ee),e.removeEventListener("pointercancel",ee),e.removeEventListener("wheel",Z)}}}function zr(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var xn=null;function Nr(){return xn??=import("../openPanorama-VD6PE3YZ.js").catch(t=>{throw xn=null,t}),xn}var Hr=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),It=class{constructor(e){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=e}emit(e,n){if(this.cb)try{this.cb(e,n)}catch{}}opened(e,n,r,a){this.emit("3d_opened",{seats:e,hasHeights:n,...r===void 0?{}:{buildMs:Math.round(r)},...a===void 0?{}:{prepSource:a}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(e,n){this.emit("3d_seat_picked",{seatId:e,sectionId:n})}cinematicPlayed(e){this.emit("3d_cinematic_played",{durationMs:e,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=Hr(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(Hr()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:e})}panoramaFailed(e,n){this.emit("3d_panorama_failed",{seatId:e,phase:n})}panoramaFallback(e){this.emit("3d_panorama_fallback",{seatId:e})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function Gr(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function Br(t){let{container:e,model:n,opts:r,expandedSeatById:a,seatIdsByRow:o,isNarrow:i}=t,s=null,l=()=>{if(!s)return;let d=i();Object.assign(s.style,d?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},m=()=>{s?.remove(),s=null};return{show:(d,c,h=!1)=>{if(m(),t.isDisposed())return null;let u=document.createElement("div");u.setAttribute("role","group"),Object.assign(u.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let b=r.chrome?.caption!==!1,p=r.chrome?.seatStepper!==!1;if(!b&&!p)return null;let x=a.get(d),P=x?.sectionId?n.sections.find(M=>M.id===x.sectionId):void 0,S=x?.label??d;u.setAttribute("aria-label",`Explore views near ${P?.label?`${P.label}, `:""}seat ${S}`);let I=document.createElement("span");I.textContent=r.seatViewCaption?.(d)??["Live 3D seat view",P?.label,S].filter(Boolean).join(" \xB7 "),Object.assign(I.style,{maxWidth:"min(70vw, 560px)",padding:"5px 10px",borderRadius:"999px",overflow:"hidden",color:"#d9e3f5",background:"rgba(12,18,32,0.72)",font:"600 11px/1.2 inherit",textOverflow:"ellipsis",whiteSpace:"nowrap",backdropFilter:"blur(6px)"}),b&&u.appendChild(I);let w=document.createElement("div");Object.assign(w.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),u.appendChild(w);let R=x?.rowId?o.get(x.rowId):void 0,V=R?.indexOf(d)??-1,g=V>=0?[R?.[V-1],R?.[V+1]]:[void 0,void 0],E=(M,D,H,F=!1)=>{let z=document.createElement("button");z.type="button",z.textContent=M,z.setAttribute("aria-label",D),Object.assign(z.style,{minHeight:"44px",padding:F?"10px 16px":"10px",borderRadius:"999px",background:"rgba(12,18,32,0.78)",color:"#eef1f8",border:"1px solid rgba(150,165,205,0.4)",backdropFilter:"blur(6px)",font:"600 13px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"}),F||(z.style.minWidth="44px"),F&&(z.dataset.panoramaTrigger=""),z.addEventListener("click",H),w.appendChild(z)};if(p&&g[0]){let M=a.get(g[0])?.label??g[0];E("\u2039",`View previous seat ${M}`,()=>{t.flyToSeat(g[0])})}if(p&&r.getSeatView){let M=r.seatViewActionLabel?.(d)??"Open 360\xB0 panorama";E(h?`\u21BB Retry ${M}`:`\u25C9 ${M}`,`${h?"Retry":M} from seat ${S}`,()=>{if(t.isDisposed()||c!==t.flightGen()){m();return}m(),t.openPanorama(d,400,c)},!0)}if(p&&g[1]){let M=a.get(g[1])?.label??g[1];E("\u203A",`View next seat ${M}`,()=>{t.flyToSeat(g[1])})}return!w.childElementCount&&!b?null:(e.appendChild(u),s=u,l(),u)},remove:m,layout:l}}var Rs={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function Wr(t){let{container:e,orbit:n,isNarrow:r}=t,a={...Rs,...t.labels??{}},o=(w,R)=>{w.setAttribute("aria-label",R),w.title=R},i=document.createElement("div"),s=!1;i.className="sl-3d-navigation-controls",Object.assign(i.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D drag mode"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let m=document.createElement("div");m.setAttribute("role","group"),m.setAttribute("aria-label","3D view controls"),Object.assign(m.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let v=document.createElement("button");v.type="button",v.textContent="\u21BB",o(v,a.rotate);let d=document.createElement("button");d.type="button",d.textContent="\u2725",o(d,a.move);let c=document.createElement("button");c.type="button",c.textContent="\u2212",o(c,a.zoomOut);let h=document.createElement("button");h.type="button",h.textContent="+",o(h,a.zoomIn);for(let w of[v,d,c,h])w.className="sl-3d-icon-control",Object.assign(w.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",border:"1px solid rgba(150,165,205,0.35)",borderRadius:"999px",color:"#c9d4ea",background:"rgba(12,18,32,0.82)",font:"600 17px/1 inherit",backdropFilter:"blur(6px)",cursor:"pointer",whiteSpace:"nowrap"});l.append(v,d),m.append(h,c);let u=null,b=()=>{let w=n.dragAction();if(w===u)return;u=w;let R=w==="orbit";v.setAttribute("aria-pressed",String(R)),d.setAttribute("aria-pressed",String(!R)),v.style.background=R?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",d.style.background=R?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",i.title=R?`${a.rotate} \xB7 ${a.move} with Shift`:`${a.move} \xB7 ${a.rotate} with Shift`},p=w=>{n.setPrimaryDragMode(w),b()};v.addEventListener("click",()=>p("orbit")),d.addEventListener("click",()=>p("pan"));let x=()=>{let{atMin:w,atMax:R}=n.dollyLimitState();h.disabled!==w&&(h.disabled=w),c.disabled!==R&&(c.disabled=R)};c.addEventListener("click",()=>{n.zoomBy(nt),x()}),h.addEventListener("click",()=>{n.zoomBy(ze),x()}),i.append(l,m),p("auto"),e.appendChild(i);let P=t.enabled!==!1,S=()=>{let w=r();i.style.display=s||!P?"none":"flex",i.style.right=w?"12px":"14px",i.style.bottom=w?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",l.style.display=w?"none":"flex",h.style.display=w?"none":"",c.style.display=w?"none":""};return S(),{element:i,utilityControls:m,setNavigationMode:p,syncNavigationMode:b,syncZoomLimits:x,setSeatViewLocked:w=>{s=w,n.setInteractionEnabled(!w),S()},seatViewLocked:()=>s,layout:S}}var Ts=.5,Ur=12,Yr=20,_s=28;function Is(t,e,n){return!(t>0)||!(n>0)?0:Ts*n/(2*t*Math.tan(e*Math.PI/360))}function Xr(t){let{glctx:e,orbit:n,model:r,seats:a,opts:o,cinematic:i,analytics:s,seatIdByIndex:l,sectionIdBySeatId:m,tapSlop:v,tapMs:d,cancelFlight:c,focusSectionCamera:h,setSelection:u,ensureSeatView:b}=t,p=0,x=0,P=0,S=-1,I=!1,w=!1,R=F=>{t.seatViewLocked()||S===-1&&(S=F.pointerId,p=F.clientX,x=F.clientY,P=performance.now(),I=!1,w=i.active,i.active&&(s.cinematicCancelled(),c(),o.onViewTargetChange?.(null)))},V=F=>{F.pointerId===S&&Math.hypot(F.clientX-p,F.clientY-x)>v&&(I=!0)},g=(F,z,B,U,W)=>{let N=e.canvas.getBoundingClientRect(),ee=e.canvas.clientWidth||N.width||1,Z=e.canvas.clientHeight||N.height||1,Y=F-N.left,T=z-N.top,C=U*U,A=-1,X=C,Q=1/0;for(let ve of a){if(B&&ve.sectionId!==B)continue;let se=r.seats.idToIndex.get(ve.id);if(se===void 0)continue;if(W){let J=Math.round(r.seats.iState[se]??0);if(J!==0&&J!==3)continue}let be=se*3,te=Me(n.camera.projectionViewMatrix,[r.seats.iPosition[be],r.seats.iPosition[be+1]+.55,r.seats.iPosition[be+2]],ee,Z);if(!te.visible)continue;let me=te.x-Y,he=te.y-T,L=me*me+he*he;(L<X||Math.abs(L-X)<1&&te.depth<Q)&&(A=se,X=L,Q=te.depth)}return A},E=(F,z)=>{let B=t.gpu(),U=t.pick();if(!B||!U)return-1;U.syncFromSeatProgram(B.seatProgram);let W=e.canvas.getBoundingClientRect(),N=e.renderer.dpr,{x:ee,y:Z}=sr(F,z,W,N,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),Y=Math.max(2,Math.round(8*N));return U.pick(n.camera,ee,Z,Y)},M=()=>e.canvas.clientHeight||e.canvas.getBoundingClientRect().height,D=(F,z=Ur)=>{let B=n.camera?.position;if(!B)return!1;let U=F*3,W=Math.hypot(B.x-r.seats.iPosition[U],B.y-r.seats.iPosition[U+1],B.z-r.seats.iPosition[U+2]);return Is(W,n.fovY,M())>=z};return{onDown:R,onMove:V,onUp:F=>{if(F.pointerId!==S)return;let z=!I&&performance.now()-P<d;if(S=-1,w){w=!1;return}let B=t.gpu(),U=t.pick();if(!z||!B||!U)return;let W=E(F.clientX,F.clientY),N=F.pointerType==="touch"||F.pointerType==="pen",ee=N?Yr:Ur,Z=W>=0&&D(W,ee),Y=!1;if(t.focusedSectionId()&&W>=0){let A=l[W],X=A?m.get(A):void 0;if(X&&X!==t.focusedSectionId()&&h(X,{keepCamera:Z})){if(!Z)return;Y=!0}}if(t.focusedSectionId()&&W<0&&(W=g(F.clientX,F.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&W<0){let A=g(F.clientX,F.clientY,null,72,!1),X=A>=0?l[A]:void 0,Q=X?m.get(X):void 0;if(Q&&Q!==t.focusedSectionId()&&h(Q))return}if(!t.focusedSectionId()){W<0&&(W=g(F.clientX,F.clientY,null,42,!1));let A=W>=0?l[W]:void 0,X=A?m.get(A):void 0;if(X&&h(X,{keepCamera:Z})){if(!Z)return;Y=!0}}if(W<0||W>=l.length){t.selection().size&&(u([]),o.onViewTargetChange?.(null));return}let T=l[W];if(N&&t.focusedSectionId()&&!Y&&!D(W,Yr)){t.focusSeatCamera(T,{seatPx:_s,viewportHeightPx:M()});return}let C=ye[Math.round(r.seats.iState[W]??0)]??"available";if(C!=="available"&&C!=="selected"){o.onSeatInspect?.(T,C);return}if(t.selection().has(T)&&t.selection().size===1){u([]),o.onViewTargetChange?.(null),o.onSeatPick?.(T);return}u([T]),b(T),s.seatPicked(T,m.get(T)),o.onSeatPick?.(T)}}}var Ft=class{constructor(e,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=e,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let e=this.iPosition,n=1/0,r=1/0,a=-1/0,o=-1/0;for(let h=0;h<this.count;h++){let u=e[h*3],b=e[h*3+2];u<n&&(n=u),u>a&&(a=u),b<r&&(r=b),b>o&&(o=b)}let i=Math.max(a-n,.001),s=Math.max(o-r,.001);this.cell=Math.max(Math.sqrt(i*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(i/this.cell)+1),this.rows=Math.max(1,Math.ceil(s/this.cell)+1),this.minX=n,this.minZ=r;let l=this.cols*this.rows,m=new Int32Array(l+1),v=h=>{let u=Math.min(this.cols-1,Math.max(0,Math.floor((e[h*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[h*3+2]-r)/this.cell)))*this.cols+u};for(let h=0;h<this.count;h++)m[v(h)+1]++;for(let h=0;h<l;h++)m[h+1]+=m[h];let d=new Int32Array(this.count),c=m.slice(0,l);for(let h=0;h<this.count;h++)d[c[v(h)]++]=h;this.cellStart=m,this.cellItems=d}gather(e,n,r,a,o){this.ensureGrid();let i=this.cellStart,s=this.cellItems;if(!i||!s)return 0;let l=a.length,m=r*r,v=Math.floor((e-this.minX)/this.cell),d=Math.floor((n-this.minZ)/this.cell),c=Math.ceil(r/this.cell)+1,h=this.iPosition,u=0;for(let b=0;b<=c&&u<l;b++){let p=d-b,x=d+b,P=v-b,S=v+b;for(let I=p;I<=x&&u<l;I++){if(I<0||I>=this.rows)continue;let w=I===p||I===x;for(let R=P;R<=S&&u<l;R++){if(!w&&R!==P&&R!==S){R=S-1;continue}if(R<0||R>=this.cols)continue;let V=I*this.cols+R;for(let g=i[V],E=i[V+1];g<E&&u<l;g++){let M=s[g],D=h[M*3]-e,H=h[M*3+2]-n,F=o===void 0?0:h[M*3+1]-o;D*D+F*F+H*H<=m&&(a[u++]=M)}}}}return u}};var Dt=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Mt);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Ft(e.model.seats.iPosition,e.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(e){let n=this.ctx.gpu();e||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!e&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(e){let{model:n}=this.ctx,r=this.ctx.gpu();if(!r)return;if(!e){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let a=this.ctx.orbit().camera.position;if(Math.hypot(a.x-this.lastGatherX,a.y-this.lastGatherY,a.z-this.lastGatherZ)<on)return;if(this.lastGatherX=a.x,this.lastGatherY=a.y,this.lastGatherZ=a.z,Math.hypot(a.x-n.bounds.center[0],a.y-n.bounds.center[1],a.z-n.bounds.center[2])-n.bounds.radius>nn){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(a.x,a.z,nn,this.nearBuf,a.y);s===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,s)}ease(e,n,r){let a=1-Math.exp(-e*9),o=1-Math.exp(-e*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?a:o),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?a:o),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};function qr(t){let e=Math.max(5,t.radius),n=t.focalWorld[0]-t.center[0],r=t.focalWorld[2]-t.center[2],a=Math.hypot(n,r);if(a<e*.12)return{center:t.center,radius:e,polarDeg:48};let o=Math.min(a*.25,e*.2);return{center:[t.center[0]+n/a*o,t.center[1],t.center[2]+r/a*o],radius:e+o,polarDeg:50}}import{Quat as Fs,Vec3 as Ds}from"ogl";function jr(){let t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","18"),e.setAttribute("height","18"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round");let n=document.createElementNS(t,"path");return n.setAttribute("d","M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 0 2 2v3M8 21H5a2 2 0 0 0-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"),e.appendChild(n),e}function $r(t){let{container:e,model:n,opts:r,orbit:a,cinematic:o,analytics:i,loop:s,labelOverlay:l,stageAzimuth:m,overviewFraming:v}=t,d=0,c=-1,h=(M,D,H=28)=>{a.camera.position.set(M[0],M[1],M[2]),a.camera.lookAt(new Ds(D[0],D[1],D[2])),a.camera.fov=H,a.camera.updateProjectionMatrix()},u=document.createElement("button");u.className="sl-3d-overview-control sl-3d-icon-control",u.type="button",u.replaceChildren(jr());let b=r.navLabels?.fitView??"Show whole venue";u.setAttribute("aria-label",b),u.title=b,Object.assign(u.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",borderRadius:"999px",background:"rgba(12,18,32,0.72)",color:"#c9d4ea",border:"1px solid rgba(150,165,205,0.35)",backdropFilter:"blur(6px)",font:"600 11px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"});let p=()=>{u.firstElementChild||u.replaceChildren(jr())};p();let x=M=>{c=M;let D=t.gpu();D&&(D.seatProgram.uniforms.uFocusFloor.value=M,D.solidProgram.uniforms.uFocusFloor.value=M,D.chairProgram.uniforms.uFocusFloor.value=M),t.showSectionSeatLabels(null)},P=null,S=!1,I=()=>{if(P=null,S=!1,t.setSeeThrough?.(null),t.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),i.panoramaClosed()),t.setPanoramaSphereVisible(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.restorePanoramaLayer(),u.style.display="",l.setVisible(!0),t.setFrozen(!1);let M=c>=0?n.floors[c]:null;if(t.setNearFieldDetailEnabled(!!M),t.setSeatViewLocked(!1),w(),t.removeArriveChip(),t.setNavigationMode("auto"),M){let D=M.focalWorld[0]-M.center[0],H=M.focalWorld[2]-M.center[2],F=Math.hypot(D,H)>M.radius*.12?Math.atan2(D,H):m,z={center:M.center,radius:M.radius,box:M.box},B={polarDeg:58,margin:1.12};t.reducedMotion()?a.frame(z,!1,F,!1,B):a.frameSoft(z,F,!1,B)}else t.reducedMotion()?a.frame(n.bounds,!1,m,r.portraitOverviewCrop===!0,v):a.frameSoft(n.bounds,m,r.portraitOverviewCrop===!0,v);l.setOverviewDistance(a.targetDistance),t.showSectionSeatLabels(null),s.requestRender()},w=()=>{d++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),o.active&&(o.cancel(),a.resumeAfterFlight(n.focalWorld))},R=M=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let D=n.seats.idToIndex.get(M);if(D===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(M),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),t.setPanoramaSphereVisible(!1),u.style.display="",t.restorePanoramaLayer()),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.setFrozen(!1);let H=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(H),t.setSeatViewLocked(!1);let F=++d;H?t.showArriveChip(M,F):t.removeArriveChip();let{eye:z,focal:B}=t.resolvedSeatViewPose(M,D),U=r.arriveAtSeatEye?t.seatViewArrival(M,D):null,W=U&&U.stops.length>1&&U.stops[1].name==="row"?U.stops[1]:null,N=U?U.focal:B,ee=[a.camera.position.x,a.camera.position.y,a.camera.position.z],Z=fn(ee,U?.eye??z,N,n.bounds.center,n.bounds.radius),Y=W?W.eye:U?U.eye:r.arriveAtSeatEye?z:Z.finalPos,T=U?U.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?Rt:65:28,C=[Z.waypoints[0],Z.waypoints[1],Y];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),h(Y,N,T),s.requestRender(),i.cinematicSkipped(),t.isDisposed()||a.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),U&&t.enterSeatView(U.stops),t.showArriveChip(M,F),Promise.resolve();let A=new Fs().copy(a.camera.quaternion),X=vr(a.camera,Y,N);s.requestRender();let Q=H?700:2500;return o.start(C,A,X,Q,T).then(()=>{t.isDisposed()||F!==d||(t.setSeatStepping(!1),i.cinematicPlayed(Q),a.resumeAfterFlight(N),t.setSeatViewLocked(r.arriveAtSeatEye===!0),U&&t.enterSeatView(U.stops,W?1:0),s.requestRender(),t.showArriveChip(M,F))})},V=(M,D)=>{let H=n.sections.find(F=>F.id===M);if(!H||H.seatCount===0)return!1;if(P=M,S=!1,t.setSeeThrough?.(null),t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),o.cancel(),t.removeArriveChip(),n.floors.length>1&&c!==H.floorIndex&&x(H.floorIndex),t.setNavigationMode("auto"),t.panorama()||l.setVisible(!0),t.showSectionSeatLabels(M),!D?.keepCamera){let F=qr(H),z={polarDeg:F.polarDeg,margin:1.12};t.reducedMotion()?a.frame({center:F.center,radius:F.radius},!1,a.currentAzimuth,!1,z):a.glideTo({center:F.center,radius:F.radius},z)}return r.onSectionFocusChange?.(M),s.requestRender(),!0},g=(M,D)=>{if(t.isDisposed()||!t.gpu())return!1;let H=n.seats.idToIndex.get(M);if(H===void 0)return!1;let F=H*3,z=[n.seats.iPosition[F],n.seats.iPosition[F+1]+.55,n.seats.iPosition[F+2]],B=D?Vs(D,a.fovY,a.camera.aspect||1):Kr;return S=!0,t.setSeeThrough?.(z),t.reducedMotion()?a.frame({center:z,radius:B},!1,void 0,!1,Sn):a.frameSoft({center:z,radius:B},void 0,!1,Sn),s.requestRender(),!0},E=()=>{if(t.isNarrow?.()&&S&&P&&V(P)){s.requestRender();return}I()};return u.addEventListener("click",E),{overviewChip:u,layoutOverviewChip:p,flightGen:()=>d,focusedFloor:()=>c,applyFloorFocus:x,placeCameraFinal:h,cancelFlight:w,focusOverview:I,flyToSeat:R,focusSectionCamera:V,focusSeatCamera:g}}var Kr=4.5;function Vs(t,e,n){let r=Math.tan(e*Math.PI/360),a=r*Math.max(.001,n),i=ks*t.viewportHeightPx/(2*Math.max(1,t.seatPx)*r)*Math.min(r,a)/Sn.margin;return Math.max(Ls,Math.min(Kr,i))}var ks=.5,Ls=1.5,Sn={polarDeg:48,margin:1.25};function wn(t,e,n,r,a,o,i,s,l=.5){let m=-1,v=s*s,d=1/0;for(let c=0;c<e;c++){let h=c*3,u=Me(n,[t[h],t[h+1]+l,t[h+2]],r,a);if(!u.visible)continue;let b=u.x-o,p=u.y-i,x=b*b+p*p;(x<v-4||x<v+4&&u.depth<d)&&(m=c,v=Math.min(v,x),d=u.depth)}return m}function Zr(t){let e=performance.now(),{input:n,estimate:r}=so(t);return{model:tt(n),buildMs:performance.now()-e,source:"main",...r?{estimate:r}:{}}}function Os(t){let e=Bn(t.doc);return{...Zr({...t,seats:e}),seats:e}}function Qr(t,e,n){if(typeof Worker>"u")return Promise.resolve(e());let r;try{r=new Worker(new URL("./scene/scene.worker.js",import.meta.url),{type:"module"})}catch{return Promise.resolve(e())}return new Promise(a=>{let o=!1,i=m=>{o||(o=!0,clearTimeout(l),r.terminate(),a(m))},s=()=>i(e()),l=window.setTimeout(s,15e3);r.onerror=s,r.onmessage=m=>{let v=n(m.data);v?i(v):s()},r.postMessage(t)})}function zs(t){return Qr(t,()=>Zr(t),({model:e,buildMs:n,estimate:r})=>({model:e,buildMs:n,source:"worker",...r?{estimate:r}:{}}))}function Ns(t){return Qr(t,()=>Os(t),({model:e,buildMs:n,seats:r,estimate:a})=>r?{model:e,buildMs:n,seats:r,source:"worker",...a?{estimate:a}:{}}:null)}var Gs=40,Bs=48,Ws=Math.PI/180,Us=6,Ys=500,Xs=6;function yu(t,e,n={}){let r=performance.now(),a=e.prepared?e.prepared.estimate:e.estimate===!1?null:Kt(e.doc,e.seats);a&&(e={...e,doc:a.doc,seats:io(e.seats,a)});let o=e.prepared?.model??tt(e),i=new It(n.onAnalytics),s=new Array(o.seats.count);for(let[f,y]of o.seats.idToIndex)s[y]=f;let l=new Map(e.seats.map(f=>[f.id,f])),m=new Map;for(let f of e.seats){if(!f.rowId)continue;let y=m.get(f.rowId);y?y.push(f.id):m.set(f.rowId,[f.id])}let v=new Map,d=[0,0,0,0];function c(){if(p)for(let f of[p.seatProgram,p.solidProgram,p.chairProgram])f.uniforms.uSeeThrough.value=d}e.seats.forEach((f,y)=>{v.set(f.id,o.seatSectionIds?.[y]??f.sectionId)});let h=new Map;for(let[f,y]of o.seats.idToIndex){let _=v.get(f);if(!_)continue;let O=h.get(_);O?O.push(y):h.set(_,[y])}let u=()=>{if(!p||!o.sectionSolidRanges.length)return;let{lit:f,anyUnlit:y}=er(o.sectionSolidRanges,h,o.seats.iState);p.setSectionShellLit(y?f:null)},b=e.doc.floors?.some(y=>(y.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(y=>y.objects)??e.doc.objects).some(y=>y.type==="section"&&((y.height??0)>0||(y.rake??0)>0)),p=null,x=null,P=null,S=!1,I=!1,w=!1,R=new Map,V=null,g=null,E=null,M=new Map,D=null,H=()=>{E===null&&(E=t.style.zIndex,t.style.zIndex="20")},F=()=>{E!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=E),E=null)},z=!1,B=()=>z?pe.focusedFloor():-1,U=()=>{p=ar(C.gl,o),x?.dispose(),x=_o(C.gl,[1,1,1],o.theme.seatStates.selected),_n(!1),u(),Mn(),P=new Ct(C.renderer,p.seatGeometry,p.chairGeometry,p.solidGeometry,o.seats.count),C.setClearColor(o.theme.background.top),P.setRestoreClear(o.theme.background.top),P.setRoomCentre(o.room?.centre),p.seatProgram.uniforms.uSeatRadius.value=Je*o.theme.seatScale,p.seatProgram.uniforms.uFocusFloor.value=B(),p.solidProgram.uniforms.uFocusFloor.value=B(),p.chairProgram.uniforms.uFocusFloor.value=B(),p.screenProgram&&(p.screenProgram.uniforms.uFocusFloor.value=B()),c(),N.forceRegather()},W=!1,N=new Dt({model:o,orbit:()=>A,gpu:()=>p}),ee=!1,Z=new Map,Y=24,T=f=>N.setDetailEnabled(f),C=new xt(t,{onContextLost:()=>{w||i.contextLost(),S=!0,ae.stop(),p=null,P=null},onContextRestored:()=>{U(),S=!1,w||i.contextRestored(),ae.requestRender()}}),A=new St(C.gl,C.canvas,()=>ae.requestRender(),()=>i.orbitEngaged());A.setAspect(C.aspect);let X=(e.doc.floors?.flatMap(f=>f.objects)??e.doc.objects).some(f=>f.type==="section"&&f.physical3dProvenance?.surfaceKind?.status==="inferred"),Q=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(X&&o.stages.length===0))return lo(o.focalWorld,o.seats.iPosition,o.bounds)})(),ve=(e.doc.floors?.flatMap(f=>f.objects)??e.doc.objects).some(f=>f.type==="shape"&&f.stageKind?.startsWith("pitch-")),se=o.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:ve?36:48,margin:1.05},be=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;A.frame(o.bounds,!be&&n.skipInitialOverviewAnimation!==!0,Q,n.portraitOverviewCrop===!0,se);let te=new Et(A.camera),me=Gr(t),he=co(t,o),L=new Pt(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:o.theme.background.top}),J=o.labels,K=()=>Kn(J,o.floors.length,B());L.setLabels(K()),L.setOverviewDistance(A.targetDistance);let ne=()=>{let f=new Map,y=ye.indexOf("available");for(let _ of J){if(!_.wheelchairSeats)continue;let O=0;for(let G of _.wheelchairSeats)o.seats.iState[G]===y&&O++;O>0&&f.set(_.id,O)}return L.setWheelchairFree(f)};ne();let q=null,le=()=>[...R.keys()].flatMap(f=>{let y=o.seats.idToIndex.get(f),_=y===void 0?void 0:e.seats[y];if(y===void 0||_?.id!==f)return[];let O=y*3;return[{id:`seat:${f}`,kind:"seat",seatWidthM:o.seats.iChairWidth[y]*2,text:_.displayLabel||_.label,anchor:[o.seats.iPosition[O],o.seats.iPosition[O+1]+1.05,o.seats.iPosition[O+2]],pinBase:kt(O)}]}),mt=-1,Mn=()=>{p&&(mt=q?o.sections.findIndex(f=>f.id===q):-1,p.seatProgram.uniforms.uFocusSection.value=mt,p.chairProgram.uniforms.uFocusSection.value=mt)},ht=f=>{if(q=f,Mn(),L.setForcedDense(!!f),!f){let k=le(),ie=new Set(k.map(re=>re.id));L.setLabels([...K().filter(re=>!ie.has(re.id)),...k]);return}let y=e.seats.filter(k=>v.get(k.id)===f),_=new Set(y.map(k=>k.id)),O=new Set(y.map(k=>k.rowId)),G=new Set(R.keys()),j=new Set(y.filter(k=>G.has(k.id)).map(k=>k.id)),$=K().filter(k=>k.kind!=="row"&&k.kind!=="seat"&&k.kind!=="access"||k.kind==="access"&&_.has(k.id.slice(7))||(k.kind==="row"?O.has(k.id.slice(4)):_.has(k.id.slice(5))));if(o.seatCount<=6e3&&j.size===0){L.setLabels($);return}let oe=y,de=new Set(oe.map(k=>`seat:${k.id}`)),ge=oe.flatMap(k=>{let ie=o.seats.idToIndex.get(k.id);if(ie===void 0)return[];let re=ie*3;return[{id:`seat:${k.id}`,kind:"seat",seatWidthM:o.seats.iChairWidth[ie]*2,rowId:k.rowId,text:G.has(k.id)?k.displayLabel||k.label:ao(k.displayLabel||k.label),anchor:[o.seats.iPosition[re],o.seats.iPosition[re+1]+(G.has(k.id)?1.05:.55),o.seats.iPosition[re+2]],...G.has(k.id)?{pinBase:kt(re)}:{}}]});L.setLabels([...$.filter(k=>!de.has(k.id)),...ge])};U();let Se=null,Vt=null,Pn=new Hs,pt=f=>{if(S||!p||I)return!1;let y=zr({flying:te.active,panoramaMounted:V!==null,seatViewActive:Se?.active===!0}),_=y==="orbit"?mt:-1;p.seatProgram.uniforms.uFocusSection.value=_,p.chairProgram.uniforms.uFocusSection.value=_;let O=ee?!1:y==="cinematic"?te.update(performance.now()):y==="seatView"?Se.update(performance.now()):y==="orbit"?A.update():!1;Vt?.syncZoomLimits(),Vt?.syncNavigationMode();let G=B()>=0?o.floors[B()]:null,j=G?.radius??o.bounds.radius,$=Po(A.currentDistance,j),oe=W?{center:[A.camera.position.x,A.camera.position.y,A.camera.position.z],radius:520}:o.clipBounds??o.renderBounds;A.updateClipping(oe);let de=G?.center??o.renderBounds.center,ge=G?.radius??o.renderBounds.radius,k=(ce,Yt)=>Math.hypot(A.camera.position.x-ce[0],A.camera.position.y-ce[1],A.camera.position.z-ce[2])<=Yt*(N.detailVisible?1.8:1.55),ie=k(de,ge);if(!ie&&q){let ce=o.sections.find(Yt=>Yt.id===q);ce&&(ie=k(ce.center,Math.max(12,ce.radius*2)))}N.detailVisible=ie;let re=p.seatProgram.uniforms;re.uSeatScale.value=$.scale,re.uSeatFade.value=$.fade;let xe=!!G&&Ao(G.seatCount,C.canvas.clientWidth||1,C.canvas.clientHeight||1),Te=Co(o.seats.count,j,A.currentDistance,A.camera.fov,C.canvas.clientHeight||1),$e=N.detailVisible||xe||Te?1:0,Ke=N.detailVisible||B()>=0||o.floors.length>1?1:0;N.ease(f,$e,Ke),re.uSeatDetail.value=N.seatDetailMix;let bt=$e===0&&N.seatDetailMix<.01;p.seatGeometry.setDrawRange(bt?Zt:0,bt?uo:Zt),p.solidProgram.uniforms.uStructureDetail.value=N.structureDetailMix,re.uMinPixels.value=$.minPixels,re.uPixelToWorld.value=2*Math.tan(A.camera.fov*Ws/2)/Math.max(1,C.pixelHeight),N.update(N.detailVisible),o.outdoor&&(Pn.copy(A.camera.projectionViewMatrix).inverse(),p.backgroundProgram.uniforms.uInvViewProj.value.set(Pn)),C.renderer.render({scene:p.background,clear:!0}),C.renderer.render({scene:p.main,camera:A.camera,clear:!1});let Ze=x?x.update(performance.now(),[A.camera.position.x,A.camera.position.y,A.camera.position.z],V!==null,y==="seatView"):!1;if(x&&C.renderer.render({scene:x.root,camera:A.camera,clear:!1}),he){let ce=A.camera.worldMatrix;he.update(y==="seatView"?[A.camera.position.x,A.camera.position.y,A.camera.position.z]:null,[-ce[8],-ce[9],-ce[10]])}L.update(A.camera.projectionViewMatrix,C.canvas.clientWidth||1,C.canvas.clientHeight||1,A.currentDistance,j,[A.camera.position.x,A.camera.position.y,A.camera.position.z]);let ke=O||Ze||N.seatDetailMix!==$e||N.structureDetailMix!==Ke;return An(!ke),ke},An=yo(t),ae=new wt(pt),Cn=typeof ResizeObserver<"u"?new ResizeObserver(()=>Ut.resize()):null;Cn?.observe(t),A.setZoomPointResolver((f,y)=>{let _=C.canvas.getBoundingClientRect(),O=C.canvas.clientWidth||_.width,G=C.canvas.clientHeight||_.height;if(!(O>0)||!(G>0))return null;A.camera.updateMatrixWorld();let j=wn(o.seats.iPosition,o.seats.count,A.camera.projectionViewMatrix,O,G,f-_.left,y-_.top,Gs);if(j<0)return null;let $=j*3;return[o.seats.iPosition[$],o.seats.iPosition[$+1]+.5,o.seats.iPosition[$+2]]});function kt(f){return[o.seats.iPosition[f],o.seats.iPosition[f+1]+.5,o.seats.iPosition[f+2]]}L.setSeatNumberRow(null);let we=null,Ee=0,Lt=null,En=()=>{Ee=0;let f=null,y=null;if(we&&!Se?.active&&!te.active){let G=C.canvas.getBoundingClientRect(),j=C.canvas.clientWidth||G.width,$=C.canvas.clientHeight||G.height;if(j>0&&$>0){let oe=wn(o.seats.iPosition,o.seats.count,A.camera.projectionViewMatrix,j,$,we.x-G.left,we.y-G.top,Bs);f=oe>=0?e.seats[oe]?.rowId??null:null;let de=oe>=0?e.seats[oe]?.id??null:null;if(y=de,we.mouse&&!we.pressing&&!!q&&!!de&&v.get(de)===q){let k=t.getBoundingClientRect();Lt=de,n.onSeatHover?.(de,{x:we.x-k.left,y:we.y-k.top})}else Rn()}}else Rn();let _=we?.mouse?y:null,O=L.setSeatNumberSeat(_);(L.setSeatNumberRow(f)||O)&&ae.requestRender()};function Rn(){Lt!==null&&(Lt=null,n.onSeatHover?.(null,null))}let ft=f=>{we={x:f.clientX,y:f.clientY,mouse:f.pointerType==="mouse",pressing:f.type==="pointerdown"},Ee||(Ee=requestAnimationFrame(En))},Tn=f=>{f.pointerType==="mouse"&&(we=null,Ee||(Ee=requestAnimationFrame(En)))};C.canvas.addEventListener("pointermove",ft),C.canvas.addEventListener("pointerdown",ft),C.canvas.addEventListener("pointerleave",Tn);function _n(f){if(!x)return;let y=[];for(let _ of R.keys()){let O=o.seats.idToIndex.get(_);if(O===void 0)continue;let G=O*3,j=kt(G),$=Math.atan2(o.focalWorld[0]-j[0],o.focalWorld[2]-j[2]);y.push({id:_,position:j,facing:$})}x.setSeats(y,performance.now(),f)}let In=f=>{let y=G=>{let j=o.seats.idToIndex.get(G);return j===void 0?void 0:o.seats.iState[j]},{updates:_,next:O}=cr(R,f,y);if(R=O,L.setSelectedSeatIds(R.keys()),_n(!Xe()),ae.requestRender(),ht(q),_.length){let G=jt(o.seats,_);p&&p.uploadSeatStateRuns(G),u(),ae.requestRender()}},Xe=()=>D!==null?D:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Jr=8,Fn=f=>{if(!n.getSeatView)return null;let y=M.get(f);if(!y)for(y=Promise.resolve(n.getSeatView(f)),M.set(f,y),y.catch(()=>{M.get(f)===y&&M.delete(f)});M.size>Jr;){let _=M.keys().next().value;if(_===void 0)break;M.delete(_)}return y},Dn=_r(o.stages,o.focalWorld,o.bounds.groundY??0),Vn=gn(Dn),Ot=(f,y)=>{let _=l.get(f),O=Math.max(0,Math.round(o.seats.iFloor[y]??0)),G=e.doc.floors?.[O],j=o.floors[O],$=G?.focalPoint??e.doc.focalPoint,oe=j?{x:j.focalWorld[0]/Le,y:j.focalWorld[2]/Le}:$,de=_?.focalPoint?{x:_.focalPoint.x+oe.x-$.x,y:_.focalPoint.y+oe.y-$.y}:oe,ge=[o.seats.iPosition[y*3],o.seats.iPosition[y*3+1],o.seats.iPosition[y*3+2]],k=yr(o.seats.iPosition,y,Vn),ie=k!==null&&Math.abs(k)<gr;return xr(ge,de,G?.baseHeightM??0,_?.eyeHeightM,Vn,ie)},zt=()=>(t.clientWidth||C.canvas.clientWidth)<=520,Nt=null,kn=null,ea=async(f,y,_)=>{if(!n.getSeatView||w||_!==pe.flightGen())return;let O;try{O=await Nr()}catch{if(i.panoramaFailed(f,"mount"),!w&&_===pe.flightGen()){let G=Gt(f,_,!0);requestAnimationFrame(()=>G?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(w||_!==pe.flightGen()||!Nt))return kn??=O.createOpenPanorama(Nt),kn(f,y,_)},Ht=Br({container:t,model:o,opts:n,expandedSeatById:l,seatIdsByRow:m,isNarrow:zt,isDisposed:()=>w,flightGen:()=>pe.flightGen(),flyToSeat:f=>Hn(f),openPanorama:(f,y,_)=>ea(f,y,_)}),Gt=Ht.show,Bt=Ht.remove,ta=Ht.layout,Re=Wr({container:t,orbit:A,isNarrow:zt,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});Vt=Re;let na=Re.element,qe=Re.setNavigationMode,oa=Re.layout,ra=Re.utilityControls,je=null,Ln=!1,vt=f=>{Re.setSeatViewLocked(f),f||Se?.exit()};Se=Or({canvas:C.canvas,camera:A.camera,requestRender:()=>ae.requestRender(),reducedMotion:Xe,onStopChange:f=>{let y=f??(Ln?"seat":null);je=y;try{n.onSeatViewStopChange?.(y)}catch{}},onApplied:()=>{w||A.syncFromCamera()}});let On=o.sections.reduce((f,y)=>y.seatCount>0&&y.box?Math.max(f,y.box.max[1]):f,-1/0),zn=(f,y)=>{let{eye:_}=Ot(f,y),O=(t.clientWidth||C.canvas.clientWidth||1)/Math.max(1,t.clientHeight||C.canvas.clientHeight||1),G=Fr(_,Dn,O,{preserveEye:!0});if(n.seatViewStops===!1)return{...G,stops:[]};let j=v.get(f),$=j?o.sections.find(oe=>oe.id===j):void 0;return{...G,stops:Dr(G,{aspect:O,seatingTopY:Number.isFinite(On)?On:o.bounds.box.max[1],section:$&&$.seatCount>0?{center:$.center,radius:$.radius}:null,venue:{center:o.bounds.center,radius:o.bounds.radius}})}},pe=$r({isNarrow:zt,setSeeThrough:f=>{d=f?[f[0],f[1],f[2],Xs]:[0,0,0,0],c(),ae.requestRender()},container:t,model:o,opts:n,orbit:A,cinematic:te,analytics:i,loop:ae,labelOverlay:L,stageAzimuth:Q,overviewFraming:se,gpu:()=>p,isDisposed:()=>w,panorama:()=>V,setPanorama:f=>{V=f},setPanoramaSphereVisible:f=>{W=f},panoramaLoadAbort:()=>g,setPanoramaLoadAbort:f=>{g=f},setFrozen:f=>{I=f},restorePanoramaLayer:F,reducedMotion:Xe,resolvedSeatViewPose:Ot,showSectionSeatLabels:ht,setNearFieldDetailEnabled:T,setSeatViewLocked:vt,setNavigationMode:qe,showArriveChip:Gt,removeArriveChip:Bt,inSeatView:()=>je!==null,setSeatStepping:f=>{Ln=f},seatViewArrival:(f,y)=>n.arriveAtSeatEye?zn(f,y):null,enterSeatView:(f,y)=>Se?.enter(f,y)});z=!0;let Wt=pe.overviewChip,aa=pe.layoutOverviewChip,ia=pe.applyFloorFocus,sa=pe.focusOverview,Nn=pe.cancelFlight,Hn=pe.flyToSeat,Gn=pe.focusSectionCamera;ra.appendChild(Wt),Nt={container:t,model:o,opts:n,analytics:i,orbit:A,loop:ae,seatsById:l,ensureSeatView:Fn,resolvedSeatViewPose:Ot,gpu:()=>p,gl:C.gl,isContextLost:()=>S,isDisposed:()=>w,flightGen:()=>pe.flightGen(),setPanorama:f=>{V=f},getLoadAbort:()=>g,setLoadAbort:f=>{g=f},setPanoramaSphereVisible:f=>{W=f,f&&Se?.exit()},setFrozen:f=>{I=f},raisePanoramaLayer:H,restorePanoramaLayer:F,getOverviewChip:()=>Wt,labelOverlay:L,reducedMotion:Xe,removeArriveChip:Bt,showArriveChip:Gt};let Ae=Xr({glctx:C,orbit:A,model:o,seats:e.seats,opts:n,cinematic:te,analytics:i,seatIdByIndex:s,sectionIdBySeatId:v,tapSlop:Us,tapMs:Ys,gpu:()=>p,pick:()=>P,seatViewLocked:()=>Re.seatViewLocked(),focusedSectionId:()=>q,selection:()=>R,cancelFlight:Nn,focusSectionCamera:Gn,focusSeatCamera:pe.focusSeatCamera,setSelection:In,ensureSeatView:Fn});C.canvas.addEventListener("pointerdown",Ae.onDown),C.canvas.addEventListener("pointermove",Ae.onMove),C.canvas.addEventListener("pointerup",Ae.onUp),C.canvas.addEventListener("pointercancel",Ae.onUp),ae.requestRender();let Ut={setAvailability(f){let y=lr(R,f),_=jt(o.seats,y);_.length&&p&&p.uploadSeatStateRuns(_),u(),_.length&&ne(),ae.requestRender()},setSelection:In,setNavigationMode:qe,zoomIn(){A.zoomBy(ze),ae.requestRender()},zoomOut(){A.zoomBy(nt),ae.requestRender()},flyToSeat:Hn,focusOverview:sa,seatViewStop:()=>je,recentreSeatView:()=>Se?.recentre()??!1,resize(){let{width:f,height:y}=C.resize();A.setAspect(f/Math.max(1,y)),ta(),oa(),aa(),ae.requestRender()},stats(){return{...ae.stats(),drawCalls:p?p.drawCalls:0,fallbackTriangles:p?p.seatGeometry.drawRange.count/3*o.seats.count:0,seatCount:o.seatCount}},captureImage(f=1280){if(S||!p||typeof document>"u")return null;pt(0);let y=C.canvas,_=Math.min(1,f/Math.max(y.width,y.height,1)),O=document.createElement("canvas");O.width=Math.max(1,Math.round(y.width*_)),O.height=Math.max(1,Math.round(y.height*_));let G=O.getContext("2d");return G?(G.drawImage(y,0,0,O.width,O.height),O.toDataURL("image/jpeg",.82)):null},captureSeatView(f,y=480){if(S||!p||I||typeof document>"u"||te.active||V!==null||Se?.active)return null;let _=Z.get(f);if(_)return _;let O=o.seats.idToIndex.get(f);if(O===void 0)return null;let{eye:G,focal:j,fov:$}=zn(f,O),oe=A.snapshot(),de=[N.seatDetailMix,N.structureDetailMix],ge=null;try{ee=!0,A.camera.position.set(G[0],G[1],G[2]),A.camera.perspective({fov:$,aspect:A.camera.aspect}),A.camera.lookAt(j),A.camera.updateMatrixWorld(),A.syncFromCamera(),N.seatDetailMix=1,N.structureDetailMix=1,N.forceRegather(),pt(0);let k=C.canvas,ie=Math.min(k.width,Math.round(k.height*16/9)),re=Math.round(ie*9/16),xe=document.createElement("canvas");xe.width=Math.max(1,Math.round(y)),xe.height=Math.max(1,Math.round(y*9/16));let Te=xe.getContext("2d");Te&&(Te.drawImage(k,(k.width-ie)/2,(k.height-re)/2,ie,re,0,0,xe.width,xe.height),ge=xe.toDataURL("image/jpeg",.8))}finally{ee=!1,oe(),N.seatDetailMix=de[0],N.structureDetailMix=de[1],N.forceRegather(),pt(0)}if(ge)for(Z.set(f,ge);Z.size>Y;)Z.delete(Z.keys().next().value);return ge},getQualityEvidence(){let f=ae.stats(),y=C.canvas.clientWidth||1,_=C.canvas.clientHeight||1,O=o.bounds.center,G=Me(A.camera.projectionViewMatrix,[O[0],o.bounds.box.min[1],O[2]],y,_),j=Me(A.camera.projectionViewMatrix,[O[0],o.bounds.box.max[1],O[2]],y,_),$=o.bounds.box,oe=[$.min[0],$.max[0]].flatMap(k=>[$.min[1],$.max[1]].flatMap(ie=>[$.min[2],$.max[2]].map(re=>Me(A.camera.projectionViewMatrix,[k,ie,re],y,_)))).filter(k=>Number.isFinite(k.x)&&Number.isFinite(k.y)&&Number.isFinite(k.depth)),de=oe.length?(()=>{let k=Math.min(...oe.map(ce=>ce.x)),ie=Math.max(...oe.map(ce=>ce.x)),re=Math.min(...oe.map(ce=>ce.y)),xe=Math.max(...oe.map(ce=>ce.y)),Te=Math.max(0,k),$e=Math.min(y,ie),Ke=Math.max(0,re),bt=Math.min(_,xe),Ze=Math.max(0,$e-Te),ke=Math.max(0,bt-Ke);return{box:{x:Te,y:Ke,width:Ze,height:ke},horizontalFillRatio:Ze/y,verticalFillRatio:ke/_,visibleAreaRatio:Ze*ke/(y*_),clippedEdges:[...re<0?["top"]:[],...ie>y?["right"]:[],...xe>_?["bottom"]:[],...k<0?["left"]:[]]}})():void 0,ge=String(C.gl.getParameter(C.gl.VERSION)??"");return{viewport:{width:y,height:_},context:{webgl2:/webgl\s*2/i.test(ge),lost:S},frame:{rendered:f.rendered,idle:f.idle},camera:{position:[A.camera.position.x,A.camera.position.y,A.camera.position.z],distance:A.currentDistance,verticalFovDeg:A.fovY},scene:{seatCount:o.seatCount,floorCount:o.floors.length,zoneCount:o.zones.length,sectionCount:o.sections.length,authoredRelief:b,renderedVerticalSpanM:Math.max(0,o.bounds.box.max[1]-o.bounds.box.min[1]),projectedReliefPx:G.visible&&j.visible?Math.abs(G.y-j.y):0},labels:L.qualityEvidence(),framing:de,...je?{seatView:{fovDeg:A.camera.fov,stop:je}}:{}}},getQualityReport(){return cn(Ut.getQualityEvidence())},loseContextForTest(){C.simulateContextLossCycle()},floors(){return o.floors},focusFloor(f){if(f!==null&&!o.floors.some(_=>_.index===f))return!1;let y=f??-1;if(T(f!==null),vt(!1),ia(y),qe("orbit"),f===null)te.cancel(),Xe()?A.frame(o.bounds,!1,Q,n.portraitOverviewCrop===!0,se):A.frameSoft(o.bounds,Q,n.portraitOverviewCrop===!0,se),L.setOverviewDistance(A.targetDistance);else{let _=o.floors[f];if(_.seatCount>0){te.cancel();let O=_.focalWorld[0]-_.center[0],G=_.focalWorld[2]-_.center[2],j=Math.hypot(O,G)>_.radius*.12?Math.atan2(O,G):Q;A.frame({center:_.center,radius:_.radius,box:_.box},!1,j,!1,{polarDeg:58,margin:1.12}),L.setOverviewDistance(A.targetDistance)}}return ae.requestRender(),!0},zones(){return o.zones},focusZone(f){let y=o.zones.find(j=>j.id===f);if(!y||y.seatCount===0)return!1;T(!1),vt(!1),te.cancel(),qe("orbit"),ht(null),n.onSectionFocusChange?.(null);let _=y.focalWorld[0]-y.center[0],O=y.focalWorld[2]-y.center[2],G=Math.hypot(_,O)>y.radius*.12?Math.atan2(_,O):void 0;return A.frame({center:y.center,radius:y.radius*1.25},!1,G),ae.requestRender(),!0},sections(){return o.sections},focusSection(f){return Gn(f)},rows(f){return f?o.rows.filter(y=>y.sectionId===f):o.rows},seatsInRow(f){return e.seats.filter(y=>y.rowId===f).map(y=>({id:y.id,label:y.displayLabel||y.label}))},focusRow(f){let y=o.rows.find(_=>_.id===f);return!y||y.seatCount===0?!1:(T(!0),vt(!1),te.cancel(),qe("pan"),y.sectionId&&(ht(y.sectionId),n.onSectionFocusChange?.(y.sectionId)),A.frame({center:y.center,radius:Math.max(2.5,y.radius*.65)}),ae.requestRender(),!0)},setReducedMotionForTest(f){D=f},dispose(){w=!0,he?.dispose(),An(!1),Bt(),Wt.remove(),na.remove(),Nn(),Se?.dispose(),ae.stop(),L.dispose(),Cn?.disconnect(),V&&(V.dispose(),V=null),F(),me(),C.canvas.removeEventListener("pointerdown",Ae.onDown),C.canvas.removeEventListener("pointermove",Ae.onMove),C.canvas.removeEventListener("pointerup",Ae.onUp),C.canvas.removeEventListener("pointercancel",Ae.onUp),C.canvas.removeEventListener("pointermove",ft),C.canvas.removeEventListener("pointerdown",ft),C.canvas.removeEventListener("pointerleave",Tn),Ee&&cancelAnimationFrame(Ee),A.dispose(),P&&P.dispose(),p&&p.dispose(),p=null,x?.dispose(),x=null,P=null,C.dispose()}};return i.opened(o.seatCount,b,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),Ut}export{ui as VENUE3D_QUALITY_REPORT_VERSION,la as autoVenue3d,tt as buildSceneModel,Kt as estimateVenue3D,cn as inspectVenue3DQualityEvidence,yu as mountVenue3D,zs as prepareVenue3D,Ns as prepareVenue3DFromChart};
957
+ void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:se},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let K=new lt(t,{geometry:Q,program:ve});K.frustumCulled=!1,K.setParent(n),me.screenProgram=ve,A=!0,me.drawCalls=3+(C?1:0)+1},L.src=he.contentImageUrl}return me}import{Mesh as mn,RenderTarget as Ui,Transform as hn}from"ogl";function Wi(t,e,n){let r=t+(e<<8)+(n<<16);return r===0?-1:r-1}function ir(t,e,n,r,a,o){let i=-1,s=1/0;for(let l=0;l<n;l++)for(let m=0;m<e;m++){let v=(l*e+m)*4,d=Wi(t[v],t[v+1],t[v+2]);if(d<0||d>=o)continue;let c=m-r,h=l-a,u=c*c+h*h;u<s&&(s=u,i=d)}return i}function sr(t,e,n,r,a,o){let i=t-n.left,s=e-n.top,l=Math.round(i*r),m=Math.round((n.height-s)*r);return{x:Math.max(0,Math.min(a-1,l)),y:Math.max(0,Math.min(o-1,m))}}var Yi=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],Ct=class{constructor(e,n,r,a,o){this.seatScene=new hn;this.chairScene=new hn;this.solidScene=new hn;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=o,this.seatProg=Xo(this.gl),this.chairProg=qo(this.gl),this.depthProg=jo(this.gl);let i=new mn(this.gl,{geometry:n,program:this.seatProg});i.frustumCulled=!1,i.setParent(this.seatScene);let s=new mn(this.gl,{geometry:r,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let l=new mn(this.gl,{geometry:a,program:this.depthProg});l.frustumCulled=!1,l.setParent(this.solidScene)}setRoomCentre(e){this.depthProg.uniforms.uRoomCentre.value.set(e??[0,0])}setRestoreClear(e){this.restoreClear=[e[0],e[1],e[2]]}syncFromSeatProgram(e){for(let a of Yi)this.seatProg.uniforms[a].value=e.uniforms[a].value;let n=e.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=n,this.chairProg.uniforms.uFocusFloor.value=n,this.depthProg.uniforms.uFocusFloor.value=n;let r=e.uniforms.uSeeThrough?.value;if(r)for(let a of[this.seatProg,this.chairProg,this.depthProg])a.uniforms.uSeeThrough.value=r}ensureTarget(){let e=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==e||this.target.height!==n)&&this.destroyTarget(),this.target||(this.target=new Ui(this.gl,{width:e,height:n,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let e=this.gl;this.target.buffer&&e.deleteFramebuffer(this.target.buffer);for(let n of this.target.textures??[])n.texture&&e.deleteTexture(n.texture);this.target.depthBuffer&&e.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(e,n,r,a){let o=this.gl,i=this.ensureTarget(),s=o.drawingBufferWidth,l=o.drawingBufferHeight,m=Math.max(0,n-a),v=Math.max(0,r-a),d=Math.max(1,Math.min(s,n+a+1)-m),c=Math.max(1,Math.min(l,r+a+1)-v);o.enable(o.SCISSOR_TEST),o.scissor(m,v,d,c);let[h,u,b]=this.restoreClear;o.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:e,target:i,clear:!0}),this.renderer.render({scene:this.seatScene,camera:e,target:i,clear:!1}),this.renderer.render({scene:this.chairScene,camera:e,target:i,clear:!1}),o.clearColor(h,u,b,1),o.disable(o.SCISSOR_TEST);let p=new Uint8Array(d*c*4);return this.renderer.bindFramebuffer(i),o.readPixels(m,v,d,c,o.RGBA,o.UNSIGNED_BYTE,p),this.renderer.bindFramebuffer(),ir(p,d,c,n-m,r-v,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function lr(t,e){let n=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,jn(r.state)):n.push(r);return n}function cr(t,e,n){let r=new Set;for(let i of e)(t.has(i)||n(i)!==void 0)&&r.add(i);let a=new Map(t),o=[];for(let[i,s]of t)r.has(i)||(o.push({seatId:i,state:ye[s]??"available"}),a.delete(i));for(let i of r){if(a.has(i))continue;let s=n(i);s!==void 0&&(a.set(i,s),o.push({seatId:i,state:"selected"}))}return{updates:o,next:a}}import{Quat as ct,Vec3 as ji}from"ogl";function Xi(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function ur(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function qi(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function dr(t){let e=Math.hypot(t[0],t[1],t[2]);return e>1e-6?[t[0]/e,t[1]/e,t[2]/e]:[0,0,0]}function pn(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function fn(t,e){return Math.max(0,Math.min(1,t+e))}function mr(t,e){let n=t.length;if(n===0)return[0,0,0];if(n===1)return[...t[0]];let r=Math.max(0,Math.min(1,e)),a=n-1,o=Math.floor(r*a);o>=a&&(o=a-1);let i=r*a-o,s=t[Math.max(0,o-1)],l=t[o],m=t[o+1],v=t[Math.min(n-1,o+2)],d=i*i,c=d*i,h=[0,0,0];for(let u=0;u<3;u++)h[u]=.5*(2*l[u]+(-s[u]+m[u])*i+(2*s[u]-5*l[u]+4*m[u]-v[u])*d+(-s[u]+3*l[u]-3*m[u]+v[u])*c);return h}function vn(t,e,n,r,a){let o=dr(Xi(e,n));o[0]===0&&o[1]===0&&o[2]===0&&(o=[0,0,1]);let i=ur(ur(e,qi(o,2.5)),[0,1.5,0]),s=[e[0]-r[0],0,e[2]-r[2]],l=dr(s);l[0]===0&&l[2]===0&&(l=[o[0],0,o[2]]);let m=Math.max(1,a),v=[r[0]+l[0]*m*1.3,r[1]+m*.75,r[2]+l[2]*m*1.3];return{waypoints:[t,v,i],finalPos:i}}function bn(t,e,n=35,r=28){let a=pn(e),o=mr(t,a),i=pn(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:o,fov:n+(r-n)*i,eased:a}}function vr(t,e,n){let r=t.position.clone(),a=new ct().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new ji(n[0],n[1],n[2]));let o=new ct().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(a),o}var Et=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new ct;this.endQuat=new ct;this.outQuat=new ct;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=e}start(e,n,r,a=2500,o=28){return this.settle(),this.waypoints=e,this.startQuat.copy(n),this.endQuat.copy(r),this.duration=a,this.endFov=o,this.startTime=performance.now(),this.active=!0,new Promise(i=>{this.resolveFn=i})}update(e){if(!this.active)return!1;let n=Math.min(1,(e-this.startTime)/this.duration),{pos:r,fov:a,eased:o}=bn(this.waypoints,n,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,fn(o,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=a,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let e=this.resolveFn;this.resolveFn=null,e&&e()}};var br=Xn,$i=.12,Ki=1.6,gr=.12;function yr(t,e,n){let r=t[e*3],a=t[e*3+1],o=t[e*3+2],i=n[0]-r,s=n[2]-o,l=Math.hypot(i,s);if(!(l>.001))return null;let m=i/l,v=s/l,d=1/0,c=null;for(let h=0;h*3<t.length;h++){if(h===e)continue;let u=t[h*3]-r,b=t[h*3+2]-o,p=u*m+b*v;p<.3||p>1.6||Math.abs(u*v-b*m)>.6||p<d&&(d=p,c=a-t[h*3+1])}return c}var Zi=.25,Qi=1.5;function xr(t,e,n=0,r,a,o=!1){let i=[e.x*Le,n+Qi,e.y*Le],s=a?[a[0],a[1],a[2]]:i,l=t[1],m=Number.isFinite(l)?l+(o?Ki:br):Number.isFinite(r)?n+r:n+br,v=i[0]-t[0],d=i[2]-t[2],c=Math.hypot(v,d),h=c>.001?Math.min($i,c*Zi):0,u=c>.001?v/c:0,b=c>.001?d/c:0;return{eye:[t[0]+u*h,m,t[2]+b*h],focal:s}}var Ce=Math.PI/180,Ji=45,gn=80,Rt=70,es=1,ts=.99;function ns(t,e){if(!(t<es))return gn;if(!(Number.isFinite(e)&&e>0))return Rt;let n=2*Math.atan(e/(2*Tt*ts)/Math.max(.05,t))/Ce;return Math.max(Rt,Math.min(gn,n))}var os=.25,Tt=1,rs=.25,as=12*Ce,is=.2,ss=1.5,Sr=.8,wr=6,Rr=1.9,ls=2/3,cs=.12,us=.9,ds=1.2,ms=2,Tr=.05,hs=6;function _r(t,e,n=0){if(!t.length)return{min:[e[0]-6,n,e[2]-6],max:[e[0]+6,Math.max(n+Sr,e[1]),e[2]+6]};let r=1/0,a=-1/0,o=1/0,i=-1/0,s=n;for(let u of t)r=Math.min(r,u.cx-u.halfX),a=Math.max(a,u.cx+u.halfX),o=Math.min(o,u.cz-u.halfZ),i=Math.max(i,u.cz+u.halfZ),s=Math.max(s,u.y);let l=a-r,m=i-o,v=Math.max(l,Math.min(m,wr))/2,d=Math.max(m,Math.min(l,wr))/2,c=(r+a)/2,h=(o+i)/2;return{min:[c-v,n,h-d],max:[c+v,Math.max(n+Sr,s),h+d]}}function ps(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+Rr,t.max[2]]}}function yn(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+ss,e+is,e+Rr*ls),(t.min[2]+t.max[2])/2]}function Ir(t,e){let n=t[0]-e[0],r=t[2]-e[2],a=Math.hypot(n,r);return a<.001?{x:0,z:1}:{x:n/a,z:r/a}}function Mr(t,e,n){let r=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],i=Math.hypot(r,a,o)||1;r/=i,a/=i,o/=i;let s=-o,l=r,m=Math.hypot(s,l);if(m<1e-6)return 1/0;s/=m,l/=m;let v=1/0,d=-1/0;for(let c=0;c<8;c++){let h=(c&1?n.max[0]:n.min[0])-t[0],u=(c&2?n.max[1]:n.min[1])-t[1],b=(c&4?n.max[2]:n.min[2])-t[2],p=Math.max(Tr,h*r+u*a+b*o),x=(h*s+b*l)/p;x<v&&(v=x),x>d&&(d=x)}return d-v}function Pr(t,e,n){let r=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],i=Math.hypot(r,a,o)||1;r/=i,a/=i,o/=i;let s=-o,l=r,m=Math.hypot(s,l);if(m<1e-6)return 1/0;s/=m,l/=m;let v=-l*a,d=l*r-s*o,c=s*a,h=1/0,u=-1/0;for(let b=0;b<8;b++){let p=(b&1?n.max[0]:n.min[0])-t[0],x=(b&2?n.max[1]:n.min[1])-t[1],P=(b&4?n.max[2]:n.min[2])-t[2],S=Math.max(Tr,p*r+x*a+P*o),I=(p*v+x*d+P*c)/S;I<h&&(h=I),I>u&&(u=I)}return u-h}function _t(t,e){return Math.tan(t*Ce/2)*Math.max(.05,e)}function Ar(t,e,n){let r=ns(n,t),a=l=>Math.max(Ji,Math.min(r,l)),o=l=>2*Math.atan(l)/Ce,i=Number.isFinite(t)&&t>0?a(o(t/(2*os)/Math.max(.05,n))):r;if(!(Number.isFinite(e)&&e>0))return i;let s=Math.min(i,a(o(e/(2*cs))));return t/(2*_t(s,n))>Tt?i:s}function Fr(t,e,n,r={}){let a=yn(e),o=[t[0],t[1],t[2]],i=0,s=0,l=u=>{if(!(u>0))return;let b=Ir(o,a);o[0]+=b.x*u,o[2]+=b.z*u,s+=u},m=r.preserveEye?0:e.max[1]+rs-o[1];m>0&&(o[1]+=m,i=m,l(m/Math.tan(as)));let v=ps(e),d=Mr(o,a,e),c=Ar(d,Pr(o,a,v),n),h=d/(2*_t(c,n));for(let u=0;!r.preserveEye&&u<hs&&h>Tt;u++){let b=Math.max(1,Math.hypot(o[0]-a[0],o[2]-a[2])),p=Number.isFinite(h)?h/Tt:2;l(Math.min(60,b*(Math.min(4,p)-1)+.5)),d=Mr(o,a,e),c=Ar(d,Pr(o,a,v),n),h=d/(2*_t(c,n))}return{eye:o,focal:a,fov:c,raisedM:i,pulledBackM:s,stageFrameWidth:h}}function fs(t,e,n){let r=Math.tan(e*Ce/2),a=_t(e,n);return Math.max(1,t/Math.max(.05,Math.min(r,a)))}var vs=.7,Cr=.5,bs=.8;function Er(t,e,n){let r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],a=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],o=r[0]*a[0]+r[1]*a[1]+r[2]*a[2],i=Math.hypot(r[0],r[1],r[2])*Math.hypot(a[0],a[1],a[2])||1;return Math.acos(Math.max(-1,Math.min(1,o/i)))/Ce}function gs(t,e,n){let r=m=>{let v=Math.hypot(m[0],m[1],m[2])||1;return[m[0]/v,m[1]/v,m[2]/v]},a=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],o=Math.hypot(a[0],a[1],a[2]),i=r(a),s=r([n[0]-t[0],n[1]-t[1],n[2]-t[2]]),l=r([0,1,2].map(m=>i[m]*(1-Cr)+s[m]*Cr));return[t[0]+l[0]*o,t[1]+l[1]*o,t[2]+l[2]*o]}function Dr(t,e){let{aspect:n,venue:r}=e,a=t.focal,o=Ir(t.eye,a),i=b=>(b[0]-a[0])*o.x+(b[2]-a[2])*o.z,s=[{name:"seat",eye:t.eye,focal:a,fov:t.fov}],l=ms*(e.rowDepthM??us),m=[t.eye[0]+o.x*l,t.eye[1]+ds,t.eye[2]+o.z*l],v=[t.eye[0],t.eye[1]-vs,t.eye[2]],d=gs(m,a,v);s.push({name:"row",eye:m,focal:d,fov:Math.min(gn,Math.max(t.fov,2*Math.max(Er(m,d,v),Er(m,d,a))/bs))});let c=(b,p,x,P)=>{let S=fs(x,t.fov,n)*1.08,I=S*Math.sin(P*Ce),w=Number.isFinite(e.seatingTopY)?e.seatingTopY+2:-1/0,R=Math.max(I,w-p[1]),V=S*Math.cos(P*Ce);return{name:b,eye:[p[0]+o.x*V,p[1]+R,p[2]+o.z*V],focal:p,fov:t.fov}};e.section&&e.section.radius>0&&s.push(c("section",e.section.center,e.section.radius,35)),s.push(c("venue",r.center,Math.max(1,r.radius),40));let h=[],u=-1/0;for(let b of s){let p=i(b.eye);h.length&&p<=u+.5||(h.push(b),u=p)}return h}import{Vec3 as ys}from"ogl";var dt=Math.PI/180,xn=320,Vr=70*dt,xs=32*dt,Ss=24*dt,kr=.0026,ws=.22,Ms=.006,Ps=180,As=900,Cs=1100,Es=4,fe=(t,e,n)=>Math.max(e,Math.min(n,t)),Lr=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function Or(t){let{canvas:e,camera:n}=t,r=[],a=!1,o=0,i=0,s=0,l=0,m=0,v=0,d=xn,c=null,h=()=>{c&&(clearTimeout(c),c=null)},u=!1,b=[0,0],p=0,x=!1,P=null,S=null,I=new Map,w=!1,R=0,V=0,g=0,E=0,M=()=>a&&r.length?r[fe(Math.round(o),0,r.length-1)].name:null,D=()=>{let T=M();T!==P&&(P=T,t.onStopChange?.(T))},H=()=>{if(!a||!r.length)return;let T=r[fe(Math.floor(o),0,r.length-1)],C=r[fe(Math.ceil(o),0,r.length-1)],A=fe(o-Math.floor(o),0,1),X=(q,le)=>q+(le-q)*A,Q=[X(T.eye[0],C.eye[0]),X(T.eye[1],C.eye[1]),X(T.eye[2],C.eye[2])],ve=[X(T.focal[0],C.focal[0]),X(T.focal[1],C.focal[1]),X(T.focal[2],C.focal[2])],se=ve[0]-Q[0],be=ve[1]-Q[1],te=ve[2]-Q[2],me=Math.hypot(se,be,te)||1,he=Math.atan2(se,te),L=Math.asin(fe(be/me,-1,1)),J=he+i,K=fe(L+s,-80*dt,80*dt),ne=Math.cos(K)*me;se=Math.sin(J)*ne,be=Math.sin(K)*me,te=Math.cos(J)*ne,n.position.set(Q[0],Q[1],Q[2]),n.fov=X(T.fov,C.fov),n.updateProjectionMatrix(),n.lookAt(new ys(Q[0]+se,Q[1]+be,Q[2]+te)),t.onApplied?.()},F=()=>{if(!a||!r.length)return;let T=fe(Math.round(o),0,r.length-1);if(t.reducedMotion()){u=!1,o=T,H(),D(),t.requestRender();return}if(Math.abs(T-o)<.001){u=!1,D();return}l=o,m=T,v=performance.now(),d=xn,u=!0,t.requestRender()},z=T=>{!a||r.length<2||(h(),u=!1,o=fe(o+T,0,r.length-1),H(),D(),t.requestRender())},B=(T,C)=>{a&&(h(),u=!1,x=!1,i=fe(i-T*kr,-Vr,Vr),s=fe(s-C*kr,-Ss,xs),H(),t.requestRender())},U=T=>{a&&(I.set(T.pointerId,{x:T.clientX,y:T.clientY}),I.size===1?(w=!0,E=0,R=T.clientX,V=T.clientY):I.size===2&&(w=!1,g=W()))},W=()=>{let T=[...I.values()];return T.length<2?0:Math.hypot(T[0].x-T[1].x,T[0].y-T[1].y)},N=T=>{if(!a||!I.has(T.pointerId))return;if(I.set(T.pointerId,{x:T.clientX,y:T.clientY}),I.size>=2){let X=W();g>0&&z((g-X)*Ms),g=X;return}if(!w)return;let C=T.clientX-R,A=T.clientY-V;R=T.clientX,V=T.clientY,E+=Math.abs(C)+Math.abs(A),!(E<=Es)&&B(C,A)},ee=T=>{I.delete(T.pointerId)&&(I.size<2&&(g=0),I.size===0&&(w=!1,F()))},Z=T=>{if(!a)return;T.preventDefault();let C=T.deltaMode===1?16:T.deltaMode===2?100:1,A=fe(T.deltaY*C/100,-2,2);z(A*ws),S&&clearTimeout(S),S=setTimeout(()=>{S=null,F()},Ps)},Y=()=>{h(),a&&(a=!1,u=!1,x=!1,r=[],I.clear(),w=!1,S&&(clearTimeout(S),S=null),P!==null&&(P=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",U),e.addEventListener("pointermove",N),e.addEventListener("pointerup",ee),e.addEventListener("pointercancel",ee),e.addEventListener("wheel",Z,{passive:!1}),{get active(){return a},enter(T,C=0){if(T.length<2){Y();return}h(),r=T,a=!0,o=t.reducedMotion()?0:fe(C,0,T.length-1),o>0&&(c=setTimeout(()=>{c=null,a&&(l=o,m=0,v=performance.now(),d=Cs,u=!0,t.requestRender())},As)),i=0,s=0,u=!1,x=!1,P=null,H(),D(),t.requestRender()},exit:Y,recentre(){return a?Math.abs(i)<1e-4&&Math.abs(s)<1e-4?!0:t.reducedMotion()?(x=!1,i=0,s=0,H(),t.requestRender(),!0):(b=[i,s],p=performance.now(),x=!0,t.requestRender(),!0):!1},update(T){if(!a)return!1;let C=!1;if(x){let A=fe((T-p)/xn,0,1),X=1-Lr(A);i=b[0]*X,s=b[1]*X,A>=1?(x=!1,i=0,s=0):C=!0}if(u){let A=fe((T-v)/d,0,1);o=l+(m-l)*Lr(A),A>=1?(u=!1,o=m,D()):C=!0}return H(),C},currentStop:M,dispose(){Y(),e.removeEventListener("pointerdown",U),e.removeEventListener("pointermove",N),e.removeEventListener("pointerup",ee),e.removeEventListener("pointercancel",ee),e.removeEventListener("wheel",Z)}}}function zr(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var Sn=null;function Nr(){return Sn??=import("../openPanorama-VD6PE3YZ.js").catch(t=>{throw Sn=null,t}),Sn}var Hr=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),It=class{constructor(e){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=e}emit(e,n){if(this.cb)try{this.cb(e,n)}catch{}}opened(e,n,r,a){this.emit("3d_opened",{seats:e,hasHeights:n,...r===void 0?{}:{buildMs:Math.round(r)},...a===void 0?{}:{prepSource:a}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(e,n){this.emit("3d_seat_picked",{seatId:e,sectionId:n})}cinematicPlayed(e){this.emit("3d_cinematic_played",{durationMs:e,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=Hr(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(Hr()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:e})}panoramaFailed(e,n){this.emit("3d_panorama_failed",{seatId:e,phase:n})}panoramaFallback(e){this.emit("3d_panorama_fallback",{seatId:e})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function Gr(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function Br(t){let{container:e,model:n,opts:r,expandedSeatById:a,seatIdsByRow:o,isNarrow:i}=t,s=null,l=()=>{if(!s)return;let d=i();Object.assign(s.style,d?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},m=()=>{s?.remove(),s=null};return{show:(d,c,h=!1)=>{if(m(),t.isDisposed())return null;let u=document.createElement("div");u.setAttribute("role","group"),Object.assign(u.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let b=r.chrome?.caption!==!1,p=r.chrome?.seatStepper!==!1;if(!b&&!p)return null;let x=a.get(d),P=x?.sectionId?n.sections.find(M=>M.id===x.sectionId):void 0,S=x?.label??d;u.setAttribute("aria-label",`Explore views near ${P?.label?`${P.label}, `:""}seat ${S}`);let I=document.createElement("span");I.textContent=r.seatViewCaption?.(d)??["Live 3D seat view",P?.label,S].filter(Boolean).join(" \xB7 "),Object.assign(I.style,{maxWidth:"min(70vw, 560px)",padding:"5px 10px",borderRadius:"999px",overflow:"hidden",color:"#d9e3f5",background:"rgba(12,18,32,0.72)",font:"600 11px/1.2 inherit",textOverflow:"ellipsis",whiteSpace:"nowrap",backdropFilter:"blur(6px)"}),b&&u.appendChild(I);let w=document.createElement("div");Object.assign(w.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),u.appendChild(w);let R=x?.rowId?o.get(x.rowId):void 0,V=R?.indexOf(d)??-1,g=V>=0?[R?.[V-1],R?.[V+1]]:[void 0,void 0],E=(M,D,H,F=!1)=>{let z=document.createElement("button");z.type="button",z.textContent=M,z.setAttribute("aria-label",D),Object.assign(z.style,{minHeight:"44px",padding:F?"10px 16px":"10px",borderRadius:"999px",background:"rgba(12,18,32,0.78)",color:"#eef1f8",border:"1px solid rgba(150,165,205,0.4)",backdropFilter:"blur(6px)",font:"600 13px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"}),F||(z.style.minWidth="44px"),F&&(z.dataset.panoramaTrigger=""),z.addEventListener("click",H),w.appendChild(z)};if(p&&g[0]){let M=a.get(g[0])?.label??g[0];E("\u2039",`View previous seat ${M}`,()=>{t.flyToSeat(g[0])})}if(p&&r.getSeatView){let M=r.seatViewActionLabel?.(d)??"Open 360\xB0 panorama";E(h?`\u21BB Retry ${M}`:`\u25C9 ${M}`,`${h?"Retry":M} from seat ${S}`,()=>{if(t.isDisposed()||c!==t.flightGen()){m();return}m(),t.openPanorama(d,400,c)},!0)}if(p&&g[1]){let M=a.get(g[1])?.label??g[1];E("\u203A",`View next seat ${M}`,()=>{t.flyToSeat(g[1])})}return!w.childElementCount&&!b?null:(e.appendChild(u),s=u,l(),u)},remove:m,layout:l}}var Rs={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function Wr(t){let{container:e,orbit:n,isNarrow:r}=t,a={...Rs,...t.labels??{}},o=(w,R)=>{w.setAttribute("aria-label",R),w.title=R},i=document.createElement("div"),s=!1;i.className="sl-3d-navigation-controls",Object.assign(i.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D drag mode"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let m=document.createElement("div");m.setAttribute("role","group"),m.setAttribute("aria-label","3D view controls"),Object.assign(m.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let v=document.createElement("button");v.type="button",v.textContent="\u21BB",o(v,a.rotate);let d=document.createElement("button");d.type="button",d.textContent="\u2725",o(d,a.move);let c=document.createElement("button");c.type="button",c.textContent="\u2212",o(c,a.zoomOut);let h=document.createElement("button");h.type="button",h.textContent="+",o(h,a.zoomIn);for(let w of[v,d,c,h])w.className="sl-3d-icon-control",Object.assign(w.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",border:"1px solid rgba(150,165,205,0.35)",borderRadius:"999px",color:"#c9d4ea",background:"rgba(12,18,32,0.82)",font:"600 17px/1 inherit",backdropFilter:"blur(6px)",cursor:"pointer",whiteSpace:"nowrap"});l.append(v,d),m.append(h,c);let u=null,b=()=>{let w=n.dragAction();if(w===u)return;u=w;let R=w==="orbit";v.setAttribute("aria-pressed",String(R)),d.setAttribute("aria-pressed",String(!R)),v.style.background=R?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",d.style.background=R?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",i.title=R?`${a.rotate} \xB7 ${a.move} with Shift`:`${a.move} \xB7 ${a.rotate} with Shift`},p=w=>{n.setPrimaryDragMode(w),b()};v.addEventListener("click",()=>p("orbit")),d.addEventListener("click",()=>p("pan"));let x=()=>{let{atMin:w,atMax:R}=n.dollyLimitState();h.disabled!==w&&(h.disabled=w),c.disabled!==R&&(c.disabled=R)};c.addEventListener("click",()=>{n.zoomBy(nt),x()}),h.addEventListener("click",()=>{n.zoomBy(ze),x()}),i.append(l,m),p("auto"),e.appendChild(i);let P=t.enabled!==!1,S=()=>{let w=r();i.style.display=s||!P?"none":"flex",i.style.right=w?"12px":"14px",i.style.bottom=w?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",l.style.display=w?"none":"flex",h.style.display=w?"none":"",c.style.display=w?"none":""};return S(),{element:i,utilityControls:m,setNavigationMode:p,syncNavigationMode:b,syncZoomLimits:x,setSeatViewLocked:w=>{s=w,n.setInteractionEnabled(!w),S()},seatViewLocked:()=>s,layout:S}}var Ts=.5,Ur=12,Yr=20,_s=28;function Is(t,e,n){return!(t>0)||!(n>0)?0:Ts*n/(2*t*Math.tan(e*Math.PI/360))}function Xr(t){let{glctx:e,orbit:n,model:r,seats:a,opts:o,cinematic:i,analytics:s,seatIdByIndex:l,sectionIdBySeatId:m,tapSlop:v,tapMs:d,cancelFlight:c,focusSectionCamera:h,setSelection:u,ensureSeatView:b}=t,p=0,x=0,P=0,S=-1,I=!1,w=!1,R=F=>{t.seatViewLocked()||S===-1&&(S=F.pointerId,p=F.clientX,x=F.clientY,P=performance.now(),I=!1,w=i.active,i.active&&(s.cinematicCancelled(),c(),o.onViewTargetChange?.(null)))},V=F=>{F.pointerId===S&&Math.hypot(F.clientX-p,F.clientY-x)>v&&(I=!0)},g=(F,z,B,U,W)=>{let N=e.canvas.getBoundingClientRect(),ee=e.canvas.clientWidth||N.width||1,Z=e.canvas.clientHeight||N.height||1,Y=F-N.left,T=z-N.top,C=U*U,A=-1,X=C,Q=1/0;for(let ve of a){if(B&&ve.sectionId!==B)continue;let se=r.seats.idToIndex.get(ve.id);if(se===void 0)continue;if(W){let J=Math.round(r.seats.iState[se]??0);if(J!==0&&J!==3)continue}let be=se*3,te=Me(n.camera.projectionViewMatrix,[r.seats.iPosition[be],r.seats.iPosition[be+1]+.55,r.seats.iPosition[be+2]],ee,Z);if(!te.visible)continue;let me=te.x-Y,he=te.y-T,L=me*me+he*he;(L<X||Math.abs(L-X)<1&&te.depth<Q)&&(A=se,X=L,Q=te.depth)}return A},E=(F,z)=>{let B=t.gpu(),U=t.pick();if(!B||!U)return-1;U.syncFromSeatProgram(B.seatProgram);let W=e.canvas.getBoundingClientRect(),N=e.renderer.dpr,{x:ee,y:Z}=sr(F,z,W,N,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),Y=Math.max(2,Math.round(8*N));return U.pick(n.camera,ee,Z,Y)},M=()=>e.canvas.clientHeight||e.canvas.getBoundingClientRect().height,D=(F,z=Ur)=>{let B=n.camera?.position;if(!B)return!1;let U=F*3,W=Math.hypot(B.x-r.seats.iPosition[U],B.y-r.seats.iPosition[U+1],B.z-r.seats.iPosition[U+2]);return Is(W,n.fovY,M())>=z};return{onDown:R,onMove:V,onUp:F=>{if(F.pointerId!==S)return;let z=!I&&performance.now()-P<d;if(S=-1,w){w=!1;return}let B=t.gpu(),U=t.pick();if(!z||!B||!U)return;let W=E(F.clientX,F.clientY),N=F.pointerType==="touch"||F.pointerType==="pen",ee=N?Yr:Ur,Z=W>=0&&D(W,ee),Y=!1;if(t.focusedSectionId()&&W>=0){let A=l[W],X=A?m.get(A):void 0;if(X&&X!==t.focusedSectionId()&&h(X,{keepCamera:Z})){if(!Z)return;Y=!0}}if(t.focusedSectionId()&&W<0&&(W=g(F.clientX,F.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&W<0){let A=g(F.clientX,F.clientY,null,72,!1),X=A>=0?l[A]:void 0,Q=X?m.get(X):void 0;if(Q&&Q!==t.focusedSectionId()&&h(Q))return}if(!t.focusedSectionId()){W<0&&(W=g(F.clientX,F.clientY,null,42,!1));let A=W>=0?l[W]:void 0,X=A?m.get(A):void 0;if(X&&h(X,{keepCamera:Z})){if(!Z)return;Y=!0}}if(W<0||W>=l.length){t.selection().size&&(u([]),o.onViewTargetChange?.(null));return}let T=l[W];if(N&&t.focusedSectionId()&&!Y&&!D(W,Yr)){t.focusSeatCamera(T,{seatPx:_s,viewportHeightPx:M()});return}let C=ye[Math.round(r.seats.iState[W]??0)]??"available";if(C!=="available"&&C!=="selected"){o.onSeatInspect?.(T,C);return}if(t.selection().has(T)&&t.selection().size===1){u([]),o.onViewTargetChange?.(null),o.onSeatPick?.(T);return}u([T]),b(T),s.seatPicked(T,m.get(T)),o.onSeatPick?.(T)}}}var Ft=class{constructor(e,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=e,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let e=this.iPosition,n=1/0,r=1/0,a=-1/0,o=-1/0;for(let h=0;h<this.count;h++){let u=e[h*3],b=e[h*3+2];u<n&&(n=u),u>a&&(a=u),b<r&&(r=b),b>o&&(o=b)}let i=Math.max(a-n,.001),s=Math.max(o-r,.001);this.cell=Math.max(Math.sqrt(i*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(i/this.cell)+1),this.rows=Math.max(1,Math.ceil(s/this.cell)+1),this.minX=n,this.minZ=r;let l=this.cols*this.rows,m=new Int32Array(l+1),v=h=>{let u=Math.min(this.cols-1,Math.max(0,Math.floor((e[h*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[h*3+2]-r)/this.cell)))*this.cols+u};for(let h=0;h<this.count;h++)m[v(h)+1]++;for(let h=0;h<l;h++)m[h+1]+=m[h];let d=new Int32Array(this.count),c=m.slice(0,l);for(let h=0;h<this.count;h++)d[c[v(h)]++]=h;this.cellStart=m,this.cellItems=d}gather(e,n,r,a,o){this.ensureGrid();let i=this.cellStart,s=this.cellItems;if(!i||!s)return 0;let l=a.length,m=r*r,v=Math.floor((e-this.minX)/this.cell),d=Math.floor((n-this.minZ)/this.cell),c=Math.ceil(r/this.cell)+1,h=this.iPosition,u=0;for(let b=0;b<=c&&u<l;b++){let p=d-b,x=d+b,P=v-b,S=v+b;for(let I=p;I<=x&&u<l;I++){if(I<0||I>=this.rows)continue;let w=I===p||I===x;for(let R=P;R<=S&&u<l;R++){if(!w&&R!==P&&R!==S){R=S-1;continue}if(R<0||R>=this.cols)continue;let V=I*this.cols+R;for(let g=i[V],E=i[V+1];g<E&&u<l;g++){let M=s[g],D=h[M*3]-e,H=h[M*3+2]-n,F=o===void 0?0:h[M*3+1]-o;D*D+F*F+H*H<=m&&(a[u++]=M)}}}}return u}};var Dt=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Mt);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Ft(e.model.seats.iPosition,e.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(e){let n=this.ctx.gpu();e||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!e&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(e){let{model:n}=this.ctx,r=this.ctx.gpu();if(!r)return;if(!e){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let a=this.ctx.orbit().camera.position;if(Math.hypot(a.x-this.lastGatherX,a.y-this.lastGatherY,a.z-this.lastGatherZ)<on)return;if(this.lastGatherX=a.x,this.lastGatherY=a.y,this.lastGatherZ=a.z,Math.hypot(a.x-n.bounds.center[0],a.y-n.bounds.center[1],a.z-n.bounds.center[2])-n.bounds.radius>nn){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(a.x,a.z,nn,this.nearBuf,a.y);s===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,s)}ease(e,n,r){let a=1-Math.exp(-e*9),o=1-Math.exp(-e*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?a:o),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?a:o),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};function qr(t){let e=Math.max(5,t.radius),n=t.focalWorld[0]-t.center[0],r=t.focalWorld[2]-t.center[2],a=Math.hypot(n,r);if(a<e*.12)return{center:t.center,radius:e,polarDeg:48};let o=Math.min(a*.25,e*.2);return{center:[t.center[0]+n/a*o,t.center[1],t.center[2]+r/a*o],radius:e+o,polarDeg:50}}import{Quat as Fs,Vec3 as Ds}from"ogl";function jr(){let t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","18"),e.setAttribute("height","18"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round");let n=document.createElementNS(t,"path");return n.setAttribute("d","M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 0 2 2v3M8 21H5a2 2 0 0 0-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3"),e.appendChild(n),e}function $r(t){let{container:e,model:n,opts:r,orbit:a,cinematic:o,analytics:i,loop:s,labelOverlay:l,stageAzimuth:m,overviewFraming:v}=t,d=0,c=-1,h=(M,D,H=28)=>{a.camera.position.set(M[0],M[1],M[2]),a.camera.lookAt(new Ds(D[0],D[1],D[2])),a.camera.fov=H,a.camera.updateProjectionMatrix()},u=document.createElement("button");u.className="sl-3d-overview-control sl-3d-icon-control",u.type="button",u.replaceChildren(jr());let b=r.navLabels?.fitView??"Show whole venue";u.setAttribute("aria-label",b),u.title=b,Object.assign(u.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",borderRadius:"999px",background:"rgba(12,18,32,0.72)",color:"#c9d4ea",border:"1px solid rgba(150,165,205,0.35)",backdropFilter:"blur(6px)",font:"600 11px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"});let p=()=>{u.firstElementChild||u.replaceChildren(jr())};p();let x=M=>{c=M;let D=t.gpu();D&&(D.seatProgram.uniforms.uFocusFloor.value=M,D.solidProgram.uniforms.uFocusFloor.value=M,D.chairProgram.uniforms.uFocusFloor.value=M),t.showSectionSeatLabels(null)},P=null,S=!1,I=()=>{if(P=null,S=!1,t.setSeeThrough?.(null),t.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),i.panoramaClosed()),t.setPanoramaSphereVisible(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.restorePanoramaLayer(),u.style.display="",l.setVisible(!0),t.setFrozen(!1);let M=c>=0?n.floors[c]:null;if(t.setNearFieldDetailEnabled(!!M),t.setSeatViewLocked(!1),w(),t.removeArriveChip(),t.setNavigationMode("auto"),M){let D=M.focalWorld[0]-M.center[0],H=M.focalWorld[2]-M.center[2],F=Math.hypot(D,H)>M.radius*.12?Math.atan2(D,H):m,z={center:M.center,radius:M.radius,box:M.box},B={polarDeg:58,margin:1.12};t.reducedMotion()?a.frame(z,!1,F,!1,B):a.frameSoft(z,F,!1,B)}else t.reducedMotion()?a.frame(n.bounds,!1,m,r.portraitOverviewCrop===!0,v):a.frameSoft(n.bounds,m,r.portraitOverviewCrop===!0,v);l.setOverviewDistance(a.targetDistance),t.showSectionSeatLabels(null),s.requestRender()},w=()=>{d++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),o.active&&(o.cancel(),a.resumeAfterFlight(n.focalWorld))},R=M=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let D=n.seats.idToIndex.get(M);if(D===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(M),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),t.setPanoramaSphereVisible(!1),u.style.display="",t.restorePanoramaLayer()),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.setFrozen(!1);let H=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(H),t.setSeatViewLocked(!1);let F=++d;H?t.showArriveChip(M,F):t.removeArriveChip();let{eye:z,focal:B}=t.resolvedSeatViewPose(M,D),U=r.arriveAtSeatEye?t.seatViewArrival(M,D):null,W=U&&U.stops.length>1&&U.stops[1].name==="row"?U.stops[1]:null,N=U?U.focal:B,ee=[a.camera.position.x,a.camera.position.y,a.camera.position.z],Z=vn(ee,U?.eye??z,N,n.bounds.center,n.bounds.radius),Y=W?W.eye:U?U.eye:r.arriveAtSeatEye?z:Z.finalPos,T=U?U.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?Rt:65:28,C=[Z.waypoints[0],Z.waypoints[1],Y];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),h(Y,N,T),s.requestRender(),i.cinematicSkipped(),t.isDisposed()||a.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),U&&t.enterSeatView(U.stops),t.showArriveChip(M,F),Promise.resolve();let A=new Fs().copy(a.camera.quaternion),X=vr(a.camera,Y,N);s.requestRender();let Q=H?700:2500;return o.start(C,A,X,Q,T).then(()=>{t.isDisposed()||F!==d||(t.setSeatStepping(!1),i.cinematicPlayed(Q),a.resumeAfterFlight(N),t.setSeatViewLocked(r.arriveAtSeatEye===!0),U&&t.enterSeatView(U.stops,W?1:0),s.requestRender(),t.showArriveChip(M,F))})},V=(M,D)=>{let H=n.sections.find(F=>F.id===M);if(!H||H.seatCount===0)return!1;if(P=M,S=!1,t.setSeeThrough?.(null),t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),o.cancel(),t.removeArriveChip(),n.floors.length>1&&c!==H.floorIndex&&x(H.floorIndex),t.setNavigationMode("auto"),t.panorama()||l.setVisible(!0),t.showSectionSeatLabels(M),!D?.keepCamera){let F=qr(H),z={polarDeg:F.polarDeg,margin:1.12};t.reducedMotion()?a.frame({center:F.center,radius:F.radius},!1,a.currentAzimuth,!1,z):a.glideTo({center:F.center,radius:F.radius},z)}return r.onSectionFocusChange?.(M),s.requestRender(),!0},g=(M,D)=>{if(t.isDisposed()||!t.gpu())return!1;let H=n.seats.idToIndex.get(M);if(H===void 0)return!1;let F=H*3,z=[n.seats.iPosition[F],n.seats.iPosition[F+1]+.55,n.seats.iPosition[F+2]],B=D?Vs(D,a.fovY,a.camera.aspect||1):Kr;return S=!0,t.setSeeThrough?.(z),t.reducedMotion()?a.frame({center:z,radius:B},!1,void 0,!1,wn):a.frameSoft({center:z,radius:B},void 0,!1,wn),s.requestRender(),!0},E=()=>{if(t.isNarrow?.()&&S&&P&&V(P)){s.requestRender();return}I()};return u.addEventListener("click",E),{overviewChip:u,layoutOverviewChip:p,flightGen:()=>d,focusedFloor:()=>c,applyFloorFocus:x,placeCameraFinal:h,cancelFlight:w,focusOverview:I,flyToSeat:R,focusSectionCamera:V,focusSeatCamera:g}}var Kr=4.5;function Vs(t,e,n){let r=Math.tan(e*Math.PI/360),a=r*Math.max(.001,n),i=ks*t.viewportHeightPx/(2*Math.max(1,t.seatPx)*r)*Math.min(r,a)/wn.margin;return Math.max(Ls,Math.min(Kr,i))}var ks=.5,Ls=1.5,wn={polarDeg:48,margin:1.25};function Mn(t,e,n,r,a,o,i,s,l=.5){let m=-1,v=s*s,d=1/0;for(let c=0;c<e;c++){let h=c*3,u=Me(n,[t[h],t[h+1]+l,t[h+2]],r,a);if(!u.visible)continue;let b=u.x-o,p=u.y-i,x=b*b+p*p;(x<v-4||x<v+4&&u.depth<d)&&(m=c,v=Math.min(v,x),d=u.depth)}return m}function Zr(t){let e=performance.now(),{input:n,estimate:r}=lo(t);return{model:tt(n),buildMs:performance.now()-e,source:"main",...r?{estimate:r}:{}}}function Os(t){let e=Wn(t.doc);return{...Zr({...t,seats:e}),seats:e}}function Qr(t,e,n){if(typeof Worker>"u")return Promise.resolve(e());let r;try{r=new Worker(new URL("./scene/scene.worker.js",import.meta.url),{type:"module"})}catch{return Promise.resolve(e())}return new Promise(a=>{let o=!1,i=m=>{o||(o=!0,clearTimeout(l),r.terminate(),a(m))},s=()=>i(e()),l=window.setTimeout(s,15e3);r.onerror=s,r.onmessage=m=>{let v=n(m.data);v?i(v):s()},r.postMessage(t)})}function zs(t){return Qr(t,()=>Zr(t),({model:e,buildMs:n,estimate:r})=>({model:e,buildMs:n,source:"worker",...r?{estimate:r}:{}}))}function Ns(t){return Qr(t,()=>Os(t),({model:e,buildMs:n,seats:r,estimate:a})=>r?{model:e,buildMs:n,seats:r,source:"worker",...a?{estimate:a}:{}}:null)}var Gs=40,Bs=48,Ws=Math.PI/180,Us=6,Ys=500,Xs=6;function yu(t,e,n={}){let r=performance.now(),a=e.prepared?e.prepared.estimate:e.estimate===!1?null:Kt(e.doc,e.seats);a&&(e={...e,doc:a.doc,seats:so(e.seats,a)});let o=e.prepared?.model??tt(e),i=new It(n.onAnalytics),s=new Array(o.seats.count);for(let[f,y]of o.seats.idToIndex)s[y]=f;let l=new Map(e.seats.map(f=>[f.id,f])),m=new Map;for(let f of e.seats){if(!f.rowId)continue;let y=m.get(f.rowId);y?y.push(f.id):m.set(f.rowId,[f.id])}let v=new Map,d=[0,0,0,0];function c(){if(p)for(let f of[p.seatProgram,p.solidProgram,p.chairProgram])f.uniforms.uSeeThrough.value=d}e.seats.forEach((f,y)=>{v.set(f.id,o.seatSectionIds?.[y]??f.sectionId)});let h=new Map;for(let[f,y]of o.seats.idToIndex){let _=v.get(f);if(!_)continue;let O=h.get(_);O?O.push(y):h.set(_,[y])}let u=()=>{if(!p||!o.sectionSolidRanges.length)return;let{lit:f,anyUnlit:y}=er(o.sectionSolidRanges,h,o.seats.iState);p.setSectionShellLit(y?f:null)},b=e.doc.floors?.some(y=>(y.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(y=>y.objects)??e.doc.objects).some(y=>y.type==="section"&&((y.height??0)>0||(y.rake??0)>0)),p=null,x=null,P=null,S=!1,I=!1,w=!1,R=new Map,V=null,g=null,E=null,M=new Map,D=null,H=()=>{E===null&&(E=t.style.zIndex,t.style.zIndex="20")},F=()=>{E!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=E),E=null)},z=!1,B=()=>z?pe.focusedFloor():-1,U=()=>{p=ar(C.gl,o),x?.dispose(),x=Io(C.gl,[1,1,1],o.theme.seatStates.selected),In(!1),u(),Pn(),P=new Ct(C.renderer,p.seatGeometry,p.chairGeometry,p.solidGeometry,o.seats.count),C.setClearColor(o.theme.background.top),P.setRestoreClear(o.theme.background.top),P.setRoomCentre(o.room?.centre),p.seatProgram.uniforms.uSeatRadius.value=Je*o.theme.seatScale,p.seatProgram.uniforms.uFocusFloor.value=B(),p.solidProgram.uniforms.uFocusFloor.value=B(),p.chairProgram.uniforms.uFocusFloor.value=B(),p.screenProgram&&(p.screenProgram.uniforms.uFocusFloor.value=B()),c(),N.forceRegather()},W=!1,N=new Dt({model:o,orbit:()=>A,gpu:()=>p}),ee=!1,Z=new Map,Y=24,T=f=>N.setDetailEnabled(f),C=new xt(t,{onContextLost:()=>{w||i.contextLost(),S=!0,ae.stop(),p=null,P=null},onContextRestored:()=>{U(),S=!1,w||i.contextRestored(),ae.requestRender()}}),A=new St(C.gl,C.canvas,()=>ae.requestRender(),()=>i.orbitEngaged());A.setAspect(C.aspect);let X=(e.doc.floors?.flatMap(f=>f.objects)??e.doc.objects).some(f=>f.type==="section"&&f.physical3dProvenance?.surfaceKind?.status==="inferred"),Q=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(X&&o.stages.length===0))return co(o.focalWorld,o.seats.iPosition,o.bounds)})(),ve=(e.doc.floors?.flatMap(f=>f.objects)??e.doc.objects).some(f=>f.type==="shape"&&f.stageKind?.startsWith("pitch-")),se=o.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:ve?36:48,margin:1.05},be=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;A.frame(o.bounds,!be&&n.skipInitialOverviewAnimation!==!0,Q,n.portraitOverviewCrop===!0,se);let te=new Et(A.camera),me=Gr(t),he=uo(t,o),L=new Pt(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:o.theme.background.top}),J=o.labels,K=()=>Zn(J,o.floors.length,B());L.setLabels(K()),L.setOverviewDistance(A.targetDistance);let ne=()=>{let f=new Map,y=ye.indexOf("available");for(let _ of J){if(!_.wheelchairSeats)continue;let O=0;for(let G of _.wheelchairSeats)o.seats.iState[G]===y&&O++;O>0&&f.set(_.id,O)}return L.setWheelchairFree(f)};ne();let q=null,le=()=>[...R.keys()].flatMap(f=>{let y=o.seats.idToIndex.get(f),_=y===void 0?void 0:e.seats[y];if(y===void 0||_?.id!==f)return[];let O=y*3;return[{id:`seat:${f}`,kind:"seat",seatWidthM:o.seats.iChairWidth[y]*2,text:_.displayLabel||_.label,anchor:[o.seats.iPosition[O],o.seats.iPosition[O+1]+1.05,o.seats.iPosition[O+2]],pinBase:kt(O)}]}),mt=-1,Pn=()=>{p&&(mt=q?o.sections.findIndex(f=>f.id===q):-1,p.seatProgram.uniforms.uFocusSection.value=mt,p.chairProgram.uniforms.uFocusSection.value=mt)},ht=f=>{if(q=f,Pn(),L.setForcedDense(!!f),!f){let k=le(),ie=new Set(k.map(re=>re.id));L.setLabels([...K().filter(re=>!ie.has(re.id)),...k]);return}let y=e.seats.filter(k=>v.get(k.id)===f),_=new Set(y.map(k=>k.id)),O=new Set(y.map(k=>k.rowId)),G=new Set(R.keys()),j=new Set(y.filter(k=>G.has(k.id)).map(k=>k.id)),$=K().filter(k=>k.kind!=="row"&&k.kind!=="seat"&&k.kind!=="access"||k.kind==="access"&&_.has(k.id.slice(7))||(k.kind==="row"?O.has(k.id.slice(4)):_.has(k.id.slice(5))));if(o.seatCount<=6e3&&j.size===0){L.setLabels($);return}let oe=y,de=new Set(oe.map(k=>`seat:${k.id}`)),ge=oe.flatMap(k=>{let ie=o.seats.idToIndex.get(k.id);if(ie===void 0)return[];let re=ie*3;return[{id:`seat:${k.id}`,kind:"seat",seatWidthM:o.seats.iChairWidth[ie]*2,rowId:k.rowId,text:G.has(k.id)?k.displayLabel||k.label:io(k.displayLabel||k.label),anchor:[o.seats.iPosition[re],o.seats.iPosition[re+1]+(G.has(k.id)?1.05:.55),o.seats.iPosition[re+2]],...G.has(k.id)?{pinBase:kt(re)}:{}}]});L.setLabels([...$.filter(k=>!de.has(k.id)),...ge])};U();let Se=null,Vt=null,An=new Hs,pt=f=>{if(S||!p||I)return!1;let y=zr({flying:te.active,panoramaMounted:V!==null,seatViewActive:Se?.active===!0}),_=y==="orbit"?mt:-1;p.seatProgram.uniforms.uFocusSection.value=_,p.chairProgram.uniforms.uFocusSection.value=_;let O=ee?!1:y==="cinematic"?te.update(performance.now()):y==="seatView"?Se.update(performance.now()):y==="orbit"?A.update():!1;Vt?.syncZoomLimits(),Vt?.syncNavigationMode();let G=B()>=0?o.floors[B()]:null,j=G?.radius??o.bounds.radius,$=Ao(A.currentDistance,j),oe=W?{center:[A.camera.position.x,A.camera.position.y,A.camera.position.z],radius:520}:o.clipBounds??o.renderBounds;A.updateClipping(oe);let de=G?.center??o.renderBounds.center,ge=G?.radius??o.renderBounds.radius,k=(ce,Yt)=>Math.hypot(A.camera.position.x-ce[0],A.camera.position.y-ce[1],A.camera.position.z-ce[2])<=Yt*(N.detailVisible?1.8:1.55),ie=k(de,ge);if(!ie&&q){let ce=o.sections.find(Yt=>Yt.id===q);ce&&(ie=k(ce.center,Math.max(12,ce.radius*2)))}N.detailVisible=ie;let re=p.seatProgram.uniforms;re.uSeatScale.value=$.scale,re.uSeatFade.value=$.fade;let xe=!!G&&Co(G.seatCount,C.canvas.clientWidth||1,C.canvas.clientHeight||1),Te=Eo(o.seats.count,j,A.currentDistance,A.camera.fov,C.canvas.clientHeight||1),$e=N.detailVisible||xe||Te?1:0,Ke=N.detailVisible||B()>=0||o.floors.length>1?1:0;N.ease(f,$e,Ke),re.uSeatDetail.value=N.seatDetailMix;let bt=$e===0&&N.seatDetailMix<.01;p.seatGeometry.setDrawRange(bt?Zt:0,bt?mo:Zt),p.solidProgram.uniforms.uStructureDetail.value=N.structureDetailMix,re.uMinPixels.value=$.minPixels,re.uPixelToWorld.value=2*Math.tan(A.camera.fov*Ws/2)/Math.max(1,C.pixelHeight),N.update(N.detailVisible),o.outdoor&&(An.copy(A.camera.projectionViewMatrix).inverse(),p.backgroundProgram.uniforms.uInvViewProj.value.set(An)),C.renderer.render({scene:p.background,clear:!0}),C.renderer.render({scene:p.main,camera:A.camera,clear:!1});let Ze=x?x.update(performance.now(),[A.camera.position.x,A.camera.position.y,A.camera.position.z],V!==null,y==="seatView"):!1;if(x&&C.renderer.render({scene:x.root,camera:A.camera,clear:!1}),he){let ce=A.camera.worldMatrix;he.update(y==="seatView"?[A.camera.position.x,A.camera.position.y,A.camera.position.z]:null,[-ce[8],-ce[9],-ce[10]])}L.update(A.camera.projectionViewMatrix,C.canvas.clientWidth||1,C.canvas.clientHeight||1,A.currentDistance,j,[A.camera.position.x,A.camera.position.y,A.camera.position.z]);let ke=O||Ze||N.seatDetailMix!==$e||N.structureDetailMix!==Ke;return Cn(!ke),ke},Cn=xo(t),ae=new wt(pt),En=typeof ResizeObserver<"u"?new ResizeObserver(()=>Ut.resize()):null;En?.observe(t),A.setZoomPointResolver((f,y)=>{let _=C.canvas.getBoundingClientRect(),O=C.canvas.clientWidth||_.width,G=C.canvas.clientHeight||_.height;if(!(O>0)||!(G>0))return null;A.camera.updateMatrixWorld();let j=Mn(o.seats.iPosition,o.seats.count,A.camera.projectionViewMatrix,O,G,f-_.left,y-_.top,Gs);if(j<0)return null;let $=j*3;return[o.seats.iPosition[$],o.seats.iPosition[$+1]+.5,o.seats.iPosition[$+2]]});function kt(f){return[o.seats.iPosition[f],o.seats.iPosition[f+1]+.5,o.seats.iPosition[f+2]]}L.setSeatNumberRow(null);let we=null,Ee=0,Lt=null,Rn=()=>{Ee=0;let f=null,y=null;if(we&&!Se?.active&&!te.active){let G=C.canvas.getBoundingClientRect(),j=C.canvas.clientWidth||G.width,$=C.canvas.clientHeight||G.height;if(j>0&&$>0){let oe=Mn(o.seats.iPosition,o.seats.count,A.camera.projectionViewMatrix,j,$,we.x-G.left,we.y-G.top,Bs);f=oe>=0?e.seats[oe]?.rowId??null:null;let de=oe>=0?e.seats[oe]?.id??null:null;if(y=de,we.mouse&&!we.pressing&&!!q&&!!de&&v.get(de)===q){let k=t.getBoundingClientRect();Lt=de,n.onSeatHover?.(de,{x:we.x-k.left,y:we.y-k.top})}else Tn()}}else Tn();let _=we?.mouse?y:null,O=L.setSeatNumberSeat(_);(L.setSeatNumberRow(f)||O)&&ae.requestRender()};function Tn(){Lt!==null&&(Lt=null,n.onSeatHover?.(null,null))}let ft=f=>{we={x:f.clientX,y:f.clientY,mouse:f.pointerType==="mouse",pressing:f.type==="pointerdown"},Ee||(Ee=requestAnimationFrame(Rn))},_n=f=>{f.pointerType==="mouse"&&(we=null,Ee||(Ee=requestAnimationFrame(Rn)))};C.canvas.addEventListener("pointermove",ft),C.canvas.addEventListener("pointerdown",ft),C.canvas.addEventListener("pointerleave",_n);function In(f){if(!x)return;let y=[];for(let _ of R.keys()){let O=o.seats.idToIndex.get(_);if(O===void 0)continue;let G=O*3,j=kt(G),$=Math.atan2(o.focalWorld[0]-j[0],o.focalWorld[2]-j[2]);y.push({id:_,position:j,facing:$})}x.setSeats(y,performance.now(),f)}let Fn=f=>{let y=G=>{let j=o.seats.idToIndex.get(G);return j===void 0?void 0:o.seats.iState[j]},{updates:_,next:O}=cr(R,f,y);if(R=O,L.setSelectedSeatIds(R.keys()),In(!Xe()),ae.requestRender(),ht(q),_.length){let G=jt(o.seats,_);p&&p.uploadSeatStateRuns(G),u(),ae.requestRender()}},Xe=()=>D!==null?D:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Jr=8,Dn=f=>{if(!n.getSeatView)return null;let y=M.get(f);if(!y)for(y=Promise.resolve(n.getSeatView(f)),M.set(f,y),y.catch(()=>{M.get(f)===y&&M.delete(f)});M.size>Jr;){let _=M.keys().next().value;if(_===void 0)break;M.delete(_)}return y},Vn=_r(o.stages,o.focalWorld,o.bounds.groundY??0),kn=yn(Vn),Ot=(f,y)=>{let _=l.get(f),O=Math.max(0,Math.round(o.seats.iFloor[y]??0)),G=e.doc.floors?.[O],j=o.floors[O],$=G?.focalPoint??e.doc.focalPoint,oe=j?{x:j.focalWorld[0]/Le,y:j.focalWorld[2]/Le}:$,de=_?.focalPoint?{x:_.focalPoint.x+oe.x-$.x,y:_.focalPoint.y+oe.y-$.y}:oe,ge=[o.seats.iPosition[y*3],o.seats.iPosition[y*3+1],o.seats.iPosition[y*3+2]],k=yr(o.seats.iPosition,y,kn),ie=k!==null&&Math.abs(k)<gr;return xr(ge,de,G?.baseHeightM??0,_?.eyeHeightM,kn,ie)},zt=()=>(t.clientWidth||C.canvas.clientWidth)<=520,Nt=null,Ln=null,ea=async(f,y,_)=>{if(!n.getSeatView||w||_!==pe.flightGen())return;let O;try{O=await Nr()}catch{if(i.panoramaFailed(f,"mount"),!w&&_===pe.flightGen()){let G=Gt(f,_,!0);requestAnimationFrame(()=>G?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(w||_!==pe.flightGen()||!Nt))return Ln??=O.createOpenPanorama(Nt),Ln(f,y,_)},Ht=Br({container:t,model:o,opts:n,expandedSeatById:l,seatIdsByRow:m,isNarrow:zt,isDisposed:()=>w,flightGen:()=>pe.flightGen(),flyToSeat:f=>Gn(f),openPanorama:(f,y,_)=>ea(f,y,_)}),Gt=Ht.show,Bt=Ht.remove,ta=Ht.layout,Re=Wr({container:t,orbit:A,isNarrow:zt,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});Vt=Re;let na=Re.element,qe=Re.setNavigationMode,oa=Re.layout,ra=Re.utilityControls,je=null,On=!1,vt=f=>{Re.setSeatViewLocked(f),f||Se?.exit()};Se=Or({canvas:C.canvas,camera:A.camera,requestRender:()=>ae.requestRender(),reducedMotion:Xe,onStopChange:f=>{let y=f??(On?"seat":null);je=y;try{n.onSeatViewStopChange?.(y)}catch{}},onApplied:()=>{w||A.syncFromCamera()}});let zn=o.sections.reduce((f,y)=>y.seatCount>0&&y.box?Math.max(f,y.box.max[1]):f,-1/0),Nn=(f,y)=>{let{eye:_}=Ot(f,y),O=(t.clientWidth||C.canvas.clientWidth||1)/Math.max(1,t.clientHeight||C.canvas.clientHeight||1),G=Fr(_,Vn,O,{preserveEye:!0});if(n.seatViewStops===!1)return{...G,stops:[]};let j=v.get(f),$=j?o.sections.find(oe=>oe.id===j):void 0;return{...G,stops:Dr(G,{aspect:O,seatingTopY:Number.isFinite(zn)?zn:o.bounds.box.max[1],section:$&&$.seatCount>0?{center:$.center,radius:$.radius}:null,venue:{center:o.bounds.center,radius:o.bounds.radius}})}},pe=$r({isNarrow:zt,setSeeThrough:f=>{d=f?[f[0],f[1],f[2],Xs]:[0,0,0,0],c(),ae.requestRender()},container:t,model:o,opts:n,orbit:A,cinematic:te,analytics:i,loop:ae,labelOverlay:L,stageAzimuth:Q,overviewFraming:se,gpu:()=>p,isDisposed:()=>w,panorama:()=>V,setPanorama:f=>{V=f},setPanoramaSphereVisible:f=>{W=f},panoramaLoadAbort:()=>g,setPanoramaLoadAbort:f=>{g=f},setFrozen:f=>{I=f},restorePanoramaLayer:F,reducedMotion:Xe,resolvedSeatViewPose:Ot,showSectionSeatLabels:ht,setNearFieldDetailEnabled:T,setSeatViewLocked:vt,setNavigationMode:qe,showArriveChip:Gt,removeArriveChip:Bt,inSeatView:()=>je!==null,setSeatStepping:f=>{On=f},seatViewArrival:(f,y)=>n.arriveAtSeatEye?Nn(f,y):null,enterSeatView:(f,y)=>Se?.enter(f,y)});z=!0;let Wt=pe.overviewChip,aa=pe.layoutOverviewChip,ia=pe.applyFloorFocus,sa=pe.focusOverview,Hn=pe.cancelFlight,Gn=pe.flyToSeat,Bn=pe.focusSectionCamera;ra.appendChild(Wt),Nt={container:t,model:o,opts:n,analytics:i,orbit:A,loop:ae,seatsById:l,ensureSeatView:Dn,resolvedSeatViewPose:Ot,gpu:()=>p,gl:C.gl,isContextLost:()=>S,isDisposed:()=>w,flightGen:()=>pe.flightGen(),setPanorama:f=>{V=f},getLoadAbort:()=>g,setLoadAbort:f=>{g=f},setPanoramaSphereVisible:f=>{W=f,f&&Se?.exit()},setFrozen:f=>{I=f},raisePanoramaLayer:H,restorePanoramaLayer:F,getOverviewChip:()=>Wt,labelOverlay:L,reducedMotion:Xe,removeArriveChip:Bt,showArriveChip:Gt};let Ae=Xr({glctx:C,orbit:A,model:o,seats:e.seats,opts:n,cinematic:te,analytics:i,seatIdByIndex:s,sectionIdBySeatId:v,tapSlop:Us,tapMs:Ys,gpu:()=>p,pick:()=>P,seatViewLocked:()=>Re.seatViewLocked(),focusedSectionId:()=>q,selection:()=>R,cancelFlight:Hn,focusSectionCamera:Bn,focusSeatCamera:pe.focusSeatCamera,setSelection:Fn,ensureSeatView:Dn});C.canvas.addEventListener("pointerdown",Ae.onDown),C.canvas.addEventListener("pointermove",Ae.onMove),C.canvas.addEventListener("pointerup",Ae.onUp),C.canvas.addEventListener("pointercancel",Ae.onUp),ae.requestRender();let Ut={setAvailability(f){let y=lr(R,f),_=jt(o.seats,y);_.length&&p&&p.uploadSeatStateRuns(_),u(),_.length&&ne(),ae.requestRender()},setSelection:Fn,setNavigationMode:qe,zoomIn(){A.zoomBy(ze),ae.requestRender()},zoomOut(){A.zoomBy(nt),ae.requestRender()},flyToSeat:Gn,focusOverview:sa,seatViewStop:()=>je,recentreSeatView:()=>Se?.recentre()??!1,resize(){let{width:f,height:y}=C.resize();A.setAspect(f/Math.max(1,y)),ta(),oa(),aa(),ae.requestRender()},stats(){return{...ae.stats(),drawCalls:p?p.drawCalls:0,fallbackTriangles:p?p.seatGeometry.drawRange.count/3*o.seats.count:0,seatCount:o.seatCount}},captureImage(f=1280){if(S||!p||typeof document>"u")return null;pt(0);let y=C.canvas,_=Math.min(1,f/Math.max(y.width,y.height,1)),O=document.createElement("canvas");O.width=Math.max(1,Math.round(y.width*_)),O.height=Math.max(1,Math.round(y.height*_));let G=O.getContext("2d");return G?(G.drawImage(y,0,0,O.width,O.height),O.toDataURL("image/jpeg",.82)):null},captureSeatView(f,y=480){if(S||!p||I||typeof document>"u"||te.active||V!==null||Se?.active)return null;let _=Z.get(f);if(_)return _;let O=o.seats.idToIndex.get(f);if(O===void 0)return null;let{eye:G,focal:j,fov:$}=Nn(f,O),oe=A.snapshot(),de=[N.seatDetailMix,N.structureDetailMix],ge=null;try{ee=!0,A.camera.position.set(G[0],G[1],G[2]),A.camera.perspective({fov:$,aspect:A.camera.aspect}),A.camera.lookAt(j),A.camera.updateMatrixWorld(),A.syncFromCamera(),N.seatDetailMix=1,N.structureDetailMix=1,N.forceRegather(),pt(0);let k=C.canvas,ie=Math.min(k.width,Math.round(k.height*16/9)),re=Math.round(ie*9/16),xe=document.createElement("canvas");xe.width=Math.max(1,Math.round(y)),xe.height=Math.max(1,Math.round(y*9/16));let Te=xe.getContext("2d");Te&&(Te.drawImage(k,(k.width-ie)/2,(k.height-re)/2,ie,re,0,0,xe.width,xe.height),ge=xe.toDataURL("image/jpeg",.8))}finally{ee=!1,oe(),N.seatDetailMix=de[0],N.structureDetailMix=de[1],N.forceRegather(),pt(0)}if(ge)for(Z.set(f,ge);Z.size>Y;)Z.delete(Z.keys().next().value);return ge},getQualityEvidence(){let f=ae.stats(),y=C.canvas.clientWidth||1,_=C.canvas.clientHeight||1,O=o.bounds.center,G=Me(A.camera.projectionViewMatrix,[O[0],o.bounds.box.min[1],O[2]],y,_),j=Me(A.camera.projectionViewMatrix,[O[0],o.bounds.box.max[1],O[2]],y,_),$=o.bounds.box,oe=[$.min[0],$.max[0]].flatMap(k=>[$.min[1],$.max[1]].flatMap(ie=>[$.min[2],$.max[2]].map(re=>Me(A.camera.projectionViewMatrix,[k,ie,re],y,_)))).filter(k=>Number.isFinite(k.x)&&Number.isFinite(k.y)&&Number.isFinite(k.depth)),de=oe.length?(()=>{let k=Math.min(...oe.map(ce=>ce.x)),ie=Math.max(...oe.map(ce=>ce.x)),re=Math.min(...oe.map(ce=>ce.y)),xe=Math.max(...oe.map(ce=>ce.y)),Te=Math.max(0,k),$e=Math.min(y,ie),Ke=Math.max(0,re),bt=Math.min(_,xe),Ze=Math.max(0,$e-Te),ke=Math.max(0,bt-Ke);return{box:{x:Te,y:Ke,width:Ze,height:ke},horizontalFillRatio:Ze/y,verticalFillRatio:ke/_,visibleAreaRatio:Ze*ke/(y*_),clippedEdges:[...re<0?["top"]:[],...ie>y?["right"]:[],...xe>_?["bottom"]:[],...k<0?["left"]:[]]}})():void 0,ge=String(C.gl.getParameter(C.gl.VERSION)??"");return{viewport:{width:y,height:_},context:{webgl2:/webgl\s*2/i.test(ge),lost:S},frame:{rendered:f.rendered,idle:f.idle},camera:{position:[A.camera.position.x,A.camera.position.y,A.camera.position.z],distance:A.currentDistance,verticalFovDeg:A.fovY},scene:{seatCount:o.seatCount,floorCount:o.floors.length,zoneCount:o.zones.length,sectionCount:o.sections.length,authoredRelief:b,renderedVerticalSpanM:Math.max(0,o.bounds.box.max[1]-o.bounds.box.min[1]),projectedReliefPx:G.visible&&j.visible?Math.abs(G.y-j.y):0},labels:L.qualityEvidence(),framing:de,...je?{seatView:{fovDeg:A.camera.fov,stop:je}}:{}}},getQualityReport(){return un(Ut.getQualityEvidence())},loseContextForTest(){C.simulateContextLossCycle()},floors(){return o.floors},focusFloor(f){if(f!==null&&!o.floors.some(_=>_.index===f))return!1;let y=f??-1;if(T(f!==null),vt(!1),ia(y),qe("orbit"),f===null)te.cancel(),Xe()?A.frame(o.bounds,!1,Q,n.portraitOverviewCrop===!0,se):A.frameSoft(o.bounds,Q,n.portraitOverviewCrop===!0,se),L.setOverviewDistance(A.targetDistance);else{let _=o.floors[f];if(_.seatCount>0){te.cancel();let O=_.focalWorld[0]-_.center[0],G=_.focalWorld[2]-_.center[2],j=Math.hypot(O,G)>_.radius*.12?Math.atan2(O,G):Q;A.frame({center:_.center,radius:_.radius,box:_.box},!1,j,!1,{polarDeg:58,margin:1.12}),L.setOverviewDistance(A.targetDistance)}}return ae.requestRender(),!0},zones(){return o.zones},focusZone(f){let y=o.zones.find(j=>j.id===f);if(!y||y.seatCount===0)return!1;T(!1),vt(!1),te.cancel(),qe("orbit"),ht(null),n.onSectionFocusChange?.(null);let _=y.focalWorld[0]-y.center[0],O=y.focalWorld[2]-y.center[2],G=Math.hypot(_,O)>y.radius*.12?Math.atan2(_,O):void 0;return A.frame({center:y.center,radius:y.radius*1.25},!1,G),ae.requestRender(),!0},sections(){return o.sections},focusSection(f){return Bn(f)},rows(f){return f?o.rows.filter(y=>y.sectionId===f):o.rows},seatsInRow(f){return e.seats.filter(y=>y.rowId===f).map(y=>({id:y.id,label:y.displayLabel||y.label}))},focusRow(f){let y=o.rows.find(_=>_.id===f);return!y||y.seatCount===0?!1:(T(!0),vt(!1),te.cancel(),qe("pan"),y.sectionId&&(ht(y.sectionId),n.onSectionFocusChange?.(y.sectionId)),A.frame({center:y.center,radius:Math.max(2.5,y.radius*.65)}),ae.requestRender(),!0)},setReducedMotionForTest(f){D=f},dispose(){w=!0,he?.dispose(),Cn(!1),Bt(),Wt.remove(),na.remove(),Hn(),Se?.dispose(),ae.stop(),L.dispose(),En?.disconnect(),V&&(V.dispose(),V=null),F(),me(),C.canvas.removeEventListener("pointerdown",Ae.onDown),C.canvas.removeEventListener("pointermove",Ae.onMove),C.canvas.removeEventListener("pointerup",Ae.onUp),C.canvas.removeEventListener("pointercancel",Ae.onUp),C.canvas.removeEventListener("pointermove",ft),C.canvas.removeEventListener("pointerdown",ft),C.canvas.removeEventListener("pointerleave",_n),Ee&&cancelAnimationFrame(Ee),A.dispose(),P&&P.dispose(),p&&p.dispose(),p=null,x?.dispose(),x=null,P=null,C.dispose()}};return i.opened(o.seatCount,b,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),Ut}export{ui as VENUE3D_QUALITY_REPORT_VERSION,la as autoVenue3d,tt as buildSceneModel,Kt as estimateVenue3D,un as inspectVenue3DQualityEvidence,yu as mountVenue3D,zs as prepareVenue3D,Ns as prepareVenue3DFromChart};