@seatlayer/core 0.110.0 → 0.110.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ar-C5PA2DVE.js +1 -0
- package/dist/be-TMKSMYPN.js +1 -0
- package/dist/bg-V6HTEDUB.js +1 -0
- package/dist/ca-CTZMHWW4.js +1 -0
- package/dist/{categoryInventory-BfvwE3nC.d.cts → categoryInventory-BE1AThTx.d.cts} +1 -1
- package/dist/{categoryInventory-ClZ-68jI.d.ts → categoryInventory-DxciZQK_.d.ts} +1 -1
- package/dist/{chunk-6VOUTNRV.js → chunk-2VYFNNYC.js} +1 -1
- package/dist/{chunk-YE4NP3XB.js → chunk-3V32MDJI.js} +1 -1
- package/dist/chunk-4AGC7B64.js +1 -0
- package/dist/{chunk-ZYQXT5JP.js → chunk-5IADCFUU.js} +1 -1
- package/dist/{chunk-2JFCDE27.js → chunk-6CBJBESS.js} +1 -1
- package/dist/{chunk-WUNZCUE6.js → chunk-DLHW3UDD.js} +1 -1
- package/dist/{chunk-UUIZHJYL.js → chunk-GVVZR3YS.js} +1 -1
- package/dist/{chunk-MRLWH6RC.js → chunk-GWGWNBGU.js} +1 -1
- package/dist/chunk-JQBJZMLG.js +1 -0
- package/dist/{chunk-OJSGMXJS.js → chunk-NVAF2E7Q.js} +1 -1
- package/dist/{chunk-FBXZWNND.js → chunk-YRDOE3N7.js} +1 -1
- package/dist/{chunk-BNLANXXZ.js → chunk-ZY6WTPTI.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.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.d.cts +5 -5
- package/dist/core/layout/index.d.ts +5 -5
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.cjs +1 -1
- package/dist/core/quality/index.d.cts +3 -3
- package/dist/core/quality/index.d.ts +3 -3
- package/dist/core/render-assets/index.cjs +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/render-assets/index.js +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/cs-FUDGOUFL.js +1 -0
- package/dist/cy-5RRARIAP.js +1 -0
- package/dist/da-PONPPWKY.js +1 -0
- package/dist/de-PKG7AAB5.js +1 -0
- package/dist/el-H7OFU4QQ.js +1 -0
- package/dist/es-QSW5IZ6U.js +1 -0
- package/dist/et-GTMPSS72.js +1 -0
- package/dist/{eventConfigurations-DsW5Mj2e.d.ts → eventConfigurations-Cdt-e0uD.d.ts} +1 -1
- package/dist/{eventConfigurations-dmn9FClw.d.cts → eventConfigurations-D0us5j0K.d.cts} +1 -1
- package/dist/fa-SGLTFGJF.js +1 -0
- package/dist/fi-7YTEAVDM.js +1 -0
- package/dist/fr-ECCQ24MZ.js +1 -0
- package/dist/he-YHMMDOX7.js +1 -0
- package/dist/hi-GRAQX2E6.js +1 -0
- package/dist/hr-MN33LRIJ.js +1 -0
- package/dist/hu-NW3SMQVM.js +1 -0
- package/dist/id-3OPRAUF7.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/it-RYM74YWO.js +1 -0
- package/dist/ja-4NI6DG5D.js +1 -0
- package/dist/{ko-6YCWWHFQ.js → ko-C4F6UEMK.js} +1 -1
- package/dist/ku-DMSBMWTC.js +1 -0
- package/dist/{labeling-Bn41ByDd.d.ts → labeling-DXgkxMoi.d.ts} +1 -1
- package/dist/{labeling-BmEjVxFt.d.cts → labeling-eYKVPLMb.d.cts} +1 -1
- package/dist/localeLoaders-G3GCGLPW.js +1 -0
- package/dist/lt-3EXKKZFG.js +1 -0
- package/dist/lv-4EWNRDCG.js +1 -0
- package/dist/ms-7LJBSAEJ.js +1 -0
- package/dist/nl-GWTIWXRW.js +1 -0
- package/dist/no-T3FW2WLX.js +1 -0
- package/dist/pl-OG5OBRHR.js +1 -0
- package/dist/pt-YQ6VES5R.js +1 -0
- package/dist/{renderedQuality-MDkNe8GA.d.ts → renderedQuality-Dzo2_8f4.d.ts} +1 -1
- package/dist/{renderedQuality-Bt2d0uq1.d.cts → renderedQuality-Frgw6jdx.d.cts} +1 -1
- package/dist/{renderer-DH0yI32q.d.cts → renderer-DM2sv1un.d.cts} +1 -1
- package/dist/{renderer-BJrpMV6U.d.ts → renderer-DuieD7jP.d.ts} +1 -1
- package/dist/ro-VK5MASYF.js +1 -0
- package/dist/ru-YU5CYR6T.js +1 -0
- package/dist/{seatTypeIcons-CG_Uzpaw.d.ts → seatTypeIcons-Bz0OJtEi.d.ts} +1 -1
- package/dist/{seatTypeIcons-Ck7oEFei.d.cts → seatTypeIcons-Cm8tjLYl.d.cts} +1 -1
- package/dist/{sections-C-UAqr1x.d.ts → sections-Bf_DV0oG.d.ts} +1 -1
- package/dist/{sections-C8HApYxd.d.cts → sections-PbQiqN0i.d.cts} +1 -1
- package/dist/{segmentedRowModel-DR1w9M13.d.ts → segmentedRowModel-CO7DD803.d.ts} +1 -1
- package/dist/{segmentedRowModel-CeoMsBnt.d.cts → segmentedRowModel-Co9LqS4i.d.cts} +1 -1
- package/dist/sk-CE7PXAYL.js +1 -0
- package/dist/sl-EYUPV4BG.js +1 -0
- package/dist/sr-PPXCN4IK.js +1 -0
- package/dist/sv-WR2BJBCJ.js +1 -0
- package/dist/{tableSizing-RRmpxOXl.d.ts → tableSizing-BDePQyPD.d.ts} +3 -3
- package/dist/{tableSizing-Bz-hxLza.d.cts → tableSizing-C6EjKNnk.d.cts} +3 -3
- package/dist/th-JUB2DODR.js +1 -0
- package/dist/{ticketRestrictions-lq4dH4k6.d.cts → ticketRestrictions-CgYwHQOf.d.cts} +2 -2
- package/dist/{ticketRestrictions-C7KUrulv.d.ts → ticketRestrictions-D5wgOq4P.d.ts} +2 -2
- package/dist/tr-GFHA7FT6.js +1 -0
- package/dist/{types-DM-OneoD.d.ts → types-CGOr0BpE.d.cts} +40 -16
- package/dist/{types-DM-OneoD.d.cts → types-CGOr0BpE.d.ts} +40 -16
- package/dist/uk-3FTS2SRK.js +1 -0
- package/dist/vi-7OTXPOQV.js +1 -0
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +410 -169
- package/dist/view3d/index.d.cts +100 -4
- package/dist/view3d/index.d.ts +100 -4
- package/dist/view3d/index.js +408 -167
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/dist/zh-Hans-FD4XNYUA.js +1 -0
- package/dist/zh-Hant-7TXVJKJQ.js +1 -0
- package/package.json +1 -1
- package/dist/ar-O3RHQRH3.js +0 -1
- package/dist/be-SXFCG3F5.js +0 -1
- package/dist/bg-W7YBNYB2.js +0 -1
- package/dist/ca-FA7WHACR.js +0 -1
- package/dist/chunk-4N5CHKHD.js +0 -1
- package/dist/chunk-4QQG5EEP.js +0 -1
- package/dist/cs-RR3VIKRC.js +0 -1
- package/dist/cy-U4JJ5C47.js +0 -1
- package/dist/da-ATULGB2M.js +0 -1
- package/dist/de-VB543CPC.js +0 -1
- package/dist/el-7Y2KXU6N.js +0 -1
- package/dist/es-GUV5XIYC.js +0 -1
- package/dist/et-SZ6I4Z44.js +0 -1
- package/dist/fa-FM6ELEN7.js +0 -1
- package/dist/fi-6QQ2M5JI.js +0 -1
- package/dist/fr-2SEQSVLR.js +0 -1
- package/dist/he-V3EVB7IW.js +0 -1
- package/dist/hi-I4QIBK5Q.js +0 -1
- package/dist/hr-I5DNEVUU.js +0 -1
- package/dist/hu-KTFWBQMF.js +0 -1
- package/dist/id-RZWUH426.js +0 -1
- package/dist/it-CNQP36V4.js +0 -1
- package/dist/ja-JQZOYIHI.js +0 -1
- package/dist/ku-33PM4OWG.js +0 -1
- package/dist/localeLoaders-VFQOZMUH.js +0 -1
- package/dist/lt-24JO2B7V.js +0 -1
- package/dist/lv-HTSDEEAB.js +0 -1
- package/dist/ms-PUEZJJ3R.js +0 -1
- package/dist/nl-NQPDRSCW.js +0 -1
- package/dist/no-3N3MUMSA.js +0 -1
- package/dist/pl-YHBEO6ZF.js +0 -1
- package/dist/pt-5RPESNZB.js +0 -1
- package/dist/ro-XDFXIMHX.js +0 -1
- package/dist/ru-BIIALOM5.js +0 -1
- package/dist/sk-LHSFRUFT.js +0 -1
- package/dist/sl-MPE5TPI3.js +0 -1
- package/dist/sr-T3N67KTP.js +0 -1
- package/dist/sv-LJWWYUIY.js +0 -1
- package/dist/th-E5POGG37.js +0 -1
- package/dist/tr-2DCWQ2CY.js +0 -1
- package/dist/uk-C3VJP6EA.js +0 -1
- package/dist/vi-XVMTKCOL.js +0 -1
- package/dist/zh-Hans-RG4CQGBY.js +0 -1
- package/dist/zh-Hant-YHNTYPFS.js +0 -1
package/dist/view3d/index.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import{A as tt,B as Kt,C as uo,D as nt,E as Qt,F as mo,G as ho,a as Je,b as Ie,c as yt,d as jt,e as $n,f as Kn,g as Se,h as Qn,i as Zn,j as Jn,k as xt,l as ze,m as et,n as eo,o as $t,p as ua,q as to,r as no,s as oo,t as ro,u as Ae,v as ao,w as io,x as so,y as lo,z as co}from"../chunk-4QQG5EEP.js";import"../chunk-WUNZCUE6.js";import"../chunk-2JFCDE27.js";import{d as gt}from"../chunk-YPVYZYMH.js";import"../chunk-PBXGWYB4.js";import"../chunk-6VOUTNRV.js";import"../chunk-OJSGMXJS.js";import"../chunk-FBXZWNND.js";import"../chunk-BNLANXXZ.js";import"../chunk-4N5CHKHD.js";import{b as Xn,c as qt,d as qn,n as jn}from"../chunk-GUNNA5LB.js";import"../chunk-M4NGX5NM.js";import"../chunk-EE2CVYFJ.js";import"../chunk-URW7MSCJ.js";import"../chunk-UUIZHJYL.js";import{eb as Wn}from"../chunk-YE4NP3XB.js";import"../chunk-S3VH7IDA.js";import{d as Un,l as Yn}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";function po(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,f=0,p=0;for(let u=0;u<r;u+=l)c+=e[u*3],f+=e[u*3+2],p++;a=c/p,o=f/p}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 Ns}from"ogl";function fo(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 A=0;A<a;A++){let R=r[A*3],L=r[A*3+2];R<o&&(o=R),R>i&&(i=R),L<s&&(s=L),L>l&&(l=L)}for(let A of e.stages)o=Math.min(o,A.cx-A.halfX),i=Math.max(i,A.cx+A.halfX),s=Math.min(s,A.cz-A.halfZ),l=Math.max(l,A.cz+A.halfZ);let c=Math.min(130/Math.max(.001,i-o),86/Math.max(.001,l-s)),f=(148-(i-o)*c)/2,p=(104-(l-s)*c)/2,u=A=>f+(A-o)*c,m=A=>p+(A-s)*c,d=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),y=document.createElement("canvas");y.width=Math.round(148*d),y.height=Math.round(104*d),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 w=document.createElement("canvas");w.width=y.width,w.height=y.height;let E=w.getContext("2d");if(E){E.scale(d,d),E.fillStyle="rgba(214,222,234,.28)";let A=Math.max(1,Math.ceil(a/6e3));for(let R=0;R<a;R+=A)E.fillRect(u(r[R*3])-.6,m(r[R*3+2])-.6,1.2,1.2);E.fillStyle="rgba(236,240,246,.16)",E.strokeStyle="rgba(236,240,246,.55)",E.lineWidth=1;for(let R of e.stages){let L=u(R.cx-R.halfX),b=m(R.cz-R.halfZ),F=R.halfX*2*c,x=R.halfZ*2*c;E.fillRect(L,b,F,x),E.strokeRect(L+.5,b+.5,Math.max(0,F-1),Math.max(0,x-1))}}let C=y.getContext("2d"),D="";return{el:y,update(A,R){if(!A||!C||t.clientWidth>0&&t.clientWidth<560){v.display!=="none"&&(v.display="none"),D="";return}let L=u(A[0]),b=m(A[2]),F=R?Math.atan2(R[2],R[0]):0,x=`${L.toFixed(1)},${b.toFixed(1)},${F.toFixed(2)}`;if(x!==D){if(D=x,v.display="block",C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,y.width,y.height),C.drawImage(w,0,0),C.setTransform(d,0,0,d,0,0),R){let I=C.createRadialGradient(L,b,0,L,b,26);I.addColorStop(0,"rgba(255,255,255,.55)"),I.addColorStop(1,"rgba(255,255,255,0)"),C.fillStyle=I,C.beginPath(),C.moveTo(L,b),C.arc(L,b,26,F-.5,F+.5),C.closePath(),C.fill()}C.fillStyle=n,C.strokeStyle="rgba(10,14,22,.9)",C.lineWidth=1.5,C.beginPath(),C.arc(L,b,3.6,0,Math.PI*2),C.fill(),C.stroke()}},dispose(){y.remove()}}}var Zt=78,vo=18;function bo(){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,Ie,-1],max:[1,yt,-.72]}])for(let l of o){let c=t.length/3,f=l.n[1]+(s.part===2?Math.abs(l.n[0])*(1-jt)/(yt-Ie):0),p=Math.hypot(l.n[0],f,l.n[2]),u=[l.n[0]/p,f/p,l.n[2]/p];for(let[m,d]of l.c.entries()){let y=d.map((v,w)=>s.min[w]+v*(s.max[w]-s.min[w]));s.part===2&&(y[0]*=1-d[1]*(1-jt)),t.push(...y),e.push(...u),n.push(s.part),r.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][m])}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 da}from"ogl";function ma(){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 St=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 da({canvas:this.canvas,dpr:ma(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[xt.top[0],xt.top[1],xt.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 ha,Vec3 as Jt}from"ogl";var de=Math.PI/180,en=15*de,tn=80*de,Ne=.12,go=35,nn=1.25,yo=.006,pa=4,He=.82,ot=1/He,fa=.12,va=2;function ba(t,e){return{azimuth:0-t*yo,polar:-e*yo}}function xo(t,e,n){let r=Math.max(va,Math.max(1,e)*fa),a=n*pa;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,a):a}}var ga=1.5;function ya(t,e,n){let r=Math.max(1,n)*ga;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 xa(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)],f=[t[0]+r*c[0],t[1]+r*c[1],t[2]+r*c[2]],p=[-c[0],-c[1],-c[2]],u=[-p[2],0,p[0]],m=Math.hypot(u[0],u[2])||1;u=[u[0]/m,0,u[2]/m];let d=[u[1]*p[2]-u[2]*p[1],u[2]*p[0]-u[0]*p[2],u[0]*p[1]-u[1]*p[0]],y=Math.tan(a*de/2),v=y*(o>0?o:1),w=[0,1,2].map(D=>p[D]+i*v*u[D]+s*y*d[D]);if(w[1]>=-1e-6)return null;let E=(t[1]-f[1])/w[1],C=Math.hypot(w[0],w[1],w[2]);return!(E>0)||E*C>r*Sa?null:[f[0]+w[0]*E,t[1],f[2]+w[2]*E]}var So=3,Sa=4,wo=.72,wa=.6;function Ma(t,e,n){return t!=="auto"?t:n!==null&&e<n*wa?"pan":"orbit"}function Mo(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 Aa=.4;function Pa(t,e,n,r,a,o){let i=[t.center[0],t.center[1],t.center[2]],s=o(i),l=t.fitPoints,c=Mo(r,a);if(!l||l.length<9||!c)return{center:i,distance:s};let{fx:f,fy:p,fz:u,rx:m,rz:d,ux:y,uy:v,uz:w}=c,E=Math.hypot(f,u),C=f/E,D=u/E,A=C*y+D*w,R=Aa*Math.max(1,t.radius);for(let L=0;L<3;L++){let b=1/0,F=-1/0,x=1/0,I=-1/0;for(let W=0;W+2<l.length;W+=3){let N=l[W]-i[0],te=l[W+1]-i[1],X=l[W+2]-i[2],J=s+N*f+te*p+X*u;if(!(J>.001))continue;let M=(N*m+X*d)/(J*e),P=(N*y+te*v+X*w)/(J*n);M<b&&(b=M),M>F&&(F=M),P<x&&(x=P),P>I&&(I=P)}if(!Number.isFinite(b))break;let z=(b+F)/2*s*e,_=Math.abs(A)>.1?(x+I)/2*s*n/A:0,O=z*m+_*C,G=z*d+_*D;if(Math.hypot(i[0]+O-t.center[0],i[2]+G-t.center[2])>R){let W=i[0]-t.center[0],N=i[2]-t.center[2],te=W+O,X=N+G,J=R/Math.hypot(te,X);O=te*J-W,G=X*J-N}i=[i[0]+O,i[1],i[2]+G],s=o(i)}return{center:i,distance:s}}var wt=class{constructor(e,n,r,a){this.fovY=go;this.target=new Jt;this.azimuth=-30*de;this.polar=55*de;this.distance=10;this.azT=-30*de;this.polT=55*de;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 Jt;this.panAnchor=new Jt;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new ha(e,{fov:go,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=a,this.onPointerDown=o=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(o.pointerId)}catch{}if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size===1){let i=this.dragAction(),s=i==="orbit"?"pan":"orbit",l=o.button===2||o.button===1||o.shiftKey?s:i;this.panning=l==="pan",this.dragging=!this.panning,this.lastX=o.clientX,this.lastY=o.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let i=this.pinchCentroid();this.pinchCx=i.x,this.pinchCy=i.y}}},this.onPointerMove=o=>{if(!this.interactionEnabled||!this.activePointers.has(o.pointerId))return;if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size>=2){let c=this.currentPinchDistance(),f=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-c)*.005),f.x,f.y),this.fireGesture()),this.pinchDist=c;let p=this.currentPinchAngle(),u=p-this.pinchAngle;u>Math.PI&&(u-=2*Math.PI),u<-Math.PI&&(u+=2*Math.PI),this.pinchAngle=p,Math.abs(u)>1e-4&&Math.abs(u)<.5&&(this.azT+=u,this.fireGesture()),this.panBy(f.x-this.pinchCx,f.y-this.pinchCy),this.pinchCx=f.x,this.pinchCy=f.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=ba(i,s);this.azT+=l.azimuth,this.polT=Math.max(en,Math.min(tn,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*de;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(en,Math.min(tn,this.polT+(o.key==="ArrowUp"?-i:i)));else if(o.key==="+"||o.key==="=")this.dollyBy(He);else if(o.key==="-"||o.key==="_")this.dollyBy(ot);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*de/2)/r,o=Math.sin(this.azimuth),i=Math.cos(this.azimuth),s=i,l=-o,c=Math.cos(this.polar),f=Math.sin(this.polar),p=-o*c,u=-i*c;this.targetT.x+=(-e*s+n*p)*a,this.targetT.z+=(-e*l+n*u)*a,this.targetT.y+=n*f*a,this.clampPan(),this.requestRender()}widenPanBox(e){this.panBox=ya(this.panBox,e.center,e.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,n=this.panAnchor.x,r=this.panAnchor.y,a=this.panAnchor.z;this.targetT.x=Math.max(n-e,Math.min(n+e,this.targetT.x)),this.targetT.z=Math.max(a-e,Math.min(a+e,this.targetT.z)),this.targetT.y=Math.max(r-e*.5,Math.min(r+e,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[e,n]=[...this.activePointers.values()];return e&&n?Math.atan2(n.y-e.y,n.x-e.x):0}dragAction(){return Ma(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let e=[...this.activePointers.values()];return e.length<2?0:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)}dollyBy(e){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*e)),this.requestRender()}dollyAt(e,n,r){let a=this.distT,o=this.canvas.getBoundingClientRect?.(),i=this.zoomPointResolver?.(n,r)??null;if(i){this.distT=Math.max(So,Math.min(this.maxDist,this.distT*e)),this.minDist=Math.min(this.minDist,Math.max(So,this.distT)),this.requestRender(),this.scaleTargetAbout(i,this.distT/a);return}let s=o&&o.width>0&&o.height>0?xa([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||o.width/o.height,(n-o.left)/o.width*2-1,1-(r-o.top)/o.height*2):null;this.dollyBy(e),s&&this.scaleTargetAbout(s,this.distT/a)}scaleTargetAbout(e,n){!Number.isFinite(n)||n===1||(this.targetT.x=e[0]+(this.targetT.x-e[0])*n,this.targetT.y=e[1]+(this.targetT.y-e[1])*n,this.targetT.z=e[2]+(this.targetT.z-e[2])*n,this.clampPan())}setZoomPointResolver(e){this.zoomPointResolver=e}zoomBy(e){this.interactionEnabled&&(this.dollyBy(e),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(e){this.primaryDragMode=e}setInteractionEnabled(e){this.interactionEnabled=e,!e&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(e,n=!1,r,a=!1,o){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e);let i=Math.max(1,e.radius),s=this.fovY*de/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*de,this.polT=Math.max(15,Math.min(80,o?.polarDeg??55))*de;let f=this.framedOn(e,s,c),p=f.distance;this.target.set(f.center[0],f.center[1],f.center[2]),this.targetT.copy(this.target),this.distT=p*Math.max(1.05,Math.min(2,o?.margin??nn)),this.envelope=xo(this.envelope,i,p),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*de,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){if(!(e>0)||!Number.isFinite(e))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let r=Math.min(n,1)/Math.min(e,1);this.distance*=r,this.distT*=r,this.overviewDist!==null&&(this.overviewDist*=r),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:e})}glideTo(e,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(e),this.targetT.set(e.center[0],e.center[1],e.center[2]);let r=this.fovY*de/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))*de;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??nn)),this.envelope=xo(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*de/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))*de;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??nn))}framedOn(e,n,r){return Pa(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=Mo(a,o);if(!c)return s;let{fx:f,fy:p,fz:u,rx:m,rz:d,ux:y,uy:v,uz:w}=c,E=Math.tan(r),C=Math.tan(n),D=1;for(let x=0;x<8;x++){let I=(x&1?l.max[0]:l.min[0])-e.center[0],z=(x&2?l.max[1]:l.min[1])-e.center[1],_=(x&4?l.max[2]:l.min[2])-e.center[2],O=I*f+z*p+_*u,G=Math.abs(I*m+_*d),B=Math.abs(I*y+z*v+_*w);D=Math.max(D,G/E-O,B/C-O)}let A=Math.min(s,Math.max(D,i*.35)),R=e.fitPoints;if(!R||R.length<9)return A;let L=0,b=1/(E*wo),F=1/(C*wo);for(let x=0;x+2<R.length;x+=3){let I=R[x]-e.center[0],z=R[x+1]-e.center[1],_=R[x+2]-e.center[2],O=I*f+z*p+_*u,G=Math.abs(I*m+_*d),B=Math.abs(I*y+z*v+_*w);L=Math.max(L,G*b-O,B*F-O)}return Math.min(A*1.5,Math.max(A*.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}=Ta(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*Ne,this.polar+=n*Ne,this.distance+=r*Ne,this.target.x+=a*Ne,this.target.y+=o*Ne,this.target.z+=i*Ne,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(en,Math.min(tn,Math.acos(Math.max(-1,Math.min(1,n/a)))));this.distance=this.distT=a,this.polar=this.polT=o,this.azimuth=this.azT=Math.atan2(e,r)}snapshot(){let e=this.target.clone(),n=this.targetT.clone(),{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}=this,c=this.camera.position.clone(),f=[...this.camera.quaternion],p=this.camera.fov;return()=>{this.target.copy(e),this.targetT.copy(n),Object.assign(this,{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}),this.camera.position.copy(c),this.camera.quaternion.set(f[0],f[1],f[2],f[3]),this.camera.perspective({fov:p,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(e){this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target)}resumeAfterFlight(e){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),e&&this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let e=Math.sin(this.polar),n=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),a=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(n,r,a),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}},Ca=.1,Ea=.25;function Ta(t,e,n){let r=Math.max(1,e)*1.18,a=n==null?Ea:Math.max(.05,n*Ca),o=Math.max(a,t-r),i=Math.max(o+10,t+r);return{near:o,far:i}}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 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 Ao(t){let e=!1;return n=>{n!==e&&(e=n,n?t.dataset.slReady="1":delete t.dataset.slReady)}}var Ge=2.5,Ra=1.15,rt=12,Be=22,Po=6,Co=9.5,Eo=.9,To=2.2,on=30,rn=4,At=8192;var rl=Be+rn;function Ro(t,e){let n=e*1.4,r=e*3.2;if(t<=n)return{scale:1,fade:0,minPixels:Ge};let a=Math.min(1,(t-n)/Math.max(.001,r-n));return{scale:1-a*.4,fade:a*.55,minPixels:Ge+a*(Ra-Ge)}}function _o(t,e,n){return!(t>0)||!(e>0)||!(n>0)?!1:e*n/t>=64}var _a=12;function Io(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>=_a}import{Geometry as Ia,Mesh as Da,Program as Fa,Transform as ka}from"ogl";var La=.05,Va=.55,Oa=12,za=1.6,Na=1,Ha=2.5,Ga=650,De={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40,nearStrength:.6};function Ba(t,e){if(e)return 0;let n=(t-De.fadeInFromM)/(De.fullByM-De.fadeInFromM);return Math.max(De.nearStrength,Math.min(1,n))}var Do=24;function Wa(t){let e=[],n=[],r=[],a=(p,u,m)=>{e.push(...p),n.push(...u),r.push(m)};for(let p=0;p<16;p++){let u=p/16*Math.PI*2,m=(p+1)/16*Math.PI*2,d=C=>[Math.cos(C),0,Math.sin(C)],y=[Math.cos(u)*.012,0,Math.sin(u)*.012],v=[Math.cos(m)*.012,0,Math.sin(m)*.012],w=[Math.cos(u)*.03,1,Math.sin(u)*.03],E=[Math.cos(m)*.03,1,Math.sin(m)*.03];a(y,d(u),0),a(w,d(u),0),a(E,d(m),0),a(y,d(u),0),a(E,d(m),0),a(v,d(m),0)}let l=.16,c=.24,f=.01;for(let p=0;p<48;p++){let u=p/48*Math.PI*2,m=(p+1)/48*Math.PI*2,d=[Math.cos(u)*l,f,Math.sin(u)*l],y=[Math.cos(u)*c,f,Math.sin(u)*c],v=[Math.cos(m)*c,f,Math.sin(m)*c],w=[Math.cos(m)*l,f,Math.sin(m)*l];for(let E of[d,y,v,d,v,w])a(E,[0,1,0],1)}for(let p=0;p<32;p++){let u=p/32*Math.PI*2,m=(p+1)/32*Math.PI*2,d=De.baseRadius,y=De.topRadius,v=[Math.cos(u)*d,0,Math.sin(u)*d],w=[Math.cos(m)*d,0,Math.sin(m)*d],E=[Math.cos(u)*y,1,Math.sin(u)*y],C=[Math.cos(m)*y,1,Math.sin(m)*y],D=[Math.cos(u),0,Math.sin(u)],A=[Math.cos(m),0,Math.sin(m)];a(v,D,2),a(E,D,2),a(C,A,2),a(v,D,2),a(C,A,2),a(w,A,2)}return new Ia(t,{position:{size:3,data:new Float32Array(e)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(r)}})}var Ua=`#version 300 es
|
|
1
|
+
import{A as Mo,B as Da,C as Ao,D as Po,E as Eo,F as Co,G as Te,H as To,I as Ro,J as _o,K as Fo,L as Io,M as ct,N as un,O as Do,P as ut,Q as dn,R as ko,S as Lo,a as it,b as ke,c as Ne,d as an,e as co,f as Et,g as uo,h as ho,i as mo,j as po,k as fo,l as sn,m as vo,n as bo,o as ln,p as st,q as go,r as Se,s as yo,t as xo,u as wo,v as Ct,w as qe,x as lt,y as So,z as cn}from"../chunk-4AGC7B64.js";import"../chunk-DLHW3UDD.js";import"../chunk-6CBJBESS.js";import{d as Pt}from"../chunk-YPVYZYMH.js";import"../chunk-PBXGWYB4.js";import"../chunk-2VYFNNYC.js";import"../chunk-NVAF2E7Q.js";import"../chunk-YRDOE3N7.js";import"../chunk-ZY6WTPTI.js";import"../chunk-JQBJZMLG.js";import{b as io,c as rn,d as so,n as lo}from"../chunk-GUNNA5LB.js";import"../chunk-M4NGX5NM.js";import"../chunk-EE2CVYFJ.js";import"../chunk-URW7MSCJ.js";import"../chunk-GVVZR3YS.js";import{fb as oo}from"../chunk-3V32MDJI.js";import"../chunk-S3VH7IDA.js";import{d as ro,l as ao}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";function Vo(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,f=0,m=0;for(let u=0;u<r;u+=l)c+=e[u*3],f+=e[u*3+2],m++;a=c/m,o=f/m}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 bl}from"ogl";function zo(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 S=0;S<a;S++){let _=r[S*3],V=r[S*3+2];_<o&&(o=_),_>i&&(i=_),V<s&&(s=V),V>l&&(l=V)}for(let S of e.stages)o=Math.min(o,S.cx-S.halfX),i=Math.max(i,S.cx+S.halfX),s=Math.min(s,S.cz-S.halfZ),l=Math.max(l,S.cz+S.halfZ);let c=Math.min(130/Math.max(.001,i-o),86/Math.max(.001,l-s)),f=(148-(i-o)*c)/2,m=(104-(l-s)*c)/2,u=S=>f+(S-o)*c,d=S=>m+(S-s)*c,h=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),y=document.createElement("canvas");y.width=Math.round(148*h),y.height=Math.round(104*h),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 x=document.createElement("canvas");x.width=y.width,x.height=y.height;let T=x.getContext("2d");if(T){T.scale(h,h),T.fillStyle="rgba(214,222,234,.28)";let S=Math.max(1,Math.ceil(a/6e3));for(let _=0;_<a;_+=S)T.fillRect(u(r[_*3])-.6,d(r[_*3+2])-.6,1.2,1.2);T.fillStyle="rgba(236,240,246,.16)",T.strokeStyle="rgba(236,240,246,.55)",T.lineWidth=1;for(let _ of e.stages){let V=u(_.cx-_.halfX),g=d(_.cz-_.halfZ),D=_.halfX*2*c,w=_.halfZ*2*c;T.fillRect(V,g,D,w),T.strokeRect(V+.5,g+.5,Math.max(0,D-1),Math.max(0,w-1))}}let A=y.getContext("2d"),F="";return{el:y,update(S,_){if(!S||!A||t.clientWidth>0&&t.clientWidth<560){v.display!=="none"&&(v.display="none"),F="";return}let V=u(S[0]),g=d(S[2]),D=_?Math.atan2(_[2],_[0]):0,w=`${V.toFixed(1)},${g.toFixed(1)},${D.toFixed(2)}`;if(w!==F){if(F=w,v.display="block",A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,y.width,y.height),A.drawImage(x,0,0),A.setTransform(h,0,0,h,0,0),_){let I=A.createRadialGradient(V,g,0,V,g,26);I.addColorStop(0,"rgba(255,255,255,.55)"),I.addColorStop(1,"rgba(255,255,255,0)"),A.fillStyle=I,A.beginPath(),A.moveTo(V,g),A.arc(V,g,26,D-.5,D+.5),A.closePath(),A.fill()}A.fillStyle=n,A.strokeStyle="rgba(10,14,22,.9)",A.lineWidth=1.5,A.beginPath(),A.arc(V,g,3.6,0,Math.PI*2),A.fill(),A.stroke()}},dispose(){y.remove()}}}var hn=78,Oo=18;function No(){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,ke,-1],max:[1,Ne,-.72]}])for(let l of o){let c=t.length/3,f=l.n[1]+(s.part===2?Math.abs(l.n[0])*(1-an)/(Ne-ke):0),m=Math.hypot(l.n[0],f,l.n[2]),u=[l.n[0]/m,f/m,l.n[2]/m];for(let[d,h]of l.c.entries()){let y=h.map((v,x)=>s.min[x]+v*(s.max[x]-s.min[x]));s.part===2&&(y[0]*=1-h[1]*(1-an)),t.push(...y),e.push(...u),n.push(s.part),r.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][d])}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 ka}from"ogl";function La(){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 Ho=1e4;function Va(t){if(typeof navigator<"u"){let e=navigator.deviceMemory;if(typeof e=="number"&&e<=4)return 0}return t>=1.5?2:4}var Tt=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.");let r=La();this.smoothingSamples=Va(r),this.renderer=new ka({canvas:this.canvas,dpr:r,alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[Ct.top[0],Ct.top[1],Ct.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=a=>{a.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{Mesh as za,Program as Oa,RenderTarget as Na,Triangle as Ha}from"ogl";var Ga=`#version 300 es
|
|
2
|
+
in vec2 position;
|
|
3
|
+
in vec2 uv;
|
|
4
|
+
out vec2 vUv;
|
|
5
|
+
void main() {
|
|
6
|
+
vUv = uv;
|
|
7
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
8
|
+
}`,Ba=`#version 300 es
|
|
9
|
+
precision highp float;
|
|
10
|
+
uniform sampler2D tFrame;
|
|
11
|
+
in vec2 vUv;
|
|
12
|
+
out vec4 fragColor;
|
|
13
|
+
void main() {
|
|
14
|
+
fragColor = vec4(texture(tFrame, vUv).rgb, 1.0);
|
|
15
|
+
}`,Rt=class{constructor(e,n,r){this.gl=e;this.renderer=n;this.samples=r;this.fbo=null;this.colour=null;this.depth=null;this.resolved=null;this.copy=null;this.width=0;this.height=0;this.active=null;this.unavailable=!1}begin(e){if(this.active=null,!e||this.unavailable||this.samples<2)return null;let n=this.gl,r=n.drawingBufferWidth,a=n.drawingBufferHeight;return r<1||a<1?null:(!this.fbo||r!==this.width||a!==this.height)&&(this.release(),!this.allocate(r,a))?(this.unavailable=!0,this.release(),null):(this.active={target:n.FRAMEBUFFER,buffer:this.fbo,width:r,height:a,depth:!0,stencil:!1},this.active)}end(){if(!this.active||!this.resolved||!this.copy)return;let e=this.gl,{width:n,height:r}=this.active;this.active=null,e.bindFramebuffer(e.READ_FRAMEBUFFER,this.fbo),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.resolved.buffer),e.blitFramebuffer(0,0,n,r,0,0,n,r,e.COLOR_BUFFER_BIT,e.NEAREST),this.unbind(),this.renderer.render({scene:this.copy,clear:!1})}reset(){this.fbo=null,this.colour=null,this.depth=null,this.resolved=null,this.copy=null,this.active=null,this.width=0,this.height=0}dispose(){this.release()}allocate(e,n){let r=this.gl,a=Math.min(this.samples,r.getParameter(r.MAX_SAMPLES));if(a<2)return!1;this.fbo=r.createFramebuffer(),this.colour=r.createRenderbuffer(),this.depth=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,this.colour),r.renderbufferStorageMultisample(r.RENDERBUFFER,a,r.RGBA8,e,n),r.bindRenderbuffer(r.RENDERBUFFER,this.depth),r.renderbufferStorageMultisample(r.RENDERBUFFER,a,r.DEPTH_COMPONENT24,e,n),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindFramebuffer(r.FRAMEBUFFER,this.fbo),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,this.colour),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,this.depth);let o=r.checkFramebufferStatus(r.FRAMEBUFFER)===r.FRAMEBUFFER_COMPLETE;if(this.unbind(),!o)return!1;this.resolved=new Na(this.gl,{width:e,height:n,depth:!1,minFilter:r.NEAREST,magFilter:r.NEAREST});let i=new Oa(this.gl,{vertex:Ga,fragment:Ba,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{tFrame:{value:this.resolved.texture}}});return this.copy=new za(this.gl,{geometry:new Ha(this.gl),program:i}),this.copy.frustumCulled=!1,this.width=e,this.height=n,!0}unbind(){let e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null),this.renderer.state.framebuffer=null}release(){let e=this.gl;if(this.fbo&&e.deleteFramebuffer(this.fbo),this.colour&&e.deleteRenderbuffer(this.colour),this.depth&&e.deleteRenderbuffer(this.depth),this.resolved){for(let n of this.resolved.textures)e.deleteTexture(n.texture);e.deleteFramebuffer(this.resolved.buffer)}this.copy&&(this.copy.geometry.remove(),this.copy.program.remove()),this.reset()}};var _t=class{constructor(){this.limit=1/0;this.recent=[];this.slow=0;this.last=null}allows(e){return e<this.limit}frame(e,n,r){if(!e){this.last=null;return}let a=this.last===null?null:r-this.last;if(this.last=r,a===null||a>250)return;let o=a>25;this.recent.push(o),o&&(this.slow+=1),this.recent.length>30&&this.recent.shift()&&(this.slow-=1),this.slow>=8&&(this.limit=Math.min(this.limit,n*.8),this.recent=[],this.slow=0)}};import{Camera as Wa,Vec3 as mn}from"ogl";var he=Math.PI/180,pn=15*he,fn=80*he,je=.12,Go=35,vn=1.25,Bo=.006,Ua=4,Ke=.82,dt=1/Ke,Ya=.12,Xa=2;function $a(t,e){return{azimuth:0-t*Bo,polar:-e*Bo}}function Wo(t,e,n){let r=Math.max(Xa,Math.max(1,e)*Ya),a=n*Ua;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,a):a}}var qa=1.5;function ja(t,e,n){let r=Math.max(1,n)*qa;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 Ka(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)],f=[t[0]+r*c[0],t[1]+r*c[1],t[2]+r*c[2]],m=[-c[0],-c[1],-c[2]],u=[-m[2],0,m[0]],d=Math.hypot(u[0],u[2])||1;u=[u[0]/d,0,u[2]/d];let h=[u[1]*m[2]-u[2]*m[1],u[2]*m[0]-u[0]*m[2],u[0]*m[1]-u[1]*m[0]],y=Math.tan(a*he/2),v=y*(o>0?o:1),x=[0,1,2].map(F=>m[F]+i*v*u[F]+s*y*h[F]);if(x[1]>=-1e-6)return null;let T=(t[1]-f[1])/x[1],A=Math.hypot(x[0],x[1],x[2]);return!(T>0)||T*A>r*Za?null:[f[0]+x[0]*T,t[1],f[2]+x[2]*T]}var Uo=3,Za=4,Yo=.72,Qa=.6;function Ja(t,e,n){return t!=="auto"?t:n!==null&&e<n*Qa?"pan":"orbit"}function Xo(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 ei=.4;function ti(t,e,n,r,a,o){let i=[t.center[0],t.center[1],t.center[2]],s=o(i),l=t.fitPoints,c=Xo(r,a);if(!l||l.length<9||!c)return{center:i,distance:s};let{fx:f,fy:m,fz:u,rx:d,rz:h,ux:y,uy:v,uz:x}=c,T=Math.hypot(f,u),A=f/T,F=u/T,S=A*y+F*x,_=ei*Math.max(1,t.radius);for(let V=0;V<3;V++){let g=1/0,D=-1/0,w=1/0,I=-1/0;for(let B=0;B+2<l.length;B+=3){let H=l[B]-i[0],ee=l[B+1]-i[1],K=l[B+2]-i[2],te=s+H*f+ee*m+K*u;if(!(te>.001))continue;let R=(H*d+K*h)/(te*e),M=(H*y+ee*v+K*x)/(te*n);R<g&&(g=R),R>D&&(D=R),M<w&&(w=M),M>I&&(I=M)}if(!Number.isFinite(g))break;let N=(g+D)/2*s*e,P=Math.abs(S)>.1?(w+I)/2*s*n/S:0,O=N*d+P*A,G=N*h+P*F;if(Math.hypot(i[0]+O-t.center[0],i[2]+G-t.center[2])>_){let B=i[0]-t.center[0],H=i[2]-t.center[2],ee=B+O,K=H+G,te=_/Math.hypot(ee,K);O=ee*te-B,G=K*te-H}i=[i[0]+O,i[1],i[2]+G],s=o(i)}return{center:i,distance:s}}var Ft=class{constructor(e,n,r,a){this.fovY=Go;this.target=new mn;this.azimuth=-30*he;this.polar=55*he;this.distance=10;this.azT=-30*he;this.polT=55*he;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 mn;this.panAnchor=new mn;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new Wa(e,{fov:Go,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=a,this.onPointerDown=o=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(o.pointerId)}catch{}if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size===1){let i=this.dragAction(),s=i==="orbit"?"pan":"orbit",l=o.button===2||o.button===1||o.shiftKey?s:i;this.panning=l==="pan",this.dragging=!this.panning,this.lastX=o.clientX,this.lastY=o.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let i=this.pinchCentroid();this.pinchCx=i.x,this.pinchCy=i.y}}},this.onPointerMove=o=>{if(!this.interactionEnabled||!this.activePointers.has(o.pointerId))return;if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size>=2){let c=this.currentPinchDistance(),f=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-c)*.005),f.x,f.y),this.fireGesture()),this.pinchDist=c;let m=this.currentPinchAngle(),u=m-this.pinchAngle;u>Math.PI&&(u-=2*Math.PI),u<-Math.PI&&(u+=2*Math.PI),this.pinchAngle=m,Math.abs(u)>1e-4&&Math.abs(u)<.5&&(this.azT+=u,this.fireGesture()),this.panBy(f.x-this.pinchCx,f.y-this.pinchCy),this.pinchCx=f.x,this.pinchCy=f.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=$a(i,s);this.azT+=l.azimuth,this.polT=Math.max(pn,Math.min(fn,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*he;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(pn,Math.min(fn,this.polT+(o.key==="ArrowUp"?-i:i)));else if(o.key==="+"||o.key==="=")this.dollyBy(Ke);else if(o.key==="-"||o.key==="_")this.dollyBy(dt);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*he/2)/r,o=Math.sin(this.azimuth),i=Math.cos(this.azimuth),s=i,l=-o,c=Math.cos(this.polar),f=Math.sin(this.polar),m=-o*c,u=-i*c;this.targetT.x+=(-e*s+n*m)*a,this.targetT.z+=(-e*l+n*u)*a,this.targetT.y+=n*f*a,this.clampPan(),this.requestRender()}widenPanBox(e){this.panBox=ja(this.panBox,e.center,e.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,n=this.panAnchor.x,r=this.panAnchor.y,a=this.panAnchor.z;this.targetT.x=Math.max(n-e,Math.min(n+e,this.targetT.x)),this.targetT.z=Math.max(a-e,Math.min(a+e,this.targetT.z)),this.targetT.y=Math.max(r-e*.5,Math.min(r+e,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[e,n]=[...this.activePointers.values()];return e&&n?Math.atan2(n.y-e.y,n.x-e.x):0}dragAction(){return Ja(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let e=[...this.activePointers.values()];return e.length<2?0:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)}dollyBy(e){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*e)),this.requestRender()}dollyAt(e,n,r){let a=this.distT,o=this.canvas.getBoundingClientRect?.(),i=this.zoomPointResolver?.(n,r)??null;if(i){this.distT=Math.max(Uo,Math.min(this.maxDist,this.distT*e)),this.minDist=Math.min(this.minDist,Math.max(Uo,this.distT)),this.requestRender(),this.scaleTargetAbout(i,this.distT/a);return}let s=o&&o.width>0&&o.height>0?Ka([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||o.width/o.height,(n-o.left)/o.width*2-1,1-(r-o.top)/o.height*2):null;this.dollyBy(e),s&&this.scaleTargetAbout(s,this.distT/a)}scaleTargetAbout(e,n){!Number.isFinite(n)||n===1||(this.targetT.x=e[0]+(this.targetT.x-e[0])*n,this.targetT.y=e[1]+(this.targetT.y-e[1])*n,this.targetT.z=e[2]+(this.targetT.z-e[2])*n,this.clampPan())}setZoomPointResolver(e){this.zoomPointResolver=e}zoomBy(e){this.interactionEnabled&&(this.dollyBy(e),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(e){this.primaryDragMode=e}setInteractionEnabled(e){this.interactionEnabled=e,!e&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(e,n=!1,r,a=!1,o){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e);let i=Math.max(1,e.radius),s=this.fovY*he/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*he,this.polT=Math.max(15,Math.min(80,o?.polarDeg??55))*he;let f=this.framedOn(e,s,c),m=f.distance;this.target.set(f.center[0],f.center[1],f.center[2]),this.targetT.copy(this.target),this.distT=m*Math.max(1.05,Math.min(2,o?.margin??vn)),this.envelope=Wo(this.envelope,i,m),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*he,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){if(!(e>0)||!Number.isFinite(e))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let r=Math.min(n,1)/Math.min(e,1);this.distance*=r,this.distT*=r,this.overviewDist!==null&&(this.overviewDist*=r),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:e})}glideTo(e,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(e),this.targetT.set(e.center[0],e.center[1],e.center[2]);let r=this.fovY*he/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))*he;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??vn)),this.envelope=Wo(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*he/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))*he;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??vn))}framedOn(e,n,r){return ti(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=Xo(a,o);if(!c)return s;let{fx:f,fy:m,fz:u,rx:d,rz:h,ux:y,uy:v,uz:x}=c,T=Math.tan(r),A=Math.tan(n),F=1;for(let w=0;w<8;w++){let I=(w&1?l.max[0]:l.min[0])-e.center[0],N=(w&2?l.max[1]:l.min[1])-e.center[1],P=(w&4?l.max[2]:l.min[2])-e.center[2],O=I*f+N*m+P*u,G=Math.abs(I*d+P*h),U=Math.abs(I*y+N*v+P*x);F=Math.max(F,G/T-O,U/A-O)}let S=Math.min(s,Math.max(F,i*.35)),_=e.fitPoints;if(!_||_.length<9)return S;let V=0,g=1/(T*Yo),D=1/(A*Yo);for(let w=0;w+2<_.length;w+=3){let I=_[w]-e.center[0],N=_[w+1]-e.center[1],P=_[w+2]-e.center[2],O=I*f+N*m+P*u,G=Math.abs(I*d+P*h),U=Math.abs(I*y+N*v+P*x);V=Math.max(V,G*g-O,U*D-O)}return Math.min(S*1.5,Math.max(S*.55,V))}updateClipping(e){let n=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],a=this.camera.position.z-e.center[2],o=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),i=this.interactionEnabled&&Math.abs(o-this.distance)<=this.distance*.01,{near:s,far:l}=ri(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*je,this.polar+=n*je,this.distance+=r*je,this.target.x+=a*je,this.target.y+=o*je,this.target.z+=i*je,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(pn,Math.min(fn,Math.acos(Math.max(-1,Math.min(1,n/a)))));this.distance=this.distT=a,this.polar=this.polT=o,this.azimuth=this.azT=Math.atan2(e,r)}snapshot(){let e=this.target.clone(),n=this.targetT.clone(),{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}=this,c=this.camera.position.clone(),f=[...this.camera.quaternion],m=this.camera.fov;return()=>{this.target.copy(e),this.targetT.copy(n),Object.assign(this,{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}),this.camera.position.copy(c),this.camera.quaternion.set(f[0],f[1],f[2],f[3]),this.camera.perspective({fov:m,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(e){this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target)}resumeAfterFlight(e){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),e&&this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let e=Math.sin(this.polar),n=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),a=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(n,r,a),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}},ni=.1,oi=.25;function ri(t,e,n){let r=Math.max(1,e)*1.18,a=n==null?oi:Math.max(.05,n*ni),o=Math.max(a,t-r),i=Math.max(o+10,t+r);return{near:o,far:i}}var It=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 $o(t){let e=!1;return n=>{n!==e&&(e=n,n?t.dataset.slReady="1":delete t.dataset.slReady)}}var Ze=2.5,ai=1.15,ht=12,Qe=22,bn=30,gn=4,Dt=8192;var Nl=Qe+gn;function qo(t,e){let n=e*1.4,r=e*3.2;if(t<=n)return{scale:1,fade:0,minPixels:Ze};let a=Math.min(1,(t-n)/Math.max(.001,r-n));return{scale:1-a*.4,fade:a*.55,minPixels:Ze+a*(ai-Ze)}}function jo(t,e,n){return!(t>0)||!(e>0)||!(n>0)?!1:e*n/t>=64}var ii=12;function Ko(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>=ii}import{Geometry as si,Mesh as li,Program as ci,Transform as ui}from"ogl";var di=.05,hi=.55,mi=12,pi=1.6,fi=1,vi=2.5,bi=650,He={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40,nearStrength:.6};function gi(t,e){if(e)return 0;let n=(t-He.fadeInFromM)/(He.fullByM-He.fadeInFromM);return Math.max(He.nearStrength,Math.min(1,n))}var Zo=24;function yi(t){let e=[],n=[],r=[],a=(m,u,d)=>{e.push(...m),n.push(...u),r.push(d)};for(let m=0;m<16;m++){let u=m/16*Math.PI*2,d=(m+1)/16*Math.PI*2,h=A=>[Math.cos(A),0,Math.sin(A)],y=[Math.cos(u)*.012,0,Math.sin(u)*.012],v=[Math.cos(d)*.012,0,Math.sin(d)*.012],x=[Math.cos(u)*.03,1,Math.sin(u)*.03],T=[Math.cos(d)*.03,1,Math.sin(d)*.03];a(y,h(u),0),a(x,h(u),0),a(T,h(d),0),a(y,h(u),0),a(T,h(d),0),a(v,h(d),0)}let l=.16,c=.24,f=.01;for(let m=0;m<48;m++){let u=m/48*Math.PI*2,d=(m+1)/48*Math.PI*2,h=[Math.cos(u)*l,f,Math.sin(u)*l],y=[Math.cos(u)*c,f,Math.sin(u)*c],v=[Math.cos(d)*c,f,Math.sin(d)*c],x=[Math.cos(d)*l,f,Math.sin(d)*l];for(let T of[h,y,v,h,v,x])a(T,[0,1,0],1)}for(let m=0;m<32;m++){let u=m/32*Math.PI*2,d=(m+1)/32*Math.PI*2,h=He.baseRadius,y=He.topRadius,v=[Math.cos(u)*h,0,Math.sin(u)*h],x=[Math.cos(d)*h,0,Math.sin(d)*h],T=[Math.cos(u)*y,1,Math.sin(u)*y],A=[Math.cos(d)*y,1,Math.sin(d)*y],F=[Math.cos(u),0,Math.sin(u)],S=[Math.cos(d),0,Math.sin(d)];a(v,F,2),a(T,F,2),a(A,S,2),a(v,F,2),a(A,S,2),a(x,S,2)}return new si(t,{position:{size:3,data:new Float32Array(e)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(r)}})}var xi=`#version 300 es
|
|
2
16
|
precision highp float;
|
|
3
17
|
in vec3 position; in vec3 normal; in float part;
|
|
4
18
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat3 normalMatrix;
|
|
@@ -25,7 +39,7 @@ void main() {
|
|
|
25
39
|
float scale = part > 0.5 ? uRingScale : uHeight;
|
|
26
40
|
vec3 world = uSeat + vec3(position.x, position.y * grow, position.z) * scale;
|
|
27
41
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(world, 1.0);
|
|
28
|
-
}`,
|
|
42
|
+
}`,wi=`#version 300 es
|
|
29
43
|
precision highp float;
|
|
30
44
|
in vec3 vNormal; in float vPart; in float vAlong;
|
|
31
45
|
uniform vec3 uColor; uniform float uRingAlpha; uniform vec3 uBeamColor; uniform float uBeam;
|
|
@@ -43,15 +57,25 @@ void main() {
|
|
|
43
57
|
float key = max(dot(normalize(vNormal), normalize(vec3(-0.4, 0.7, 0.6))), 0.0);
|
|
44
58
|
vec3 c = uColor * (0.55 + 0.5 * key) + vec3(0.12) * pow(key, 12.0);
|
|
45
59
|
fragColor = vec4(c, 1.0);
|
|
46
|
-
}`;function Xa(t){if(t>=1)return 1;if(t<.72){let n=t/.72;return 1-(1-n)*(1-n)}let e=(t-.72)/.28;return 1-.08*Math.sin(e*Math.PI)}function an(t){return Math.max(Va,Math.min(Oa,t*La))}function qa(t){let e=.2126*t[0]+.7152*t[1]+.0722*t[2],n=e>=.25?0:Math.min(.45,(.25-e)*2.2);return t.map(r=>r+(1-r)*n)}function Fo(t,e,n=[.24,.74,1]){let r=qa(n),a=new ka,o=Wa(t),i=new Map,s=(l,c)=>{let f=new Fa(t,{vertex:Ua,fragment:Ya,uniforms:{uSeat:{value:l},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uBeamHeight:{value:De.height},uBeam:{value:0},uBeamColor:{value:r},uColor:{value:e},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),p=new Da(t,{geometry:o,program:f});return p.frustumCulled=!1,p.setParent(a),{mesh:p,program:f,seat:l,start:c}};return{root:a,setSeats(l,c,f){let p=new Set(l.slice(0,Do).map(u=>u.id));for(let[u,m]of i)p.has(u)||(m.mesh.setParent(null),i.delete(u));for(let u of l.slice(0,Do))i.has(u.id)||i.set(u.id,s(u.position,f?c:-1/0))},update(l,c,f,p=!1){let u=!1;for(let m of i.values()){let d=c[0]-m.seat[0],y=c[1]-m.seat[1],v=c[2]-m.seat[2],w=Math.hypot(d,y,v);m.mesh.visible=!f&&w>(p?Na:Ha);let E=an(w),C=Math.max(0,Math.min(1,(l-m.start)/Ga));C<1&&(u=!0),m.program.uniforms.uHeight.value=E,m.program.uniforms.uRingScale.value=Math.min(E,za),m.program.uniforms.uLift.value=p?1:1-Xa(C),m.program.uniforms.uBeam.value=Ba(w,p),m.program.uniforms.uRingAlpha.value=.55+.4*(C<1?Math.sin(C*Math.PI):0)}return u},dispose(){for(let l of i.values())l.mesh.setParent(null);i.clear(),o.remove()}}}var at="#ffffff",ko="#0b1220",it=6,ja=80,Lo=14,Vo=88,Oo=20,zo={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},$a=640,Ka=.8,Qa=11,Za="3px 7px",Ja="2px 5px",No="rgba(10,14,22,.62)",ei="#f4f7fb",Ho=5,Go=2,ti=6,st=new Set(["row","seat","access"]),sn={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},We={row:{x:66,y:20},seat:{x:52,y:22}},Fe=Un,ln=t=>Yn(t);function ke(t,e){let n=ln(t),r=ln(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ni(t){let e=Fe(t);if(!e)return null;let n=o=>`#${o.map(i=>Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")).join("")}`,r=e.map(o=>o+(1-o)*.78),a=e.map(o=>o*.62);for(let o=0;o<12&&ke(a,r)<4.5;o++)a=a.map(i=>i*.8);return{fill:n(r),ink:n(a),border:n(e.map(o=>o+(1-o)*.35)),contrast:ke(a,r)}}var oi=30;function cn(t,e){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(t.replace(/\s/g,""));if(!n)return e;let r=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(a=>Number(n[a])/255*r+e[a-1]*(1-r))}function ri(t,e=[.04,.06,.1],n=!0){let r=ln(e)<.42,a=r?"#f4f7fb":"#0b1220",o=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",i=n?cn(o,e):e,s=Fe(t),l=n?7:4.5,c=s&&ke(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 ai(t,e=[.04,.06,.1]){let n=cn(No,e),r=Fe(t);return{ink:r&&ke(r,n)>=4.5?t:ei,backing:No}}var ii=.8,Ue=20,si=14,li=60,ci='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Pt=class{constructor(e,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let r=this.root.style;r.position="absolute",r.inset="0",r.pointerEvents="none",r.overflow="hidden",r.fontFamily=n.fontFamily||ci,e.appendChild(this.root)}setVisible(e){this.root.style.visibility=e?"":"hidden"}setLabels(e){this.labels=e;let n=new Set(e.map(r=>r.id));for(let[r,a]of this.nodes)n.has(r)||(a.remove(),this.nodes.delete(r))}setForcedDense(e){this.forcedDense=e}setOverviewDistance(e){this.overviewDistance=e>0?e:null}setSeatNumberRow(e){return e===this.seatNumberRow?!1:(this.seatNumberRow=e,!0)}setSeatNumberSeat(e){let n=e?`seat:${e}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(e){let n=e.size!==this.wheelchairFree.size;if(!n){for(let[r,a]of e)if(this.wheelchairFree.get(r)!==a){n=!0;break}}return n&&(this.wheelchairFree=new Map(e)),n}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,n=>`seat:${n}`))}sizeFor(e){let n=zo[e].size;return!this.narrowStage||st.has(e)?n:Math.max(Qa,n*Ka)}qualityEvidence(){let e=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let a=this.nodes.get(r.id),o=a?.getBoundingClientRect(),i=!!(n&&a&&a.style.display!=="none"&&o&&o.width>0&&o.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:i,renderedFontPx:a&&Number.parseFloat(a.style.fontSize)||0,contrast:a?Number(a.dataset.qualityContrast??0):0,...i&&o?{screenBox:{x:o.x-e.x,y:o.y-e.y,width:o.width,height:o.height}}:{}}})}update(e,n,r,a,o,i){if(!this.labels.length)return;this.narrowStage=n>0&&n<$a;let s=oo(a,o,{hasZoneLabels:this.labels.some(b=>b.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&a>this.overviewDistance*ii&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(b=>b.kind==="section")&&s.delete("zone");let l=[];for(let b of this.labels){let F=b.kind==="annotation"&&!!b.venueIcon;if(!s.has(b.kind)&&!F&&!(b.kind==="seat"&&this.selectedSeatLabelIds.has(b.id)))continue;let x=b.kind==="seat"&&i&&this.selectedSeatLabelIds.has(b.id)?b.pinBase:void 0,I=x&&i?[x[0],x[1]+an(Math.hypot(x[0]-i[0],x[1]-i[1],x[2]-i[2])),x[2]]:b.anchor,z=Ae(e,I,n,r);if(!z.visible)continue;let _=st.has(b.kind),O=this.sizeFor(b.kind),G=b.kind==="access"?Ue:so(b.text,O,!_)+(_?Ho*2:0)+((this.wheelchairFree.get(b.id)??0)>0?oi:0);if(b.kind==="access"&&b.seatWidthM!==void 0&&Kt(e,b.anchor,b.seatWidthM,n)<si||b.kind==="seat"&&b.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(b.id)&&Kt(e,b.anchor,b.seatWidthM,n)<Math.max(22,G))continue;let B=ro(z,G/2,O/2+(_?Go:4),n,r),W=i?Math.hypot(b.anchor[0]-i[0],b.anchor[1]-i[1],b.anchor[2]-i[2]):1;l.push({label:b,screen:B,focus:co(B,W,n,r),halfWidth:G/2,...this.selectedSeatLabelIds.has(b.id)?{priority:1}:{}})}let c=no(l.filter(b=>b.label.kind==="floor"),n),f=[...l.filter(b=>!st.has(b.label.kind)&&b.label.kind!=="floor"),...c],p=lo(n),u=l.filter(b=>b.label.kind==="seat"&&this.selectedSeatLabelIds.has(b.label.id)),m=tt(u,We.seat.x,We.seat.y,p.seat);this.placePinHeads(u.filter(b=>b.label.pinBase&&!m.includes(b)).map(b=>b.screen));let d=ao(f,Vo,Oo,b=>sn[b.label.kind]??0).filter(b=>!m.some(F=>io(b,F,Vo,Oo))),y=tt(l.filter(b=>b.label.kind==="access"),Ue,Ue,li,[...d,...m]),v=tt(l.filter(b=>b.label.kind==="row"),We.row.x,We.row.y,p.row,[...d,...m,...y]),w=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,E=tt(l.filter(b=>b.label.kind==="seat"&&!this.selectedSeatLabelIds.has(b.label.id)&&(this.seatNumberSeat!==null?b.label.id===this.seatNumberSeat:!w||this.seatNumberRow!==null&&b.label.rowId===this.seatNumberRow)),We.seat.x,We.seat.y,w?ja:p.seat-m.length,[...d,...m,...y,...v]),C=[...d,...y,...v,...m,...E],D=new Set(C.map(b=>b.label.id));for(let{label:b,screen:F}of C){let I=this.nodeFor(b).style;I.display=b.kind==="access"?"flex":b.kind==="gate"?"inline-flex":"";let z=!!b.pinBase&&this.selectedSeatLabelIds.has(b.id);I.transform=z?`translate(-50%, -100%) translate(${F.x.toFixed(1)}px, ${(F.y-it).toFixed(1)}px)`:`translate(-50%, -50%) translate(${F.x.toFixed(1)}px, ${F.y.toFixed(1)}px)`}let R=C.filter(({label:b})=>!st.has(b.kind)).sort((b,F)=>sn[F.label.kind]-sn[b.label.kind]||b.screen.depth-F.screen.depth||b.focus-F.focus).flatMap(({label:b})=>{let F=this.nodes.get(b.id);return F&&F.style.display!=="none"?[{node:F,box:F.getBoundingClientRect()}]:[]}),L=[];for(let{node:b,box:F}of R)L.some(I=>F.left<I.right+3&&F.right+3>I.left&&F.top<I.bottom+3&&F.bottom+3>I.top)?b.style.display="none":L.push(F);for(let[b,F]of this.nodes)D.has(b)||(F.style.display="none")}nodeFor(e){let n=this.nodes.get(e.id);if(!n){n=document.createElement("div");let w=n.style;w.position="absolute",w.left="0",w.top="0",w.whiteSpace="nowrap",w.display="none",this.root.appendChild(n),this.nodes.set(e.id,n)}let r=this.selectedSeatLabelIds.has(e.id),a=this.nodeAppearance.get(n),o=this.wheelchairFree.get(e.id)??0,i=e.text+(e.icon??"")+(e.venueIcon??"")+(e.tint??"")+(o>0?`|${o}`:"");if(a&&a.text===i&&a.kind===e.kind&&a.color===e.color&&a.selected===r&&a.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:i,kind:e.kind,color:e.color,selected:r,narrow:this.narrowStage}),e.kind==="access")return this.paintAccessChip(n,e);if(n.textContent=e.text,r){let w=document.createElement("span"),E=w.style;E.position="absolute",E.left="50%",E.bottom=`-${it}px`,E.transform="translateX(-50%)",E.borderLeft=`${it}px solid transparent`,E.borderRight=`${it}px solid transparent`,E.borderTop=`${it}px solid ${at}`,n.appendChild(w)}n.setAttribute("data-label-kind",e.kind),n.toggleAttribute("data-selected-seat",r);let s=zo[e.kind],l=n.style;l.fontSize=`${this.sizeFor(e.kind)}px`,l.fontWeight=r?"800":s.weight,l.opacity=r?"1":String(s.opacity);let c=st.has(e.kind),f=!c,p=ri(e.color??this.opts.ink,this.opts.backgroundRgb,!0),u=c?ai(e.color??this.opts.ink,this.opts.backgroundRgb):p;l.color=r?ko:u.ink,l.background=r?at:u.backing,l.border=r?`1px solid ${at}`:f?`1px solid ${p.border}`:"",l.borderRadius=r||f?"999px":`${ti}px`;let m=this.narrowStage?Ja:Za;l.padding=r||f?m:`${Go}px ${Ho}px`,l.lineHeight=c?"1.1":"",l.boxShadow=r?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":f?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",l.textShadow=r||f?"none":"0 1px 1px rgba(0,0,0,0.4)",l.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let d=this.opts.backgroundRgb??[.04,.06,.1],y=Fe(r?ko:u.ink)??[1,1,1],v=cn(r?at:u.backing,d);return n.dataset.qualityContrast=ke(y,v).toFixed(3),l.textTransform=e.kind==="zone"||e.kind==="floor"?"uppercase":"",e.kind==="section"&&this.dressSectionTag(n,e,o),e.kind==="gate"&&this.dressGateTag(n,e),e.venueIcon&&this.dressVenueIconTag(n,e.venueIcon),n}dressVenueIconTag(e,n){let r=jn(n);if(!r)return;let a=e.style;a.display="inline-flex",a.alignItems="center",a.gap="5px";let o=16,i=qn.glyphScale,s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.setAttribute("data-venue-icon",r.key),s.style.lineHeight="0",s.innerHTML=`<svg width="${o}" height="${o}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11.25" fill="${Xn[r.group]}" stroke="${qt}" stroke-width="1.5"/><path transform="translate(${12-12*i} ${12-12*i}) scale(${i})" d="${r.solid}" fill="${qt}"/></svg>`,e.prepend(s)}dressGateTag(e,n){let r=e.style;r.background="#0f172a",r.color="#ffffff",r.border="1px solid rgba(255,255,255,0.28)",r.textTransform="uppercase",r.letterSpacing="0.06em",r.display="inline-flex",r.alignItems="center",r.gap="5px";let a=document.createElement("span");if(a.setAttribute("aria-hidden","true"),a.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),a.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',e.prepend(a),n.stepFree){let o=document.createElement("span");o.setAttribute("data-gate-step-free","true"),o.setAttribute("aria-label","Step-free"),o.style.lineHeight="0",o.innerHTML=gt("wheelchair",{size:11}),e.append(o)}e.dataset.qualityContrast=ke([1,1,1],Fe("#0f172a")).toFixed(3)}dressSectionTag(e,n,r){let a=n.tint?ni(n.tint):null,o=e.style;if(a&&(o.background=a.fill,o.color=a.ink,o.border=`1px solid ${a.border}`,e.dataset.qualityContrast=a.contrast.toFixed(3)),r<=0)return;let i=document.createElement("span");i.setAttribute("data-wheelchair-free",String(r)),i.setAttribute("aria-label",`${r} wheelchair ${r===1?"place":"places"} free`),i.innerHTML=`${gt("wheelchair",{size:11})}<span>${r}</span>`;let s=i.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",e.appendChild(i)}paintAccessChip(e,n){e.setAttribute("data-label-kind","access"),e.setAttribute("data-access-type",n.icon??""),e.innerHTML=n.icon?gt(n.icon,{size:Ue-6}):"",e.setAttribute("role","img"),e.setAttribute("aria-label",n.text);let r=e.style;return r.width=`${Ue}px`,r.height=`${Ue}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=ke(Fe(n.ink??"#ffffff")??[1,1,1],Fe(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=`${Lo}px`,r.height=`${Lo}px`,r.borderRadius="50%",r.background=at,r.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",r.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,r)=>{let a=e[r];n.style.display=a?"":"none",a&&(n.style.transform=`translate(-50%, -100%) translate(${a.x.toFixed(1)}px, ${a.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var ui=1;var di=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function mi(t){return t.every(e=>Number.isFinite(e))}function hi(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Bo(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function Le(t){return Math.round(t*1e4)/1e4}function pi(t){if(t)return{box:{x:Le(t.box.x),y:Le(t.box.y),width:Le(t.box.width),height:Le(t.box.height)},horizontalFillRatio:Le(t.horizontalFillRatio),verticalFillRatio:Le(t.verticalFillRatio),visibleAreaRatio:Le(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function Pe(t,e,n){return n.length?{code:t,message:e,count:n.length,samples:n.slice(0,20)}:null}function un(t){let e=t.labels.filter(s=>s.visible&&s.screenBox),n=e.filter(s=>di.has(s.kind)),r=t.scene.floorCount>1?t.scene.floorCount:t.scene.zoneCount||t.scene.sectionCount,a=[];for(let s=0;s<n.length;s+=1)for(let l=0;l<s;l+=1)hi(n[s].screenBox,n[l].screenBox)&&a.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[l].id});let o=[...t.camera.position,t.camera.distance,t.camera.verticalFovDeg],i=[Pe("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),Pe("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),Pe("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),Pe("viewport-empty","The 3D viewport must have visible dimensions",t.viewport.width>1&&t.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${t.viewport.width}\xD7${t.viewport.height}`}]),Pe("camera-invalid","The capture camera must have a finite physical pose",mi(o)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),Pe("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!t.scene.authoredRelief||t.scene.renderedVerticalSpanM>.05&&t.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:t.scene.projectedReliefPx,minimum:2}]),Pe("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),Pe("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",n.filter(s=>s.renderedFontPx<11).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.renderedFontPx,minimum:11}))),Pe("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",n.filter(s=>s.contrast<4.5).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.contrast,minimum:4.5}))),Pe("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",a)].filter(s=>!!s);return{version:1,state:"venue3d",passed:i.length===0,resolvedRules:["rendered-3d-webgl-context","rendered-3d-stable-frame","rendered-3d-camera-pose","rendered-3d-relief-projection","rendered-3d-label-size","rendered-3d-label-contrast","rendered-3d-label-collision"],viewport:t.viewport,context:t.context,frame:t.frame,camera:t.camera,scene:t.scene,composition:{visibleLabels:e.map(({id:s,kind:l,text:c})=>({id:s,kind:l,text:c})).sort((s,l)=>s.kind.localeCompare(l.kind)||s.id.localeCompare(l.id)),framing:pi(t.framing)},metrics:{minimumHierarchyFontPx:Bo(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:Bo(n.map(s=>s.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:i}}function Wo(t,e,n){t.fill(0);for(let r=0;r<Math.min(n,e.length);r++)t[e[r]]=1}import{Geometry as lt,Mesh as ct,Program as zi,Texture as Ni,Transform as rr}from"ogl";import{Program as Ve}from"ogl";var Ct=`
|
|
60
|
+
}`;function Si(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 yn(t){return Math.max(hi,Math.min(mi,t*di))}function Mi(t){let e=.2126*t[0]+.7152*t[1]+.0722*t[2],n=e>=.25?0:Math.min(.45,(.25-e)*2.2);return t.map(r=>r+(1-r)*n)}function Qo(t,e,n=[.24,.74,1]){let r=Mi(n),a=new ui,o=yi(t),i=new Map,s=(l,c)=>{let f=new ci(t,{vertex:xi,fragment:wi,uniforms:{uSeat:{value:l},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uBeamHeight:{value:He.height},uBeam:{value:0},uBeamColor:{value:r},uColor:{value:e},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),m=new li(t,{geometry:o,program:f});return m.frustumCulled=!1,m.setParent(a),{mesh:m,program:f,seat:l,start:c}};return{root:a,setSeats(l,c,f){let m=new Set(l.slice(0,Zo).map(u=>u.id));for(let[u,d]of i)m.has(u)||(d.mesh.setParent(null),i.delete(u));for(let u of l.slice(0,Zo))i.has(u.id)||i.set(u.id,s(u.position,f?c:-1/0))},update(l,c,f,m=!1){let u=!1;for(let d of i.values()){let h=c[0]-d.seat[0],y=c[1]-d.seat[1],v=c[2]-d.seat[2],x=Math.hypot(h,y,v);d.mesh.visible=!f&&x>(m?fi:vi);let T=yn(x),A=Math.max(0,Math.min(1,(l-d.start)/bi));A<1&&(u=!0),d.program.uniforms.uHeight.value=T,d.program.uniforms.uRingScale.value=Math.min(T,pi),d.program.uniforms.uLift.value=m?1:1-Si(A),d.program.uniforms.uBeam.value=gi(x,m),d.program.uniforms.uRingAlpha.value=.55+.4*(A<1?Math.sin(A*Math.PI):0)}return u},dispose(){for(let l of i.values())l.mesh.setParent(null);i.clear(),o.remove()}}}var mt="#ffffff",Jo="#0b1220",pt=6,Ai=80,er=14,tr=88,nr=20,or={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},Pi=640,Ei=.8,Ci=11,Ti="3px 7px",Ri="2px 5px",rr="rgba(10,14,22,.62)",_i="#f4f7fb",ar=5,ir=2,Fi=6,ft=new Set(["row","seat","access"]),xn={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},Je={row:{x:66,y:20},seat:{x:52,y:22}},Ge=ro,wn=t=>ao(t);function Be(t,e){let n=wn(t),r=wn(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Ii(t){let e=Ge(t);if(!e)return null;let n=o=>`#${o.map(i=>Math.round(Math.max(0,Math.min(1,i))*255).toString(16).padStart(2,"0")).join("")}`,r=e.map(o=>o+(1-o)*.78),a=e.map(o=>o*.62);for(let o=0;o<12&&Be(a,r)<4.5;o++)a=a.map(i=>i*.8);return{fill:n(r),ink:n(a),border:n(e.map(o=>o+(1-o)*.35)),contrast:Be(a,r)}}var Di=30;function Sn(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 ki(t,e=[.04,.06,.1],n=!0){let r=wn(e)<.42,a=r?"#f4f7fb":"#0b1220",o=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",i=n?Sn(o,e):e,s=Ge(t),l=n?7:4.5,c=s&&Be(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 Li(t,e=[.04,.06,.1]){let n=Sn(rr,e),r=Ge(t);return{ink:r&&Be(r,n)>=4.5?t:_i,backing:rr}}var Vi=.8,et=20,zi=14,Oi=60,Ni='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',kt=class{constructor(e,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let r=this.root.style;r.position="absolute",r.inset="0",r.pointerEvents="none",r.overflow="hidden",r.fontFamily=n.fontFamily||Ni,e.appendChild(this.root)}setVisible(e){this.root.style.visibility=e?"":"hidden"}setLabels(e){this.labels=e;let n=new Set(e.map(r=>r.id));for(let[r,a]of this.nodes)n.has(r)||(a.remove(),this.nodes.delete(r))}setForcedDense(e){this.forcedDense=e}setOverviewDistance(e){this.overviewDistance=e>0?e:null}setSeatNumberRow(e){return e===this.seatNumberRow?!1:(this.seatNumberRow=e,!0)}setSeatNumberSeat(e){let n=e?`seat:${e}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(e){let n=e.size!==this.wheelchairFree.size;if(!n){for(let[r,a]of e)if(this.wheelchairFree.get(r)!==a){n=!0;break}}return n&&(this.wheelchairFree=new Map(e)),n}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,n=>`seat:${n}`))}sizeFor(e){let n=or[e].size;return!this.narrowStage||ft.has(e)?n:Math.max(Ci,n*Ei)}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<Pi;let s=Eo(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*Vi&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(g=>g.kind==="section")&&s.delete("zone");let l=[];for(let g of this.labels){let D=g.kind==="annotation"&&!!g.venueIcon;if(!s.has(g.kind)&&!D&&!(g.kind==="seat"&&this.selectedSeatLabelIds.has(g.id)))continue;let w=g.kind==="seat"&&i&&this.selectedSeatLabelIds.has(g.id)?g.pinBase:void 0,I=w&&i?[w[0],w[1]+yn(Math.hypot(w[0]-i[0],w[1]-i[1],w[2]-i[2])),w[2]]:g.anchor,N=Te(e,I,n,r);if(!N.visible)continue;let P=ft.has(g.kind),O=this.sizeFor(g.kind),G=g.kind==="access"?et:_o(g.text,O,!P)+(P?ar*2:0)+((this.wheelchairFree.get(g.id)??0)>0?Di:0);if(g.kind==="access"&&g.seatWidthM!==void 0&&un(e,g.anchor,g.seatWidthM,n)<zi||g.kind==="seat"&&g.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(g.id)&&un(e,g.anchor,g.seatWidthM,n)<Math.max(22,G))continue;let U=Co(N,G/2,O/2+(P?ir:4),n,r),B=i?Math.hypot(g.anchor[0]-i[0],g.anchor[1]-i[1],g.anchor[2]-i[2]):1;l.push({label:g,screen:U,focus:Io(U,B,n,r),halfWidth:G/2,...this.selectedSeatLabelIds.has(g.id)?{priority:1}:{}})}let c=Po(l.filter(g=>g.label.kind==="floor"),n),f=[...l.filter(g=>!ft.has(g.label.kind)&&g.label.kind!=="floor"),...c],m=Fo(n),u=l.filter(g=>g.label.kind==="seat"&&this.selectedSeatLabelIds.has(g.label.id)),d=ct(u,Je.seat.x,Je.seat.y,m.seat);this.placePinHeads(u.filter(g=>g.label.pinBase&&!d.includes(g)).map(g=>g.screen));let h=To(f,tr,nr,g=>xn[g.label.kind]??0).filter(g=>!d.some(D=>Ro(g,D,tr,nr))),y=ct(l.filter(g=>g.label.kind==="access"),et,et,Oi,[...h,...d]),v=ct(l.filter(g=>g.label.kind==="row"),Je.row.x,Je.row.y,m.row,[...h,...d,...y]),x=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,T=ct(l.filter(g=>g.label.kind==="seat"&&!this.selectedSeatLabelIds.has(g.label.id)&&(this.seatNumberSeat!==null?g.label.id===this.seatNumberSeat:!x||this.seatNumberRow!==null&&g.label.rowId===this.seatNumberRow)),Je.seat.x,Je.seat.y,x?Ai:m.seat-d.length,[...h,...d,...y,...v]),A=[...h,...y,...v,...d,...T],F=new Set(A.map(g=>g.label.id));for(let{label:g,screen:D}of A){let I=this.nodeFor(g).style;I.display=g.kind==="access"?"flex":g.kind==="gate"?"inline-flex":"";let N=!!g.pinBase&&this.selectedSeatLabelIds.has(g.id);I.transform=N?`translate(-50%, -100%) translate(${D.x.toFixed(1)}px, ${(D.y-pt).toFixed(1)}px)`:`translate(-50%, -50%) translate(${D.x.toFixed(1)}px, ${D.y.toFixed(1)}px)`}let _=A.filter(({label:g})=>!ft.has(g.kind)).sort((g,D)=>xn[D.label.kind]-xn[g.label.kind]||g.screen.depth-D.screen.depth||g.focus-D.focus).flatMap(({label:g})=>{let D=this.nodes.get(g.id);return D&&D.style.display!=="none"?[{node:D,box:D.getBoundingClientRect()}]:[]}),V=[];for(let{node:g,box:D}of _)V.some(I=>D.left<I.right+3&&D.right+3>I.left&&D.top<I.bottom+3&&D.bottom+3>I.top)?g.style.display="none":V.push(D);for(let[g,D]of this.nodes)F.has(g)||(D.style.display="none")}nodeFor(e){let n=this.nodes.get(e.id);if(!n){n=document.createElement("div");let x=n.style;x.position="absolute",x.left="0",x.top="0",x.whiteSpace="nowrap",x.display="none",this.root.appendChild(n),this.nodes.set(e.id,n)}let r=this.selectedSeatLabelIds.has(e.id),a=this.nodeAppearance.get(n),o=this.wheelchairFree.get(e.id)??0,i=e.text+(e.icon??"")+(e.venueIcon??"")+(e.tint??"")+(o>0?`|${o}`:"");if(a&&a.text===i&&a.kind===e.kind&&a.color===e.color&&a.selected===r&&a.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:i,kind:e.kind,color:e.color,selected:r,narrow:this.narrowStage}),e.kind==="access")return this.paintAccessChip(n,e);if(n.textContent=e.text,r){let x=document.createElement("span"),T=x.style;T.position="absolute",T.left="50%",T.bottom=`-${pt}px`,T.transform="translateX(-50%)",T.borderLeft=`${pt}px solid transparent`,T.borderRight=`${pt}px solid transparent`,T.borderTop=`${pt}px solid ${mt}`,n.appendChild(x)}n.setAttribute("data-label-kind",e.kind),n.toggleAttribute("data-selected-seat",r);let s=or[e.kind],l=n.style;l.fontSize=`${this.sizeFor(e.kind)}px`,l.fontWeight=r?"800":s.weight,l.opacity=r?"1":String(s.opacity);let c=ft.has(e.kind),f=!c,m=ki(e.color??this.opts.ink,this.opts.backgroundRgb,!0),u=c?Li(e.color??this.opts.ink,this.opts.backgroundRgb):m;l.color=r?Jo:u.ink,l.background=r?mt:u.backing,l.border=r?`1px solid ${mt}`:f?`1px solid ${m.border}`:"",l.borderRadius=r||f?"999px":`${Fi}px`;let d=this.narrowStage?Ri:Ti;l.padding=r||f?d:`${ir}px ${ar}px`,l.lineHeight=c?"1.1":"",l.boxShadow=r?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":f?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",l.textShadow=r||f?"none":"0 1px 1px rgba(0,0,0,0.4)",l.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let h=this.opts.backgroundRgb??[.04,.06,.1],y=Ge(r?Jo:u.ink)??[1,1,1],v=Sn(r?mt:u.backing,h);return n.dataset.qualityContrast=Be(y,v).toFixed(3),l.textTransform=e.kind==="zone"||e.kind==="floor"?"uppercase":"",e.kind==="section"&&this.dressSectionTag(n,e,o),e.kind==="gate"&&this.dressGateTag(n,e),e.venueIcon&&this.dressVenueIconTag(n,e.venueIcon),n}dressVenueIconTag(e,n){let r=lo(n);if(!r)return;let a=e.style;a.display="inline-flex",a.alignItems="center",a.gap="5px";let o=16,i=so.glyphScale,s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.setAttribute("data-venue-icon",r.key),s.style.lineHeight="0",s.innerHTML=`<svg width="${o}" height="${o}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11.25" fill="${io[r.group]}" stroke="${rn}" stroke-width="1.5"/><path transform="translate(${12-12*i} ${12-12*i}) scale(${i})" d="${r.solid}" fill="${rn}"/></svg>`,e.prepend(s)}dressGateTag(e,n){let r=e.style;r.background="#0f172a",r.color="#ffffff",r.border="1px solid rgba(255,255,255,0.28)",r.textTransform="uppercase",r.letterSpacing="0.06em",r.display="inline-flex",r.alignItems="center",r.gap="5px";let a=document.createElement("span");if(a.setAttribute("aria-hidden","true"),a.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),a.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',e.prepend(a),n.stepFree){let o=document.createElement("span");o.setAttribute("data-gate-step-free","true"),o.setAttribute("aria-label","Step-free"),o.style.lineHeight="0",o.innerHTML=Pt("wheelchair",{size:11}),e.append(o)}e.dataset.qualityContrast=Be([1,1,1],Ge("#0f172a")).toFixed(3)}dressSectionTag(e,n,r){let a=n.tint?Ii(n.tint):null,o=e.style;if(a&&(o.background=a.fill,o.color=a.ink,o.border=`1px solid ${a.border}`,e.dataset.qualityContrast=a.contrast.toFixed(3)),r<=0)return;let i=document.createElement("span");i.setAttribute("data-wheelchair-free",String(r)),i.setAttribute("aria-label",`${r} wheelchair ${r===1?"place":"places"} free`),i.innerHTML=`${Pt("wheelchair",{size:11})}<span>${r}</span>`;let s=i.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",e.appendChild(i)}paintAccessChip(e,n){e.setAttribute("data-label-kind","access"),e.setAttribute("data-access-type",n.icon??""),e.innerHTML=n.icon?Pt(n.icon,{size:et-6}):"",e.setAttribute("role","img"),e.setAttribute("aria-label",n.text);let r=e.style;return r.width=`${et}px`,r.height=`${et}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=Be(Ge(n.ink??"#ffffff")??[1,1,1],Ge(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=`${er}px`,r.height=`${er}px`,r.borderRadius="50%",r.background=mt,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 Hi=1;var Gi=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function Bi(t){return t.every(e=>Number.isFinite(e))}function Wi(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 sr(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function We(t){return Math.round(t*1e4)/1e4}function Ui(t){if(t)return{box:{x:We(t.box.x),y:We(t.box.y),width:We(t.box.width),height:We(t.box.height)},horizontalFillRatio:We(t.horizontalFillRatio),verticalFillRatio:We(t.verticalFillRatio),visibleAreaRatio:We(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function Re(t,e,n){return n.length?{code:t,message:e,count:n.length,samples:n.slice(0,20)}:null}function Mn(t){let e=t.labels.filter(s=>s.visible&&s.screenBox),n=e.filter(s=>Gi.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)Wi(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=[Re("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),Re("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),Re("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),Re("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}`}]),Re("camera-invalid","The capture camera must have a finite physical pose",Bi(o)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),Re("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}]),Re("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`}]),Re("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}))),Re("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}))),Re("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:Ui(t.framing)},metrics:{minimumHierarchyFontPx:sr(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:sr(n.map(s=>s.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:i}}function lr(t,e,n){t.fill(0);for(let r=0;r<Math.min(n,e.length);r++)t[e[r]]=1}import{Geometry as vt,Mesh as bt,Program as fs,Texture as vs,Transform as Pr}from"ogl";import{Program as Ue}from"ogl";var Lt=`
|
|
47
61
|
float chairWeight(float depth) {
|
|
48
62
|
return 1.0 - smoothstep(uChairFull, uChairNone, depth);
|
|
49
|
-
}`,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
63
|
+
}`,An=`
|
|
64
|
+
const float TIP_SIN = ${Math.sin(ln*Math.PI/180).toFixed(4)};
|
|
65
|
+
const float TIP_COS = ${Math.cos(ln*Math.PI/180).toFixed(4)};
|
|
66
|
+
vec3 tipUpPad(vec3 p, float halfWidth, float up) {
|
|
67
|
+
if (up < 0.5) return p;
|
|
68
|
+
float hingeZ = (${vo.toFixed(2)}) * halfWidth + ${bo.toFixed(2)};
|
|
69
|
+
float dy = p.y - ${sn.toFixed(2)};
|
|
70
|
+
float dz = p.z - hingeZ;
|
|
71
|
+
return vec3(p.x,
|
|
72
|
+
${sn.toFixed(2)} + dz * TIP_SIN + dy * TIP_COS,
|
|
73
|
+
hingeZ + dz * TIP_COS - dy * TIP_SIN);
|
|
74
|
+
}
|
|
75
|
+
vec3 tipUpNormal(vec3 n, float up) {
|
|
76
|
+
if (up < 0.5) return n;
|
|
77
|
+
return vec3(n.x, n.z * TIP_SIN + n.y * TIP_COS, n.z * TIP_COS - n.y * TIP_SIN);
|
|
78
|
+
}`,Pn=`
|
|
55
79
|
float glyphEq(float glyph, float expected) {
|
|
56
80
|
return 1.0 - step(0.25, abs(glyph - expected));
|
|
57
81
|
}
|
|
@@ -84,7 +108,9 @@ vec3 glyphChairPosition(vec3 p, float partId, float glyph) {
|
|
|
84
108
|
else if (bench > 0.5) { p.x *= 1.10; p.z *= 0.82; }
|
|
85
109
|
} else if (partId < 2.5) {
|
|
86
110
|
if (stool > 0.5) return vec3(0.0);
|
|
87
|
-
|
|
111
|
+
// A dining chair's back is a panel held clear of the seat on its two rear
|
|
112
|
+
// legs: open under it, where an auditorium seat is closed to the pad.
|
|
113
|
+
if (dining > 0.5) { p.x *= 0.78; p.y = ${Ne.toFixed(2)} - (${Ne.toFixed(2)} - p.y) * ${po.toFixed(2)}; }
|
|
88
114
|
else if (folding > 0.5) { p.x *= 0.90; p.y = 0.45 + (p.y - 0.45) * 0.72; }
|
|
89
115
|
else if (bench > 0.5) { p.x *= 1.10; p.y = 0.45 + (p.y - 0.45) * 0.62; }
|
|
90
116
|
} else if (partId < 3.5) {
|
|
@@ -96,11 +122,31 @@ vec3 glyphChairPosition(vec3 p, float partId, float glyph) {
|
|
|
96
122
|
if (max(max(dining, folding), bench) < 0.5) return vec3(0.0);
|
|
97
123
|
if (folding > 0.5) p.x *= 0.88;
|
|
98
124
|
if (bench > 0.5) p.x *= 1.10;
|
|
99
|
-
|
|
100
|
-
|
|
125
|
+
if (dining > 0.5) {
|
|
126
|
+
// Slim legs set in under the seat. The rear pair stand behind the pad and
|
|
127
|
+
// carry on up into the foot of the back, so the back is held by the
|
|
128
|
+
// chair's own frame and daylight shows between it and the seat.
|
|
129
|
+
p.x = sign(p.x) * (${uo.toFixed(2)} + (abs(p.x) - 0.72) * ${Et.toFixed(2)});
|
|
130
|
+
if (p.z > 0.0) p.z = ${ho.toFixed(2)} + (p.z - 0.59) * ${Et.toFixed(2)};
|
|
131
|
+
else {
|
|
132
|
+
p.z = ${mo.toFixed(2)} + (p.z + 0.59) * ${Et.toFixed(2)};
|
|
133
|
+
if (p.y > 0.2) p.y = ${fo.toFixed(2)};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
} else if (partId < 6.5) {
|
|
137
|
+
// The spine joins the back to the seat, so it goes where the back goes:
|
|
138
|
+
// as wide as that furniture's back, and gone where there is no back.
|
|
139
|
+
// A dining chair's back stands on its rear legs instead (see the legs).
|
|
140
|
+
if (max(stool, dining) > 0.5) return vec3(0.0);
|
|
141
|
+
if (folding > 0.5) p.x *= 0.90;
|
|
142
|
+
else if (bench > 0.5) p.x *= 1.10;
|
|
143
|
+
} else if (partId < 7.5) {
|
|
144
|
+
// Armrest standards are fixed auditorium seating; every other furniture
|
|
145
|
+
// family either has its own arms or has none.
|
|
146
|
+
if (generic < 0.5) return vec3(0.0);
|
|
101
147
|
}
|
|
102
148
|
return p;
|
|
103
|
-
}`,
|
|
149
|
+
}`,Yi=1.5,tt=`
|
|
104
150
|
uniform vec4 uSeeThrough; // xyz = the seats looked at, w = cone radius there; 0 = off
|
|
105
151
|
bool seeThroughCut(vec3 p, vec3 eye) {
|
|
106
152
|
if (uSeeThrough.w <= 0.0) return false;
|
|
@@ -109,11 +155,11 @@ bool seeThroughCut(vec3 p, vec3 eye) {
|
|
|
109
155
|
if (len < 1.0) return false;
|
|
110
156
|
vec3 dir = axis / len;
|
|
111
157
|
float t = dot(p - eye, dir);
|
|
112
|
-
if (t <= 0.0 || t > len - ${
|
|
158
|
+
if (t <= 0.0 || t > len - ${Yi.toFixed(2)}) return false;
|
|
113
159
|
vec3 onLine = eye + dir * t;
|
|
114
160
|
if (p.y < onLine.y - 0.25) return false;
|
|
115
161
|
return length(p - onLine) < uSeeThrough.w * t / len;
|
|
116
|
-
}`,
|
|
162
|
+
}`,Xi=`#version 300 es
|
|
117
163
|
precision highp float;
|
|
118
164
|
in vec3 position;
|
|
119
165
|
in vec3 normal;
|
|
@@ -151,13 +197,60 @@ void main() {
|
|
|
151
197
|
vNormalWorld = normalize(mat3(modelMatrix) * normal);
|
|
152
198
|
vColor = color;
|
|
153
199
|
gl_Position = projectionMatrix * mv;
|
|
154
|
-
}`,
|
|
200
|
+
}`,cr=`
|
|
155
201
|
bool roomWallHidden(float material, vec3 normalWorld, vec3 posWorld, vec3 eye, vec2 roomCentre) {
|
|
156
202
|
if (abs(material - 6.0) > 0.5) return false;
|
|
157
203
|
vec3 n = normalize(normalWorld);
|
|
158
204
|
if (abs(n.y) > 0.5) return true;
|
|
159
205
|
return dot(n.xz, eye.xz - posWorld.xz) * dot(n.xz, roomCentre - posWorld.xz) <= 0.0;
|
|
160
|
-
}`,
|
|
206
|
+
}`,ur=`
|
|
207
|
+
uniform vec3 uTop;
|
|
208
|
+
uniform vec3 uBottom;
|
|
209
|
+
uniform float uSky; // 1 for an open-air venue, see SceneModel.outdoor
|
|
210
|
+
uniform vec3 uZenith;
|
|
211
|
+
uniform vec3 uHorizon;
|
|
212
|
+
// uv: the pixel's place on screen, 0..1. dir: its line of sight, used only under a sky.
|
|
213
|
+
vec3 backdrop(vec2 uv, vec3 dir) {
|
|
214
|
+
vec3 col = mix(uBottom, uTop, uv.y);
|
|
215
|
+
vec2 c = uv - 0.5;
|
|
216
|
+
col *= 1.0 - dot(c, c) * 0.16; // soft vignette
|
|
217
|
+
// Above the horizon an open-air venue has a sky, not the chart's flat
|
|
218
|
+
// backdrop: from a seat, the stands used to meet a black void. Below the
|
|
219
|
+
// horizon (every overview) nothing changes.
|
|
220
|
+
if (uSky > 0.5) {
|
|
221
|
+
vec3 sky = mix(uHorizon, uZenith, pow(clamp(dir.y, 0.0, 1.0), 0.45));
|
|
222
|
+
// Reaching a little below the horizon too: from a low seat the far stands
|
|
223
|
+
// top out right at it, and a sliver of backdrop showed as a dark band.
|
|
224
|
+
// Every overview looks further down than this (at least ~24 degrees).
|
|
225
|
+
col = mix(col, sky, smoothstep(-0.22, 0.03, dir.y));
|
|
226
|
+
}
|
|
227
|
+
return col;
|
|
228
|
+
}`,$i=`
|
|
229
|
+
// A fixed 4 by 4 threshold pattern: a net thinned by it reads as a fine mesh,
|
|
230
|
+
// where random grain would read as dirt.
|
|
231
|
+
float orderedThreshold(vec2 pixel) {
|
|
232
|
+
const float m[16] = float[16](0.0, 8.0, 2.0, 10.0, 12.0, 4.0, 14.0, 6.0, 3.0, 11.0, 1.0, 9.0, 15.0, 7.0, 13.0, 5.0);
|
|
233
|
+
ivec2 i = ivec2(mod(pixel, 4.0));
|
|
234
|
+
return (m[i.x + i.y * 4] + 0.5) / 16.0;
|
|
235
|
+
}
|
|
236
|
+
const float NET_MESH_M = 0.12; // one mesh of a goal net
|
|
237
|
+
const float NET_CORD = 0.07; // half a cord's width, in meshes (drawn heavier than life)
|
|
238
|
+
const float NET_VEIL = 0.3; // how much of a distant net shows
|
|
239
|
+
// place: the point's place on its panel, metres (carried where a colour would be).
|
|
240
|
+
float netShown(vec2 place) {
|
|
241
|
+
vec2 mesh = place / NET_MESH_M;
|
|
242
|
+
vec2 w = fwidth(mesh); // meshes per pixel
|
|
243
|
+
vec2 toCord = 0.5 - abs(fract(mesh) - 0.5);
|
|
244
|
+
vec2 cord = 1.0 - smoothstep(NET_CORD - w, NET_CORD + w, toCord);
|
|
245
|
+
// Cords while a mesh is a dozen pixels or more; a veil once it is under six.
|
|
246
|
+
float crisp = 1.0 - smoothstep(0.08, 0.16, max(w.x, w.y));
|
|
247
|
+
return mix(NET_VEIL, max(cord.x, cord.y), crisp);
|
|
248
|
+
}
|
|
249
|
+
// A part a few centimetres thick: in full while a pixel covers 2.5 cm of it or
|
|
250
|
+
// less, gone by 4.5. pixelM: the world size of this pixel, metres.
|
|
251
|
+
float slenderShown(float pixelM) {
|
|
252
|
+
return 1.0 - smoothstep(0.025, 0.045, pixelM);
|
|
253
|
+
}`,qi=`#version 300 es
|
|
161
254
|
precision highp float;
|
|
162
255
|
in vec3 vColor;
|
|
163
256
|
in vec3 vNormalWorld;
|
|
@@ -167,6 +260,8 @@ in vec3 vPosWorld;
|
|
|
167
260
|
in float vDim;
|
|
168
261
|
in float vMaterial;
|
|
169
262
|
uniform vec3 uKeyDir; // WORLD space, unit, points at the light
|
|
263
|
+
uniform vec3 uKeyColor; // the look's tint of the key light (1 = white)
|
|
264
|
+
uniform vec3 uAmbientColor; // ...and of the ambient and fill
|
|
170
265
|
uniform float uStructureDetail;
|
|
171
266
|
uniform float uRoughness;
|
|
172
267
|
uniform vec3 uDeckColor;
|
|
@@ -176,9 +271,12 @@ uniform sampler2D tVenueShadow;
|
|
|
176
271
|
uniform mat4 uShadowMatrix;
|
|
177
272
|
uniform vec3 cameraPosition;
|
|
178
273
|
uniform vec2 uRoomCentre;
|
|
274
|
+
uniform vec2 uViewport; // drawing buffer size, pixels
|
|
179
275
|
out vec4 fragColor;
|
|
180
|
-
${
|
|
181
|
-
${
|
|
276
|
+
${cr}
|
|
277
|
+
${tt}
|
|
278
|
+
${ur}
|
|
279
|
+
${$i}
|
|
182
280
|
// Stable world-space variation; no textures or per-frame random grain.
|
|
183
281
|
float turfHash(vec2 p) {
|
|
184
282
|
vec3 q = fract(vec3(p.xyx) * 0.1031);
|
|
@@ -219,6 +317,36 @@ void main() {
|
|
|
219
317
|
if (vDim > 0.5) discard;
|
|
220
318
|
if (roomWallHidden(vMaterial, vNormalWorld, vPosWorld, cameraPosition, uRoomCentre)) discard;
|
|
221
319
|
if (seeThroughCut(vPosWorld, cameraPosition)) discard;
|
|
320
|
+
// Stage light (material 12, stageDressing.ts): the drape behind a stage and
|
|
321
|
+
// the lamps along it. It is light, not a surface: it is drawn in exactly its
|
|
322
|
+
// own colour, whatever the venue's rig does, and only from the side it faces,
|
|
323
|
+
// so the overview from behind a stage still looks over a low backdrop.
|
|
324
|
+
if (abs(vMaterial - 12.0) < 0.5) {
|
|
325
|
+
if (dot(vNormalWorld, cameraPosition - vPosWorld) <= 0.0) discard;
|
|
326
|
+
fragColor = vec4(vColor, 1.0);
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
// A step nosing (material 7, see sectionAisles.ts) is a 5 cm strip. It is
|
|
330
|
+
// drawn in full only while a pixel covers about a centimetre of it or less,
|
|
331
|
+
// so it is four or five pixels deep, and it is gone by three: a short
|
|
332
|
+
// screen-door band between the two, never a thin line. Drawn at every
|
|
333
|
+
// distance, the first nosing thinned to a dash on every step and made a
|
|
334
|
+
// zig-zag down each section edge. The tread it lies on is underneath, so a
|
|
335
|
+
// dropped fragment shows the plain step.
|
|
336
|
+
if (abs(vMaterial - 7.0) < 0.5) {
|
|
337
|
+
float nosingPixel = max(length(dFdx(vPosWorld)), length(dFdy(vPosWorld)));
|
|
338
|
+
float nosingShown = 1.0 - smoothstep(0.011, 0.016, nosingPixel);
|
|
339
|
+
float nosingStipple = fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453);
|
|
340
|
+
if (nosingStipple >= nosingShown) discard;
|
|
341
|
+
}
|
|
342
|
+
// Sport fittings: a slender part thins out like a nosing, a net is cords up
|
|
343
|
+
// close and a veil further off (see FITTINGS_GLSL).
|
|
344
|
+
bool net = abs(vMaterial - 10.0) < 0.5;
|
|
345
|
+
if (abs(vMaterial - 11.0) < 0.5) {
|
|
346
|
+
float shown = slenderShown(max(length(dFdx(vPosWorld)), length(dFdy(vPosWorld))));
|
|
347
|
+
if (fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453) >= shown) discard;
|
|
348
|
+
}
|
|
349
|
+
if (net && orderedThreshold(gl_FragCoord.xy) >= netShown(vColor.rg)) discard;
|
|
222
350
|
// Row treads (material 3) and risers (material 2) are chart truth: the
|
|
223
351
|
// stepped deck IS the stand, at every distance. What must not survive at
|
|
224
352
|
// whole-venue scale is the risers' darker shade \u2014 hundreds of sub-pixel dark
|
|
@@ -236,6 +364,8 @@ void main() {
|
|
|
236
364
|
// Risers are baked at 0.72 of their tread (see tiers.ts bandColors); lift
|
|
237
365
|
// them back to the tread colour as detail fades out.
|
|
238
366
|
vec3 vColorRung = vColor * mix(mix(1.0 / 0.72, 1.0, uStructureDetail), 1.0, 1.0 - riser);
|
|
367
|
+
// A net's vertex colour is its place on the panel, not a colour.
|
|
368
|
+
if (net) vColorRung = vec3(0.90, 0.92, 0.95);
|
|
239
369
|
// Concrete remains visible at overview instead of painting the entire
|
|
240
370
|
// seating deck like upholstery. Keep a category tint for navigation;
|
|
241
371
|
// filtering retains its existing shell color cues.
|
|
@@ -275,7 +405,10 @@ void main() {
|
|
|
275
405
|
// The fill keeps the turned faces from going charcoal: at 0.10 a wall facing
|
|
276
406
|
// away from the sun kept about half its colour, and the walls under every
|
|
277
407
|
// tier and box read as dark blocks (owner, 2026-09-24).
|
|
278
|
-
|
|
408
|
+
// The look tints the light, never the surface: the same concrete under an
|
|
409
|
+
// amber house and under floodlights (see looks.ts). White for no look.
|
|
410
|
+
vec3 base = vColorRung * ((0.34 + 0.26 * hemi) * mix(0.72, 1.0, visibility) * uAmbientColor
|
|
411
|
+
+ key * 0.60 * uKeyColor + fill * 0.26 * uAmbientColor);
|
|
279
412
|
float fres = pow(1.0 - max(dot(normalize(vNormalView), V), 0.0), 3.0);
|
|
280
413
|
// Material 1 is a powered display and keeps its authored emission treatment.
|
|
281
414
|
// Every architectural material uses the venue roughness token; 0.78 maps to
|
|
@@ -308,9 +441,18 @@ void main() {
|
|
|
308
441
|
+ vec3(0.62, 0.46, 0.20) * band * 0.28
|
|
309
442
|
+ vec3(0.20, 0.10, 0.34) * focalHalo;
|
|
310
443
|
base = mix(base, display, poweredDisplay * verticalFace * 0.92);
|
|
444
|
+
// The site's open land (material 8 at the paving, rising to 9 at its outer
|
|
445
|
+
// edge: bounds.ts emitSite) dissolves into the backdrop behind it, so the
|
|
446
|
+
// venue stands on ground that has no rim. Matched to the backdrop pixel for
|
|
447
|
+
// pixel: a rim painted one fixed colour showed as a pale disc.
|
|
448
|
+
if (vMaterial > 7.5 && vMaterial < 9.5) {
|
|
449
|
+
float out_ = smoothstep(0.0, 1.0, clamp(vMaterial - 8.0, 0.0, 1.0));
|
|
450
|
+
base = mix(base, backdrop(gl_FragCoord.xy / uViewport, normalize(vPosWorld - cameraPosition)), out_);
|
|
451
|
+
}
|
|
311
452
|
fragColor = vec4(base, 1.0);
|
|
312
|
-
}`,
|
|
313
|
-
${
|
|
453
|
+
}`,dr=`
|
|
454
|
+
${Pn}
|
|
455
|
+
${An}
|
|
314
456
|
vec4 seatSurface(vec3 source, float radius) {
|
|
315
457
|
vec4 origin = modelViewMatrix * vec4(iOffset, 1.0);
|
|
316
458
|
if (iPhysicalSeat < 0.5) {
|
|
@@ -324,12 +466,13 @@ vec4 seatSurface(vec3 source, float radius) {
|
|
|
324
466
|
if (surface < 0.5) return origin;
|
|
325
467
|
vec3 p = glyphChairPosition(source, surface, iGlyph);
|
|
326
468
|
p.xz *= iChairWidth;
|
|
327
|
-
if (surface
|
|
469
|
+
if (surface < 1.5) p = tipUpPad(p, iChairWidth, iTipUp);
|
|
470
|
+
if (surface > 1.5) p.z -= max(p.y - ${ke.toFixed(2)}, 0.0) * ${it.toFixed(2)} * glyphBackRake(iGlyph);
|
|
328
471
|
float c = cos(iYaw), s = sin(iYaw);
|
|
329
472
|
vec3 rotated = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
330
473
|
return modelViewMatrix * vec4(iOffset + rotated, 1.0);
|
|
331
474
|
}
|
|
332
|
-
`,
|
|
475
|
+
`,ji=`#version 300 es
|
|
333
476
|
precision highp float;
|
|
334
477
|
in float surface;
|
|
335
478
|
in float iYaw;
|
|
@@ -343,6 +486,7 @@ in vec3 iColor; // per-instance state colour (resolved CPU-side)
|
|
|
343
486
|
in float iMaxRadius; // per-instance world-radius ceiling (seat pitch derived)
|
|
344
487
|
in float iHasChair;
|
|
345
488
|
in float iPhysicalSeat;// 1 = chair; 0 = empty wheelchair bay
|
|
489
|
+
in float iTipUp; // 1 = an empty tip-up seat, drawn folded against its back
|
|
346
490
|
in vec3 iRing; // accommodation ring colour; (0,0,0) = not accessible
|
|
347
491
|
in float iFloor; // owning floor index
|
|
348
492
|
in float iSection; // owning section index, -1 = none
|
|
@@ -369,9 +513,9 @@ out float vDotWeight; // 1 = the dot IS this seat, 0 = the chair has taken over
|
|
|
369
513
|
out float vPhysicalSeat;
|
|
370
514
|
out float vPixelRadius;
|
|
371
515
|
uniform vec3 cameraPosition;
|
|
372
|
-
${
|
|
373
|
-
${
|
|
374
|
-
${
|
|
516
|
+
${Lt}
|
|
517
|
+
${dr}
|
|
518
|
+
${tt}
|
|
375
519
|
void main() {
|
|
376
520
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
377
521
|
vec4 mv = modelViewMatrix * vec4(iOffset, 1.0);
|
|
@@ -393,8 +537,9 @@ void main() {
|
|
|
393
537
|
mv = seatSurface(position, r);
|
|
394
538
|
// Match the shell's non-uniform width/depth scale before its back rake.
|
|
395
539
|
vec3 n = vec3(normal.x / iChairWidth, normal.y, normal.z / iChairWidth);
|
|
396
|
-
if (surface > 1.5) n.y += n.z * ${
|
|
540
|
+
if (surface > 1.5) n.y += n.z * ${it.toFixed(2)} * glyphBackRake(iGlyph);
|
|
397
541
|
n = normalize(n);
|
|
542
|
+
if (surface > 0.5 && surface < 1.5) n = tipUpNormal(n, iTipUp);
|
|
398
543
|
vSeatNormal = vec3(n.x * cos(iYaw) + n.z * sin(iYaw), n.y, -n.x * sin(iYaw) + n.z * cos(iYaw));
|
|
399
544
|
vSeatHeight = position.y;
|
|
400
545
|
vSeatSurface = step(1.5, surface);
|
|
@@ -405,18 +550,20 @@ void main() {
|
|
|
405
550
|
vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
|
|
406
551
|
vSectionFade = (uFocusSection < -0.5 || abs(iSection - uFocusSection) < 0.5) ? 0.0 : 1.0;
|
|
407
552
|
gl_Position = projectionMatrix * mv;
|
|
408
|
-
}`,
|
|
553
|
+
}`,hr=`
|
|
409
554
|
float seatSilhouette(vec2 uv, float physical) {
|
|
410
555
|
// Solid furniture owns its silhouette in geometry. Only empty bays need
|
|
411
556
|
// a fragment mask; cutting physical faces would open holes in the volume.
|
|
412
557
|
return mix(max(abs(uv.x), abs(uv.y)), 0.0, physical);
|
|
413
558
|
}
|
|
414
|
-
`,
|
|
559
|
+
`,Ki=`#version 300 es
|
|
415
560
|
precision highp float;
|
|
416
561
|
in vec3 vSeatNormal;
|
|
417
562
|
in float vSeatHeight;
|
|
418
563
|
in float vSeatSurface;
|
|
419
564
|
uniform vec3 uKeyDir;
|
|
565
|
+
uniform vec3 uKeyColor; // the look's light, at the seats' share (looks.ts)
|
|
566
|
+
uniform vec3 uAmbientColor;
|
|
420
567
|
in vec2 vUv;
|
|
421
568
|
in vec3 vColor;
|
|
422
569
|
in float vBudget;
|
|
@@ -431,7 +578,7 @@ uniform float uSeatDetail; // 0 for venue/area overview; 1 in section/row/sea
|
|
|
431
578
|
uniform vec3 uFadeColor;
|
|
432
579
|
uniform float uRoughness;
|
|
433
580
|
out vec4 fragColor;
|
|
434
|
-
${
|
|
581
|
+
${hr}
|
|
435
582
|
void main() {
|
|
436
583
|
if (vDim > 0.5) discard;
|
|
437
584
|
// Same screen-door dissolve as the structure rung (uStructureDetail): the
|
|
@@ -452,7 +599,15 @@ void main() {
|
|
|
452
599
|
float fill = max(dot(N, normalize(vec3(-uKeyDir.x, 0.25, -uKeyDir.z))), 0.0);
|
|
453
600
|
float ao = mix(0.58, 1.0, clamp(vSeatHeight / 0.92, 0.0, 1.0));
|
|
454
601
|
float partShade = mix(1.10, 0.80, vSeatSurface);
|
|
455
|
-
vec3 c = vColor * (partShade * ao * (0.60 + 0.30 * hemi) + key * 0.28 + fill * 0.16);
|
|
602
|
+
vec3 c = vColor * (partShade * ao * (0.60 + 0.30 * hemi) * uAmbientColor + key * 0.28 * uKeyColor + fill * 0.16 * uAmbientColor);
|
|
603
|
+
// The far seat is two boxes, and a box face is one flat value. Each face
|
|
604
|
+
// darkens toward its own edges instead, so the pad and the back read as
|
|
605
|
+
// cushions and the row matches the rounded near chair it hands over to (see
|
|
606
|
+
// seatChair.ts) without a single extra triangle. Only once a seat is several
|
|
607
|
+
// pixels across: below that the falloff would be sub-pixel noise.
|
|
608
|
+
vec2 edge = vUv * vUv;
|
|
609
|
+
float cushion = (1.0 - edge.x * edge.x) * (1.0 - edge.y * edge.y);
|
|
610
|
+
c *= mix(1.0, mix(0.78, 1.06, cushion), vPhysicalSeat * smoothstep(3.0, 7.0, vPixelRadius));
|
|
456
611
|
c = mix(c, uFadeColor, uSeatFade);
|
|
457
612
|
// Accommodation ring \u2014 the 3D echo of the coloured ring 2D draws around every
|
|
458
613
|
// accessible seat. Painted INSIDE the dot's own radius rather than outside it,
|
|
@@ -496,11 +651,11 @@ void main() {
|
|
|
496
651
|
c = mix(c, mix(vec3(lum), vec3(0.93), 0.35), 0.45);
|
|
497
652
|
}
|
|
498
653
|
fragColor = vec4(c, alpha);
|
|
499
|
-
}`,
|
|
654
|
+
}`,Zi=`#version 300 es
|
|
500
655
|
precision highp float;
|
|
501
656
|
in vec3 position; // local: x/z in units of the seat radius, y in METRES
|
|
502
657
|
in vec3 normal;
|
|
503
|
-
in float part; // 0..
|
|
658
|
+
in float part; // 0..7 furniture modules (see CHAIR_PART)
|
|
504
659
|
in vec3 iOffset; // per-instance world deck point (identical to the dot's)
|
|
505
660
|
in vec3 iColor; // per-instance state colour
|
|
506
661
|
in float iRadius; // per-instance horizontal half-width, world metres
|
|
@@ -508,9 +663,11 @@ in float iYaw; // per-instance facing, radians (local +Z -> facing dir)
|
|
|
508
663
|
in vec3 iRing; // accommodation ring colour; (0,0,0) = not accessible
|
|
509
664
|
in float iFloor;
|
|
510
665
|
in float iSection; // owning section index, -1 = none
|
|
511
|
-
in float
|
|
666
|
+
in float iTaken; // 1 = sold or held: not for sale
|
|
512
667
|
in float iPhysicalSeat;// 1 = chair; 0 = empty wheelchair bay
|
|
513
668
|
in float iGlyph; // stable SEAT_GLYPH_ORDER index
|
|
669
|
+
in vec4 iArmrests; // xy / zw = world offsets (x, z) of the two armrests; 0 = none
|
|
670
|
+
in float iTipUp; // 1 = an empty tip-up seat, drawn folded against its back
|
|
514
671
|
uniform mat4 modelViewMatrix;
|
|
515
672
|
uniform mat4 projectionMatrix;
|
|
516
673
|
uniform float uChairFull;
|
|
@@ -529,14 +686,14 @@ out float vHeight; // local height in metres, for the vertical occlusion ramp
|
|
|
529
686
|
out vec3 vRing;
|
|
530
687
|
out float vDim;
|
|
531
688
|
out float vSectionFade;
|
|
532
|
-
out float vOccupant; // 1 = this vertex belongs to a person, not to the chair
|
|
533
|
-
out vec3 vOccupantTint;
|
|
534
689
|
out float vTaken; // 1 = sold or held: not for sale
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
${
|
|
690
|
+
out vec3 vLocal; // x/z in chair half-widths, y in metres: where on the chair
|
|
691
|
+
out vec3 vViewWorld;// from the surface to the eye, world space (not unit)
|
|
692
|
+
${Lt}
|
|
693
|
+
${Pn}
|
|
694
|
+
${An}
|
|
538
695
|
uniform vec3 cameraPosition;
|
|
539
|
-
${
|
|
696
|
+
${tt}
|
|
540
697
|
void main() {
|
|
541
698
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
542
699
|
vec4 anchor = modelViewMatrix * vec4(iOffset, 1.0);
|
|
@@ -550,80 +707,68 @@ void main() {
|
|
|
550
707
|
// chairs, but nobody gets a short one (people are the same height at every
|
|
551
708
|
// seat pitch).
|
|
552
709
|
vec3 p = position;
|
|
553
|
-
|
|
554
|
-
//
|
|
555
|
-
// One instanced mesh draws both an empty seat and a taken one, because the
|
|
556
|
-
// alternative \u2014 a second geometry and a second draw call gathered per frame \u2014
|
|
557
|
-
// would double the near-field cost to show what is already known per instance.
|
|
558
|
-
// An unoccupied seat collapses its person to a point at the seat, which the
|
|
559
|
-
// rasteriser discards, exactly as the chair itself collapses at w=0.
|
|
560
|
-
float occupant = step(9.5, part);
|
|
561
|
-
float taken = step(0.0, iSeed);
|
|
562
|
-
vTaken = taken;
|
|
563
|
-
vOccupant = occupant;
|
|
710
|
+
vTaken = step(0.5, iTaken);
|
|
564
711
|
p = glyphChairPosition(p, part, iGlyph);
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
p.xz *= 0.92 + 0.16 * fract(iSeed * 7.13);
|
|
575
|
-
// People only appear once they are large enough to read as people. At
|
|
576
|
-
// section/overview distance their tiny dark geometry aliases into radial
|
|
577
|
-
// streaks; seat dots already communicate held/booked state there.
|
|
578
|
-
p *= occupantWeight(depth);
|
|
579
|
-
}
|
|
712
|
+
// Armrest standards (see fixedRowSeating in seatInstances.ts). The mesh holds
|
|
713
|
+
// two, told apart by the side of x = 0 they are built on; each is recentred
|
|
714
|
+
// on its own axis here and stood at its world offset after the yaw below.
|
|
715
|
+
vec2 armrestAt = vec2(0.0);
|
|
716
|
+
if (part > 6.5 && part < 7.5) {
|
|
717
|
+
bool shared = position.x > 0.0;
|
|
718
|
+
armrestAt = shared ? iArmrests.xy : iArmrests.zw;
|
|
719
|
+
if (dot(armrestAt, armrestAt) <= 0.0) p = vec3(0.0);
|
|
720
|
+
else if (dot(p, p) > 0.0) p.x += shared ? -${st.toFixed(2)} : ${st.toFixed(2)};
|
|
580
721
|
}
|
|
722
|
+
if (iPhysicalSeat < 0.5) p = vec3(0.0); // sellable space, but no physical chair
|
|
581
723
|
float localHeight = p.y;
|
|
724
|
+
vLocal = p;
|
|
582
725
|
p.xz *= iRadius;
|
|
726
|
+
// A seat in a fixed row hangs between its armrest standards, as a real
|
|
727
|
+
// tip-up does: no post under the middle of it. An accessible seat keeps the
|
|
728
|
+
// pedestal, which is what carries its ring colour at close range.
|
|
729
|
+
if (part < 0.5 && iGlyph < 1.5 && dot(iArmrests, iArmrests) > 0.0 && dot(iRing, iRing) < 0.001) p = vec3(0.0);
|
|
730
|
+
// The pad of an empty tip-up seat stands folded against the back. Its height
|
|
731
|
+
// for the occlusion ramp is where it now stands, not where it lay.
|
|
732
|
+
bool padPart = part > 0.5 && part < 1.5;
|
|
733
|
+
if (padPart) { p = tipUpPad(p, iRadius, iTipUp); localHeight = p.y; }
|
|
583
734
|
// 2. Lean the back. Done here rather than in the base mesh so the lean is a
|
|
584
735
|
// real angle in METRES \u2014 baked into the mesh it would scale with the seat's
|
|
585
736
|
// width and the same chair would lean 20 degrees on a wide stadium row and
|
|
586
737
|
// 6 on a tight theatre one.
|
|
587
|
-
// Only the
|
|
588
|
-
// now also catches the occupant \u2014 leaning a person by the panel's rule would
|
|
589
|
-
// translate their head backwards by a rake measured from the panel's base.
|
|
738
|
+
// Only the back and the spine that carries it rake.
|
|
590
739
|
float resolvedRake = uBackRake * glyphBackRake(iGlyph);
|
|
591
|
-
|
|
740
|
+
// (And a leg, where it rises past the back's base: a dining chair's rear legs.)
|
|
741
|
+
float rake = ((part > 1.5 && part < 2.5) || (part > 4.5 && part < 6.5)) ? max(p.y - uBackBase, 0.0) * resolvedRake : 0.0;
|
|
592
742
|
p.z -= rake;
|
|
593
743
|
// Fixed-size detail swap: no miniature chair inside a larger fallback.
|
|
594
744
|
p *= step(0.01, w);
|
|
595
745
|
vChairWeight = w;
|
|
596
746
|
float c = cos(iYaw), s = sin(iYaw);
|
|
597
747
|
vec3 rp = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
748
|
+
// A collapsed armrest (p = 0) must stay collapsed, so the offset rides on w.
|
|
749
|
+
rp.xz += armrestAt * step(0.01, w) * step(0.0001, dot(p, p));
|
|
598
750
|
// Normals under the same two transforms, in reverse and inverted-transposed.
|
|
599
751
|
// The xz scale is non-uniform, so an axis-aligned normal does NOT survive it
|
|
600
752
|
// unchanged; and the rake is a shear, whose normal transform adds a y term.
|
|
601
753
|
// Skipping either lights the raked back as though it were still vertical.
|
|
602
754
|
vec3 n = vec3(normal.x / iRadius, normal.y, normal.z / iRadius);
|
|
603
|
-
if (part > 1.5 && part < 2.5) n.y += resolvedRake * n.z;
|
|
755
|
+
if ((part > 1.5 && part < 2.5) || (part > 5.5 && part < 6.5)) n.y += resolvedRake * n.z;
|
|
604
756
|
n = normalize(n);
|
|
757
|
+
if (padPart) n = tipUpNormal(n, iTipUp);
|
|
605
758
|
vec3 rn = vec3(n.x * c + n.z * s, n.y, -n.x * s + n.z * c);
|
|
606
759
|
vec4 mv = modelViewMatrix * vec4(iOffset + rp, 1.0);
|
|
607
760
|
vPosView = mv.xyz;
|
|
761
|
+
vViewWorld = cameraPosition - (iOffset + rp);
|
|
608
762
|
vNormalWorld = rn;
|
|
609
763
|
vNormalView = normalize(mat3(modelViewMatrix) * rn);
|
|
610
764
|
vColor = iColor;
|
|
611
|
-
// Occupant colour, resolved here so the fragment stage needs no extra
|
|
612
|
-
// varyings beyond this one. A person is NOT painted in the seat's state
|
|
613
|
-
// colour: a sold seat is red, and a hall of red people reads as a warning,
|
|
614
|
-
// not an audience. Hair/clothing for the body, a warm tone for the head,
|
|
615
|
-
// both varied by the same per-person hash.
|
|
616
|
-
float t = fract(iSeed * 3.71);
|
|
617
|
-
vec3 clothes = mix(vec3(0.18, 0.22, 0.30), vec3(0.42, 0.29, 0.34), t);
|
|
618
|
-
vec3 skin = mix(vec3(0.52, 0.38, 0.29), vec3(0.86, 0.70, 0.58), fract(iSeed * 11.3));
|
|
619
|
-
vOccupantTint = (part > 10.5) ? skin : clothes;
|
|
620
765
|
vPart = part;
|
|
621
766
|
vHeight = localHeight;
|
|
622
767
|
vRing = iRing;
|
|
623
768
|
vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
|
|
624
769
|
vSectionFade = (uFocusSection < -0.5 || abs(iSection - uFocusSection) < 0.5) ? 0.0 : 1.0;
|
|
625
770
|
gl_Position = projectionMatrix * mv;
|
|
626
|
-
}`,
|
|
771
|
+
}`,Qi=`#version 300 es
|
|
627
772
|
precision highp float;
|
|
628
773
|
in vec3 vColor;
|
|
629
774
|
in vec3 vNormalWorld;
|
|
@@ -634,10 +779,12 @@ in float vHeight;
|
|
|
634
779
|
in vec3 vRing;
|
|
635
780
|
in float vDim;
|
|
636
781
|
in float vSectionFade;
|
|
637
|
-
in float vOccupant;
|
|
638
|
-
in vec3 vOccupantTint;
|
|
639
782
|
in float vTaken;
|
|
783
|
+
in vec3 vLocal;
|
|
784
|
+
in vec3 vViewWorld;
|
|
640
785
|
uniform vec3 uKeyDir;
|
|
786
|
+
uniform vec3 uKeyColor; // the look's light, at the seats' share (looks.ts)
|
|
787
|
+
uniform vec3 uAmbientColor;
|
|
641
788
|
uniform vec3 uFadeColor;
|
|
642
789
|
uniform float uRoughness;
|
|
643
790
|
in float vChairWeight;
|
|
@@ -653,55 +800,68 @@ void main() {
|
|
|
653
800
|
vec3 fillDir = normalize(vec3(-uKeyDir.x, 0.25, -uKeyDir.z));
|
|
654
801
|
float fill = max(dot(N, fillDir), 0.0);
|
|
655
802
|
vec3 tint = vColor;
|
|
656
|
-
if (vOccupant > 0.5) tint = vOccupantTint;
|
|
657
|
-
// The crowd in taken seats is one crisp, dark tone, not the seat's muted
|
|
658
|
-
// grey: on a light venue that grey went pale, and the people read as soft
|
|
659
|
-
// grey blobs (owner, 2026-09-25: "not crisp"). Dark silhouettes with the rim
|
|
660
|
-
// below read as an audience at every distance; the head is a step lighter so
|
|
661
|
-
// it separates from the shoulders.
|
|
662
|
-
if (vOccupant > 0.5 && vTaken > 0.5) {
|
|
663
|
-
// A little per-person variety (the clothing hash), so a full stand reads
|
|
664
|
-
// as people and not as one moulded block.
|
|
665
|
-
float vary = dot(vOccupantTint, vec3(0.33)) - 0.3;
|
|
666
|
-
tint = (vPart > 10.5 ? vec3(0.31, 0.32, 0.36) : vec3(0.19, 0.22, 0.27)) + vary * 0.12;
|
|
667
|
-
}
|
|
668
803
|
// The accommodation ring, kept legible once the dot (which drew it) is gone:
|
|
669
804
|
// an accessible seat's support is painted in the ring colour, so the marker
|
|
670
805
|
// survives to close range instead of vanishing exactly when the buyer arrives.
|
|
671
806
|
float ringMask = step(0.001, dot(vRing, vRing));
|
|
672
807
|
float supportPart = max(1.0 - step(0.5, vPart),
|
|
673
808
|
step(4.5, vPart) * (1.0 - step(5.5, vPart)));
|
|
809
|
+
// The frame is a frame. The pedestal and legs were the upholstery's colour at
|
|
810
|
+
// half strength, so a red seat stood on a dark-red post and the whole chair
|
|
811
|
+
// read as one moulded block. Real seating is fabric on a graphite frame; the
|
|
812
|
+
// little tint that stays keeps the frame in the venue's light, not a cut-out.
|
|
813
|
+
// The spine (6) and the armrest standards (7) are frame as well.
|
|
814
|
+
float framePart = step(5.5, vPart) * (1.0 - step(7.5, vPart));
|
|
815
|
+
float frame = max(supportPart, framePart);
|
|
816
|
+
// An armrest takes none of its seat's colour: it is shared with the seat
|
|
817
|
+
// next door, which may be another colour.
|
|
818
|
+
float armrestPart = step(6.5, vPart) * (1.0 - step(7.5, vPart));
|
|
819
|
+
tint = mix(tint, mix(vec3(0.17, 0.18, 0.20), tint, 0.12 * (1.0 - armrestPart)) * 2.0, frame);
|
|
674
820
|
if (supportPart > 0.5 && ringMask > 0.5) tint = vRing;
|
|
675
821
|
// Tonal separation keeps the modular silhouettes readable without textures.
|
|
676
|
-
|
|
677
|
-
// of the pad's sheen, so a head does not read as a polished box.
|
|
678
|
-
float furnitureShade = vPart < 0.5 ? 0.50
|
|
822
|
+
float partShade = vPart < 0.5 ? 0.50
|
|
679
823
|
: (vPart < 1.5 ? 1.10
|
|
680
824
|
: (vPart < 2.5 ? 0.80
|
|
681
825
|
: (vPart < 3.5 ? 0.72
|
|
682
826
|
: (vPart < 4.5 ? 0.90 : 0.55))));
|
|
683
|
-
float partShade = vOccupant > 0.5 ? 0.95 : furnitureShade;
|
|
684
827
|
// Cheap vertical occlusion: a chair is in a dense row, so the closer a surface
|
|
685
828
|
// sits to the deck the less sky it can actually see. This is the depth cue \u2014
|
|
686
829
|
// without it the pad top, the back and the deck all resolve to the same flat
|
|
687
830
|
// value and the row loses its form entirely.
|
|
688
|
-
|
|
689
|
-
//
|
|
690
|
-
|
|
831
|
+
float ao = mix(0.58, 1.0, clamp(vHeight / 0.92, 0.0, 1.0));
|
|
832
|
+
// The crease. Where the back meets the pad neither can see the sky: the foot
|
|
833
|
+
// of the back and the rear of the pad darken toward the join. This is the
|
|
834
|
+
// line that makes two cushions read as one chair, and it is what the flat
|
|
835
|
+
// panels were missing most.
|
|
836
|
+
float padPart = step(0.5, vPart) * (1.0 - step(1.5, vPart));
|
|
837
|
+
float backPart = step(1.5, vPart) * (1.0 - step(2.5, vPart));
|
|
838
|
+
float crease = mix(1.0, mix(0.70, 1.0, smoothstep(-0.95, -0.15, vLocal.z)), padPart)
|
|
839
|
+
* mix(1.0, mix(0.74, 1.0, smoothstep(0.0, 0.20, vLocal.y - ${ke.toFixed(2)})), backPart);
|
|
840
|
+
// The seam. On a tight row neighbouring pads meet edge to edge, and without a
|
|
841
|
+
// line between them the row is one long bench. Each pad darkens toward its
|
|
842
|
+
// own sides, which draws that line whether or not there is a gap to see.
|
|
843
|
+
crease *= mix(1.0, mix(1.0, 0.72, smoothstep(0.58, 0.90, abs(vLocal.x))), padPart);
|
|
844
|
+
ao *= crease;
|
|
691
845
|
// Chairs follow the structure's balance (see SOLID_FRAG): more sun, less
|
|
692
846
|
// ambient, so seat pads, backs and arms separate instead of reading as one
|
|
693
847
|
// coloured mass.
|
|
694
|
-
vec3 base = tint * partShade * ao * (0.52 + 0.26 * hemi)
|
|
848
|
+
vec3 base = tint * (partShade * ao * (0.52 + 0.26 * hemi) * uAmbientColor + key * 0.40 * uKeyColor + fill * 0.14 * uAmbientColor);
|
|
695
849
|
float fres = pow(1.0 - max(dot(normalize(vNormalView), V), 0.0), 3.0);
|
|
696
850
|
// A restrained furniture rim keeps the low-poly edges from looking outlined.
|
|
697
|
-
// Occupant silhouettes retain their existing stronger separation.
|
|
698
851
|
float sheen = clamp((1.0 - uRoughness) / 0.22, 0.15, 2.0);
|
|
699
|
-
base += vec3(0.26, 0.31, 0.38) * fres *
|
|
700
|
-
//
|
|
701
|
-
//
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
852
|
+
base += vec3(0.26, 0.31, 0.38) * fres * 0.24 * sheen;
|
|
853
|
+
// A soft highlight where a cushion turns toward the light. Broad and weak:
|
|
854
|
+
// it is upholstery catching the sun, not a polished shell.
|
|
855
|
+
vec3 halfway = normalize(uKeyDir + normalize(vViewWorld));
|
|
856
|
+
float gloss = pow(max(dot(N, halfway), 0.0), 18.0) * (padPart + backPart);
|
|
857
|
+
base += (tint * 0.35 + vec3(0.10)) * gloss * 0.42 * clamp(sheen, 0.5, 1.5);
|
|
858
|
+
// Not for sale: the chair goes one muted grey, a step toward the venue. The
|
|
859
|
+
// chair's category tint made a taken seat look like any other at a glance
|
|
860
|
+
// (owner report, 2026-09-23); now only the seats a buyer can take wear full
|
|
861
|
+
// colour. With its pad down among folded neighbours, that grey IS the taken
|
|
862
|
+
// seat: no figure sits in it (owner, 2026-11-11).
|
|
863
|
+
// (Not the armrest: it is shared with the seat next door, which may be free.)
|
|
864
|
+
if (vTaken > 0.5 && armrestPart < 0.5) {
|
|
705
865
|
float takenLum = dot(base, vec3(0.299, 0.587, 0.114));
|
|
706
866
|
base = mix(vec3(takenLum), uFadeColor, 0.35) * 0.92;
|
|
707
867
|
}
|
|
@@ -712,45 +872,98 @@ void main() {
|
|
|
712
872
|
base = mix(base, mix(vec3(lum), vec3(0.93), 0.35), 0.45);
|
|
713
873
|
}
|
|
714
874
|
fragColor = vec4(base, 1.0);
|
|
715
|
-
}`,
|
|
875
|
+
}`,Ji=`#version 300 es
|
|
716
876
|
precision highp float;
|
|
717
877
|
in vec2 position;
|
|
718
878
|
out vec2 vUv;
|
|
719
879
|
void main() {
|
|
720
880
|
vUv = position * 0.5 + 0.5;
|
|
721
881
|
gl_Position = vec4(position, 0.999, 1.0);
|
|
722
|
-
}`,
|
|
882
|
+
}`,es=`#version 300 es
|
|
723
883
|
precision highp float;
|
|
724
884
|
in vec2 vUv;
|
|
725
|
-
|
|
726
|
-
uniform vec3 uBottom;
|
|
727
|
-
uniform float uSky; // 1 for an open-air venue, see SceneModel.outdoor
|
|
728
|
-
uniform vec3 uZenith;
|
|
729
|
-
uniform vec3 uHorizon;
|
|
885
|
+
${ur}
|
|
730
886
|
uniform mat4 uInvViewProj;
|
|
887
|
+
uniform float uHouse; // 1 for an indoor venue, see SceneModel.house
|
|
888
|
+
uniform vec4 uHouseShape; // the wall: centre x, centre z, half-width x, half-width z (world metres)
|
|
889
|
+
uniform vec2 uHouseLevels; // floor y, ceiling y
|
|
890
|
+
uniform vec3 uHouseCeiling;
|
|
891
|
+
uniform vec3 uHouseWall;
|
|
892
|
+
uniform vec3 uHouseLamp;
|
|
893
|
+
uniform vec3 uEye; // camera, world metres
|
|
731
894
|
out vec4 fragColor;
|
|
895
|
+
|
|
896
|
+
// One house light to a bay of the ceiling, and the bay's own width, metres.
|
|
897
|
+
const float HOUSE_BAY_M = 7.0;
|
|
898
|
+
const float HOUSE_LAMP_BAYS = 0.055; // lamp radius, in bays
|
|
899
|
+
const float HOUSE_COURSE_M = 3.2; // height of one course of wall panels
|
|
900
|
+
|
|
732
901
|
void main() {
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
// Above the horizon an open-air venue has a sky, not the chart's flat
|
|
738
|
-
// backdrop: from a seat, the stands used to meet a black void. Below the
|
|
739
|
-
// horizon (every overview) nothing changes.
|
|
740
|
-
if (uSky > 0.5) {
|
|
902
|
+
// This pixel's line of sight. A venue with neither a sky nor a room skips
|
|
903
|
+
// it: its backdrop is the flat gradient.
|
|
904
|
+
vec3 dir = vec3(0.0, -1.0, 0.0);
|
|
905
|
+
if (uSky > 0.5 || uHouse > 0.5) {
|
|
741
906
|
vec2 ndc = vUv * 2.0 - 1.0;
|
|
742
907
|
vec4 near = uInvViewProj * vec4(ndc, -1.0, 1.0);
|
|
743
908
|
vec4 far = uInvViewProj * vec4(ndc, 1.0, 1.0);
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
909
|
+
dir = normalize(far.xyz / far.w - near.xyz / near.w);
|
|
910
|
+
}
|
|
911
|
+
// The gradient and, for an open-air venue, the sky. A venue never has both
|
|
912
|
+
// a sky and a room, so the room below paints over the plain gradient.
|
|
913
|
+
vec3 col = backdrop(vUv, dir);
|
|
914
|
+
// An indoor venue has a room, not the chart's flat backdrop: from a seat the
|
|
915
|
+
// stands used to end in a void (see scene/model/house.ts). Painted here, so
|
|
916
|
+
// it is behind everything drawn. Only from inside the room and under its
|
|
917
|
+
// ceiling: every overview stands outside or above, and is unchanged.
|
|
918
|
+
if (uHouse > 0.5) {
|
|
919
|
+
// Where the line of sight would meet the ceiling, and where it would leave
|
|
920
|
+
// the elliptical wall. Worked out for every pixel before the branch on
|
|
921
|
+
// what it actually hits, so each pattern's pixel footprint (fwidth) is
|
|
922
|
+
// defined everywhere.
|
|
923
|
+
float headroom = uHouseLevels.y - uEye.y;
|
|
924
|
+
float tCeiling = headroom / max(dir.y, 1e-4);
|
|
925
|
+
vec2 onCeiling = uEye.xz + dir.xz * tCeiling - uHouseShape.xy;
|
|
926
|
+
vec2 bay = onCeiling / HOUSE_BAY_M;
|
|
927
|
+
float bayPixel = max(fwidth(bay.x), fwidth(bay.y)); // bays per pixel
|
|
928
|
+
vec2 eye = (uEye.xz - uHouseShape.xy) / uHouseShape.zw;
|
|
929
|
+
vec2 across = dir.xz / uHouseShape.zw;
|
|
930
|
+
float wa = dot(across, across), wb = dot(eye, across), wk = dot(eye, eye) - 1.0;
|
|
931
|
+
float tWall = wa > 1e-9 ? (-wb + sqrt(max(0.0, wb * wb - wa * wk))) / wa : 1e9;
|
|
932
|
+
float course = (uEye.y + dir.y * tWall - uHouseLevels.x) / HOUSE_COURSE_M;
|
|
933
|
+
float coursePixel = fwidth(course); // courses per pixel
|
|
934
|
+
float inside = smoothstep(0.0, 0.05, -wk) * smoothstep(0.0, 3.0, headroom);
|
|
935
|
+
if (inside > 0.0) {
|
|
936
|
+
if (dir.y > 1e-4 && tCeiling < tWall) {
|
|
937
|
+
// The ceiling: darker into the cove where it meets the wall, a faint
|
|
938
|
+
// line between bays, one house light to a bay. Far away, where a bay
|
|
939
|
+
// is a pixel or less, lamps and lines give way to their average.
|
|
940
|
+
float edge = length(onCeiling / uHouseShape.zw);
|
|
941
|
+
vec3 room = uHouseCeiling * mix(1.0, 0.7, smoothstep(0.5, 1.0, edge));
|
|
942
|
+
float detail = 1.0 - smoothstep(0.06, 0.3, bayPixel);
|
|
943
|
+
vec2 cell = fract(bay) - 0.5;
|
|
944
|
+
float r = length(cell);
|
|
945
|
+
float lamp = 1.0 - smoothstep(HOUSE_LAMP_BAYS - bayPixel, HOUSE_LAMP_BAYS + bayPixel, r);
|
|
946
|
+
float glow = exp(-r * r * 46.0);
|
|
947
|
+
vec2 toLine = 0.5 - abs(cell);
|
|
948
|
+
float line = 1.0 - smoothstep(0.012 - bayPixel, 0.012 + bayPixel, min(toLine.x, toLine.y));
|
|
949
|
+
// A joint is a shadow line: plain on a dark ceiling, slight on a pale one.
|
|
950
|
+
room *= 1.0 - mix(0.16, 0.05, dot(uHouseCeiling, vec3(0.2126, 0.7152, 0.0722))) * line * detail;
|
|
951
|
+
room += uHouseLamp * mix(0.05, lamp + 0.22 * glow, detail);
|
|
952
|
+
col = mix(col, room, inside);
|
|
953
|
+
} else {
|
|
954
|
+
// The wall, floor to ceiling: lit from the floor, darkening toward the
|
|
955
|
+
// cove, with the faint joint of each course of panels. Below the
|
|
956
|
+
// floor there is nothing to paint: the ground is drawn there.
|
|
957
|
+
float h = course * HOUSE_COURSE_M / max(1.0, uHouseLevels.y - uHouseLevels.x);
|
|
958
|
+
vec3 room = uHouseWall * mix(1.06, 0.6, smoothstep(0.3, 1.0, h));
|
|
959
|
+
float joint = 1.0 - smoothstep(0.014 - coursePixel, 0.014 + coursePixel, 0.5 - abs(fract(course) - 0.5));
|
|
960
|
+
room *= 1.0 - 0.14 * joint * (1.0 - smoothstep(0.08, 0.35, coursePixel));
|
|
961
|
+
col = mix(col, room, inside * smoothstep(-0.02, 0.0, h));
|
|
962
|
+
}
|
|
963
|
+
}
|
|
751
964
|
}
|
|
752
965
|
fragColor = vec4(col, 1.0);
|
|
753
|
-
}`,
|
|
966
|
+
}`,ts=`#version 300 es
|
|
754
967
|
precision highp float;
|
|
755
968
|
in float surface;
|
|
756
969
|
in float iYaw;
|
|
@@ -763,6 +976,7 @@ in vec3 iOffset;
|
|
|
763
976
|
in float iMaxRadius;
|
|
764
977
|
in float iHasChair;
|
|
765
978
|
in float iPhysicalSeat;
|
|
979
|
+
in float iTipUp;
|
|
766
980
|
in float iFloor;
|
|
767
981
|
uniform mat4 modelViewMatrix;
|
|
768
982
|
uniform mat4 projectionMatrix;
|
|
@@ -779,9 +993,9 @@ out float vDotWeight;
|
|
|
779
993
|
out float vHidden;
|
|
780
994
|
flat out vec3 vPick;
|
|
781
995
|
uniform vec3 cameraPosition;
|
|
782
|
-
${
|
|
783
|
-
${
|
|
784
|
-
${
|
|
996
|
+
${Lt}
|
|
997
|
+
${dr}
|
|
998
|
+
${tt}
|
|
785
999
|
void main() {
|
|
786
1000
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
787
1001
|
int id = gl_InstanceID + 1; // 0 reserved for no-hit
|
|
@@ -796,7 +1010,7 @@ void main() {
|
|
|
796
1010
|
vPhysicalSeat = iPhysicalSeat;
|
|
797
1011
|
vHidden = (uFocusFloor > -0.5 && abs(iFloor - uFocusFloor) > 0.5) ? 1.0 : 0.0;
|
|
798
1012
|
gl_Position = projectionMatrix * mv;
|
|
799
|
-
}`,
|
|
1013
|
+
}`,ns=`#version 300 es
|
|
800
1014
|
precision highp float;
|
|
801
1015
|
in vec2 vUv;
|
|
802
1016
|
in float vPhysicalSeat;
|
|
@@ -804,7 +1018,7 @@ in float vDotWeight;
|
|
|
804
1018
|
in float vHidden;
|
|
805
1019
|
flat in vec3 vPick;
|
|
806
1020
|
out vec4 fragColor;
|
|
807
|
-
${
|
|
1021
|
+
${hr}
|
|
808
1022
|
void main() {
|
|
809
1023
|
if (vHidden > 0.5) discard;
|
|
810
1024
|
if (vDotWeight <= 0.99) discard;
|
|
@@ -812,16 +1026,17 @@ void main() {
|
|
|
812
1026
|
float d = seatSilhouette(vUv, vPhysicalSeat);
|
|
813
1027
|
if (d > 1.0) discard; // hit-mask matches chair/bay shape
|
|
814
1028
|
fragColor = vec4(vPick, 1.0);
|
|
815
|
-
}`,
|
|
1029
|
+
}`,os=`#version 300 es
|
|
816
1030
|
precision highp float;
|
|
817
1031
|
in vec3 position;
|
|
818
1032
|
in float part;
|
|
819
1033
|
in vec3 iOffset;
|
|
820
1034
|
in float iRadius;
|
|
821
1035
|
in float iYaw;
|
|
822
|
-
in float iSeed;
|
|
823
1036
|
in float iPhysicalSeat;
|
|
824
1037
|
in float iGlyph;
|
|
1038
|
+
in vec4 iArmrests;
|
|
1039
|
+
in float iTipUp;
|
|
825
1040
|
in float iPickIndex;
|
|
826
1041
|
in float iFloor;
|
|
827
1042
|
uniform mat4 modelViewMatrix;
|
|
@@ -835,10 +1050,10 @@ flat out vec3 vPick;
|
|
|
835
1050
|
out float vChairWeight;
|
|
836
1051
|
out float vHidden;
|
|
837
1052
|
uniform vec3 cameraPosition;
|
|
838
|
-
${
|
|
839
|
-
${
|
|
840
|
-
${
|
|
841
|
-
${
|
|
1053
|
+
${Lt}
|
|
1054
|
+
${Pn}
|
|
1055
|
+
${An}
|
|
1056
|
+
${tt}
|
|
842
1057
|
void main() {
|
|
843
1058
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
844
1059
|
int id = int(iPickIndex + 0.5); // already global index + 1
|
|
@@ -849,22 +1064,21 @@ void main() {
|
|
|
849
1064
|
float depth = max(viewDepth, 0.001);
|
|
850
1065
|
float w = viewDepth > 0.05 ? chairWeight(length(anchor.xyz)) : 0.0;
|
|
851
1066
|
vec3 p = position;
|
|
852
|
-
float occupant = step(9.5, part);
|
|
853
|
-
float taken = step(0.0, iSeed);
|
|
854
1067
|
p = glyphChairPosition(p, part, iGlyph);
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
}
|
|
1068
|
+
// Armrest standards (see fixedRowSeating in seatInstances.ts). The mesh holds
|
|
1069
|
+
// two, told apart by the side of x = 0 they are built on; each is recentred
|
|
1070
|
+
// on its own axis here and stood at its world offset after the yaw below.
|
|
1071
|
+
vec2 armrestAt = vec2(0.0);
|
|
1072
|
+
if (part > 6.5 && part < 7.5) {
|
|
1073
|
+
bool shared = position.x > 0.0;
|
|
1074
|
+
armrestAt = shared ? iArmrests.xy : iArmrests.zw;
|
|
1075
|
+
if (dot(armrestAt, armrestAt) <= 0.0) p = vec3(0.0);
|
|
1076
|
+
else if (dot(p, p) > 0.0) p.x += shared ? -${st.toFixed(2)} : ${st.toFixed(2)};
|
|
865
1077
|
}
|
|
1078
|
+
if (iPhysicalSeat < 0.5) p = vec3(0.0);
|
|
866
1079
|
p.xz *= iRadius;
|
|
867
|
-
|
|
1080
|
+
if (part > 0.5 && part < 1.5) p = tipUpPad(p, iRadius, iTipUp);
|
|
1081
|
+
float rake = ((part > 1.5 && part < 2.5) || (part > 4.5 && part < 6.5))
|
|
868
1082
|
? max(p.y - uBackBase, 0.0) * uBackRake * glyphBackRake(iGlyph)
|
|
869
1083
|
: 0.0;
|
|
870
1084
|
p.z -= rake;
|
|
@@ -872,8 +1086,10 @@ void main() {
|
|
|
872
1086
|
vChairWeight = w;
|
|
873
1087
|
float c = cos(iYaw), s = sin(iYaw);
|
|
874
1088
|
vec3 rp = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
1089
|
+
// A collapsed armrest (p = 0) must stay collapsed, so the offset rides on w.
|
|
1090
|
+
rp.xz += armrestAt * step(0.01, w) * step(0.0001, dot(p, p));
|
|
875
1091
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(iOffset + rp, 1.0);
|
|
876
|
-
}`,
|
|
1092
|
+
}`,rs=`#version 300 es
|
|
877
1093
|
precision highp float;
|
|
878
1094
|
flat in vec3 vPick;
|
|
879
1095
|
in float vHidden;
|
|
@@ -883,7 +1099,7 @@ void main() {
|
|
|
883
1099
|
if (vHidden > 0.5) discard;
|
|
884
1100
|
if (vChairWeight < 0.01) discard;
|
|
885
1101
|
fragColor = vec4(vPick, 1.0);
|
|
886
|
-
}`,
|
|
1102
|
+
}`,as=`#version 300 es
|
|
887
1103
|
precision highp float;
|
|
888
1104
|
in vec3 position;
|
|
889
1105
|
in vec3 normal;
|
|
@@ -903,7 +1119,7 @@ void main() {
|
|
|
903
1119
|
vNormalWorld = mat3(modelMatrix) * normal;
|
|
904
1120
|
vPosWorld = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
905
1121
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
906
|
-
}`,
|
|
1122
|
+
}`,is=`#version 300 es
|
|
907
1123
|
precision highp float;
|
|
908
1124
|
in float vHidden;
|
|
909
1125
|
in float vMaterial;
|
|
@@ -912,14 +1128,18 @@ in vec3 vPosWorld;
|
|
|
912
1128
|
uniform vec3 cameraPosition;
|
|
913
1129
|
uniform vec2 uRoomCentre;
|
|
914
1130
|
out vec4 fragColor;
|
|
915
|
-
${
|
|
916
|
-
${
|
|
1131
|
+
${cr}
|
|
1132
|
+
${tt}
|
|
917
1133
|
void main() {
|
|
918
1134
|
if (vHidden > 0.5) discard;
|
|
919
1135
|
if (roomWallHidden(vMaterial, vNormalWorld, vPosWorld, cameraPosition, uRoomCentre)) discard;
|
|
920
1136
|
if (seeThroughCut(vPosWorld, cameraPosition)) discard;
|
|
1137
|
+
// Nets and slender fittings (materials 10 and 11) never swallow a tap: a
|
|
1138
|
+
// buyer behind the goal picks a seat through the net. Nor does stage light
|
|
1139
|
+
// (12), which from behind is not there at all.
|
|
1140
|
+
if (vMaterial > 9.5 && vMaterial < 12.5) discard;
|
|
921
1141
|
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
922
|
-
}`;function
|
|
1142
|
+
}`;function mr(t){return new Ue(t,{vertex:ts,fragment:ns,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uSeatRadius:{value:lt},uSeatScale:{value:1},uMinPixels:{value:Ze},uPixelToWorld:{value:.002},uChairFull:{value:ht},uChairNone:{value:Qe},uFocusFloor:{value:-1}}})}function pr(t){return new Ue(t,{vertex:os,fragment:rs,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uChairFull:{value:ht},uChairNone:{value:Qe},uBackRake:{value:it},uBackBase:{value:ke},uFocusFloor:{value:-1}}})}function fr(t){return new Ue(t,{vertex:as,fragment:is,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 vr(t,e=.78,n=[.63,.66,.65]){return new Ue(t,{vertex:Xi,fragment:qi,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uKeyColor:{value:new Float32Array([1,1,1])},uAmbientColor:{value:new Float32Array([1,1,1])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uDeckColor:{value:new Float32Array(n)},uSectionFilter:{value:0},uRoughness:{value:e},uRoomCentre:{value:new Float32Array([0,0])},uViewport:{value:new Float32Array([1,1])},uTop:{value:new Float32Array([0,0,0])},uBottom:{value:new Float32Array([0,0,0])},uSky:{value:0},uZenith:{value:new Float32Array([0,0,0])},uHorizon:{value:new Float32Array([0,0,0])}}})}function br(t){return new Ue(t,{vertex:ji,fragment:Ki,transparent:!0,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uKeyColor:{value:new Float32Array([1,1,1])},uAmbientColor:{value:new Float32Array([1,1,1])},uSeatRadius:{value:lt},uSeatScale:{value:1},uMinPixels:{value:Ze},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFocusSection:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:ht},uChairNone:{value:Qe}}})}function gr(t,e=.78){return new Ue(t,{vertex:Zi,fragment:Qi,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uKeyColor:{value:new Float32Array([1,1,1])},uAmbientColor:{value:new Float32Array([1,1,1])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:ht},uChairNone:{value:Qe},uBackRake:{value:it},uBackBase:{value:ke},uFocusFloor:{value:-1},uFocusSection:{value:-1},uRoughness:{value:e}}})}function yr(t,e,n,r,a){return new Ue(t,{vertex:Ji,fragment:es,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)},uHouse:{value:a?1:0},uHouseShape:{value:new Float32Array(a?[...a.centre,...a.radii]:[0,0,1,1])},uHouseLevels:{value:new Float32Array(a?[a.floorY,a.ceilingY]:[0,1])},uHouseCeiling:{value:new Float32Array(a?.ceiling??[0,0,0])},uHouseWall:{value:new Float32Array(a?.wall??[0,0,0])},uHouseLamp:{value:new Float32Array(a?.lamp??[0,0,0])},uEye:{value:new Float32Array(3)}}})}import{Camera as ss,Mat4 as ls,Mesh as xr,Program as wr,RenderTarget as cs,Transform as us}from"ogl";var ds=45,hs=.16;function Sr(t,e,n,r){let a=Math.max(3,n.radius*1.04),o=t.getParameter(t.MAX_TEXTURE_SIZE),i=a<=ds||o<2048?1024:2048,s=!!r&&2*a/i<=hs,[l,c,f]=n.center,m=new ss(t,{left:-a,right:a,bottom:-a,top:a,near:.1,far:a*6});m.position.set(l-a*1.44,c+a*2.34,f+a*1.2),m.lookAt([l,c,f]);let u=new cs(t,{width:i,height:i,depthTexture:!0,minFilter:t.NEAREST,magFilter:t.NEAREST}),d=new wr(t,{cullFace:!1,vertex:`#version 300 es
|
|
923
1143
|
in vec3 position;
|
|
924
1144
|
in float materialIndex;
|
|
925
1145
|
uniform mat4 modelViewMatrix;
|
|
@@ -930,9 +1150,30 @@ void main() {
|
|
|
930
1150
|
in float vMaterial;
|
|
931
1151
|
out vec4 fragColor;
|
|
932
1152
|
void main() {
|
|
933
|
-
|
|
1153
|
+
// ...nor do nets and slender sport fittings (10, 11): a net is mostly air.
|
|
1154
|
+
if (abs(vMaterial - 6.0) < 0.5 || (vMaterial > 9.5 && vMaterial < 12.5)) discard;
|
|
934
1155
|
fragColor = vec4(1.0);
|
|
935
|
-
}`}),
|
|
1156
|
+
}`}),h=new us,y=new xr(t,{geometry:e,program:d});y.frustumCulled=!1,y.setParent(h);let v=s?new wr(t,{cullFace:!1,vertex:`#version 300 es
|
|
1157
|
+
in vec3 position;
|
|
1158
|
+
in float surface;
|
|
1159
|
+
in vec3 iOffset;
|
|
1160
|
+
in float iYaw;
|
|
1161
|
+
in float iChairWidth;
|
|
1162
|
+
in float iPhysicalSeat;
|
|
1163
|
+
uniform mat4 modelViewMatrix;
|
|
1164
|
+
uniform mat4 projectionMatrix;
|
|
1165
|
+
void main() {
|
|
1166
|
+
if (iPhysicalSeat < 0.5 || surface < 0.5) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
1167
|
+
vec3 p = position;
|
|
1168
|
+
if (surface < 1.5 && p.y < 0.40) p.y = 0.02;
|
|
1169
|
+
p.xz *= iChairWidth;
|
|
1170
|
+
float c = cos(iYaw), s = sin(iYaw);
|
|
1171
|
+
vec3 rotated = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
1172
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(iOffset + rotated, 1.0);
|
|
1173
|
+
}`,fragment:`#version 300 es
|
|
1174
|
+
precision highp float;
|
|
1175
|
+
out vec4 fragColor;
|
|
1176
|
+
void main() { fragColor = vec4(1.0); }`}):null;if(v&&r){let F=new xr(t,{geometry:r,program:v});F.frustumCulled=!1,F.setParent(h)}let x=t.getParameter(t.COLOR_CLEAR_VALUE),T=t.isEnabled(t.DITHER);try{t.disable(t.DITHER),t.clearColor(1,1,1,1),t.renderer.render({scene:h,camera:m,target:u})}finally{T&&t.enable(t.DITHER),t.clearColor(x[0],x[1],x[2],x[3]),d.remove(),v?.remove()}let A=new ls().multiply(m.projectionMatrix,m.viewMatrix);return{texture:u.depthTexture,matrix:A,seatsCast:s,dispose(){for(let F of u.textures)t.deleteTexture(F.texture);t.deleteTexture(u.depthTexture.texture),t.deleteFramebuffer(u.buffer),u.depthBuffer&&t.deleteRenderbuffer(u.depthBuffer)}}}var ms=.65,ps=new Set(["dimmed","sold","held"]);function Mr(t,e,n){let r=new Set,a=!1;for(let o of t){let i=e.get(o.sectionId);if(!i||!i.length){r.add(o.sectionId);continue}let s=!1;for(let l of i){let c=Se[n[l]]??"available";if(!ps.has(c)){s=!0;break}}s?r.add(o.sectionId):a=!0}return{lit:r,anyUnlit:a}}function Ar(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 f=s.start*3;f<c;f++)e[f]=l?n[f]:n[f]+(o[f%3]-n[f])*ms;i.push(s)}return i}var bs=Se.map(t=>t==="available"||t==="dimmed"),Er=Se.indexOf("selected");function gs(t,e){return[0,1,2].map(n=>t[n]*.15+.75+e[n]*.1)}function Cr(t,e,n,r,a,o){for(let i=n;i<n+r;i++){let s=o&&e[i]===0,l=o&&e[i]===Er?gs([o[i*3],o[i*3+1],o[i*3+2]],a[Er]??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 ys=new Float32Array([-1,-1,3,-1,-1,3]);function Tr(t,e){let n=new Pr,r=new Pr,a=new vt(t,{position:{size:2,data:ys}}),o=yr(t,e.theme.background.top,e.theme.background.bottom,e.outdoor?e.theme.sky:null,e.house&&e.theme.house?{...e.house,...e.theme.house}:null),i=new bt(t,{geometry:a,program:o});i.frustumCulled=!1,i.setParent(r);let s=new vt(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=vr(t,e.theme.materials.roughness,e.theme.structure.tierTop);e.room&&l.uniforms.uRoomCentre.value.set(e.room.centre);for(let L of["uTop","uBottom","uSky","uZenith","uHorizon"])l.uniforms[L]=o.uniforms[L];let c=new bt(t,{geometry:s,program:l});c.frustumCulled=!1,c.setParent(n);let f=br(t),m=new Float32Array(e.seats.count*3),u=Se.map(L=>e.theme.seatStates[L]),d=e.seats.iCategory.slice(),h=xo(e.theme.structure);for(let L=0;L<e.seats.count;L++){if(e.seats.iPhysicalSeat[L]<.5)continue;let Y=e.theme.materials.seat??wo([d[L*3],d[L*3+1],d[L*3+2]],h);d.set(Y,L*3)}Cr(m,e.seats.iState,0,e.seats.count,u,d);let y=No(),v=new Uint8Array(e.seats.count),x=new Uint8Array(e.seats.count);for(let L=0;L<e.seats.count;L++){let Y=e.seats.iArmrests[L*4]!==0||e.seats.iArmrests[L*4+1]!==0;x[L]=Y&&e.seats.iPhysicalSeat[L]>=.5&&e.seats.iGlyph[L]<1.5?1:0}let T=new Float32Array(e.seats.count),A=(L,Y)=>{for(let J=L;J<L+Y;J++)T[J]=x[J]&&bs[e.seats.iState[J]]?1:0};A(0,e.seats.count);let F=new vt(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:m,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},iTipUp:{size:1,data:T,usage:t.DYNAMIC_DRAW,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}}),S=new bt(t,{geometry:F,program:f});S.frustumCulled=!1,e.seats.count>0&&S.setParent(n);let _=Sr(t,s,e.renderBounds,e.seats.count>0?F:null);l.uniforms.tVenueShadow={value:_.texture},l.uniforms.uShadowMatrix={value:_.matrix};let V=F.attributes.iColor,g=e.solids.color.slice(),D=e.theme.structure.ground,w=new Map(e.sectionSolidRanges.map(L=>[L.sectionId,!0])),I=go(),N=gr(t,e.theme.materials.roughness),P=Dt,O=new Float32Array(P*3),G=new Float32Array(P*3),U=new Float32Array(P),B=new Float32Array(P),H=new Float32Array(P),ee=new Float32Array(P*3),K=new Float32Array(P),te=new Float32Array(P),R=new Float32Array(P),M=new Float32Array(P*4),q=new Float32Array(P),$=new Float32Array(P),oe=new Float32Array(P),Q=new vt(t,{position:{size:3,data:I.position},normal:{size:3,data:I.normal},part:{size:1,data:I.part},index:{data:I.index},iOffset:{size:3,data:O,instanced:1},iColor:{size:3,data:G,instanced:1},iRadius:{size:1,data:U,instanced:1},iYaw:{size:1,data:B,instanced:1},iGlyph:{size:1,data:H,instanced:1},iRing:{size:3,data:ee,instanced:1},iFloor:{size:1,data:K,instanced:1},iSection:{size:1,data:te,instanced:1},iPhysicalSeat:{size:1,data:R,instanced:1},iArmrests:{size:4,data:M,instanced:1},iTipUp:{size:1,data:q,instanced:1},iTaken:{size:1,data:oe,instanced:1},iPickIndex:{size:1,data:$,instanced:1}}),C=L=>L.map(Y=>1+(Y-1)*Mo);l.uniforms.uKeyColor.value.set(e.theme.light.key),l.uniforms.uAmbientColor.value.set(e.theme.light.ambient);for(let L of[f,N])L.uniforms.uKeyColor.value.set(C(e.theme.light.key)),L.uniforms.uAmbientColor.value.set(C(e.theme.light.ambient));let me=new bt(t,{geometry:Q,program:N});me.frustumCulled=!1;let ie=0,ye=!1,xe=!1,Me=null,le=null,_e=null,Fe=new Int32Array(0),ae=()=>{let L=e.seats;for(let Y=0;Y<ie;Y++){let J=Fe[Y];oe[Y]=So(L.iState[J]),q[Y]=T[J],G[Y*3]=m[J*3],G[Y*3+1]=m[J*3+1],G[Y*3+2]=m[J*3+2]}Q.attributes.iColor.needsUpdate=!0,Q.attributes.iTipUp.needsUpdate=!0,Q.attributes.iTaken.needsUpdate=!0},Ee={main:n,background:r,backgroundProgram:o,seatProgram:f,solidProgram:l,chairProgram:N,seatGeometry:F,chairGeometry:Q,solidGeometry:s,drawCalls:3,setNearSeats(L,Y){let J=Math.min(Y,P,L.length);if(lr(v,L,J),F.attributes.iHasChair.needsUpdate=!0,Fe=L,ie=J,J===0){me.parent&&me.setParent(null),Q.instancedCount=0,Ee.drawCalls=3+(ye?1:0);return}let X=e.seats;for(let ne=0;ne<J;ne++){let se=L[ne];O[ne*3]=X.iPosition[se*3],O[ne*3+1]=X.iPosition[se*3+1],O[ne*3+2]=X.iPosition[se*3+2],U[ne]=X.iChairWidth[se],B[ne]=X.iYaw[se],H[ne]=X.iGlyph[se],ee[ne*3]=X.iRing[se*3],ee[ne*3+1]=X.iRing[se*3+1],ee[ne*3+2]=X.iRing[se*3+2],K[ne]=X.iFloor[se],te[ne]=X.iSection[se],R[ne]=X.iPhysicalSeat[se],M.set(X.iArmrests.subarray(se*4,se*4+4),ne*4),$[ne]=se+1}ae(),Q.attributes.iOffset.needsUpdate=!0,Q.attributes.iRadius.needsUpdate=!0,Q.attributes.iYaw.needsUpdate=!0,Q.attributes.iGlyph.needsUpdate=!0,Q.attributes.iRing.needsUpdate=!0,Q.attributes.iFloor.needsUpdate=!0,Q.attributes.iSection.needsUpdate=!0,Q.attributes.iPhysicalSeat.needsUpdate=!0,Q.attributes.iArmrests.needsUpdate=!0,Q.attributes.iTaken.needsUpdate=!0,Q.attributes.iPickIndex.needsUpdate=!0,Q.instancedCount=J,me.parent||me.setParent(n),Ee.drawCalls=4+(ye?1:0)},nearSeatCount(){return ie},setSectionShellLit(L){l.uniforms.uSectionFilter.value=L===null?0:1;let Y=Ar(e.sectionSolidRanges,e.solids.color,g,w,L,D);if(!Y.length)return;let J=s.attributes.color,X=J.buffer;if(!X){J.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,X);for(let ne of Y){let se=e.solids.color.subarray(ne.start*3,(ne.start+ne.count)*3);t.bufferSubData(t.ARRAY_BUFFER,ne.start*3*Float32Array.BYTES_PER_ELEMENT,se)}},uploadSeatStateRuns(L){if(!L.length)return;for(let X of L)A(X.start,X.length);let Y=F.attributes.iTipUp;if(!Y.buffer)Y.needsUpdate=!0;else{t.bindBuffer(t.ARRAY_BUFFER,Y.buffer);for(let X of L)t.bufferSubData(t.ARRAY_BUFFER,X.start*Float32Array.BYTES_PER_ELEMENT,T.subarray(X.start,X.start+X.length))}for(let X of L)Cr(m,e.seats.iState,X.start,X.length,u,d);ie&&ae();let J=V.buffer;if(!J){V.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,J);for(let X of L){let ne=m.subarray(X.start*3,(X.start+X.length)*3);t.bufferSubData(t.ARRAY_BUFFER,X.start*3*Float32Array.BYTES_PER_ELEMENT,ne)}},dispose(){xe=!0,_.dispose(),a.remove(),o.remove(),s.remove(),l.remove(),F.remove(),f.remove(),Q.remove(),N.remove(),Me?.remove(),le?.remove(),_e?.texture&&t.deleteTexture(_e.texture)}},Ie=e.productionElements.find(L=>L.contentImageUrl&&L.contentPlane);if(Ie?.contentImageUrl&&Ie.contentPlane?.length===4&&typeof Image<"u"){let L=new Image;L.crossOrigin="anonymous",L.onload=()=>{if(xe)return;let Y=Ie.contentPlane;Me=new vt(t,{position:{size:3,data:new Float32Array(Y.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill(Ie.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),_e=new vs(t,{image:L,generateMipmaps:!0,wrapS:t.CLAMP_TO_EDGE,wrapT:t.CLAMP_TO_EDGE,flipY:!1}),le=new fs(t,{vertex:`#version 300 es
|
|
936
1177
|
precision highp float;
|
|
937
1178
|
in vec3 position; in vec2 uv; in float floorIndex;
|
|
938
1179
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform float uFocusFloor;
|
|
@@ -940,4 +1181,4 @@ void main() {
|
|
|
940
1181
|
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
|
|
941
1182
|
precision highp float;
|
|
942
1183
|
in vec2 vUv; in float vDim; uniform sampler2D uImage; out vec4 fragColor;
|
|
943
|
-
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:he},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let q=new ct(t,{geometry:ge,program:ce});q.frustumCulled=!1,q.setParent(n),pe.screenProgram=ce,Y=!0,pe.drawCalls=3+(S?1:0)+1},U.src=$.contentImageUrl}return pe}import{Mesh as mn,RenderTarget as Wi,Transform as hn}from"ogl";function Bi(t,e,n){let r=t+(e<<8)+(n<<16);return r===0?-1:r-1}function lr(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 f=(l*e+c)*4,p=Bi(t[f],t[f+1],t[f+2]);if(p<0||p>=o)continue;let u=c-r,m=l-a,d=u*u+m*m;d<s&&(s=d,i=p)}return i}function cr(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 Ui=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],Et=class{constructor(e,n,r,a,o){this.seatScene=new hn;this.chairScene=new hn;this.solidScene=new hn;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=o,this.seatProg=jo(this.gl),this.chairProg=$o(this.gl),this.depthProg=Ko(this.gl);let i=new mn(this.gl,{geometry:n,program:this.seatProg});i.frustumCulled=!1,i.setParent(this.seatScene);let s=new mn(this.gl,{geometry:r,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let l=new mn(this.gl,{geometry:a,program:this.depthProg});l.frustumCulled=!1,l.setParent(this.solidScene)}setRoomCentre(e){this.depthProg.uniforms.uRoomCentre.value.set(e??[0,0])}setRestoreClear(e){this.restoreClear=[e[0],e[1],e[2]]}syncFromSeatProgram(e){for(let a of Ui)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 Wi(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),f=Math.max(0,r-a),p=Math.max(1,Math.min(s,n+a+1)-c),u=Math.max(1,Math.min(l,r+a+1)-f);o.enable(o.SCISSOR_TEST),o.scissor(c,f,p,u);let[m,d,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(m,d,y,1),o.disable(o.SCISSOR_TEST);let v=new Uint8Array(p*u*4);return this.renderer.bindFramebuffer(i),o.readPixels(c,f,p,u,o.RGBA,o.UNSIGNED_BYTE,v),this.renderer.bindFramebuffer(),lr(v,p,u,n-c,r-f,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function ur(t,e){let n=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,Qn(r.state)):n.push(r);return n}function dr(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:Se[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 ut,Vec3 as qi}from"ogl";function Yi(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function mr(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function Xi(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function hr(t){let e=Math.hypot(t[0],t[1],t[2]);return e>1e-6?[t[0]/e,t[1]/e,t[2]/e]:[0,0,0]}function pn(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function fn(t,e){return Math.max(0,Math.min(1,t+e))}function pr(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],f=t[Math.min(n-1,o+2)],p=i*i,u=p*i,m=[0,0,0];for(let d=0;d<3;d++)m[d]=.5*(2*l[d]+(-s[d]+c[d])*i+(2*s[d]-5*l[d]+4*c[d]-f[d])*p+(-s[d]+3*l[d]-3*c[d]+f[d])*u);return m}function vn(t,e,n,r,a){let o=hr(Yi(e,n));o[0]===0&&o[1]===0&&o[2]===0&&(o=[0,0,1]);let i=mr(mr(e,Xi(o,2.5)),[0,1.5,0]),s=[e[0]-r[0],0,e[2]-r[2]],l=hr(s);l[0]===0&&l[2]===0&&(l=[o[0],0,o[2]]);let c=Math.max(1,a),f=[r[0]+l[0]*c*1.3,r[1]+c*.75,r[2]+l[2]*c*1.3];return{waypoints:[t,f,i],finalPos:i}}function bn(t,e,n=35,r=28){let a=pn(e),o=pr(t,a),i=pn(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:o,fov:n+(r-n)*i,eased:a}}function gr(t,e,n){let r=t.position.clone(),a=new ut().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new qi(n[0],n[1],n[2]));let o=new ut().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(a),o}var Tt=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new ut;this.endQuat=new ut;this.outQuat=new ut;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=e}start(e,n,r,a=2500,o=28){return this.settle(),this.waypoints=e,this.startQuat.copy(n),this.endQuat.copy(r),this.duration=a,this.endFov=o,this.startTime=performance.now(),this.active=!0,new Promise(i=>{this.resolveFn=i})}update(e){if(!this.active)return!1;let n=Math.min(1,(e-this.startTime)/this.duration),{pos:r,fov:a,eased:o}=bn(this.waypoints,n,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,fn(o,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=a,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let e=this.resolveFn;this.resolveFn=null,e&&e()}};var yr=$n,ji=.12,$i=1.6,xr=.12;function Sr(t,e,n){let r=t[e*3],a=t[e*3+1],o=t[e*3+2],i=n[0]-r,s=n[2]-o,l=Math.hypot(i,s);if(!(l>.001))return null;let c=i/l,f=s/l,p=1/0,u=null;for(let m=0;m*3<t.length;m++){if(m===e)continue;let d=t[m*3]-r,y=t[m*3+2]-o,v=d*c+y*f;v<.3||v>1.6||Math.abs(d*f-y*c)>.6||v<p&&(p=v,u=a-t[m*3+1])}return u}var Ki=.25,Qi=1.5;function wr(t,e,n=0,r,a,o=!1){let i=[e.x*ze,n+Qi,e.y*ze],s=a?[a[0],a[1],a[2]]:i,l=t[1],c=Number.isFinite(l)?l+(o?$i:yr):Number.isFinite(r)?n+r:n+yr,f=i[0]-t[0],p=i[2]-t[2],u=Math.hypot(f,p),m=u>.001?Math.min(ji,u*Ki):0,d=u>.001?f/u:0,y=u>.001?p/u:0;return{eye:[t[0]+d*m,c,t[2]+y*m],focal:s}}var Ee=Math.PI/180,Zi=45,gn=80,Rt=70,Ji=1,es=.99;function ts(t,e){if(!(t<Ji))return gn;if(!(Number.isFinite(e)&&e>0))return Rt;let n=2*Math.atan(e/(2*_t*es)/Math.max(.05,t))/Ee;return Math.max(Rt,Math.min(gn,n))}var ns=.25,_t=1,os=.25,rs=12*Ee,as=.2,is=1.5,Mr=.8,Ar=6,_r=1.9,ss=2/3,ls=.12,cs=.9,us=1.2,ds=2,Ir=.05,ms=6;function Dr(t,e,n=0){if(!t.length)return{min:[e[0]-6,n,e[2]-6],max:[e[0]+6,Math.max(n+Mr,e[1]),e[2]+6]};let r=1/0,a=-1/0,o=1/0,i=-1/0,s=n;for(let d of t)r=Math.min(r,d.cx-d.halfX),a=Math.max(a,d.cx+d.halfX),o=Math.min(o,d.cz-d.halfZ),i=Math.max(i,d.cz+d.halfZ),s=Math.max(s,d.y);let l=a-r,c=i-o,f=Math.max(l,Math.min(c,Ar))/2,p=Math.max(c,Math.min(l,Ar))/2,u=(r+a)/2,m=(o+i)/2;return{min:[u-f,n,m-p],max:[u+f,Math.max(n+Mr,s),m+p]}}function hs(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+_r,t.max[2]]}}function yn(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+is,e+as,e+_r*ss),(t.min[2]+t.max[2])/2]}function Fr(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 Pr(t,e,n){let r=e[0]-t[0],a=e[1]-t[1],o=e[2]-t[2],i=Math.hypot(r,a,o)||1;r/=i,a/=i,o/=i;let s=-o,l=r,c=Math.hypot(s,l);if(c<1e-6)return 1/0;s/=c,l/=c;let f=1/0,p=-1/0;for(let u=0;u<8;u++){let m=(u&1?n.max[0]:n.min[0])-t[0],d=(u&2?n.max[1]:n.min[1])-t[1],y=(u&4?n.max[2]:n.min[2])-t[2],v=Math.max(Ir,m*r+d*a+y*o),w=(m*s+y*l)/v;w<f&&(f=w),w>p&&(p=w)}return p-f}function Cr(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 f=-l*a,p=l*r-s*o,u=s*a,m=1/0,d=-1/0;for(let y=0;y<8;y++){let v=(y&1?n.max[0]:n.min[0])-t[0],w=(y&2?n.max[1]:n.min[1])-t[1],E=(y&4?n.max[2]:n.min[2])-t[2],C=Math.max(Ir,v*r+w*a+E*o),D=(v*f+w*p+E*u)/C;D<m&&(m=D),D>d&&(d=D)}return d-m}function It(t,e){return Math.tan(t*Ee/2)*Math.max(.05,e)}function Er(t,e,n){let r=ts(n,t),a=l=>Math.max(Zi,Math.min(r,l)),o=l=>2*Math.atan(l)/Ee,i=Number.isFinite(t)&&t>0?a(o(t/(2*ns)/Math.max(.05,n))):r;if(!(Number.isFinite(e)&&e>0))return i;let s=Math.min(i,a(o(e/(2*ls))));return t/(2*It(s,n))>_t?i:s}function kr(t,e,n,r={}){let a=yn(e),o=[t[0],t[1],t[2]],i=0,s=0,l=d=>{if(!(d>0))return;let y=Fr(o,a);o[0]+=y.x*d,o[2]+=y.z*d,s+=d},c=r.preserveEye?0:e.max[1]+os-o[1];c>0&&(o[1]+=c,i=c,l(c/Math.tan(rs)));let f=hs(e),p=Pr(o,a,e),u=Er(p,Cr(o,a,f),n),m=p/(2*It(u,n));for(let d=0;!r.preserveEye&&d<ms&&m>_t;d++){let y=Math.max(1,Math.hypot(o[0]-a[0],o[2]-a[2])),v=Number.isFinite(m)?m/_t:2;l(Math.min(60,y*(Math.min(4,v)-1)+.5)),p=Pr(o,a,e),u=Er(p,Cr(o,a,f),n),m=p/(2*It(u,n))}return{eye:o,focal:a,fov:u,raisedM:i,pulledBackM:s,stageFrameWidth:m}}function ps(t,e,n){let r=Math.tan(e*Ee/2),a=It(e,n);return Math.max(1,t/Math.max(.05,Math.min(r,a)))}var fs=.7,Tr=.5,vs=.8;function Rr(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)))/Ee}function bs(t,e,n){let r=c=>{let f=Math.hypot(c[0],c[1],c[2])||1;return[c[0]/f,c[1]/f,c[2]/f]},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-Tr)+s[c]*Tr));return[t[0]+l[0]*o,t[1]+l[1]*o,t[2]+l[2]*o]}function Lr(t,e){let{aspect:n,venue:r}=e,a=t.focal,o=Fr(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=ds*(e.rowDepthM??cs),c=[t.eye[0]+o.x*l,t.eye[1]+us,t.eye[2]+o.z*l],f=[t.eye[0],t.eye[1]-fs,t.eye[2]],p=bs(c,a,f);s.push({name:"row",eye:c,focal:p,fov:Math.min(gn,Math.max(t.fov,2*Math.max(Rr(c,p,f),Rr(c,p,a))/vs))});let u=(y,v,w,E)=>{let C=ps(w,t.fov,n)*1.08,D=C*Math.sin(E*Ee),A=Number.isFinite(e.seatingTopY)?e.seatingTopY+2:-1/0,R=Math.max(D,A-v[1]),L=C*Math.cos(E*Ee);return{name:y,eye:[v[0]+o.x*L,v[1]+R,v[2]+o.z*L],focal:v,fov:t.fov}};e.section&&e.section.radius>0&&s.push(u("section",e.section.center,e.section.radius,35)),s.push(u("venue",r.center,Math.max(1,r.radius),40));let m=[],d=-1/0;for(let y of s){let v=i(y.eye);m.length&&v<=d+.5||(m.push(y),d=v)}return m}import{Vec3 as gs}from"ogl";var mt=Math.PI/180,xn=320,Vr=70*mt,ys=32*mt,xs=24*mt,Or=.0026,Ss=.22,ws=.006,Ms=180,As=900,Ps=1100,Cs=4,ve=(t,e,n)=>Math.max(e,Math.min(n,t)),zr=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function Nr(t){let{canvas:e,camera:n}=t,r=[],a=!1,o=0,i=0,s=0,l=0,c=0,f=0,p=xn,u=null,m=()=>{u&&(clearTimeout(u),u=null)},d=!1,y=[0,0],v=0,w=!1,E=null,C=null,D=new Map,A=!1,R=0,L=0,b=0,F=0,x=()=>a&&r.length?r[ve(Math.round(o),0,r.length-1)].name:null,I=()=>{let M=x();M!==E&&(E=M,t.onStopChange?.(M))},z=()=>{if(!a||!r.length)return;let M=r[ve(Math.floor(o),0,r.length-1)],P=r[ve(Math.ceil(o),0,r.length-1)],S=ve(o-Math.floor(o),0,1),Y=(K,ne)=>K+(ne-K)*S,Z=[Y(M.eye[0],P.eye[0]),Y(M.eye[1],P.eye[1]),Y(M.eye[2],P.eye[2])],ge=[Y(M.focal[0],P.focal[0]),Y(M.focal[1],P.focal[1]),Y(M.focal[2],P.focal[2])],ce=ge[0]-Z[0],he=ge[1]-Z[1],oe=ge[2]-Z[2],ye=Math.hypot(ce,he,oe)||1,pe=Math.atan2(ce,oe),$=Math.asin(ve(he/ye,-1,1)),U=pe+i,ee=ve($+s,-80*mt,80*mt),q=Math.cos(ee)*ye;ce=Math.sin(U)*q,he=Math.sin(ee)*ye,oe=Math.cos(U)*q,n.position.set(Z[0],Z[1],Z[2]),n.fov=Y(M.fov,P.fov),n.updateProjectionMatrix(),n.lookAt(new gs(Z[0]+ce,Z[1]+he,Z[2]+oe)),t.onApplied?.()},_=()=>{if(!a||!r.length)return;let M=ve(Math.round(o),0,r.length-1);if(t.reducedMotion()){d=!1,o=M,z(),I(),t.requestRender();return}if(Math.abs(M-o)<.001){d=!1,I();return}l=o,c=M,f=performance.now(),p=xn,d=!0,t.requestRender()},O=M=>{!a||r.length<2||(m(),d=!1,o=ve(o+M,0,r.length-1),z(),I(),t.requestRender())},G=(M,P)=>{a&&(m(),d=!1,w=!1,i=ve(i-M*Or,-Vr,Vr),s=ve(s-P*Or,-xs,ys),z(),t.requestRender())},B=M=>{a&&(D.set(M.pointerId,{x:M.clientX,y:M.clientY}),D.size===1?(A=!0,F=0,R=M.clientX,L=M.clientY):D.size===2&&(A=!1,b=W()))},W=()=>{let M=[...D.values()];return M.length<2?0:Math.hypot(M[0].x-M[1].x,M[0].y-M[1].y)},N=M=>{if(!a||!D.has(M.pointerId))return;if(D.set(M.pointerId,{x:M.clientX,y:M.clientY}),D.size>=2){let Y=W();b>0&&O((b-Y)*ws),b=Y;return}if(!A)return;let P=M.clientX-R,S=M.clientY-L;R=M.clientX,L=M.clientY,F+=Math.abs(P)+Math.abs(S),!(F<=Cs)&&G(P,S)},te=M=>{D.delete(M.pointerId)&&(D.size<2&&(b=0),D.size===0&&(A=!1,_()))},X=M=>{if(!a)return;M.preventDefault();let P=M.deltaMode===1?16:M.deltaMode===2?100:1,S=ve(M.deltaY*P/100,-2,2);O(S*Ss),C&&clearTimeout(C),C=setTimeout(()=>{C=null,_()},Ms)},J=()=>{m(),a&&(a=!1,d=!1,w=!1,r=[],D.clear(),A=!1,C&&(clearTimeout(C),C=null),E!==null&&(E=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",B),e.addEventListener("pointermove",N),e.addEventListener("pointerup",te),e.addEventListener("pointercancel",te),e.addEventListener("wheel",X,{passive:!1}),{get active(){return a},enter(M,P=0){if(M.length<2){J();return}m(),r=M,a=!0,o=t.reducedMotion()?0:ve(P,0,M.length-1),o>0&&(u=setTimeout(()=>{u=null,a&&(l=o,c=0,f=performance.now(),p=Ps,d=!0,t.requestRender())},As)),i=0,s=0,d=!1,w=!1,E=null,z(),I(),t.requestRender()},exit:J,recentre(){return a?Math.abs(i)<1e-4&&Math.abs(s)<1e-4?!0:t.reducedMotion()?(w=!1,i=0,s=0,z(),t.requestRender(),!0):(y=[i,s],v=performance.now(),w=!0,t.requestRender(),!0):!1},update(M){if(!a)return!1;let P=!1;if(w){let S=ve((M-v)/xn,0,1),Y=1-zr(S);i=y[0]*Y,s=y[1]*Y,S>=1?(w=!1,i=0,s=0):P=!0}if(d){let S=ve((M-f)/p,0,1);o=l+(c-l)*zr(S),S>=1?(d=!1,o=c,I()):P=!0}return z(),P},currentStop:x,dispose(){J(),e.removeEventListener("pointerdown",B),e.removeEventListener("pointermove",N),e.removeEventListener("pointerup",te),e.removeEventListener("pointercancel",te),e.removeEventListener("wheel",X)}}}function Hr(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var Sn=null;function Gr(){return Sn??=import("../openPanorama-VD6PE3YZ.js").catch(t=>{throw Sn=null,t}),Sn}var Br=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Dt=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=Br(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(Br()-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 Wr(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function Ur(t){let{container:e,model:n,opts:r,expandedSeatById:a,seatIdsByRow:o,isNarrow:i}=t,s=null,l=()=>{if(!s)return;let p=i();Object.assign(s.style,p?{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:(p,u,m=!1)=>{if(c(),t.isDisposed())return null;let d=document.createElement("div");d.setAttribute("role","group"),Object.assign(d.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 w=a.get(p),E=w?.sectionId?n.sections.find(x=>x.id===w.sectionId):void 0,C=w?.label??p;d.setAttribute("aria-label",`Explore views near ${E?.label?`${E.label}, `:""}seat ${C}`);let D=document.createElement("span");D.textContent=r.seatViewCaption?.(p)??["Live 3D seat view",E?.label,C].filter(Boolean).join(" \xB7 "),Object.assign(D.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&&d.appendChild(D);let A=document.createElement("div");Object.assign(A.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),d.appendChild(A);let R=w?.rowId?o.get(w.rowId):void 0,L=R?.indexOf(p)??-1,b=L>=0?[R?.[L-1],R?.[L+1]]:[void 0,void 0],F=(x,I,z,_=!1)=>{let O=document.createElement("button");O.type="button",O.textContent=x,O.setAttribute("aria-label",I),Object.assign(O.style,{minHeight:"44px",padding:_?"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"}),_||(O.style.minWidth="44px"),_&&(O.dataset.panoramaTrigger=""),O.addEventListener("click",z),A.appendChild(O)};if(v&&b[0]){let x=a.get(b[0])?.label??b[0];F("\u2039",`View previous seat ${x}`,()=>{t.flyToSeat(b[0])})}if(v&&r.getSeatView){let x=r.seatViewActionLabel?.(p)??"Open 360\xB0 panorama";F(m?`\u21BB Retry ${x}`:`\u25C9 ${x}`,`${m?"Retry":x} from seat ${C}`,()=>{if(t.isDisposed()||u!==t.flightGen()){c();return}c(),t.openPanorama(p,400,u)},!0)}if(v&&b[1]){let x=a.get(b[1])?.label??b[1];F("\u203A",`View next seat ${x}`,()=>{t.flyToSeat(b[1])})}return!A.childElementCount&&!y?null:(e.appendChild(d),s=d,l(),d)},remove:c,layout:l}}var Es={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function Yr(t){let{container:e,orbit:n,isNarrow:r}=t,a={...Es,...t.labels??{}},o=(A,R)=>{A.setAttribute("aria-label",R),A.title=R},i=document.createElement("div"),s=!1;i.className="sl-3d-navigation-controls",Object.assign(i.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D drag mode"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let 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 f=document.createElement("button");f.type="button",f.textContent="\u21BB",o(f,a.rotate);let p=document.createElement("button");p.type="button",p.textContent="\u2725",o(p,a.move);let u=document.createElement("button");u.type="button",u.textContent="\u2212",o(u,a.zoomOut);let m=document.createElement("button");m.type="button",m.textContent="+",o(m,a.zoomIn);for(let A of[f,p,u,m])A.className="sl-3d-icon-control",Object.assign(A.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(f,p),c.append(m,u);let d=null,y=()=>{let A=n.dragAction();if(A===d)return;d=A;let R=A==="orbit";f.setAttribute("aria-pressed",String(R)),p.setAttribute("aria-pressed",String(!R)),f.style.background=R?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",p.style.background=R?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",i.title=R?`${a.rotate} \xB7 ${a.move} with Shift`:`${a.move} \xB7 ${a.rotate} with Shift`},v=A=>{n.setPrimaryDragMode(A),y()};f.addEventListener("click",()=>v("orbit")),p.addEventListener("click",()=>v("pan"));let w=()=>{let{atMin:A,atMax:R}=n.dollyLimitState();m.disabled!==A&&(m.disabled=A),u.disabled!==R&&(u.disabled=R)};u.addEventListener("click",()=>{n.zoomBy(ot),w()}),m.addEventListener("click",()=>{n.zoomBy(He),w()}),i.append(l,c),v("auto"),e.appendChild(i);let E=t.enabled!==!1,C=()=>{let A=r();i.style.display=s||!E?"none":"flex",i.style.right=A?"12px":"14px",i.style.bottom=A?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",l.style.display=A?"none":"flex",m.style.display=A?"none":"",u.style.display=A?"none":""};return C(),{element:i,utilityControls:c,setNavigationMode:v,syncNavigationMode:y,syncZoomLimits:w,setSeatViewLocked:A=>{s=A,n.setInteractionEnabled(!A),C()},seatViewLocked:()=>s,layout:C}}var Ts=.5,Xr=12,qr=20,Rs=28;function _s(t,e,n){return!(t>0)||!(n>0)?0:Ts*n/(2*t*Math.tan(e*Math.PI/360))}function jr(t){let{glctx:e,orbit:n,model:r,seats:a,opts:o,cinematic:i,analytics:s,seatIdByIndex:l,sectionIdBySeatId:c,tapSlop:f,tapMs:p,cancelFlight:u,focusSectionCamera:m,setSelection:d,ensureSeatView:y}=t,v=0,w=0,E=0,C=-1,D=!1,A=!1,R=_=>{t.seatViewLocked()||C===-1&&(C=_.pointerId,v=_.clientX,w=_.clientY,E=performance.now(),D=!1,A=i.active,i.active&&(s.cinematicCancelled(),u(),o.onViewTargetChange?.(null)))},L=_=>{_.pointerId===C&&Math.hypot(_.clientX-v,_.clientY-w)>f&&(D=!0)},b=(_,O,G,B,W)=>{let N=e.canvas.getBoundingClientRect(),te=e.canvas.clientWidth||N.width||1,X=e.canvas.clientHeight||N.height||1,J=_-N.left,M=O-N.top,P=B*B,S=-1,Y=P,Z=1/0;for(let ge of a){if(G&&ge.sectionId!==G)continue;let ce=r.seats.idToIndex.get(ge.id);if(ce===void 0)continue;if(W){let U=Math.round(r.seats.iState[ce]??0);if(U!==0&&U!==3)continue}let he=ce*3,oe=Ae(n.camera.projectionViewMatrix,[r.seats.iPosition[he],r.seats.iPosition[he+1]+.55,r.seats.iPosition[he+2]],te,X);if(!oe.visible)continue;let ye=oe.x-J,pe=oe.y-M,$=ye*ye+pe*pe;($<Y||Math.abs($-Y)<1&&oe.depth<Z)&&(S=ce,Y=$,Z=oe.depth)}return S},F=(_,O)=>{let G=t.gpu(),B=t.pick();if(!G||!B)return-1;B.syncFromSeatProgram(G.seatProgram);let W=e.canvas.getBoundingClientRect(),N=e.renderer.dpr,{x:te,y:X}=cr(_,O,W,N,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),J=Math.max(2,Math.round(8*N));return B.pick(n.camera,te,X,J)},x=()=>e.canvas.clientHeight||e.canvas.getBoundingClientRect().height,I=(_,O=Xr)=>{let G=n.camera?.position;if(!G)return!1;let B=_*3,W=Math.hypot(G.x-r.seats.iPosition[B],G.y-r.seats.iPosition[B+1],G.z-r.seats.iPosition[B+2]);return _s(W,n.fovY,x())>=O};return{onDown:R,onMove:L,onUp:_=>{if(_.pointerId!==C)return;let O=!D&&performance.now()-E<p;if(C=-1,A){A=!1;return}let G=t.gpu(),B=t.pick();if(!O||!G||!B)return;let W=F(_.clientX,_.clientY),N=_.pointerType==="touch"||_.pointerType==="pen",te=N?qr:Xr,X=W>=0&&I(W,te),J=!1;if(t.focusedSectionId()&&W>=0){let S=l[W],Y=S?c.get(S):void 0;if(Y&&Y!==t.focusedSectionId()&&m(Y,{keepCamera:X})){if(!X)return;J=!0}}if(t.focusedSectionId()&&W<0&&(W=b(_.clientX,_.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&W<0){let S=b(_.clientX,_.clientY,null,72,!1),Y=S>=0?l[S]:void 0,Z=Y?c.get(Y):void 0;if(Z&&Z!==t.focusedSectionId()&&m(Z))return}if(!t.focusedSectionId()){W<0&&(W=b(_.clientX,_.clientY,null,42,!1));let S=W>=0?l[W]:void 0,Y=S?c.get(S):void 0;if(Y&&m(Y,{keepCamera:X})){if(!X)return;J=!0}}if(W<0||W>=l.length){t.selection().size&&(d([]),o.onViewTargetChange?.(null));return}let M=l[W];if(N&&t.focusedSectionId()&&!J&&!I(W,qr)){t.focusSeatCamera(M,{seatPx:Rs,viewportHeightPx:x()});return}let P=Se[Math.round(r.seats.iState[W]??0)]??"available";if(P!=="available"&&P!=="selected"){o.onSeatInspect?.(M,P);return}if(t.selection().has(M)&&t.selection().size===1){d([]),o.onViewTargetChange?.(null),o.onSeatPick?.(M);return}d([M]),y(M),s.seatPicked(M,c.get(M)),o.onSeatPick?.(M)}}}var Ft=class{constructor(e,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=e,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let e=this.iPosition,n=1/0,r=1/0,a=-1/0,o=-1/0;for(let m=0;m<this.count;m++){let d=e[m*3],y=e[m*3+2];d<n&&(n=d),d>a&&(a=d),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),f=m=>{let d=Math.min(this.cols-1,Math.max(0,Math.floor((e[m*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[m*3+2]-r)/this.cell)))*this.cols+d};for(let m=0;m<this.count;m++)c[f(m)+1]++;for(let m=0;m<l;m++)c[m+1]+=c[m];let p=new Int32Array(this.count),u=c.slice(0,l);for(let m=0;m<this.count;m++)p[u[f(m)]++]=m;this.cellStart=c,this.cellItems=p}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,f=Math.floor((e-this.minX)/this.cell),p=Math.floor((n-this.minZ)/this.cell),u=Math.ceil(r/this.cell)+1,m=this.iPosition,d=0;for(let y=0;y<=u&&d<l;y++){let v=p-y,w=p+y,E=f-y,C=f+y;for(let D=v;D<=w&&d<l;D++){if(D<0||D>=this.rows)continue;let A=D===v||D===w;for(let R=E;R<=C&&d<l;R++){if(!A&&R!==E&&R!==C){R=C-1;continue}if(R<0||R>=this.cols)continue;let L=D*this.cols+R;for(let b=i[L],F=i[L+1];b<F&&d<l;b++){let x=s[b],I=m[x*3]-e,z=m[x*3+2]-n,_=o===void 0?0:m[x*3+1]-o;I*I+_*_+z*z<=c&&(a[d++]=x)}}}}return d}};var kt=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(At);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Ft(e.model.seats.iPosition,e.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(e){let n=this.ctx.gpu();e||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!e&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(e){let{model:n}=this.ctx,r=this.ctx.gpu();if(!r)return;if(!e){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let a=this.ctx.orbit().camera.position;if(Math.hypot(a.x-this.lastGatherX,a.y-this.lastGatherY,a.z-this.lastGatherZ)<rn)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>on){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(a.x,a.z,on,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 $r(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 Is,Vec3 as Ds}from"ogl";function Kr(){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 Qr(t){let{container:e,model:n,opts:r,orbit:a,cinematic:o,analytics:i,loop:s,labelOverlay:l,stageAzimuth:c,overviewFraming:f}=t,p=0,u=-1,m=(x,I,z=28)=>{a.camera.position.set(x[0],x[1],x[2]),a.camera.lookAt(new Ds(I[0],I[1],I[2])),a.camera.fov=z,a.camera.updateProjectionMatrix()},d=document.createElement("button");d.className="sl-3d-overview-control sl-3d-icon-control",d.type="button",d.replaceChildren(Kr());let y=r.navLabels?.fitView??"Show whole venue";d.setAttribute("aria-label",y),d.title=y,Object.assign(d.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=()=>{d.firstElementChild||d.replaceChildren(Kr())};v();let w=x=>{u=x;let I=t.gpu();I&&(I.seatProgram.uniforms.uFocusFloor.value=x,I.solidProgram.uniforms.uFocusFloor.value=x,I.chairProgram.uniforms.uFocusFloor.value=x),t.showSectionSeatLabels(null)},E=null,C=!1,D=()=>{if(E=null,C=!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(),d.style.display="",l.setVisible(!0),t.setFrozen(!1);let x=u>=0?n.floors[u]:null;if(t.setNearFieldDetailEnabled(!!x),t.setSeatViewLocked(!1),A(),t.removeArriveChip(),t.setNavigationMode("auto"),x){let I=x.focalWorld[0]-x.center[0],z=x.focalWorld[2]-x.center[2],_=Math.hypot(I,z)>x.radius*.12?Math.atan2(I,z):c,O={center:x.center,radius:x.radius,box:x.box},G={polarDeg:58,margin:1.12};t.reducedMotion()?a.frame(O,!1,_,!1,G):a.frameSoft(O,_,!1,G)}else t.reducedMotion()?a.frame(n.bounds,!1,c,r.portraitOverviewCrop===!0,f):a.frameSoft(n.bounds,c,r.portraitOverviewCrop===!0,f);l.setOverviewDistance(a.targetDistance),t.showSectionSeatLabels(null),s.requestRender()},A=()=>{p++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),o.active&&(o.cancel(),a.resumeAfterFlight(n.focalWorld))},R=x=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let I=n.seats.idToIndex.get(x);if(I===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(x),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),t.setPanoramaSphereVisible(!1),d.style.display="",t.restorePanoramaLayer()),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.setFrozen(!1);let z=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(z),t.setSeatViewLocked(!1);let _=++p;z?t.showArriveChip(x,_):t.removeArriveChip();let{eye:O,focal:G}=t.resolvedSeatViewPose(x,I),B=r.arriveAtSeatEye?t.seatViewArrival(x,I):null,W=B&&B.stops.length>1&&B.stops[1].name==="row"?B.stops[1]:null,N=B?B.focal:G,te=[a.camera.position.x,a.camera.position.y,a.camera.position.z],X=vn(te,B?.eye??O,N,n.bounds.center,n.bounds.radius),J=W?W.eye:B?B.eye:r.arriveAtSeatEye?O:X.finalPos,M=B?B.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?Rt:65:28,P=[X.waypoints[0],X.waypoints[1],J];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),m(J,N,M),s.requestRender(),i.cinematicSkipped(),t.isDisposed()||a.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),B&&t.enterSeatView(B.stops),t.showArriveChip(x,_),Promise.resolve();let S=new Is().copy(a.camera.quaternion),Y=gr(a.camera,J,N);s.requestRender();let Z=z?700:2500;return o.start(P,S,Y,Z,M).then(()=>{t.isDisposed()||_!==p||(t.setSeatStepping(!1),i.cinematicPlayed(Z),a.resumeAfterFlight(N),t.setSeatViewLocked(r.arriveAtSeatEye===!0),B&&t.enterSeatView(B.stops,W?1:0),s.requestRender(),t.showArriveChip(x,_))})},L=(x,I)=>{let z=n.sections.find(_=>_.id===x);if(!z||z.seatCount===0)return!1;if(E=x,C=!1,t.setSeeThrough?.(null),t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),o.cancel(),t.removeArriveChip(),n.floors.length>1&&u!==z.floorIndex&&w(z.floorIndex),t.setNavigationMode("auto"),t.panorama()||l.setVisible(!0),t.showSectionSeatLabels(x),!I?.keepCamera){let _=$r(z),O={polarDeg:_.polarDeg,margin:1.12};t.reducedMotion()?a.frame({center:_.center,radius:_.radius},!1,a.currentAzimuth,!1,O):a.glideTo({center:_.center,radius:_.radius},O)}return r.onSectionFocusChange?.(x),s.requestRender(),!0},b=(x,I)=>{if(t.isDisposed()||!t.gpu())return!1;let z=n.seats.idToIndex.get(x);if(z===void 0)return!1;let _=z*3,O=[n.seats.iPosition[_],n.seats.iPosition[_+1]+.55,n.seats.iPosition[_+2]],G=I?Fs(I,a.fovY,a.camera.aspect||1):Zr;return C=!0,t.setSeeThrough?.(O),t.reducedMotion()?a.frame({center:O,radius:G},!1,void 0,!1,wn):a.frameSoft({center:O,radius:G},void 0,!1,wn),s.requestRender(),!0},F=()=>{if(t.isNarrow?.()&&C&&E&&L(E)){s.requestRender();return}D()};return d.addEventListener("click",F),{overviewChip:d,layoutOverviewChip:v,flightGen:()=>p,focusedFloor:()=>u,applyFloorFocus:w,placeCameraFinal:m,cancelFlight:A,focusOverview:D,flyToSeat:R,focusSectionCamera:L,focusSeatCamera:b}}var Zr=4.5;function Fs(t,e,n){let r=Math.tan(e*Math.PI/360),a=r*Math.max(.001,n),i=ks*t.viewportHeightPx/(2*Math.max(1,t.seatPx)*r)*Math.min(r,a)/wn.margin;return Math.max(Ls,Math.min(Zr,i))}var ks=.5,Ls=1.5,wn={polarDeg:48,margin:1.25};function Mn(t,e,n,r,a,o,i,s,l=.5){let c=-1,f=s*s,p=1/0;for(let u=0;u<e;u++){let m=u*3,d=Ae(n,[t[m],t[m+1]+l,t[m+2]],r,a);if(!d.visible)continue;let y=d.x-o,v=d.y-i,w=y*y+v*v;(w<f-4||w<f+4&&d.depth<p)&&(c=u,f=Math.min(f,w),p=d.depth)}return c}function Jr(t){let e=performance.now(),{input:n,estimate:r}=ho(t);return{model:nt(n),buildMs:performance.now()-e,source:"main",...r?{estimate:r}:{}}}function Vs(t){let e=Wn(t.doc);return{...Jr({...t,seats:e}),seats:e}}function ea(t,e,n){let r=o=>({...e(),fallbackReason:o});if(typeof Worker>"u")return Promise.resolve(r("unavailable"));let a;try{a=new Worker(new URL("./scene/scene.worker.js",import.meta.url),{type:"module"})}catch{return Promise.resolve(r("unavailable"))}return new Promise(o=>{let i=!1,s=f=>{i||(i=!0,clearTimeout(c),a.terminate(),o(f))},l=f=>s(r(f)),c=window.setTimeout(()=>l("timeout"),15e3);a.onerror=()=>l("worker_error"),a.onmessage=f=>{let p=n(f.data);p?s(p):l("bad_response")},a.postMessage(t)})}function Os(t){return ea(t,()=>Jr(t),({model:e,buildMs:n,estimate:r})=>({model:e,buildMs:n,source:"worker",...r?{estimate:r}:{}}))}function zs(t){return ea(t,()=>Vs(t),({model:e,buildMs:n,seats:r,estimate:a})=>r?{model:e,buildMs:n,seats:r,source:"worker",...a?{estimate:a}:{}}:null)}var Hs=40,Gs=48,Bs=Math.PI/180,Ws=6,Us=500,Ys=6;function gu(t,e,n={}){let r=performance.now(),a=e.prepared?e.prepared.estimate:e.estimate===!1?null:Qt(e.doc,e.seats);a&&(e={...e,doc:a.doc,seats:mo(e.seats,a)});let o=e.prepared?.model??nt(e),i=new Dt(n.onAnalytics),s=new Array(o.seats.count);for(let[h,g]of o.seats.idToIndex)s[g]=h;let l=new Map(e.seats.map(h=>[h.id,h])),c=new Map;for(let h of e.seats){if(!h.rowId)continue;let g=c.get(h.rowId);g?g.push(h.id):c.set(h.rowId,[h.id])}let f=new Map,p=[0,0,0,0];function u(){if(v)for(let h of[v.seatProgram,v.solidProgram,v.chairProgram])h.uniforms.uSeeThrough.value=p}e.seats.forEach((h,g)=>{f.set(h.id,o.seatSectionIds?.[g]??h.sectionId)});let m=new Map;for(let[h,g]of o.seats.idToIndex){let T=f.get(h);if(!T)continue;let V=m.get(T);V?V.push(g):m.set(T,[g])}let d=()=>{if(!v||!o.sectionSolidRanges.length)return;let{lit:h,anyUnlit:g}=nr(o.sectionSolidRanges,m,o.seats.iState);v.setSectionShellLit(g?h:null)},y=e.doc.floors?.some(g=>(g.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(g=>g.objects)??e.doc.objects).some(g=>g.type==="section"&&((g.height??0)>0||(g.rake??0)>0)),v=null,w=null,E=null,C=!1,D=!1,A=!1,R=new Map,L=null,b=null,F=null,x=new Map,I=null,z=()=>{F===null&&(F=t.style.zIndex,t.style.zIndex="20")},_=()=>{F!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=F),F=null)},O=!1,G=()=>O?fe.focusedFloor():-1,B=()=>{v=sr(P.gl,o),w?.dispose(),w=Fo(P.gl,[1,1,1],o.theme.seatStates.selected),In(!1),d(),An(),E=new Et(P.renderer,v.seatGeometry,v.chairGeometry,v.solidGeometry,o.seats.count),P.setClearColor(o.theme.background.top),E.setRestoreClear(o.theme.background.top),E.setRoomCentre(o.room?.centre),v.seatProgram.uniforms.uSeatRadius.value=et*o.theme.seatScale,v.seatProgram.uniforms.uFocusFloor.value=G(),v.solidProgram.uniforms.uFocusFloor.value=G(),v.chairProgram.uniforms.uFocusFloor.value=G(),v.screenProgram&&(v.screenProgram.uniforms.uFocusFloor.value=G()),u(),N.forceRegather()},W=!1,N=new kt({model:o,orbit:()=>S,gpu:()=>v}),te=!1,X=new Map,J=24,M=h=>N.setDetailEnabled(h),P=new St(t,{onContextLost:()=>{A||i.contextLost(),C=!0,ie.stop(),v=null,E=null},onContextRestored:()=>{B(),C=!1,A||i.contextRestored(),ie.requestRender()}}),S=new wt(P.gl,P.canvas,()=>ie.requestRender(),()=>i.orbitEngaged());S.setAspect(P.aspect);let Y=(e.doc.floors?.flatMap(h=>h.objects)??e.doc.objects).some(h=>h.type==="section"&&h.physical3dProvenance?.surfaceKind?.status==="inferred"),Z=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(Y&&o.stages.length===0))return po(o.focalWorld,o.seats.iPosition,o.bounds)})(),ge=(e.doc.floors?.flatMap(h=>h.objects)??e.doc.objects).some(h=>h.type==="shape"&&h.stageKind?.startsWith("pitch-")),ce=o.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:ge?36:48,margin:1.05},he=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;S.frame(o.bounds,!he&&n.skipInitialOverviewAnimation!==!0,Z,n.portraitOverviewCrop===!0,ce);let oe=new Tt(S.camera),ye=Wr(t),pe=fo(t,o),$=new Pt(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:o.theme.background.top}),U=o.labels,ee=()=>to(U,o.floors.length,G());$.setLabels(ee()),$.setOverviewDistance(S.targetDistance);let q=()=>{let h=new Map,g=Se.indexOf("available");for(let T of U){if(!T.wheelchairSeats)continue;let V=0;for(let H of T.wheelchairSeats)o.seats.iState[H]===g&&V++;V>0&&h.set(T.id,V)}return $.setWheelchairFree(h)};q();let K=null,ne=()=>[...R.keys()].flatMap(h=>{let g=o.seats.idToIndex.get(h),T=g===void 0?void 0:e.seats[g];if(g===void 0||T?.id!==h)return[];let V=g*3;return[{id:`seat:${h}`,kind:"seat",seatWidthM:o.seats.iChairWidth[g]*2,text:T.displayLabel||T.label,anchor:[o.seats.iPosition[V],o.seats.iPosition[V+1]+1.05,o.seats.iPosition[V+2]],pinBase:Vt(V)}]}),se=-1,An=()=>{v&&(se=K?o.sections.findIndex(h=>h.id===K):-1,v.seatProgram.uniforms.uFocusSection.value=se,v.chairProgram.uniforms.uFocusSection.value=se)},ht=h=>{if(K=h,An(),$.setForcedDense(!!h),!h){let k=ne(),le=new Set(k.map(ae=>ae.id));$.setLabels([...ee().filter(ae=>!le.has(ae.id)),...k]);return}let g=e.seats.filter(k=>f.get(k.id)===h),T=new Set(g.map(k=>k.id)),V=new Set(g.map(k=>k.rowId)),H=new Set(R.keys()),Q=new Set(g.filter(k=>H.has(k.id)).map(k=>k.id)),j=ee().filter(k=>k.kind!=="row"&&k.kind!=="seat"&&k.kind!=="access"||k.kind==="access"&&T.has(k.id.slice(7))||(k.kind==="row"?V.has(k.id.slice(4)):T.has(k.id.slice(5))));if(o.seatCount<=6e3&&Q.size===0){$.setLabels(j);return}let re=g,me=new Set(re.map(k=>`seat:${k.id}`)),be=re.flatMap(k=>{let le=o.seats.idToIndex.get(k.id);if(le===void 0)return[];let ae=le*3;return[{id:`seat:${k.id}`,kind:"seat",seatWidthM:o.seats.iChairWidth[le]*2,rowId:k.rowId,text:H.has(k.id)?k.displayLabel||k.label:uo(k.displayLabel||k.label),anchor:[o.seats.iPosition[ae],o.seats.iPosition[ae+1]+(H.has(k.id)?1.05:.55),o.seats.iPosition[ae+2]],...H.has(k.id)?{pinBase:Vt(ae)}:{}}]});$.setLabels([...j.filter(k=>!me.has(k.id)),...be])};B();let we=null,Lt=null,Pn=new Ns,pt=h=>{if(C||!v||D)return!1;let g=Hr({flying:oe.active,panoramaMounted:L!==null,seatViewActive:we?.active===!0}),T=g==="orbit"?se:-1;v.seatProgram.uniforms.uFocusSection.value=T,v.chairProgram.uniforms.uFocusSection.value=T;let V=te?!1:g==="cinematic"?oe.update(performance.now()):g==="seatView"?we.update(performance.now()):g==="orbit"?S.update():!1;Lt?.syncZoomLimits(),Lt?.syncNavigationMode();let H=G()>=0?o.floors[G()]:null,Q=H?.radius??o.bounds.radius,j=Ro(S.currentDistance,Q),re=W?{center:[S.camera.position.x,S.camera.position.y,S.camera.position.z],radius:520}:o.clipBounds??o.renderBounds;S.updateClipping(re);let me=H?.center??o.renderBounds.center,be=H?.radius??o.renderBounds.radius,k=(ue,Xt)=>Math.hypot(S.camera.position.x-ue[0],S.camera.position.y-ue[1],S.camera.position.z-ue[2])<=Xt*(N.detailVisible?1.8:1.55),le=k(me,be);if(!le&&K){let ue=o.sections.find(Xt=>Xt.id===K);ue&&(le=k(ue.center,Math.max(12,ue.radius*2)))}N.detailVisible=le;let ae=v.seatProgram.uniforms;ae.uSeatScale.value=j.scale,ae.uSeatFade.value=j.fade;let xe=!!H&&_o(H.seatCount,P.canvas.clientWidth||1,P.canvas.clientHeight||1),_e=Io(o.seats.count,Q,S.currentDistance,S.camera.fov,P.canvas.clientHeight||1),Ke=N.detailVisible||xe||_e?1:0,Qe=N.detailVisible||G()>=0||o.floors.length>1?1:0;N.ease(h,Ke,Qe),ae.uSeatDetail.value=N.seatDetailMix;let bt=Ke===0&&N.seatDetailMix<.01;v.seatGeometry.setDrawRange(bt?Zt:0,bt?vo:Zt),v.solidProgram.uniforms.uStructureDetail.value=N.structureDetailMix,ae.uMinPixels.value=j.minPixels,ae.uPixelToWorld.value=2*Math.tan(S.camera.fov*Bs/2)/Math.max(1,P.pixelHeight),N.update(N.detailVisible),o.outdoor&&(Pn.copy(S.camera.projectionViewMatrix).inverse(),v.backgroundProgram.uniforms.uInvViewProj.value.set(Pn)),P.renderer.render({scene:v.background,clear:!0}),P.renderer.render({scene:v.main,camera:S.camera,clear:!1});let Ze=w?w.update(performance.now(),[S.camera.position.x,S.camera.position.y,S.camera.position.z],L!==null,g==="seatView"):!1;if(w&&P.renderer.render({scene:w.root,camera:S.camera,clear:!1}),pe){let ue=S.camera.worldMatrix;pe.update(g==="seatView"?[S.camera.position.x,S.camera.position.y,S.camera.position.z]:null,[-ue[8],-ue[9],-ue[10]])}$.update(S.camera.projectionViewMatrix,P.canvas.clientWidth||1,P.canvas.clientHeight||1,S.currentDistance,Q,[S.camera.position.x,S.camera.position.y,S.camera.position.z]);let Oe=V||Ze||N.seatDetailMix!==Ke||N.structureDetailMix!==Qe;return Cn(!Oe),Oe},Cn=Ao(t),ie=new Mt(pt),En=typeof ResizeObserver<"u"?new ResizeObserver(()=>Yt.resize()):null;En?.observe(t),S.setZoomPointResolver((h,g)=>{let T=P.canvas.getBoundingClientRect(),V=P.canvas.clientWidth||T.width,H=P.canvas.clientHeight||T.height;if(!(V>0)||!(H>0))return null;S.camera.updateMatrixWorld();let Q=Mn(o.seats.iPosition,o.seats.count,S.camera.projectionViewMatrix,V,H,h-T.left,g-T.top,Hs);if(Q<0)return null;let j=Q*3;return[o.seats.iPosition[j],o.seats.iPosition[j+1]+.5,o.seats.iPosition[j+2]]});function Vt(h){return[o.seats.iPosition[h],o.seats.iPosition[h+1]+.5,o.seats.iPosition[h+2]]}$.setSeatNumberRow(null);let Me=null,Te=0,Ot=null,Tn=()=>{Te=0;let h=null,g=null;if(Me&&!we?.active&&!oe.active){let H=P.canvas.getBoundingClientRect(),Q=P.canvas.clientWidth||H.width,j=P.canvas.clientHeight||H.height;if(Q>0&&j>0){let re=Mn(o.seats.iPosition,o.seats.count,S.camera.projectionViewMatrix,Q,j,Me.x-H.left,Me.y-H.top,Gs);h=re>=0?e.seats[re]?.rowId??null:null;let me=re>=0?e.seats[re]?.id??null:null;if(g=me,Me.mouse&&!Me.pressing&&!!K&&!!me&&f.get(me)===K){let k=t.getBoundingClientRect();Ot=me,n.onSeatHover?.(me,{x:Me.x-k.left,y:Me.y-k.top})}else Rn()}}else Rn();let T=Me?.mouse?g:null,V=$.setSeatNumberSeat(T);($.setSeatNumberRow(h)||V)&&ie.requestRender()};function Rn(){Ot!==null&&(Ot=null,n.onSeatHover?.(null,null))}let ft=h=>{Me={x:h.clientX,y:h.clientY,mouse:h.pointerType==="mouse",pressing:h.type==="pointerdown"},Te||(Te=requestAnimationFrame(Tn))},_n=h=>{h.pointerType==="mouse"&&(Me=null,Te||(Te=requestAnimationFrame(Tn)))};P.canvas.addEventListener("pointermove",ft),P.canvas.addEventListener("pointerdown",ft),P.canvas.addEventListener("pointerleave",_n);function In(h){if(!w)return;let g=[];for(let T of R.keys()){let V=o.seats.idToIndex.get(T);if(V===void 0)continue;let H=V*3;g.push({id:T,position:Vt(H)})}w.setSeats(g,performance.now(),h)}let Dn=h=>{let g=H=>{let Q=o.seats.idToIndex.get(H);return Q===void 0?void 0:o.seats.iState[Q]},{updates:T,next:V}=dr(R,h,g);if(R=V,$.setSelectedSeatIds(R.keys()),In(!qe()),ie.requestRender(),ht(K),T.length){let H=$t(o.seats,T);v&&v.uploadSeatStateRuns(H),d(),ie.requestRender()}},qe=()=>I!==null?I:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,ta=8,Fn=h=>{if(!n.getSeatView)return null;let g=x.get(h);if(!g)for(g=Promise.resolve(n.getSeatView(h)),x.set(h,g),g.catch(()=>{x.get(h)===g&&x.delete(h)});x.size>ta;){let T=x.keys().next().value;if(T===void 0)break;x.delete(T)}return g},kn=Dr(o.stages,o.focalWorld,o.bounds.groundY??0),Ln=yn(kn),zt=(h,g)=>{let T=l.get(h),V=Math.max(0,Math.round(o.seats.iFloor[g]??0)),H=e.doc.floors?.[V],Q=o.floors[V],j=H?.focalPoint??e.doc.focalPoint,re=Q?{x:Q.focalWorld[0]/ze,y:Q.focalWorld[2]/ze}:j,me=T?.focalPoint?{x:T.focalPoint.x+re.x-j.x,y:T.focalPoint.y+re.y-j.y}:re,be=[o.seats.iPosition[g*3],o.seats.iPosition[g*3+1],o.seats.iPosition[g*3+2]],k=Sr(o.seats.iPosition,g,Ln),le=k!==null&&Math.abs(k)<xr;return wr(be,me,H?.baseHeightM??0,T?.eyeHeightM,Ln,le)},Nt=()=>(t.clientWidth||P.canvas.clientWidth)<=520,Ht=null,Vn=null,na=async(h,g,T)=>{if(!n.getSeatView||A||T!==fe.flightGen())return;let V;try{V=await Gr()}catch{if(i.panoramaFailed(h,"mount"),!A&&T===fe.flightGen()){let H=Bt(h,T,!0);requestAnimationFrame(()=>H?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(A||T!==fe.flightGen()||!Ht))return Vn??=V.createOpenPanorama(Ht),Vn(h,g,T)},Gt=Ur({container:t,model:o,opts:n,expandedSeatById:l,seatIdsByRow:c,isNarrow:Nt,isDisposed:()=>A,flightGen:()=>fe.flightGen(),flyToSeat:h=>Gn(h),openPanorama:(h,g,T)=>na(h,g,T)}),Bt=Gt.show,Wt=Gt.remove,oa=Gt.layout,Re=Yr({container:t,orbit:S,isNarrow:Nt,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});Lt=Re;let ra=Re.element,je=Re.setNavigationMode,aa=Re.layout,ia=Re.utilityControls,$e=null,On=!1,vt=h=>{Re.setSeatViewLocked(h),h||we?.exit()};we=Nr({canvas:P.canvas,camera:S.camera,requestRender:()=>ie.requestRender(),reducedMotion:qe,onStopChange:h=>{let g=h??(On?"seat":null);$e=g;try{n.onSeatViewStopChange?.(g)}catch{}},onApplied:()=>{A||S.syncFromCamera()}});let zn=o.sections.reduce((h,g)=>g.seatCount>0&&g.box?Math.max(h,g.box.max[1]):h,-1/0),Nn=(h,g)=>{let{eye:T}=zt(h,g),V=(t.clientWidth||P.canvas.clientWidth||1)/Math.max(1,t.clientHeight||P.canvas.clientHeight||1),H=kr(T,kn,V,{preserveEye:!0});if(n.seatViewStops===!1)return{...H,stops:[]};let Q=f.get(h),j=Q?o.sections.find(re=>re.id===Q):void 0;return{...H,stops:Lr(H,{aspect:V,seatingTopY:Number.isFinite(zn)?zn:o.bounds.box.max[1],section:j&&j.seatCount>0?{center:j.center,radius:j.radius}:null,venue:{center:o.bounds.center,radius:o.bounds.radius}})}},fe=Qr({isNarrow:Nt,setSeeThrough:h=>{p=h?[h[0],h[1],h[2],Ys]:[0,0,0,0],u(),ie.requestRender()},container:t,model:o,opts:n,orbit:S,cinematic:oe,analytics:i,loop:ie,labelOverlay:$,stageAzimuth:Z,overviewFraming:ce,gpu:()=>v,isDisposed:()=>A,panorama:()=>L,setPanorama:h=>{L=h},setPanoramaSphereVisible:h=>{W=h},panoramaLoadAbort:()=>b,setPanoramaLoadAbort:h=>{b=h},setFrozen:h=>{D=h},restorePanoramaLayer:_,reducedMotion:qe,resolvedSeatViewPose:zt,showSectionSeatLabels:ht,setNearFieldDetailEnabled:M,setSeatViewLocked:vt,setNavigationMode:je,showArriveChip:Bt,removeArriveChip:Wt,inSeatView:()=>$e!==null,setSeatStepping:h=>{On=h},seatViewArrival:(h,g)=>n.arriveAtSeatEye?Nn(h,g):null,enterSeatView:(h,g)=>we?.enter(h,g)});O=!0;let Ut=fe.overviewChip,sa=fe.layoutOverviewChip,la=fe.applyFloorFocus,ca=fe.focusOverview,Hn=fe.cancelFlight,Gn=fe.flyToSeat,Bn=fe.focusSectionCamera;ia.appendChild(Ut),Ht={container:t,model:o,opts:n,analytics:i,orbit:S,loop:ie,seatsById:l,ensureSeatView:Fn,resolvedSeatViewPose:zt,gpu:()=>v,gl:P.gl,isContextLost:()=>C,isDisposed:()=>A,flightGen:()=>fe.flightGen(),setPanorama:h=>{L=h},getLoadAbort:()=>b,setLoadAbort:h=>{b=h},setPanoramaSphereVisible:h=>{W=h,h&&we?.exit()},setFrozen:h=>{D=h},raisePanoramaLayer:z,restorePanoramaLayer:_,getOverviewChip:()=>Ut,labelOverlay:$,reducedMotion:qe,removeArriveChip:Wt,showArriveChip:Bt};let Ce=jr({glctx:P,orbit:S,model:o,seats:e.seats,opts:n,cinematic:oe,analytics:i,seatIdByIndex:s,sectionIdBySeatId:f,tapSlop:Ws,tapMs:Us,gpu:()=>v,pick:()=>E,seatViewLocked:()=>Re.seatViewLocked(),focusedSectionId:()=>K,selection:()=>R,cancelFlight:Hn,focusSectionCamera:Bn,focusSeatCamera:fe.focusSeatCamera,setSelection:Dn,ensureSeatView:Fn});P.canvas.addEventListener("pointerdown",Ce.onDown),P.canvas.addEventListener("pointermove",Ce.onMove),P.canvas.addEventListener("pointerup",Ce.onUp),P.canvas.addEventListener("pointercancel",Ce.onUp),ie.requestRender();let Yt={setAvailability(h){let g=ur(R,h),T=$t(o.seats,g);T.length&&v&&v.uploadSeatStateRuns(T),d(),T.length&&q(),ie.requestRender()},setSelection:Dn,setNavigationMode:je,zoomIn(){S.zoomBy(He),ie.requestRender()},zoomOut(){S.zoomBy(ot),ie.requestRender()},flyToSeat:Gn,focusOverview:ca,seatViewStop:()=>$e,recentreSeatView:()=>we?.recentre()??!1,resize(){let{width:h,height:g}=P.resize();S.setAspect(h/Math.max(1,g)),oa(),aa(),sa(),ie.requestRender()},stats(){return{...ie.stats(),drawCalls:v?v.drawCalls:0,fallbackTriangles:v?v.seatGeometry.drawRange.count/3*o.seats.count:0,seatCount:o.seatCount}},captureImage(h=1280){if(C||!v||typeof document>"u")return null;pt(0);let g=P.canvas,T=Math.min(1,h/Math.max(g.width,g.height,1)),V=document.createElement("canvas");V.width=Math.max(1,Math.round(g.width*T)),V.height=Math.max(1,Math.round(g.height*T));let H=V.getContext("2d");return H?(H.drawImage(g,0,0,V.width,V.height),V.toDataURL("image/jpeg",.82)):null},captureSeatView(h,g=480){if(C||!v||D||typeof document>"u"||oe.active||L!==null||we?.active)return null;let T=X.get(h);if(T)return T;let V=o.seats.idToIndex.get(h);if(V===void 0)return null;let{eye:H,focal:Q,fov:j}=Nn(h,V),re=S.snapshot(),me=[N.seatDetailMix,N.structureDetailMix],be=null;try{te=!0,S.camera.position.set(H[0],H[1],H[2]),S.camera.perspective({fov:j,aspect:S.camera.aspect}),S.camera.lookAt(Q),S.camera.updateMatrixWorld(),S.syncFromCamera(),N.seatDetailMix=1,N.structureDetailMix=1,N.forceRegather(),pt(0);let k=P.canvas,le=Math.min(k.width,Math.round(k.height*16/9)),ae=Math.round(le*9/16),xe=document.createElement("canvas");xe.width=Math.max(1,Math.round(g)),xe.height=Math.max(1,Math.round(g*9/16));let _e=xe.getContext("2d");_e&&(_e.drawImage(k,(k.width-le)/2,(k.height-ae)/2,le,ae,0,0,xe.width,xe.height),be=xe.toDataURL("image/jpeg",.8))}finally{te=!1,re(),N.seatDetailMix=me[0],N.structureDetailMix=me[1],N.forceRegather(),pt(0)}if(be)for(X.set(h,be);X.size>J;)X.delete(X.keys().next().value);return be},getQualityEvidence(){let h=ie.stats(),g=P.canvas.clientWidth||1,T=P.canvas.clientHeight||1,V=o.bounds.center,H=Ae(S.camera.projectionViewMatrix,[V[0],o.bounds.box.min[1],V[2]],g,T),Q=Ae(S.camera.projectionViewMatrix,[V[0],o.bounds.box.max[1],V[2]],g,T),j=o.bounds.box,re=[j.min[0],j.max[0]].flatMap(k=>[j.min[1],j.max[1]].flatMap(le=>[j.min[2],j.max[2]].map(ae=>Ae(S.camera.projectionViewMatrix,[k,le,ae],g,T)))).filter(k=>Number.isFinite(k.x)&&Number.isFinite(k.y)&&Number.isFinite(k.depth)),me=re.length?(()=>{let k=Math.min(...re.map(ue=>ue.x)),le=Math.max(...re.map(ue=>ue.x)),ae=Math.min(...re.map(ue=>ue.y)),xe=Math.max(...re.map(ue=>ue.y)),_e=Math.max(0,k),Ke=Math.min(g,le),Qe=Math.max(0,ae),bt=Math.min(T,xe),Ze=Math.max(0,Ke-_e),Oe=Math.max(0,bt-Qe);return{box:{x:_e,y:Qe,width:Ze,height:Oe},horizontalFillRatio:Ze/g,verticalFillRatio:Oe/T,visibleAreaRatio:Ze*Oe/(g*T),clippedEdges:[...ae<0?["top"]:[],...le>g?["right"]:[],...xe>T?["bottom"]:[],...k<0?["left"]:[]]}})():void 0,be=String(P.gl.getParameter(P.gl.VERSION)??"");return{viewport:{width:g,height:T},context:{webgl2:/webgl\s*2/i.test(be),lost:C},frame:{rendered:h.rendered,idle:h.idle},camera:{position:[S.camera.position.x,S.camera.position.y,S.camera.position.z],distance:S.currentDistance,verticalFovDeg:S.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:H.visible&&Q.visible?Math.abs(H.y-Q.y):0},labels:$.qualityEvidence(),framing:me,...$e?{seatView:{fovDeg:S.camera.fov,stop:$e}}:{}}},getQualityReport(){return un(Yt.getQualityEvidence())},loseContextForTest(){P.simulateContextLossCycle()},floors(){return o.floors},focusFloor(h){if(h!==null&&!o.floors.some(T=>T.index===h))return!1;let g=h??-1;if(M(h!==null),vt(!1),la(g),je("orbit"),h===null)oe.cancel(),qe()?S.frame(o.bounds,!1,Z,n.portraitOverviewCrop===!0,ce):S.frameSoft(o.bounds,Z,n.portraitOverviewCrop===!0,ce),$.setOverviewDistance(S.targetDistance);else{let T=o.floors[h];if(T.seatCount>0){oe.cancel();let V=T.focalWorld[0]-T.center[0],H=T.focalWorld[2]-T.center[2],Q=Math.hypot(V,H)>T.radius*.12?Math.atan2(V,H):Z;S.frame({center:T.center,radius:T.radius,box:T.box},!1,Q,!1,{polarDeg:58,margin:1.12}),$.setOverviewDistance(S.targetDistance)}}return ie.requestRender(),!0},zones(){return o.zones},focusZone(h){let g=o.zones.find(Q=>Q.id===h);if(!g||g.seatCount===0)return!1;M(!1),vt(!1),oe.cancel(),je("orbit"),ht(null),n.onSectionFocusChange?.(null);let T=g.focalWorld[0]-g.center[0],V=g.focalWorld[2]-g.center[2],H=Math.hypot(T,V)>g.radius*.12?Math.atan2(T,V):void 0;return S.frame({center:g.center,radius:g.radius*1.25},!1,H),ie.requestRender(),!0},sections(){return o.sections},focusSection(h){return Bn(h)},rows(h){return h?o.rows.filter(g=>g.sectionId===h):o.rows},seatsInRow(h){return e.seats.filter(g=>g.rowId===h).map(g=>({id:g.id,label:g.displayLabel||g.label}))},focusRow(h){let g=o.rows.find(T=>T.id===h);return!g||g.seatCount===0?!1:(M(!0),vt(!1),oe.cancel(),je("pan"),g.sectionId&&(ht(g.sectionId),n.onSectionFocusChange?.(g.sectionId)),S.frame({center:g.center,radius:Math.max(2.5,g.radius*.65)}),ie.requestRender(),!0)},setReducedMotionForTest(h){I=h},dispose(){A=!0,pe?.dispose(),Cn(!1),Wt(),Ut.remove(),ra.remove(),Hn(),we?.dispose(),ie.stop(),$.dispose(),En?.disconnect(),L&&(L.dispose(),L=null),_(),ye(),P.canvas.removeEventListener("pointerdown",Ce.onDown),P.canvas.removeEventListener("pointermove",Ce.onMove),P.canvas.removeEventListener("pointerup",Ce.onUp),P.canvas.removeEventListener("pointercancel",Ce.onUp),P.canvas.removeEventListener("pointermove",ft),P.canvas.removeEventListener("pointerdown",ft),P.canvas.removeEventListener("pointerleave",_n),Te&&cancelAnimationFrame(Te),S.dispose(),E&&E.dispose(),v&&v.dispose(),v=null,w?.dispose(),w=null,E=null,P.dispose()}};return i.opened(o.seatCount,y,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),Yt}export{ui as VENUE3D_QUALITY_REPORT_VERSION,ua as autoVenue3d,nt as buildSceneModel,Qt as estimateVenue3D,un as inspectVenue3DQualityEvidence,gu as mountVenue3D,Os as prepareVenue3D,zs as prepareVenue3DFromChart};
|
|
1184
|
+
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:_e},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let J=new bt(t,{geometry:Me,program:le});J.frustumCulled=!1,J.setParent(n),Ee.screenProgram=le,ye=!0,Ee.drawCalls=3+(ie?1:0)+1},L.src=Ie.contentImageUrl}return Ee}import{Mesh as En,RenderTarget as ws,Transform as Cn}from"ogl";function xs(t,e,n){let r=t+(e<<8)+(n<<16);return r===0?-1:r-1}function Rr(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 f=(l*e+c)*4,m=xs(t[f],t[f+1],t[f+2]);if(m<0||m>=o)continue;let u=c-r,d=l-a,h=u*u+d*d;h<s&&(s=h,i=m)}return i}function _r(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 Ss=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],Vt=class{constructor(e,n,r,a,o){this.seatScene=new Cn;this.chairScene=new Cn;this.solidScene=new Cn;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=o,this.seatProg=mr(this.gl),this.chairProg=pr(this.gl),this.depthProg=fr(this.gl);let i=new En(this.gl,{geometry:n,program:this.seatProg});i.frustumCulled=!1,i.setParent(this.seatScene);let s=new En(this.gl,{geometry:r,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let l=new En(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 Ss)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 ws(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),f=Math.max(0,r-a),m=Math.max(1,Math.min(s,n+a+1)-c),u=Math.max(1,Math.min(l,r+a+1)-f);o.enable(o.SCISSOR_TEST),o.scissor(c,f,m,u);let[d,h,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(d,h,y,1),o.disable(o.SCISSOR_TEST);let v=new Uint8Array(m*u*4);return this.renderer.bindFramebuffer(i),o.readPixels(c,f,m,u,o.RGBA,o.UNSIGNED_BYTE,v),this.renderer.bindFramebuffer(),Rr(v,m,u,n-c,r-f,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Fr(t,e){let n=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,yo(r.state)):n.push(r);return n}function Ir(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:Se[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 gt,Vec3 as Ps}from"ogl";function Ms(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function Dr(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function As(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function kr(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 Tn(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function Rn(t,e){return Math.max(0,Math.min(1,t+e))}function Lr(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],f=t[Math.min(n-1,o+2)],m=i*i,u=m*i,d=[0,0,0];for(let h=0;h<3;h++)d[h]=.5*(2*l[h]+(-s[h]+c[h])*i+(2*s[h]-5*l[h]+4*c[h]-f[h])*m+(-s[h]+3*l[h]-3*c[h]+f[h])*u);return d}function _n(t,e,n,r,a){let o=kr(Ms(e,n));o[0]===0&&o[1]===0&&o[2]===0&&(o=[0,0,1]);let i=Dr(Dr(e,As(o,2.5)),[0,1.5,0]),s=[e[0]-r[0],0,e[2]-r[2]],l=kr(s);l[0]===0&&l[2]===0&&(l=[o[0],0,o[2]]);let c=Math.max(1,a),f=[r[0]+l[0]*c*1.3,r[1]+c*.75,r[2]+l[2]*c*1.3];return{waypoints:[t,f,i],finalPos:i}}function Fn(t,e,n=35,r=28){let a=Tn(e),o=Lr(t,a),i=Tn(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:o,fov:n+(r-n)*i,eased:a}}function Nr(t,e,n){let r=t.position.clone(),a=new gt().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new Ps(n[0],n[1],n[2]));let o=new gt().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(a),o}var zt=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new gt;this.endQuat=new gt;this.outQuat=new gt;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}=Fn(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,Rn(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 Hr=co,Es=.12,Cs=1.6,Gr=.12;function Br(t,e,n){let r=t[e*3],a=t[e*3+1],o=t[e*3+2],i=n[0]-r,s=n[2]-o,l=Math.hypot(i,s);if(!(l>.001))return null;let c=i/l,f=s/l,m=1/0,u=null;for(let d=0;d*3<t.length;d++){if(d===e)continue;let h=t[d*3]-r,y=t[d*3+2]-o,v=h*c+y*f;v<.3||v>1.6||Math.abs(h*f-y*c)>.6||v<m&&(m=v,u=a-t[d*3+1])}return u}var Ts=.25,Rs=1.5;function Wr(t,e,n=0,r,a,o=!1){let i=[e.x*qe,n+Rs,e.y*qe],s=a?[a[0],a[1],a[2]]:i,l=t[1],c=Number.isFinite(l)?l+(o?Cs:Hr):Number.isFinite(r)?n+r:n+Hr,f=i[0]-t[0],m=i[2]-t[2],u=Math.hypot(f,m),d=u>.001?Math.min(Es,u*Ts):0,h=u>.001?f/u:0,y=u>.001?m/u:0;return{eye:[t[0]+h*d,c,t[2]+y*d],focal:s}}var Le=Math.PI/180,_s=45,In=80,Ot=70,Fs=1,Is=.99;function Ds(t,e){if(!(t<Fs))return In;if(!(Number.isFinite(e)&&e>0))return Ot;let n=2*Math.atan(e/(2*Nt*Is)/Math.max(.05,t))/Le;return Math.max(Ot,Math.min(In,n))}var ks=.25,Nt=1,Ls=.25,Vs=12*Le,zs=.2,Os=1.5,Ur=.8,Yr=6,Zr=1.9,Ns=2/3,Hs=.12,Gs=.9,Bs=1.2,Ws=2,Qr=.05,Us=6;function Jr(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 h of t)r=Math.min(r,h.cx-h.halfX),a=Math.max(a,h.cx+h.halfX),o=Math.min(o,h.cz-h.halfZ),i=Math.max(i,h.cz+h.halfZ),s=Math.max(s,h.y);let l=a-r,c=i-o,f=Math.max(l,Math.min(c,Yr))/2,m=Math.max(c,Math.min(l,Yr))/2,u=(r+a)/2,d=(o+i)/2;return{min:[u-f,n,d-m],max:[u+f,Math.max(n+Ur,s),d+m]}}function Ys(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+Zr,t.max[2]]}}function Dn(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+Os,e+zs,e+Zr*Ns),(t.min[2]+t.max[2])/2]}function ea(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 Xr(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 f=1/0,m=-1/0;for(let u=0;u<8;u++){let d=(u&1?n.max[0]:n.min[0])-t[0],h=(u&2?n.max[1]:n.min[1])-t[1],y=(u&4?n.max[2]:n.min[2])-t[2],v=Math.max(Qr,d*r+h*a+y*o),x=(d*s+y*l)/v;x<f&&(f=x),x>m&&(m=x)}return m-f}function $r(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 f=-l*a,m=l*r-s*o,u=s*a,d=1/0,h=-1/0;for(let y=0;y<8;y++){let v=(y&1?n.max[0]:n.min[0])-t[0],x=(y&2?n.max[1]:n.min[1])-t[1],T=(y&4?n.max[2]:n.min[2])-t[2],A=Math.max(Qr,v*r+x*a+T*o),F=(v*f+x*m+T*u)/A;F<d&&(d=F),F>h&&(h=F)}return h-d}function Ht(t,e){return Math.tan(t*Le/2)*Math.max(.05,e)}function qr(t,e,n){let r=Ds(n,t),a=l=>Math.max(_s,Math.min(r,l)),o=l=>2*Math.atan(l)/Le,i=Number.isFinite(t)&&t>0?a(o(t/(2*ks)/Math.max(.05,n))):r;if(!(Number.isFinite(e)&&e>0))return i;let s=Math.min(i,a(o(e/(2*Hs))));return t/(2*Ht(s,n))>Nt?i:s}function ta(t,e,n,r={}){let a=Dn(e),o=[t[0],t[1],t[2]],i=0,s=0,l=h=>{if(!(h>0))return;let y=ea(o,a);o[0]+=y.x*h,o[2]+=y.z*h,s+=h},c=r.preserveEye?0:e.max[1]+Ls-o[1];c>0&&(o[1]+=c,i=c,l(c/Math.tan(Vs)));let f=Ys(e),m=Xr(o,a,e),u=qr(m,$r(o,a,f),n),d=m/(2*Ht(u,n));for(let h=0;!r.preserveEye&&h<Us&&d>Nt;h++){let y=Math.max(1,Math.hypot(o[0]-a[0],o[2]-a[2])),v=Number.isFinite(d)?d/Nt:2;l(Math.min(60,y*(Math.min(4,v)-1)+.5)),m=Xr(o,a,e),u=qr(m,$r(o,a,f),n),d=m/(2*Ht(u,n))}return{eye:o,focal:a,fov:u,raisedM:i,pulledBackM:s,stageFrameWidth:d}}function Xs(t,e,n){let r=Math.tan(e*Le/2),a=Ht(e,n);return Math.max(1,t/Math.max(.05,Math.min(r,a)))}var $s=.7,jr=.5,qs=.8;function Kr(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)))/Le}function js(t,e,n){let r=c=>{let f=Math.hypot(c[0],c[1],c[2])||1;return[c[0]/f,c[1]/f,c[2]/f]},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-jr)+s[c]*jr));return[t[0]+l[0]*o,t[1]+l[1]*o,t[2]+l[2]*o]}function na(t,e){let{aspect:n,venue:r}=e,a=t.focal,o=ea(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=Ws*(e.rowDepthM??Gs),c=[t.eye[0]+o.x*l,t.eye[1]+Bs,t.eye[2]+o.z*l],f=[t.eye[0],t.eye[1]-$s,t.eye[2]],m=js(c,a,f);s.push({name:"row",eye:c,focal:m,fov:Math.min(In,Math.max(t.fov,2*Math.max(Kr(c,m,f),Kr(c,m,a))/qs))});let u=(y,v,x,T)=>{let A=Xs(x,t.fov,n)*1.08,F=A*Math.sin(T*Le),S=Number.isFinite(e.seatingTopY)?e.seatingTopY+2:-1/0,_=Math.max(F,S-v[1]),V=A*Math.cos(T*Le);return{name:y,eye:[v[0]+o.x*V,v[1]+_,v[2]+o.z*V],focal:v,fov:t.fov}};e.section&&e.section.radius>0&&s.push(u("section",e.section.center,e.section.radius,35)),s.push(u("venue",r.center,Math.max(1,r.radius),40));let d=[],h=-1/0;for(let y of s){let v=i(y.eye);d.length&&v<=h+.5||(d.push(y),h=v)}return d}import{Vec3 as Ks}from"ogl";var xt=Math.PI/180,kn=320,oa=70*xt,Zs=32*xt,Qs=24*xt,ra=.0026,Js=.22,el=.006,tl=180,nl=900,ol=1100,rl=4,be=(t,e,n)=>Math.max(e,Math.min(n,t)),aa=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function ia(t){let{canvas:e,camera:n}=t,r=[],a=!1,o=0,i=0,s=0,l=0,c=0,f=0,m=kn,u=null,d=()=>{u&&(clearTimeout(u),u=null)},h=!1,y=[0,0],v=0,x=!1,T=null,A=null,F=new Map,S=!1,_=0,V=0,g=0,D=0,w=()=>a&&r.length?r[be(Math.round(o),0,r.length-1)].name:null,I=()=>{let R=w();R!==T&&(T=R,t.onStopChange?.(R))},N=()=>{if(!a||!r.length)return;let R=r[be(Math.floor(o),0,r.length-1)],M=r[be(Math.ceil(o),0,r.length-1)],q=be(o-Math.floor(o),0,1),$=(ae,Ee)=>ae+(Ee-ae)*q,oe=[$(R.eye[0],M.eye[0]),$(R.eye[1],M.eye[1]),$(R.eye[2],M.eye[2])],Q=[$(R.focal[0],M.focal[0]),$(R.focal[1],M.focal[1]),$(R.focal[2],M.focal[2])],C=Q[0]-oe[0],me=Q[1]-oe[1],ie=Q[2]-oe[2],ye=Math.hypot(C,me,ie)||1,xe=Math.atan2(C,ie),Me=Math.asin(be(me/ye,-1,1)),le=xe+i,_e=be(Me+s,-80*xt,80*xt),Fe=Math.cos(_e)*ye;C=Math.sin(le)*Fe,me=Math.sin(_e)*ye,ie=Math.cos(le)*Fe,n.position.set(oe[0],oe[1],oe[2]),n.fov=$(R.fov,M.fov),n.updateProjectionMatrix(),n.lookAt(new Ks(oe[0]+C,oe[1]+me,oe[2]+ie)),t.onApplied?.()},P=()=>{if(!a||!r.length)return;let R=be(Math.round(o),0,r.length-1);if(t.reducedMotion()){h=!1,o=R,N(),I(),t.requestRender();return}if(Math.abs(R-o)<.001){h=!1,I();return}l=o,c=R,f=performance.now(),m=kn,h=!0,t.requestRender()},O=R=>{!a||r.length<2||(d(),h=!1,o=be(o+R,0,r.length-1),N(),I(),t.requestRender())},G=(R,M)=>{a&&(d(),h=!1,x=!1,i=be(i-R*ra,-oa,oa),s=be(s-M*ra,-Qs,Zs),N(),t.requestRender())},U=R=>{a&&(F.set(R.pointerId,{x:R.clientX,y:R.clientY}),F.size===1?(S=!0,D=0,_=R.clientX,V=R.clientY):F.size===2&&(S=!1,g=B()))},B=()=>{let R=[...F.values()];return R.length<2?0:Math.hypot(R[0].x-R[1].x,R[0].y-R[1].y)},H=R=>{if(!a||!F.has(R.pointerId))return;if(F.set(R.pointerId,{x:R.clientX,y:R.clientY}),F.size>=2){let $=B();g>0&&O((g-$)*el),g=$;return}if(!S)return;let M=R.clientX-_,q=R.clientY-V;_=R.clientX,V=R.clientY,D+=Math.abs(M)+Math.abs(q),!(D<=rl)&&G(M,q)},ee=R=>{F.delete(R.pointerId)&&(F.size<2&&(g=0),F.size===0&&(S=!1,P()))},K=R=>{if(!a)return;R.preventDefault();let M=R.deltaMode===1?16:R.deltaMode===2?100:1,q=be(R.deltaY*M/100,-2,2);O(q*Js),A&&clearTimeout(A),A=setTimeout(()=>{A=null,P()},tl)},te=()=>{d(),a&&(a=!1,h=!1,x=!1,r=[],F.clear(),S=!1,A&&(clearTimeout(A),A=null),T!==null&&(T=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",U),e.addEventListener("pointermove",H),e.addEventListener("pointerup",ee),e.addEventListener("pointercancel",ee),e.addEventListener("wheel",K,{passive:!1}),{get active(){return a},enter(R,M=0){if(R.length<2){te();return}d(),r=R,a=!0,o=t.reducedMotion()?0:be(M,0,R.length-1),o>0&&(u=setTimeout(()=>{u=null,a&&(l=o,c=0,f=performance.now(),m=ol,h=!0,t.requestRender())},nl)),i=0,s=0,h=!1,x=!1,T=null,N(),I(),t.requestRender()},exit:te,recentre(){return a?Math.abs(i)<1e-4&&Math.abs(s)<1e-4?!0:t.reducedMotion()?(x=!1,i=0,s=0,N(),t.requestRender(),!0):(y=[i,s],v=performance.now(),x=!0,t.requestRender(),!0):!1},update(R){if(!a)return!1;let M=!1;if(x){let q=be((R-v)/kn,0,1),$=1-aa(q);i=y[0]*$,s=y[1]*$,q>=1?(x=!1,i=0,s=0):M=!0}if(h){let q=be((R-f)/m,0,1);o=l+(c-l)*aa(q),q>=1?(h=!1,o=c,I()):M=!0}return N(),M},currentStop:w,dispose(){te(),e.removeEventListener("pointerdown",U),e.removeEventListener("pointermove",H),e.removeEventListener("pointerup",ee),e.removeEventListener("pointercancel",ee),e.removeEventListener("wheel",K)}}}function sa(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}function la(t,e){return t?-1:e}var Ln=null;function ca(){return Ln??=import("../openPanorama-VD6PE3YZ.js").catch(t=>{throw Ln=null,t}),Ln}var ua=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Gt=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=ua(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(ua()-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 da(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function ha(t){let{container:e,model:n,opts:r,expandedSeatById:a,seatIdsByRow:o,isNarrow:i}=t,s=null,l=()=>{if(!s)return;let m=i();Object.assign(s.style,m?{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:(m,u,d=!1)=>{if(c(),t.isDisposed())return null;let h=document.createElement("div");h.setAttribute("role","group"),Object.assign(h.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 x=a.get(m),T=x?.sectionId?n.sections.find(w=>w.id===x.sectionId):void 0,A=x?.label??m;h.setAttribute("aria-label",`Explore views near ${T?.label?`${T.label}, `:""}seat ${A}`);let F=document.createElement("span");F.textContent=r.seatViewCaption?.(m)??["Live 3D seat view",T?.label,A].filter(Boolean).join(" \xB7 "),Object.assign(F.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&&h.appendChild(F);let S=document.createElement("div");Object.assign(S.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),h.appendChild(S);let _=x?.rowId?o.get(x.rowId):void 0,V=_?.indexOf(m)??-1,g=V>=0?[_?.[V-1],_?.[V+1]]:[void 0,void 0],D=(w,I,N,P=!1)=>{let O=document.createElement("button");O.type="button",O.textContent=w,O.setAttribute("aria-label",I),Object.assign(O.style,{minHeight:"44px",padding:P?"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"}),P||(O.style.minWidth="44px"),P&&(O.dataset.panoramaTrigger=""),O.addEventListener("click",N),S.appendChild(O)};if(v&&g[0]){let w=a.get(g[0])?.label??g[0];D("\u2039",`View previous seat ${w}`,()=>{t.flyToSeat(g[0])})}if(v&&r.getSeatView){let w=r.seatViewActionLabel?.(m)??"Open 360\xB0 panorama";D(d?`\u21BB Retry ${w}`:`\u25C9 ${w}`,`${d?"Retry":w} from seat ${A}`,()=>{if(t.isDisposed()||u!==t.flightGen()){c();return}c(),t.openPanorama(m,400,u)},!0)}if(v&&g[1]){let w=a.get(g[1])?.label??g[1];D("\u203A",`View next seat ${w}`,()=>{t.flyToSeat(g[1])})}return!S.childElementCount&&!y?null:(e.appendChild(h),s=h,l(),h)},remove:c,layout:l}}var al={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function ma(t){let{container:e,orbit:n,isNarrow:r}=t,a={...al,...t.labels??{}},o=(S,_)=>{S.setAttribute("aria-label",_),S.title=_},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 f=document.createElement("button");f.type="button",f.textContent="\u21BB",o(f,a.rotate);let m=document.createElement("button");m.type="button",m.textContent="\u2725",o(m,a.move);let u=document.createElement("button");u.type="button",u.textContent="\u2212",o(u,a.zoomOut);let d=document.createElement("button");d.type="button",d.textContent="+",o(d,a.zoomIn);for(let S of[f,m,u,d])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(f,m),c.append(d,u);let h=null,y=()=>{let S=n.dragAction();if(S===h)return;h=S;let _=S==="orbit";f.setAttribute("aria-pressed",String(_)),m.setAttribute("aria-pressed",String(!_)),f.style.background=_?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",m.style.background=_?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",i.title=_?`${a.rotate} \xB7 ${a.move} with Shift`:`${a.move} \xB7 ${a.rotate} with Shift`},v=S=>{n.setPrimaryDragMode(S),y()};f.addEventListener("click",()=>v("orbit")),m.addEventListener("click",()=>v("pan"));let x=()=>{let{atMin:S,atMax:_}=n.dollyLimitState();d.disabled!==S&&(d.disabled=S),u.disabled!==_&&(u.disabled=_)};u.addEventListener("click",()=>{n.zoomBy(dt),x()}),d.addEventListener("click",()=>{n.zoomBy(Ke),x()}),i.append(l,c),v("auto"),e.appendChild(i);let T=t.enabled!==!1,A=()=>{let S=r();i.style.display=s||!T?"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",d.style.display=S?"none":"",u.style.display=S?"none":""};return A(),{element:i,utilityControls:c,setNavigationMode:v,syncNavigationMode:y,syncZoomLimits:x,setSeatViewLocked:S=>{s=S,n.setInteractionEnabled(!S),A()},seatViewLocked:()=>s,layout:A}}var il=.5,pa=12,fa=20,sl=28;function ll(t,e,n){return!(t>0)||!(n>0)?0:il*n/(2*t*Math.tan(e*Math.PI/360))}function va(t){let{glctx:e,orbit:n,model:r,seats:a,opts:o,cinematic:i,analytics:s,seatIdByIndex:l,sectionIdBySeatId:c,tapSlop:f,tapMs:m,cancelFlight:u,focusSectionCamera:d,setSelection:h,ensureSeatView:y}=t,v=0,x=0,T=0,A=-1,F=!1,S=!1,_=P=>{t.seatViewLocked()||A===-1&&(A=P.pointerId,v=P.clientX,x=P.clientY,T=performance.now(),F=!1,S=i.active,i.active&&(s.cinematicCancelled(),u(),o.onViewTargetChange?.(null)))},V=P=>{P.pointerId===A&&Math.hypot(P.clientX-v,P.clientY-x)>f&&(F=!0)},g=(P,O,G,U,B)=>{let H=e.canvas.getBoundingClientRect(),ee=e.canvas.clientWidth||H.width||1,K=e.canvas.clientHeight||H.height||1,te=P-H.left,R=O-H.top,M=U*U,q=-1,$=M,oe=1/0;for(let Q of a){if(G&&Q.sectionId!==G)continue;let C=r.seats.idToIndex.get(Q.id);if(C===void 0)continue;if(B){let le=Math.round(r.seats.iState[C]??0);if(le!==0&&le!==3)continue}let me=C*3,ie=Te(n.camera.projectionViewMatrix,[r.seats.iPosition[me],r.seats.iPosition[me+1]+.55,r.seats.iPosition[me+2]],ee,K);if(!ie.visible)continue;let ye=ie.x-te,xe=ie.y-R,Me=ye*ye+xe*xe;(Me<$||Math.abs(Me-$)<1&&ie.depth<oe)&&(q=C,$=Me,oe=ie.depth)}return q},D=(P,O)=>{let G=t.gpu(),U=t.pick();if(!G||!U)return-1;U.syncFromSeatProgram(G.seatProgram);let B=e.canvas.getBoundingClientRect(),H=e.renderer.dpr,{x:ee,y:K}=_r(P,O,B,H,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),te=Math.max(2,Math.round(8*H));return U.pick(n.camera,ee,K,te)},w=()=>e.canvas.clientHeight||e.canvas.getBoundingClientRect().height,I=(P,O=pa)=>{let G=n.camera?.position;if(!G)return!1;let U=P*3,B=Math.hypot(G.x-r.seats.iPosition[U],G.y-r.seats.iPosition[U+1],G.z-r.seats.iPosition[U+2]);return ll(B,n.fovY,w())>=O};return{onDown:_,onMove:V,onUp:P=>{if(P.pointerId!==A)return;let O=!F&&performance.now()-T<m;if(A=-1,S){S=!1;return}let G=t.gpu(),U=t.pick();if(!O||!G||!U)return;let B=D(P.clientX,P.clientY),H=P.pointerType==="touch"||P.pointerType==="pen",ee=H?fa:pa,K=B>=0&&I(B,ee),te=!1;if(t.focusedSectionId()&&B>=0){let q=l[B],$=q?c.get(q):void 0;if($&&$!==t.focusedSectionId()&&d($,{keepCamera:K})){if(!K)return;te=!0}}if(t.focusedSectionId()&&B<0&&(B=g(P.clientX,P.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&B<0){let q=g(P.clientX,P.clientY,null,72,!1),$=q>=0?l[q]:void 0,oe=$?c.get($):void 0;if(oe&&oe!==t.focusedSectionId()&&d(oe))return}if(!t.focusedSectionId()){B<0&&(B=g(P.clientX,P.clientY,null,42,!1));let q=B>=0?l[B]:void 0,$=q?c.get(q):void 0;if($&&d($,{keepCamera:K})){if(!K)return;te=!0}}if(B<0||B>=l.length){t.selection().size&&(h([]),o.onViewTargetChange?.(null));return}let R=l[B];if(H&&t.focusedSectionId()&&!te&&!I(B,fa)){t.focusSeatCamera(R,{seatPx:sl,viewportHeightPx:w()});return}let M=Se[Math.round(r.seats.iState[B]??0)]??"available";if(M!=="available"&&M!=="selected"){o.onSeatInspect?.(R,M);return}if(t.selection().has(R)&&t.selection().size===1){h([]),o.onViewTargetChange?.(null),o.onSeatPick?.(R);return}h([R]),y(R),s.seatPicked(R,c.get(R)),o.onSeatPick?.(R)}}}var Bt=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 d=0;d<this.count;d++){let h=e[d*3],y=e[d*3+2];h<n&&(n=h),h>a&&(a=h),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),f=d=>{let h=Math.min(this.cols-1,Math.max(0,Math.floor((e[d*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[d*3+2]-r)/this.cell)))*this.cols+h};for(let d=0;d<this.count;d++)c[f(d)+1]++;for(let d=0;d<l;d++)c[d+1]+=c[d];let m=new Int32Array(this.count),u=c.slice(0,l);for(let d=0;d<this.count;d++)m[u[f(d)]++]=d;this.cellStart=c,this.cellItems=m}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,f=Math.floor((e-this.minX)/this.cell),m=Math.floor((n-this.minZ)/this.cell),u=Math.ceil(r/this.cell)+1,d=this.iPosition,h=0;for(let y=0;y<=u&&h<l;y++){let v=m-y,x=m+y,T=f-y,A=f+y;for(let F=v;F<=x&&h<l;F++){if(F<0||F>=this.rows)continue;let S=F===v||F===x;for(let _=T;_<=A&&h<l;_++){if(!S&&_!==T&&_!==A){_=A-1;continue}if(_<0||_>=this.cols)continue;let V=F*this.cols+_;for(let g=i[V],D=i[V+1];g<D&&h<l;g++){let w=s[g],I=d[w*3]-e,N=d[w*3+2]-n,P=o===void 0?0:d[w*3+1]-o;I*I+P*P+N*N<=c&&(a[h++]=w)}}}}return h}};var Wt=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Dt);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Bt(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)<gn)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>bn){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(a.x,a.z,bn,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 ba(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 cl,Vec3 as ul}from"ogl";function ga(){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 ya(t){let{container:e,model:n,opts:r,orbit:a,cinematic:o,analytics:i,loop:s,labelOverlay:l,stageAzimuth:c,overviewFraming:f}=t,m=0,u=-1,d=(w,I,N=28)=>{a.camera.position.set(w[0],w[1],w[2]),a.camera.lookAt(new ul(I[0],I[1],I[2])),a.camera.fov=N,a.camera.updateProjectionMatrix()},h=document.createElement("button");h.className="sl-3d-overview-control sl-3d-icon-control",h.type="button",h.replaceChildren(ga());let y=r.navLabels?.fitView??"Show whole venue";h.setAttribute("aria-label",y),h.title=y,Object.assign(h.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=()=>{h.firstElementChild||h.replaceChildren(ga())};v();let x=w=>{u=w;let I=t.gpu();I&&(I.seatProgram.uniforms.uFocusFloor.value=w,I.solidProgram.uniforms.uFocusFloor.value=w,I.chairProgram.uniforms.uFocusFloor.value=w),t.showSectionSeatLabels(null)},T=null,A=!1,F=()=>{if(T=null,A=!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(),h.style.display="",l.setVisible(!0),t.setFrozen(!1);let w=u>=0?n.floors[u]:null;if(t.setNearFieldDetailEnabled(!!w),t.setSeatViewLocked(!1),S(),t.removeArriveChip(),t.setNavigationMode("auto"),w){let I=w.focalWorld[0]-w.center[0],N=w.focalWorld[2]-w.center[2],P=Math.hypot(I,N)>w.radius*.12?Math.atan2(I,N):c,O={center:w.center,radius:w.radius,box:w.box},G={polarDeg:58,margin:1.12};t.reducedMotion()?a.frame(O,!1,P,!1,G):a.frameSoft(O,P,!1,G)}else t.reducedMotion()?a.frame(n.bounds,!1,c,r.portraitOverviewCrop===!0,f):a.frameSoft(n.bounds,c,r.portraitOverviewCrop===!0,f);l.setOverviewDistance(a.targetDistance),t.showSectionSeatLabels(null),s.requestRender()},S=()=>{m++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),o.active&&(o.cancel(),a.resumeAfterFlight(n.focalWorld))},_=w=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let I=n.seats.idToIndex.get(w);if(I===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(w),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),t.setPanoramaSphereVisible(!1),h.style.display="",t.restorePanoramaLayer()),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.setFrozen(!1);let N=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(N),t.setSeatViewLocked(!1);let P=++m;N?t.showArriveChip(w,P):t.removeArriveChip();let{eye:O,focal:G}=t.resolvedSeatViewPose(w,I),U=r.arriveAtSeatEye?t.seatViewArrival(w,I):null,B=U&&U.stops.length>1&&U.stops[1].name==="row"?U.stops[1]:null,H=U?U.focal:G,ee=[a.camera.position.x,a.camera.position.y,a.camera.position.z],K=_n(ee,U?.eye??O,H,n.bounds.center,n.bounds.radius),te=B?B.eye:U?U.eye:r.arriveAtSeatEye?O:K.finalPos,R=U?U.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?Ot:65:28,M=[K.waypoints[0],K.waypoints[1],te];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),d(te,H,R),s.requestRender(),i.cinematicSkipped(),t.isDisposed()||a.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),U&&t.enterSeatView(U.stops),t.showArriveChip(w,P),Promise.resolve();let q=new cl().copy(a.camera.quaternion),$=Nr(a.camera,te,H);s.requestRender();let oe=N?700:2500;return o.start(M,q,$,oe,R).then(()=>{t.isDisposed()||P!==m||(t.setSeatStepping(!1),i.cinematicPlayed(oe),a.resumeAfterFlight(H),t.setSeatViewLocked(r.arriveAtSeatEye===!0),U&&t.enterSeatView(U.stops,B?1:0),s.requestRender(),t.showArriveChip(w,P))})},V=(w,I)=>{let N=n.sections.find(P=>P.id===w);if(!N||N.seatCount===0)return!1;if(T=w,A=!1,t.setSeeThrough?.(null),t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),o.cancel(),t.removeArriveChip(),n.floors.length>1&&u!==N.floorIndex&&x(N.floorIndex),t.setNavigationMode("auto"),t.panorama()||l.setVisible(!0),t.showSectionSeatLabels(w),!I?.keepCamera){let P=ba(N),O={polarDeg:P.polarDeg,margin:1.12};t.reducedMotion()?a.frame({center:P.center,radius:P.radius},!1,a.currentAzimuth,!1,O):a.glideTo({center:P.center,radius:P.radius},O)}return r.onSectionFocusChange?.(w),s.requestRender(),!0},g=(w,I)=>{if(t.isDisposed()||!t.gpu())return!1;let N=n.seats.idToIndex.get(w);if(N===void 0)return!1;let P=N*3,O=[n.seats.iPosition[P],n.seats.iPosition[P+1]+.55,n.seats.iPosition[P+2]],G=I?dl(I,a.fovY,a.camera.aspect||1):xa;return A=!0,t.setSeeThrough?.(O),t.reducedMotion()?a.frame({center:O,radius:G},!1,void 0,!1,Vn):a.frameSoft({center:O,radius:G},void 0,!1,Vn),s.requestRender(),!0},D=()=>{if(t.isNarrow?.()&&A&&T&&V(T)){s.requestRender();return}F()};return h.addEventListener("click",D),{overviewChip:h,layoutOverviewChip:v,flightGen:()=>m,focusedFloor:()=>u,applyFloorFocus:x,placeCameraFinal:d,cancelFlight:S,focusOverview:F,flyToSeat:_,focusSectionCamera:V,focusSeatCamera:g}}var xa=4.5;function dl(t,e,n){let r=Math.tan(e*Math.PI/360),a=r*Math.max(.001,n),i=hl*t.viewportHeightPx/(2*Math.max(1,t.seatPx)*r)*Math.min(r,a)/Vn.margin;return Math.max(ml,Math.min(xa,i))}var hl=.5,ml=1.5,Vn={polarDeg:48,margin:1.25};function zn(t,e,n,r,a,o,i,s,l=.5){let c=-1,f=s*s,m=1/0;for(let u=0;u<e;u++){let d=u*3,h=Te(n,[t[d],t[d+1]+l,t[d+2]],r,a);if(!h.visible)continue;let y=h.x-o,v=h.y-i,x=y*y+v*v;(x<f-4||x<f+4&&h.depth<m)&&(c=u,f=Math.min(f,x),m=h.depth)}return c}function wa(t){let e=performance.now(),{input:n,estimate:r}=Lo(t);return{model:ut(n),buildMs:performance.now()-e,source:"main",...r?{estimate:r}:{}}}function pl(t){let e=oo(t.doc);return{...wa({...t,seats:e}),seats:e}}function Sa(t,e,n){let r=o=>({...e(),fallbackReason:o});if(typeof Worker>"u")return Promise.resolve(r("unavailable"));let a;try{a=new Worker(new URL("./scene/scene.worker.js",import.meta.url),{type:"module"})}catch{return Promise.resolve(r("unavailable"))}return new Promise(o=>{let i=!1,s=f=>{i||(i=!0,clearTimeout(c),a.terminate(),o(f))},l=f=>s(r(f)),c=window.setTimeout(()=>l("timeout"),15e3);a.onerror=()=>l("worker_error"),a.onmessage=f=>{let m=n(f.data);m?s(m):l("bad_response")},a.postMessage(t)})}function fl(t){return Sa(t,()=>wa(t),({model:e,buildMs:n,estimate:r})=>({model:e,buildMs:n,source:"worker",...r?{estimate:r}:{}}))}function vl(t){return Sa(t,()=>pl(t),({model:e,buildMs:n,seats:r,estimate:a})=>r?{model:e,buildMs:n,seats:r,source:"worker",...a?{estimate:a}:{}}:null)}var gl=40,yl=48,xl=Math.PI/180,wl=6,Sl=500,Ml=6;function nd(t,e,n={}){let r=performance.now(),a=e.prepared?e.prepared.estimate:e.estimate===!1?null:dn(e.doc,e.seats);a&&(e={...e,doc:a.doc,seats:ko(e.seats,a)});let o=e.prepared?.model??ut(e),i=new Gt(n.onAnalytics),s=new Array(o.seats.count);for(let[p,b]of o.seats.idToIndex)s[b]=p;let l=new Map(e.seats.map(p=>[p.id,p])),c=new Map;for(let p of e.seats){if(!p.rowId)continue;let b=c.get(p.rowId);b?b.push(p.id):c.set(p.rowId,[p.id])}let f=new Map,m=[0,0,0,0];function u(){if(v)for(let p of[v.seatProgram,v.solidProgram,v.chairProgram])p.uniforms.uSeeThrough.value=m}e.seats.forEach((p,b)=>{f.set(p.id,o.seatSectionIds?.[b]??p.sectionId)});let d=new Map;for(let[p,b]of o.seats.idToIndex){let E=f.get(p);if(!E)continue;let z=d.get(E);z?z.push(b):d.set(E,[b])}let h=()=>{if(!v||!o.sectionSolidRanges.length)return;let{lit:p,anyUnlit:b}=Mr(o.sectionSolidRanges,d,o.seats.iState);v.setSectionShellLit(b?p: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,x=null,T=null,A=!1,F=!1,S=!1,_=new Map,V=null,g=null,D=null,w=new Map,I=null,N=()=>{D===null&&(D=t.style.zIndex,t.style.zIndex="20")},P=()=>{D!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=D),D=null)},O=!1,G=()=>O?ve.focusedFloor():-1,U=()=>{v=Tr(M.gl,o),x?.dispose(),x=Qo(M.gl,[1,1,1],o.theme.seatStates.selected),Un(!1),h(),ne(),T=new Vt(M.renderer,v.seatGeometry,v.chairGeometry,v.solidGeometry,o.seats.count),M.setClearColor(o.theme.background.top),T.setRestoreClear(o.theme.background.top),T.setRoomCentre(o.room?.centre),v.seatProgram.uniforms.uSeatRadius.value=lt*o.theme.seatScale,v.seatProgram.uniforms.uFocusFloor.value=G(),v.solidProgram.uniforms.uFocusFloor.value=G(),v.chairProgram.uniforms.uFocusFloor.value=G(),v.screenProgram&&(v.screenProgram.uniforms.uFocusFloor.value=G()),u(),H.forceRegather()},B=!1,H=new Wt({model:o,orbit:()=>C,gpu:()=>v}),ee=!1,K=new Map,te=24,R=p=>H.setDetailEnabled(p),M=new Tt(t,{onContextLost:()=>{S||i.contextLost(),A=!0,ce.stop(),v=null,T=null,q.reset()},onContextRestored:()=>{U(),A=!1,S||i.contextRestored(),ce.requestRender()}}),q=new Rt(M.gl,M.renderer,M.smoothingSamples),$=new _t,oe=!1,Q=(p,b)=>{if(!v)return{smooth:!1,onBudget:!1};if(o.seatCount<=Ho||v.nearSeatCount()>0||!p)return{smooth:!0,onBudget:!1};let E=$.allows(b);return{smooth:E,onBudget:E}},C=new Ft(M.gl,M.canvas,()=>ce.requestRender(),()=>i.orbitEngaged());C.setAspect(M.aspect);let me=(e.doc.floors?.flatMap(p=>p.objects)??e.doc.objects).some(p=>p.type==="section"&&p.physical3dProvenance?.surfaceKind?.status==="inferred"),ie=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(me&&o.stages.length===0))return Vo(o.focalWorld,o.seats.iPosition,o.bounds)})(),ye=(e.doc.floors?.flatMap(p=>p.objects)??e.doc.objects).some(p=>p.type==="shape"&&p.stageKind?.startsWith("pitch-")),xe=o.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:ye?36:48,margin:1.05},Me=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;C.frame(o.bounds,!Me&&n.skipInitialOverviewAnimation!==!0,ie,n.portraitOverviewCrop===!0,xe);let le=new zt(C.camera),_e=da(t),Fe=zo(t,o),ae=new kt(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:o.theme.background.top}),Ee=o.labels,Ie=()=>Ao(Ee,o.floors.length,G());ae.setLabels(Ie()),ae.setOverviewDistance(C.targetDistance);let L=()=>{let p=new Map,b=Se.indexOf("available");for(let E of Ee){if(!E.wheelchairSeats)continue;let z=0;for(let W of E.wheelchairSeats)o.seats.iState[W]===b&&z++;z>0&&p.set(E.id,z)}return ae.setWheelchairFree(p)};L();let Y=null,J=()=>[..._.keys()].flatMap(p=>{let b=o.seats.idToIndex.get(p),E=b===void 0?void 0:e.seats[b];if(b===void 0||E?.id!==p)return[];let z=b*3;return[{id:`seat:${p}`,kind:"seat",seatWidthM:o.seats.iChairWidth[b]*2,text:E.displayLabel||E.label,anchor:[o.seats.iPosition[z],o.seats.iPosition[z+1]+1.05,o.seats.iPosition[z+2]],pinBase:Yt(z)}]}),X=-1,ne=()=>{v&&(X=Y?o.sections.findIndex(p=>p.id===Y):-1,v.seatProgram.uniforms.uFocusSection.value=X,v.chairProgram.uniforms.uFocusSection.value=X)},se=p=>{if(Y=p,ne(),ae.setForcedDense(!!p),!p){let k=J(),de=new Set(k.map(ue=>ue.id));ae.setLabels([...Ie().filter(ue=>!de.has(ue.id)),...k]);return}let b=e.seats.filter(k=>f.get(k.id)===p),E=new Set(b.map(k=>k.id)),z=new Set(b.map(k=>k.rowId)),W=new Set(_.keys()),j=new Set(b.filter(k=>W.has(k.id)).map(k=>k.id)),Z=Ie().filter(k=>k.kind!=="row"&&k.kind!=="seat"&&k.kind!=="access"||k.kind==="access"&&E.has(k.id.slice(7))||(k.kind==="row"?z.has(k.id.slice(4)):E.has(k.id.slice(5))));if(o.seatCount<=6e3&&j.size===0){ae.setLabels(Z);return}let re=b,pe=new Set(re.map(k=>`seat:${k.id}`)),ge=re.flatMap(k=>{let de=o.seats.idToIndex.get(k.id);if(de===void 0)return[];let ue=de*3;return[{id:`seat:${k.id}`,kind:"seat",seatWidthM:o.seats.iChairWidth[de]*2,rowId:k.rowId,text:W.has(k.id)?k.displayLabel||k.label:Do(k.displayLabel||k.label),anchor:[o.seats.iPosition[ue],o.seats.iPosition[ue+1]+(W.has(k.id)?1.05:.55),o.seats.iPosition[ue+2]],...W.has(k.id)?{pinBase:Yt(ue)}:{}}]});ae.setLabels([...Z.filter(k=>!pe.has(k.id)),...ge])};U();let Ae=null,Ut=null,On=new bl,wt=p=>{if(A||!v||F)return!1;let b=sa({flying:le.active,panoramaMounted:V!==null,seatViewActive:Ae?.active===!0}),E=la(Ae?.active===!0,G());v.seatProgram.uniforms.uFocusFloor.value=E,v.solidProgram.uniforms.uFocusFloor.value=E,v.chairProgram.uniforms.uFocusFloor.value=E,v.screenProgram&&(v.screenProgram.uniforms.uFocusFloor.value=E);let z=b==="orbit"?X:-1;v.seatProgram.uniforms.uFocusSection.value=z,v.chairProgram.uniforms.uFocusSection.value=z;let W=ee?!1:b==="cinematic"?le.update(performance.now()):b==="seatView"?Ae.update(performance.now()):b==="orbit"?C.update():!1;Ut?.syncZoomLimits(),Ut?.syncNavigationMode();let j=G()>=0?o.floors[G()]:null,Z=j?.radius??o.bounds.radius,re=qo(C.currentDistance,Z),pe=B?{center:[C.camera.position.x,C.camera.position.y,C.camera.position.z],radius:520}:o.clipBounds??o.renderBounds;C.updateClipping(pe);let ge=j?.center??o.renderBounds.center,k=j?.radius??o.renderBounds.radius,de=(Pe,on)=>Math.hypot(C.camera.position.x-Pe[0],C.camera.position.y-Pe[1],C.camera.position.z-Pe[2])<=on*(H.detailVisible?1.8:1.55),ue=de(ge,k);if(!ue&&Y){let Pe=o.sections.find(on=>on.id===Y);Pe&&(ue=de(Pe.center,Math.max(12,Pe.radius*2)))}H.detailVisible=ue;let fe=v.seatProgram.uniforms;fe.uSeatScale.value=re.scale,fe.uSeatFade.value=re.fade;let Oe=!!j&&jo(j.seatCount,M.canvas.clientWidth||1,M.canvas.clientHeight||1),tn=Ko(o.seats.count,Z,C.currentDistance,C.camera.fov,M.canvas.clientHeight||1),Ye=H.detailVisible||Oe||tn?1:0,At=H.detailVisible||G()>=0||o.floors.length>1?1:0;H.ease(p,Ye,At),fe.uSeatDetail.value=H.seatDetailMix;let Xe=Ye===0&&H.seatDetailMix<.01;v.seatGeometry.setDrawRange(Xe?hn:0,Xe?Oo:hn),v.solidProgram.uniforms.uStructureDetail.value=H.structureDetailMix,v.solidProgram.uniforms.uViewport.value.set([M.gl.drawingBufferWidth,M.gl.drawingBufferHeight]),fe.uMinPixels.value=re.minPixels,fe.uPixelToWorld.value=2*Math.tan(C.camera.fov*xl/2)/Math.max(1,M.pixelHeight),H.update(H.detailVisible),(o.outdoor||o.house)&&(On.copy(C.camera.projectionViewMatrix).inverse(),v.backgroundProgram.uniforms.uInvViewProj.value.set(On),v.backgroundProgram.uniforms.uEye.value.set([C.camera.position.x,C.camera.position.y,C.camera.position.z]));let $e=Q(W,C.currentDistance),we=q.begin($e.smooth);oe=we!==null,$.frame($e.onBudget&&we!==null,C.currentDistance,performance.now());let nn=we?{target:we}:{};M.renderer.render({scene:v.background,clear:!0,...nn}),M.renderer.render({scene:v.main,camera:C.camera,clear:!1,...nn});let Ia=x?x.update(performance.now(),[C.camera.position.x,C.camera.position.y,C.camera.position.z],V!==null,b==="seatView"):!1;if(x&&M.renderer.render({scene:x.root,camera:C.camera,clear:!1,...nn}),q.end(),Fe){let Pe=C.camera.worldMatrix;Fe.update(b==="seatView"?[C.camera.position.x,C.camera.position.y,C.camera.position.z]:null,[-Pe[8],-Pe[9],-Pe[10]])}ae.update(C.camera.projectionViewMatrix,M.canvas.clientWidth||1,M.canvas.clientHeight||1,C.currentDistance,Z,[C.camera.position.x,C.camera.position.y,C.camera.position.z]);let no=W||Ia||H.seatDetailMix!==Ye||H.structureDetailMix!==At;return Nn(!no),no},Nn=$o(t),ce=new It(wt),Hn=typeof ResizeObserver<"u"?new ResizeObserver(()=>en.resize()):null;Hn?.observe(t),C.setZoomPointResolver((p,b)=>{let E=M.canvas.getBoundingClientRect(),z=M.canvas.clientWidth||E.width,W=M.canvas.clientHeight||E.height;if(!(z>0)||!(W>0))return null;C.camera.updateMatrixWorld();let j=zn(o.seats.iPosition,o.seats.count,C.camera.projectionViewMatrix,z,W,p-E.left,b-E.top,gl);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 Yt(p){return[o.seats.iPosition[p],o.seats.iPosition[p+1]+.5,o.seats.iPosition[p+2]]}ae.setSeatNumberRow(null);let Ce=null,Ve=0,Xt=null,Gn=()=>{Ve=0;let p=null,b=null;if(Ce&&!Ae?.active&&!le.active){let W=M.canvas.getBoundingClientRect(),j=M.canvas.clientWidth||W.width,Z=M.canvas.clientHeight||W.height;if(j>0&&Z>0){let re=zn(o.seats.iPosition,o.seats.count,C.camera.projectionViewMatrix,j,Z,Ce.x-W.left,Ce.y-W.top,yl);p=re>=0?e.seats[re]?.rowId??null:null;let pe=re>=0?e.seats[re]?.id??null:null;if(b=pe,Ce.mouse&&!Ce.pressing&&!!Y&&!!pe&&f.get(pe)===Y){let k=t.getBoundingClientRect();Xt=pe,n.onSeatHover?.(pe,{x:Ce.x-k.left,y:Ce.y-k.top})}else Bn()}}else Bn();let E=Ce?.mouse?b:null,z=ae.setSeatNumberSeat(E);(ae.setSeatNumberRow(p)||z)&&ce.requestRender()};function Bn(){Xt!==null&&(Xt=null,n.onSeatHover?.(null,null))}let St=p=>{Ce={x:p.clientX,y:p.clientY,mouse:p.pointerType==="mouse",pressing:p.type==="pointerdown"},Ve||(Ve=requestAnimationFrame(Gn))},Wn=p=>{p.pointerType==="mouse"&&(Ce=null,Ve||(Ve=requestAnimationFrame(Gn)))};M.canvas.addEventListener("pointermove",St),M.canvas.addEventListener("pointerdown",St),M.canvas.addEventListener("pointerleave",Wn);function Un(p){if(!x)return;let b=[];for(let E of _.keys()){let z=o.seats.idToIndex.get(E);if(z===void 0)continue;let W=z*3;b.push({id:E,position:Yt(W)})}x.setSeats(b,performance.now(),p)}let Yn=p=>{let b=W=>{let j=o.seats.idToIndex.get(W);return j===void 0?void 0:o.seats.iState[j]},{updates:E,next:z}=Ir(_,p,b);if(_=z,ae.setSelectedSeatIds(_.keys()),Un(!ot()),ce.requestRender(),se(Y),E.length){let W=cn(o.seats,E);v&&v.uploadSeatStateRuns(W),h(),ce.requestRender()}},ot=()=>I!==null?I:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Ma=8,Xn=p=>{if(!n.getSeatView)return null;let b=w.get(p);if(!b)for(b=Promise.resolve(n.getSeatView(p)),w.set(p,b),b.catch(()=>{w.get(p)===b&&w.delete(p)});w.size>Ma;){let E=w.keys().next().value;if(E===void 0)break;w.delete(E)}return b},$n=Jr(o.stages,o.focalWorld,o.bounds.groundY??0),qn=Dn($n),$t=(p,b)=>{let E=l.get(p),z=Math.max(0,Math.round(o.seats.iFloor[b]??0)),W=e.doc.floors?.[z],j=o.floors[z],Z=W?.focalPoint??e.doc.focalPoint,re=j?{x:j.focalWorld[0]/qe,y:j.focalWorld[2]/qe}:Z,pe=E?.focalPoint?{x:E.focalPoint.x+re.x-Z.x,y:E.focalPoint.y+re.y-Z.y}:re,ge=[o.seats.iPosition[b*3],o.seats.iPosition[b*3+1],o.seats.iPosition[b*3+2]],k=Br(o.seats.iPosition,b,qn),de=k!==null&&Math.abs(k)<Gr;return Wr(ge,pe,W?.baseHeightM??0,E?.eyeHeightM,qn,de)},qt=()=>(t.clientWidth||M.canvas.clientWidth)<=520,jt=null,jn=null,Aa=async(p,b,E)=>{if(!n.getSeatView||S||E!==ve.flightGen())return;let z;try{z=await ca()}catch{if(i.panoramaFailed(p,"mount"),!S&&E===ve.flightGen()){let W=Zt(p,E,!0);requestAnimationFrame(()=>W?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(S||E!==ve.flightGen()||!jt))return jn??=z.createOpenPanorama(jt),jn(p,b,E)},Kt=ha({container:t,model:o,opts:n,expandedSeatById:l,seatIdsByRow:c,isNarrow:qt,isDisposed:()=>S,flightGen:()=>ve.flightGen(),flyToSeat:p=>eo(p),openPanorama:(p,b,E)=>Aa(p,b,E)}),Zt=Kt.show,Qt=Kt.remove,Pa=Kt.layout,ze=ma({container:t,orbit:C,isNarrow:qt,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});Ut=ze;let Ea=ze.element,rt=ze.setNavigationMode,Ca=ze.layout,Ta=ze.utilityControls,at=null,Kn=!1,Mt=p=>{ze.setSeatViewLocked(p),p||Ae?.exit()};Ae=ia({canvas:M.canvas,camera:C.camera,requestRender:()=>ce.requestRender(),reducedMotion:ot,onStopChange:p=>{let b=p??(Kn?"seat":null);at=b;try{n.onSeatViewStopChange?.(b)}catch{}},onApplied:()=>{S||C.syncFromCamera()}});let Zn=o.sections.reduce((p,b)=>b.seatCount>0&&b.box?Math.max(p,b.box.max[1]):p,-1/0),Qn=(p,b)=>{let{eye:E}=$t(p,b),z=(t.clientWidth||M.canvas.clientWidth||1)/Math.max(1,t.clientHeight||M.canvas.clientHeight||1),W=ta(E,$n,z,{preserveEye:!0});if(n.seatViewStops===!1)return{...W,stops:[]};let j=f.get(p),Z=j?o.sections.find(re=>re.id===j):void 0;return{...W,stops:na(W,{aspect:z,seatingTopY:Number.isFinite(Zn)?Zn: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}})}},ve=ya({isNarrow:qt,setSeeThrough:p=>{m=p?[p[0],p[1],p[2],Ml]:[0,0,0,0],u(),ce.requestRender()},container:t,model:o,opts:n,orbit:C,cinematic:le,analytics:i,loop:ce,labelOverlay:ae,stageAzimuth:ie,overviewFraming:xe,gpu:()=>v,isDisposed:()=>S,panorama:()=>V,setPanorama:p=>{V=p},setPanoramaSphereVisible:p=>{B=p},panoramaLoadAbort:()=>g,setPanoramaLoadAbort:p=>{g=p},setFrozen:p=>{F=p},restorePanoramaLayer:P,reducedMotion:ot,resolvedSeatViewPose:$t,showSectionSeatLabels:se,setNearFieldDetailEnabled:R,setSeatViewLocked:Mt,setNavigationMode:rt,showArriveChip:Zt,removeArriveChip:Qt,inSeatView:()=>at!==null,setSeatStepping:p=>{Kn=p},seatViewArrival:(p,b)=>n.arriveAtSeatEye?Qn(p,b):null,enterSeatView:(p,b)=>Ae?.enter(p,b)});O=!0;let Jt=ve.overviewChip,Ra=ve.layoutOverviewChip,_a=ve.applyFloorFocus,Fa=ve.focusOverview,Jn=ve.cancelFlight,eo=ve.flyToSeat,to=ve.focusSectionCamera;Ta.appendChild(Jt),jt={container:t,model:o,opts:n,analytics:i,orbit:C,loop:ce,seatsById:l,ensureSeatView:Xn,resolvedSeatViewPose:$t,gpu:()=>v,gl:M.gl,isContextLost:()=>A,isDisposed:()=>S,flightGen:()=>ve.flightGen(),setPanorama:p=>{V=p},getLoadAbort:()=>g,setLoadAbort:p=>{g=p},setPanoramaSphereVisible:p=>{B=p,p&&Ae?.exit()},setFrozen:p=>{F=p},raisePanoramaLayer:N,restorePanoramaLayer:P,getOverviewChip:()=>Jt,labelOverlay:ae,reducedMotion:ot,removeArriveChip:Qt,showArriveChip:Zt};let De=va({glctx:M,orbit:C,model:o,seats:e.seats,opts:n,cinematic:le,analytics:i,seatIdByIndex:s,sectionIdBySeatId:f,tapSlop:wl,tapMs:Sl,gpu:()=>v,pick:()=>T,seatViewLocked:()=>ze.seatViewLocked(),focusedSectionId:()=>Y,selection:()=>_,cancelFlight:Jn,focusSectionCamera:to,focusSeatCamera:ve.focusSeatCamera,setSelection:Yn,ensureSeatView:Xn});M.canvas.addEventListener("pointerdown",De.onDown),M.canvas.addEventListener("pointermove",De.onMove),M.canvas.addEventListener("pointerup",De.onUp),M.canvas.addEventListener("pointercancel",De.onUp),ce.requestRender();let en={setAvailability(p){let b=Fr(_,p),E=cn(o.seats,b);E.length&&v&&v.uploadSeatStateRuns(E),h(),E.length&&L(),ce.requestRender()},setSelection:Yn,setNavigationMode:rt,zoomIn(){C.zoomBy(Ke),ce.requestRender()},zoomOut(){C.zoomBy(dt),ce.requestRender()},flyToSeat:eo,focusOverview:Fa,seatViewStop:()=>at,recentreSeatView:()=>Ae?.recentre()??!1,resize(){let{width:p,height:b}=M.resize();C.setAspect(p/Math.max(1,b)),Pa(),Ca(),Ra(),ce.requestRender()},stats(){return{...ce.stats(),drawCalls:v?v.drawCalls:0,fallbackTriangles:v?v.seatGeometry.drawRange.count/3*o.seats.count:0,seatCount:o.seatCount}},captureImage(p=1280){if(A||!v||typeof document>"u")return null;wt(0);let b=M.canvas,E=Math.min(1,p/Math.max(b.width,b.height,1)),z=document.createElement("canvas");z.width=Math.max(1,Math.round(b.width*E)),z.height=Math.max(1,Math.round(b.height*E));let W=z.getContext("2d");return W?(W.drawImage(b,0,0,z.width,z.height),z.toDataURL("image/jpeg",.82)):null},captureSeatView(p,b=480){if(A||!v||F||typeof document>"u"||le.active||V!==null||Ae?.active)return null;let E=K.get(p);if(E)return E;let z=o.seats.idToIndex.get(p);if(z===void 0)return null;let{eye:W,focal:j,fov:Z}=Qn(p,z),re=C.snapshot(),pe=[H.seatDetailMix,H.structureDetailMix],ge=null;try{ee=!0,C.camera.position.set(W[0],W[1],W[2]),C.camera.perspective({fov:Z,aspect:C.camera.aspect}),C.camera.lookAt(j),C.camera.updateMatrixWorld(),C.syncFromCamera(),H.seatDetailMix=1,H.structureDetailMix=1,H.forceRegather(),wt(0);let k=M.canvas,de=Math.min(k.width,Math.round(k.height*16/9)),ue=Math.round(de*9/16),fe=document.createElement("canvas");fe.width=Math.max(1,Math.round(b)),fe.height=Math.max(1,Math.round(b*9/16));let Oe=fe.getContext("2d");Oe&&(Oe.drawImage(k,(k.width-de)/2,(k.height-ue)/2,de,ue,0,0,fe.width,fe.height),ge=fe.toDataURL("image/jpeg",.8))}finally{ee=!1,re(),H.seatDetailMix=pe[0],H.structureDetailMix=pe[1],H.forceRegather(),wt(0)}if(ge)for(K.set(p,ge);K.size>te;)K.delete(K.keys().next().value);return ge},getQualityEvidence(){let p=ce.stats(),b=M.canvas.clientWidth||1,E=M.canvas.clientHeight||1,z=o.bounds.center,W=Te(C.camera.projectionViewMatrix,[z[0],o.bounds.box.min[1],z[2]],b,E),j=Te(C.camera.projectionViewMatrix,[z[0],o.bounds.box.max[1],z[2]],b,E),Z=o.bounds.box,re=[Z.min[0],Z.max[0]].flatMap(k=>[Z.min[1],Z.max[1]].flatMap(de=>[Z.min[2],Z.max[2]].map(ue=>Te(C.camera.projectionViewMatrix,[k,de,ue],b,E)))).filter(k=>Number.isFinite(k.x)&&Number.isFinite(k.y)&&Number.isFinite(k.depth)),pe=re.length?(()=>{let k=Math.min(...re.map(we=>we.x)),de=Math.max(...re.map(we=>we.x)),ue=Math.min(...re.map(we=>we.y)),fe=Math.max(...re.map(we=>we.y)),Oe=Math.max(0,k),tn=Math.min(b,de),Ye=Math.max(0,ue),At=Math.min(E,fe),Xe=Math.max(0,tn-Oe),$e=Math.max(0,At-Ye);return{box:{x:Oe,y:Ye,width:Xe,height:$e},horizontalFillRatio:Xe/b,verticalFillRatio:$e/E,visibleAreaRatio:Xe*$e/(b*E),clippedEdges:[...ue<0?["top"]:[],...de>b?["right"]:[],...fe>E?["bottom"]:[],...k<0?["left"]:[]]}})():void 0,ge=String(M.gl.getParameter(M.gl.VERSION)??"");return{viewport:{width:b,height:E},context:{webgl2:/webgl\s*2/i.test(ge),lost:A},frame:{rendered:p.rendered,idle:p.idle,smoothed:oe},camera:{position:[C.camera.position.x,C.camera.position.y,C.camera.position.z],distance:C.currentDistance,verticalFovDeg:C.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:W.visible&&j.visible?Math.abs(W.y-j.y):0},labels:ae.qualityEvidence(),framing:pe,...at?{seatView:{fovDeg:C.camera.fov,stop:at}}:{}}},getQualityReport(){return Mn(en.getQualityEvidence())},loseContextForTest(){M.simulateContextLossCycle()},floors(){return o.floors},focusFloor(p){if(p!==null&&!o.floors.some(E=>E.index===p))return!1;let b=p??-1;if(R(p!==null),Mt(!1),_a(b),rt("orbit"),p===null)le.cancel(),ot()?C.frame(o.bounds,!1,ie,n.portraitOverviewCrop===!0,xe):C.frameSoft(o.bounds,ie,n.portraitOverviewCrop===!0,xe),ae.setOverviewDistance(C.targetDistance);else{let E=o.floors[p];if(E.seatCount>0){le.cancel();let z=E.focalWorld[0]-E.center[0],W=E.focalWorld[2]-E.center[2],j=Math.hypot(z,W)>E.radius*.12?Math.atan2(z,W):ie;C.frame({center:E.center,radius:E.radius,box:E.box},!1,j,!1,{polarDeg:58,margin:1.12}),ae.setOverviewDistance(C.targetDistance)}}return ce.requestRender(),!0},zones(){return o.zones},focusZone(p){let b=o.zones.find(j=>j.id===p);if(!b||b.seatCount===0)return!1;R(!1),Mt(!1),le.cancel(),rt("orbit"),se(null),n.onSectionFocusChange?.(null);let E=b.focalWorld[0]-b.center[0],z=b.focalWorld[2]-b.center[2],W=Math.hypot(E,z)>b.radius*.12?Math.atan2(E,z):void 0;return C.frame({center:b.center,radius:b.radius*1.25},!1,W),ce.requestRender(),!0},sections(){return o.sections},focusSection(p){return to(p)},rows(p){return p?o.rows.filter(b=>b.sectionId===p):o.rows},seatsInRow(p){return e.seats.filter(b=>b.rowId===p).map(b=>({id:b.id,label:b.displayLabel||b.label}))},focusRow(p){let b=o.rows.find(E=>E.id===p);return!b||b.seatCount===0?!1:(R(!0),Mt(!1),le.cancel(),rt("pan"),b.sectionId&&(se(b.sectionId),n.onSectionFocusChange?.(b.sectionId)),C.frame({center:b.center,radius:Math.max(2.5,b.radius*.65)}),ce.requestRender(),!0)},setReducedMotionForTest(p){I=p},dispose(){S=!0,Fe?.dispose(),Nn(!1),Qt(),Jt.remove(),Ea.remove(),Jn(),Ae?.dispose(),ce.stop(),ae.dispose(),Hn?.disconnect(),V&&(V.dispose(),V=null),P(),_e(),M.canvas.removeEventListener("pointerdown",De.onDown),M.canvas.removeEventListener("pointermove",De.onMove),M.canvas.removeEventListener("pointerup",De.onUp),M.canvas.removeEventListener("pointercancel",De.onUp),M.canvas.removeEventListener("pointermove",St),M.canvas.removeEventListener("pointerdown",St),M.canvas.removeEventListener("pointerleave",Wn),Ve&&cancelAnimationFrame(Ve),C.dispose(),T&&T.dispose(),v&&v.dispose(),v=null,x?.dispose(),x=null,T=null,q.dispose(),M.dispose()}};return i.opened(o.seatCount,y,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),en}export{Hi as VENUE3D_QUALITY_REPORT_VERSION,Da as autoVenue3d,ut as buildSceneModel,dn as estimateVenue3D,Mn as inspectVenue3DQualityEvidence,nd as mountVenue3D,fl as prepareVenue3D,vl as prepareVenue3DFromChart};
|