@seatlayer/core 0.71.3 → 0.71.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/{categoryInventory-BiUDSvBt.d.ts → categoryInventory-B8CDQtH4.d.ts} +1 -1
  2. package/dist/{categoryInventory-DBqgM5in.d.cts → categoryInventory-r3OfIEQn.d.cts} +1 -1
  3. package/dist/{chunk-GK4ILJFB.js → chunk-7KS6TAYH.js} +1 -1
  4. package/dist/{chunk-A27USMF7.js → chunk-AM2LRFAY.js} +1 -1
  5. package/dist/chunk-KCFEFP6H.js +1 -0
  6. package/dist/{chunk-7OJ6SB6V.js → chunk-KPSJDH3N.js} +1 -1
  7. package/dist/{chunk-FBRBY6NE.js → chunk-LR7WIR5Z.js} +1 -1
  8. package/dist/chunk-NKYPEBW3.js +1 -0
  9. package/dist/{chunk-TQWKQGXF.js → chunk-NXFDYBZY.js} +1 -1
  10. package/dist/{chunk-AB4ALUEW.js → chunk-SKO3DCVB.js} +1 -1
  11. package/dist/{chunk-652LV66L.js → chunk-YSVXAUOH.js} +1 -1
  12. package/dist/core/chart-ops/index.cjs +1 -1
  13. package/dist/core/chart-ops/index.d.cts +4 -4
  14. package/dist/core/chart-ops/index.d.ts +4 -4
  15. package/dist/core/chart-ops/index.js +1 -1
  16. package/dist/core/inventory/index.cjs +1 -1
  17. package/dist/core/inventory/index.d.cts +4 -4
  18. package/dist/core/inventory/index.d.ts +4 -4
  19. package/dist/core/inventory/index.js +1 -1
  20. package/dist/core/layout/index.cjs +1 -1
  21. package/dist/core/layout/index.d.cts +5 -4
  22. package/dist/core/layout/index.d.ts +5 -4
  23. package/dist/core/layout/index.js +1 -1
  24. package/dist/core/quality/index.d.cts +3 -3
  25. package/dist/core/quality/index.d.ts +3 -3
  26. package/dist/core/render-assets/index.d.cts +1 -1
  27. package/dist/core/render-assets/index.d.ts +1 -1
  28. package/dist/core/seatConfidence.d.cts +1 -1
  29. package/dist/core/seatConfidence.d.ts +1 -1
  30. package/dist/core/sections/index.cjs +1 -1
  31. package/dist/core/sections/index.d.cts +5 -5
  32. package/dist/core/sections/index.d.ts +5 -5
  33. package/dist/core/sections/index.js +1 -1
  34. package/dist/{eventConfigurations-CA2XhDig.d.ts → eventConfigurations-0OC43JJY.d.ts} +1 -1
  35. package/dist/{eventConfigurations-Csdxe89O.d.cts → eventConfigurations-ByU_uPeS.d.cts} +1 -1
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.d.cts +21 -13
  38. package/dist/index.d.ts +21 -13
  39. package/dist/index.js +1 -1
  40. package/dist/{labeling-CxZWjZBN.d.ts → labeling-B05IJwd2.d.ts} +1 -1
  41. package/dist/{labeling-DG-Sc8VW.d.cts → labeling-DAGq3u0z.d.cts} +1 -1
  42. package/dist/{layout-BjTtYIy8.d.ts → layout-DkDRcXvu.d.ts} +102 -60
  43. package/dist/{layout-CUiLkR8o.d.cts → layout-e0Qe7jmM.d.cts} +102 -60
  44. package/dist/{renderedQuality-ZDPLvzcZ.d.cts → renderedQuality-BaejczsK.d.cts} +1 -1
  45. package/dist/{renderedQuality-DrOWtrO-.d.ts → renderedQuality-BwwrqYzX.d.ts} +1 -1
  46. package/dist/{renderer-DIebhcYo.d.cts → renderer-BNicx5sw.d.ts} +4 -1
  47. package/dist/{renderer-DtR3EaF4.d.ts → renderer-Duv1HhQg.d.cts} +4 -1
  48. package/dist/{sections-Bb0L9lDT.d.cts → sections-BjGjR21N.d.cts} +1 -1
  49. package/dist/{sections-87qiciyN.d.ts → sections-CrX4vq-m.d.ts} +1 -1
  50. package/dist/{segmentedRowModel-CEP6crcl.d.ts → segmentedRowModel-BOO8w9Ng.d.ts} +1 -1
  51. package/dist/{segmentedRowModel-BqiM0U65.d.cts → segmentedRowModel-UO_YIQRB.d.cts} +1 -1
  52. package/dist/{ticketRestrictions-NKWgOV-D.d.cts → ticketRestrictions-DUQrKTpS.d.cts} +2 -2
  53. package/dist/{ticketRestrictions-Ch3ZKeMR.d.ts → ticketRestrictions-dvlNTwem.d.ts} +2 -2
  54. package/dist/{types-DNztpn7q.d.cts → types-0yruRsAj.d.cts} +30 -1
  55. package/dist/{types-DNztpn7q.d.ts → types-0yruRsAj.d.ts} +30 -1
  56. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  57. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  58. package/dist/view3d/index.cjs +8 -8
  59. package/dist/view3d/index.d.cts +3 -3
  60. package/dist/view3d/index.d.ts +3 -3
  61. package/dist/view3d/index.js +1 -1
  62. package/dist/view3d/scene/scene.worker.cjs +1 -1
  63. package/dist/view3d/scene/scene.worker.js +1 -1
  64. package/package.json +1 -1
  65. package/dist/chunk-WXWJZ5DO.js +0 -1
  66. package/dist/chunk-X3K36XZM.js +0 -1
@@ -1 +0,0 @@
1
- import{c as le}from"./chunk-CRCGO52K.js";var Xt=40,zt=1200,Kt=.8,Vt=3,$t=-2,Wt=20,Yt=.1,qt=40,Jt=40,ue=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function $e(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let o=Math.max(1,Math.floor(t/ue(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let c=0;for(let u of i.split(/\s+/)){let s=u.length;c&&c+1+s<=o?c+=1+s:(r+=Math.max(1,Math.ceil(s/o)),c=s%o)}}return Math.max(1,r)}function fe(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(u=>u.length))*ue(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),c=$e(e,i);return{width:r,height:c*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:c,padding:t}}var We=Math.PI/180;function I(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Ye(e,t,n){let o=Math.cos(n),r=Math.sin(n),i=e.x-t.x,c=e.y-t.y;return{x:t.x+i*o-c*r,y:t.y+i*r+c*o}}function Zt(e,t){return Ye(e,{x:0,y:0},t*We)}function O(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function qe(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function en(e){return e.length?qe(e):null}function Y(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,c=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+c*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+c*e.end.y}}function on(e,t,n){let o={x:(e.x+t.x)/2,y:(e.y+t.y)/2},r={x:(n.x-o.x)*4/3,y:(n.y-o.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+r.x,y:e.y+(t.y-e.y)/3+r.y},control2:{x:e.x+(t.x-e.x)*2/3+r.x,y:e.y+(t.y-e.y)*2/3+r.y},end:{...t}}}function me(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[Y(e,.5)];let o=Array.from({length:n+1},(s,f)=>Y(e,f/n)),r=new Float64Array(o.length);for(let s=1;s<o.length;s+=1){let f=o[s].x-o[s-1].x,a=o[s].y-o[s-1].y;r[s]=r[s-1]+Math.hypot(f,a)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let c=[],u=1;for(let s=0;s<t;s+=1){let f=i*s/(t-1);for(;u<r.length-1&&r[u]<f;)u+=1;let a=r[u-1],m=r[u],d=m===a?0:(f-a)/(m-a);c.push({x:o[u-1].x+(o[u].x-o[u-1].x)*d,y:o[u-1].y+(o[u].y-o[u-1].y)*d})}return c}function T(e,t){return{x:e.x+t.x,y:e.y+t.y}}function F(e,t){return{x:e.x-t.x,y:e.y-t.y}}function R(e,t){return{x:e.x*t,y:e.y*t}}function B(e,t=13){return Array.from({length:t},(n,o)=>Y(e,o/(t-1)))}function de(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return O(e[o],e[o+1],n-o)}function he(e,t,n){let o=Math.max(0,Math.min(1,t)),r=Math.max(o,Math.min(1,n)),i=[de(e,o)];for(let c=1;c<e.length-1;c+=1){let u=c/(e.length-1);u>o+1e-9&&u<r-1e-9&&i.push(e[c])}return i.push(de(e,r)),i}function pe(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([d,x],p)=>{let y=I(O(e[d],e[x],.5),t);y<r&&(r=y,o=p)});let i=e[o],c=e[(o+1)%4],u=e[(o+2)%4],s=e[(o+3)%4],f=O(i,c,.5),a=F(t,f),m=Math.max(1e-9,Math.hypot(a.x,a.y));return{p0:i,p1:c,p2:u,p3:s,normal:R(a,1/m),depth:(I(i,s)+I(c,u))/2}}function ye(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:c}=e,u=F(n,t),s=F(o,r),f=c*.22,a=c*.12;return{nearPath:{start:t,control1:T(T(t,R(u,1/3)),R(i,f)),control2:T(T(t,R(u,2/3)),R(i,f)),end:n},farPath:{start:o,control1:T(T(r,R(s,2/3)),R(i,a)),control2:T(T(r,R(s,1/3)),R(i,a)),end:r}}}function rn(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let o=e.reduce((p,y)=>T(p,y),{x:0,y:0});o.x/=4,o.y/=4;let r=I(e[0],e[1]),i=I(e[0],e[3]),c=n==="auto"?r>i*1.25&&I(o,t)>i?"bezier":"tapered":n;if(c==="rectangle")return{mode:c,outline:e.map(p=>({...p}))};let u=pe(e,t),{p0:s,p1:f,p2:a,p3:m}=u;if(c==="tapered")return{mode:c,outline:[T(s,R(F(f,s),.14)),T(s,R(F(f,s),1-.14)),a,m]};let{nearPath:d,farPath:x}=ye(u);return{mode:c,outline:[...B(d),...B(x).slice(1)]}}function sn(e,t,n,o){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let r=pe(e,t),{p0:i,p1:c,p2:u,p3:s}=r,f=o==="bezier"?ye(r):null,a=f?B(f.nearPath):null,m=f?B(f.farPath).reverse():null,d=Math.min(.055,.18/(n+1));return Array.from({length:n},(x,p)=>{let y=(p+1)/(n+1),h=y-d/2,b=y+d/2;return a&&m?[...he(a,h,b),...he(m,h,b).reverse()]:[O(i,c,h),O(i,c,b),O(s,u,b),O(s,u,h)]})}function Je(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,c=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return Math.hypot(e.x-(t.x+c*o),e.y-(t.y+c*r))}function Qe(e,t){let n=1/0;for(let o of t)if(!(o.length<2))for(let r=0,i=o.length-1;r<o.length;i=r++){let c=Je(e,o[i],o[r]);c<n&&(n=c)}return n}function xe(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,c=t[o].y,u=t[r].x,s=t[r].y;c>e.y!=s>e.y&&e.x<(u-i)*(e.y-c)/(s-c)+i&&(n=!n)}return n}function Ze(e,t,n){let o=xe(e,t)&&!n.some(i=>xe(e,i)),r=Qe(e,[t,...n]);return o?r:-r}function L(e,t,n,o,r){let i=Ze({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var q=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let o=n.length-1;for(;o>0;){let r=o-1>>1;if(n[r].max>=n[o].max)break;[n[r],n[o]]=[n[o],n[r]],o=r}}pop(){let t=this.items,n=t[0],o=t.pop();if(t.length&&o){t[0]=o;let r=0;for(;;){let i=r*2+1,c=i+1,u=r;if(i<t.length&&t[i].max>t[u].max&&(u=i),c<t.length&&t[c].max>t[u].max&&(u=c),u===r)break;[t[u],t[r]]=[t[r],t[u]],r=u}}return n}};function be(e){if(e.length<3)return 0;let t=0;for(let n=0,o=e.length-1;n<e.length;o=n++)t+=(e[o].x+e[n].x)*(e[o].y-e[n].y);return Math.abs(t)/2}function an(e,t){return Math.max(0,be(e)-(t??[]).reduce((n,o)=>n+be(o),0))}function ge(e,t){let n=t??[];if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let y=e.reduce((b,S)=>b+S.x,0)/e.length,h=e.reduce((b,S)=>b+S.y,0)/e.length;return{point:{x:y,y:h},radius:0}}let o=1/0,r=1/0,i=-1/0,c=-1/0;for(let y of e)y.x<o&&(o=y.x),y.y<r&&(r=y.y),y.x>i&&(i=y.x),y.y>c&&(c=y.y);let u=i-o,s=c-r,f=Math.min(u,s);if(!(f>0))return{point:{x:(o+i)/2,y:(r+c)/2},radius:0};let a=Math.max(u,s)/150,m=new q,d=f/2;for(let y=o;y<i;y+=f)for(let h=r;h<c;h+=f)m.push(L(y+d,h+d,d,e,n));let x=L(o+u/2,r+s/2,0,e,n),p=0;for(;m.size;){let y=m.pop();if(!y)break;y.d>x.d&&(x=y),!(y.max-x.d<=a)&&(p>=4e3||(p+=1,d=y.h/2,m.push(L(y.x-d,y.y-d,d,e,n)),m.push(L(y.x+d,y.y-d,d,e,n)),m.push(L(y.x-d,y.y+d,d,e,n)),m.push(L(y.x+d,y.y+d,d,e,n))))}return{point:{x:x.x,y:x.y},radius:Math.max(0,x.d)}}function et(e,t,n){return Math.max(t,Math.min(n,e))}function un(e,t,n){return e<t?t:e>n?n:e}function tt(e){return et(e,0,1)}function we(e){let t=tt(e);return t*t*(3-2*t)}var k=Math.PI*2;function j(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function nt(e,t,n){let o=t-e;if(n){for(;o<0;)o+=k;for(;o>=k;)o-=k}else{for(;o>0;)o-=k;for(;o<=-k;)o+=k}return o}function mn(e){return e.end}function Pe(e){if(e.version!==1||e.closed!==!0||!j(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!j(n.end))return!1;if(n.kind==="line"){if(I(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!j(n.control1)||!j(n.control2)||I(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!j(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(I(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(I(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||I(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return I(t,e.start)<=1e-4}function ot(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function pn(e,t=2){if(!Pe(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let c=Math.atan2(r.y-i.center.y,r.x-i.center.x),u=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),s=nt(c,u,i.clockwise),f=Math.max(2,Math.ceil(Math.abs(s)*i.radius/n));for(let a=1;a<=f;a+=1){let m=c+s*a/f;o.push({x:i.center.x+Math.cos(m)*i.radius,y:i.center.y+Math.sin(m)*i.radius})}}else{let c=I(r,i.control1)+I(i.control1,i.control2)+I(i.control2,i.end),u=Math.max(2,Math.ceil(c/n));for(let s=1;s<=u;s+=1)o.push(ot(r,i,s/u))}r=i.end}return I(o[o.length-1],o[0])<=1e-4&&o.pop(),o}function ve(e,t,n){return rt(e,r=>({x:r.x+t,y:r.y+n}))}function rt(e,t,n=1,o=!1){return{...e,start:t(e.start),segments:e.segments.map(r=>r.kind==="line"?{...r,end:t(r.end)}:r.kind==="arc"?{...r,center:t(r.center),radius:r.radius*Math.abs(n),clockwise:o?!r.clockwise:r.clockwise,end:t(r.end)}:{...r,control1:t(r.control1),control2:t(r.control2),end:t(r.end)})}}var it=45,J=150,st=60;function ct(e){let t=it/100;if(e<=t)return J;let n=Math.min(1,(e-t)/(1-t));return J-n*(J-st)}var Se=.5523;function Me(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function at(e){let t=[],n=[];for(e.forEach((o,r)=>{j(o)&&(t.length&&Me(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&Me(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function yn(e,t,n){return dt(e,{cornerSmoothing:t,...n})}var lt=.5,ut=4/3;function ft(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let c=-r/i,u=o/i,s=n*ut;return{kind:"bezier",control1:{x:e.x+o/3+c*s,y:e.y+r/3+u*s},control2:{x:e.x+o*2/3+c*s,y:e.y+r*2/3+u*s},end:{...t}}}function dt(e,t){let{points:n,sourceIndex:o}=at(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,c=t.edgeCurvature,u=new Array(r).fill(0);if(c?.length)for(let l=0;l<r;l+=1){let M=c[o[l]];u[l]=Number.isFinite(M)?Math.min(100,Math.max(-100,M))/100:0}let s=u.some(l=>Math.abs(l)>1e-6);if(i<=0&&!s)return null;let f=t.wideAngleThresholdDeg??ct(i),a=[];for(let l=0;l<r;l+=1)a[l]=I(n[l],n[(l+1)%r]);let m=new Array(r).fill(0);for(let l=0;l<r;l+=1){let M=n[(l-1+r)%r],w=n[l],P=n[(l+1)%r],C={x:M.x-w.x,y:M.y-w.y},E={x:P.x-w.x,y:P.y-w.y},A=Math.hypot(C.x,C.y),_=Math.hypot(E.x,E.y);if(A<=1e-9||_<=1e-9)continue;let H=Math.min(1,Math.max(-1,(C.x*E.x+C.y*E.y)/(A*_))),N=Math.acos(H)*180/Math.PI;if(N<f)continue;let W=we((N-f)/(180-f));m[l]=i*W*.5*Math.min(A,_)}for(let l=0;l<r;l+=1){let M=(l+1)%r,w=m[l]+m[M];if(w>a[l]&&w>1e-9){let P=a[l]/w;m[l]*=P,m[M]*=P}}let d=new Array(r),x=new Array(r);for(let l=0;l<r;l+=1){let M=n[(l-1+r)%r],w=n[l],P=n[(l+1)%r];if(m[l]<=1e-6){d[l]={...w},x[l]={...w};continue}let C=I(w,M)||1,E=I(w,P)||1;d[l]={x:w.x+(M.x-w.x)/C*m[l],y:w.y+(M.y-w.y)/C*m[l]},x[l]={x:w.x+(P.x-w.x)/E*m[l],y:w.y+(P.y-w.y)/E*m[l]}}if(m.every(l=>l<=1e-6)&&!s)return null;let p=[],y={...x[0]},h=y,b=(l,M)=>{if(I(h,l)<=1e-9)return;let w=u[M];Math.abs(w)>1e-6?p.push(ft(h,l,w*lt*a[M])):p.push({kind:"line",end:{...l}}),h=l};for(let l=1;l<=r;l+=1){let M=l%r,w=n[M];b(d[M],(l-1)%r),m[M]>1e-6&&I(d[M],x[M])>1e-9&&(p.push({kind:"bezier",control1:O(d[M],w,Se),control2:O(x[M],w,Se),end:{...x[M]}}),h=x[M])}if(!p.length)return null;let S=p[p.length-1];I(S.end,y)>1e-9&&(S.kind==="line"?S.end={...y}:p.push({kind:"line",end:{...y}}));let g={version:1,closed:!0,start:y,segments:p};return Pe(g)?g:null}function xn(e){let t=[],n=e.start;for(let r of e.segments)t.push(n),n=r.end;let o=[];for(let r=e.segments.length-1;r>=0;r-=1){let i=e.segments[r],c=t[r];i.kind==="line"?o.push({kind:"line",end:{...c}}):i.kind==="arc"?o.push({kind:"arc",center:{...i.center},radius:i.radius,clockwise:!i.clockwise,end:{...c}}):o.push({kind:"bezier",control1:{...i.control2},control2:{...i.control1},end:{...c}})}return{version:1,closed:!0,start:{...e.start},segments:o}}function gn(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],c=e[r+1],u=Math.hypot(c.x-i.x,c.y-i.y);if(u<=0)continue;let s=Math.max(1,Math.round(u/n)),f=u/s,a=Math.atan2(c.y-i.y,c.x-i.x),m=r===0,x=(r>0?t[r-1]:void 0)==="break"?2:1,p=m?{...i}:{x:i.x+Math.cos(a)*f*x,y:i.y+Math.sin(a)*f*x},y=m?s+1:Math.max(1,s-(x-1));o.push({origin:p,rotation:a*180/Math.PI,seatCount:y,seatSpacing:f})}return o}function wn(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(o,r)=>({x:e.origin.x+n.x*r*e.seatSpacing,y:e.origin.y+n.y*r*e.seatSpacing}))}function Sn(e){return e.reduce((t,n)=>t+n.seatCount,0)}function Ie(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((d,x)=>d.segmentedRow.componentIndex-x.segmentedRow.componentIndex),c=i[0]?.segmentedRow?.componentCount??0,u=i[0]?.segmentedRow;if(!u||!(c>=2&&i.length===c&&u?.boundaryBefore==="start"&&i.every((d,x)=>d.segmentedRow?.kind==="segmented-row-v1"&&d.segmentedRow.groupId===o&&d.segmentedRow.componentCount===c&&d.segmentedRow.componentIndex===x&&d.segmentedRow.repeatLabelOnComponents===u.repeatLabelOnComponents&&(x===0?d.segmentedRow.boundaryBefore==="start":d.segmentedRow.boundaryBefore!=="start")&&d.segmentedRow.displayLabel===u.displayLabel)))continue;let f=i.reduce((d,x)=>d+x.seatCount,0),a=0,m=0;for(let d of i)d.segmentedRow.boundaryBefore==="break"&&(a+=1),t.set(d.id,{groupId:o,adjacencyOffset:a,displayOffset:m,displayLabel:u.displayLabel,totalSeats:f,canonical:i[0],viewFromSeatUrl:u.viewFromSeatUrl,viewFromSeatMeta:u.viewFromSeatMeta,confidenceEvidence:u.confidenceEvidence}),a+=d.seatCount,m+=d.seatCount}return t}var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZ",ht="ABCDEFGHJKLMNPQRSTUVWXYZ",mt="abcdefghijklmnopqrstuvwxyz";function Ee(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function pt(e,t){let n=t.startAt-1,o=e+n;if(t.scheme==="numbers")return String(o+1);let r=t.skipAmbiguous?ht:Ce;return Ee(o,r)}function Q(e,t=!1){let n=t?mt:Ce;return Ee(Math.max(0,Math.floor(e)-1),n)}var yt=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function Oe(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of yt)for(;t>=o;)n+=r,t-=o;return n}function Pn(e,t){let n=e.length;return e.map((o,r)=>{let i=t.reverse?n-1-r:r;return{...o,label:pt(i,t)}})}function xt(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function Z(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",c=e.seatNumbering?.prefix??"",u=e.seatNumbering?.endAt,s=e.seatCount;if(i==="updown"||i==="updown-descending"){let x=Math.ceil(s/2),p=i==="updown"?t<x?n+2*t:n-1+2*(s-t):t<x?n+2*(x-1-t):n+1+2*(t-x);return`${c}${p}`}let f=i==="odd"||i==="even"?2:r,a=u!=null&&Number.isFinite(u)?u-(s-1)*f:n,m=o==="center"?xt(s)[t]:o==="rtl"?s-1-t:t,d;switch(i){case"odd":{let x=a%2===1?a:a+1;d=String(x+m*2);break}case"even":{let x=a%2===0?a:a+1;d=String(x+m*2);break}case"roman":d=Oe(a+m*r);break;case"letters-upper":d=Q(a+m*r,!1);break;case"letters-lower":d=Q(a+m*r,!0);break;default:d=String(a+m*r);break}return`${c}${d}`}function bt(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Te(e,t,n){return n?.label??`${e.label}-${Z(e,t)}`}function ee(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(!n)return`${e.displayLabel??e.label}-${Z(e,t)}`;let r=bt(n),i=n.displayOffset+t;return`${n.displayLabel}-${Z(r,i)}`}var G=.02291666666666667,En=1/G,gt=58,wt=gt*G,Re=0,_e=3,Ae=0,te=120,St=0,Mt=45,Pt=7,X=1.2;function ne(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function On(e){return Number.isFinite(e)?Math.max(Re,Math.min(_e,Math.round(e))):Re}function vt(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Pt?e:_e}function Le(e,t={}){let n=ne(t.floorBaseHeightM,Ae,te,0),o=Math.min(te,n+vt(e.elevation)*wt),r=e.height===void 0?o:ne(e.height,Ae,te,o),i=ne(e.rake,St,Mt,0);return{height:r,rake:i}}function ke(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function je(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],c=e[r+1],u=c.x-i.x,s=c.y-i.y,f=u*u+s*s,a=f>1e-12?((t-i.x)*u+(n-i.y)*s)/f:0;a<0?a=0:a>1&&(a=1);let m=Math.hypot(t-(i.x+a*u),n-(i.y+a*s));m<o&&(o=m)}return o}function It(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let c=Math.hypot(i.x-t,i.y-n);c>r&&(r=c)}return{cx:t,cy:n,r}}function De(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function oe(e,t){let n=1/0;for(let o of ke(e)){let r=je(t,o.x,o.y);r<n&&(n=r)}for(let o of ke(t)){let r=je(e,o.x,o.y);r<n&&(n=r)}return n}function Ct(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let a of e)n+=a.x,o+=a.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let a of e){let m=Math.hypot(a.x-n,a.y-o);m>r&&(r=m,i=a)}let c=i.x-n,u=i.y-o,s=Math.hypot(c,u);s>1e-9?(c/=s,u/=s):(c=1,u=0);let f=e.map((a,m)=>({p:a,i:m,t:(a.x-n)*c+(a.y-o)*u})).sort((a,m)=>a.t-m.t);return{pts:f.map(a=>a.p),seatIndices:f.map(a=>t[a.i])}}function Et(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let S of e)n+=S.x,o+=S.y;n/=t,o/=t;let r=0,i=0,c=0,u=0,s=0,f=0,a=0;for(let S of e){let g=S.x-n,l=S.y-o;r+=g*g,c+=l*l,i+=g*l,u+=g*g*g,s+=l*l*l,f+=g*l*l,a+=l*g*g}let m=r*c-i*i;if(Math.abs(m)<1e-9)return null;let d=(u+f)/2,x=(s+a)/2,p=(d*c-x*i)/m,y=(x*r-d*i)/m,h=p+n,b=y+o;return!Number.isFinite(h)||!Number.isFinite(b)?null:{cx:h,cy:b}}var Ot=.15;function Tt(e){if(e.length<2)return null;let t=e.map(S=>{let g=0,l=0;for(let M of S.pts)g+=M.x,l+=M.y;return{x:g/S.pts.length,y:l/S.pts.length}}),n=0,o=0;for(let S of t)n+=S.x,o+=S.y;n/=t.length,o/=t.length;let r=0,i=0,c=0;for(let S of t){let g=S.x-n,l=S.y-o;r+=g*g,i+=g*l,c+=l*l}let u=r+c,s=r*c-i*i,f=u/2+Math.sqrt(Math.max(0,u*u/4-s)),a,m;Math.abs(i)>1e-12?(a=f-c,m=i):r>=c?(a=1,m=0):(a=0,m=1);let d=Math.hypot(a,m);if(!(d>1e-12))return null;a/=d,m/=d;let x=1/0,p=-1/0,y=[];for(let S of e){let g=1/0,l=-1/0;for(let M of S.pts){let w=M.x*a+M.y*m;w<g&&(g=w),w>l&&(l=w),w<x&&(x=w),w>p&&(p=w)}y.push(l-g)}let h=p-x;return h>1e-9?(y.sort((S,g)=>S-g),y[Math.min(y.length-1,Math.floor(y.length*.9))]/h<=Rt?{x:a,y:m}:null):null}var Rt=.35;function Ne(e,t,n,o){let r=new Map;for(let h of n){let b=t[h],S=b.rowId||`__seat-${h}`,g=r.get(S);g||(g={pts:[],idx:[]},r.set(S,g)),g.pts.push({x:b.x,y:b.y}),g.idx.push(h)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[h,b]of r){let S=Ct(b.pts,b.idx),g=0;for(let l of S.pts)g+=Math.hypot(l.x-o.x,l.y-o.y);i.push({id:h,pts:S.pts,seatIndices:S.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:g/S.pts.length})}let c=i.map(h=>It(h.pts)),u=[];for(let h=0;h<i.length;h++){let b=1/0;for(let S=0;S<i.length;S++){if(h===S||De(c[h],c[S])>=b)continue;let g=oe(i[h].pts,i[S].pts);g<b&&(b=g)}Number.isFinite(b)&&u.push(b)}u.sort((h,b)=>h-b);let s=u.length?u[Math.floor(u.length/2)]:1,f=Math.max(s*1.8,1e-6),a=i.map(()=>[]);for(let h=0;h<i.length;h++)for(let b=h+1;b<i.length;b++)De(c[h],c[b])>f||oe(i[h].pts,i[b].pts)<=f&&(a[h].push(b),a[b].push(h));let m=0;for(let h=0;h<i.length;h++){if(i[h].blockId!==-1)continue;let b=m++,S=[h];for(i[h].blockId=b;S.length;){let g=S.pop();for(let l of a[g])i[l].blockId===-1&&(i[l].blockId=b,S.push(l))}}let d=new Map;for(let h of i){let b=d.get(h.blockId)??[];b.push(h),d.set(h.blockId,b)}let x=[];for(let h of i){if(h.pts.length<4)continue;let b=Et(h.pts);b&&(!Number.isFinite(b.cx)||!Number.isFinite(b.cy)||x.push({x:b.cx,y:b.cy}))}let p=x.length>=2?(()=>{let h=x.map(g=>g.x).sort((g,l)=>g-l),b=x.map(g=>g.y).sort((g,l)=>g-l),S=Math.floor(x.length/2);return{cx:h[S],cy:b[S]}})():null;if(p){let h=w=>Math.hypot(w.x-p.cx,w.y-p.cy),b=1/0,S=-1/0,g=[];for(let w of i){let P=1/0,C=-1/0;for(let E of w.pts){let A=h(E);A<P&&(P=A),A>C&&(C=A)}g.push(C-P),P<b&&(b=P),C>S&&(S=C)}let l=S-b;g.sort((w,P)=>w-P);let M=g[Math.min(g.length-1,Math.floor(g.length*.9))];if(l>1e-9&&M/l<=Ot){let w=i.map(v=>{let U=0;for(let Ve of v.pts)U+=h(Ve);return{row:v,radius:U/v.pts.length}}),P=0,C=0;for(let v of w)P+=v.radius,C+=v.row.focalDistance;P/=w.length,C/=w.length;let E=0;for(let v of w)E+=(v.radius-P)*(v.row.focalDistance-C);if(E<0)for(let v of w)v.radius=-v.radius;let _=1/0;for(let v of w)v.radius<_&&(_=v.radius);w.sort((v,U)=>v.radius-U.radius);let H=-1,N=-1/0,W=l/Math.max(1,w.length)*.5,ae=[];for(let v of w)v.radius-N>W&&(H++,N=v.radius),v.row.ordinal=H,v.row.blockDepth=v.radius-_,ae.push(v.row);return{sectionId:e,rows:ae,blockCount:m}}}let y=[];for(let[,h]of d){let b=Tt(h);if(b){let S=l=>{let M=0;for(let w of l.pts)M+=w.x*b.x+w.y*b.y;return M/l.pts.length};h.sort((l,M)=>S(l)-S(M)),h.length>=2&&h[0].focalDistance>h[h.length-1].focalDistance&&h.reverse();let g=0;for(let l=0;l<h.length;l++)l>0&&(g+=oe(h[l-1].pts,h[l].pts)),h[l].ordinal=l,h[l].blockDepth=g,y.push(h[l])}else{let S=1/0;for(let g of h)g.focalDistance<S&&(S=g.focalDistance);h.sort((g,l)=>g.focalDistance-l.focalDistance);for(let g=0;g<h.length;g++)h[g].ordinal=g,h[g].blockDepth=Math.max(0,h[g].focalDistance-S),y.push(h[g])}}return{sectionId:e,rows:y,blockCount:m}}function Ge(e){return e?e.accessibility&&e.accessibility.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var K=Math.PI/180,At=9,D=16;function ie(e,t,n,o){let r=n*K,i=Math.cos(r),c=Math.sin(r);return{x:o.x+e*i-t*c,y:o.y+e*c+t*i}}function Xe(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,c=[];if(e.path)return me(e.path,t);if(t<=1)return t===1&&c.push({x:i.x,y:i.y}),c;if(o===0){for(let f=0;f<t;f++)c.push(ie(f*n,0,r,i));return c}let u=o/(t-1)*K,s=n/(2*Math.sin(Math.abs(u)/2));for(let f=0;f<t;f++){let a=f*u,m=s*Math.sin(a),d=-s+s*Math.cos(a);c.push(ie(m,d,r,i))}return c}function _t(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Un(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function Lt(e,t){let n=_t(e);return Xe(e).map((o,r)=>{let i=n.get(r),c=Ge(i),u=Te(e,r,i),s={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:u,displayLabel:ee(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:c.length>0,accessibility:c,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(s).some(f=>f!==void 0&&f!==!1&&f!=="")?s:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle}})}function ze(e){let t=[];for(let n of Lt(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function kt(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function Ke(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(a=>[a.index,a])),r=(a,m,d,x)=>{let p=o.get(a),y=Ge(p),h=p?.label??`${e.label}-${a+1}`,b=e.displayLabel??e.label;return{index:a,label:h,displayLabel:p?.displayLabel??`${b}-${a+1}`,x:m+(p?.dx??0),y:d+(p?.dy??0),categoryKey:p?.categoryKey??e.categoryKey,skipped:!!p?.skip,accessible:y.length>0,accessibility:y,wheelchairSpaceType:p?.wheelchairSpaceType,commercial:p?.commercial,glyph:p?.glyph,viewUrl:p?.viewFromSeatUrl,viewMeta:p?.viewFromSeatUrl?p.viewFromSeatMeta:void 0,labelStyle:p?.labelStyle,...x?{side:x}:{}}};if(e.shape==="round"){let a=(e.radius??40)+D,m=e.rotation*K,d=Math.max(0,Math.min(360,e.seatArc??360));if(d>=360||n===1){for(let h=0;h<n;h++){let b=m+h/n*2*Math.PI;t.push(r(h,e.center.x+a*Math.cos(b),e.center.y+a*Math.sin(b)))}return t}let x=d*K,p=(2*Math.PI-x)/2,y=m+p;for(let h=0;h<n;h++){let b=y+h/(n-1)*x;t.push(r(h,e.center.x+a*Math.cos(b),e.center.y+a*Math.sin(b)))}return t}let i=e.width??80,c=e.height??50,u=kt(e),s=["top","bottom","left","right"],f=0;for(let a of s){let m=u[a];for(let d=0;d<m;d++){let x,p;a==="top"?(x=-i/2+(d+.5)*i/m,p=-c/2-D):a==="bottom"?(x=-i/2+(d+.5)*i/m,p=c/2+D):a==="left"?(x=-i/2-D,p=-c/2+(d+.5)*c/m):(x=i/2+D,p=-c/2+(d+.5)*c/m);let y=ie(x,p,e.rotation,e.center);t.push(r(f++,y.x,y.y,a))}}return t}function Bn(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Ke(e).filter(t=>!t.skipped).length}function jt(e){return Ke(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function Dt(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth"}]}function Fe(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,c=t[o].y,u=t[r].x,s=t[r].y;c>e.y!=s>e.y&&e.x<(u-i)*(e.y-c)/(s-c)+i&&(n=!n)}return n}function Nt(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let c=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),u=(r.x-n.x)**2+(r.y-n.y)**2;return c>=-1e-7&&c<=u+1e-7})}function V(e,t,n){return Fe(e,t)&&!(n??[]).some(o=>Fe(e,o)||Nt(e,o))}function Gn(e,t){return ge(e,t).point}function re(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function $(e){switch(e.type){case"row":{let t=ze(e);if(!t.length)return{x:e.origin.x,y:e.origin.y};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return re(e.points);case"section":return re(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?re(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function He(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function Ft(e,t){if(e.type!=="gaArea"||!He(e.points,t.outline))return!1;let n=e.holes??[],o=t.holes??[];return n.length===o.length&&n.every((r,i)=>He(r,o[i]))}function Ht(e,t){let n=e.filter(c=>c.type==="section"),o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0,r=$(t);return(o?n.find(c=>(c.logicalSectionId??c.id)===o&&(Ft(t,c)||V(r,c.outline,c.holes))):void 0)??n.find(c=>V(r,c.outline,c.holes))}function Ut(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function Xn(e,t){let n=Ut(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function Bt(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function se(e,t,n){let o=i=>({x:i.x+t,y:i.y+n}),r=i=>i.map(o);switch(e.type){case"row":return{...e,origin:o(e.origin)};case"table":case"booth":return{...e,center:o(e.center)};case"gaArea":return{...e,points:r(e.points),...e.holes?{holes:e.holes.map(r)}:{}};case"section":return{...e,outline:r(e.outline),...e.outlinePath?{outlinePath:ve(e.outlinePath,t,n)}:{},...e.holes?{holes:e.holes.map(r)}:{}};case"text":return{...e,position:o(e.position)};case"shape":return{...e,...e.points?{points:r(e.points)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function zn(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((o,r)=>{let i=-r*t;for(let c of o.objects)n.push(i===0?c:se(c,0,i))}),{...e,objects:n,floors:void 0}}function Kn(e){let t=e.floors;if(!t||t.length<2)return e;let n=Gt(e),o=[];return t.forEach((r,i)=>{let{x:c,y:u}=n[i];for(let s of r.objects)o.push(se(s,c,u))}),{...e,objects:o,floors:void 0,referenceImage:void 0,backgroundImage:void 0}}function Vn(e){let t=e.floors;if(!t||t.length<2)return!1;let n=t.map(s=>ce({...e,objects:s.objects,floors:void 0,focalPoint:s.focalPoint,referenceImage:void 0,backgroundImage:void 0}));if(n.some(s=>s.width<=0||s.height<=0))return!1;let[o,...r]=n;if(!r.every(s=>{let f=Math.min(o.x+o.width,s.x+s.width)-Math.max(o.x,s.x),a=Math.min(o.y+o.height,s.y+s.height)-Math.max(o.y,s.y);return f<=0||a<=0?!1:f>=Math.min(o.width,s.width)*.7&&a>=Math.min(o.height,s.height)*.7}))return!1;let c={x:o.x+o.width/2,y:o.y+o.height/2},u=Math.hypot(o.width,o.height)/2;return t.every(s=>s.objects.length?s.objects.filter(a=>{let m=$(a);return Math.hypot(m.x-c.x,m.y-c.y)>=u*.25}).length>=s.objects.length*.6:!1)}function $n(e){let t=e.floors;if(!t||t.length<2)return e;let n=t.map((s,f)=>({floor:s,index:f,height:s.baseHeightM??0})).sort((s,f)=>s.height-f.height||s.index-f.index),o=ce({...e,objects:n[0].floor.objects,floors:void 0,focalPoint:n[0].floor.focalPoint,referenceImage:void 0,backgroundImage:void 0}),r={x:o.x+o.width/2,y:o.y+o.height/2},i=Math.max(48,Math.min(200,Math.max(o.width,o.height)*.06)),c=[],u=0;return n.forEach((s,f)=>{let a=s.floor.objects.map(y=>{let h=$(y);return Math.hypot(h.x-r.x,h.y-r.y)}),m=a.filter(y=>Number.isFinite(y)),d=m.length?Math.min(...m):0,x=m.length?Math.max(...m):0,p=f===0?0:Math.max(0,u+i-d);u=x+p,s.floor.objects.forEach((y,h)=>{if(f>0&&y.type==="shape"&&y.role==="stage")return;if(p===0){c.push(y);return}let b=a[h];if(!Number.isFinite(b)||b<1e-6){c.push(y);return}let S=$(y);c.push(se(y,(S.x-r.x)/b*p,(S.y-r.y)/b*p))})}),{...e,objects:c,floors:void 0,referenceImage:void 0,backgroundImage:void 0}}function Gt(e){let t=e.floors;if(!t?.length)return[{x:0,y:0}];if(t.length<2)return t.map(()=>({x:0,y:0}));let n=t.map(d=>ce({...e,objects:d.objects,floors:void 0,focalPoint:d.focalPoint,referenceImage:void 0,backgroundImage:void 0})),o=Math.max(1,...n.map(d=>Math.max(d.width,d.height))),r=Math.max(64,Math.min(240,o*.08)),i=16/10,c=null;for(let d=1;d<=t.length;d+=1){let x=Math.ceil(t.length/d),p=new Array(d).fill(0),y=new Array(x).fill(0);n.forEach((l,M)=>{let w=M%d,P=Math.floor(M/d);p[w]=Math.max(p[w],l.width),y[P]=Math.max(y[P],l.height)});let h=p.reduce((l,M)=>l+M,0)+r*(d-1),b=y.reduce((l,M)=>l+M,0)+r*(x-1),S=d*x-t.length,g=Math.abs(Math.log(h/Math.max(1,b)/i))+S*.04;(!c||g<c.score)&&(c={columns:d,columnWidths:p,rowHeights:y,score:g})}let{columns:u,columnWidths:s,rowHeights:f}=c,a=[],m=[];return s.reduce((d,x,p)=>(a[p]=d,d+x+r),0),f.reduce((d,x,p)=>(m[p]=d,d+x+r),0),t.map((d,x)=>{let p=n[x],y=x%u,h=Math.floor(x/u),b=a[y]+(s[y]-p.width)/2,S=m[h]+(f[h]-p.height)/2;return{x:b-p.x,y:S-p.y}})}function Ue(e,t,n,o,r,i,c,u,s){let f=[],a=Ie(e),m=p=>!p?.eventConfigurationId||p.eventConfigurationId===o&&(p.eventConfigurationVersion===void 0||p.eventConfigurationVersion===s),d=p=>le(p,{activeConfigurationId:o,activeConfigurationVersion:s,activeBasisSha256:r,now:u}),x=(p,y)=>d(p)?{...p,coverage:y}:void 0;for(let p of e){let y=[];if(p.type==="row"?y=ze(p):p.type==="table"?y=jt(p):p.type==="booth"&&(y=Dt(p)),!y.length)continue;for(let l of y)l.viewUrl&&!m(l.viewMeta)&&(l.viewUrl=void 0,l.viewMeta=void 0);if(p.type==="row"){let l=a.get(p.id);if(l){let M=new Map((p.overrides??[]).map(w=>[w.index,w]));for(let w of y){let P=Number(w.id.slice(w.id.lastIndexOf(":")+1));if(!Number.isInteger(P))continue;w.logicalRowId=l.groupId,w.logicalSeatIndex=l.adjacencyOffset+P,M.get(P)?.displayLabel||(w.displayLabel=ee(p,P,l)),!w.viewUrl&&l.viewFromSeatUrl&&m(l.viewFromSeatMeta)&&(w.viewUrl=l.viewFromSeatUrl,w.viewMeta=l.viewFromSeatMeta);let C=M.get(P)?.confidenceEvidence;w.confidenceEvidence=x(C,"exact-seat")??x(p.confidenceEvidence,"row-representative")??x(l.confidenceEvidence,"row-representative")}}}let h=Ht(e,p),b=h?.viewFromSeatUrl,g=(h?.zone?t?.find(l=>l.id===h.zone):void 0)?.focalPoint??n;for(let l of y){if(!l.confidenceEvidence){let M=Number(l.id.slice(l.id.lastIndexOf(":")+1)),w=(p.type==="row"||p.type==="table")&&Number.isInteger(M)?p.overrides?.find(P=>P.index===M)?.confidenceEvidence:void 0;l.confidenceEvidence=x(w,"exact-seat")??(p.type==="row"?x(p.confidenceEvidence,"row-representative"):void 0)}l.confidenceEvidence??=x(h?.confidenceEvidence,"section-representative")??(c?x(c.evidence,c.coverage):void 0),!l.viewUrl&&b&&m(h?.viewFromSeatMeta)&&(l.viewUrl=b,l.viewMeta=h?.viewFromSeatMeta),!l.viewUrl&&i&&m(i.meta)&&(l.viewUrl=i.url,l.viewMeta=i.meta),h&&(l.sectionId=h.logicalSectionId??h.id),h?.zone&&(l.zoneId=h.zone),g&&(l.focalPoint={...g})}f.push(...y)}return f}function Wn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,c=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,u=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,s=Ue(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,c,u,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Be(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,s);for(let f of s)f.floorId=r.id;o.push(...s)}return o}let n=Ue(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&Be(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),n}function Be(e,t,n,o){let r=e.filter(a=>a.type==="section"),i=n>0||r.some(a=>a.height!==void 0||a.rake!==void 0||(a.elevation??0)>0);if(!r.length||!i||!t){for(let a of o)a.eyeHeightM=n+X;return}let c=new Array(o.length),u=new Map,s=new Map;for(let a=0;a<o.length;a++){let m=o[a],x=(m.sectionId?r.find(y=>y.id===m.sectionId)??r.find(y=>y.logicalSectionId===m.sectionId&&V({x:m.x,y:m.y},y.outline,y.holes)):void 0)??r.find(y=>V({x:m.x,y:m.y},y.outline,y.holes))??null;if(c[a]=x,!x)continue;u.has(x.id)||u.set(x.id,Le(x,{floorBaseHeightM:n}));let p=s.get(x.id);p?p.push(a):s.set(x.id,[a])}let f=new Array(o.length).fill(void 0);for(let[a,m]of s){let d=u.get(a);if(!d)continue;let x=d.rake>0?Math.tan(d.rake*Math.PI/180):0,p=Ne(a,o,m,t);for(let y of p.rows){let h=y.blockDepth*G*x,b=d.height+h;for(let S of y.seatIndices)f[S]=b}}for(let a=0;a<o.length;a++){let m=o[a],d=c[a];if(!d){m.eyeHeightM=n+X;continue}let x=u.get(d.id);m.eyeHeightM=(f[a]??x.height)+X}}var z=40;function ce(e,t){let n=t?.freeText==="exclude",o=1/0,r=1/0,i=-1/0,c=-1/0,u=(s,f)=>{s<o&&(o=s),f<r&&(r=f),s>i&&(i=s),f>c&&(c=f)};for(let s of Bt(e))if(s.type==="row"){let f=new Map((s.overrides??[]).map(a=>[a.index,a]));Xe(s).forEach((a,m)=>{let d=f.get(m);d?.skip||u(a.x+(d?.dx??0),a.y+(d?.dy??0))})}else if(s.type==="gaArea")for(let f of s.points)u(f.x,f.y);else if(s.type==="section")for(let f of s.outline)u(f.x,f.y);else if(s.type==="decorImage")u(s.x,s.y),u(s.x+s.width,s.y+s.height);else if(s.type==="shape")if(s.points&&s.points.length)for(let f of s.points)u(f.x,f.y);else s.x!=null&&s.y!=null&&s.width!=null&&s.height!=null&&(u(s.x,s.y),u(s.x+s.width,s.y+s.height));else if(s.type==="table"){let f=D+At,a=s.shape==="round"?(s.radius??40)+f:Math.max((s.width??80)/2,(s.height??50)/2)+f;u(s.center.x-a,s.center.y-a),u(s.center.x+a,s.center.y+a)}else if(s.type==="booth"){let f=Math.max(s.width,s.height)/2;u(s.center.x-f,s.center.y-f),u(s.center.x+f,s.center.y+f)}else if(s.type==="text"){if(n)continue;let f=fe(s);u(s.position.x,s.position.y),u(s.position.x+f.width,s.position.y+f.height)}for(let s of[e.referenceImage,e.backgroundImage]){if(!s)continue;let{center:f,width:a}=s,m=a*3/4;u(f.x-a/2,f.y-m/2),u(f.x+a/2,f.y+m/2)}if(!isFinite(o)){let s=e.focalPoint??{x:0,y:0};return{x:s.x-200,y:s.y-200,width:400,height:400}}return{x:o-z,y:r-z,width:i-o+z*2,height:c-r+z*2}}export{Xt as a,zt as b,Kt as c,Vt as d,$t as e,Wt as f,Yt as g,qt as h,Jt as i,fe as j,Zt as k,qe as l,en as m,Y as n,on as o,me as p,rn as q,sn as r,Qe as s,be as t,an as u,ge as v,et as w,un as x,mn as y,Pe as z,pn as A,ve as B,rt as C,it as D,ct as E,yn as F,lt as G,dt as H,xn as I,gn as J,wn as K,Sn as L,Ie as M,Ee as N,pt as O,Q as P,Oe as Q,Pn as R,Z as S,bt as T,Te as U,ee as V,G as W,En as X,wt as Y,Re as Z,_e as _,Ae as $,te as aa,St as ba,Mt as ca,Pt as da,X as ea,On as fa,Le as ga,je as ha,Et as ia,Ne as ja,D as ka,Xe as la,Un as ma,Lt as na,ze as oa,kt as pa,Ke as qa,Bn as ra,jt as sa,Dt as ta,Fe as ua,V as va,Gn as wa,$ as xa,Ht as ya,Ut as za,Xn as Aa,Bt as Ba,se as Ca,zn as Da,Kn as Ea,Vn as Fa,$n as Ga,Gt as Ha,Wn as Ia,ce as Ja};