@seatlayer/core 0.98.0 → 0.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{categoryInventory-4XH7dMDH.d.ts → categoryInventory-DdJdJ4Og.d.ts} +1 -1
- package/dist/{categoryInventory-C-bfH2av.d.cts → categoryInventory-DuOez0-4.d.cts} +1 -1
- package/dist/{chunk-M5VINTGE.js → chunk-23OTKCJU.js} +1 -1
- package/dist/chunk-COOPHSHM.js +1 -0
- package/dist/{chunk-CUACREZL.js → chunk-CTIGUXXK.js} +1 -1
- package/dist/{chunk-P4C24CIZ.js → chunk-D723OZEY.js} +1 -1
- package/dist/chunk-FYJJSWEM.js +1 -0
- package/dist/chunk-GLGXP5I7.js +1 -0
- package/dist/{chunk-FLMKHAUT.js → chunk-HO4MFTVX.js} +1 -1
- package/dist/chunk-HYEZPOZU.js +1 -0
- package/dist/{chunk-YPESNMTC.js → chunk-KFVUBZMK.js} +1 -1
- package/dist/{chunk-OLGPAFXW.js → chunk-L34T3APU.js} +1 -1
- package/dist/{chunk-IW7QZIMF.js → chunk-N4J4CT6P.js} +1 -1
- package/dist/{chunk-2P72QUJR.js → chunk-UIMDB6GZ.js} +1 -1
- package/dist/chunk-UISTXRO5.js +1 -0
- package/dist/{chunk-ASIIXY5M.js → chunk-VWT44HBR.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +6 -4
- package/dist/core/chart-ops/index.d.ts +6 -4
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +4 -4
- package/dist/core/inventory/index.d.ts +4 -4
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +5 -5
- package/dist/core/layout/index.d.ts +5 -5
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.d.cts +3 -3
- package/dist/core/quality/index.d.ts +3 -3
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.d.cts +2 -2
- package/dist/core/render-assets/index.d.ts +2 -2
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/{eventConfigurations-BEyHDxBT.d.ts → eventConfigurations-BISNREZL.d.ts} +1 -1
- package/dist/{eventConfigurations-BE0rFmbQ.d.cts → eventConfigurations-DYn5XP3J.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +18 -13
- package/dist/index.d.ts +18 -13
- package/dist/index.js +1 -1
- package/dist/{labeling-HWSKKrX8.d.ts → labeling-CzuSxAkr.d.ts} +1 -1
- package/dist/{labeling-SURRJh5u.d.cts → labeling-owTTG6e0.d.cts} +1 -1
- package/dist/{openPanorama-6FMXAJ6O.js → openPanorama-VD6PE3YZ.js} +2 -2
- package/dist/{renderedQuality-QWHMvOej.d.cts → renderedQuality-BZycehrC.d.cts} +1 -1
- package/dist/{renderedQuality-CZNfpB1H.d.ts → renderedQuality-DPElQ3-x.d.ts} +1 -1
- package/dist/{renderer-CuXYGgR3.d.ts → renderer-DPKIlnuF.d.ts} +10 -1
- package/dist/{renderer-DEnthjgs.d.cts → renderer-DnsIDiWN.d.cts} +10 -1
- package/dist/{seatTypeIcons-BAyWebjw.d.cts → seatTypeIcons-QwEebl3k.d.cts} +1 -1
- package/dist/{seatTypeIcons-CqLiEH9C.d.ts → seatTypeIcons-dy3XQVWN.d.ts} +1 -1
- package/dist/{sections-DOk8zxm5.d.ts → sections-C8VTe6BN.d.ts} +1 -1
- package/dist/{sections-BlCiPWJJ.d.cts → sections-DSIfnBJY.d.cts} +1 -1
- package/dist/{segmentedRowModel-BbHdWqJy.d.cts → segmentedRowModel-CDvvJJ4-.d.cts} +1 -1
- package/dist/{segmentedRowModel-oVUtwW87.d.ts → segmentedRowModel-I8eYUQft.d.ts} +1 -1
- package/dist/{tableSizing-ExOrUwtX.d.ts → tableSizing-0PwrOWi5.d.ts} +20 -13
- package/dist/{tableSizing-DaEXRHYs.d.cts → tableSizing-x8ADFtKS.d.cts} +20 -13
- package/dist/{ticketRestrictions-BHUMet7N.d.ts → ticketRestrictions-C8H-XJha.d.ts} +2 -2
- package/dist/{ticketRestrictions-BvG_INSV.d.cts → ticketRestrictions-O-fv0Os6.d.cts} +2 -2
- package/dist/{types-BbqhOJ5L.d.ts → types-DWx32xXH.d.cts} +10 -1
- package/dist/{types-BbqhOJ5L.d.cts → types-DWx32xXH.d.ts} +10 -1
- package/dist/view3d/crossfade/panorama.cjs +1 -1
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/crossfade/panorama.js +1 -1
- package/dist/view3d/index.cjs +135 -47
- package/dist/view3d/index.d.cts +35 -4
- package/dist/view3d/index.d.ts +35 -4
- package/dist/view3d/index.js +133 -45
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2MXDWZQ4.js +0 -1
- package/dist/chunk-QEPYNCBJ.js +0 -1
- package/dist/chunk-SPM2LMKI.js +0 -1
- package/dist/chunk-VAI2VDQR.js +0 -1
- package/dist/chunk-Z43H6AWN.js +0 -1
package/dist/view3d/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as zn,B as Nn,C as Ye,D as Vt,E as Hn,F as Gn,a as We,b as Ce,c as st,d as _t,e as An,f as Pn,g as be,h as Cn,i as En,j as lt,k as Te,l as Ue,m as Rn,n as It,o as Lr,p as Tn,q as Dn,r as Fn,s as _n,t as ge,u as In,v as Vn,w as Ln,x as kn,y as On,z as ct}from"../chunk-2MXDWZQ4.js";import"../chunk-2P72QUJR.js";import"../chunk-OLGPAFXW.js";import"../chunk-QJXSZT3H.js";import"../chunk-ASIIXY5M.js";import"../chunk-M5VINTGE.js";import"../chunk-P4C24CIZ.js";import"../chunk-IW7QZIMF.js";import"../chunk-Z43H6AWN.js";import"../chunk-4N5CHKHD.js";import"../chunk-TQN2VWQO.js";import"../chunk-5BMXWOE7.js";import"../chunk-FLMKHAUT.js";import{Va as Sn}from"../chunk-VAI2VDQR.js";import"../chunk-5ITK5236.js";import{d as wn,l as Mn}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";function Bn(t,e,n){let r=Math.floor(e.length/3),i=n.center[0],o=n.center[2];if(r>0){let l=Math.max(1,Math.floor(r/4e3)),u=0,m=0,d=0;for(let p=0;p<r;p+=l)u+=e[p*3],m+=e[p*3+2],d++;i=u/d,o=m/d}let a=t[0]-i,s=t[2]-o;return Math.hypot(a,s)>n.radius*.12?Math.atan2(a,s):void 0}var Lt=78,Wn=18;function Un(){let t=[],e=[],n=[],r=[],i=[],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,Ce,-1],max:[1,st,-.72]}])for(let l of o){let u=t.length/3,m=l.n[1]+(s.part===2?Math.abs(l.n[0])*(1-_t)/(st-Ce):0),d=Math.hypot(l.n[0],m,l.n[2]),p=[l.n[0]/d,m/d,l.n[2]/d];for(let[f,c]of l.c.entries()){let g=c.map((S,w)=>s.min[w]+S*(s.max[w]-s.min[w]));s.part===2&&(g[0]*=1-c[1]*(1-_t)),t.push(...g),e.push(...p),n.push(s.part),r.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][f])}i.push(u,u+1,u+2,u,u+2,u+3)}let a=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 i.push(a,a+1,a+2,a,a+2,a+3),i.push(...i.slice(12,18),...i.slice(60,66),...i.slice(72,78)),{position:new Float32Array(t),normal:new Float32Array(e),surface:new Float32Array(n),uv:new Float32Array(r),index:new Uint16Array(i)}}import{Renderer as kr}from"ogl";function Or(){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 ut=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 kr({canvas:this.canvas,dpr:Or(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[lt.top[0],lt.top[1],lt.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 zr,Vec3 as kt}from"ogl";var se=Math.PI/180,Ot=15*se,zt=80*se,De=.12,Yn=35,Nt=1.25,Xn=.006,Nr=4,Fe=.82,Xe=1/Fe,Hr=.12,Gr=2;function Br(t,e){return{azimuth:t*Xn,polar:-e*Xn}}function Wr(t,e,n){if(!n)return 1;let r=e[0]-t[0],i=e[2]-t[2];return(n[0]-e[0])*r+(n[2]-e[2])*i<0?-1:1}function qn(t,e,n){let r=Math.max(Gr,Math.max(1,e)*Hr),i=n*Nr;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,i):i}}var Ur=1.5;function Yr(t,e,n){let r=Math.max(1,n)*Ur;if(!t)return{anchor:[e[0],e[1],e[2]],limit:r};let[i,o,a]=t.anchor,s=e[1]-o,l=Math.max(Math.abs(e[0]-i),Math.abs(e[2]-a),s>=0?s:-s*2);return{anchor:t.anchor,limit:Math.max(t.limit,l+r)}}function jn(t,e,n,r,i,o,a,s){let l=Math.sin(n),u=[l*Math.sin(e),Math.cos(n),l*Math.cos(e)],m=[t[0]+r*u[0],t[1]+r*u[1],t[2]+r*u[2]],d=[-u[0],-u[1],-u[2]],p=[-d[2],0,d[0]],f=Math.hypot(p[0],p[2])||1;p=[p[0]/f,0,p[2]/f];let c=[p[1]*d[2]-p[2]*d[1],p[2]*d[0]-p[0]*d[2],p[0]*d[1]-p[1]*d[0]],g=Math.tan(i*se/2),S=g*(o>0?o:1),w=[0,1,2].map(E=>d[E]+a*S*p[E]+s*g*c[E]);if(w[1]>=-1e-6)return null;let I=(t[1]-m[1])/w[1],P=Math.hypot(w[0],w[1],w[2]);return!(I>0)||I*P>r*Xr?null:[m[0]+w[0]*I,t[1],m[2]+w[2]*I]}var Kn=3,Xr=4,dt=class{constructor(e,n,r,i){this.fovY=Yn;this.target=new kt;this.azimuth=-30*se;this.polar=55*se;this.distance=10;this.azT=-30*se;this.polT=55*se;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 kt;this.panAnchor=new kt;this.panLimit=0;this.panBox=null;this.grabSign=1;this.zoomPointResolver=null;this.primaryDragMode="orbit";this.camera=new zr(e,{fov:Yn,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=i,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 a=o.button===2||o.button===1,s=o.button===0&&(o.shiftKey?this.primaryDragMode==="orbit":this.primaryDragMode==="pan");this.panning=a||s,this.dragging=!this.panning,this.dragging&&(this.grabSign=this.grabSignAt(o.clientX,o.clientY)),this.lastX=o.clientX,this.lastY=o.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance();let a=this.pinchCentroid();this.pinchCx=a.x,this.pinchCy=a.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 u=this.currentPinchDistance(),m=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-u)*.005),m.x,m.y),this.fireGesture()),this.pinchDist=u,this.panBy(m.x-this.pinchCx,m.y-this.pinchCy),this.pinchCx=m.x,this.pinchCy=m.y;return}let a=o.clientX-this.lastX,s=o.clientY-this.lastY;if(this.panning){this.lastX=o.clientX,this.lastY=o.clientY,(a!==0||s!==0)&&(this.panBy(a,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=o.clientX,this.lastY=o.clientY,(a!==0||s!==0)&&this.fireGesture();let l=Br(a,s);this.azT+=l.azimuth*this.grabSign,this.polT=Math.max(Ot,Math.min(zt,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 a=o.deltaMode===1?16:o.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,o.deltaY*a/100));this.dollyAt(Math.exp(s*.22),o.clientX,o.clientY),this.fireGesture()},this.onKeyDown=o=>{if(!this.interactionEnabled)return;let a=7*se;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"?-a:a;else if(o.key==="ArrowUp"||o.key==="ArrowDown")this.polT=Math.max(Ot,Math.min(zt,this.polT+(o.key==="ArrowUp"?-a:a)));else if(o.key==="+"||o.key==="=")this.dollyBy(Fe);else if(o.key==="-"||o.key==="_")this.dollyBy(Xe);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 i of e)n+=i.x,r+=i.y;return{x:n/e.length,y:r/e.length}}panBy(e,n){let r=this.canvas.clientHeight||1,i=2*this.distance*Math.tan(this.fovY*se/2)/r,o=Math.sin(this.azimuth),a=Math.cos(this.azimuth),s=a,l=-o,u=Math.cos(this.polar),m=Math.sin(this.polar),d=-o*u,p=-a*u;this.targetT.x+=(-e*s+n*d)*i,this.targetT.z+=(-e*l+n*p)*i,this.targetT.y+=n*m*i,this.clampPan(),this.requestRender()}widenPanBox(e){this.panBox=Yr(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,i=this.panAnchor.z;this.targetT.x=Math.max(n-e,Math.min(n+e,this.targetT.x)),this.targetT.z=Math.max(i-e,Math.min(i+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?.())}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 i=this.distT,o=this.canvas.getBoundingClientRect?.(),a=this.zoomPointResolver?.(n,r)??null;if(a){this.distT=Math.max(Kn,Math.min(this.maxDist,this.distT*e)),this.minDist=Math.min(this.minDist,Math.max(Kn,this.distT)),this.requestRender(),this.scaleTargetAbout(a,this.distT/i);return}let s=o&&o.width>0&&o.height>0?jn([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/i)}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())}grabSignAt(e,n){let r=this.canvas.getBoundingClientRect?.(),i=this.zoomPointResolver?.(e,n)??(r&&r.width>0&&r.height>0?jn([this.target.x,this.target.y,this.target.z],this.azimuth,this.polar,this.distance,this.fovY,this.camera.aspect||r.width/r.height,(e-r.left)/r.width*2-1,1-(n-r.top)/r.height*2):null),o=this.camera.position;return Wr([o.x,o.y,o.z],[this.target.x,this.target.y,this.target.z],i)}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,i=!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 a=Math.max(1,e.radius),s=this.fovY*se/2,l=i?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,u=Math.atan(Math.tan(s)*l);this.azT=r??-30*se,this.polT=Math.max(15,Math.min(80,o?.polarDeg??55))*se;let m=this.fitDistance(e,s,u,this.azT,this.polT);this.distT=m*Math.max(1.05,Math.min(2,o?.margin??Nt)),this.envelope=qn(this.envelope,a,m),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,n?(this.azimuth=this.azT,this.polar=12*se,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.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*se/2,i=Math.atan(Math.tan(r)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*se;let o=this.fitDistance(e,r,i,this.azT,this.polT);this.distT=o*Math.max(1.05,Math.min(2,n?.margin??Nt)),this.envelope=qn(this.envelope,Math.max(1,e.radius),o),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(e,n,r=!1,i){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*se/2,a=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(o)*a);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*se;let l=this.fitDistance(e,o,s,this.azT,this.polT);this.distT=l*Math.max(1.05,Math.min(2,i?.margin??Nt))}fitDistance(e,n,r,i,o){let a=Math.max(1,e.radius),s=Math.max(a/Math.tan(n),a/Math.tan(r)),l=e.box;if(!l)return s;let u=Math.sin(o),m=-u*Math.sin(i),d=-Math.cos(o),p=-u*Math.cos(i);if(Math.abs(d)>.999)return s;let f=-p,c=m,g=Math.hypot(f,c);f/=g,c/=g;let S=-c*d,w=c*m-f*p,I=f*d,P=Math.tan(r),E=Math.tan(n),W=1;for(let H=0;H<8;H++){let v=(H&1?l.max[0]:l.min[0])-e.center[0],y=(H&2?l.max[1]:l.min[1])-e.center[1],T=(H&4?l.max[2]:l.min[2])-e.center[2],R=v*m+y*d+T*p,U=Math.abs(v*f+T*c),F=Math.abs(v*S+y*w+T*I);W=Math.max(W,U/P-R,F/E-R)}return Math.min(s,Math.max(W,a*.35))}updateClipping(e){let n=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],i=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),a=this.interactionEnabled&&Math.abs(o-this.distance)<=this.distance*.01,{near:s,far:l}=Kr(Math.hypot(n,r,i),e.radius,a?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,i=this.targetT.x-this.target.x,o=this.targetT.y-this.target.y,a=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(i)>s||Math.abs(o)>s||Math.abs(a)>s;return this.azimuth+=e*De,this.polar+=n*De,this.distance+=r*De,this.target.x+=i*De,this.target.y+=o*De,this.target.z+=a*De,l&&this.applyPosition(),l}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}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,i=Math.hypot(e,n,r)||1,o=Math.max(Ot,Math.min(zt,Math.acos(Math.max(-1,Math.min(1,n/i)))));this.distance=this.distT=i,this.polar=this.polT=o,this.azimuth=this.azT=Math.atan2(e,r)}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),i=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(n,r,i),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()}},qr=.1,jr=.25;function Kr(t,e,n){let r=Math.max(1,e)*1.18,i=n==null?jr:Math.max(.05,n*qr),o=Math.max(i,t-r),a=Math.max(o+10,t+r);return{near:o,far:a}}var mt=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 i=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+i*.1:i}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}};var _e=2.5,$r=1.15,qe=12,Ie=22,$n=6,Qn=9.5,Zn=.9,Jn=2.2,Ht=30,Gt=4,ht=8192;var ms=Ie+Gt;function eo(t,e){let n=e*1.4,r=e*3.2;if(t<=n)return{scale:1,fade:0,minPixels:_e};let i=Math.min(1,(t-n)/Math.max(.001,r-n));return{scale:1-i*.4,fade:i*.55,minPixels:_e+i*($r-_e)}}function to(t,e,n){return!(t>0)||!(e>0)||!(n>0)?!1:e*n/t>=64}var Qr=12;function no(t,e,n,r,i){if(!(t>0)||!(e>0)||!(n>0)||!(r>0)||!(i>0))return!1;let o=Math.tan(r/2*Math.PI/180);if(!(o>0))return!1;let a=e/(n*o)*(i/2);return Math.PI*a*a/t>=Qr}import{Geometry as Zr,Mesh as Jr,Program as ei,Transform as ti}from"ogl";var ni=.05,oi=.6,ri=12,ii=1.6,ai=1,si=2.5,li=650,oo=24;function ci(t){let e=[],n=[],r=[],i=(d,p,f)=>{e.push(...d),n.push(...p),r.push(f)};for(let d=0;d<16;d++){let p=d/16*Math.PI*2,f=(d+1)/16*Math.PI*2,c=P=>[Math.cos(P),0,Math.sin(P)],g=[Math.cos(p)*.012,0,Math.sin(p)*.012],S=[Math.cos(f)*.012,0,Math.sin(f)*.012],w=[Math.cos(p)*.03,1,Math.sin(p)*.03],I=[Math.cos(f)*.03,1,Math.sin(f)*.03];i(g,c(p),0),i(w,c(p),0),i(I,c(f),0),i(g,c(p),0),i(I,c(f),0),i(S,c(f),0)}let l=.16,u=.24,m=.01;for(let d=0;d<48;d++){let p=d/48*Math.PI*2,f=(d+1)/48*Math.PI*2,c=[Math.cos(p)*l,m,Math.sin(p)*l],g=[Math.cos(p)*u,m,Math.sin(p)*u],S=[Math.cos(f)*u,m,Math.sin(f)*u],w=[Math.cos(f)*l,m,Math.sin(f)*l];for(let I of[c,g,S,c,S,w])i(I,[0,1,0],1)}return new Zr(t,{position:{size:3,data:new Float32Array(e)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(r)}})}var ui=`#version 300 es
|
|
1
|
+
import{A as Bt,B as Qn,C as Ke,D as Wt,E as Zn,F as Jn,a as Xe,b as Ee,c as mt,d as Ht,e as On,f as zn,g as ye,h as Nn,i as Hn,j as ht,k as Ie,l as qe,m as Gn,n as Gt,o as Jr,p as Bn,q as Wn,r as Un,s as Yn,t as xe,u as Xn,v as qn,w as jn,x as Kn,y as $n,z as je}from"../chunk-COOPHSHM.js";import"../chunk-UIMDB6GZ.js";import"../chunk-L34T3APU.js";import{d as Ln}from"../chunk-P4J57TK6.js";import"../chunk-QJXSZT3H.js";import"../chunk-VWT44HBR.js";import"../chunk-23OTKCJU.js";import"../chunk-D723OZEY.js";import"../chunk-N4J4CT6P.js";import"../chunk-HYEZPOZU.js";import"../chunk-4N5CHKHD.js";import"../chunk-TQN2VWQO.js";import"../chunk-5BMXWOE7.js";import"../chunk-HO4MFTVX.js";import{Va as Fn}from"../chunk-UISTXRO5.js";import"../chunk-5ITK5236.js";import{d as Vn,l as kn}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";function eo(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)),c=0,d=0,h=0;for(let p=0;p<r;p+=l)c+=e[p*3],d+=e[p*3+2],h++;a=c/h,o=d/h}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 ws}from"ogl";function to(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 F=0;F<a;F++){let D=r[F*3],L=r[F*3+2];D<o&&(o=D),D>i&&(i=D),L<s&&(s=L),L>l&&(l=L)}for(let F of e.stages)o=Math.min(o,F.cx-F.halfX),i=Math.max(i,F.cx+F.halfX),s=Math.min(s,F.cz-F.halfZ),l=Math.max(l,F.cz+F.halfZ);let c=Math.min(130/Math.max(.001,i-o),86/Math.max(.001,l-s)),d=(148-(i-o)*c)/2,h=(104-(l-s)*c)/2,p=F=>d+(F-o)*c,f=F=>h+(F-s)*c,u=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),y=document.createElement("canvas");y.width=Math.round(148*u),y.height=Math.round(104*u),y.setAttribute("aria-hidden","true"),y.setAttribute("data-seat-locator","");let v=y.style;v.position="absolute",v.left="12px",v.bottom="12px",v.width="148px",v.height="104px",v.borderRadius="10px",v.background="rgba(10,14,22,.72)",v.border="1px solid rgba(255,255,255,.14)",v.boxShadow="0 4px 14px rgba(0,0,0,.35)",v.pointerEvents="none",v.zIndex="3",v.display="none",t.appendChild(y);let M=document.createElement("canvas");M.width=y.width,M.height=y.height;let I=M.getContext("2d");if(I){I.scale(u,u),I.fillStyle="rgba(214,222,234,.28)";let F=Math.max(1,Math.ceil(a/6e3));for(let D=0;D<a;D+=F)I.fillRect(p(r[D*3])-.6,f(r[D*3+2])-.6,1.2,1.2);I.fillStyle="rgba(236,240,246,.16)",I.strokeStyle="rgba(236,240,246,.55)",I.lineWidth=1;for(let D of e.stages){let L=p(D.cx-D.halfX),g=f(D.cz-D.halfZ),A=D.halfX*2*c,w=D.halfZ*2*c;I.fillRect(L,g,A,w),I.strokeRect(L+.5,g+.5,Math.max(0,A-1),Math.max(0,w-1))}}let S=y.getContext("2d"),T="";return{el:y,update(F,D){if(!F||!S||t.clientWidth>0&&t.clientWidth<560){v.display!=="none"&&(v.display="none"),T="";return}let L=p(F[0]),g=f(F[2]),A=D?Math.atan2(D[2],D[0]):0,w=`${L.toFixed(1)},${g.toFixed(1)},${A.toFixed(2)}`;if(w!==T){if(T=w,v.display="block",S.setTransform(1,0,0,1,0,0),S.clearRect(0,0,y.width,y.height),S.drawImage(M,0,0),S.setTransform(u,0,0,u,0,0),D){let _=S.createRadialGradient(L,g,0,L,g,26);_.addColorStop(0,"rgba(255,255,255,.55)"),_.addColorStop(1,"rgba(255,255,255,0)"),S.fillStyle=_,S.beginPath(),S.moveTo(L,g),S.arc(L,g,26,A-.5,A+.5),S.closePath(),S.fill()}S.fillStyle=n,S.strokeStyle="rgba(10,14,22,.9)",S.lineWidth=1.5,S.beginPath(),S.arc(L,g,3.6,0,Math.PI*2),S.fill(),S.stroke()}},dispose(){y.remove()}}}var Ut=78,no=18;function oo(){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,Ee,-1],max:[1,mt,-.72]}])for(let l of o){let c=t.length/3,d=l.n[1]+(s.part===2?Math.abs(l.n[0])*(1-Ht)/(mt-Ee):0),h=Math.hypot(l.n[0],d,l.n[2]),p=[l.n[0]/h,d/h,l.n[2]/h];for(let[f,u]of l.c.entries()){let y=u.map((v,M)=>s.min[M]+v*(s.max[M]-s.min[M]));s.part===2&&(y[0]*=1-u[1]*(1-Ht)),t.push(...y),e.push(...p),n.push(s.part),r.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][f])}a.push(c,c+1,c+2,c,c+2,c+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 ea}from"ogl";function ta(){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 pt=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 ea({canvas:this.canvas,dpr:ta(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[ht.top[0],ht.top[1],ht.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 na,Vec3 as Yt}from"ogl";var ce=Math.PI/180,Xt=15*ce,qt=80*ce,De=.12,ro=35,jt=1.25,ao=.006,oa=4,Fe=.82,$e=1/Fe,ra=.12,aa=2;function ia(t,e){return{azimuth:t*ao,polar:-e*ao}}function sa(t,e,n){if(!n)return 1;let r=e[0]-t[0],a=e[2]-t[2];return(n[0]-e[0])*r+(n[2]-e[2])*a<0?-1:1}function io(t,e,n){let r=Math.max(aa,Math.max(1,e)*ra),a=n*oa;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,a):a}}var la=1.5;function ca(t,e,n){let r=Math.max(1,n)*la;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 so(t,e,n,r,a,o,i,s){let l=Math.sin(n),c=[l*Math.sin(e),Math.cos(n),l*Math.cos(e)],d=[t[0]+r*c[0],t[1]+r*c[1],t[2]+r*c[2]],h=[-c[0],-c[1],-c[2]],p=[-h[2],0,h[0]],f=Math.hypot(p[0],p[2])||1;p=[p[0]/f,0,p[2]/f];let u=[p[1]*h[2]-p[2]*h[1],p[2]*h[0]-p[0]*h[2],p[0]*h[1]-p[1]*h[0]],y=Math.tan(a*ce/2),v=y*(o>0?o:1),M=[0,1,2].map(T=>h[T]+i*v*p[T]+s*y*u[T]);if(M[1]>=-1e-6)return null;let I=(t[1]-d[1])/M[1],S=Math.hypot(M[0],M[1],M[2]);return!(I>0)||I*S>r*ua?null:[d[0]+M[0]*I,t[1],d[2]+M[2]*I]}var lo=3,ua=4,co=.72;function uo(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 da=.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,c=uo(r,a);if(!l||l.length<9||!c)return{center:i,distance:s};let{fx:d,fy:h,fz:p,rx:f,rz:u,ux:y,uy:v,uz:M}=c,I=Math.hypot(d,p),S=d/I,T=p/I,F=S*y+T*M,D=da*Math.max(1,t.radius);for(let L=0;L<3;L++){let g=1/0,A=-1/0,w=1/0,_=-1/0;for(let G=0;G+2<l.length;G+=3){let Y=l[G]-i[0],te=l[G+1]-i[1],E=l[G+2]-i[2],x=s+Y*d+te*h+E*p;if(!(x>.001))continue;let P=(Y*f+E*u)/(x*e),B=(Y*y+te*v+E*M)/(x*n);P<g&&(g=P),P>A&&(A=P),B<w&&(w=B),B>_&&(_=B)}if(!Number.isFinite(g))break;let O=(g+A)/2*s*e,C=Math.abs(F)>.1?(w+_)/2*s*n/F:0,V=O*f+C*S,N=O*u+C*T;if(Math.hypot(i[0]+V-t.center[0],i[2]+N-t.center[2])>D){let G=i[0]-t.center[0],Y=i[2]-t.center[2],te=G+V,E=Y+N,x=D/Math.hypot(te,E);V=te*x-G,N=E*x-Y}i=[i[0]+V,i[1],i[2]+N],s=o(i)}return{center:i,distance:s}}var ft=class{constructor(e,n,r,a){this.fovY=ro;this.target=new Yt;this.azimuth=-30*ce;this.polar=55*ce;this.distance=10;this.azT=-30*ce;this.polT=55*ce;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 Yt;this.panAnchor=new Yt;this.panLimit=0;this.panBox=null;this.grabSign=1;this.zoomPointResolver=null;this.primaryDragMode="orbit";this.camera=new na(e,{fov:ro,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=o.button===2||o.button===1,s=o.button===0&&(o.shiftKey?this.primaryDragMode==="orbit":this.primaryDragMode==="pan");this.panning=i||s,this.dragging=!this.panning,this.dragging&&(this.grabSign=this.grabSignAt(o.clientX,o.clientY)),this.lastX=o.clientX,this.lastY=o.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance();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 c=this.currentPinchDistance(),d=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-c)*.005),d.x,d.y),this.fireGesture()),this.pinchDist=c,this.panBy(d.x-this.pinchCx,d.y-this.pinchCy),this.pinchCx=d.x,this.pinchCy=d.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=ia(i,s);this.azT+=l.azimuth*this.grabSign,this.polT=Math.max(Xt,Math.min(qt,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*ce;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(Xt,Math.min(qt,this.polT+(o.key==="ArrowUp"?-i:i)));else if(o.key==="+"||o.key==="=")this.dollyBy(Fe);else if(o.key==="-"||o.key==="_")this.dollyBy($e);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*ce/2)/r,o=Math.sin(this.azimuth),i=Math.cos(this.azimuth),s=i,l=-o,c=Math.cos(this.polar),d=Math.sin(this.polar),h=-o*c,p=-i*c;this.targetT.x+=(-e*s+n*h)*a,this.targetT.z+=(-e*l+n*p)*a,this.targetT.y+=n*d*a,this.clampPan(),this.requestRender()}widenPanBox(e){this.panBox=ca(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?.())}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(lo,Math.min(this.maxDist,this.distT*e)),this.minDist=Math.min(this.minDist,Math.max(lo,this.distT)),this.requestRender(),this.scaleTargetAbout(i,this.distT/a);return}let s=o&&o.width>0&&o.height>0?so([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())}grabSignAt(e,n){let r=this.canvas.getBoundingClientRect?.(),a=this.zoomPointResolver?.(e,n)??(r&&r.width>0&&r.height>0?so([this.target.x,this.target.y,this.target.z],this.azimuth,this.polar,this.distance,this.fovY,this.camera.aspect||r.width/r.height,(e-r.left)/r.width*2-1,1-(n-r.top)/r.height*2):null),o=this.camera.position;return sa([o.x,o.y,o.z],[this.target.x,this.target.y,this.target.z],a)}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*ce/2,l=a?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,c=Math.atan(Math.tan(s)*l);this.azT=r??-30*ce,this.polT=Math.max(15,Math.min(80,o?.polarDeg??55))*ce;let d=this.framedOn(e,s,c),h=d.distance;this.target.set(d.center[0],d.center[1],d.center[2]),this.targetT.copy(this.target),this.distT=h*Math.max(1.05,Math.min(2,o?.margin??jt)),this.envelope=io(this.envelope,i,h),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,n?(this.azimuth=this.azT,this.polar=12*ce,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.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*ce/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))*ce;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??jt)),this.envelope=io(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*ce/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))*ce;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??jt))}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 c=uo(a,o);if(!c)return s;let{fx:d,fy:h,fz:p,rx:f,rz:u,ux:y,uy:v,uz:M}=c,I=Math.tan(r),S=Math.tan(n),T=1;for(let w=0;w<8;w++){let _=(w&1?l.max[0]:l.min[0])-e.center[0],O=(w&2?l.max[1]:l.min[1])-e.center[1],C=(w&4?l.max[2]:l.min[2])-e.center[2],V=_*d+O*h+C*p,N=Math.abs(_*f+C*u),W=Math.abs(_*y+O*v+C*M);T=Math.max(T,N/I-V,W/S-V)}let F=Math.min(s,Math.max(T,i*.35)),D=e.fitPoints;if(!D||D.length<9)return F;let L=0,g=1/(I*co),A=1/(S*co);for(let w=0;w+2<D.length;w+=3){let _=D[w]-e.center[0],O=D[w+1]-e.center[1],C=D[w+2]-e.center[2],V=_*d+O*h+C*p,N=Math.abs(_*f+C*u),W=Math.abs(_*y+O*v+C*M);L=Math.max(L,N*g-V,W*A-V)}return Math.min(F*1.5,Math.max(F*.55,L))}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}=fa(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*De,this.polar+=n*De,this.distance+=r*De,this.target.x+=a*De,this.target.y+=o*De,this.target.z+=i*De,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(Xt,Math.min(qt,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)}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()}},ha=.1,pa=.25;function fa(t,e,n){let r=Math.max(1,e)*1.18,a=n==null?pa:Math.max(.05,n*ha),o=Math.max(a,t-r),i=Math.max(o+10,t+r);return{near:o,far:i}}var vt=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 mo(t){let e=!1;return n=>{n!==e&&(e=n,n?t.dataset.slReady="1":delete t.dataset.slReady)}}var Le=2.5,va=1.15,Qe=12,Ve=22,ho=6,po=9.5,fo=.9,vo=2.2,Kt=30,$t=4,bt=8192;var Gs=Ve+$t;function bo(t,e){let n=e*1.4,r=e*3.2;if(t<=n)return{scale:1,fade:0,minPixels:Le};let a=Math.min(1,(t-n)/Math.max(.001,r-n));return{scale:1-a*.4,fade:a*.55,minPixels:Le+a*(va-Le)}}function go(t,e,n){return!(t>0)||!(e>0)||!(n>0)?!1:e*n/t>=64}var ba=12;function yo(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>=ba}import{Geometry as ga,Mesh as ya,Program as xa,Transform as Sa}from"ogl";var wa=.05,Ma=.6,Pa=12,Aa=1.6,Ca=1,Ea=2.5,Ra=650,xo=24;function Ta(t){let e=[],n=[],r=[],a=(h,p,f)=>{e.push(...h),n.push(...p),r.push(f)};for(let h=0;h<16;h++){let p=h/16*Math.PI*2,f=(h+1)/16*Math.PI*2,u=S=>[Math.cos(S),0,Math.sin(S)],y=[Math.cos(p)*.012,0,Math.sin(p)*.012],v=[Math.cos(f)*.012,0,Math.sin(f)*.012],M=[Math.cos(p)*.03,1,Math.sin(p)*.03],I=[Math.cos(f)*.03,1,Math.sin(f)*.03];a(y,u(p),0),a(M,u(p),0),a(I,u(f),0),a(y,u(p),0),a(I,u(f),0),a(v,u(f),0)}let l=.16,c=.24,d=.01;for(let h=0;h<48;h++){let p=h/48*Math.PI*2,f=(h+1)/48*Math.PI*2,u=[Math.cos(p)*l,d,Math.sin(p)*l],y=[Math.cos(p)*c,d,Math.sin(p)*c],v=[Math.cos(f)*c,d,Math.sin(f)*c],M=[Math.cos(f)*l,d,Math.sin(f)*l];for(let I of[u,y,v,u,v,M])a(I,[0,1,0],1)}return new ga(t,{position:{size:3,data:new Float32Array(e)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(r)}})}var _a=`#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;
|
|
@@ -14,7 +14,7 @@ void main() {
|
|
|
14
14
|
float scale = part > 0.5 ? uRingScale : uHeight;
|
|
15
15
|
vec3 world = uSeat + vec3(position.x, position.y * grow, position.z) * scale;
|
|
16
16
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(world, 1.0);
|
|
17
|
-
}`,
|
|
17
|
+
}`,Ia=`#version 300 es
|
|
18
18
|
precision highp float;
|
|
19
19
|
in vec3 vNormal; in float vPart;
|
|
20
20
|
uniform vec3 uColor; uniform float uRingAlpha;
|
|
@@ -26,15 +26,15 @@ void main() {
|
|
|
26
26
|
float key = max(dot(normalize(vNormal), normalize(vec3(-0.4, 0.7, 0.6))), 0.0);
|
|
27
27
|
vec3 c = uColor * (0.55 + 0.5 * key) + vec3(0.12) * pow(key, 12.0);
|
|
28
28
|
fragColor = vec4(c, 1.0);
|
|
29
|
-
}`;function mi(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 Bt(t){return Math.max(oi,Math.min(ri,t*ni))}function ro(t,e){let n=new ti,r=ci(t),i=new Map,o=(a,s)=>{let l=new ei(t,{vertex:ui,fragment:di,uniforms:{uSeat:{value:a},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uColor:{value:e},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),u=new Jr(t,{geometry:r,program:l});return u.frustumCulled=!1,u.setParent(n),{mesh:u,program:l,seat:a,start:s}};return{root:n,setSeats(a,s,l){let u=new Set(a.slice(0,oo).map(m=>m.id));for(let[m,d]of i)u.has(m)||(d.mesh.setParent(null),i.delete(m));for(let m of a.slice(0,oo))i.has(m.id)||i.set(m.id,o(m.position,l?s:-1/0))},update(a,s,l,u=!1){let m=!1;for(let d of i.values()){let p=s[0]-d.seat[0],f=s[1]-d.seat[1],c=s[2]-d.seat[2],g=Math.hypot(p,f,c);d.mesh.visible=!l&&g>(u?ai:si);let S=Bt(g),w=Math.max(0,Math.min(1,(a-d.start)/li));w<1&&(m=!0),d.program.uniforms.uHeight.value=S,d.program.uniforms.uRingScale.value=Math.min(S,ii),d.program.uniforms.uLift.value=u?1:1-mi(w),d.program.uniforms.uRingAlpha.value=.55+.4*(w<1?Math.sin(w*Math.PI):0)}return m},dispose(){for(let a of i.values())a.mesh.setParent(null);i.clear(),r.remove()}}}var je="#ffffff",io="#0b1220",Ke=6,hi=80,ao=14,so=88,lo=20,co={floor:{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},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}},pi=640,fi=.8,vi=11,bi="3px 7px",gi="2px 5px",uo="rgba(10,14,22,.62)",yi="#f4f7fb",mo=5,ho=2,xi=6,$e=new Set(["row","seat"]),po={floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},Ve={row:{x:66,y:20},seat:{x:52,y:22}},Ut=wn,Wt=t=>Mn(t);function Yt(t,e){let n=Wt(t),r=Wt(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Xt(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(i=>Number(n[i])/255*r+e[i-1]*(1-r))}function Si(t,e=[.04,.06,.1],n=!0){let r=Wt(e)<.42,i=r?"#f4f7fb":"#0b1220",o=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",a=n?Xt(o,e):e,s=Ut(t),l=n?7:4.5,u=s&&Yt(s,a)>=l?t:i;return r?{ink:u,backing:o,border:"rgba(210,222,245,.24)"}:{ink:u,backing:o,border:"rgba(11,18,32,.22)"}}function wi(t,e=[.04,.06,.1]){let n=Xt(uo,e),r=Ut(t);return{ink:r&&Yt(r,n)>=4.5?t:yi,backing:uo}}var Mi='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',pt=class{constructor(e,n={}){this.nodes=new Map;this.labels=[];this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;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||Mi,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,i]of this.nodes)n.has(r)||(i.remove(),this.nodes.delete(r))}setForcedDense(e){this.forcedDense=e}setSeatNumberRow(e){return e===this.seatNumberRow?!1:(this.seatNumberRow=e,!0)}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,n=>`seat:${n}`))}sizeFor(e){let n=co[e].size;return!this.narrowStage||$e.has(e)?n:Math.max(vi,n*fi)}qualityEvidence(){let e=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let i=this.nodes.get(r.id),o=i?.getBoundingClientRect(),a=!!(n&&i&&i.style.display!=="none"&&o&&o.width>0&&o.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:a,renderedFontPx:i&&Number.parseFloat(i.style.fontSize)||0,contrast:i?Number(i.dataset.qualityContrast??0):0,...a&&o?{screenBox:{x:o.x-e.x,y:o.y-e.y,width:o.width,height:o.height}}:{}}})}update(e,n,r,i,o,a){if(!this.labels.length)return;this.narrowStage=n>0&&n<pi;let s=Fn(i,o,{hasZoneLabels:this.labels.some(v=>v.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"));let l=[];for(let v of this.labels){if(!s.has(v.kind)&&!(v.kind==="seat"&&this.selectedSeatLabelIds.has(v.id)))continue;let y=v.kind==="seat"&&a&&this.selectedSeatLabelIds.has(v.id)?v.pinBase:void 0,T=y&&a?[y[0],y[1]+Bt(Math.hypot(y[0]-a[0],y[1]-a[1],y[2]-a[2])),y[2]]:v.anchor,R=ge(e,T,n,r);if(!R.visible)continue;let U=$e.has(v.kind),F=this.sizeFor(v.kind),D=Ln(v.text,F,!U)+(U?mo*2:0);if(v.kind==="seat"&&v.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(v.id)&&zn(e,v.anchor,v.seatWidthM,n)<Math.max(22,D))continue;let Y=_n(R,D/2,F/2+(U?ho:4),n,r),q=a?Math.hypot(v.anchor[0]-a[0],v.anchor[1]-a[1],v.anchor[2]-a[2]):1;l.push({label:v,screen:Y,focus:On(Y,q,n,r),halfWidth:D/2,...this.selectedSeatLabelIds.has(v.id)?{priority:1}:{}})}let u=Dn(l.filter(v=>v.label.kind==="floor"),n),m=[...l.filter(v=>!$e.has(v.label.kind)&&v.label.kind!=="floor"),...u],d=kn(n),p=l.filter(v=>v.label.kind==="seat"&&this.selectedSeatLabelIds.has(v.label.id)),f=ct(p,Ve.seat.x,Ve.seat.y,d.seat);this.placePinHeads(p.filter(v=>v.label.pinBase&&!f.includes(v)).map(v=>v.screen));let c=In(m,so,lo).filter(v=>!f.some(y=>Vn(v,y,so,lo))),g=ct(l.filter(v=>v.label.kind==="row"),Ve.row.x,Ve.row.y,d.row,[...c,...f]),S=this.seatNumberRow!==void 0,w=ct(l.filter(v=>v.label.kind==="seat"&&!this.selectedSeatLabelIds.has(v.label.id)&&(!S||this.seatNumberRow!==null&&v.label.rowId===this.seatNumberRow)),Ve.seat.x,Ve.seat.y,S?hi:d.seat-f.length,[...c,...f,...g]),I=[...c,...g,...f,...w],P=new Set(I.map(v=>v.label.id));for(let{label:v,screen:y}of I){let R=this.nodeFor(v).style;R.display="";let U=!!v.pinBase&&this.selectedSeatLabelIds.has(v.id);R.transform=U?`translate(-50%, -100%) translate(${y.x.toFixed(1)}px, ${(y.y-Ke).toFixed(1)}px)`:`translate(-50%, -50%) translate(${y.x.toFixed(1)}px, ${y.y.toFixed(1)}px)`}let W=I.filter(({label:v})=>!$e.has(v.kind)).sort((v,y)=>po[y.label.kind]-po[v.label.kind]||v.screen.depth-y.screen.depth||v.focus-y.focus).flatMap(({label:v})=>{let y=this.nodes.get(v.id);return y&&y.style.display!=="none"?[{node:y,box:y.getBoundingClientRect()}]:[]}),H=[];for(let{node:v,box:y}of W)H.some(R=>y.left<R.right+3&&y.right+3>R.left&&y.top<R.bottom+3&&y.bottom+3>R.top)?v.style.display="none":H.push(y);for(let[v,y]of this.nodes)P.has(v)||(y.style.display="none")}nodeFor(e){let n=this.nodes.get(e.id);if(!n){n=document.createElement("div");let g=n.style;g.position="absolute",g.left="0",g.top="0",g.whiteSpace="nowrap",g.textShadow="0 1px 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.55)",g.display="none",this.root.appendChild(n),this.nodes.set(e.id,n)}let r=this.selectedSeatLabelIds.has(e.id),i=this.nodeAppearance.get(n);if(i&&i.text===e.text&&i.kind===e.kind&&i.color===e.color&&i.selected===r&&i.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:e.text,kind:e.kind,color:e.color,selected:r,narrow:this.narrowStage}),n.textContent=e.text,r){let g=document.createElement("span"),S=g.style;S.position="absolute",S.left="50%",S.bottom=`-${Ke}px`,S.transform="translateX(-50%)",S.borderLeft=`${Ke}px solid transparent`,S.borderRight=`${Ke}px solid transparent`,S.borderTop=`${Ke}px solid ${je}`,n.appendChild(g)}n.setAttribute("data-label-kind",e.kind),n.toggleAttribute("data-selected-seat",r);let o=co[e.kind],a=n.style;a.fontSize=`${this.sizeFor(e.kind)}px`,a.fontWeight=r?"800":o.weight,a.opacity=r?"1":String(o.opacity);let s=$e.has(e.kind),l=!s,u=Si(e.color??this.opts.ink,this.opts.backgroundRgb,!0),m=s?wi(e.color??this.opts.ink,this.opts.backgroundRgb):u;a.color=r?io:m.ink,a.background=r?je:m.backing,a.border=r?`1px solid ${je}`:l?`1px solid ${u.border}`:"",a.borderRadius=r||l?"999px":`${xi}px`;let d=this.narrowStage?gi:bi;a.padding=r||l?d:`${ho}px ${mo}px`,a.lineHeight=s?"1.1":"",a.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)":l?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",a.textShadow=r?"none":"0 1px 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.55)",a.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let p=this.opts.backgroundRgb??[.04,.06,.1],f=Ut(r?io:m.ink)??[1,1,1],c=Xt(r?je:m.backing,p);return n.dataset.qualityContrast=Yt(f,c).toFixed(3),a.textTransform=e.kind==="zone"||e.kind==="floor"?"uppercase":"",n}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=`${ao}px`,r.height=`${ao}px`,r.borderRadius="50%",r.background=je,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 i=e[r];n.style.display=i?"":"none",i&&(n.style.transform=`translate(-50%, -100%) translate(${i.x.toFixed(1)}px, ${i.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var Ai=1;var Pi=new Set(["floor","zone","section","ga","booth","annotation"]);function Ci(t){return t.every(e=>Number.isFinite(e))}function Ei(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 fo(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function Ee(t){return Math.round(t*1e4)/1e4}function Ri(t){if(t)return{box:{x:Ee(t.box.x),y:Ee(t.box.y),width:Ee(t.box.width),height:Ee(t.box.height)},horizontalFillRatio:Ee(t.horizontalFillRatio),verticalFillRatio:Ee(t.verticalFillRatio),visibleAreaRatio:Ee(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function ye(t,e,n){return n.length?{code:t,message:e,count:n.length,samples:n.slice(0,20)}:null}function qt(t){let e=t.labels.filter(s=>s.visible&&s.screenBox),n=e.filter(s=>Pi.has(s.kind)),r=t.scene.floorCount>1?t.scene.floorCount:t.scene.zoneCount||t.scene.sectionCount,i=[];for(let s=0;s<n.length;s+=1)for(let l=0;l<s;l+=1)Ei(n[s].screenBox,n[l].screenBox)&&i.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[l].id});let o=[...t.camera.position,t.camera.distance,t.camera.verticalFovDeg],a=[ye("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),ye("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),ye("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),ye("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}`}]),ye("camera-invalid","The capture camera must have a finite physical pose",Ci(o)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),ye("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}]),ye("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`}]),ye("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}))),ye("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}))),ye("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",i)].filter(s=>!!s);return{version:1,state:"venue3d",passed:a.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:u})=>({id:s,kind:l,text:u})).sort((s,l)=>s.kind.localeCompare(l.kind)||s.id.localeCompare(l.id)),framing:Ri(t.framing)},metrics:{minimumHierarchyFontPx:fo(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:fo(n.map(s=>s.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:a}}function vo(t,e,n){t.fill(0);for(let r=0;r<Math.min(n,e.length);r++)t[e[r]]=1}import{Geometry as Qe,Mesh as Ze,Program as Zi,Texture as Ji,Transform as Do}from"ogl";import{Program as Re}from"ogl";var ft=`
|
|
29
|
+
}`;function Da(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 Qt(t){return Math.max(Ma,Math.min(Pa,t*wa))}function So(t,e){let n=new Sa,r=Ta(t),a=new Map,o=(i,s)=>{let l=new xa(t,{vertex:_a,fragment:Ia,uniforms:{uSeat:{value:i},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uColor:{value:e},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),c=new ya(t,{geometry:r,program:l});return c.frustumCulled=!1,c.setParent(n),{mesh:c,program:l,seat:i,start:s}};return{root:n,setSeats(i,s,l){let c=new Set(i.slice(0,xo).map(d=>d.id));for(let[d,h]of a)c.has(d)||(h.mesh.setParent(null),a.delete(d));for(let d of i.slice(0,xo))a.has(d.id)||a.set(d.id,o(d.position,l?s:-1/0))},update(i,s,l,c=!1){let d=!1;for(let h of a.values()){let p=s[0]-h.seat[0],f=s[1]-h.seat[1],u=s[2]-h.seat[2],y=Math.hypot(p,f,u);h.mesh.visible=!l&&y>(c?Ca:Ea);let v=Qt(y),M=Math.max(0,Math.min(1,(i-h.start)/Ra));M<1&&(d=!0),h.program.uniforms.uHeight.value=v,h.program.uniforms.uRingScale.value=Math.min(v,Aa),h.program.uniforms.uLift.value=c?1:1-Da(M),h.program.uniforms.uRingAlpha.value=.55+.4*(M<1?Math.sin(M*Math.PI):0)}return d},dispose(){for(let i of a.values())i.mesh.setParent(null);a.clear(),r.remove()}}}var Ze="#ffffff",wo="#0b1220",Je=6,Fa=80,Mo=14,Po=88,Ao=20,Co={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},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}},La=640,Va=.8,ka=11,Oa="3px 7px",za="2px 5px",Eo="rgba(10,14,22,.62)",Na="#f4f7fb",Ro=5,To=2,Ha=6,et=new Set(["row","seat","access"]),_o={stage:6,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},ke={row:{x:66,y:20},seat:{x:52,y:22}},tt=Vn,Zt=t=>kn(t);function gt(t,e){let n=Zt(t),r=Zt(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Jt(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 Ga(t,e=[.04,.06,.1],n=!0){let r=Zt(e)<.42,a=r?"#f4f7fb":"#0b1220",o=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",i=n?Jt(o,e):e,s=tt(t),l=n?7:4.5,c=s&>(s,i)>=l?t:a;return r?{ink:c,backing:o,border:"rgba(210,222,245,.24)"}:{ink:c,backing:o,border:"rgba(11,18,32,.22)"}}function Ba(t,e=[.04,.06,.1]){let n=Jt(Eo,e),r=tt(t);return{ink:r&>(r,n)>=4.5?t:Na,backing:Eo}}var Wa=.8,Oe=20,Ua=14,Ya=60,Xa='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',yt=class{constructor(e,n={}){this.nodes=new Map;this.labels=[];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||Xa,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)}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,n=>`seat:${n}`))}sizeFor(e){let n=Co[e].size;return!this.narrowStage||et.has(e)?n:Math.max(ka,n*Va)}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<La;let s=Un(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*Wa&&(s.delete("section"),s.delete("ga"));let l=[];for(let g of this.labels){if(!s.has(g.kind)&&!(g.kind==="seat"&&this.selectedSeatLabelIds.has(g.id)))continue;let A=g.kind==="seat"&&i&&this.selectedSeatLabelIds.has(g.id)?g.pinBase:void 0,w=A&&i?[A[0],A[1]+Qt(Math.hypot(A[0]-i[0],A[1]-i[1],A[2]-i[2])),A[2]]:g.anchor,_=xe(e,w,n,r);if(!_.visible)continue;let O=et.has(g.kind),C=this.sizeFor(g.kind),V=g.kind==="access"?Oe:jn(g.text,C,!O)+(O?Ro*2:0);if(g.kind==="access"&&g.seatWidthM!==void 0&&Bt(e,g.anchor,g.seatWidthM,n)<Ua||g.kind==="seat"&&g.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(g.id)&&Bt(e,g.anchor,g.seatWidthM,n)<Math.max(22,V))continue;let N=Yn(_,V/2,C/2+(O?To:4),n,r),W=i?Math.hypot(g.anchor[0]-i[0],g.anchor[1]-i[1],g.anchor[2]-i[2]):1;l.push({label:g,screen:N,focus:$n(N,W,n,r),halfWidth:V/2,...this.selectedSeatLabelIds.has(g.id)?{priority:1}:{}})}let c=Wn(l.filter(g=>g.label.kind==="floor"),n),d=[...l.filter(g=>!et.has(g.label.kind)&&g.label.kind!=="floor"),...c],h=Kn(n),p=l.filter(g=>g.label.kind==="seat"&&this.selectedSeatLabelIds.has(g.label.id)),f=je(p,ke.seat.x,ke.seat.y,h.seat);this.placePinHeads(p.filter(g=>g.label.pinBase&&!f.includes(g)).map(g=>g.screen));let u=Xn(d,Po,Ao).filter(g=>!f.some(A=>qn(g,A,Po,Ao))),y=je(l.filter(g=>g.label.kind==="access"),Oe,Oe,Ya,[...u,...f]),v=je(l.filter(g=>g.label.kind==="row"),ke.row.x,ke.row.y,h.row,[...u,...f,...y]),M=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,I=je(l.filter(g=>g.label.kind==="seat"&&!this.selectedSeatLabelIds.has(g.label.id)&&(this.seatNumberSeat!==null?g.label.id===this.seatNumberSeat:!M||this.seatNumberRow!==null&&g.label.rowId===this.seatNumberRow)),ke.seat.x,ke.seat.y,M?Fa:h.seat-f.length,[...u,...f,...y,...v]),S=[...u,...y,...v,...f,...I],T=new Set(S.map(g=>g.label.id));for(let{label:g,screen:A}of S){let _=this.nodeFor(g).style;_.display=g.kind==="access"?"flex":"";let O=!!g.pinBase&&this.selectedSeatLabelIds.has(g.id);_.transform=O?`translate(-50%, -100%) translate(${A.x.toFixed(1)}px, ${(A.y-Je).toFixed(1)}px)`:`translate(-50%, -50%) translate(${A.x.toFixed(1)}px, ${A.y.toFixed(1)}px)`}let D=S.filter(({label:g})=>!et.has(g.kind)).sort((g,A)=>_o[A.label.kind]-_o[g.label.kind]||g.screen.depth-A.screen.depth||g.focus-A.focus).flatMap(({label:g})=>{let A=this.nodes.get(g.id);return A&&A.style.display!=="none"?[{node:A,box:A.getBoundingClientRect()}]:[]}),L=[];for(let{node:g,box:A}of D)L.some(_=>A.left<_.right+3&&A.right+3>_.left&&A.top<_.bottom+3&&A.bottom+3>_.top)?g.style.display="none":L.push(A);for(let[g,A]of this.nodes)T.has(g)||(A.style.display="none")}nodeFor(e){let n=this.nodes.get(e.id);if(!n){n=document.createElement("div");let y=n.style;y.position="absolute",y.left="0",y.top="0",y.whiteSpace="nowrap",y.display="none",this.root.appendChild(n),this.nodes.set(e.id,n)}let r=this.selectedSeatLabelIds.has(e.id),a=this.nodeAppearance.get(n);if(a&&a.text===e.text+(e.icon??"")&&a.kind===e.kind&&a.color===e.color&&a.selected===r&&a.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:e.text+(e.icon??""),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 y=document.createElement("span"),v=y.style;v.position="absolute",v.left="50%",v.bottom=`-${Je}px`,v.transform="translateX(-50%)",v.borderLeft=`${Je}px solid transparent`,v.borderRight=`${Je}px solid transparent`,v.borderTop=`${Je}px solid ${Ze}`,n.appendChild(y)}n.setAttribute("data-label-kind",e.kind),n.toggleAttribute("data-selected-seat",r);let o=Co[e.kind],i=n.style;i.fontSize=`${this.sizeFor(e.kind)}px`,i.fontWeight=r?"800":o.weight,i.opacity=r?"1":String(o.opacity);let s=et.has(e.kind),l=!s,c=Ga(e.color??this.opts.ink,this.opts.backgroundRgb,!0),d=s?Ba(e.color??this.opts.ink,this.opts.backgroundRgb):c;i.color=r?wo:d.ink,i.background=r?Ze:d.backing,i.border=r?`1px solid ${Ze}`:l?`1px solid ${c.border}`:"",i.borderRadius=r||l?"999px":`${Ha}px`;let h=this.narrowStage?za:Oa;i.padding=r||l?h:`${To}px ${Ro}px`,i.lineHeight=s?"1.1":"",i.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)":l?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",i.textShadow=r||l?"none":"0 1px 1px rgba(0,0,0,0.4)",i.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let p=this.opts.backgroundRgb??[.04,.06,.1],f=tt(r?wo:d.ink)??[1,1,1],u=Jt(r?Ze:d.backing,p);return n.dataset.qualityContrast=gt(f,u).toFixed(3),i.textTransform=e.kind==="zone"||e.kind==="floor"?"uppercase":"",n}paintAccessChip(e,n){e.setAttribute("data-label-kind","access"),e.setAttribute("data-access-type",n.icon??""),e.innerHTML=n.icon?Ln(n.icon,{size:Oe-6}):"";let r=e.style;return r.width=`${Oe}px`,r.height=`${Oe}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=gt(tt(n.ink??"#ffffff")??[1,1,1],tt(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=`${Mo}px`,r.height=`${Mo}px`,r.borderRadius="50%",r.background=Ze,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 qa=1;var ja=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function Ka(t){return t.every(e=>Number.isFinite(e))}function $a(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 Io(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function Re(t){return Math.round(t*1e4)/1e4}function Qa(t){if(t)return{box:{x:Re(t.box.x),y:Re(t.box.y),width:Re(t.box.width),height:Re(t.box.height)},horizontalFillRatio:Re(t.horizontalFillRatio),verticalFillRatio:Re(t.verticalFillRatio),visibleAreaRatio:Re(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function Se(t,e,n){return n.length?{code:t,message:e,count:n.length,samples:n.slice(0,20)}:null}function en(t){let e=t.labels.filter(s=>s.visible&&s.screenBox),n=e.filter(s=>ja.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)$a(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=[Se("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),Se("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),Se("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),Se("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}`}]),Se("camera-invalid","The capture camera must have a finite physical pose",Ka(o)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),Se("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}]),Se("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`}]),Se("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}))),Se("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}))),Se("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:c})=>({id:s,kind:l,text:c})).sort((s,l)=>s.kind.localeCompare(l.kind)||s.id.localeCompare(l.id)),framing:Qa(t.framing)},metrics:{minimumHierarchyFontPx:Io(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:Io(n.map(s=>s.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:i}}function Do(t,e,n){t.fill(0);for(let r=0;r<Math.min(n,e.length);r++)t[e[r]]=1}import{Geometry as nt,Mesh as ot,Program as wi,Texture as Mi,Transform as qo}from"ogl";import{Program as Te}from"ogl";var xt=`
|
|
30
30
|
float chairWeight(float depth) {
|
|
31
31
|
return 1.0 - smoothstep(uChairFull, uChairNone, depth);
|
|
32
|
-
}`,
|
|
32
|
+
}`,Fo=`
|
|
33
33
|
float occupantWeight(float depth) {
|
|
34
|
-
float nearWeight = smoothstep(${
|
|
35
|
-
float farWeight = 1.0 - smoothstep(${
|
|
34
|
+
float nearWeight = smoothstep(${fo.toFixed(1)}, ${vo.toFixed(1)}, depth);
|
|
35
|
+
float farWeight = 1.0 - smoothstep(${ho.toFixed(1)}, ${po.toFixed(1)}, depth);
|
|
36
36
|
return nearWeight * farWeight;
|
|
37
|
-
}`,
|
|
37
|
+
}`,tn=`
|
|
38
38
|
float glyphEq(float glyph, float expected) {
|
|
39
39
|
return 1.0 - step(0.25, abs(glyph - expected));
|
|
40
40
|
}
|
|
@@ -83,7 +83,20 @@ vec3 glyphChairPosition(vec3 p, float partId, float glyph) {
|
|
|
83
83
|
p.y += 0.16;
|
|
84
84
|
}
|
|
85
85
|
return p;
|
|
86
|
-
}`,
|
|
86
|
+
}`,Za=1.5,ze=`
|
|
87
|
+
uniform vec4 uSeeThrough; // xyz = the seats looked at, w = cone radius there; 0 = off
|
|
88
|
+
bool seeThroughCut(vec3 p, vec3 eye) {
|
|
89
|
+
if (uSeeThrough.w <= 0.0) return false;
|
|
90
|
+
vec3 axis = uSeeThrough.xyz - eye;
|
|
91
|
+
float len = length(axis);
|
|
92
|
+
if (len < 1.0) return false;
|
|
93
|
+
vec3 dir = axis / len;
|
|
94
|
+
float t = dot(p - eye, dir);
|
|
95
|
+
if (t <= 0.0 || t > len - ${Za.toFixed(2)}) return false;
|
|
96
|
+
vec3 onLine = eye + dir * t;
|
|
97
|
+
if (p.y < onLine.y - 0.25) return false;
|
|
98
|
+
return length(p - onLine) < uSeeThrough.w * t / len;
|
|
99
|
+
}`,Ja=`#version 300 es
|
|
87
100
|
precision highp float;
|
|
88
101
|
in vec3 position;
|
|
89
102
|
in vec3 normal;
|
|
@@ -121,7 +134,13 @@ void main() {
|
|
|
121
134
|
vNormalWorld = normalize(mat3(modelMatrix) * normal);
|
|
122
135
|
vColor = color;
|
|
123
136
|
gl_Position = projectionMatrix * mv;
|
|
124
|
-
}`,
|
|
137
|
+
}`,Lo=`
|
|
138
|
+
bool roomWallHidden(float material, vec3 normalWorld, vec3 posWorld, vec3 eye, vec2 roomCentre) {
|
|
139
|
+
if (abs(material - 6.0) > 0.5) return false;
|
|
140
|
+
vec3 n = normalize(normalWorld);
|
|
141
|
+
if (abs(n.y) > 0.5) return true;
|
|
142
|
+
return dot(n.xz, eye.xz - posWorld.xz) * dot(n.xz, roomCentre - posWorld.xz) <= 0.0;
|
|
143
|
+
}`,ei=`#version 300 es
|
|
125
144
|
precision highp float;
|
|
126
145
|
in vec3 vColor;
|
|
127
146
|
in vec3 vNormalWorld;
|
|
@@ -138,7 +157,11 @@ uniform float uSectionFilter;
|
|
|
138
157
|
uniform float uFocusFloor;
|
|
139
158
|
uniform sampler2D tVenueShadow;
|
|
140
159
|
uniform mat4 uShadowMatrix;
|
|
160
|
+
uniform vec3 cameraPosition;
|
|
161
|
+
uniform vec2 uRoomCentre;
|
|
141
162
|
out vec4 fragColor;
|
|
163
|
+
${Lo}
|
|
164
|
+
${ze}
|
|
142
165
|
// Stable world-space variation; no textures or per-frame random grain.
|
|
143
166
|
float turfHash(vec2 p) {
|
|
144
167
|
vec3 q = fract(vec3(p.xyx) * 0.1031);
|
|
@@ -177,6 +200,8 @@ float architecturalLight(vec3 normal) {
|
|
|
177
200
|
}
|
|
178
201
|
void main() {
|
|
179
202
|
if (vDim > 0.5) discard;
|
|
203
|
+
if (roomWallHidden(vMaterial, vNormalWorld, vPosWorld, cameraPosition, uRoomCentre)) discard;
|
|
204
|
+
if (seeThroughCut(vPosWorld, cameraPosition)) discard;
|
|
180
205
|
// Row treads (material 3) and risers (material 2) are chart truth: the
|
|
181
206
|
// stepped deck IS the stand, at every distance. What must not survive at
|
|
182
207
|
// whole-venue scale is the risers' darker shade \u2014 hundreds of sub-pixel dark
|
|
@@ -227,7 +252,13 @@ void main() {
|
|
|
227
252
|
// of crushing to a single flat value.
|
|
228
253
|
vec3 fillDir = normalize(vec3(-uKeyDir.x, 0.25, -uKeyDir.z));
|
|
229
254
|
float fill = max(dot(N, fillDir), 0.0);
|
|
230
|
-
|
|
255
|
+
// More sun, less flat ambient: at 0.40-0.68 ambient against a 0.46 key every
|
|
256
|
+
// face read at nearly one value and venues looked flat beside a lit reference
|
|
257
|
+
// (3D Digital Venue comparison, 2026-09-24). Lit and turned faces now part.
|
|
258
|
+
// The fill keeps the turned faces from going charcoal: at 0.10 a wall facing
|
|
259
|
+
// away from the sun kept about half its colour, and the walls under every
|
|
260
|
+
// tier and box read as dark blocks (owner, 2026-09-24).
|
|
261
|
+
vec3 base = vColorRung * (0.34 + 0.26 * hemi) * mix(0.72, 1.0, visibility) + vColorRung * key * 0.60 + vColorRung * fill * 0.26;
|
|
231
262
|
float fres = pow(1.0 - max(dot(normalize(vNormalView), V), 0.0), 3.0);
|
|
232
263
|
// Material 1 is a powered display and keeps its authored emission treatment.
|
|
233
264
|
// Every architectural material uses the venue roughness token; 0.78 maps to
|
|
@@ -261,8 +292,8 @@ void main() {
|
|
|
261
292
|
+ vec3(0.20, 0.10, 0.34) * focalHalo;
|
|
262
293
|
base = mix(base, display, poweredDisplay * verticalFace * 0.92);
|
|
263
294
|
fragColor = vec4(base, 1.0);
|
|
264
|
-
}`,
|
|
265
|
-
${
|
|
295
|
+
}`,Vo=`
|
|
296
|
+
${tn}
|
|
266
297
|
vec4 seatSurface(vec3 source, float radius) {
|
|
267
298
|
vec4 origin = modelViewMatrix * vec4(iOffset, 1.0);
|
|
268
299
|
if (iPhysicalSeat < 0.5) {
|
|
@@ -276,12 +307,12 @@ vec4 seatSurface(vec3 source, float radius) {
|
|
|
276
307
|
if (surface < 0.5) return origin;
|
|
277
308
|
vec3 p = glyphChairPosition(source, surface, iGlyph);
|
|
278
309
|
p.xz *= iChairWidth;
|
|
279
|
-
if (surface > 1.5) p.z -= max(p.y - ${
|
|
310
|
+
if (surface > 1.5) p.z -= max(p.y - ${Ee.toFixed(2)}, 0.0) * ${Xe.toFixed(2)} * glyphBackRake(iGlyph);
|
|
280
311
|
float c = cos(iYaw), s = sin(iYaw);
|
|
281
312
|
vec3 rotated = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
282
313
|
return modelViewMatrix * vec4(iOffset + rotated, 1.0);
|
|
283
314
|
}
|
|
284
|
-
`,
|
|
315
|
+
`,ti=`#version 300 es
|
|
285
316
|
precision highp float;
|
|
286
317
|
in float surface;
|
|
287
318
|
in float iYaw;
|
|
@@ -320,9 +351,12 @@ out float vSectionFade;
|
|
|
320
351
|
out float vDotWeight; // 1 = the dot IS this seat, 0 = the chair has taken over
|
|
321
352
|
out float vPhysicalSeat;
|
|
322
353
|
out float vPixelRadius;
|
|
323
|
-
|
|
324
|
-
${
|
|
354
|
+
uniform vec3 cameraPosition;
|
|
355
|
+
${xt}
|
|
356
|
+
${Vo}
|
|
357
|
+
${ze}
|
|
325
358
|
void main() {
|
|
359
|
+
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
326
360
|
vec4 mv = modelViewMatrix * vec4(iOffset, 1.0);
|
|
327
361
|
float depth = max(-mv.z, 0.001);
|
|
328
362
|
// Hand the seat over to the chair mesh as it comes into range. Derived from
|
|
@@ -342,7 +376,7 @@ void main() {
|
|
|
342
376
|
mv = seatSurface(position, r);
|
|
343
377
|
// Match the shell's non-uniform width/depth scale before its back rake.
|
|
344
378
|
vec3 n = vec3(normal.x / iChairWidth, normal.y, normal.z / iChairWidth);
|
|
345
|
-
if (surface > 1.5) n.y += n.z * ${
|
|
379
|
+
if (surface > 1.5) n.y += n.z * ${Xe.toFixed(2)} * glyphBackRake(iGlyph);
|
|
346
380
|
n = normalize(n);
|
|
347
381
|
vSeatNormal = vec3(n.x * cos(iYaw) + n.z * sin(iYaw), n.y, -n.x * sin(iYaw) + n.z * cos(iYaw));
|
|
348
382
|
vSeatHeight = position.y;
|
|
@@ -354,13 +388,13 @@ void main() {
|
|
|
354
388
|
vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
|
|
355
389
|
vSectionFade = (uFocusSection < -0.5 || abs(iSection - uFocusSection) < 0.5) ? 0.0 : 1.0;
|
|
356
390
|
gl_Position = projectionMatrix * mv;
|
|
357
|
-
}`,
|
|
391
|
+
}`,ko=`
|
|
358
392
|
float seatSilhouette(vec2 uv, float physical) {
|
|
359
393
|
// Solid furniture owns its silhouette in geometry. Only empty bays need
|
|
360
394
|
// a fragment mask; cutting physical faces would open holes in the volume.
|
|
361
395
|
return mix(max(abs(uv.x), abs(uv.y)), 0.0, physical);
|
|
362
396
|
}
|
|
363
|
-
`,
|
|
397
|
+
`,ni=`#version 300 es
|
|
364
398
|
precision highp float;
|
|
365
399
|
in vec3 vSeatNormal;
|
|
366
400
|
in float vSeatHeight;
|
|
@@ -380,7 +414,7 @@ uniform float uSeatDetail; // 0 for venue/area overview; 1 in section/row/sea
|
|
|
380
414
|
uniform vec3 uFadeColor;
|
|
381
415
|
uniform float uRoughness;
|
|
382
416
|
out vec4 fragColor;
|
|
383
|
-
${
|
|
417
|
+
${ko}
|
|
384
418
|
void main() {
|
|
385
419
|
if (vDim > 0.5) discard;
|
|
386
420
|
// Same screen-door dissolve as the structure rung (uStructureDetail): the
|
|
@@ -445,7 +479,7 @@ void main() {
|
|
|
445
479
|
c = mix(c, mix(vec3(lum), vec3(0.93), 0.35), 0.45);
|
|
446
480
|
}
|
|
447
481
|
fragColor = vec4(c, alpha);
|
|
448
|
-
}`,
|
|
482
|
+
}`,oi=`#version 300 es
|
|
449
483
|
precision highp float;
|
|
450
484
|
in vec3 position; // local: x/z in units of the seat radius, y in METRES
|
|
451
485
|
in vec3 normal;
|
|
@@ -481,10 +515,13 @@ out float vSectionFade;
|
|
|
481
515
|
out float vOccupant; // 1 = this vertex belongs to a person, not to the chair
|
|
482
516
|
out vec3 vOccupantTint;
|
|
483
517
|
out float vTaken; // 1 = sold or held: not for sale
|
|
484
|
-
${
|
|
485
|
-
${
|
|
486
|
-
${
|
|
518
|
+
${xt}
|
|
519
|
+
${Fo}
|
|
520
|
+
${tn}
|
|
521
|
+
uniform vec3 cameraPosition;
|
|
522
|
+
${ze}
|
|
487
523
|
void main() {
|
|
524
|
+
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
488
525
|
vec4 anchor = modelViewMatrix * vec4(iOffset, 1.0);
|
|
489
526
|
float viewDepth = -anchor.z;
|
|
490
527
|
float depth = max(viewDepth, 0.001);
|
|
@@ -569,7 +606,7 @@ void main() {
|
|
|
569
606
|
vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
|
|
570
607
|
vSectionFade = (uFocusSection < -0.5 || abs(iSection - uFocusSection) < 0.5) ? 0.0 : 1.0;
|
|
571
608
|
gl_Position = projectionMatrix * mv;
|
|
572
|
-
}`,
|
|
609
|
+
}`,ri=`#version 300 es
|
|
573
610
|
precision highp float;
|
|
574
611
|
in vec3 vColor;
|
|
575
612
|
in vec3 vNormalWorld;
|
|
@@ -623,7 +660,10 @@ void main() {
|
|
|
623
660
|
// Occupants rise above the 0.92 m chair back, so their ramp uses their own
|
|
624
661
|
// height or every head would clamp to full brightness and float.
|
|
625
662
|
float ao = mix(0.58, 1.0, clamp(vHeight / (vOccupant > 0.5 ? 1.30 : 0.92), 0.0, 1.0));
|
|
626
|
-
|
|
663
|
+
// Chairs follow the structure's balance (see SOLID_FRAG): more sun, less
|
|
664
|
+
// ambient, so seat pads, backs and arms separate instead of reading as one
|
|
665
|
+
// coloured mass.
|
|
666
|
+
vec3 base = tint * partShade * ao * (0.52 + 0.26 * hemi) + tint * key * 0.40 + tint * fill * 0.14;
|
|
627
667
|
float fres = pow(1.0 - max(dot(normalize(vNormalView), V), 0.0), 3.0);
|
|
628
668
|
// A restrained furniture rim keeps the low-poly edges from looking outlined.
|
|
629
669
|
// Occupant silhouettes retain their existing stronger separation.
|
|
@@ -644,25 +684,45 @@ void main() {
|
|
|
644
684
|
base = mix(base, mix(vec3(lum), vec3(0.93), 0.35), 0.45);
|
|
645
685
|
}
|
|
646
686
|
fragColor = vec4(base, 1.0);
|
|
647
|
-
}`,
|
|
687
|
+
}`,ai=`#version 300 es
|
|
648
688
|
precision highp float;
|
|
649
689
|
in vec2 position;
|
|
650
690
|
out vec2 vUv;
|
|
651
691
|
void main() {
|
|
652
692
|
vUv = position * 0.5 + 0.5;
|
|
653
693
|
gl_Position = vec4(position, 0.999, 1.0);
|
|
654
|
-
}`,
|
|
694
|
+
}`,ii=`#version 300 es
|
|
655
695
|
precision highp float;
|
|
656
696
|
in vec2 vUv;
|
|
657
697
|
uniform vec3 uTop;
|
|
658
698
|
uniform vec3 uBottom;
|
|
699
|
+
uniform float uSky; // 1 for an open-air venue, see SceneModel.outdoor
|
|
700
|
+
uniform vec3 uZenith;
|
|
701
|
+
uniform vec3 uHorizon;
|
|
702
|
+
uniform mat4 uInvViewProj;
|
|
659
703
|
out vec4 fragColor;
|
|
660
704
|
void main() {
|
|
661
705
|
vec3 col = mix(uBottom, uTop, vUv.y);
|
|
662
706
|
vec2 c = vUv - 0.5;
|
|
663
707
|
float vig = 1.0 - dot(c, c) * 0.16; // soft vignette
|
|
664
|
-
|
|
665
|
-
|
|
708
|
+
col *= vig;
|
|
709
|
+
// Above the horizon an open-air venue has a sky, not the chart's flat
|
|
710
|
+
// backdrop: from a seat, the stands used to meet a black void. Below the
|
|
711
|
+
// horizon (every overview) nothing changes.
|
|
712
|
+
if (uSky > 0.5) {
|
|
713
|
+
vec2 ndc = vUv * 2.0 - 1.0;
|
|
714
|
+
vec4 near = uInvViewProj * vec4(ndc, -1.0, 1.0);
|
|
715
|
+
vec4 far = uInvViewProj * vec4(ndc, 1.0, 1.0);
|
|
716
|
+
vec3 dir = normalize(far.xyz / far.w - near.xyz / near.w);
|
|
717
|
+
float up = dir.y;
|
|
718
|
+
vec3 sky = mix(uHorizon, uZenith, pow(clamp(up, 0.0, 1.0), 0.45));
|
|
719
|
+
// Reaching a little below the horizon too: from a low seat the far stands
|
|
720
|
+
// top out right at it, and a sliver of backdrop showed as a dark band.
|
|
721
|
+
// Every overview looks further down than this (at least ~24 degrees).
|
|
722
|
+
col = mix(col, sky, smoothstep(-0.22, 0.03, up));
|
|
723
|
+
}
|
|
724
|
+
fragColor = vec4(col, 1.0);
|
|
725
|
+
}`,si=`#version 300 es
|
|
666
726
|
precision highp float;
|
|
667
727
|
in float surface;
|
|
668
728
|
in float iYaw;
|
|
@@ -690,9 +750,12 @@ out float vPhysicalSeat;
|
|
|
690
750
|
out float vDotWeight;
|
|
691
751
|
out float vHidden;
|
|
692
752
|
flat out vec3 vPick;
|
|
693
|
-
|
|
694
|
-
${
|
|
753
|
+
uniform vec3 cameraPosition;
|
|
754
|
+
${xt}
|
|
755
|
+
${Vo}
|
|
756
|
+
${ze}
|
|
695
757
|
void main() {
|
|
758
|
+
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
696
759
|
int id = gl_InstanceID + 1; // 0 reserved for no-hit
|
|
697
760
|
vPick = vec3(float(id & 255), float((id >> 8) & 255), float((id >> 16) & 255)) / 255.0;
|
|
698
761
|
vec4 mv = modelViewMatrix * vec4(iOffset, 1.0);
|
|
@@ -705,7 +768,7 @@ void main() {
|
|
|
705
768
|
vPhysicalSeat = iPhysicalSeat;
|
|
706
769
|
vHidden = (uFocusFloor > -0.5 && abs(iFloor - uFocusFloor) > 0.5) ? 1.0 : 0.0;
|
|
707
770
|
gl_Position = projectionMatrix * mv;
|
|
708
|
-
}`,
|
|
771
|
+
}`,li=`#version 300 es
|
|
709
772
|
precision highp float;
|
|
710
773
|
in vec2 vUv;
|
|
711
774
|
in float vPhysicalSeat;
|
|
@@ -713,7 +776,7 @@ in float vDotWeight;
|
|
|
713
776
|
in float vHidden;
|
|
714
777
|
flat in vec3 vPick;
|
|
715
778
|
out vec4 fragColor;
|
|
716
|
-
${
|
|
779
|
+
${ko}
|
|
717
780
|
void main() {
|
|
718
781
|
if (vHidden > 0.5) discard;
|
|
719
782
|
if (vDotWeight <= 0.99) discard;
|
|
@@ -721,7 +784,7 @@ void main() {
|
|
|
721
784
|
float d = seatSilhouette(vUv, vPhysicalSeat);
|
|
722
785
|
if (d > 1.0) discard; // hit-mask matches chair/bay shape
|
|
723
786
|
fragColor = vec4(vPick, 1.0);
|
|
724
|
-
}`,
|
|
787
|
+
}`,ci=`#version 300 es
|
|
725
788
|
precision highp float;
|
|
726
789
|
in vec3 position;
|
|
727
790
|
in float part;
|
|
@@ -743,10 +806,13 @@ uniform float uFocusFloor;
|
|
|
743
806
|
flat out vec3 vPick;
|
|
744
807
|
out float vChairWeight;
|
|
745
808
|
out float vHidden;
|
|
746
|
-
|
|
747
|
-
${
|
|
748
|
-
${
|
|
809
|
+
uniform vec3 cameraPosition;
|
|
810
|
+
${xt}
|
|
811
|
+
${Fo}
|
|
812
|
+
${tn}
|
|
813
|
+
${ze}
|
|
749
814
|
void main() {
|
|
815
|
+
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
750
816
|
int id = int(iPickIndex + 0.5); // already global index + 1
|
|
751
817
|
vPick = vec3(float(id & 255), float((id >> 8) & 255), float((id >> 16) & 255)) / 255.0;
|
|
752
818
|
vHidden = (uFocusFloor > -0.5 && abs(iFloor - uFocusFloor) > 0.5) ? 1.0 : 0.0;
|
|
@@ -779,7 +845,7 @@ void main() {
|
|
|
779
845
|
float c = cos(iYaw), s = sin(iYaw);
|
|
780
846
|
vec3 rp = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
781
847
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(iOffset + rp, 1.0);
|
|
782
|
-
}`,
|
|
848
|
+
}`,ui=`#version 300 es
|
|
783
849
|
precision highp float;
|
|
784
850
|
flat in vec3 vPick;
|
|
785
851
|
in float vHidden;
|
|
@@ -789,34 +855,56 @@ void main() {
|
|
|
789
855
|
if (vHidden > 0.5) discard;
|
|
790
856
|
if (vChairWeight < 0.01) discard;
|
|
791
857
|
fragColor = vec4(vPick, 1.0);
|
|
792
|
-
}`,
|
|
858
|
+
}`,di=`#version 300 es
|
|
793
859
|
precision highp float;
|
|
794
860
|
in vec3 position;
|
|
861
|
+
in vec3 normal;
|
|
795
862
|
in float floorIndex;
|
|
863
|
+
in float materialIndex;
|
|
864
|
+
uniform mat4 modelMatrix;
|
|
796
865
|
uniform mat4 modelViewMatrix;
|
|
797
866
|
uniform mat4 projectionMatrix;
|
|
798
867
|
uniform float uFocusFloor;
|
|
799
868
|
out float vHidden;
|
|
869
|
+
out float vMaterial;
|
|
870
|
+
out vec3 vNormalWorld;
|
|
871
|
+
out vec3 vPosWorld;
|
|
800
872
|
void main() {
|
|
801
873
|
vHidden = (uFocusFloor > -0.5 && abs(floorIndex - uFocusFloor) > 0.5) ? 1.0 : 0.0;
|
|
874
|
+
vMaterial = materialIndex;
|
|
875
|
+
vNormalWorld = mat3(modelMatrix) * normal;
|
|
876
|
+
vPosWorld = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
802
877
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
803
|
-
}`,
|
|
878
|
+
}`,mi=`#version 300 es
|
|
804
879
|
precision highp float;
|
|
805
880
|
in float vHidden;
|
|
881
|
+
in float vMaterial;
|
|
882
|
+
in vec3 vNormalWorld;
|
|
883
|
+
in vec3 vPosWorld;
|
|
884
|
+
uniform vec3 cameraPosition;
|
|
885
|
+
uniform vec2 uRoomCentre;
|
|
806
886
|
out vec4 fragColor;
|
|
887
|
+
${Lo}
|
|
888
|
+
${ze}
|
|
807
889
|
void main() {
|
|
808
890
|
if (vHidden > 0.5) discard;
|
|
891
|
+
if (roomWallHidden(vMaterial, vNormalWorld, vPosWorld, cameraPosition, uRoomCentre)) discard;
|
|
892
|
+
if (seeThroughCut(vPosWorld, cameraPosition)) discard;
|
|
809
893
|
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
810
|
-
}`;function
|
|
894
|
+
}`;function Oo(t){return new Te(t,{vertex:si,fragment:li,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uSeatRadius:{value:qe},uSeatScale:{value:1},uMinPixels:{value:Le},uPixelToWorld:{value:.002},uChairFull:{value:Qe},uChairNone:{value:Ve},uFocusFloor:{value:-1}}})}function zo(t){return new Te(t,{vertex:ci,fragment:ui,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uChairFull:{value:Qe},uChairNone:{value:Ve},uBackRake:{value:Xe},uBackBase:{value:Ee},uFocusFloor:{value:-1}}})}function No(t){return new Te(t,{vertex:di,fragment:mi,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uFocusFloor:{value:-1},uRoomCentre:{value:new Float32Array([0,0])}}})}function Ho(t,e=.78,n=[.63,.66,.65]){return new Te(t,{vertex:Ja,fragment:ei,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uDeckColor:{value:new Float32Array(n)},uSectionFilter:{value:0},uRoughness:{value:e},uRoomCentre:{value:new Float32Array([0,0])}}})}function Go(t){return new Te(t,{vertex:ti,fragment:ni,transparent:!0,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uSeatRadius:{value:qe},uSeatScale:{value:1},uMinPixels:{value:Le},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFocusSection:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:Qe},uChairNone:{value:Ve}}})}function Bo(t,e=.78){return new Te(t,{vertex:oi,fragment:ri,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:Qe},uChairNone:{value:Ve},uBackRake:{value:Xe},uBackBase:{value:Ee},uFocusFloor:{value:-1},uFocusSection:{value:-1},uRoughness:{value:e}}})}function Wo(t,e,n,r){return new Te(t,{vertex:ai,fragment:ii,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(e)},uBottom:{value:new Float32Array(n)},uSky:{value:r?1:0},uZenith:{value:new Float32Array(r?.zenith??[0,0,0])},uHorizon:{value:new Float32Array(r?.horizon??[0,0,0])},uInvViewProj:{value:new Float32Array(16)}}})}import{Camera as hi,Mat4 as pi,Mesh as fi,Program as vi,RenderTarget as bi,Transform as gi}from"ogl";function Uo(t,e,n){let a=Math.max(3,n.radius*1.04),[o,i,s]=n.center,l=new hi(t,{left:-a,right:a,bottom:-a,top:a,near:.1,far:a*6});l.position.set(o-a*1.44,i+a*2.34,s+a*1.2),l.lookAt([o,i,s]);let c=new bi(t,{width:1024,height:1024,depthTexture:!0,minFilter:t.NEAREST,magFilter:t.NEAREST}),d=new vi(t,{cullFace:!1,vertex:`#version 300 es
|
|
811
895
|
in vec3 position;
|
|
896
|
+
in float materialIndex;
|
|
812
897
|
uniform mat4 modelViewMatrix;
|
|
813
898
|
uniform mat4 projectionMatrix;
|
|
814
|
-
|
|
899
|
+
out float vMaterial;
|
|
900
|
+
void main() { vMaterial = materialIndex; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`,fragment:`#version 300 es
|
|
815
901
|
precision highp float;
|
|
902
|
+
in float vMaterial;
|
|
816
903
|
out vec4 fragColor;
|
|
817
904
|
void main() {
|
|
905
|
+
if (abs(vMaterial - 6.0) < 0.5) discard;
|
|
818
906
|
fragColor = vec4(1.0);
|
|
819
|
-
}`}),
|
|
907
|
+
}`}),h=new gi,p=new fi(t,{geometry:e,program:d});p.frustumCulled=!1,p.setParent(h);let f=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:h,camera:l,target:c})}finally{u&&t.enable(t.DITHER),t.clearColor(f[0],f[1],f[2],f[3]),d.remove()}let y=new pi().multiply(l.projectionMatrix,l.viewMatrix);return{texture:c.depthTexture,matrix:y,dispose(){for(let v of c.textures)t.deleteTexture(v.texture);t.deleteTexture(c.depthTexture.texture),t.deleteFramebuffer(c.buffer),c.depthBuffer&&t.deleteRenderbuffer(c.depthBuffer)}}}var yi=.65,xi=new Set(["dimmed","sold"]),Si=new Set(["dimmed","sold","held"]);function Yo(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?Si:xi;for(let l of t){let c=e.get(l.sectionId);if(!c||!c.length){r.add(l.sectionId);continue}let d=!1;for(let h of c){let p=ye[n[h]]??"available";if(!s.has(p)){d=!0;break}}d?r.add(l.sectionId):a=!0}return{lit:r,anyUnlit:a}}function Xo(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 c=(s.start+s.count)*3;for(let d=s.start*3;d<c;d++)e[d]=l?n[d]:n[d]+(o[d%3]-n[d])*yi;i.push(s)}return i}var jo=ye.indexOf("selected");function Pi(t,e){return[0,1,2].map(n=>t[n]*.15+.75+e[n]*.1)}function Ko(t,e,n,r,a,o){for(let i=n;i<n+r;i++){let s=o&&e[i]===0,l=o&&e[i]===jo?Pi([o[i*3],o[i*3+1],o[i*3+2]],a[jo]??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 Ai=new Float32Array([-1,-1,3,-1,-1,3]);function $o(t,e){let n=new qo,r=new qo,a=new nt(t,{position:{size:2,data:Ai}}),o=Wo(t,e.theme.background.top,e.theme.background.bottom,e.outdoor?e.theme.sky:null),i=new ot(t,{geometry:a,program:o});i.frustumCulled=!1,i.setParent(r);let s=new nt(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=Uo(t,s,e.renderBounds),c=Ho(t,e.theme.materials.roughness,e.theme.structure.tierTop);c.uniforms.tVenueShadow={value:l.texture},c.uniforms.uShadowMatrix={value:l.matrix},e.room&&c.uniforms.uRoomCentre.value.set(e.room.centre);let d=new ot(t,{geometry:s,program:c});d.frustumCulled=!1,d.setParent(n);let h=Go(t),p=new Float32Array(e.seats.count*3),f=ye.map(z=>e.theme.seatStates[z]),u=e.seats.iCategory.slice();for(let z=0;z<e.seats.count;z++){if(e.seats.iPhysicalSeat[z]<.5)continue;let J=e.theme.materials.seat??Hn([u[z*3],u[z*3+1],u[z*3+2]]);u.set(J,z*3)}Ko(p,e.seats.iState,0,e.seats.count,f,u);let y=oo(),v=new Uint8Array(e.seats.count),M=new nt(t,{position:{size:3,data:y.position},normal:{size:3,data:y.normal},uv:{size:2,data:y.uv},index:{size:1,data:y.index},surface:{size:1,data:y.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:p,instanced:1},iMaxRadius:{size:1,data:e.seats.iMaxRadius,instanced:1},iHasChair:{size:1,data:v,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}}),I=new ot(t,{geometry:M,program:h});I.frustumCulled=!1,e.seats.count>0&&I.setParent(n);let S=M.attributes.iColor,T=e.solids.color.slice(),F=e.theme.structure.ground,D=new Map(e.sectionSolidRanges.map(z=>[z.sectionId,!0])),L=zn(),g=Bo(t,e.theme.materials.roughness),A=bt,w=new Float32Array(A*3),_=new Float32Array(A*3),O=new Float32Array(A),C=new Float32Array(A),V=new Float32Array(A),N=new Float32Array(A*3),W=new Float32Array(A),G=new Float32Array(A),Y=new Float32Array(A),te=new Float32Array(A),E=new Float32Array(A),x=new nt(t,{position:{size:3,data:L.position},normal:{size:3,data:L.normal},part:{size:1,data:L.part},index:{data:L.index},iOffset:{size:3,data:w,instanced:1},iColor:{size:3,data:_,instanced:1},iRadius:{size:1,data:O,instanced:1},iYaw:{size:1,data:C,instanced:1},iGlyph:{size:1,data:V,instanced:1},iRing:{size:3,data:N,instanced:1},iFloor:{size:1,data:W,instanced:1},iSection:{size:1,data:G,instanced:1},iPhysicalSeat:{size:1,data:Y,instanced:1},iSeed:{size:1,data:E,instanced:1},iPickIndex:{size:1,data:te,instanced:1}}),P=new ot(t,{geometry:x,program:g});P.frustumCulled=!1;let B=0,j=!1,X=!1,ne=null,re=null,ue=null,de=new Int32Array(0),K=()=>{let z=e.seats;for(let J=0;J<B;J++){let q=de[J];E[J]=Gn(z.iState[q],q),_[J*3]=p[q*3],_[J*3+1]=p[q*3+1],_[J*3+2]=p[q*3+2]}x.attributes.iColor.needsUpdate=!0,x.attributes.iSeed.needsUpdate=!0},me={main:n,background:r,backgroundProgram:o,seatProgram:h,solidProgram:c,chairProgram:g,seatGeometry:M,chairGeometry:x,solidGeometry:s,drawCalls:3,setNearSeats(z,J){let q=Math.min(J,A,z.length);if(Do(v,z,q),M.attributes.iHasChair.needsUpdate=!0,de=z,B=q,q===0){P.parent&&P.setParent(null),x.instancedCount=0,me.drawCalls=3+(j?1:0);return}let oe=e.seats;for(let $=0;$<q;$++){let ee=z[$];w[$*3]=oe.iPosition[ee*3],w[$*3+1]=oe.iPosition[ee*3+1],w[$*3+2]=oe.iPosition[ee*3+2],O[$]=oe.iChairWidth[ee],C[$]=oe.iYaw[ee],V[$]=oe.iGlyph[ee],N[$*3]=oe.iRing[ee*3],N[$*3+1]=oe.iRing[ee*3+1],N[$*3+2]=oe.iRing[ee*3+2],W[$]=oe.iFloor[ee],G[$]=oe.iSection[ee],Y[$]=oe.iPhysicalSeat[ee],te[$]=ee+1}K(),x.attributes.iOffset.needsUpdate=!0,x.attributes.iRadius.needsUpdate=!0,x.attributes.iYaw.needsUpdate=!0,x.attributes.iGlyph.needsUpdate=!0,x.attributes.iRing.needsUpdate=!0,x.attributes.iFloor.needsUpdate=!0,x.attributes.iSection.needsUpdate=!0,x.attributes.iPhysicalSeat.needsUpdate=!0,x.attributes.iSeed.needsUpdate=!0,x.attributes.iPickIndex.needsUpdate=!0,x.instancedCount=q,P.parent||P.setParent(n),me.drawCalls=4+(j?1:0)},nearSeatCount(){return B},setSectionShellLit(z){c.uniforms.uSectionFilter.value=z===null?0:1;let J=Xo(e.sectionSolidRanges,e.solids.color,T,D,z,F);if(!J.length)return;let q=s.attributes.color,oe=q.buffer;if(!oe){q.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,oe);for(let $ of J){let ee=e.solids.color.subarray($.start*3,($.start+$.count)*3);t.bufferSubData(t.ARRAY_BUFFER,$.start*3*Float32Array.BYTES_PER_ELEMENT,ee)}},uploadSeatStateRuns(z){if(!z.length)return;B&&K();for(let q of z)Ko(p,e.seats.iState,q.start,q.length,f,u);let J=S.buffer;if(!J){S.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,J);for(let q of z){let oe=p.subarray(q.start*3,(q.start+q.length)*3);t.bufferSubData(t.ARRAY_BUFFER,q.start*3*Float32Array.BYTES_PER_ELEMENT,oe)}},dispose(){X=!0,l.dispose(),a.remove(),o.remove(),s.remove(),c.remove(),M.remove(),h.remove(),x.remove(),g.remove(),ne?.remove(),re?.remove(),ue?.texture&&t.deleteTexture(ue.texture)}},he=e.productionElements.find(z=>z.contentImageUrl&&z.contentPlane);if(he?.contentImageUrl&&he.contentPlane?.length===4&&typeof Image<"u"){let z=new Image;z.crossOrigin="anonymous",z.onload=()=>{if(X)return;let J=he.contentPlane;ne=new nt(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])}}),ue=new Mi(t,{image:z,generateMipmaps:!0,wrapS:t.CLAMP_TO_EDGE,wrapT:t.CLAMP_TO_EDGE,flipY:!1}),re=new wi(t,{vertex:`#version 300 es
|
|
820
908
|
precision highp float;
|
|
821
909
|
in vec3 position; in vec2 uv; in float floorIndex;
|
|
822
910
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform float uFocusFloor;
|
|
@@ -824,4 +912,4 @@ void main() {
|
|
|
824
912
|
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
|
|
825
913
|
precision highp float;
|
|
826
914
|
in vec2 vUv; in float vDim; uniform sampler2D uImage; out vec4 fragColor;
|
|
827
|
-
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:ue},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let G=new Ze(t,{geometry:oe,program:K});G.frustumCulled=!1,G.setParent(n),de.screenProgram=K,te=!0,de.drawCalls=3+(z?1:0)+1},N.src=le.contentImageUrl}return de}import{Mesh as Kt,RenderTarget as oa,Transform as $t}from"ogl";function na(t,e,n){let r=t+(e<<8)+(n<<16);return r===0?-1:r-1}function Vo(t,e,n,r,i,o){let a=-1,s=1/0;for(let l=0;l<n;l++)for(let u=0;u<e;u++){let m=(l*e+u)*4,d=na(t[m],t[m+1],t[m+2]);if(d<0||d>=o)continue;let p=u-r,f=l-i,c=p*p+f*f;c<s&&(s=c,a=d)}return a}function Lo(t,e,n,r,i,o){let a=t-n.left,s=e-n.top,l=Math.round(a*r),u=Math.round((n.height-s)*r);return{x:Math.max(0,Math.min(i-1,l)),y:Math.max(0,Math.min(o-1,u))}}var ra=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],vt=class{constructor(e,n,r,i,o){this.seatScene=new $t;this.chairScene=new $t;this.solidScene=new $t;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=So(this.gl),this.depthProg=wo(this.gl);let a=new Kt(this.gl,{geometry:n,program:this.seatProg});a.frustumCulled=!1,a.setParent(this.seatScene);let s=new Kt(this.gl,{geometry:r,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let l=new Kt(this.gl,{geometry:i,program:this.depthProg});l.frustumCulled=!1,l.setParent(this.solidScene)}setRestoreClear(e){this.restoreClear=[e[0],e[1],e[2]]}syncFromSeatProgram(e){for(let r of ra)this.seatProg.uniforms[r].value=e.uniforms[r].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}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 oa(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,i){let o=this.gl,a=this.ensureTarget(),s=o.drawingBufferWidth,l=o.drawingBufferHeight,u=Math.max(0,n-i),m=Math.max(0,r-i),d=Math.max(1,Math.min(s,n+i+1)-u),p=Math.max(1,Math.min(l,r+i+1)-m);o.enable(o.SCISSOR_TEST),o.scissor(u,m,d,p);let[f,c,g]=this.restoreClear;o.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:e,target:a,clear:!0}),this.renderer.render({scene:this.seatScene,camera:e,target:a,clear:!1}),this.renderer.render({scene:this.chairScene,camera:e,target:a,clear:!1}),o.clearColor(f,c,g,1),o.disable(o.SCISSOR_TEST);let S=new Uint8Array(d*p*4);return this.renderer.bindFramebuffer(a),o.readPixels(u,m,d,p,o.RGBA,o.UNSIGNED_BYTE,S),this.renderer.bindFramebuffer(),Vo(S,d,p,n-u,r-m,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function ko(t,e){let n=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,Cn(r.state)):n.push(r);return n}function Oo(t,e,n){let r=new Set;for(let a of e)(t.has(a)||n(a)!==void 0)&&r.add(a);let i=new Map(t),o=[];for(let[a,s]of t)r.has(a)||(o.push({seatId:a,state:be[s]??"available"}),i.delete(a));for(let a of r){if(i.has(a))continue;let s=n(a);s!==void 0&&(i.set(a,s),o.push({seatId:a,state:"selected"}))}return{updates:o,next:i}}import{Quat as Je,Vec3 as sa}from"ogl";function ia(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function zo(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function aa(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function No(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 Qt(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function Zt(t,e){return Math.max(0,Math.min(1,t+e))}function Ho(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)),i=n-1,o=Math.floor(r*i);o>=i&&(o=i-1);let a=r*i-o,s=t[Math.max(0,o-1)],l=t[o],u=t[o+1],m=t[Math.min(n-1,o+2)],d=a*a,p=d*a,f=[0,0,0];for(let c=0;c<3;c++)f[c]=.5*(2*l[c]+(-s[c]+u[c])*a+(2*s[c]-5*l[c]+4*u[c]-m[c])*d+(-s[c]+3*l[c]-3*u[c]+m[c])*p);return f}function Jt(t,e,n,r,i){let o=No(ia(e,n));o[0]===0&&o[1]===0&&o[2]===0&&(o=[0,0,1]);let a=zo(zo(e,aa(o,2.5)),[0,1.5,0]),s=[e[0]-r[0],0,e[2]-r[2]],l=No(s);l[0]===0&&l[2]===0&&(l=[o[0],0,o[2]]);let u=Math.max(1,i),m=[r[0]+l[0]*u*1.3,r[1]+u*.75,r[2]+l[2]*u*1.3];return{waypoints:[t,m,a],finalPos:a}}function en(t,e,n=35,r=28){let i=Qt(e),o=Ho(t,i),a=Qt(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:o,fov:n+(r-n)*a,eased:i}}function Uo(t,e,n){let r=t.position.clone(),i=new Je().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new sa(n[0],n[1],n[2]));let o=new Je().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(i),o}var bt=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new Je;this.endQuat=new Je;this.outQuat=new Je;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=e}start(e,n,r,i=2500,o=28){return this.settle(),this.waypoints=e,this.startQuat.copy(n),this.endQuat.copy(r),this.duration=i,this.endFov=o,this.startTime=performance.now(),this.active=!0,new Promise(a=>{this.resolveFn=a})}update(e){if(!this.active)return!1;let n=Math.min(1,(e-this.startTime)/this.duration),{pos:r,fov:i,eased:o}=en(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,Zt(o,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=i,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 Yo=An,la=.12,ca=.25,ua=1.5;function Xo(t,e,n=0,r,i){let o=[e.x*Te,n+ua,e.y*Te],a=i?[i[0],i[1],i[2]]:o,s=t[1],l=Number.isFinite(s)?s+Yo:Number.isFinite(r)?n+r:n+Yo,u=o[0]-t[0],m=o[2]-t[2],d=Math.hypot(u,m),p=d>.001?Math.min(la,d*ca):0,f=d>.001?u/d:0,c=d>.001?m/d:0;return{eye:[t[0]+f*p,l,t[2]+c*p],focal:a}}var Se=Math.PI/180,da=45,tn=80,gt=70,ma=1,ha=.99;function pa(t,e){if(!(t<ma))return tn;if(!(Number.isFinite(e)&&e>0))return gt;let n=2*Math.atan(e/(2*yt*ha)/Math.max(.05,t))/Se;return Math.max(gt,Math.min(tn,n))}var fa=.25,yt=1,va=.25,ba=12*Se,ga=.2,ya=1.5,qo=.8,jo=6,er=1.9,xa=2/3,Sa=.12,wa=.9,Ma=1.2,Aa=2,tr=.05,Pa=6;function nr(t,e,n=0){if(!t.length)return{min:[e[0]-6,n,e[2]-6],max:[e[0]+6,Math.max(n+qo,e[1]),e[2]+6]};let r=1/0,i=-1/0,o=1/0,a=-1/0,s=n;for(let c of t)r=Math.min(r,c.cx-c.halfX),i=Math.max(i,c.cx+c.halfX),o=Math.min(o,c.cz-c.halfZ),a=Math.max(a,c.cz+c.halfZ),s=Math.max(s,c.y);let l=i-r,u=a-o,m=Math.max(l,Math.min(u,jo))/2,d=Math.max(u,Math.min(l,jo))/2,p=(r+i)/2,f=(o+a)/2;return{min:[p-m,n,f-d],max:[p+m,Math.max(n+qo,s),f+d]}}function Ca(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+er,t.max[2]]}}function nn(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+ya,e+ga,e+er*xa),(t.min[2]+t.max[2])/2]}function or(t,e){let n=t[0]-e[0],r=t[2]-e[2],i=Math.hypot(n,r);return i<.001?{x:0,z:1}:{x:n/i,z:r/i}}function Ko(t,e,n){let r=e[0]-t[0],i=e[1]-t[1],o=e[2]-t[2],a=Math.hypot(r,i,o)||1;r/=a,i/=a,o/=a;let s=-o,l=r,u=Math.hypot(s,l);if(u<1e-6)return 1/0;s/=u,l/=u;let m=1/0,d=-1/0;for(let p=0;p<8;p++){let f=(p&1?n.max[0]:n.min[0])-t[0],c=(p&2?n.max[1]:n.min[1])-t[1],g=(p&4?n.max[2]:n.min[2])-t[2],S=Math.max(tr,f*r+c*i+g*o),w=(f*s+g*l)/S;w<m&&(m=w),w>d&&(d=w)}return d-m}function $o(t,e,n){let r=e[0]-t[0],i=e[1]-t[1],o=e[2]-t[2],a=Math.hypot(r,i,o)||1;r/=a,i/=a,o/=a;let s=-o,l=r,u=Math.hypot(s,l);if(u<1e-6)return 1/0;s/=u,l/=u;let m=-l*i,d=l*r-s*o,p=s*i,f=1/0,c=-1/0;for(let g=0;g<8;g++){let S=(g&1?n.max[0]:n.min[0])-t[0],w=(g&2?n.max[1]:n.min[1])-t[1],I=(g&4?n.max[2]:n.min[2])-t[2],P=Math.max(tr,S*r+w*i+I*o),E=(S*m+w*d+I*p)/P;E<f&&(f=E),E>c&&(c=E)}return c-f}function xt(t,e){return Math.tan(t*Se/2)*Math.max(.05,e)}function Qo(t,e,n){let r=pa(n,t),i=l=>Math.max(da,Math.min(r,l)),o=l=>2*Math.atan(l)/Se,a=Number.isFinite(t)&&t>0?i(o(t/(2*fa)/Math.max(.05,n))):r;if(!(Number.isFinite(e)&&e>0))return a;let s=Math.min(a,i(o(e/(2*Sa))));return t/(2*xt(s,n))>yt?a:s}function rr(t,e,n,r={}){let i=nn(e),o=[t[0],t[1],t[2]],a=0,s=0,l=c=>{if(!(c>0))return;let g=or(o,i);o[0]+=g.x*c,o[2]+=g.z*c,s+=c},u=r.preserveEye?0:e.max[1]+va-o[1];u>0&&(o[1]+=u,a=u,l(u/Math.tan(ba)));let m=Ca(e),d=Ko(o,i,e),p=Qo(d,$o(o,i,m),n),f=d/(2*xt(p,n));for(let c=0;!r.preserveEye&&c<Pa&&f>yt;c++){let g=Math.max(1,Math.hypot(o[0]-i[0],o[2]-i[2])),S=Number.isFinite(f)?f/yt:2;l(Math.min(60,g*(Math.min(4,S)-1)+.5)),d=Ko(o,i,e),p=Qo(d,$o(o,i,m),n),f=d/(2*xt(p,n))}return{eye:o,focal:i,fov:p,raisedM:a,pulledBackM:s,stageFrameWidth:f}}function Ea(t,e,n){let r=Math.tan(e*Se/2),i=xt(e,n);return Math.max(1,t/Math.max(.05,Math.min(r,i)))}var Ra=.7,Zo=.5,Ta=.8;function Jo(t,e,n){let r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],i=[n[0]-t[0],n[1]-t[1],n[2]-t[2]],o=r[0]*i[0]+r[1]*i[1]+r[2]*i[2],a=Math.hypot(r[0],r[1],r[2])*Math.hypot(i[0],i[1],i[2])||1;return Math.acos(Math.max(-1,Math.min(1,o/a)))/Se}function Da(t,e,n){let r=u=>{let m=Math.hypot(u[0],u[1],u[2])||1;return[u[0]/m,u[1]/m,u[2]/m]},i=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],o=Math.hypot(i[0],i[1],i[2]),a=r(i),s=r([n[0]-t[0],n[1]-t[1],n[2]-t[2]]),l=r([0,1,2].map(u=>a[u]*(1-Zo)+s[u]*Zo));return[t[0]+l[0]*o,t[1]+l[1]*o,t[2]+l[2]*o]}function ir(t,e){let{aspect:n,venue:r}=e,i=t.focal,o=or(t.eye,i),a=g=>(g[0]-i[0])*o.x+(g[2]-i[2])*o.z,s=[{name:"seat",eye:t.eye,focal:i,fov:t.fov}],l=Aa*(e.rowDepthM??wa),u=[t.eye[0]+o.x*l,t.eye[1]+Ma,t.eye[2]+o.z*l],m=[t.eye[0],t.eye[1]-Ra,t.eye[2]],d=Da(u,i,m);s.push({name:"row",eye:u,focal:d,fov:Math.min(tn,Math.max(t.fov,2*Math.max(Jo(u,d,m),Jo(u,d,i))/Ta))});let p=(g,S,w,I)=>{let P=Ea(w,t.fov,n)*1.08,E=P*Math.sin(I*Se),W=Number.isFinite(e.seatingTopY)?e.seatingTopY+2:-1/0,H=Math.max(E,W-S[1]),v=P*Math.cos(I*Se);return{name:g,eye:[S[0]+o.x*v,S[1]+H,S[2]+o.z*v],focal:S,fov:t.fov}};e.section&&e.section.radius>0&&s.push(p("section",e.section.center,e.section.radius,35)),s.push(p("venue",r.center,Math.max(1,r.radius),40));let f=[],c=-1/0;for(let g of s){let S=a(g.eye);f.length&&S<=c+.5||(f.push(g),c=S)}return f}import{Vec3 as Fa}from"ogl";var tt=Math.PI/180,on=320,ar=70*tt,_a=32*tt,Ia=24*tt,sr=.0026,Va=.22,La=.006,ka=180,Oa=900,za=1100,Na=4,pe=(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 cr(t){let{canvas:e,camera:n}=t,r=[],i=!1,o=0,a=0,s=0,l=0,u=0,m=0,d=on,p=null,f=()=>{p&&(clearTimeout(p),p=null)},c=!1,g=[0,0],S=0,w=!1,I=null,P=null,E=new Map,W=!1,H=0,v=0,y=0,T=0,R=()=>i&&r.length?r[pe(Math.round(o),0,r.length-1)].name:null,U=()=>{let M=R();M!==I&&(I=M,t.onStopChange?.(M))},F=()=>{if(!i||!r.length)return;let M=r[pe(Math.floor(o),0,r.length-1)],z=r[pe(Math.ceil(o),0,r.length-1)],te=pe(o-Math.floor(o),0,1),X=(Q,B)=>Q+(B-Q)*te,oe=[X(M.eye[0],z.eye[0]),X(M.eye[1],z.eye[1]),X(M.eye[2],z.eye[2])],K=[X(M.focal[0],z.focal[0]),X(M.focal[1],z.focal[1]),X(M.focal[2],z.focal[2])],ue=K[0]-oe[0],ae=K[1]-oe[1],re=K[2]-oe[2],de=Math.hypot(ue,ae,re)||1,le=Math.atan2(ue,re),N=Math.asin(pe(ae/de,-1,1)),$=le+a,G=pe(N+s,-80*tt,80*tt),ee=Math.cos(G)*de;ue=Math.sin($)*ee,ae=Math.sin(G)*de,re=Math.cos($)*ee,n.position.set(oe[0],oe[1],oe[2]),n.fov=X(M.fov,z.fov),n.updateProjectionMatrix(),n.lookAt(new Fa(oe[0]+ue,oe[1]+ae,oe[2]+re)),t.onApplied?.()},D=()=>{if(!i||!r.length)return;let M=pe(Math.round(o),0,r.length-1);if(t.reducedMotion()){c=!1,o=M,F(),U(),t.requestRender();return}if(Math.abs(M-o)<.001){c=!1,U();return}l=o,u=M,m=performance.now(),d=on,c=!0,t.requestRender()},Y=M=>{!i||r.length<2||(f(),c=!1,o=pe(o+M,0,r.length-1),F(),U(),t.requestRender())},q=(M,z)=>{i&&(f(),c=!1,w=!1,a=pe(a-M*sr,-ar,ar),s=pe(s-z*sr,-Ia,_a),F(),t.requestRender())},V=M=>{i&&(E.set(M.pointerId,{x:M.clientX,y:M.clientY}),E.size===1?(W=!0,T=0,H=M.clientX,v=M.clientY):E.size===2&&(W=!1,y=j()))},j=()=>{let M=[...E.values()];return M.length<2?0:Math.hypot(M[0].x-M[1].x,M[0].y-M[1].y)},C=M=>{if(!i||!E.has(M.pointerId))return;if(E.set(M.pointerId,{x:M.clientX,y:M.clientY}),E.size>=2){let X=j();y>0&&Y((y-X)*La),y=X;return}if(!W)return;let z=M.clientX-H,te=M.clientY-v;H=M.clientX,v=M.clientY,T+=Math.abs(z)+Math.abs(te),!(T<=Na)&&q(z,te)},x=M=>{E.delete(M.pointerId)&&(E.size<2&&(y=0),E.size===0&&(W=!1,D()))},ie=M=>{if(!i)return;M.preventDefault();let z=M.deltaMode===1?16:M.deltaMode===2?100:1,te=pe(M.deltaY*z/100,-2,2);Y(te*Va),P&&clearTimeout(P),P=setTimeout(()=>{P=null,D()},ka)},k=()=>{f(),i&&(i=!1,c=!1,w=!1,r=[],E.clear(),W=!1,P&&(clearTimeout(P),P=null),I!==null&&(I=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",V),e.addEventListener("pointermove",C),e.addEventListener("pointerup",x),e.addEventListener("pointercancel",x),e.addEventListener("wheel",ie,{passive:!1}),{get active(){return i},enter(M,z=0){if(M.length<2){k();return}f(),r=M,i=!0,o=t.reducedMotion()?0:pe(z,0,M.length-1),o>0&&(p=setTimeout(()=>{p=null,i&&(l=o,u=0,m=performance.now(),d=za,c=!0,t.requestRender())},Oa)),a=0,s=0,c=!1,w=!1,I=null,F(),U(),t.requestRender()},exit:k,recentre(){return i?Math.abs(a)<1e-4&&Math.abs(s)<1e-4?!0:t.reducedMotion()?(w=!1,a=0,s=0,F(),t.requestRender(),!0):(g=[a,s],S=performance.now(),w=!0,t.requestRender(),!0):!1},update(M){if(!i)return!1;let z=!1;if(w){let te=pe((M-S)/on,0,1),X=1-lr(te);a=g[0]*X,s=g[1]*X,te>=1?(w=!1,a=0,s=0):z=!0}if(c){let te=pe((M-m)/d,0,1);o=l+(u-l)*lr(te),te>=1?(c=!1,o=u,U()):z=!0}return F(),z},currentStop:R,dispose(){k(),e.removeEventListener("pointerdown",V),e.removeEventListener("pointermove",C),e.removeEventListener("pointerup",x),e.removeEventListener("pointercancel",x),e.removeEventListener("wheel",ie)}}}function ur(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var rn=null;function dr(){return rn??=import("../openPanorama-6FMXAJ6O.js").catch(t=>{throw rn=null,t}),rn}var mr=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),St=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,i){this.emit("3d_opened",{seats:e,hasHeights:n,...r===void 0?{}:{buildMs:Math.round(r)},...i===void 0?{}:{prepSource:i}})}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=mr(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(mr()-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 hr(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function pr(t){let{container:e,model:n,opts:r,expandedSeatById:i,seatIdsByRow:o,isNarrow:a}=t,s=null,l=()=>{if(!s)return;let d=a();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"})},u=()=>{s?.remove(),s=null};return{show:(d,p,f=!1)=>{if(u(),t.isDisposed())return null;let c=document.createElement("div");c.setAttribute("role","group"),Object.assign(c.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let g=r.chrome?.caption!==!1,S=r.chrome?.seatStepper!==!1;if(!g&&!S)return null;let w=i.get(d),I=w?.sectionId?n.sections.find(R=>R.id===w.sectionId):void 0,P=w?.label??d;c.setAttribute("aria-label",`Explore views near ${I?.label?`${I.label}, `:""}seat ${P}`);let E=document.createElement("span");E.textContent=r.seatViewCaption?.(d)??["Live 3D seat view",I?.label,P].filter(Boolean).join(" \xB7 "),Object.assign(E.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)"}),g&&c.appendChild(E);let W=document.createElement("div");Object.assign(W.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),c.appendChild(W);let H=w?.rowId?o.get(w.rowId):void 0,v=H?.indexOf(d)??-1,y=v>=0?[H?.[v-1],H?.[v+1]]:[void 0,void 0],T=(R,U,F,D=!1)=>{let Y=document.createElement("button");Y.type="button",Y.textContent=R,Y.setAttribute("aria-label",U),Object.assign(Y.style,{minHeight:"44px",padding:D?"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"}),D||(Y.style.minWidth="44px"),D&&(Y.dataset.panoramaTrigger=""),Y.addEventListener("click",F),W.appendChild(Y)};if(S&&y[0]){let R=i.get(y[0])?.label??y[0];T("\u2039",`View previous seat ${R}`,()=>{t.flyToSeat(y[0])})}if(S&&r.getSeatView){let R=r.seatViewActionLabel?.(d)??"Open 360\xB0 panorama";T(f?`\u21BB Retry ${R}`:`\u25C9 ${R}`,`${f?"Retry":R} from seat ${P}`,()=>{if(t.isDisposed()||p!==t.flightGen()){u();return}u(),t.openPanorama(d,400,p)},!0)}if(S&&y[1]){let R=i.get(y[1])?.label??y[1];T("\u203A",`View next seat ${R}`,()=>{t.flyToSeat(y[1])})}return!W.childElementCount&&!g?null:(e.appendChild(c),s=c,l(),c)},remove:u,layout:l}}var Ha={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function fr(t){let{container:e,orbit:n,isNarrow:r}=t,i={...Ha,...t.labels??{}},o=(P,E)=>{P.setAttribute("aria-label",E),P.title=E},a=document.createElement("div"),s=!1;a.className="sl-3d-navigation-controls",Object.assign(a.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 u=document.createElement("div");u.setAttribute("role","group"),u.setAttribute("aria-label","3D view controls"),Object.assign(u.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let m=document.createElement("button");m.type="button",m.textContent="\u21BB",o(m,i.rotate);let d=document.createElement("button");d.type="button",d.textContent="\u2725",o(d,i.move);let p=document.createElement("button");p.type="button",p.textContent="\u2212",o(p,i.zoomOut);let f=document.createElement("button");f.type="button",f.textContent="+",o(f,i.zoomIn);for(let P of[m,d,p,f])P.className="sl-3d-icon-control",Object.assign(P.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(m,d),u.append(f,p);let c=P=>{n.setPrimaryDragMode(P);let E=P==="orbit";m.setAttribute("aria-pressed",String(E)),d.setAttribute("aria-pressed",String(!E)),m.style.background=E?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",d.style.background=E?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",a.title=E?`${i.rotate} \xB7 ${i.move} with Shift`:`${i.move} \xB7 ${i.rotate} with Shift`};m.addEventListener("click",()=>c("orbit")),d.addEventListener("click",()=>c("pan"));let g=()=>{let{atMin:P,atMax:E}=n.dollyLimitState();f.disabled!==P&&(f.disabled=P),p.disabled!==E&&(p.disabled=E)};p.addEventListener("click",()=>{n.zoomBy(Xe),g()}),f.addEventListener("click",()=>{n.zoomBy(Fe),g()}),a.append(l,u),c("orbit"),e.appendChild(a);let S=t.enabled!==!1,w=()=>{let P=r();a.style.display=s||!S?"none":"flex",a.style.right=P?"12px":"14px",a.style.bottom=P?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",l.style.display=P?"none":"flex",f.style.display=P?"none":"",p.style.display=P?"none":""};return w(),{element:a,utilityControls:u,setNavigationMode:c,syncZoomLimits:g,setSeatViewLocked:P=>{s=P,n.setInteractionEnabled(!P),w()},seatViewLocked:()=>s,layout:w}}var Ga=12;function Ba(t,e){if(!t)return!1;let n=t.x-e[0],r=t.y-e[1],i=t.z-e[2];return Math.hypot(n,r,i)>Ga}var Wa=.5,Ua=12;function Ya(t,e,n){return!(t>0)||!(n>0)?0:Wa*n/(2*t*Math.tan(e*Math.PI/360))}function vr(t){let{glctx:e,orbit:n,model:r,seats:i,opts:o,cinematic:a,analytics:s,seatIdByIndex:l,sectionIdBySeatId:u,tapSlop:m,tapMs:d,cancelFlight:p,focusSectionCamera:f,setSelection:c,ensureSeatView:g}=t,S=0,w=0,I=0,P=-1,E=!1,W=!1,H=F=>{t.seatViewLocked()||P===-1&&(P=F.pointerId,S=F.clientX,w=F.clientY,I=performance.now(),E=!1,W=a.active,a.active&&(s.cinematicCancelled(),p(),o.onViewTargetChange?.(null)))},v=F=>{F.pointerId===P&&Math.hypot(F.clientX-S,F.clientY-w)>m&&(E=!0)},y=(F,D,Y,q,V)=>{let j=e.canvas.getBoundingClientRect(),C=e.canvas.clientWidth||j.width||1,x=e.canvas.clientHeight||j.height||1,ie=F-j.left,k=D-j.top,M=q*q,z=-1,te=M,X=1/0;for(let oe of i){if(Y&&oe.sectionId!==Y)continue;let K=r.seats.idToIndex.get(oe.id);if(K===void 0)continue;if(V){let N=Math.round(r.seats.iState[K]??0);if(N!==0&&N!==3)continue}let ue=K*3,ae=ge(n.camera.projectionViewMatrix,[r.seats.iPosition[ue],r.seats.iPosition[ue+1]+.55,r.seats.iPosition[ue+2]],C,x);if(!ae.visible)continue;let re=ae.x-ie,de=ae.y-k,le=re*re+de*de;(le<te||Math.abs(le-te)<1&&ae.depth<X)&&(z=K,te=le,X=ae.depth)}return z},T=(F,D)=>{let Y=t.gpu(),q=t.pick();if(!Y||!q)return-1;q.syncFromSeatProgram(Y.seatProgram);let V=e.canvas.getBoundingClientRect(),j=e.renderer.dpr,{x:C,y:x}=Lo(F,D,V,j,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),ie=Math.max(2,Math.round(8*j));return q.pick(n.camera,C,x,ie)},R=F=>{let D=n.camera?.position;if(!D)return!1;let Y=F*3,q=Math.hypot(D.x-r.seats.iPosition[Y],D.y-r.seats.iPosition[Y+1],D.z-r.seats.iPosition[Y+2]),V=e.canvas.clientHeight||e.canvas.getBoundingClientRect().height;return Ya(q,n.fovY,V)>=Ua};return{onDown:H,onMove:v,onUp:F=>{if(F.pointerId!==P)return;let D=!E&&performance.now()-I<d;if(P=-1,W){W=!1;return}let Y=t.gpu(),q=t.pick();if(!D||!Y||!q)return;let V=T(F.clientX,F.clientY),j=V>=0&&R(V),C=!1;if(t.focusedSectionId()&&V>=0){let k=l[V],M=k?u.get(k):void 0;if(M&&M!==t.focusedSectionId()&&f(M,{keepCamera:j})){if(!j)return;C=!0}}if(t.focusedSectionId()&&V<0&&(V=y(F.clientX,F.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&V<0){let k=y(F.clientX,F.clientY,null,72,!1),M=k>=0?l[k]:void 0,z=M?u.get(M):void 0;if(z&&z!==t.focusedSectionId()&&f(z))return}if(!t.focusedSectionId()){V<0&&(V=y(F.clientX,F.clientY,null,42,!1));let k=V>=0?l[V]:void 0,M=k?u.get(k):void 0;if(M&&f(M,{keepCamera:j})){if(!j)return;C=!0}}if(V<0||V>=l.length){t.selection().size&&(c([]),o.onViewTargetChange?.(null));return}let x=l[V],ie=be[Math.round(r.seats.iState[V]??0)]??"available";if(ie!=="available"&&ie!=="selected"){o.onSeatInspect?.(x,ie);return}if(t.selection().has(x)&&t.selection().size===1){c([]),o.onViewTargetChange?.(null),o.onSeatPick?.(x);return}if(c([x]),g(x),s.seatPicked(x,u.get(x)),o.onSeatPick?.(x),t.focusedSectionId()&&!C){let k=V*3,M=[r.seats.iPosition[k],r.seats.iPosition[k+1],r.seats.iPosition[k+2]];Ba(n.camera?.position,M)&&t.focusSeatCamera(x)}}}}var wt=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,i=-1/0,o=-1/0;for(let f=0;f<this.count;f++){let c=e[f*3],g=e[f*3+2];c<n&&(n=c),c>i&&(i=c),g<r&&(r=g),g>o&&(o=g)}let a=Math.max(i-n,.001),s=Math.max(o-r,.001);this.cell=Math.max(Math.sqrt(a*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(a/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,u=new Int32Array(l+1),m=f=>{let c=Math.min(this.cols-1,Math.max(0,Math.floor((e[f*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[f*3+2]-r)/this.cell)))*this.cols+c};for(let f=0;f<this.count;f++)u[m(f)+1]++;for(let f=0;f<l;f++)u[f+1]+=u[f];let d=new Int32Array(this.count),p=u.slice(0,l);for(let f=0;f<this.count;f++)d[p[m(f)]++]=f;this.cellStart=u,this.cellItems=d}gather(e,n,r,i,o){this.ensureGrid();let a=this.cellStart,s=this.cellItems;if(!a||!s)return 0;let l=i.length,u=r*r,m=Math.floor((e-this.minX)/this.cell),d=Math.floor((n-this.minZ)/this.cell),p=Math.ceil(r/this.cell)+1,f=this.iPosition,c=0;for(let g=0;g<=p&&c<l;g++){let S=d-g,w=d+g,I=m-g,P=m+g;for(let E=S;E<=w&&c<l;E++){if(E<0||E>=this.rows)continue;let W=E===S||E===w;for(let H=I;H<=P&&c<l;H++){if(!W&&H!==I&&H!==P){H=P-1;continue}if(H<0||H>=this.cols)continue;let v=E*this.cols+H;for(let y=a[v],T=a[v+1];y<T&&c<l;y++){let R=s[y],U=f[R*3]-e,F=f[R*3+2]-n,D=o===void 0?0:f[R*3+1]-o;U*U+D*D+F*F<=u&&(i[c++]=R)}}}}return c}};var Mt=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(ht);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new wt(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 i=this.ctx.orbit().camera.position;if(Math.hypot(i.x-this.lastGatherX,i.y-this.lastGatherY,i.z-this.lastGatherZ)<Gt)return;if(this.lastGatherX=i.x,this.lastGatherY=i.y,this.lastGatherZ=i.z,Math.hypot(i.x-n.bounds.center[0],i.y-n.bounds.center[1],i.z-n.bounds.center[2])-n.bounds.radius>Ht){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(i.x,i.z,Ht,this.nearBuf,i.y);s===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,s)}ease(e,n,r){let i=1-Math.exp(-e*9),o=1-Math.exp(-e*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?i:o),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?i:o),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};function br(t){let e=Math.max(5,t.radius),n=t.focalWorld[0]-t.center[0],r=t.focalWorld[2]-t.center[2],i=Math.hypot(n,r);if(i<e*.12)return{center:t.center,radius:e,polarDeg:48};let o=Math.min(i*.25,e*.2);return{center:[t.center[0]+n/i*o,t.center[1],t.center[2]+r/i*o],radius:e+o,polarDeg:50}}import{Quat as Xa,Vec3 as qa}from"ogl";function gr(){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 Sr(t){let{container:e,model:n,opts:r,orbit:i,cinematic:o,analytics:a,loop:s,labelOverlay:l,stageAzimuth:u,overviewFraming:m}=t,d=0,p=-1,f=(v,y,T=28)=>{i.camera.position.set(v[0],v[1],v[2]),i.camera.lookAt(new qa(y[0],y[1],y[2])),i.camera.fov=T,i.camera.updateProjectionMatrix()},c=document.createElement("button");c.className="sl-3d-overview-control sl-3d-icon-control",c.type="button",c.replaceChildren(gr());let g=r.navLabels?.fitView??"Show whole venue";c.setAttribute("aria-label",g),c.title=g,Object.assign(c.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 S=()=>{c.firstElementChild||c.replaceChildren(gr())};S();let w=v=>{p=v;let y=t.gpu();y&&(y.seatProgram.uniforms.uFocusFloor.value=v,y.solidProgram.uniforms.uFocusFloor.value=v,y.chairProgram.uniforms.uFocusFloor.value=v),t.showSectionSeatLabels(null)},I=()=>{if(t.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),a.panoramaClosed()),t.setPanoramaSphereVisible(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.restorePanoramaLayer(),c.style.display="",l.setVisible(!0),t.setFrozen(!1);let v=p>=0?n.floors[p]:null;if(t.setNearFieldDetailEnabled(!!v),t.setSeatViewLocked(!1),P(),t.removeArriveChip(),t.setNavigationMode("orbit"),v){let y=v.focalWorld[0]-v.center[0],T=v.focalWorld[2]-v.center[2],R=Math.hypot(y,T)>v.radius*.12?Math.atan2(y,T):u,U={center:v.center,radius:v.radius,box:v.box},F={polarDeg:58,margin:1.12};t.reducedMotion()?i.frame(U,!1,R,!1,F):i.frameSoft(U,R,!1,F)}else t.reducedMotion()?i.frame(n.bounds,!1,u,r.portraitOverviewCrop===!0,m):i.frameSoft(n.bounds,u,r.portraitOverviewCrop===!0,m);t.showSectionSeatLabels(null),s.requestRender()},P=()=>{d++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),o.active&&(o.cancel(),i.resumeAfterFlight(n.focalWorld))},E=v=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let y=n.seats.idToIndex.get(v);if(y===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(v),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),t.setPanoramaSphereVisible(!1),c.style.display="",t.restorePanoramaLayer()),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.setFrozen(!1);let T=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(T),t.setSeatViewLocked(!1);let R=++d;T?t.showArriveChip(v,R):t.removeArriveChip();let{eye:U,focal:F}=t.resolvedSeatViewPose(v,y),D=r.arriveAtSeatEye?t.seatViewArrival(v,y):null,Y=D&&D.stops.length>1&&D.stops[1].name==="row"?D.stops[1]:null,q=D?D.focal:F,V=[i.camera.position.x,i.camera.position.y,i.camera.position.z],j=Jt(V,D?.eye??U,q,n.bounds.center,n.bounds.radius),C=Y?Y.eye:D?D.eye:r.arriveAtSeatEye?U:j.finalPos,x=D?D.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?gt:65:28,ie=[j.waypoints[0],j.waypoints[1],C];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),f(C,q,x),s.requestRender(),a.cinematicSkipped(),t.isDisposed()||i.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),D&&t.enterSeatView(D.stops),t.showArriveChip(v,R),Promise.resolve();let k=new Xa().copy(i.camera.quaternion),M=Uo(i.camera,C,q);s.requestRender();let z=T?700:2500;return o.start(ie,k,M,z,x).then(()=>{t.isDisposed()||R!==d||(t.setSeatStepping(!1),a.cinematicPlayed(z),i.resumeAfterFlight(q),t.setSeatViewLocked(r.arriveAtSeatEye===!0),D&&t.enterSeatView(D.stops,Y?1:0),s.requestRender(),t.showArriveChip(v,R))})},W=(v,y)=>{let T=n.sections.find(R=>R.id===v);if(!T||T.seatCount===0)return!1;if(t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),o.cancel(),t.removeArriveChip(),n.floors.length>1&&p!==T.floorIndex&&w(T.floorIndex),t.setNavigationMode("pan"),t.panorama()||l.setVisible(!0),t.showSectionSeatLabels(v),!y?.keepCamera){let R=br(T),U={polarDeg:R.polarDeg,margin:1.12};t.reducedMotion()?i.frame({center:R.center,radius:R.radius},!1,i.currentAzimuth,!1,U):i.glideTo({center:R.center,radius:R.radius},U)}return r.onSectionFocusChange?.(v),s.requestRender(),!0},H=v=>{if(t.isDisposed()||!t.gpu())return!1;let y=n.seats.idToIndex.get(v);if(y===void 0)return!1;let T=y*3,R=[n.seats.iPosition[T],n.seats.iPosition[T+1]+.55,n.seats.iPosition[T+2]];return t.reducedMotion()?i.frame({center:R,radius:yr},!1,void 0,!1,xr):i.frameSoft({center:R,radius:yr},void 0,!1,xr),s.requestRender(),!0};return c.addEventListener("click",I),{overviewChip:c,layoutOverviewChip:S,flightGen:()=>d,focusedFloor:()=>p,applyFloorFocus:w,placeCameraFinal:f,cancelFlight:P,focusOverview:I,flyToSeat:E,focusSectionCamera:W,focusSeatCamera:H}}var yr=4.5,xr={polarDeg:48,margin:1.25};function an(t,e,n,r,i,o,a,s,l=.5){let u=-1,m=s*s,d=1/0;for(let p=0;p<e;p++){let f=p*3,c=ge(n,[t[f],t[f+1]+l,t[f+2]],r,i);if(!c.visible)continue;let g=c.x-o,S=c.y-a,w=g*g+S*S;(w<m-4||w<m+4&&c.depth<d)&&(u=p,m=Math.min(m,w),d=c.depth)}return u}function wr(t){let e=performance.now(),{input:n,estimate:r}=Gn(t);return{model:Ye(n),buildMs:performance.now()-e,source:"main",...r?{estimate:r}:{}}}function ja(t){let e=Sn(t.doc);return{...wr({...t,seats:e}),seats:e}}function Mr(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(i=>{let o=!1,a=u=>{o||(o=!0,clearTimeout(l),r.terminate(),i(u))},s=()=>a(e()),l=window.setTimeout(s,15e3);r.onerror=s,r.onmessage=u=>{let m=n(u.data);m?a(m):s()},r.postMessage(t)})}function Ka(t){return Mr(t,()=>wr(t),({model:e,buildMs:n,estimate:r})=>({model:e,buildMs:n,source:"worker",...r?{estimate:r}:{}}))}function $a(t){return Mr(t,()=>ja(t),({model:e,buildMs:n,seats:r,estimate:i})=>r?{model:e,buildMs:n,seats:r,source:"worker",...i?{estimate:i}:{}}:null)}var Qa=40,Za=48,Ja=Math.PI/180,es=6,ts=500;function xc(t,e,n={}){let r=performance.now(),i=e.prepared?e.prepared.estimate:e.estimate===!1?null:Vt(e.doc,e.seats);i&&(e={...e,doc:i.doc,seats:Hn(e.seats,i)});let o=e.prepared?.model??Ye(e),a=new St(n.onAnalytics),s=new Array(o.seats.count);for(let[h,b]of o.seats.idToIndex)s[b]=h;let l=new Map(e.seats.map(h=>[h.id,h])),u=new Map;for(let h of e.seats){if(!h.rowId)continue;let b=u.get(h.rowId);b?b.push(h.id):u.set(h.rowId,[h.id])}let m=new Map;e.seats.forEach((h,b)=>{m.set(h.id,o.seatSectionIds?.[b]??h.sectionId)});let d=new Map;for(let[h,b]of o.seats.idToIndex){let A=m.get(h);if(!A)continue;let _=d.get(A);_?_.push(b):d.set(A,[b])}let p=()=>{if(!c||!o.sectionSolidRanges.length)return;let{lit:h,anyUnlit:b}=Ro(o.sectionSolidRanges,d,o.seats.iState);c.setSectionShellLit(b?h:null)},f=e.doc.floors?.some(b=>(b.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(b=>b.objects)??e.doc.objects).some(b=>b.type==="section"&&((b.height??0)>0||(b.rake??0)>0)),c=null,g=null,S=null,w=!1,I=!1,P=!1,E=new Map,W=null,H=null,v=null,y=new Map,T=null,R=()=>{v===null&&(v=t.style.zIndex,t.style.zIndex="20")},U=()=>{v!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=v),v=null)},F=!1,D=()=>F?me.focusedFloor():-1,Y=()=>{c=Io(C.gl,o),g?.dispose(),g=ro(C.gl,[1,1,1]),un(!1),p(),N(),S=new vt(C.renderer,c.seatGeometry,c.chairGeometry,c.solidGeometry,o.seats.count),C.setClearColor(o.theme.background.top),S.setRestoreClear(o.theme.background.top),c.seatProgram.uniforms.uSeatRadius.value=Ue*o.theme.seatScale,c.seatProgram.uniforms.uFocusFloor.value=D(),c.solidProgram.uniforms.uFocusFloor.value=D(),c.chairProgram.uniforms.uFocusFloor.value=D(),c.screenProgram&&(c.screenProgram.uniforms.uFocusFloor.value=D()),V.forceRegather()},q=!1,V=new Mt({model:o,orbit:()=>x,gpu:()=>c}),j=h=>V.setDetailEnabled(h),C=new ut(t,{onContextLost:()=>{P||a.contextLost(),w=!0,B.stop(),c=null,S=null},onContextRestored:()=>{Y(),w=!1,P||a.contextRestored(),B.requestRender()}}),x=new dt(C.gl,C.canvas,()=>B.requestRender(),()=>a.orbitEngaged());x.setAspect(C.aspect);let ie=(e.doc.floors?.flatMap(h=>h.objects)??e.doc.objects).some(h=>h.type==="section"&&h.physical3dProvenance?.surfaceKind?.status==="inferred"),k=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(ie&&o.stages.length===0))return Bn(o.focalWorld,o.seats.iPosition,o.bounds)})(),M=(e.doc.floors?.flatMap(h=>h.objects)??e.doc.objects).some(h=>h.type==="shape"&&h.stageKind?.startsWith("pitch-")),z=o.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:M?36:48,margin:1.05},te=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;x.frame(o.bounds,!te&&n.skipInitialOverviewAnimation!==!0,k,n.portraitOverviewCrop===!0,z);let X=new bt(x.camera),oe=hr(t),K=new pt(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:o.theme.background.top}),ue=o.labels,ae=()=>Tn(ue,o.floors.length,D());K.setLabels(ae());let re=null,de=()=>[...E.keys()].flatMap(h=>{let b=o.seats.idToIndex.get(h),A=b===void 0?void 0:e.seats[b];if(b===void 0||A?.id!==h)return[];let _=b*3;return[{id:`seat:${h}`,kind:"seat",seatWidthM:o.seats.iChairWidth[b]*2,text:A.displayLabel||A.label,anchor:[o.seats.iPosition[_],o.seats.iPosition[_+1]+1.05,o.seats.iPosition[_+2]],pinBase:At(_)}]}),le=-1,N=()=>{c&&(le=re?o.sections.findIndex(h=>h.id===re):-1,c.seatProgram.uniforms.uFocusSection.value=le,c.chairProgram.uniforms.uFocusSection.value=le)},$=h=>{if(re=h,N(),K.setForcedDense(!!h),!h){let L=de(),he=new Set(L.map(ne=>ne.id));K.setLabels([...ae().filter(ne=>!he.has(ne.id)),...L]);return}let b=e.seats.filter(L=>m.get(L.id)===h),A=new Set(b.map(L=>L.id)),_=new Set(b.map(L=>L.rowId)),O=new Set(E.keys()),J=new Set(b.filter(L=>O.has(L.id)).map(L=>L.id)),Z=ae().filter(L=>L.kind!=="row"&&L.kind!=="seat"||(L.kind==="row"?_.has(L.id.slice(4)):A.has(L.id.slice(5))));if(o.seatCount<=6e3&&J.size===0){K.setLabels(Z);return}let ce=b,Ae=new Set(ce.map(L=>`seat:${L.id}`)),Pe=ce.flatMap(L=>{let he=o.seats.idToIndex.get(L.id);if(he===void 0)return[];let ne=he*3;return[{id:`seat:${L.id}`,kind:"seat",seatWidthM:o.seats.iChairWidth[he]*2,rowId:L.rowId,text:O.has(L.id)?L.displayLabel||L.label:Nn(L.displayLabel||L.label),anchor:[o.seats.iPosition[ne],o.seats.iPosition[ne+1]+(O.has(L.id)?1.05:.55),o.seats.iPosition[ne+2]],...O.has(L.id)?{pinBase:At(ne)}:{}}]});K.setLabels([...Z.filter(L=>!Ae.has(L.id)),...Pe])};Y();let G=null,ee=null,Q=h=>{if(w||!c||I)return!1;let b=ur({flying:X.active,panoramaMounted:W!==null,seatViewActive:G?.active===!0}),A=b==="orbit"?le:-1;c.seatProgram.uniforms.uFocusSection.value=A,c.chairProgram.uniforms.uFocusSection.value=A;let _=b==="cinematic"?X.update(performance.now()):b==="seatView"?G.update(performance.now()):b==="orbit"?x.update():!1;ee?.syncZoomLimits();let O=D()>=0?o.floors[D()]:null,J=O?.radius??o.bounds.radius,Z=eo(x.currentDistance,J),ce=q?{center:[x.camera.position.x,x.camera.position.y,x.camera.position.z],radius:520}:o.clipBounds??o.renderBounds;x.updateClipping(ce);let Ae=O?.center??o.renderBounds.center,Pe=O?.radius??o.renderBounds.radius,L=(fe,ve)=>Math.hypot(x.camera.position.x-fe[0],x.camera.position.y-fe[1],x.camera.position.z-fe[2])<=ve*(V.detailVisible?1.8:1.55),he=L(Ae,Pe);if(!he&&re){let fe=o.sections.find(ve=>ve.id===re);fe&&(he=L(fe.center,Math.max(12,fe.radius*2)))}V.detailVisible=he;let ne=c.seatProgram.uniforms;ne.uSeatScale.value=Z.scale,ne.uSeatFade.value=Z.fade;let rt=!!O&&to(O.seatCount,C.canvas.clientWidth||1,C.canvas.clientHeight||1),it=no(o.seats.count,J,x.currentDistance,x.camera.fov,C.canvas.clientHeight||1),He=V.detailVisible||rt||it?1:0,Ge=V.detailVisible||D()>=0||o.floors.length>1?1:0;V.ease(h,He,Ge),ne.uSeatDetail.value=V.seatDetailMix;let at=He===0&&V.seatDetailMix<.01;c.seatGeometry.setDrawRange(at?Lt:0,at?Wn:Lt),c.solidProgram.uniforms.uStructureDetail.value=V.structureDetailMix,ne.uMinPixels.value=Z.minPixels,ne.uPixelToWorld.value=2*Math.tan(x.camera.fov*Ja/2)/Math.max(1,C.pixelHeight),V.update(V.detailVisible),C.renderer.render({scene:c.background,clear:!0}),C.renderer.render({scene:c.main,camera:x.camera,clear:!1});let Be=g?g.update(performance.now(),[x.camera.position.x,x.camera.position.y,x.camera.position.z],W!==null,b==="seatView"):!1;return g&&C.renderer.render({scene:g.root,camera:x.camera,clear:!1}),K.update(x.camera.projectionViewMatrix,C.canvas.clientWidth||1,C.canvas.clientHeight||1,x.currentDistance,J,[x.camera.position.x,x.camera.position.y,x.camera.position.z]),_||Be||V.seatDetailMix!==He||V.structureDetailMix!==Ge},B=new mt(Q),sn=typeof ResizeObserver<"u"?new ResizeObserver(()=>Ft.resize()):null;sn?.observe(t),x.setZoomPointResolver((h,b)=>{let A=C.canvas.getBoundingClientRect(),_=C.canvas.clientWidth||A.width,O=C.canvas.clientHeight||A.height;if(!(_>0)||!(O>0))return null;x.camera.updateMatrixWorld();let J=an(o.seats.iPosition,o.seats.count,x.camera.projectionViewMatrix,_,O,h-A.left,b-A.top,Qa);if(J<0)return null;let Z=J*3;return[o.seats.iPosition[Z],o.seats.iPosition[Z+1]+.5,o.seats.iPosition[Z+2]]});function At(h){return[o.seats.iPosition[h],o.seats.iPosition[h+1]+.5,o.seats.iPosition[h+2]]}K.setSeatNumberRow(null);let ke=null,we=0,ln=()=>{we=0;let h=null;if(ke&&!G?.active&&!X.active){let b=C.canvas.getBoundingClientRect(),A=C.canvas.clientWidth||b.width,_=C.canvas.clientHeight||b.height;if(A>0&&_>0){let O=an(o.seats.iPosition,o.seats.count,x.camera.projectionViewMatrix,A,_,ke.x-b.left,ke.y-b.top,Za);h=O>=0?e.seats[O]?.rowId??null:null}}K.setSeatNumberRow(h)&&B.requestRender()},nt=h=>{ke={x:h.clientX,y:h.clientY},we||(we=requestAnimationFrame(ln))},cn=h=>{h.pointerType==="mouse"&&(ke=null,we||(we=requestAnimationFrame(ln)))};C.canvas.addEventListener("pointermove",nt),C.canvas.addEventListener("pointerdown",nt),C.canvas.addEventListener("pointerleave",cn);function un(h){if(!g)return;let b=[];for(let A of E.keys()){let _=o.seats.idToIndex.get(A);if(_===void 0)continue;let O=_*3;b.push({id:A,position:At(O)})}g.setSeats(b,performance.now(),h)}let dn=h=>{let b=O=>{let J=o.seats.idToIndex.get(O);return J===void 0?void 0:o.seats.iState[J]},{updates:A,next:_}=Oo(E,h,b);if(E=_,K.setSelectedSeatIds(E.keys()),un(!Oe()),B.requestRender(),$(re),A.length){let O=It(o.seats,A);c&&c.uploadSeatStateRuns(O),p(),B.requestRender()}},Oe=()=>T!==null?T:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Ar=8,mn=h=>{if(!n.getSeatView)return null;let b=y.get(h);if(!b)for(b=Promise.resolve(n.getSeatView(h)),y.set(h,b),b.catch(()=>{y.get(h)===b&&y.delete(h)});y.size>Ar;){let A=y.keys().next().value;if(A===void 0)break;y.delete(A)}return b},hn=nr(o.stages,o.focalWorld,o.bounds.groundY??0),Pr=nn(hn),Pt=(h,b)=>{let A=l.get(h),_=Math.max(0,Math.round(o.seats.iFloor[b]??0)),O=e.doc.floors?.[_],J=o.floors[_],Z=O?.focalPoint??e.doc.focalPoint,ce=J?{x:J.focalWorld[0]/Te,y:J.focalWorld[2]/Te}:Z,Ae=A?.focalPoint?{x:A.focalPoint.x+ce.x-Z.x,y:A.focalPoint.y+ce.y-Z.y}:ce,Pe=[o.seats.iPosition[b*3],o.seats.iPosition[b*3+1],o.seats.iPosition[b*3+2]];return Xo(Pe,Ae,O?.baseHeightM??0,A?.eyeHeightM,Pr)},pn=()=>(t.clientWidth||C.canvas.clientWidth)<=520,Ct=null,fn=null,Cr=async(h,b,A)=>{if(!n.getSeatView||P||A!==me.flightGen())return;let _;try{_=await dr()}catch{if(a.panoramaFailed(h,"mount"),!P&&A===me.flightGen()){let O=Rt(h,A,!0);requestAnimationFrame(()=>O?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(P||A!==me.flightGen()||!Ct))return fn??=_.createOpenPanorama(Ct),fn(h,b,A)},Et=pr({container:t,model:o,opts:n,expandedSeatById:l,seatIdsByRow:u,isNarrow:pn,isDisposed:()=>P,flightGen:()=>me.flightGen(),flyToSeat:h=>yn(h),openPanorama:(h,b,A)=>Cr(h,b,A)}),Rt=Et.show,Tt=Et.remove,Er=Et.layout,Me=fr({container:t,orbit:x,isNarrow:pn,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});ee=Me;let Rr=Me.element,ze=Me.setNavigationMode,Tr=Me.layout,Dr=Me.utilityControls,Ne=null,vn=!1,ot=h=>{Me.setSeatViewLocked(h),h||G?.exit()};G=cr({canvas:C.canvas,camera:x.camera,requestRender:()=>B.requestRender(),reducedMotion:Oe,onStopChange:h=>{let b=h??(vn?"seat":null);Ne=b;try{n.onSeatViewStopChange?.(b)}catch{}},onApplied:()=>{P||x.syncFromCamera()}});let bn=o.sections.reduce((h,b)=>b.seatCount>0&&b.box?Math.max(h,b.box.max[1]):h,-1/0),Fr=(h,b)=>{let{eye:A}=Pt(h,b),_=(t.clientWidth||C.canvas.clientWidth||1)/Math.max(1,t.clientHeight||C.canvas.clientHeight||1),O=rr(A,hn,_,{preserveEye:!0});if(n.seatViewStops===!1)return{...O,stops:[]};let J=m.get(h),Z=J?o.sections.find(ce=>ce.id===J):void 0;return{...O,stops:ir(O,{aspect:_,seatingTopY:Number.isFinite(bn)?bn:o.bounds.box.max[1],section:Z&&Z.seatCount>0?{center:Z.center,radius:Z.radius}:null,venue:{center:o.bounds.center,radius:o.bounds.radius}})}},me=Sr({container:t,model:o,opts:n,orbit:x,cinematic:X,analytics:a,loop:B,labelOverlay:K,stageAzimuth:k,overviewFraming:z,gpu:()=>c,isDisposed:()=>P,panorama:()=>W,setPanorama:h=>{W=h},setPanoramaSphereVisible:h=>{q=h},panoramaLoadAbort:()=>H,setPanoramaLoadAbort:h=>{H=h},setFrozen:h=>{I=h},restorePanoramaLayer:U,reducedMotion:Oe,resolvedSeatViewPose:Pt,showSectionSeatLabels:$,setNearFieldDetailEnabled:j,setSeatViewLocked:ot,setNavigationMode:ze,showArriveChip:Rt,removeArriveChip:Tt,inSeatView:()=>Ne!==null,setSeatStepping:h=>{vn=h},seatViewArrival:(h,b)=>n.arriveAtSeatEye?Fr(h,b):null,enterSeatView:(h,b)=>G?.enter(h,b)});F=!0;let Dt=me.overviewChip,_r=me.layoutOverviewChip,Ir=me.applyFloorFocus,Vr=me.focusOverview,gn=me.cancelFlight,yn=me.flyToSeat,xn=me.focusSectionCamera;Dr.appendChild(Dt),Ct={container:t,model:o,opts:n,analytics:a,orbit:x,loop:B,seatsById:l,ensureSeatView:mn,resolvedSeatViewPose:Pt,gpu:()=>c,gl:C.gl,isContextLost:()=>w,isDisposed:()=>P,flightGen:()=>me.flightGen(),setPanorama:h=>{W=h},getLoadAbort:()=>H,setLoadAbort:h=>{H=h},setPanoramaSphereVisible:h=>{q=h,h&&G?.exit()},setFrozen:h=>{I=h},raisePanoramaLayer:R,restorePanoramaLayer:U,getOverviewChip:()=>Dt,labelOverlay:K,reducedMotion:Oe,removeArriveChip:Tt,showArriveChip:Rt};let xe=vr({glctx:C,orbit:x,model:o,seats:e.seats,opts:n,cinematic:X,analytics:a,seatIdByIndex:s,sectionIdBySeatId:m,tapSlop:es,tapMs:ts,gpu:()=>c,pick:()=>S,seatViewLocked:()=>Me.seatViewLocked(),focusedSectionId:()=>re,selection:()=>E,cancelFlight:gn,focusSectionCamera:xn,focusSeatCamera:me.focusSeatCamera,setSelection:dn,ensureSeatView:mn});C.canvas.addEventListener("pointerdown",xe.onDown),C.canvas.addEventListener("pointermove",xe.onMove),C.canvas.addEventListener("pointerup",xe.onUp),C.canvas.addEventListener("pointercancel",xe.onUp),B.requestRender();let Ft={setAvailability(h){let b=ko(E,h),A=It(o.seats,b);A.length&&c&&c.uploadSeatStateRuns(A),p(),B.requestRender()},setSelection:dn,setNavigationMode:ze,zoomIn(){x.zoomBy(Fe),B.requestRender()},zoomOut(){x.zoomBy(Xe),B.requestRender()},flyToSeat:yn,focusOverview:Vr,seatViewStop:()=>Ne,recentreSeatView:()=>G?.recentre()??!1,resize(){let{width:h,height:b}=C.resize();x.setAspect(h/Math.max(1,b)),Er(),Tr(),_r(),B.requestRender()},stats(){return{...B.stats(),drawCalls:c?c.drawCalls:0,fallbackTriangles:c?c.seatGeometry.drawRange.count/3*o.seats.count:0,seatCount:o.seatCount}},captureImage(h=1280){if(w||!c||typeof document>"u")return null;Q(0);let b=C.canvas,A=Math.min(1,h/Math.max(b.width,b.height,1)),_=document.createElement("canvas");_.width=Math.max(1,Math.round(b.width*A)),_.height=Math.max(1,Math.round(b.height*A));let O=_.getContext("2d");return O?(O.drawImage(b,0,0,_.width,_.height),_.toDataURL("image/jpeg",.82)):null},getQualityEvidence(){let h=B.stats(),b=C.canvas.clientWidth||1,A=C.canvas.clientHeight||1,_=o.bounds.center,O=ge(x.camera.projectionViewMatrix,[_[0],o.bounds.box.min[1],_[2]],b,A),J=ge(x.camera.projectionViewMatrix,[_[0],o.bounds.box.max[1],_[2]],b,A),Z=o.bounds.box,ce=[Z.min[0],Z.max[0]].flatMap(L=>[Z.min[1],Z.max[1]].flatMap(he=>[Z.min[2],Z.max[2]].map(ne=>ge(x.camera.projectionViewMatrix,[L,he,ne],b,A)))).filter(L=>Number.isFinite(L.x)&&Number.isFinite(L.y)&&Number.isFinite(L.depth)),Ae=ce.length?(()=>{let L=Math.min(...ce.map(ve=>ve.x)),he=Math.max(...ce.map(ve=>ve.x)),ne=Math.min(...ce.map(ve=>ve.y)),rt=Math.max(...ce.map(ve=>ve.y)),it=Math.max(0,L),He=Math.min(b,he),Ge=Math.max(0,ne),at=Math.min(A,rt),Be=Math.max(0,He-it),fe=Math.max(0,at-Ge);return{box:{x:it,y:Ge,width:Be,height:fe},horizontalFillRatio:Be/b,verticalFillRatio:fe/A,visibleAreaRatio:Be*fe/(b*A),clippedEdges:[...ne<0?["top"]:[],...he>b?["right"]:[],...rt>A?["bottom"]:[],...L<0?["left"]:[]]}})():void 0,Pe=String(C.gl.getParameter(C.gl.VERSION)??"");return{viewport:{width:b,height:A},context:{webgl2:/webgl\s*2/i.test(Pe),lost:w},frame:{rendered:h.rendered,idle:h.idle},camera:{position:[x.camera.position.x,x.camera.position.y,x.camera.position.z],distance:x.currentDistance,verticalFovDeg:x.fovY},scene:{seatCount:o.seatCount,floorCount:o.floors.length,zoneCount:o.zones.length,sectionCount:o.sections.length,authoredRelief:f,renderedVerticalSpanM:Math.max(0,o.bounds.box.max[1]-o.bounds.box.min[1]),projectedReliefPx:O.visible&&J.visible?Math.abs(O.y-J.y):0},labels:K.qualityEvidence(),framing:Ae,...Ne?{seatView:{fovDeg:x.camera.fov,stop:Ne}}:{}}},getQualityReport(){return qt(Ft.getQualityEvidence())},loseContextForTest(){C.simulateContextLossCycle()},floors(){return o.floors},focusFloor(h){if(h!==null&&!o.floors.some(A=>A.index===h))return!1;let b=h??-1;if(j(h!==null),ot(!1),Ir(b),ze("orbit"),h===null)X.cancel(),Oe()?x.frame(o.bounds,!1,k,n.portraitOverviewCrop===!0,z):x.frameSoft(o.bounds,k,n.portraitOverviewCrop===!0,z);else{let A=o.floors[h];if(A.seatCount>0){X.cancel();let _=A.focalWorld[0]-A.center[0],O=A.focalWorld[2]-A.center[2],J=Math.hypot(_,O)>A.radius*.12?Math.atan2(_,O):k;x.frame({center:A.center,radius:A.radius,box:A.box},!1,J,!1,{polarDeg:58,margin:1.12})}}return B.requestRender(),!0},zones(){return o.zones},focusZone(h){let b=o.zones.find(J=>J.id===h);if(!b||b.seatCount===0)return!1;j(!1),ot(!1),X.cancel(),ze("orbit"),$(null),n.onSectionFocusChange?.(null);let A=b.focalWorld[0]-b.center[0],_=b.focalWorld[2]-b.center[2],O=Math.hypot(A,_)>b.radius*.12?Math.atan2(A,_):void 0;return x.frame({center:b.center,radius:b.radius*1.25},!1,O),B.requestRender(),!0},sections(){return o.sections},focusSection(h){return xn(h)},rows(h){return h?o.rows.filter(b=>b.sectionId===h):o.rows},seatsInRow(h){return e.seats.filter(b=>b.rowId===h).map(b=>({id:b.id,label:b.displayLabel||b.label}))},focusRow(h){let b=o.rows.find(A=>A.id===h);return!b||b.seatCount===0?!1:(j(!0),ot(!1),X.cancel(),ze("pan"),b.sectionId&&($(b.sectionId),n.onSectionFocusChange?.(b.sectionId)),x.frame({center:b.center,radius:Math.max(2.5,b.radius*.65)}),B.requestRender(),!0)},setReducedMotionForTest(h){T=h},dispose(){P=!0,Tt(),Dt.remove(),Rr.remove(),gn(),G?.dispose(),B.stop(),K.dispose(),sn?.disconnect(),W&&(W.dispose(),W=null),U(),oe(),C.canvas.removeEventListener("pointerdown",xe.onDown),C.canvas.removeEventListener("pointermove",xe.onMove),C.canvas.removeEventListener("pointerup",xe.onUp),C.canvas.removeEventListener("pointercancel",xe.onUp),C.canvas.removeEventListener("pointermove",nt),C.canvas.removeEventListener("pointerdown",nt),C.canvas.removeEventListener("pointerleave",cn),we&&cancelAnimationFrame(we),x.dispose(),S&&S.dispose(),c&&c.dispose(),c=null,g?.dispose(),g=null,S=null,C.dispose()}};return a.opened(o.seatCount,f,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),Ft}export{Ai as VENUE3D_QUALITY_REPORT_VERSION,Lr as autoVenue3d,Ye as buildSceneModel,Vt as estimateVenue3D,qt as inspectVenue3DQualityEvidence,xc as mountVenue3D,Ka as prepareVenue3D,$a as prepareVenue3DFromChart};
|
|
915
|
+
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:ue},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let q=new ot(t,{geometry:ne,program:re});q.frustumCulled=!1,q.setParent(n),me.screenProgram=re,j=!0,me.drawCalls=3+(B?1:0)+1},z.src=he.contentImageUrl}return me}import{Mesh as nn,RenderTarget as Ei,Transform as on}from"ogl";function Ci(t,e,n){let r=t+(e<<8)+(n<<16);return r===0?-1:r-1}function Qo(t,e,n,r,a,o){let i=-1,s=1/0;for(let l=0;l<n;l++)for(let c=0;c<e;c++){let d=(l*e+c)*4,h=Ci(t[d],t[d+1],t[d+2]);if(h<0||h>=o)continue;let p=c-r,f=l-a,u=p*p+f*f;u<s&&(s=u,i=h)}return i}function Zo(t,e,n,r,a,o){let i=t-n.left,s=e-n.top,l=Math.round(i*r),c=Math.round((n.height-s)*r);return{x:Math.max(0,Math.min(a-1,l)),y:Math.max(0,Math.min(o-1,c))}}var Ri=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],St=class{constructor(e,n,r,a,o){this.seatScene=new on;this.chairScene=new on;this.solidScene=new on;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=o,this.seatProg=Oo(this.gl),this.chairProg=zo(this.gl),this.depthProg=No(this.gl);let i=new nn(this.gl,{geometry:n,program:this.seatProg});i.frustumCulled=!1,i.setParent(this.seatScene);let s=new nn(this.gl,{geometry:r,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let l=new nn(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 Ri)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 Ei(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,c=Math.max(0,n-a),d=Math.max(0,r-a),h=Math.max(1,Math.min(s,n+a+1)-c),p=Math.max(1,Math.min(l,r+a+1)-d);o.enable(o.SCISSOR_TEST),o.scissor(c,d,h,p);let[f,u,y]=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(f,u,y,1),o.disable(o.SCISSOR_TEST);let v=new Uint8Array(h*p*4);return this.renderer.bindFramebuffer(i),o.readPixels(c,d,h,p,o.RGBA,o.UNSIGNED_BYTE,v),this.renderer.bindFramebuffer(),Qo(v,h,p,n-c,r-d,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Jo(t,e){let n=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,Nn(r.state)):n.push(r);return n}function er(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 rt,Vec3 as Ii}from"ogl";function Ti(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function tr(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function _i(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function nr(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 rn(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function an(t,e){return Math.max(0,Math.min(1,t+e))}function or(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],c=t[o+1],d=t[Math.min(n-1,o+2)],h=i*i,p=h*i,f=[0,0,0];for(let u=0;u<3;u++)f[u]=.5*(2*l[u]+(-s[u]+c[u])*i+(2*s[u]-5*l[u]+4*c[u]-d[u])*h+(-s[u]+3*l[u]-3*c[u]+d[u])*p);return f}function sn(t,e,n,r,a){let o=nr(Ti(e,n));o[0]===0&&o[1]===0&&o[2]===0&&(o=[0,0,1]);let i=tr(tr(e,_i(o,2.5)),[0,1.5,0]),s=[e[0]-r[0],0,e[2]-r[2]],l=nr(s);l[0]===0&&l[2]===0&&(l=[o[0],0,o[2]]);let c=Math.max(1,a),d=[r[0]+l[0]*c*1.3,r[1]+c*.75,r[2]+l[2]*c*1.3];return{waypoints:[t,d,i],finalPos:i}}function ln(t,e,n=35,r=28){let a=rn(e),o=or(t,a),i=rn(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:o,fov:n+(r-n)*i,eased:a}}function sr(t,e,n){let r=t.position.clone(),a=new rt().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new Ii(n[0],n[1],n[2]));let o=new rt().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(a),o}var wt=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new rt;this.endQuat=new rt;this.outQuat=new rt;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}=ln(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,an(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 lr=On,Di=.12,Fi=.25,Li=1.5;function cr(t,e,n=0,r,a){let o=[e.x*Ie,n+Li,e.y*Ie],i=a?[a[0],a[1],a[2]]:o,s=t[1],l=Number.isFinite(s)?s+lr:Number.isFinite(r)?n+r:n+lr,c=o[0]-t[0],d=o[2]-t[2],h=Math.hypot(c,d),p=h>.001?Math.min(Di,h*Fi):0,f=h>.001?c/h:0,u=h>.001?d/h:0;return{eye:[t[0]+f*p,l,t[2]+u*p],focal:i}}var Pe=Math.PI/180,Vi=45,cn=80,Mt=70,ki=1,Oi=.99;function zi(t,e){if(!(t<ki))return cn;if(!(Number.isFinite(e)&&e>0))return Mt;let n=2*Math.atan(e/(2*Pt*Oi)/Math.max(.05,t))/Pe;return Math.max(Mt,Math.min(cn,n))}var Ni=.25,Pt=1,Hi=.25,Gi=12*Pe,Bi=.2,Wi=1.5,ur=.8,dr=6,br=1.9,Ui=2/3,Yi=.12,Xi=.9,qi=1.2,ji=2,gr=.05,Ki=6;function yr(t,e,n=0){if(!t.length)return{min:[e[0]-6,n,e[2]-6],max:[e[0]+6,Math.max(n+ur,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,c=i-o,d=Math.max(l,Math.min(c,dr))/2,h=Math.max(c,Math.min(l,dr))/2,p=(r+a)/2,f=(o+i)/2;return{min:[p-d,n,f-h],max:[p+d,Math.max(n+ur,s),f+h]}}function $i(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+br,t.max[2]]}}function un(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+Wi,e+Bi,e+br*Ui),(t.min[2]+t.max[2])/2]}function xr(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,c=Math.hypot(s,l);if(c<1e-6)return 1/0;s/=c,l/=c;let d=1/0,h=-1/0;for(let p=0;p<8;p++){let f=(p&1?n.max[0]:n.min[0])-t[0],u=(p&2?n.max[1]:n.min[1])-t[1],y=(p&4?n.max[2]:n.min[2])-t[2],v=Math.max(gr,f*r+u*a+y*o),M=(f*s+y*l)/v;M<d&&(d=M),M>h&&(h=M)}return h-d}function hr(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,c=Math.hypot(s,l);if(c<1e-6)return 1/0;s/=c,l/=c;let d=-l*a,h=l*r-s*o,p=s*a,f=1/0,u=-1/0;for(let y=0;y<8;y++){let v=(y&1?n.max[0]:n.min[0])-t[0],M=(y&2?n.max[1]:n.min[1])-t[1],I=(y&4?n.max[2]:n.min[2])-t[2],S=Math.max(gr,v*r+M*a+I*o),T=(v*d+M*h+I*p)/S;T<f&&(f=T),T>u&&(u=T)}return u-f}function At(t,e){return Math.tan(t*Pe/2)*Math.max(.05,e)}function pr(t,e,n){let r=zi(n,t),a=l=>Math.max(Vi,Math.min(r,l)),o=l=>2*Math.atan(l)/Pe,i=Number.isFinite(t)&&t>0?a(o(t/(2*Ni)/Math.max(.05,n))):r;if(!(Number.isFinite(e)&&e>0))return i;let s=Math.min(i,a(o(e/(2*Yi))));return t/(2*At(s,n))>Pt?i:s}function Sr(t,e,n,r={}){let a=un(e),o=[t[0],t[1],t[2]],i=0,s=0,l=u=>{if(!(u>0))return;let y=xr(o,a);o[0]+=y.x*u,o[2]+=y.z*u,s+=u},c=r.preserveEye?0:e.max[1]+Hi-o[1];c>0&&(o[1]+=c,i=c,l(c/Math.tan(Gi)));let d=$i(e),h=mr(o,a,e),p=pr(h,hr(o,a,d),n),f=h/(2*At(p,n));for(let u=0;!r.preserveEye&&u<Ki&&f>Pt;u++){let y=Math.max(1,Math.hypot(o[0]-a[0],o[2]-a[2])),v=Number.isFinite(f)?f/Pt:2;l(Math.min(60,y*(Math.min(4,v)-1)+.5)),h=mr(o,a,e),p=pr(h,hr(o,a,d),n),f=h/(2*At(p,n))}return{eye:o,focal:a,fov:p,raisedM:i,pulledBackM:s,stageFrameWidth:f}}function Qi(t,e,n){let r=Math.tan(e*Pe/2),a=At(e,n);return Math.max(1,t/Math.max(.05,Math.min(r,a)))}var Zi=.7,fr=.5,Ji=.8;function vr(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)))/Pe}function es(t,e,n){let r=c=>{let d=Math.hypot(c[0],c[1],c[2])||1;return[c[0]/d,c[1]/d,c[2]/d]},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(c=>i[c]*(1-fr)+s[c]*fr));return[t[0]+l[0]*o,t[1]+l[1]*o,t[2]+l[2]*o]}function wr(t,e){let{aspect:n,venue:r}=e,a=t.focal,o=xr(t.eye,a),i=y=>(y[0]-a[0])*o.x+(y[2]-a[2])*o.z,s=[{name:"seat",eye:t.eye,focal:a,fov:t.fov}],l=ji*(e.rowDepthM??Xi),c=[t.eye[0]+o.x*l,t.eye[1]+qi,t.eye[2]+o.z*l],d=[t.eye[0],t.eye[1]-Zi,t.eye[2]],h=es(c,a,d);s.push({name:"row",eye:c,focal:h,fov:Math.min(cn,Math.max(t.fov,2*Math.max(vr(c,h,d),vr(c,h,a))/Ji))});let p=(y,v,M,I)=>{let S=Qi(M,t.fov,n)*1.08,T=S*Math.sin(I*Pe),F=Number.isFinite(e.seatingTopY)?e.seatingTopY+2:-1/0,D=Math.max(T,F-v[1]),L=S*Math.cos(I*Pe);return{name:y,eye:[v[0]+o.x*L,v[1]+D,v[2]+o.z*L],focal:v,fov:t.fov}};e.section&&e.section.radius>0&&s.push(p("section",e.section.center,e.section.radius,35)),s.push(p("venue",r.center,Math.max(1,r.radius),40));let f=[],u=-1/0;for(let y of s){let v=i(y.eye);f.length&&v<=u+.5||(f.push(y),u=v)}return f}import{Vec3 as ts}from"ogl";var it=Math.PI/180,dn=320,Mr=70*it,ns=32*it,os=24*it,Pr=.0026,rs=.22,as=.006,is=180,ss=900,ls=1100,cs=4,ve=(t,e,n)=>Math.max(e,Math.min(n,t)),Ar=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function Cr(t){let{canvas:e,camera:n}=t,r=[],a=!1,o=0,i=0,s=0,l=0,c=0,d=0,h=dn,p=null,f=()=>{p&&(clearTimeout(p),p=null)},u=!1,y=[0,0],v=0,M=!1,I=null,S=null,T=new Map,F=!1,D=0,L=0,g=0,A=0,w=()=>a&&r.length?r[ve(Math.round(o),0,r.length-1)].name:null,_=()=>{let P=w();P!==I&&(I=P,t.onStopChange?.(P))},O=()=>{if(!a||!r.length)return;let P=r[ve(Math.floor(o),0,r.length-1)],B=r[ve(Math.ceil(o),0,r.length-1)],j=ve(o-Math.floor(o),0,1),X=($,ee)=>$+(ee-$)*j,ne=[X(P.eye[0],B.eye[0]),X(P.eye[1],B.eye[1]),X(P.eye[2],B.eye[2])],re=[X(P.focal[0],B.focal[0]),X(P.focal[1],B.focal[1]),X(P.focal[2],B.focal[2])],ue=re[0]-ne[0],de=re[1]-ne[1],K=re[2]-ne[2],me=Math.hypot(ue,de,K)||1,he=Math.atan2(ue,K),z=Math.asin(ve(de/me,-1,1)),J=he+i,q=ve(z+s,-80*it,80*it),oe=Math.cos(q)*me;ue=Math.sin(J)*oe,de=Math.sin(q)*me,K=Math.cos(J)*oe,n.position.set(ne[0],ne[1],ne[2]),n.fov=X(P.fov,B.fov),n.updateProjectionMatrix(),n.lookAt(new ts(ne[0]+ue,ne[1]+de,ne[2]+K)),t.onApplied?.()},C=()=>{if(!a||!r.length)return;let P=ve(Math.round(o),0,r.length-1);if(t.reducedMotion()){u=!1,o=P,O(),_(),t.requestRender();return}if(Math.abs(P-o)<.001){u=!1,_();return}l=o,c=P,d=performance.now(),h=dn,u=!0,t.requestRender()},V=P=>{!a||r.length<2||(f(),u=!1,o=ve(o+P,0,r.length-1),O(),_(),t.requestRender())},N=(P,B)=>{a&&(f(),u=!1,M=!1,i=ve(i-P*Pr,-Mr,Mr),s=ve(s-B*Pr,-os,ns),O(),t.requestRender())},W=P=>{a&&(T.set(P.pointerId,{x:P.clientX,y:P.clientY}),T.size===1?(F=!0,A=0,D=P.clientX,L=P.clientY):T.size===2&&(F=!1,g=G()))},G=()=>{let P=[...T.values()];return P.length<2?0:Math.hypot(P[0].x-P[1].x,P[0].y-P[1].y)},Y=P=>{if(!a||!T.has(P.pointerId))return;if(T.set(P.pointerId,{x:P.clientX,y:P.clientY}),T.size>=2){let X=G();g>0&&V((g-X)*as),g=X;return}if(!F)return;let B=P.clientX-D,j=P.clientY-L;D=P.clientX,L=P.clientY,A+=Math.abs(B)+Math.abs(j),!(A<=cs)&&N(B,j)},te=P=>{T.delete(P.pointerId)&&(T.size<2&&(g=0),T.size===0&&(F=!1,C()))},E=P=>{if(!a)return;P.preventDefault();let B=P.deltaMode===1?16:P.deltaMode===2?100:1,j=ve(P.deltaY*B/100,-2,2);V(j*rs),S&&clearTimeout(S),S=setTimeout(()=>{S=null,C()},is)},x=()=>{f(),a&&(a=!1,u=!1,M=!1,r=[],T.clear(),F=!1,S&&(clearTimeout(S),S=null),I!==null&&(I=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",W),e.addEventListener("pointermove",Y),e.addEventListener("pointerup",te),e.addEventListener("pointercancel",te),e.addEventListener("wheel",E,{passive:!1}),{get active(){return a},enter(P,B=0){if(P.length<2){x();return}f(),r=P,a=!0,o=t.reducedMotion()?0:ve(B,0,P.length-1),o>0&&(p=setTimeout(()=>{p=null,a&&(l=o,c=0,d=performance.now(),h=ls,u=!0,t.requestRender())},ss)),i=0,s=0,u=!1,M=!1,I=null,O(),_(),t.requestRender()},exit:x,recentre(){return a?Math.abs(i)<1e-4&&Math.abs(s)<1e-4?!0:t.reducedMotion()?(M=!1,i=0,s=0,O(),t.requestRender(),!0):(y=[i,s],v=performance.now(),M=!0,t.requestRender(),!0):!1},update(P){if(!a)return!1;let B=!1;if(M){let j=ve((P-v)/dn,0,1),X=1-Ar(j);i=y[0]*X,s=y[1]*X,j>=1?(M=!1,i=0,s=0):B=!0}if(u){let j=ve((P-d)/h,0,1);o=l+(c-l)*Ar(j),j>=1?(u=!1,o=c,_()):B=!0}return O(),B},currentStop:w,dispose(){x(),e.removeEventListener("pointerdown",W),e.removeEventListener("pointermove",Y),e.removeEventListener("pointerup",te),e.removeEventListener("pointercancel",te),e.removeEventListener("wheel",E)}}}function Er(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var mn=null;function Rr(){return mn??=import("../openPanorama-VD6PE3YZ.js").catch(t=>{throw mn=null,t}),mn}var Tr=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Ct=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=Tr(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(Tr()-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 _r(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function Ir(t){let{container:e,model:n,opts:r,expandedSeatById:a,seatIdsByRow:o,isNarrow:i}=t,s=null,l=()=>{if(!s)return;let h=i();Object.assign(s.style,h?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},c=()=>{s?.remove(),s=null};return{show:(h,p,f=!1)=>{if(c(),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 y=r.chrome?.caption!==!1,v=r.chrome?.seatStepper!==!1;if(!y&&!v)return null;let M=a.get(h),I=M?.sectionId?n.sections.find(w=>w.id===M.sectionId):void 0,S=M?.label??h;u.setAttribute("aria-label",`Explore views near ${I?.label?`${I.label}, `:""}seat ${S}`);let T=document.createElement("span");T.textContent=r.seatViewCaption?.(h)??["Live 3D seat view",I?.label,S].filter(Boolean).join(" \xB7 "),Object.assign(T.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)"}),y&&u.appendChild(T);let F=document.createElement("div");Object.assign(F.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),u.appendChild(F);let D=M?.rowId?o.get(M.rowId):void 0,L=D?.indexOf(h)??-1,g=L>=0?[D?.[L-1],D?.[L+1]]:[void 0,void 0],A=(w,_,O,C=!1)=>{let V=document.createElement("button");V.type="button",V.textContent=w,V.setAttribute("aria-label",_),Object.assign(V.style,{minHeight:"44px",padding:C?"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"}),C||(V.style.minWidth="44px"),C&&(V.dataset.panoramaTrigger=""),V.addEventListener("click",O),F.appendChild(V)};if(v&&g[0]){let w=a.get(g[0])?.label??g[0];A("\u2039",`View previous seat ${w}`,()=>{t.flyToSeat(g[0])})}if(v&&r.getSeatView){let w=r.seatViewActionLabel?.(h)??"Open 360\xB0 panorama";A(f?`\u21BB Retry ${w}`:`\u25C9 ${w}`,`${f?"Retry":w} from seat ${S}`,()=>{if(t.isDisposed()||p!==t.flightGen()){c();return}c(),t.openPanorama(h,400,p)},!0)}if(v&&g[1]){let w=a.get(g[1])?.label??g[1];A("\u203A",`View next seat ${w}`,()=>{t.flyToSeat(g[1])})}return!F.childElementCount&&!y?null:(e.appendChild(u),s=u,l(),u)},remove:c,layout:l}}var us={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function Dr(t){let{container:e,orbit:n,isNarrow:r}=t,a={...us,...t.labels??{}},o=(S,T)=>{S.setAttribute("aria-label",T),S.title=T},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 c=document.createElement("div");c.setAttribute("role","group"),c.setAttribute("aria-label","3D view controls"),Object.assign(c.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let d=document.createElement("button");d.type="button",d.textContent="\u21BB",o(d,a.rotate);let h=document.createElement("button");h.type="button",h.textContent="\u2725",o(h,a.move);let p=document.createElement("button");p.type="button",p.textContent="\u2212",o(p,a.zoomOut);let f=document.createElement("button");f.type="button",f.textContent="+",o(f,a.zoomIn);for(let S of[d,h,p,f])S.className="sl-3d-icon-control",Object.assign(S.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(d,h),c.append(f,p);let u=S=>{n.setPrimaryDragMode(S);let T=S==="orbit";d.setAttribute("aria-pressed",String(T)),h.setAttribute("aria-pressed",String(!T)),d.style.background=T?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",h.style.background=T?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",i.title=T?`${a.rotate} \xB7 ${a.move} with Shift`:`${a.move} \xB7 ${a.rotate} with Shift`};d.addEventListener("click",()=>u("orbit")),h.addEventListener("click",()=>u("pan"));let y=()=>{let{atMin:S,atMax:T}=n.dollyLimitState();f.disabled!==S&&(f.disabled=S),p.disabled!==T&&(p.disabled=T)};p.addEventListener("click",()=>{n.zoomBy($e),y()}),f.addEventListener("click",()=>{n.zoomBy(Fe),y()}),i.append(l,c),u("orbit"),e.appendChild(i);let v=t.enabled!==!1,M=()=>{let S=r();i.style.display=s||!v?"none":"flex",i.style.right=S?"12px":"14px",i.style.bottom=S?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",l.style.display=S?"none":"flex",f.style.display=S?"none":"",p.style.display=S?"none":""};return M(),{element:i,utilityControls:c,setNavigationMode:u,syncZoomLimits:y,setSeatViewLocked:S=>{s=S,n.setInteractionEnabled(!S),M()},seatViewLocked:()=>s,layout:M}}var ds=.5,Fr=12,Lr=20,ms=28;function hs(t,e,n){return!(t>0)||!(n>0)?0:ds*n/(2*t*Math.tan(e*Math.PI/360))}function Vr(t){let{glctx:e,orbit:n,model:r,seats:a,opts:o,cinematic:i,analytics:s,seatIdByIndex:l,sectionIdBySeatId:c,tapSlop:d,tapMs:h,cancelFlight:p,focusSectionCamera:f,setSelection:u,ensureSeatView:y}=t,v=0,M=0,I=0,S=-1,T=!1,F=!1,D=C=>{t.seatViewLocked()||S===-1&&(S=C.pointerId,v=C.clientX,M=C.clientY,I=performance.now(),T=!1,F=i.active,i.active&&(s.cinematicCancelled(),p(),o.onViewTargetChange?.(null)))},L=C=>{C.pointerId===S&&Math.hypot(C.clientX-v,C.clientY-M)>d&&(T=!0)},g=(C,V,N,W,G)=>{let Y=e.canvas.getBoundingClientRect(),te=e.canvas.clientWidth||Y.width||1,E=e.canvas.clientHeight||Y.height||1,x=C-Y.left,P=V-Y.top,B=W*W,j=-1,X=B,ne=1/0;for(let re of a){if(N&&re.sectionId!==N)continue;let ue=r.seats.idToIndex.get(re.id);if(ue===void 0)continue;if(G){let J=Math.round(r.seats.iState[ue]??0);if(J!==0&&J!==3)continue}let de=ue*3,K=xe(n.camera.projectionViewMatrix,[r.seats.iPosition[de],r.seats.iPosition[de+1]+.55,r.seats.iPosition[de+2]],te,E);if(!K.visible)continue;let me=K.x-x,he=K.y-P,z=me*me+he*he;(z<X||Math.abs(z-X)<1&&K.depth<ne)&&(j=ue,X=z,ne=K.depth)}return j},A=(C,V)=>{let N=t.gpu(),W=t.pick();if(!N||!W)return-1;W.syncFromSeatProgram(N.seatProgram);let G=e.canvas.getBoundingClientRect(),Y=e.renderer.dpr,{x:te,y:E}=Zo(C,V,G,Y,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),x=Math.max(2,Math.round(8*Y));return W.pick(n.camera,te,E,x)},w=()=>e.canvas.clientHeight||e.canvas.getBoundingClientRect().height,_=(C,V=Fr)=>{let N=n.camera?.position;if(!N)return!1;let W=C*3,G=Math.hypot(N.x-r.seats.iPosition[W],N.y-r.seats.iPosition[W+1],N.z-r.seats.iPosition[W+2]);return hs(G,n.fovY,w())>=V};return{onDown:D,onMove:L,onUp:C=>{if(C.pointerId!==S)return;let V=!T&&performance.now()-I<h;if(S=-1,F){F=!1;return}let N=t.gpu(),W=t.pick();if(!V||!N||!W)return;let G=A(C.clientX,C.clientY),Y=C.pointerType==="touch"||C.pointerType==="pen",te=Y?Lr:Fr,E=G>=0&&_(G,te),x=!1;if(t.focusedSectionId()&&G>=0){let j=l[G],X=j?c.get(j):void 0;if(X&&X!==t.focusedSectionId()&&f(X,{keepCamera:E})){if(!E)return;x=!0}}if(t.focusedSectionId()&&G<0&&(G=g(C.clientX,C.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&G<0){let j=g(C.clientX,C.clientY,null,72,!1),X=j>=0?l[j]:void 0,ne=X?c.get(X):void 0;if(ne&&ne!==t.focusedSectionId()&&f(ne))return}if(!t.focusedSectionId()){G<0&&(G=g(C.clientX,C.clientY,null,42,!1));let j=G>=0?l[G]:void 0,X=j?c.get(j):void 0;if(X&&f(X,{keepCamera:E})){if(!E)return;x=!0}}if(G<0||G>=l.length){t.selection().size&&(u([]),o.onViewTargetChange?.(null));return}let P=l[G];if(Y&&t.focusedSectionId()&&!x&&!_(G,Lr)){t.focusSeatCamera(P,{seatPx:ms,viewportHeightPx:w()});return}let B=ye[Math.round(r.seats.iState[G]??0)]??"available";if(B!=="available"&&B!=="selected"){o.onSeatInspect?.(P,B);return}if(t.selection().has(P)&&t.selection().size===1){u([]),o.onViewTargetChange?.(null),o.onSeatPick?.(P);return}u([P]),y(P),s.seatPicked(P,c.get(P)),o.onSeatPick?.(P)}}}var Et=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 f=0;f<this.count;f++){let u=e[f*3],y=e[f*3+2];u<n&&(n=u),u>a&&(a=u),y<r&&(r=y),y>o&&(o=y)}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,c=new Int32Array(l+1),d=f=>{let u=Math.min(this.cols-1,Math.max(0,Math.floor((e[f*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[f*3+2]-r)/this.cell)))*this.cols+u};for(let f=0;f<this.count;f++)c[d(f)+1]++;for(let f=0;f<l;f++)c[f+1]+=c[f];let h=new Int32Array(this.count),p=c.slice(0,l);for(let f=0;f<this.count;f++)h[p[d(f)]++]=f;this.cellStart=c,this.cellItems=h}gather(e,n,r,a,o){this.ensureGrid();let i=this.cellStart,s=this.cellItems;if(!i||!s)return 0;let l=a.length,c=r*r,d=Math.floor((e-this.minX)/this.cell),h=Math.floor((n-this.minZ)/this.cell),p=Math.ceil(r/this.cell)+1,f=this.iPosition,u=0;for(let y=0;y<=p&&u<l;y++){let v=h-y,M=h+y,I=d-y,S=d+y;for(let T=v;T<=M&&u<l;T++){if(T<0||T>=this.rows)continue;let F=T===v||T===M;for(let D=I;D<=S&&u<l;D++){if(!F&&D!==I&&D!==S){D=S-1;continue}if(D<0||D>=this.cols)continue;let L=T*this.cols+D;for(let g=i[L],A=i[L+1];g<A&&u<l;g++){let w=s[g],_=f[w*3]-e,O=f[w*3+2]-n,C=o===void 0?0:f[w*3+1]-o;_*_+C*C+O*O<=c&&(a[u++]=w)}}}}return u}};var Rt=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(bt);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Et(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)<$t)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>Kt){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(a.x,a.z,Kt,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 kr(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 ps,Vec3 as fs}from"ogl";function Or(){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 zr(t){let{container:e,model:n,opts:r,orbit:a,cinematic:o,analytics:i,loop:s,labelOverlay:l,stageAzimuth:c,overviewFraming:d}=t,h=0,p=-1,f=(w,_,O=28)=>{a.camera.position.set(w[0],w[1],w[2]),a.camera.lookAt(new fs(_[0],_[1],_[2])),a.camera.fov=O,a.camera.updateProjectionMatrix()},u=document.createElement("button");u.className="sl-3d-overview-control sl-3d-icon-control",u.type="button",u.replaceChildren(Or());let y=r.navLabels?.fitView??"Show whole venue";u.setAttribute("aria-label",y),u.title=y,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 v=()=>{u.firstElementChild||u.replaceChildren(Or())};v();let M=w=>{p=w;let _=t.gpu();_&&(_.seatProgram.uniforms.uFocusFloor.value=w,_.solidProgram.uniforms.uFocusFloor.value=w,_.chairProgram.uniforms.uFocusFloor.value=w),t.showSectionSeatLabels(null)},I=null,S=!1,T=()=>{if(I=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 w=p>=0?n.floors[p]:null;if(t.setNearFieldDetailEnabled(!!w),t.setSeatViewLocked(!1),F(),t.removeArriveChip(),t.setNavigationMode("orbit"),w){let _=w.focalWorld[0]-w.center[0],O=w.focalWorld[2]-w.center[2],C=Math.hypot(_,O)>w.radius*.12?Math.atan2(_,O):c,V={center:w.center,radius:w.radius,box:w.box},N={polarDeg:58,margin:1.12};t.reducedMotion()?a.frame(V,!1,C,!1,N):a.frameSoft(V,C,!1,N)}else t.reducedMotion()?a.frame(n.bounds,!1,c,r.portraitOverviewCrop===!0,d):a.frameSoft(n.bounds,c,r.portraitOverviewCrop===!0,d);l.setOverviewDistance(a.targetDistance),t.showSectionSeatLabels(null),s.requestRender()},F=()=>{h++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),o.active&&(o.cancel(),a.resumeAfterFlight(n.focalWorld))},D=w=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let _=n.seats.idToIndex.get(w);if(_===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(w),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 O=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(O),t.setSeatViewLocked(!1);let C=++h;O?t.showArriveChip(w,C):t.removeArriveChip();let{eye:V,focal:N}=t.resolvedSeatViewPose(w,_),W=r.arriveAtSeatEye?t.seatViewArrival(w,_):null,G=W&&W.stops.length>1&&W.stops[1].name==="row"?W.stops[1]:null,Y=W?W.focal:N,te=[a.camera.position.x,a.camera.position.y,a.camera.position.z],E=sn(te,W?.eye??V,Y,n.bounds.center,n.bounds.radius),x=G?G.eye:W?W.eye:r.arriveAtSeatEye?V:E.finalPos,P=W?W.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?Mt:65:28,B=[E.waypoints[0],E.waypoints[1],x];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),f(x,Y,P),s.requestRender(),i.cinematicSkipped(),t.isDisposed()||a.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),W&&t.enterSeatView(W.stops),t.showArriveChip(w,C),Promise.resolve();let j=new ps().copy(a.camera.quaternion),X=sr(a.camera,x,Y);s.requestRender();let ne=O?700:2500;return o.start(B,j,X,ne,P).then(()=>{t.isDisposed()||C!==h||(t.setSeatStepping(!1),i.cinematicPlayed(ne),a.resumeAfterFlight(Y),t.setSeatViewLocked(r.arriveAtSeatEye===!0),W&&t.enterSeatView(W.stops,G?1:0),s.requestRender(),t.showArriveChip(w,C))})},L=(w,_)=>{let O=n.sections.find(C=>C.id===w);if(!O||O.seatCount===0)return!1;if(I=w,S=!1,t.setSeeThrough?.(null),t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),o.cancel(),t.removeArriveChip(),n.floors.length>1&&p!==O.floorIndex&&M(O.floorIndex),t.setNavigationMode("pan"),t.panorama()||l.setVisible(!0),t.showSectionSeatLabels(w),!_?.keepCamera){let C=kr(O),V={polarDeg:C.polarDeg,margin:1.12};t.reducedMotion()?a.frame({center:C.center,radius:C.radius},!1,a.currentAzimuth,!1,V):a.glideTo({center:C.center,radius:C.radius},V)}return r.onSectionFocusChange?.(w),s.requestRender(),!0},g=(w,_)=>{if(t.isDisposed()||!t.gpu())return!1;let O=n.seats.idToIndex.get(w);if(O===void 0)return!1;let C=O*3,V=[n.seats.iPosition[C],n.seats.iPosition[C+1]+.55,n.seats.iPosition[C+2]],N=_?vs(_,a.fovY,a.camera.aspect||1):Nr;return S=!0,t.setSeeThrough?.(V),t.reducedMotion()?a.frame({center:V,radius:N},!1,void 0,!1,hn):a.frameSoft({center:V,radius:N},void 0,!1,hn),s.requestRender(),!0},A=()=>{if(t.isNarrow?.()&&S&&I&&L(I)){s.requestRender();return}T()};return u.addEventListener("click",A),{overviewChip:u,layoutOverviewChip:v,flightGen:()=>h,focusedFloor:()=>p,applyFloorFocus:M,placeCameraFinal:f,cancelFlight:F,focusOverview:T,flyToSeat:D,focusSectionCamera:L,focusSeatCamera:g}}var Nr=4.5;function vs(t,e,n){let r=Math.tan(e*Math.PI/360),a=r*Math.max(.001,n),i=bs*t.viewportHeightPx/(2*Math.max(1,t.seatPx)*r)*Math.min(r,a)/hn.margin;return Math.max(gs,Math.min(Nr,i))}var bs=.5,gs=1.5,hn={polarDeg:48,margin:1.25};function pn(t,e,n,r,a,o,i,s,l=.5){let c=-1,d=s*s,h=1/0;for(let p=0;p<e;p++){let f=p*3,u=xe(n,[t[f],t[f+1]+l,t[f+2]],r,a);if(!u.visible)continue;let y=u.x-o,v=u.y-i,M=y*y+v*v;(M<d-4||M<d+4&&u.depth<h)&&(c=p,d=Math.min(d,M),h=u.depth)}return c}function Hr(t){let e=performance.now(),{input:n,estimate:r}=Jn(t);return{model:Ke(n),buildMs:performance.now()-e,source:"main",...r?{estimate:r}:{}}}function ys(t){let e=Fn(t.doc);return{...Hr({...t,seats:e}),seats:e}}function Gr(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=c=>{o||(o=!0,clearTimeout(l),r.terminate(),a(c))},s=()=>i(e()),l=window.setTimeout(s,15e3);r.onerror=s,r.onmessage=c=>{let d=n(c.data);d?i(d):s()},r.postMessage(t)})}function xs(t){return Gr(t,()=>Hr(t),({model:e,buildMs:n,estimate:r})=>({model:e,buildMs:n,source:"worker",...r?{estimate:r}:{}}))}function Ss(t){return Gr(t,()=>ys(t),({model:e,buildMs:n,seats:r,estimate:a})=>r?{model:e,buildMs:n,seats:r,source:"worker",...a?{estimate:a}:{}}:null)}var Ms=40,Ps=48,As=Math.PI/180,Cs=6,Es=500,Rs=6;function Jc(t,e,n={}){let r=performance.now(),a=e.prepared?e.prepared.estimate:e.estimate===!1?null:Wt(e.doc,e.seats);a&&(e={...e,doc:a.doc,seats:Zn(e.seats,a)});let o=e.prepared?.model??Ke(e),i=new Ct(n.onAnalytics),s=new Array(o.seats.count);for(let[m,b]of o.seats.idToIndex)s[b]=m;let l=new Map(e.seats.map(m=>[m.id,m])),c=new Map;for(let m of e.seats){if(!m.rowId)continue;let b=c.get(m.rowId);b?b.push(m.id):c.set(m.rowId,[m.id])}let d=new Map,h=[0,0,0,0];function p(){if(v)for(let m of[v.seatProgram,v.solidProgram,v.chairProgram])m.uniforms.uSeeThrough.value=h}e.seats.forEach((m,b)=>{d.set(m.id,o.seatSectionIds?.[b]??m.sectionId)});let f=new Map;for(let[m,b]of o.seats.idToIndex){let R=d.get(m);if(!R)continue;let H=f.get(R);H?H.push(b):f.set(R,[b])}let u=()=>{if(!v||!o.sectionSolidRanges.length)return;let{lit:m,anyUnlit:b}=Yo(o.sectionSolidRanges,f,o.seats.iState);v.setSectionShellLit(b?m:null)},y=e.doc.floors?.some(b=>(b.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(b=>b.objects)??e.doc.objects).some(b=>b.type==="section"&&((b.height??0)>0||(b.rake??0)>0)),v=null,M=null,I=null,S=!1,T=!1,F=!1,D=new Map,L=null,g=null,A=null,w=new Map,_=null,O=()=>{A===null&&(A=t.style.zIndex,t.style.zIndex="20")},C=()=>{A!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=A),A=null)},V=!1,N=()=>V?pe.focusedFloor():-1,W=()=>{v=$o(E.gl,o),M?.dispose(),M=So(E.gl,[1,1,1]),Mn(!1),u(),oe(),I=new St(E.renderer,v.seatGeometry,v.chairGeometry,v.solidGeometry,o.seats.count),E.setClearColor(o.theme.background.top),I.setRestoreClear(o.theme.background.top),I.setRoomCentre(o.room?.centre),v.seatProgram.uniforms.uSeatRadius.value=qe*o.theme.seatScale,v.seatProgram.uniforms.uFocusFloor.value=N(),v.solidProgram.uniforms.uFocusFloor.value=N(),v.chairProgram.uniforms.uFocusFloor.value=N(),v.screenProgram&&(v.screenProgram.uniforms.uFocusFloor.value=N()),p(),Y.forceRegather()},G=!1,Y=new Rt({model:o,orbit:()=>x,gpu:()=>v}),te=m=>Y.setDetailEnabled(m),E=new pt(t,{onContextLost:()=>{F||i.contextLost(),S=!0,ae.stop(),v=null,I=null},onContextRestored:()=>{W(),S=!1,F||i.contextRestored(),ae.requestRender()}}),x=new ft(E.gl,E.canvas,()=>ae.requestRender(),()=>i.orbitEngaged());x.setAspect(E.aspect);let P=(e.doc.floors?.flatMap(m=>m.objects)??e.doc.objects).some(m=>m.type==="section"&&m.physical3dProvenance?.surfaceKind?.status==="inferred"),B=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(P&&o.stages.length===0))return eo(o.focalWorld,o.seats.iPosition,o.bounds)})(),j=(e.doc.floors?.flatMap(m=>m.objects)??e.doc.objects).some(m=>m.type==="shape"&&m.stageKind?.startsWith("pitch-")),X=o.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:j?36:48,margin:1.05},ne=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;x.frame(o.bounds,!ne&&n.skipInitialOverviewAnimation!==!0,B,n.portraitOverviewCrop===!0,X);let re=new wt(x.camera),ue=_r(t),de=to(t,o),K=new yt(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:o.theme.background.top}),me=o.labels,he=()=>Bn(me,o.floors.length,N());K.setLabels(he()),K.setOverviewDistance(x.targetDistance);let z=null,J=()=>[...D.keys()].flatMap(m=>{let b=o.seats.idToIndex.get(m),R=b===void 0?void 0:e.seats[b];if(b===void 0||R?.id!==m)return[];let H=b*3;return[{id:`seat:${m}`,kind:"seat",seatWidthM:o.seats.iChairWidth[b]*2,text:R.displayLabel||R.label,anchor:[o.seats.iPosition[H],o.seats.iPosition[H+1]+1.05,o.seats.iPosition[H+2]],pinBase:Tt(H)}]}),q=-1,oe=()=>{v&&(q=z?o.sections.findIndex(m=>m.id===z):-1,v.seatProgram.uniforms.uFocusSection.value=q,v.chairProgram.uniforms.uFocusSection.value=q)},$=m=>{if(z=m,oe(),K.setForcedDense(!!m),!m){let k=J(),fe=new Set(k.map(se=>se.id));K.setLabels([...he().filter(se=>!fe.has(se.id)),...k]);return}let b=e.seats.filter(k=>d.get(k.id)===m),R=new Set(b.map(k=>k.id)),H=new Set(b.map(k=>k.rowId)),U=new Set(D.keys()),Z=new Set(b.filter(k=>U.has(k.id)).map(k=>k.id)),Q=he().filter(k=>k.kind!=="row"&&k.kind!=="seat"&&k.kind!=="access"||k.kind==="access"&&R.has(k.id.slice(7))||(k.kind==="row"?H.has(k.id.slice(4)):R.has(k.id.slice(5))));if(o.seatCount<=6e3&&Z.size===0){K.setLabels(Q);return}let ie=b,be=new Set(ie.map(k=>`seat:${k.id}`)),Me=ie.flatMap(k=>{let fe=o.seats.idToIndex.get(k.id);if(fe===void 0)return[];let se=fe*3;return[{id:`seat:${k.id}`,kind:"seat",seatWidthM:o.seats.iChairWidth[fe]*2,rowId:k.rowId,text:U.has(k.id)?k.displayLabel||k.label:Qn(k.displayLabel||k.label),anchor:[o.seats.iPosition[se],o.seats.iPosition[se+1]+(U.has(k.id)?1.05:.55),o.seats.iPosition[se+2]],...U.has(k.id)?{pinBase:Tt(se)}:{}}]});K.setLabels([...Q.filter(k=>!be.has(k.id)),...Me])};W();let ee=null,fn=null,vn=new ws,bn=m=>{if(S||!v||T)return!1;let b=Er({flying:re.active,panoramaMounted:L!==null,seatViewActive:ee?.active===!0}),R=b==="orbit"?q:-1;v.seatProgram.uniforms.uFocusSection.value=R,v.chairProgram.uniforms.uFocusSection.value=R;let H=b==="cinematic"?re.update(performance.now()):b==="seatView"?ee.update(performance.now()):b==="orbit"?x.update():!1;fn?.syncZoomLimits();let U=N()>=0?o.floors[N()]:null,Z=U?.radius??o.bounds.radius,Q=bo(x.currentDistance,Z),ie=G?{center:[x.camera.position.x,x.camera.position.y,x.camera.position.z],radius:520}:o.clipBounds??o.renderBounds;x.updateClipping(ie);let be=U?.center??o.renderBounds.center,Me=U?.radius??o.renderBounds.radius,k=(le,Nt)=>Math.hypot(x.camera.position.x-le[0],x.camera.position.y-le[1],x.camera.position.z-le[2])<=Nt*(Y.detailVisible?1.8:1.55),fe=k(be,Me);if(!fe&&z){let le=o.sections.find(Nt=>Nt.id===z);le&&(fe=k(le.center,Math.max(12,le.radius*2)))}Y.detailVisible=fe;let se=v.seatProgram.uniforms;se.uSeatScale.value=Q.scale,se.uSeatFade.value=Q.fade;let ct=!!U&&go(U.seatCount,E.canvas.clientWidth||1,E.canvas.clientHeight||1),ut=yo(o.seats.count,Z,x.currentDistance,x.camera.fov,E.canvas.clientHeight||1),We=Y.detailVisible||ct||ut?1:0,Ue=Y.detailVisible||N()>=0||o.floors.length>1?1:0;Y.ease(m,We,Ue),se.uSeatDetail.value=Y.seatDetailMix;let dt=We===0&&Y.seatDetailMix<.01;v.seatGeometry.setDrawRange(dt?Ut:0,dt?no:Ut),v.solidProgram.uniforms.uStructureDetail.value=Y.structureDetailMix,se.uMinPixels.value=Q.minPixels,se.uPixelToWorld.value=2*Math.tan(x.camera.fov*As/2)/Math.max(1,E.pixelHeight),Y.update(Y.detailVisible),o.outdoor&&(vn.copy(x.camera.projectionViewMatrix).inverse(),v.backgroundProgram.uniforms.uInvViewProj.value.set(vn)),E.renderer.render({scene:v.background,clear:!0}),E.renderer.render({scene:v.main,camera:x.camera,clear:!1});let Ye=M?M.update(performance.now(),[x.camera.position.x,x.camera.position.y,x.camera.position.z],L!==null,b==="seatView"):!1;if(M&&E.renderer.render({scene:M.root,camera:x.camera,clear:!1}),de){let le=x.camera.worldMatrix;de.update(b==="seatView"?[x.camera.position.x,x.camera.position.y,x.camera.position.z]:null,[-le[8],-le[9],-le[10]])}K.update(x.camera.projectionViewMatrix,E.canvas.clientWidth||1,E.canvas.clientHeight||1,x.currentDistance,Z,[x.camera.position.x,x.camera.position.y,x.camera.position.z]);let _e=H||Ye||Y.seatDetailMix!==We||Y.structureDetailMix!==Ue;return gn(!_e),_e},gn=mo(t),ae=new vt(bn),yn=typeof ResizeObserver<"u"?new ResizeObserver(()=>zt.resize()):null;yn?.observe(t),x.setZoomPointResolver((m,b)=>{let R=E.canvas.getBoundingClientRect(),H=E.canvas.clientWidth||R.width,U=E.canvas.clientHeight||R.height;if(!(H>0)||!(U>0))return null;x.camera.updateMatrixWorld();let Z=pn(o.seats.iPosition,o.seats.count,x.camera.projectionViewMatrix,H,U,m-R.left,b-R.top,Ms);if(Z<0)return null;let Q=Z*3;return[o.seats.iPosition[Q],o.seats.iPosition[Q+1]+.5,o.seats.iPosition[Q+2]]});function Tt(m){return[o.seats.iPosition[m],o.seats.iPosition[m+1]+.5,o.seats.iPosition[m+2]]}K.setSeatNumberRow(null);let ge=null,Ae=0,_t=null,xn=()=>{Ae=0;let m=null,b=null;if(ge&&!ee?.active&&!re.active){let U=E.canvas.getBoundingClientRect(),Z=E.canvas.clientWidth||U.width,Q=E.canvas.clientHeight||U.height;if(Z>0&&Q>0){let ie=pn(o.seats.iPosition,o.seats.count,x.camera.projectionViewMatrix,Z,Q,ge.x-U.left,ge.y-U.top,Ps);m=ie>=0?e.seats[ie]?.rowId??null:null;let be=ie>=0?e.seats[ie]?.id??null:null;if(b=be,ge.mouse&&!ge.pressing&&!!z&&!!be&&d.get(be)===z){let k=t.getBoundingClientRect();_t=be,n.onSeatHover?.(be,{x:ge.x-k.left,y:ge.y-k.top})}else Sn()}}else Sn();let R=ge?.mouse?b:null,H=K.setSeatNumberSeat(R);(K.setSeatNumberRow(m)||H)&&ae.requestRender()};function Sn(){_t!==null&&(_t=null,n.onSeatHover?.(null,null))}let st=m=>{ge={x:m.clientX,y:m.clientY,mouse:m.pointerType==="mouse",pressing:m.type==="pointerdown"},Ae||(Ae=requestAnimationFrame(xn))},wn=m=>{m.pointerType==="mouse"&&(ge=null,Ae||(Ae=requestAnimationFrame(xn)))};E.canvas.addEventListener("pointermove",st),E.canvas.addEventListener("pointerdown",st),E.canvas.addEventListener("pointerleave",wn);function Mn(m){if(!M)return;let b=[];for(let R of D.keys()){let H=o.seats.idToIndex.get(R);if(H===void 0)continue;let U=H*3;b.push({id:R,position:Tt(U)})}M.setSeats(b,performance.now(),m)}let Pn=m=>{let b=U=>{let Z=o.seats.idToIndex.get(U);return Z===void 0?void 0:o.seats.iState[Z]},{updates:R,next:H}=er(D,m,b);if(D=H,K.setSelectedSeatIds(D.keys()),Mn(!He()),ae.requestRender(),$(z),R.length){let U=Gt(o.seats,R);v&&v.uploadSeatStateRuns(U),u(),ae.requestRender()}},He=()=>_!==null?_:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Br=8,An=m=>{if(!n.getSeatView)return null;let b=w.get(m);if(!b)for(b=Promise.resolve(n.getSeatView(m)),w.set(m,b),b.catch(()=>{w.get(m)===b&&w.delete(m)});w.size>Br;){let R=w.keys().next().value;if(R===void 0)break;w.delete(R)}return b},Cn=yr(o.stages,o.focalWorld,o.bounds.groundY??0),Wr=un(Cn),It=(m,b)=>{let R=l.get(m),H=Math.max(0,Math.round(o.seats.iFloor[b]??0)),U=e.doc.floors?.[H],Z=o.floors[H],Q=U?.focalPoint??e.doc.focalPoint,ie=Z?{x:Z.focalWorld[0]/Ie,y:Z.focalWorld[2]/Ie}:Q,be=R?.focalPoint?{x:R.focalPoint.x+ie.x-Q.x,y:R.focalPoint.y+ie.y-Q.y}:ie,Me=[o.seats.iPosition[b*3],o.seats.iPosition[b*3+1],o.seats.iPosition[b*3+2]];return cr(Me,be,U?.baseHeightM??0,R?.eyeHeightM,Wr)},Dt=()=>(t.clientWidth||E.canvas.clientWidth)<=520,Ft=null,En=null,Ur=async(m,b,R)=>{if(!n.getSeatView||F||R!==pe.flightGen())return;let H;try{H=await Rr()}catch{if(i.panoramaFailed(m,"mount"),!F&&R===pe.flightGen()){let U=Vt(m,R,!0);requestAnimationFrame(()=>U?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(F||R!==pe.flightGen()||!Ft))return En??=H.createOpenPanorama(Ft),En(m,b,R)},Lt=Ir({container:t,model:o,opts:n,expandedSeatById:l,seatIdsByRow:c,isNarrow:Dt,isDisposed:()=>F,flightGen:()=>pe.flightGen(),flyToSeat:m=>In(m),openPanorama:(m,b,R)=>Ur(m,b,R)}),Vt=Lt.show,kt=Lt.remove,Yr=Lt.layout,Ce=Dr({container:t,orbit:x,isNarrow:Dt,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});fn=Ce;let Xr=Ce.element,Ge=Ce.setNavigationMode,qr=Ce.layout,jr=Ce.utilityControls,Be=null,Rn=!1,lt=m=>{Ce.setSeatViewLocked(m),m||ee?.exit()};ee=Cr({canvas:E.canvas,camera:x.camera,requestRender:()=>ae.requestRender(),reducedMotion:He,onStopChange:m=>{let b=m??(Rn?"seat":null);Be=b;try{n.onSeatViewStopChange?.(b)}catch{}},onApplied:()=>{F||x.syncFromCamera()}});let Tn=o.sections.reduce((m,b)=>b.seatCount>0&&b.box?Math.max(m,b.box.max[1]):m,-1/0),Kr=(m,b)=>{let{eye:R}=It(m,b),H=(t.clientWidth||E.canvas.clientWidth||1)/Math.max(1,t.clientHeight||E.canvas.clientHeight||1),U=Sr(R,Cn,H,{preserveEye:!0});if(n.seatViewStops===!1)return{...U,stops:[]};let Z=d.get(m),Q=Z?o.sections.find(ie=>ie.id===Z):void 0;return{...U,stops:wr(U,{aspect:H,seatingTopY:Number.isFinite(Tn)?Tn:o.bounds.box.max[1],section:Q&&Q.seatCount>0?{center:Q.center,radius:Q.radius}:null,venue:{center:o.bounds.center,radius:o.bounds.radius}})}},pe=zr({isNarrow:Dt,setSeeThrough:m=>{h=m?[m[0],m[1],m[2],Rs]:[0,0,0,0],p(),ae.requestRender()},container:t,model:o,opts:n,orbit:x,cinematic:re,analytics:i,loop:ae,labelOverlay:K,stageAzimuth:B,overviewFraming:X,gpu:()=>v,isDisposed:()=>F,panorama:()=>L,setPanorama:m=>{L=m},setPanoramaSphereVisible:m=>{G=m},panoramaLoadAbort:()=>g,setPanoramaLoadAbort:m=>{g=m},setFrozen:m=>{T=m},restorePanoramaLayer:C,reducedMotion:He,resolvedSeatViewPose:It,showSectionSeatLabels:$,setNearFieldDetailEnabled:te,setSeatViewLocked:lt,setNavigationMode:Ge,showArriveChip:Vt,removeArriveChip:kt,inSeatView:()=>Be!==null,setSeatStepping:m=>{Rn=m},seatViewArrival:(m,b)=>n.arriveAtSeatEye?Kr(m,b):null,enterSeatView:(m,b)=>ee?.enter(m,b)});V=!0;let Ot=pe.overviewChip,$r=pe.layoutOverviewChip,Qr=pe.applyFloorFocus,Zr=pe.focusOverview,_n=pe.cancelFlight,In=pe.flyToSeat,Dn=pe.focusSectionCamera;jr.appendChild(Ot),Ft={container:t,model:o,opts:n,analytics:i,orbit:x,loop:ae,seatsById:l,ensureSeatView:An,resolvedSeatViewPose:It,gpu:()=>v,gl:E.gl,isContextLost:()=>S,isDisposed:()=>F,flightGen:()=>pe.flightGen(),setPanorama:m=>{L=m},getLoadAbort:()=>g,setLoadAbort:m=>{g=m},setPanoramaSphereVisible:m=>{G=m,m&&ee?.exit()},setFrozen:m=>{T=m},raisePanoramaLayer:O,restorePanoramaLayer:C,getOverviewChip:()=>Ot,labelOverlay:K,reducedMotion:He,removeArriveChip:kt,showArriveChip:Vt};let we=Vr({glctx:E,orbit:x,model:o,seats:e.seats,opts:n,cinematic:re,analytics:i,seatIdByIndex:s,sectionIdBySeatId:d,tapSlop:Cs,tapMs:Es,gpu:()=>v,pick:()=>I,seatViewLocked:()=>Ce.seatViewLocked(),focusedSectionId:()=>z,selection:()=>D,cancelFlight:_n,focusSectionCamera:Dn,focusSeatCamera:pe.focusSeatCamera,setSelection:Pn,ensureSeatView:An});E.canvas.addEventListener("pointerdown",we.onDown),E.canvas.addEventListener("pointermove",we.onMove),E.canvas.addEventListener("pointerup",we.onUp),E.canvas.addEventListener("pointercancel",we.onUp),ae.requestRender();let zt={setAvailability(m){let b=Jo(D,m),R=Gt(o.seats,b);R.length&&v&&v.uploadSeatStateRuns(R),u(),ae.requestRender()},setSelection:Pn,setNavigationMode:Ge,zoomIn(){x.zoomBy(Fe),ae.requestRender()},zoomOut(){x.zoomBy($e),ae.requestRender()},flyToSeat:In,focusOverview:Zr,seatViewStop:()=>Be,recentreSeatView:()=>ee?.recentre()??!1,resize(){let{width:m,height:b}=E.resize();x.setAspect(m/Math.max(1,b)),Yr(),qr(),$r(),ae.requestRender()},stats(){return{...ae.stats(),drawCalls:v?v.drawCalls:0,fallbackTriangles:v?v.seatGeometry.drawRange.count/3*o.seats.count:0,seatCount:o.seatCount}},captureImage(m=1280){if(S||!v||typeof document>"u")return null;bn(0);let b=E.canvas,R=Math.min(1,m/Math.max(b.width,b.height,1)),H=document.createElement("canvas");H.width=Math.max(1,Math.round(b.width*R)),H.height=Math.max(1,Math.round(b.height*R));let U=H.getContext("2d");return U?(U.drawImage(b,0,0,H.width,H.height),H.toDataURL("image/jpeg",.82)):null},getQualityEvidence(){let m=ae.stats(),b=E.canvas.clientWidth||1,R=E.canvas.clientHeight||1,H=o.bounds.center,U=xe(x.camera.projectionViewMatrix,[H[0],o.bounds.box.min[1],H[2]],b,R),Z=xe(x.camera.projectionViewMatrix,[H[0],o.bounds.box.max[1],H[2]],b,R),Q=o.bounds.box,ie=[Q.min[0],Q.max[0]].flatMap(k=>[Q.min[1],Q.max[1]].flatMap(fe=>[Q.min[2],Q.max[2]].map(se=>xe(x.camera.projectionViewMatrix,[k,fe,se],b,R)))).filter(k=>Number.isFinite(k.x)&&Number.isFinite(k.y)&&Number.isFinite(k.depth)),be=ie.length?(()=>{let k=Math.min(...ie.map(le=>le.x)),fe=Math.max(...ie.map(le=>le.x)),se=Math.min(...ie.map(le=>le.y)),ct=Math.max(...ie.map(le=>le.y)),ut=Math.max(0,k),We=Math.min(b,fe),Ue=Math.max(0,se),dt=Math.min(R,ct),Ye=Math.max(0,We-ut),_e=Math.max(0,dt-Ue);return{box:{x:ut,y:Ue,width:Ye,height:_e},horizontalFillRatio:Ye/b,verticalFillRatio:_e/R,visibleAreaRatio:Ye*_e/(b*R),clippedEdges:[...se<0?["top"]:[],...fe>b?["right"]:[],...ct>R?["bottom"]:[],...k<0?["left"]:[]]}})():void 0,Me=String(E.gl.getParameter(E.gl.VERSION)??"");return{viewport:{width:b,height:R},context:{webgl2:/webgl\s*2/i.test(Me),lost:S},frame:{rendered:m.rendered,idle:m.idle},camera:{position:[x.camera.position.x,x.camera.position.y,x.camera.position.z],distance:x.currentDistance,verticalFovDeg:x.fovY},scene:{seatCount:o.seatCount,floorCount:o.floors.length,zoneCount:o.zones.length,sectionCount:o.sections.length,authoredRelief:y,renderedVerticalSpanM:Math.max(0,o.bounds.box.max[1]-o.bounds.box.min[1]),projectedReliefPx:U.visible&&Z.visible?Math.abs(U.y-Z.y):0},labels:K.qualityEvidence(),framing:be,...Be?{seatView:{fovDeg:x.camera.fov,stop:Be}}:{}}},getQualityReport(){return en(zt.getQualityEvidence())},loseContextForTest(){E.simulateContextLossCycle()},floors(){return o.floors},focusFloor(m){if(m!==null&&!o.floors.some(R=>R.index===m))return!1;let b=m??-1;if(te(m!==null),lt(!1),Qr(b),Ge("orbit"),m===null)re.cancel(),He()?x.frame(o.bounds,!1,B,n.portraitOverviewCrop===!0,X):x.frameSoft(o.bounds,B,n.portraitOverviewCrop===!0,X),K.setOverviewDistance(x.targetDistance);else{let R=o.floors[m];if(R.seatCount>0){re.cancel();let H=R.focalWorld[0]-R.center[0],U=R.focalWorld[2]-R.center[2],Z=Math.hypot(H,U)>R.radius*.12?Math.atan2(H,U):B;x.frame({center:R.center,radius:R.radius,box:R.box},!1,Z,!1,{polarDeg:58,margin:1.12}),K.setOverviewDistance(x.targetDistance)}}return ae.requestRender(),!0},zones(){return o.zones},focusZone(m){let b=o.zones.find(Z=>Z.id===m);if(!b||b.seatCount===0)return!1;te(!1),lt(!1),re.cancel(),Ge("orbit"),$(null),n.onSectionFocusChange?.(null);let R=b.focalWorld[0]-b.center[0],H=b.focalWorld[2]-b.center[2],U=Math.hypot(R,H)>b.radius*.12?Math.atan2(R,H):void 0;return x.frame({center:b.center,radius:b.radius*1.25},!1,U),ae.requestRender(),!0},sections(){return o.sections},focusSection(m){return Dn(m)},rows(m){return m?o.rows.filter(b=>b.sectionId===m):o.rows},seatsInRow(m){return e.seats.filter(b=>b.rowId===m).map(b=>({id:b.id,label:b.displayLabel||b.label}))},focusRow(m){let b=o.rows.find(R=>R.id===m);return!b||b.seatCount===0?!1:(te(!0),lt(!1),re.cancel(),Ge("pan"),b.sectionId&&($(b.sectionId),n.onSectionFocusChange?.(b.sectionId)),x.frame({center:b.center,radius:Math.max(2.5,b.radius*.65)}),ae.requestRender(),!0)},setReducedMotionForTest(m){_=m},dispose(){F=!0,de?.dispose(),gn(!1),kt(),Ot.remove(),Xr.remove(),_n(),ee?.dispose(),ae.stop(),K.dispose(),yn?.disconnect(),L&&(L.dispose(),L=null),C(),ue(),E.canvas.removeEventListener("pointerdown",we.onDown),E.canvas.removeEventListener("pointermove",we.onMove),E.canvas.removeEventListener("pointerup",we.onUp),E.canvas.removeEventListener("pointercancel",we.onUp),E.canvas.removeEventListener("pointermove",st),E.canvas.removeEventListener("pointerdown",st),E.canvas.removeEventListener("pointerleave",wn),Ae&&cancelAnimationFrame(Ae),x.dispose(),I&&I.dispose(),v&&v.dispose(),v=null,M?.dispose(),M=null,I=null,E.dispose()}};return i.opened(o.seatCount,y,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),zt}export{qa as VENUE3D_QUALITY_REPORT_VERSION,Jr as autoVenue3d,Ke as buildSceneModel,Wt as estimateVenue3D,en as inspectVenue3DQualityEvidence,Jc as mountVenue3D,xs as prepareVenue3D,Ss as prepareVenue3DFromChart};
|