@seatlayer/core 0.101.0 → 0.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/dist/ar-TGXEBJUB.js +1 -0
  2. package/dist/be-JIDOHWF6.js +1 -0
  3. package/dist/bg-ODVJNCC2.js +1 -0
  4. package/dist/ca-3I7TMWYU.js +1 -0
  5. package/dist/{categoryInventory-H77A_8pF.d.cts → categoryInventory-7gSFTu0l.d.cts} +1 -1
  6. package/dist/{categoryInventory-DZ5IcDOy.d.ts → categoryInventory-hJxuFF9L.d.ts} +1 -1
  7. package/dist/chunk-254ABRJF.js +1 -0
  8. package/dist/{chunk-5HXTEMRE.js → chunk-4DYJCT62.js} +1 -1
  9. package/dist/chunk-4R6TXHY2.js +1 -0
  10. package/dist/{chunk-D723OZEY.js → chunk-66T4EAUA.js} +1 -1
  11. package/dist/{chunk-GLGXP5I7.js → chunk-AFJWTB7L.js} +1 -1
  12. package/dist/chunk-COECA63Q.js +1 -0
  13. package/dist/chunk-EIV3CAGV.js +1 -0
  14. package/dist/chunk-FOIYJ5NT.js +1 -0
  15. package/dist/chunk-FUFRWRPM.js +1 -0
  16. package/dist/{chunk-2RNZOV5I.js → chunk-GPZFVQXV.js} +1 -1
  17. package/dist/{chunk-L34T3APU.js → chunk-GTRYL7YV.js} +1 -1
  18. package/dist/chunk-JRZHC75P.js +1 -0
  19. package/dist/chunk-KTMZ3QAO.js +1 -0
  20. package/dist/chunk-PHV2U54Y.js +1 -0
  21. package/dist/chunk-TAMY7HTV.js +1 -0
  22. package/dist/chunk-UEDS3HJ3.js +1 -0
  23. package/dist/{chunk-P4J57TK6.js → chunk-YPVYZYMH.js} +1 -1
  24. package/dist/chunk-ZS5YFXSE.js +1 -0
  25. package/dist/core/chart-ops/index.cjs +1 -1
  26. package/dist/core/chart-ops/index.d.cts +30 -9
  27. package/dist/core/chart-ops/index.d.ts +30 -9
  28. package/dist/core/chart-ops/index.js +1 -1
  29. package/dist/core/inventory/index.cjs +1 -1
  30. package/dist/core/inventory/index.d.cts +72 -5
  31. package/dist/core/inventory/index.d.ts +72 -5
  32. package/dist/core/inventory/index.js +1 -1
  33. package/dist/core/layout/index.cjs +1 -1
  34. package/dist/core/layout/index.d.cts +63 -6
  35. package/dist/core/layout/index.d.ts +63 -6
  36. package/dist/core/layout/index.js +1 -1
  37. package/dist/core/quality/index.cjs +1 -1
  38. package/dist/core/quality/index.d.cts +18 -4
  39. package/dist/core/quality/index.d.ts +18 -4
  40. package/dist/core/quality/index.js +1 -1
  41. package/dist/core/render-assets/index.cjs +1 -1
  42. package/dist/core/render-assets/index.d.cts +2 -2
  43. package/dist/core/render-assets/index.d.ts +2 -2
  44. package/dist/core/render-assets/index.js +1 -1
  45. package/dist/core/seatConfidence.d.cts +1 -1
  46. package/dist/core/seatConfidence.d.ts +1 -1
  47. package/dist/core/sections/index.cjs +1 -1
  48. package/dist/core/sections/index.d.cts +5 -5
  49. package/dist/core/sections/index.d.ts +5 -5
  50. package/dist/core/sections/index.js +1 -1
  51. package/dist/cs-XXB624Z3.js +1 -0
  52. package/dist/cy-W2QNU2GO.js +1 -0
  53. package/dist/da-Q47YPK2E.js +1 -0
  54. package/dist/de-TS3DPLM5.js +1 -0
  55. package/dist/{el-ZPFVDCWA.js → el-3JQUH6DB.js} +1 -1
  56. package/dist/es-GP7VOX7S.js +1 -0
  57. package/dist/et-A22OMZ6V.js +1 -0
  58. package/dist/{eventConfigurations-ClFqXQi9.d.cts → eventConfigurations-BHIfPJJJ.d.cts} +1 -1
  59. package/dist/{eventConfigurations-B6aS6c-_.d.ts → eventConfigurations-I5UBS6r9.d.ts} +1 -1
  60. package/dist/fa-5MS3C6YX.js +1 -0
  61. package/dist/fi-OJLAOJO2.js +1 -0
  62. package/dist/fr-7ATOYJCF.js +1 -0
  63. package/dist/he-37LKRY5W.js +1 -0
  64. package/dist/hi-YXZ5EWK7.js +1 -0
  65. package/dist/hr-QFOPGLMR.js +1 -0
  66. package/dist/hu-RHRBK46E.js +1 -0
  67. package/dist/id-A5Q3MLSX.js +1 -0
  68. package/dist/index.cjs +1 -1
  69. package/dist/index.d.cts +57 -16
  70. package/dist/index.d.ts +57 -16
  71. package/dist/index.js +1 -1
  72. package/dist/it-KG53QPQF.js +1 -0
  73. package/dist/ja-CC6EPUSN.js +1 -0
  74. package/dist/ko-7H4RGYFK.js +1 -0
  75. package/dist/ku-HFYWPSS4.js +1 -0
  76. package/dist/{labeling-ByEZkLee.d.cts → labeling-2A31f781.d.cts} +11 -3
  77. package/dist/{labeling-CP3GhUrf.d.ts → labeling-CDKZ9TO1.d.ts} +11 -3
  78. package/dist/localeLoaders-4YMC7FIZ.js +1 -0
  79. package/dist/lt-HQXE7W47.js +1 -0
  80. package/dist/lv-AN25XXPB.js +1 -0
  81. package/dist/ms-CWAYSF6E.js +1 -0
  82. package/dist/nl-63QBRZSZ.js +1 -0
  83. package/dist/no-RAPQMKWU.js +1 -0
  84. package/dist/pl-ILSTD4ZV.js +1 -0
  85. package/dist/pt-WF3US5D7.js +1 -0
  86. package/dist/{renderedQuality--H0toc-2.d.cts → renderedQuality-CwZ8hY-5.d.cts} +1 -1
  87. package/dist/{renderedQuality-Bo4k99GE.d.ts → renderedQuality-wDIiUId3.d.ts} +1 -1
  88. package/dist/{renderer-CWbam_zr.d.ts → renderer-CdJx5l3B.d.ts} +8 -1
  89. package/dist/{renderer-BPhSZUGh.d.cts → renderer-D6ggv3bV.d.cts} +8 -1
  90. package/dist/ro-XR3HT6DE.js +1 -0
  91. package/dist/ru-TLJEWDPA.js +1 -0
  92. package/dist/{seatTypeIcons-CSt1isBY.d.ts → seatTypeIcons-DMJX4rVN.d.cts} +2 -2
  93. package/dist/{seatTypeIcons-B2tvcQ0H.d.cts → seatTypeIcons-UpUTD8Xf.d.ts} +2 -2
  94. package/dist/{sections-JHox6Lsw.d.ts → sections-CempT5a0.d.cts} +5 -2
  95. package/dist/{sections-C_AKwOIh.d.cts → sections-lpdfwSdO.d.ts} +5 -2
  96. package/dist/{segmentedRowModel-CZ0Ciea-.d.cts → segmentedRowModel-Ddx5ol8T.d.cts} +1 -1
  97. package/dist/{segmentedRowModel-DQO0vHR1.d.ts → segmentedRowModel-HwY4XuYa.d.ts} +1 -1
  98. package/dist/sk-OJC2EL3Z.js +1 -0
  99. package/dist/sl-7RGTVXCV.js +1 -0
  100. package/dist/sr-NHDJ54BS.js +1 -0
  101. package/dist/sv-ZODCCBCU.js +1 -0
  102. package/dist/{tableSizing-Cp5T_6Lw.d.cts → tableSizing-BJqAuJDg.d.cts} +3 -3
  103. package/dist/{tableSizing-ClgbhNks.d.ts → tableSizing-C0zx97eg.d.ts} +3 -3
  104. package/dist/th-VCZA4MP5.js +1 -0
  105. package/dist/{ticketRestrictions-BHNbxzFT.d.cts → ticketRestrictions-AU8UUmdL.d.ts} +39 -3
  106. package/dist/{ticketRestrictions-DUdzkp4F.d.ts → ticketRestrictions-DDQHiKF-.d.cts} +39 -3
  107. package/dist/tr-ROKZO3HC.js +1 -0
  108. package/dist/{types-5AlKCD4j.d.cts → types-DL7qIUrD.d.cts} +68 -2
  109. package/dist/{types-5AlKCD4j.d.ts → types-DL7qIUrD.d.ts} +68 -2
  110. package/dist/uk-LP2DPUHC.js +1 -0
  111. package/dist/vi-JDK3JRJR.js +1 -0
  112. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  113. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  114. package/dist/view3d/index.cjs +54 -54
  115. package/dist/view3d/index.d.cts +9 -3
  116. package/dist/view3d/index.d.ts +9 -3
  117. package/dist/view3d/index.js +10 -10
  118. package/dist/view3d/scene/scene.worker.cjs +1 -1
  119. package/dist/view3d/scene/scene.worker.js +1 -1
  120. package/dist/zh-Hans-P3GB3FAZ.js +1 -0
  121. package/dist/zh-Hant-YU4OKSFZ.js +1 -0
  122. package/package.json +1 -1
  123. package/dist/ar-Q44JP5JY.js +0 -1
  124. package/dist/be-CGFFSIQL.js +0 -1
  125. package/dist/bg-WOYK6OLH.js +0 -1
  126. package/dist/ca-77ZVI3X5.js +0 -1
  127. package/dist/chunk-52XO3LA7.js +0 -1
  128. package/dist/chunk-5BMXWOE7.js +0 -1
  129. package/dist/chunk-5ITK5236.js +0 -1
  130. package/dist/chunk-5PFYIYM5.js +0 -1
  131. package/dist/chunk-CTIGUXXK.js +0 -1
  132. package/dist/chunk-FLZKBXHA.js +0 -1
  133. package/dist/chunk-HO4MFTVX.js +0 -1
  134. package/dist/chunk-JK3DUFRX.js +0 -1
  135. package/dist/chunk-N4J4CT6P.js +0 -1
  136. package/dist/chunk-NO6OLVTT.js +0 -1
  137. package/dist/chunk-UISTXRO5.js +0 -1
  138. package/dist/cs-OSBZYCSR.js +0 -1
  139. package/dist/cy-ZCOJW2WH.js +0 -1
  140. package/dist/da-2PDK6JTR.js +0 -1
  141. package/dist/de-R5LLVFUU.js +0 -1
  142. package/dist/es-7YASJP32.js +0 -1
  143. package/dist/et-J4TV6KQL.js +0 -1
  144. package/dist/fa-4TEO7UGM.js +0 -1
  145. package/dist/fi-GIUDDKMH.js +0 -1
  146. package/dist/fr-J5J2XJLA.js +0 -1
  147. package/dist/he-OCEHSVUJ.js +0 -1
  148. package/dist/hi-EK5CTBW5.js +0 -1
  149. package/dist/hr-SLDTQOYC.js +0 -1
  150. package/dist/hu-2QNE77NO.js +0 -1
  151. package/dist/id-LGDAFQJK.js +0 -1
  152. package/dist/it-DT4Y3IYB.js +0 -1
  153. package/dist/ja-D5EY2XCQ.js +0 -1
  154. package/dist/ko-DD2NV45Q.js +0 -1
  155. package/dist/ku-KZCMVLBE.js +0 -1
  156. package/dist/localeLoaders-GGAKX22E.js +0 -1
  157. package/dist/lt-QWGTJ47Y.js +0 -1
  158. package/dist/lv-LYAIG3VK.js +0 -1
  159. package/dist/ms-XTF4KNGD.js +0 -1
  160. package/dist/nl-QEXY6XHS.js +0 -1
  161. package/dist/no-HCOXN2CN.js +0 -1
  162. package/dist/pl-BWY53TSD.js +0 -1
  163. package/dist/pt-2UJUBCPL.js +0 -1
  164. package/dist/ro-GGXOLTED.js +0 -1
  165. package/dist/ru-ZTFK3WCU.js +0 -1
  166. package/dist/sk-KU543Y2U.js +0 -1
  167. package/dist/sl-FT576R7A.js +0 -1
  168. package/dist/sr-WE3J46JE.js +0 -1
  169. package/dist/sv-YEAOPSEB.js +0 -1
  170. package/dist/th-BEBRDHJA.js +0 -1
  171. package/dist/tr-LOAHUPSH.js +0 -1
  172. package/dist/uk-2GMICSHN.js +0 -1
  173. package/dist/vi-TC5B6AUR.js +0 -1
  174. package/dist/zh-Hans-TSZWTZQY.js +0 -1
  175. package/dist/zh-Hant-TLB4FZYM.js +0 -1
@@ -0,0 +1 @@
1
+ import{h as g}from"./chunk-UEDS3HJ3.js";import{c as M,k as A,n as m,t as _}from"./chunk-JBOTRSMY.js";var F=7,G=10,x=10,h=.39,d=.8,I=.62;function v(t){let n=Math.min(Math.abs(t.width),Math.abs(t.height));if(!(n>0))return x;let e=Math.max(1,t.text.length),r=Math.abs(t.width)*d/(e*I);return Math.max(x,Math.min(n*h,r))}var w=15,K=11,X=12;function Y(t){return t.labelPresentation?.visible!==!1}function D(t){let n=t.labelPresentation?.labelStyle?.size;return typeof n=="number"&&Number.isFinite(n)?n:void 0}var U=.85,O=12,l=4.5,V=3,S=3,o="#000000",i="#ffffff",Z=24,B=18.67;function W(t,n=400){return t>=Z||n>=700&&t>=B?S:l}function $(t,n){return t*n>=O}var j=24,C={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},Q=C.wheelchair;function q(t){if(!t?.length)return null;let n=t.includes("wheelchair")?"wheelchair":t[0];return C[n]??null}function J(t,n){return n.colorblind?N(n.canvasBackground):g(t)}function t1(t){return/-(\d{1,5})$/.exec(t)?.[1]??t}var s=m;function n1(t,n,e){let r=M(t),a=M(n);if(!r||!a)return n;let L=Math.max(0,Math.min(1,e));return`#${r.map((c,p)=>Math.round(c*L+a[p]*(1-L))).map(c=>c.toString(16).padStart(2,"0")).join("")}`}var e1=3;function r1(t){let n=s(i,t)??0,e=s(o,t)??0;return n>=l?i:e>=l&&_(t)||_(t)?o:i}function N(t){return _(t)?o:i}function E(t,n,e=l){let r=s(n,t);if(r!=null&&r>=e)return n;let a=s(o,t)??0,L=s(i,t)??0;return a===0&&L===0?n:a>=L?o:i}function L1(t,n,e,r=l){return n??E(t,e,r)}var z=3;function o1(t){let n=s("#ffffff",t);if(n!=null&&n>=z)return"#ffffff";let e=s(o,t)??0,r=s(i,t)??0;return e===0&&r===0?"#ffffff":e>=r?o:i}var T=/^#[0-9a-f]{6}$/i;function k(t){let n=M(t);return n!=null&&A(n)>.5}var y="#e5e7eb",R="#273142";function i1(t){return k(t)?y:R}function s1(t,n,e=l){let r=T.test(t.trim()),a=t.trim().toLowerCase(),L=0,u=0,c=null;for(let b of n){if(!r||!T.test(b.trim()))continue;L+=1;let f=E(b,t,e);f.toLowerCase()!==a&&(u+=1,c=f)}return{total:L,overridden:u,status:L===0?"none":u===0?"applies":u===L?"overridden":"mixed",overrideInk:c}}export{F as a,G as b,x as c,h as d,v as e,w as f,K as g,X as h,Y as i,D as j,U as k,O as l,l as m,V as n,S as o,o as p,i as q,W as r,$ as s,j as t,C as u,Q as v,q as w,J as x,t1 as y,s as z,n1 as A,e1 as B,r1 as C,N as D,E,L1 as F,o1 as G,k as H,y as I,R as J,i1 as K,s1 as L};
@@ -0,0 +1 @@
1
+ var g="ABCDEFGHIJKLMNOPQRSTUVWXYZ",k="ABCDEFGHJKLMNPQRSTUVWXYZ",x="abcdefghijklmnopqrstuvwxyz";function p(e,t){let r=t.length,n=e+1,a="";for(;n>0;){n-=1;let i=n%r;a=t[i]+a,n=Math.floor(n/r)}return a}function y(e,t){let r=t.startAt-1,n=e+r;if(t.scheme==="numbers")return String(n+1);let a=t.skipAmbiguous?k:g;return p(n,a)}function l(e,t=!1){let r=t?x:g;return p(Math.max(0,Math.floor(e)-1),r)}var A=[[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 h(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),r="";for(let[n,a]of A)for(;t>=n;)r+=a,t-=n;return r}function j(e,t){let r=e.length;return e.map((n,a)=>{let i=t.reverse?r-1-a:a;return{...n,label:y(i,t)}})}function C(e){let t=new Array(e);return Array.from({length:e},(r,n)=>n).sort((r,n)=>Math.abs(2*r-(e-1))-Math.abs(2*n-(e-1))||r-n).forEach((r,n)=>t[r]=n),t}function m(e,t){let r=e.seatLabelStart??1,n=e.seatNumbering?.direction??"ltr",a=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",f=e.seatNumbering?.prefix??"",d=e.seatNumbering?.endAt,b=e.seatCount;if(i==="updown"||i==="updown-descending"){let o=Math.ceil(b/2),R=i==="updown"?t<o?r+2*t:r-1+2*(b-t):t<o?r+2*(o-1-t):r+1+2*(t-o);return`${f}${R}`}let L=i==="odd"||i==="even"?2:a,s=d!=null&&Number.isFinite(d)?d-(b-1)*L:r,c=n==="center"?C(b)[t]:n==="rtl"?b-1-t:t,u;switch(i){case"odd":{let o=s%2===1?s:s+1;u=String(o+c*2);break}case"even":{let o=s%2===0?s:s+1;u=String(o+c*2);break}case"roman":u=h(s+c*a);break;case"letters-upper":u=l(s+c*a,!1);break;case"letters-lower":u=l(s+c*a,!0);break;default:u=String(s+c*a);break}return`${f}${u}`}function O(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function B(e,t,r){return r?.label??`${e.seatLabelBase??e.label}-${m(e,t)}`}function E(e,t,r,n){if(n?.displayLabel)return n.displayLabel;if(e.seatDisplayLabelMode==="number")return m(e,t);if(!r)return`${e.displayLabel||e.label}-${m(e,t)}`;let a=O(r),i=r.displayOffset+t;return`${r.displayLabel}-${m(a,i)}`}var N=999,S=["clockwise","anticlockwise"],M=["table-number","number","letter"];function D(e,t){return`${e.label}-${t+1}`}function T(e,t,r){return e?.direction==="anticlockwise"?Math.max(0,t-1-r):r}function w(e,t){let r=e.chairNumbering,n=r?.start??1,a=T(r,Math.max(0,Math.round(e.seatCount)),t);return r?.format==="letter"?l(Math.max(1,n)+a):String(n+a)}function H(e,t){let r=w(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${r}`:r}function F(e){if(e===void 0)return null;if(!e||typeof e!="object"||Array.isArray(e))return"chairNumbering must be an object";let t=e,r=Object.keys(t).filter(n=>!["start","direction","format"].includes(n));return r.length?`chairNumbering has unsupported field(s): ${r.join(", ")}`:t.start!==void 0&&(!Number.isInteger(t.start)||t.start<0||t.start>N)?`chairNumbering.start must be a whole number from 0 to ${N}`:t.direction!==void 0&&!S.includes(t.direction)?"chairNumbering.direction must be clockwise or anticlockwise":t.format!==void 0&&!M.includes(t.format)?"chairNumbering.format must be table-number, number or letter":null}function X(e){let t={};return e.start!==void 0&&e.start!==1&&(t.start=e.start),e.direction==="anticlockwise"&&(t.direction="anticlockwise"),e.format&&e.format!=="table-number"&&(t.format=e.format),Object.keys(t).length?t:void 0}export{p as a,y as b,l as c,h as d,j as e,m as f,O as g,B as h,E as i,N as j,S as k,M as l,D as m,w as n,H as o,F as p,X as q};
@@ -0,0 +1 @@
1
+ import{m as S}from"./chunk-UEDS3HJ3.js";import{M as f,Ra as A,ba as w}from"./chunk-EIV3CAGV.js";var j=36,x=160;function C(e,t=360){let o=f(Math.round(Number.isFinite(e)?e:1),1,40),s=f(Number.isFinite(t)?t:360,120,360);return Math.round(f(o*4*(360/s),j,x))}function l(e){return typeof e=="string"&&S.includes(e)}function b(e,t){return e&&t?"both":e?"start":t?"end":"none"}function g(e){let t=new Map,o=w(e);if(!o.size)return t;let s=new Map;for(let r of e){if(r.type!=="row"||!o.has(r.id))continue;let i=r.segmentedRow.groupId,a=s.get(i)??[];a.push(r),s.set(i,a)}for(let r of s.values())r.sort((i,a)=>i.segmentedRow.componentIndex-a.segmentedRow.componentIndex),r.forEach((i,a)=>{let c=r[a+1];t.set(i.id,{start:a>0&&i.segmentedRow.boundaryBefore==="continuous",end:!!c&&c.segmentedRow.boundaryBefore==="continuous"})});return t}function h(e,t){let o=Number.isInteger(e.seatCount)&&e.seatCount>0?e.seatCount:0,s=new Set;for(let n of e.overrides??[])n.skip&&s.add(n.index);let r=n=>n>=0&&n<o&&!s.has(n),i=b(!t?.start,!t?.end),a=l(e.aisleSeats)?e.aisleSeats:void 0,c=a??i,d=-1,m=-1;for(let n=0;n<o;n+=1)r(n)&&(d<0&&(d=n),m=n);let u=new Set;if(d>=0){(c==="start"||c==="both")&&u.add(d),(c==="end"||c==="both")&&u.add(m);for(let n of s)r(n-1)&&u.add(n-1),r(n+1)&&u.add(n+1)}return{...a?{override:a}:{},automatic:i,slots:[...u].sort((n,O)=>n-O)}}function D(e,t=[e]){return h(e,e.segmentedRow?g(t).get(e.id):void 0)}function I(e){let t=new Set;for(let o of A(e)){let s=g(o.objects);for(let r of o.objects)if(r.type==="row")for(let i of h(r,s.get(r.id)).slots)t.add(`${r.id}:${i}`)}return t}function E(e,t,o){return I(e).has(`${t}:${o}`)}function R(e){let t=l(e.aisleSeats)?e.aisleSeats:"both";return{start:t==="start"||t==="both",end:t==="end"||t==="both"}}function p(e,t){t==="both"?delete e.aisleSeats:e.aisleSeats=t}function N(e,t,o){if(!l(e.aisleSeats)){delete t.aisleSeats,delete o.aisleSeats;return}let s=R(e);p(t,b(s.start,!0)),p(o,b(!0,s.end))}function U(e,t){let o=e[0],s=e[e.length-1];if(!o||!s||!l(o.aisleSeats)&&!l(s.aisleSeats)){delete t.aisleSeats;return}p(t,b(R(o).start,R(s).end))}export{j as a,x as b,C as c,l as d,D as e,I as f,E as g,N as h,U as i};
@@ -0,0 +1 @@
1
+ import{a as We,c as Ye,d as ze}from"./chunk-GTRYL7YV.js";import{b as Ne,c as Xe}from"./chunk-FUFRWRPM.js";import{v as Ke}from"./chunk-4DYJCT62.js";import{a as je,c as Vt,d as pt,f as xt,i as Ue}from"./chunk-66T4EAUA.js";import{h as gn}from"./chunk-UEDS3HJ3.js";import{e as Ge,l as He}from"./chunk-4N5CHKHD.js";import{B as Oe,C as Yt,Na as Rt,Wa as In,ca as $,da as Pt,j as Te,ma as Mn,oa as zt,pa as Pn,ra as Ce,ta as Kt,ua as Rn,va as ke,xa as zn,ya as Fe,za as Le}from"./chunk-EIV3CAGV.js";import{A as St,D as De,b as ve,d as it,y as st}from"./chunk-JBOTRSMY.js";var on=["available","held","sold","selected","dimmed"];function Kn(t){let n=on.indexOf(t);return n<0?0:n}var Ve={available:[.24,.82,.52],held:[.34,.39,.45],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function Bl(t){let n=.2126*t[0]+.7152*t[1]+.0722*t[2],e=.78,r=.86;return[(n+(t[0]-n)*e)*r,(n+(t[1]-n)*e)*r,(n+(t[2]-n)*e)*r]}var Vn={ground:[.07,.085,.11],tierTop:[.24,.28,.34],tierWall:[.17,.2,.25],stageTop:[.94,.7,.38],stageWall:[.48,.33,.18],decorTop:[.22,.25,.29],decorWall:[.15,.17,.2],gaTop:[.24,.28,.33],gaWall:[.16,.19,.23],boothTop:[.3,.33,.38],boothWall:[.2,.23,.27],tableTop:[.38,.34,.29],tableWall:[.24,.21,.18]},Zn={top:[.05,.06,.08],bottom:[.1,.12,.15]};function V(t,n){return[Math.min(1,t[0]*n),Math.min(1,t[1]*n),Math.min(1,t[2]*n)]}import Qr from"earcut";import qe from"polygon-clipping";var I=$,Jr=.002;function ti(t,n,e){let r=Math.hypot(n[0]-t[0],n[1]-t[1],n[2]-t[2]),o=Math.hypot(e[0]-n[0],e[1]-n[1],e[2]-n[2]),a=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),i=Math.max(r,o,a);if(i<1e-9)return!0;let s=(r+o+a)/2;return 2*Math.sqrt(Math.max(0,s*(s-r)*(s-o)*(s-a)))/i<Jr}var Xt=class{constructor(n=16384){this.len=0;this.buf=new Float32Array(n)}push3(n,e,r){this.len+3>this.buf.length&&this.grow(this.len+3),this.buf[this.len++]=n,this.buf[this.len++]=e,this.buf[this.len++]=r}push1(n){this.len+1>this.buf.length&&this.grow(this.len+1),this.buf[this.len++]=n}grow(n){let e=this.buf.length*2;for(;e<n;)e*=2;let r=new Float32Array(e);r.set(this.buf.subarray(0,this.len)),this.buf=r}get length(){return this.len}toArray(){return this.buf.slice(0,this.len)}},An=class{constructor(){this.pos=new Xt;this.nor=new Xt;this.col=new Xt;this.flr=new Xt;this.mat=new Xt;this.currentFloor=0;this.currentMaterial=0}setFloor(n){this.currentFloor=n}setMaterial(n){this.currentMaterial=n}tri(n,e,r,o,a,i=a,s=a){ti(n,e,r)||(this.pos.push3(n[0],n[1],n[2]),this.pos.push3(e[0],e[1],e[2]),this.pos.push3(r[0],r[1],r[2]),this.nor.push3(o[0],o[1],o[2]),this.nor.push3(o[0],o[1],o[2]),this.nor.push3(o[0],o[1],o[2]),this.col.push3(a[0],a[1],a[2]),this.col.push3(i[0],i[1],i[2]),this.col.push3(s[0],s[1],s[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}triN(n,e,r,o,a,i,s,c=s,l=s){[...n,...e,...r].every(Number.isFinite)&&(this.pos.push3(n[0],n[1],n[2]),this.pos.push3(e[0],e[1],e[2]),this.pos.push3(r[0],r[1],r[2]),this.nor.push3(o[0],o[1],o[2]),this.nor.push3(a[0],a[1],a[2]),this.nor.push3(i[0],i[1],i[2]),this.col.push3(s[0],s[1],s[2]),this.col.push3(c[0],c[1],c[2]),this.col.push3(l[0],l[1],l[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}get vertexCount(){return this.pos.length/3}build(){return{position:this.pos.toArray(),normal:this.nor.toArray(),color:this.col.toArray(),floor:this.flr.toArray(),material:this.mat.toArray(),count:this.pos.length/3}}};function ni(t,n,e){let r=n[0]-t[0],o=n[1]-t[1],a=n[2]-t[2],i=e[0]-t[0],s=e[1]-t[1],c=e[2]-t[2],l=o*c-a*s,u=a*i-r*c,f=r*s-o*i,m=Math.hypot(l,u,f)||1;return l/=m,u/=m,f/=m,[l,u,f]}function ei(t,n){let e=[...t],r=[];for(let i of t)r.push(i.x,i.y);let o=[];if(n){for(let i of n)if(!(i.length<3)){o.push(e.length);for(let s of i)e.push(s),r.push(s.x,s.y)}}let a=Qr(r,o.length?o:void 0,2);return{pts:e,tris:a}}function Et(t){return pt(t)<0?[...t].reverse():t}var oi=3;function ri(t,n,e,r){let o=r(t),a=r(n),i=r(e),s=(h,d,y,b)=>Math.abs(r({x:(h.x+d.x)/2,y:(h.y+d.y)/2})-(y+b)/2),c=(t.x+n.x+e.x)/3,l=(t.y+n.y+e.y)/3,u=(o+a+i)/3,f=Math.max(s(t,n,o,a),s(n,e,a,i),s(e,t,i,o),Math.abs(r({x:c,y:l})-u)),m=(h,d,y)=>{let b=Math.abs(r({x:(h+c)/2,y:(d+l)/2})-(y+u)/2);b>f&&(f=b)};return m((t.x+n.x)/2,(t.y+n.y)/2,(o+a)/2),m((n.x+e.x)/2,(n.y+e.y)/2,(a+i)/2),m((e.x+t.x)/2,(e.y+t.y)/2,(i+o)/2),f}function rn(t,n,e,r,o){if(o<=0)return ri(t,n,e,r);let a={x:(t.x+n.x)/2,y:(t.y+n.y)/2},i={x:(n.x+e.x)/2,y:(n.y+e.y)/2},s={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return Math.max(rn(t,a,s,r,o-1),rn(a,n,i,r,o-1),rn(s,i,e,r,o-1),rn(a,i,s,r,o-1))}function sn(t,n,e,r,o,a,i,s){if(i>0){let m={x:(n.x+e.x)/2,y:(n.y+e.y)/2},h={x:(e.x+r.x)/2,y:(e.y+r.y)/2},d={x:(r.x+n.x)/2,y:(r.y+n.y)/2};sn(t,n,m,d,o,a,i-1,s),sn(t,m,e,h,o,a,i-1,s),sn(t,d,h,r,o,a,i-1,s),sn(t,m,h,d,o,a,i-1,s);return}let c=[n.x*I,o(n),n.y*I],l=[e.x*I,o(e),e.y*I],u=[r.x*I,o(r),r.y*I];if(s){t.triN(c,l,u,s(n),s(e),s(r),a);return}let f=ni(c,l,u);f[1]<0&&(f=[-f[0],-f[1],-f[2]]),t.tri(c,l,u,f,a)}var ii=8;function Ze(t,n,e){if(!Number.isFinite(e))return t;let r=[],o=(a,i,s,c,l)=>{if(l>0){let u={x:(a.x+i.x)/2,y:(a.y+i.y)/2},f=n(u);if(Math.abs(f-(s+c)/2)>e){o(a,u,s,f,l-1),o(u,i,f,c,l-1);return}}r.push(a)};for(let a=0;a<t.length;a++){let i=t[a],s=t[(a+1)%t.length];o(i,s,n(i),n(s),ii)}return r}function Sn(t,n){if(t.length<3)return t;let e=[];for(let o of t){let a=e[e.length-1];a&&Math.hypot(o.x-a.x,o.y-a.y)<n||e.push(o)}for(;e.length>2&&Math.hypot(e[0].x-e[e.length-1].x,e[0].y-e[e.length-1].y)<n;)e.pop();if(e.length<3)return t;let r=[];for(let o=0;o<e.length;o++){let a=r.length?r[r.length-1]:e[(o-1+e.length)%e.length],i=e[o],s=e[(o+1)%e.length],c=s.x-a.x,l=s.y-a.y,u=Math.hypot(c,l);u>n&&Math.abs((i.x-a.x)*l-(i.y-a.y)*c)/u<n||r.push(i)}return r.length>=3?r:e}var _n=.001*Pt*.1;function Z(t,n,e,r,o,a,i,s,c=1/0,l){if(!n||n.length<3||(c===void 0&&(c=1/0),Math.abs(pt(n))<1e-4))return;let u=Sn(Ze(Sn(Et(n),_n),r,c),_n),f=e?.map(x=>Sn(Ze(Sn(Et(x),_n),r,c),_n)).filter(x=>x.length>=3&&Math.abs(pt(x))>=1e-4),{pts:m,tris:h}=ei(u,f),d=[a[0]*s.top,a[1]*s.top,a[2]*s.top],y=[a[0]*s.bottomCap,a[1]*s.bottomCap,a[2]*s.bottomCap],b=[i[0]*s.top,i[1]*s.top,i[2]*s.top],p=[i[0]*s.wallBottom,i[1]*s.wallBottom,i[2]*s.wallBottom],g=0;if(Number.isFinite(c))for(;g<oi;g++){let x=0;for(let A=0;A<h.length;A+=3){let R=rn(m[h[A]],m[h[A+1]],m[h[A+2]],r,g);R>x&&(x=R)}if(x<=c)break}for(let x=0;x<h.length;x+=3){let A=m[h[x]],R=m[h[x+1]],S=m[h[x+2]];sn(t,A,R,S,r,d,g,l);let E=[A.x*I,o,A.y*I],T=[R.x*I,o,R.y*I],F=[S.x*I,o,S.y*I];t.tri(E,F,T,[0,-1,0],y)}let P=x=>{if(g<=0)return x;let A=1<<g,R=[];for(let S=0;S<x.length;S++){let E=x[S],T=x[(S+1)%x.length];for(let F=0;F<A;F++){let k=F/A;R.push({x:E.x+(T.x-E.x)*k,y:E.y+(T.y-E.y)*k})}}return R},_=Oe(u),M=[{ring:P(u),flip:!1}];if(f)for(let x of f)x.length>=3&&M.push({ring:P(x),flip:!0});for(let{ring:x,flip:A}of M)for(let R=0;R<x.length;R++){let S=x[R],E=x[(R+1)%x.length],T=(E.x-S.x)*I,k=(E.y-S.y)*I,w=-T,B=Math.hypot(k,w)||1;k/=B,w/=B;let C=(S.x+E.x)/2-_.x,L=(S.y+E.y)/2-_.y,O=k*C+w*L;A&&(O=-O),O<0&&(k=-k,w=-w);let D=[k,0,w],H=[S.x*I,r(S),S.y*I],j=[E.x*I,r(E),E.y*I],G=[S.x*I,o,S.y*I],U=[E.x*I,o,E.y*I];t.tri(H,j,U,D,b,b,p),t.tri(H,U,G,D,b,p,p)}}function $e(t){let n=0;for(let c of t)n+=c.count;let e=new Float32Array(n*3),r=new Float32Array(n*3),o=new Float32Array(n*3),a=new Float32Array(n),i=new Float32Array(n),s=0;for(let c of t)e.set(c.position,s*3),r.set(c.normal,s*3),o.set(c.color,s*3),a.set(c.floor,s),i.set(c.material,s),s+=c.count;return{position:e,normal:r,color:o,floor:a,material:i,count:n}}function _t(t,n,e=2.5){if(n<=0||t.length<3)return t;let r=Et(t),o=r.length,a=[];for(let s=0;s<o;s++){let c=r[s],l=r[(s+1)%o],u=l.x-c.x,f=l.y-c.y,m=Math.hypot(u,f)||1;a.push({x:f/m,y:-u/m})}let i=[];for(let s=0;s<o;s++){let c=r[s],l=a[(s-1+o)%o],u=a[s],f=l.x+u.x,m=l.y+u.y,h=Math.hypot(f,m),d=()=>{i.push([c.x+l.x*n,c.y+l.y*n]),i.push([c.x+u.x*n,c.y+u.y*n])};if(h<1e-9){d();continue}f/=h,m/=h;let y=f*l.x+m*l.y,b=1/Math.max(y,1e-6);if(!Number.isFinite(b)||b>e){d();continue}i.push([c.x+f*n*b,c.y+m*n*b])}if(i.length<3)return t;try{let s=qe.union([[...i,i[0]]]),c=null,l=-1/0;for(let f of s){let m=Math.abs(pt(f[0].map(([h,d])=>({x:h,y:d}))));m>l&&(l=m,c=f[0])}if(!c)return t;let u=c.map(([f,m])=>({x:f,y:m}));if(u.length>1){let f=u[0],m=u[u.length-1];Math.abs(f.x-m.x)<1e-9&&Math.abs(f.y-m.y)<1e-9&&u.pop()}return u.length>=3?u:t}catch{return t}}function Lt(t,n,e=2.5){if(t.length<3)return[];if(n<=0)return t;let r=Et(t),o=r.length,a=[];for(let c=0;c<o;c++){let l=r[c],u=r[(c+1)%o],f=Math.hypot(u.x-l.x,u.y-l.y)||1;a.push({x:-(u.y-l.y)/f,y:(u.x-l.x)/f})}let i=[],s=[];for(let c=0;c<o;c++){let l=r[c],u=a[(c-1+o)%o],f=a[c],m=u.x+f.x,h=u.y+f.y,d=Math.hypot(m,h),y=d<1e-9?1/0:1/Math.max(m/d*u.x+h/d*u.y,1e-6);if(!Number.isFinite(y)||y>e){i.push({x:l.x+u.x*n,y:l.y+u.y*n},{x:l.x+f.x*n,y:l.y+f.y*n}),s.push(c,c);continue}m/=d,h/=d,i.push({x:l.x+m*n*y,y:l.y+h*n*y}),s.push(c)}for(let c=0;c<i.length;c++){let l=(c+1)%i.length,u=s[c],f=s[l];if(f!==(u+1)%o)continue;let m=r[u],h=r[f];if((i[l].x-i[c].x)*(h.x-m.x)+(i[l].y-i[c].y)*(h.y-m.y)<=0)return[]}try{let c=qe.intersection([[...i.map(d=>[d.x,d.y]),[i[0].x,i[0].y]]],[[...r.map(d=>[d.x,d.y]),[r[0].x,r[0].y]]]),l=null,u=0;for(let d of c){let y=Math.abs(pt(d[0].map(([b,p])=>({x:b,y:p}))));y>u&&(u=y,l=d[0])}if(!l)return[];let f=l.map(([d,y])=>({x:d,y})),m=f[0],h=f[f.length-1];return f.length>1&&Math.abs(m.x-h.x)<1e-9&&Math.abs(m.y-h.y)<1e-9&&f.pop(),f.length>=3?Et(f):[]}catch{return[]}}function wn(t,n,e,r,o=28){let a=[];for(let i=0;i<o;i++){let s=i/o*Math.PI*2;a.push({x:t+e*Math.cos(s),y:n+r*Math.sin(s)})}return a}function an(t,n,e,r){return[{x:t,y:n},{x:t+e,y:n},{x:t+e,y:n+r},{x:t,y:n+r}]}var ut={pedestal:0,pad:1,back:2,arm:3,footrest:4,leg:5,body:10,head:11},si=.44,ai=.15,ci=.3,li=.24;function Je(t){return t===void 0||!Number.isFinite(t)||t<=0?li:Math.min(ci,Math.max(ai,t*si))}var vl=.21,ui=.05,qn=.45,fi=qn+ui,mi=.92,Qe=.66,hi=1.205,yi=-.23,di=.38,pi=[{part:ut.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:ut.pad,min:[-1,.36,-.95],max:[1,qn,1]},{part:ut.back,min:[-1,fi,-1],max:[1,mi,-.72]},{part:ut.arm,min:[-1,.44,-.82],max:[-.78,.65,.78]},{part:ut.arm,min:[.78,.44,-.82],max:[1,.65,.78]},{part:ut.footrest,min:[-.9,.18,.78],max:[.9,.31,1.34]},{part:ut.leg,min:[-.82,0,-.7],max:[-.62,.37,-.48]},{part:ut.leg,min:[.62,0,-.7],max:[.82,.37,-.48]},{part:ut.leg,min:[-.82,0,.48],max:[-.62,.37,.7]},{part:ut.leg,min:[.62,0,.48],max:[.82,.37,.7]}],xi=[{part:ut.body,min:[-.52,.39,-.08],max:[-.08,.55,.82]},{part:ut.body,min:[.08,.39,-.08],max:[.52,.55,.82]},{part:ut.body,min:[-.47,.05,.58],max:[-.13,.43,.82]},{part:ut.body,min:[.13,.05,.58],max:[.47,.43,.82]},{part:ut.head,min:[-.16,1.04,-.33],max:[.16,1.1,-.13]}],bi=[{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]]}];function Dl(){let t=[],n=[],e=[],r=[],o=(G,U,X)=>{let Y=e.length,[nt,rt,q]=G,Q=[rt[0]-nt[0],rt[1]-nt[1],rt[2]-nt[2]],J=[q[0]-nt[0],q[1]-nt[1],q[2]-nt[2]],N=Q[1]*J[2]-Q[2]*J[1],v=Q[2]*J[0]-Q[0]*J[2],W=Q[0]*J[1]-Q[1]*J[0],lt=Math.hypot(N,v,W);lt>1e-9?(N/=lt,v/=lt,W/=lt):[N,v,W]=U,N*U[0]+v*U[1]+W*U[2]<0&&(N=-N,v=-v,W=-W);for(let ft of G)t.push(...ft),n.push(N,v,W),e.push(X);r.push(Y,Y+1,Y+2,Y,Y+2,Y+3)},a=G=>{for(let U of bi){let X=U.c.map(Y=>Y.map((nt,rt)=>nt?G.max[rt]:G.min[rt]));o(X,U.n,G.part)}},i=(G,U)=>{let[X,Y,nt]=U?[0,1,2]:[0,2,1],rt=G.min[X],q=G.max[X],Q=G.min[Y],J=G.max[Y],N=(q-rt)*.1,v=(J-Q)*.1,W=U?[[rt+N,Q],[q-N,Q],[q,Q+v],[q*.94,J-(J-Q)*.23],[q*Qe,J],[rt*Qe,J],[rt*.94,J-(J-Q)*.23],[rt,Q+v]]:[[rt+N,Q],[q-N,Q],[q,Q+v],[q,J-v],[q-N,J],[rt+N,J],[rt,J-v],[rt,Q+v]],lt=(at,tt,et)=>{let ht=[0,0,0];return ht[X]=at,ht[Y]=tt,ht[nt]=et,ht},ft=[G.min[nt],G.max[nt]].map(at=>W.map(([tt,et])=>lt(tt,et,at)));for(let at=0;at<W.length;at++){let tt=(at+1)%W.length,et=[0,0,0];et[X]=(W[at][0]+W[tt][0])/2-(rt+q)/2,et[Y]=(W[at][1]+W[tt][1])/2-(Q+J)/2,o([ft[0][at],ft[0][tt],ft[1][tt],ft[1][at]],et,G.part)}for(let at=0;at<2;at++){let tt=[0,0,0];tt[nt]=at?1:-1;let et=ft[at];for(let ht=1;ht<et.length-1;ht++){let z=e.length;for(let mt of[et[0],et[ht],et[ht+1]])t.push(...mt),n.push(...tt),e.push(G.part);r.push(z,z+1,z+2)}}};for(let G of pi)G.part===ut.pad||G.part===ut.back?i(G,G.part===ut.back):a(G);for(let G of xi)a(G);let s=qn,c=1.08,l=.47,u=.69,f=-.55,m=.08,h=-.48,d=.01,y=[-l,s,f],b=[l,s,f],p=[-l,s,m],g=[l,s,m],P=[-u,c,h],_=[u,c,h],M=[-u,c,d],x=[u,c,d];o([b,_,x,g],[1,0,0],ut.body),o([p,M,P,y],[-1,0,0],ut.body),o([y,b,g,p],[0,-1,0],ut.body);let A=c+.07,R=.24,S=[-R,A,h],E=[R,A,h],T=[-R,A,d],F=[R,A,d];o([M,T,S,P],[-.5,1,0],ut.body),o([T,F,E,S],[0,1,0],ut.body),o([F,x,_,E],[.5,1,0],ut.body),o([g,x,M,p],[0,0,1],ut.body),o([x,F,T,M],[0,0,1],ut.body),o([y,P,_,b],[0,0,-1],ut.body),o([P,S,E,_],[0,0,-1],ut.body);let k=10,w=8,B=[0,hi,yi],C=[.32,.115,di],L=e.length;for(let G=0;G<=w;G++){let U=Math.PI*G/w,X=Math.cos(U),Y=Math.sin(U);for(let nt=0;nt<=k;nt++){let rt=Math.PI*2*nt/k,q=Y*Math.cos(rt),Q=Y*Math.sin(rt);t.push(B[0]+C[0]*q,B[1]+C[1]*X,B[2]+C[2]*Q);let J=q/C[0],N=X/C[1],v=Q/C[2],W=Math.hypot(J,N,v)||1;J/=W,N/=W,v/=W,n.push(J,N,v),e.push(ut.head)}}for(let G=0;G<w;G++)for(let U=0;U<k;U++){let X=L+G*(k+1)+U,Y=X+k+1;r.push(X,Y,X+1,X+1,Y,Y+1)}let O=new Float32Array(t),D=new Float32Array(n),H=new Float32Array(e),j=new Uint16Array(r);return{position:O,normal:D,part:H,index:j,vertexCount:e.length,indexCount:r.length}}function to(t,n,e,r){let o=new Float32Array(n),a=l=>t[l*3],i=l=>t[l*3+2],s=0,c=(l,u)=>{let f=u-l;for(let m=l;m<u;m++){let[h,d]=r(m),y=h-a(m),b=d-i(m);if(f>=2){let p=Math.max(l,m-1),g=Math.min(u-1,m+1),P=a(g)-a(p),_=i(g)-i(p),M=Math.hypot(P,_);if(M>1e-6){let x=-_/M,A=P/M;x*y+A*b<0&&(x=-x,A=-A),y=x,b=A}}o[m]=y===0&&b===0?0:Math.atan2(y,b)}};for(let l=1;l<=n;l++)(l===n||e(l)!==e(s))&&(c(s,l),s=l);return o}var En=.22;function Kl(t,n){let e=on[t];if(e!=="sold"&&e!=="held")return-1;let r=(n+1)*2654435761;return r^=r>>>15,r=Math.imul(r,2246822519),r^=r>>>13,(r>>>0)%1e5/1e5}var gi=.42;function Mi(t){let n=t.length,e=new Float64Array(n);if(n<2)return e.fill(1/0),e;let r=1/0,o=1/0,a=-1/0,i=-1/0;for(let d of t)d.x<r&&(r=d.x),d.y<o&&(o=d.y),d.x>a&&(a=d.x),d.y>i&&(i=d.y);let s=Math.max(a-r,1e-6),c=Math.max(i-o,1e-6),l=Math.max(Math.sqrt(s*c/n),1e-6),u=Math.max(1,Math.ceil(s/l)+1),f=Math.max(1,Math.ceil(c/l)+1),m=new Map,h=(d,y)=>{let b=Math.min(u-1,Math.max(0,Math.floor((d-r)/l)));return Math.min(f-1,Math.max(0,Math.floor((y-o)/l)))*u+b};for(let d=0;d<n;d++){let y=h(t[d].x,t[d].y),b=m.get(y);b?b.push(d):m.set(y,[d])}for(let d=0;d<n;d++){let y=t[d],b=Math.min(u-1,Math.max(0,Math.floor((y.x-r)/l))),p=Math.min(f-1,Math.max(0,Math.floor((y.y-o)/l))),g=1/0;for(let P=1;P<=4;P++){for(let _=p-P;_<=p+P;_++)if(!(_<0||_>=f))for(let M=b-P;M<=b+P;M++){if(M<0||M>=u||P>1&&Math.abs(_-p)<P&&Math.abs(M-b)<P)continue;let x=m.get(_*u+M);if(x)for(let A of x){if(A===d)continue;let R=Math.hypot(t[A].x-y.x,t[A].y-y.y);R<g&&(g=R)}}if(Number.isFinite(g)&&g<=P*l)break}e[d]=g}return e}function Pi(t){let n=t.eyeHeightM;return Number.isFinite(n)?Math.max(0,n-Mn):0}function no(t,n,e,r,o,a){let i=t.length,s=new Float32Array(i*3),c=new Float32Array(i),l=new Float32Array(i*3),u=new Float32Array(i),f=new Float32Array(i),m=new Float32Array(i),h=new Float32Array(i),d=new Float32Array(i*3),y=new Map,b=Mi(t);for(let p=0;p<i;p++){let g=t[p],_=(e?.seatPitchU(p)??b[p])*I;u[p]=Number.isFinite(_)?Math.max(.06,Math.min(En,_*gi)):En,f[p]=Je(Number.isFinite(_)?_:void 0);let M=He(g.glyph,{seatGlyph:a?.get(g.categoryKey)});m[p]=Ge.indexOf(M),h[p]=g.wheelchairSpaceType==="no-seat"?0:1,s[p*3]=g.x*I,s[p*3+1]=e?e.seatDeckY(p):Pi(g),s[p*3+2]=g.y*I,c[p]=Kn(n?n(g):"available");let x=it(o?.get(g.categoryKey)??"#6e7bff")??[.43,.48,1];if(l[p*3]=x[0],l[p*3+1]=x[1],l[p*3+2]=x[2],g.accessibility?.length){let A=it(gn(g.accessibility));A&&(d[p*3]=A[0],d[p*3+1]=A[1],d[p*3+2]=A[2])}y.set(g.id,p)}return{count:i,iPosition:s,iState:c,iCategory:l,iMaxRadius:u,iRing:d,idToIndex:y,iChairWidth:f,iGlyph:m,iPhysicalSeat:h,iFloor:r??new Float32Array(i),iSection:new Float32Array(i).fill(-1),iYaw:new Float32Array(i)}}var Ri=64;function Vl(t,n){let e=[];for(let i of n){let s=t.idToIndex.get(i.seatId);if(s===void 0)continue;let c=Kn(i.state);t.iState[s]!==c&&(t.iState[s]=c,e.push(s))}if(!e.length)return[];e.sort((i,s)=>i-s);let r=[],o=e[0],a=e[0];for(let i=1;i<e.length;i++){let s=e[i];if(s!==a){if(s<=a+Ri){a=s;continue}r.push({start:o,length:a-o+1}),o=s,a=s}}return r.push({start:o,length:a-o+1}),r}import Li from"polygon-clipping";var K={top:1,wallBottom:.58,bottomCap:.4};function jt(t,n){if(!t)return n;let e=V(St(t,.4),.62);return st(n,e,.22)}function eo(t,n){return t?st(n,V(St(t,.25),.74),.62):n}function oo(t,n){return t?st(n,V(St(t,.08),.9),.82):n}function ro(t,n){let e=new Map;for(let a of t.categories??[])e.set(a.key,a.color);let r=new Map;for(let a of n){if(!a.sectionId)continue;let i=r.get(a.sectionId);i||(i=new Map,r.set(a.sectionId,i)),i.set(a.categoryKey,(i.get(a.categoryKey)??0)+1)}let o=new Map;for(let[a,i]of r){let s=0,c=0,l=0,u=0;for(let[f,m]of i){let h=it(e.get(f));h&&(s+=h[0]*m,c+=h[1]*m,l+=h[2]*m,u+=m)}u>0&&o.set(a,[s/u,c/u,l/u])}return o}function io(t,n){return it(t.color)??n.get(t.logicalSectionId??t.id)??null}import go from"polygon-clipping";import lo from"polygon-clipping";import Ii from"earcut";var Si=.58,so=.01,It=En*1.5*Pt,_i=.5,Ai=.6;function wi(t,n){let e=t.length,r=[];for(let i=0;i<e;i++){let s=t[Math.max(0,i-1)],c=t[Math.min(e-1,i+1)],l=c.x-s.x,u=c.y-s.y,f=Math.hypot(l,u);if(f<1e-9){r.push([0,0]);continue}l/=f,u/=f,r.push([-u,l])}let o=0;for(let i=0;i<e;i++)o+=(t[i].x-n.x)*r[i][0]+(t[i].y-n.y)*r[i][1];return o<0?r.map(([i,s])=>[-i,-s]):r}function Ei(t,n){if(t.length<2||n<=0)return[...t];let e=[...t],r=(i,s)=>{let c=s.x-i.x,l=s.y-i.y,u=Math.hypot(c,l)||1;return{x:c/u,y:l/u}},o=r(e[1],e[0]),a=r(e[e.length-2],e[e.length-1]);return e.unshift({x:e[0].x+o.x*n,y:e[0].y+o.y*n}),e.push({x:e[e.length-1].x+a.x*n,y:e[e.length-1].y+a.y*n}),e}var ao=Math.PI/12;function Bi(t){if(t.length<3)return[...t];let n=[...t].sort((a,i)=>a.x-i.x||a.y-i.y),e=(a,i,s)=>(i.x-a.x)*(s.y-a.y)-(i.y-a.y)*(s.x-a.x),r=a=>{let i=[];for(let s of a){for(;i.length>=2&&e(i[i.length-2],i[i.length-1],s)<=0;)i.pop();i.push(s)}return i.pop(),i},o=[...r(n),...r([...n].reverse())];return o.length>=3?o:[...t]}function uo(t,n){if(!t.length||!(n>0))return[];let e=Bi(t),r=(s,c,l,u)=>{let f=l-c;for(;f<0;)f+=Math.PI*2;for(;f>Math.PI*2;)f-=Math.PI*2;let m=Math.max(1,Math.ceil(f/ao)),h=n/Math.cos(f/m/2);for(let d=0;d<=m;d++){let y=c+f*d/m;u.push({x:s.x+Math.cos(y)*h,y:s.y+Math.sin(y)*h})}};if(e.length<3){let s=0,c=0;for(let h of e)s+=h.x,c+=h.y;s/=e.length||1,c/=e.length||1;let l=0;for(let h of e)l=Math.max(l,Math.hypot(h.x-s,h.y-c));let u=[],f=Math.max(3,Math.ceil(Math.PI*2/ao)),m=(l+n)/Math.cos(Math.PI/f);for(let h=0;h<f;h++){let d=h/f*Math.PI*2;u.push({x:s+Math.cos(d)*m,y:c+Math.sin(d)*m})}return u}let o=e.length,a=[];for(let s=0;s<o;s++){let c=e[s],l=e[(s+1)%o];a.push(Math.atan2(-(l.x-c.x),l.y-c.y))}let i=[];for(let s=0;s<o;s++)r(e[s],a[(s+o-1)%o],a[s],i);return po(i)}function Ti(t,n,e){if(t.length===1)return Math.hypot(n-t[0].x,e-t[0].y);let r=1/0;for(let o=0;o+1<t.length;o++){let a=t[o],i=t[o+1],s=i.x-a.x,c=i.y-a.y,l=s*s+c*c,u=l>1e-12?((n-a.x)*s+(e-a.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let f=Math.hypot(n-(a.x+u*s),e-(a.y+u*c));f<r&&(r=f)}return r}function Bn(t){let n=t.map(o=>{let a=0,i=0;for(let l of o.pts)a+=l.x,i+=l.y;let s=o.pts.length||1;a/=s,i/=s;let c=0;for(let l of o.pts){let u=Math.hypot(l.x-a,l.y-i);u>c&&(c=u)}return{cx:a,cy:i,rad:c}}),e=o=>{let a=o.length;return a<=2?[...o]:[o[Math.floor(a*.25)],o[Math.floor(a*.5)],o[Math.floor(a*.75)]]},r=[];for(let o=0;o<t.length;o++){let a=e(t[o].pts),i=[],s=1/0,c=null;for(let u of a){let f=1/0;for(let m=0;m<t.length;m++){if(m===o||Math.abs(t[m].y-t[o].y)<.001)continue;let h=n[m],d=Math.hypot(u.x-h.cx,u.y-h.cy)-h.rad;if(d>=f&&d>=s)continue;let y=Ti(t[m].pts,u.x,u.y);y<f&&(f=y),t[m].depth<t[o].depth&&y<s&&(s=y,c=t[m].y)}Number.isFinite(f)&&f>0&&i.push(f)}i.sort((u,f)=>u-f);let l=i.length?i[Math.floor(i.length/2)]:1;r.push({pitch:l,belowY:c})}return r}function fo(t,n,e,r){let o=t[n],a=o.pts.length>=2?[...o.pts]:o.pts.length===1?(()=>{let u=o.pts[0],f=u.x-r.x,m=u.y-r.y,h=Math.hypot(f,m)||1;f/=h,m/=h;let d=Math.max(e[n].pitch,.001)*.5;return[{x:u.x+m*d,y:u.y-f*d},{x:u.x-m*d,y:u.y+f*d}]})():[];if(a.length<2)return null;let i=0,s=0;for(let u=1;u<a.length;u++){let f=Math.hypot(a[u].x-a[u-1].x,a[u].y-a[u-1].y);f>1e-6&&(i+=f,s++)}let c=s>0?i/s:0,l=Ei(a,Math.max(c*Ai,It));return{pts:l,nrm:wi(l,r),front:Math.max(e[n].pitch*Si,It),back:Math.max(e[n].pitch*_i,It)}}var Zt=1.5,mo=.3;function $n(t,n){if(t.length<3)return t;let e=t[0],r=t[t.length-1],o=r.x-e.x,a=r.y-e.y,i=Math.hypot(o,a),s=-1,c=-1;for(let f=1;f<t.length-1;f++){let m=t[f],h=i>1e-12?Math.abs((m.x-e.x)*a-(m.y-e.y)*o)/i:Math.hypot(m.x-e.x,m.y-e.y);h>s&&(s=h,c=f)}if(s<=n||c<0)return[e,r];let l=$n(t.slice(0,c+1),n),u=$n(t.slice(c),n);return[...l.slice(0,-1),...u]}function ho(t,n){if(t.length<4)return t;let e=$n([...t,t[0]],n);return e.pop(),e.length>=3?e:t}function Oi(t){let n=t.map((r,o)=>{let a=t[(o+1)%t.length];return{a:r,b:a,i:o,minX:Math.min(r.x,a.x),maxX:Math.max(r.x,a.x),minY:Math.min(r.y,a.y),maxY:Math.max(r.y,a.y)}}).sort((r,o)=>r.minX-o.minX),e=(r,o,a)=>(o.x-r.x)*(a.y-r.y)-(o.y-r.y)*(a.x-r.x);for(let r=0;r<n.length;r++){let o=n[r];for(let a=r+1;a<n.length&&n[a].minX<=o.maxX;a++){let i=n[a];if(!(Math.abs(o.i-i.i)===1||Math.abs(o.i-i.i)===t.length-1||o.maxY<i.minY||i.maxY<o.minY)&&e(o.a,o.b,i.a)*e(o.a,o.b,i.b)<=0&&e(i.a,i.b,o.a)*e(i.a,i.b,o.b)<=0)return!0}}return!1}function yo(t,n,e){if(t.length<2)return[];let r=e??Bn(t),o=new Map;for(let i=0;i<t.length;i++){let s=o.get(t[i].blockId);s?s.push(i):o.set(t[i].blockId,[i])}let a=[];for(let[,i]of o){let s=[];for(let g of i){let P=t[g].patch;P&&P.length>=3?a.push({outline:[...P],holes:[],topY:t[g].y}):s.push(g)}if(!s.length)continue;s.sort((g,P)=>t[g].depth-t[P].depth);let l=s.map(g=>fo(t,g,r,n)).filter(g=>g!==null);if(!l.length)continue;let u=(g,P)=>({x:g.pts[P].x-g.nrm[P][0]*(g.front+Zt),y:g.pts[P].y-g.nrm[P][1]*(g.front+Zt)}),f=(g,P)=>({x:g.pts[P].x+g.nrm[P][0]*(g.back+Zt),y:g.pts[P].y+g.nrm[P][1]*(g.back+Zt)}),m=l[0],h=l[l.length-1],d=[];for(let g=0;g<m.pts.length;g++)d.push(u(m,g));for(let g of l)d.push(f(g,g.pts.length-1));for(let g=h.pts.length-1;g>=0;g--)d.push(f(h,g));for(let g=l.length-1;g>=0;g--)d.push(u(l[g],0));let y=po(d),b=1/0;for(let g of s)t[g].y<b&&(b=t[g].y);if(!Number.isFinite(b))continue;if(y.length>=3&&Math.abs(pt(y))>1e-6&&l.every(g=>{let P=g.pts[Math.floor(g.pts.length/2)];return xt(y,P.x,P.y)})&&!Oi(y)){a.push({outline:ho(y,mo),holes:[],topY:b});continue}for(let g of Ci(l))a.push({outline:g,holes:[],topY:b})}return a}function Ci(t){let n=[];for(let e of t){let r=[],o=[],a=e.front+Zt,i=e.back+Zt;for(let c=0;c<e.pts.length;c++){let l=e.pts[c],u=e.nrm[c];r.push([l.x-u[0]*a,l.y-u[1]*a]),o.push([l.x+u[0]*i,l.y+u[1]*i])}let s=[...r,...o.reverse()];s.length<3||(s.push(s[0]),n.push([s]))}if(!n.length)return[];try{let e=lo.union(n[0],...n.slice(1)),r=[];for(let o of e){if(!o.length||o[0].length<4)continue;let a=o[0].map(([c,l])=>({x:c,y:l})),i=a[0],s=a[a.length-1];a.length>1&&Math.abs(i.x-s.x)<1e-9&&Math.abs(i.y-s.y)<1e-9&&a.pop(),a.length>=3&&r.push(ho(a,mo))}return r}catch{return[]}}function po(t){let n=[];for(let e of t){let r=n[n.length-1];r&&Math.hypot(e.x-r.x,e.y-r.y)<1e-9||n.push(e)}for(;n.length>2&&Math.hypot(n[0].x-n[n.length-1].x,n[0].y-n[n.length-1].y)<1e-9;)n.pop();return n}var Qn=class{constructor(n){this.minX=1/0;this.minY=1/0;this.maxX=-1/0;this.maxY=-1/0;this.rings=n;for(let e of n)for(let r of e)r.x<this.minX&&(this.minX=r.x),r.y<this.minY&&(this.minY=r.y),r.x>this.maxX&&(this.maxX=r.x),r.y>this.maxY&&(this.maxY=r.y)}containsAll(n){for(let e of n)if(e.x<this.minX||e.x>this.maxX||e.y<this.minY||e.y>this.maxY)return!1;for(let e of this.rings){let r=!0;for(let o of n)if(!xt(e,o.x,o.y)){r=!1;break}if(r)return!0}return!1}};function co(t,n,e,r,o,a){if(r.length<3)return;if(e.containsAll(r)){let l=[0,1,0],u=r[0];for(let f=1;f+1<r.length;f++){let m=r[f],h=r[f+1];t.tri([u.x*I,o,u.y*I],[m.x*I,o,m.y*I],[h.x*I,o,h.y*I],l,a)}return}let i=r.map(l=>[l.x,l.y]);i.push(i[0]);let s;try{s=lo.intersection([i],n)}catch{return}let c=[0,1,0];for(let l of s){if(!l.length||l[0].length<4)continue;let u=l[0],f=[],m=[];for(let d=0;d<u.length-1;d++)f.push(u[d][0],u[d][1]),m.push([u[d][0],u[d][1]]);if(m.length<3)continue;let h=Ii(f,void 0,2);for(let d=0;d<h.length;d+=3){let y=m[h[d]],b=m[h[d+1]],p=m[h[d+2]];t.tri([y[0]*I,o,y[1]*I],[b[0]*I,o,b[1]*I],[p[0]*I,o,p[1]*I],c,a)}}}function xo(t,n,e,r,o,a,i){if(n.length<2)return;let s=i??Bn(n),c=[0,1,0],l=a&&a.length>=3?[[...a.map(h=>[h.x,h.y]),[a[0].x,a[0].y]]]:null,u=a&&a.length>=3?new Qn([[...a]]):null,f=h=>{t.setMaterial(2),h(),t.setMaterial(0)},m=h=>{t.setMaterial(3),h(),t.setMaterial(0)};for(let h=0;h<n.length;h++){let d=n[h];if(d.patch&&d.patch.length>=3){let M=[...d.patch],x=s[h].belowY??r;if(m(()=>{if(l&&u)co(t,l,u,M,d.y,o.tread);else{let A=M[0];for(let R=1;R+1<M.length;R++){let S=M[R],E=M[R+1];t.tri([A.x*I,d.y,A.y*I],[S.x*I,d.y,S.y*I],[E.x*I,d.y,E.y*I],c,o.tread)}}}),d.y>x+so){let A=0,R=0;for(let S of M)A+=S.x,R+=S.y;A/=M.length,R/=M.length,f(()=>{for(let S=0;S<M.length;S++){let E=M[S],T=M[(S+1)%M.length],F=T.x-E.x,k=T.y-E.y,w=Math.hypot(F,k);if(w<1e-6)continue;let B=k/w,C=-F/w;(E.x-A)*B+(E.y-R)*C<0&&(B=-B,C=-C);let L=[B,0,C],O=[E.x*I,d.y,E.y*I],D=[T.x*I,d.y,T.y*I],H=[E.x*I,x,E.y*I],j=[T.x*I,x,T.y*I];t.tri(O,D,j,L,o.riser),t.tri(O,j,H,L,o.riser)}})}continue}let y=fo(n,h,s,e);if(!y)continue;let{pts:b,nrm:p,front:g,back:P}=y,_=s[h].belowY??r;for(let M=0;M+1<b.length;M++){let x=b[M],A=b[M+1],R=p[M],S=p[M+1];if(Math.hypot(A.x-x.x,A.y-x.y)<1e-6||R[0]===0&&R[1]===0||S[0]===0&&S[1]===0)continue;let E=[(x.x-R[0]*g)*I,d.y,(x.y-R[1]*g)*I],T=[(A.x-S[0]*g)*I,d.y,(A.y-S[1]*g)*I],F=[(x.x+R[0]*P)*I,d.y,(x.y+R[1]*P)*I],k=[(A.x+S[0]*P)*I,d.y,(A.y+S[1]*P)*I];if(m(()=>{l&&u?co(t,l,u,[{x:x.x-R[0]*g,y:x.y-R[1]*g},{x:A.x-S[0]*g,y:A.y-S[1]*g},{x:A.x+S[0]*P,y:A.y+S[1]*P},{x:x.x+R[0]*P,y:x.y+R[1]*P}],d.y,o.tread):(t.tri(E,T,k,c,o.tread),t.tri(E,k,F,c,o.tread))}),d.y>_+so){let w=[E[0],_,E[2]],B=[T[0],_,T[2]],C=[-R[0],0,-R[1]];f(()=>{t.tri(E,T,B,C,o.riser),t.tri(E,B,w,C,o.riser)})}}}}function ki(t,n){let e=t.eventConfigurationIds;return!e?.length||!!n&&e.includes(n)}function bo(t,n){return t.filter(e=>e.type!=="shape"||ki(e,n))}function Mo(t,n){let e=t.focalPoint??{x:0,y:0};return t.floors?.length?t.floors.map((r,o)=>({objects:bo(r.objects,n),focal:{x:(r.focalPoint??e).x,y:(r.focalPoint??e).y},baseHeightM:r.baseHeightM??0,index:o})):[{objects:bo(t.objects,n),focal:e,baseHeightM:0,index:0}]}var Fi={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function Tt(t){return je(t)??Fi}function Po(t,n){let e=_t(t.outline,It),r=Tt(e),o=n.filter(i=>i!==t&&i.outline&&i.outline.length>=3&&Vt(r,Tt(i.outline)));if(!o.length)return[e];let a=i=>{let s=i.map(c=>[c.x,c.y]);return s.push(s[0]),s};try{let i=go.difference([a(e)],...o.map(c=>[a(c.outline)])),s=[];for(let c of i){if(!c.length)continue;let l=c[0].map(([u,f])=>({x:u,y:f}));if(l.length>1){let u=l[0],f=l[l.length-1];Math.abs(u.x-f.x)<1e-9&&Math.abs(u.y-f.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s.length?s:[e]}catch{return[e]}}function Ro(t,n){if(!n.length)return t;let e=a=>{let i=a.map(s=>[s.x,s.y]);return i.push(i[0]),i},r=n.map(a=>[e(a)]),o=[];for(let a of t){let i;try{i=go.intersection([e(a.outline)],r.flat())}catch{o.push(a);continue}for(let s of i){if(!s.length)continue;let c=s[0].map(([l,u])=>({x:l,y:u}));if(c.length>1){let l=c[0],u=c[c.length-1];Math.abs(l.x-u.x)<1e-9&&Math.abs(l.y-u.y)<1e-9&&c.pop()}c.length>=3&&o.push({outline:c,holes:[],topY:a.topY})}}return o.length?o:t}function Ni(t,n){return t===void 0||n===void 0?!0:Math.abs(t-n)<.001}var Tn=class{constructor(){this.rings=[];this.boxes=[];this.levels=[]}subtract(n,e){let r=n.map(c=>[c.x,c.y]);if(r.length<3)return[];r.push(r[0]);let o=Tt(n),a=this.rings.filter((c,l)=>Vt(o,this.boxes[l])&&Ni(e,this.levels[l])),i=[[r]];if(a.length)try{i=Li.difference([r],...a).map(l=>l.map(u=>u.map(([f,m])=>[f,m])))}catch{i=[[r]]}this.rings.push([r]),this.boxes.push(o),this.levels.push(e);let s=[];for(let c of i){if(!c.length)continue;let l=c[0].map(([u,f])=>({x:u,y:f}));if(l.length>1){let u=l[0],f=l[l.length-1];Math.abs(u.x-f.x)<1e-9&&Math.abs(u.y-f.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s}};function On(t,n){if(!n)return t;let e=1/0,r=-1/0,o=1/0,a=-1/0;for(let f of t)e=Math.min(e,f.x),r=Math.max(r,f.x),o=Math.min(o,f.y),a=Math.max(a,f.y);let i=(e+r)/2,s=(o+a)/2,c=n*Math.PI/180,l=Math.cos(c),u=Math.sin(c);return t.map(f=>{let m=f.x-i,h=f.y-s;return{x:i+m*l-h*u,y:s+m*u+h*l}})}function ct(t){let n=null;if(t.kind==="polygon"&&t.points&&t.points.length>=3&&(n=t.points),t.kind==="rect"&&t.width&&t.height&&(n=an(t.x??0,t.y??0,t.width,t.height)),t.kind==="ellipse"&&t.width&&t.height){let e=(t.x??0)+t.width/2,r=(t.y??0)+t.height/2;n=wn(e,r,t.width/2,t.height/2)}return n?On(n,t.rotation):null}function At(t){let n=t.role??"",e={stage:{kind:"stage",heightM:1},entrance:{kind:"portal",heightM:2.7},exit:{kind:"portal",heightM:2.7},screen:{kind:"solid",heightM:6},wall:{kind:"solid",heightM:2.8},rail:{kind:"solid",heightM:1.1},suite:{kind:"suite",heightM:3},obstruction:{kind:"solid",heightM:4.5},sound:{kind:"solid",heightM:1.45},restroom:{kind:"solid",heightM:2.4},bar:{kind:"solid",heightM:1.1},concession:{kind:"solid",heightM:1.1},coat:{kind:"solid",heightM:1.1},goal:{kind:"portal",heightM:1.8}},r=n==="stage"&&Fe(t.stageKind)?{kind:"stage",heightM:t.stageKind==="ring-boxing"?ke:.06}:e[n]??{kind:"plate",heightM:.25};return{...r,heightM:t.heightM??r.heightM}}var vi=.08,Di=30,Gi=.015;function Hi(t,n){let e=!1;for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[r],i=n[o];a.y>t.y!=i.y>t.y&&t.x<(i.x-a.x)*(t.y-a.y)/(i.y-a.y)+a.x&&(e=!e)}return e}function Io(t,n){let e=ct(t)??(t.points?.length?On(t.points,t.rotation):null),r=At(t),a=!t.role&&r.kind==="plate"&&t.heightM===void 0&&!!e&&Math.abs(pt(e))*$**2>=Di?Gi:r.heightM;if(!e)return{topOffsetM:a,supportOffsetM:0};if(r.kind!=="plate"&&r.kind!=="stage")return{topOffsetM:a,supportOffsetM:0};let i=1/0,s=1/0,c=-1/0,l=-1/0;for(let h of e)i=Math.min(i,h.x),s=Math.min(s,h.y),c=Math.max(c,h.x),l=Math.max(l,h.y);let u=a,f=0,m=1e-6*Math.max(1,c-i,l-s);for(let h of n)c>h.minX&&i<h.maxX&&l>h.minY&&s<h.maxY&&u<=h.topOffsetM+1e-6&&(u=h.topOffsetM+vi),i>=h.minX-m&&c<=h.maxX+m&&s>=h.minY-m&&l<=h.maxY+m&&(!h.poly||e.every(b=>Hi(b,h.poly)||Xi(b,h.poly,m)))&&(f=Math.max(f,h.topOffsetM));return t.fill&&t.fill!=="none"&&t.fill!=="transparent"&&n.push({minX:i,minY:s,maxX:c,maxY:l,topOffsetM:u,poly:e}),{topOffsetM:u,supportOffsetM:Math.min(f,u)}}function Xi(t,n,e){for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[o],i=n[r],s=i.x-a.x,c=i.y-a.y,l=s*s+c*c,u=l?Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*c)/l)):0;if(Math.hypot(t.x-(a.x+u*s),t.y-(a.y+u*c))<=e)return!0}return!1}function Nt(t,n,e){return{x:t.x+(n.x-t.x)*e,y:t.y+(n.y-t.y)*e}}function bt(t){if(t.length!==4)return t;let n=Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y),e=Math.hypot(t[2].x-t[1].x,t[2].y-t[1].y);return n>=e?t:[t[1],t[2],t[3],t[0]]}function dt(t,n,e){return[Nt(t[0],t[1],n),Nt(t[0],t[1],e),Nt(t[3],t[2],e),Nt(t[3],t[2],n)]}function cn(t,n,e){return[Nt(t[0],t[3],n),Nt(t[1],t[2],n),Nt(t[1],t[2],e),Nt(t[0],t[3],e)]}function ot(t,n,e,r,o,a){Z(t,n,void 0,()=>e,r,o,a,K)}function ln(t){if(t.length<3)return t.map(a=>({...a}));let n=[...t].sort((a,i)=>a.x-i.x||a.y-i.y),e=(a,i,s)=>(i.x-a.x)*(s.y-a.y)-(i.y-a.y)*(s.x-a.x),r=a=>{let i=[];for(let s of a){for(;i.length>=2&&e(i[i.length-2],i[i.length-1],s)<=0;)i.pop();i.push(s)}return i.pop(),i},o=[...r(n),...r([...n].reverse())];return o.length>=3?o.map(a=>({...a})):n.map(a=>({...a}))}var ji=.8,Ui=.6,Wi=2;function vt(t,n){if(!n.length)return null;let e=[],r=0;for(let i of t.objects){if(i.type!=="shape"||i.role!=="wall")continue;let s=ct(i)??[],c=So(s)/2;!(c>0)||Ki(s)/c*I>Wi||(e.push(...s),r+=c)}if(e.length<3)return null;let o=ln(e);if(o.length<3||r<So(o)*Ui)return null;let a=0;for(let i of n)Vi(i,o)&&(a+=1);return a>=n.length*ji?o:null}var Cn=6,Yi=5,zi=8;function _o(t){return Math.max(zi,(Number.isFinite(t)?t:0)+Yi)}function qt(t){let n=0,e=0,r=0;for(let o=0;o<t.length;o++){let a=t[o],i=t[(o+1)%t.length],s=a.x*i.y-i.x*a.y;n+=s,e+=(a.x+i.x)*s,r+=(a.y+i.y)*s}if(Math.abs(n)<1e-9){let o=0,a=0;for(let i of t)o+=i.x,a+=i.y;return{x:o/Math.max(1,t.length),y:a/Math.max(1,t.length)}}return{x:e/(3*n),y:r/(3*n)}}function Ki(t){let n=0;for(let e=0;e<t.length;e++){let r=t[e],o=t[(e+1)%t.length];n+=r.x*o.y-o.x*r.y}return Math.abs(n)/2}function So(t){let n=0;for(let e=0;e<t.length;e++){let r=t[e],o=t[(e+1)%t.length];n+=Math.hypot(o.x-r.x,o.y-r.y)}return n}function Vi(t,n){let e=!1;for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[r],i=n[o];a.y>t.y!=i.y>t.y&&t.x<(i.x-a.x)*(t.y-a.y)/(i.y-a.y)+a.x&&(e=!e)}return e}var Zi=[[/\b(wc|toilets?|restrooms?|washrooms?|lavatory|loo)\b/i,"restroom"],[/\b(bar|drinks|pub|cocktails?)\b/i,"bar"],[/\b(food|concessions?|snacks?|kiosk|caf[eé]|kitchen|catering)\b/i,"concession"],[/\b(coat ?check|cloak ?room|cloakroom|coats)\b/i,"coat"],[/\b(screen|led wall|projection|video wall)\b/i,"screen"],[/\b(sound|foh|mixing desk|control booth)\b/i,"sound"],[/\b(entrance|entry|way in|gate)\b/i,"entrance"],[/\b(exit|way out)\b/i,"exit"],[/\b(pillar|column|obstruction)\b/i,"obstruction"],[/\b(walls?|outline|boundary|perimeter)\b/i,"wall"]],qi=1.2,$i=12;function Ao(t){if(t.heightM!==void 0)return!1;let n=ct(t);if(!n||n.length<3)return!1;let e=0;for(let o=0;o<n.length;o++){let a=n[o],i=n[(o+1)%n.length];e+=Math.hypot(i.x-a.x,i.y-a.y)}return e*$<$i*2?!1:2*un(n)/e*$<=qi}function Jn(t){if(!t)return null;for(let[n,e]of Zi)if(n.test(t))return e;return null}var Eo="auto-rows-";function Bo(t){return t.id.startsWith(Eo)&&!t.label}var Qi=1.15,Ji=.09,To=6,ts=34,ns=.35,es=6,os=.35,rs=.75,is=12,ss=2.5,as=40,cs=[18,24],ls=[12,16],wo=14,us=.8,fs=.6,ms=5,hs=.3,Oo=.4,Co=2,ys=400,ds=2.6,ps=.8,xs=4,bs=26,gs=.7,Ms=.5,Ps=.985,Rs=1.5,Is=2.2,Ss=3,_s=25,As=.985,ws=2,Es=6,Bs=3,Ts=.1,Os=1.5,Cs=1.6,ks=6e3,Fs=.6,Ls="#c3c7cd",te=300,Ns=240;function vs(t,n,e,r){if(!t.fill||!/^#[0-9a-f]{6}$/i.test(t.fill))return null;let o=ee([...n]),a=new Set;for(let u of r)a.add(Math.floor(Math.atan2(u.y-o.y,u.x-o.x)*180/Math.PI/10));if(a.size*10<Ns)return null;let{h:i,s,l:c}=De(ve(t.fill));return i<70/360||i>170/360||s<.2||c<.08||c>.75||e.some(u=>u!==t&&u.type==="shape"&&ct(u)?.some(f=>ie(f,n)))?null:t.kind==="ellipse"?"oval-cricket":t.kind==="rect"?"pitch-football":null}var Ds="Estimated from the drawing; confirm with the venue.",oe=t=>{if(!t.length)return null;let n=[...t].sort((r,o)=>r-o),e=Math.floor(n.length/2);return n.length%2?n[e]:(n[e-1]+n[e])/2},ee=t=>({x:t.reduce((n,e)=>n+e.x,0)/t.length,y:t.reduce((n,e)=>n+e.y,0)/t.length}),un=t=>{let n=0;for(let e=0;e<t.length;e++){let r=t[e],o=t[(e+1)%t.length];n+=r.x*o.y-o.x*r.y}return Math.abs(n)/2};function Gs(t){return t.height!==void 0||t.rake!==void 0||t.elevation!==void 0||t.surfaceKind!==void 0}function re(t){let n=new Map;for(let e of t){let r=n.get(e.rowId);r?r.push(e):n.set(e.rowId,[e])}return n}function ie(t,n){let e=!1;for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[r],i=n[o];a.y>t.y!=i.y>t.y&&t.x<(i.x-a.x)*(t.y-a.y)/(i.y-a.y)+a.x&&(e=!e)}return e}function se(t,n){let e=n[0],r=1/0;for(let o=0;o<n.length;o++){let a=n[o],i=n[(o+1)%n.length],s=i.x-a.x,c=i.y-a.y,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*c)/l)):0,f={x:a.x+s*u,y:a.y+c*u},m=Math.hypot(t.x-f.x,t.y-f.y);m<r&&(r=m,e=f)}return e}function ko(t,n){let e=0,r=0;for(let o of t.values()){if(o.length<3)continue;let a=o[0],i=o[o.length-1],s=i.x-a.x,c=i.y-a.y,l=Math.hypot(s,c);if(l<1e-6)continue;let u={x:(a.x+i.x)/2,y:(a.y+i.y)/2},f=se(u,n),m=f.x-u.x,h=f.y-u.y,d=Math.hypot(m,h);d<1e-6||(r+=Math.abs((-c*m+s*h)/(l*d))*o.length,e+=o.length)}return e?r/e:0}function Hs(t,n,e){let r=t.filter(y=>y.type==="shape"),o=r.find(y=>y.role==="stage");if(o){let y=ct(o);return y?{shape:o,centre:ee(y),outline:y,inferred:!1}:null}if(!e.length)return null;let a=1/0,i=-1/0,s=1/0,c=-1/0;for(let y of e)a=Math.min(a,y.x),i=Math.max(i,y.x),s=Math.min(s,y.y),c=Math.max(c,y.y);let l=(i-a)*(c-s),u=[];for(let y of r){if(y.role)continue;let b=ct(y);if(!b)continue;let p=un(b);if(p*$*$<6||p>l)continue;let g=Math.min(...b.map(S=>S.x)),P=Math.max(...b.map(S=>S.x)),_=Math.min(...b.map(S=>S.y)),M=Math.max(...b.map(S=>S.y)),x=0;for(let S of e)S.x>g&&S.x<P&&S.y>_&&S.y<M&&ie(S,b)&&x++;if(x>e.length*.05)continue;let A=ee(b),R=ko(n,b);R>=us&&u.push({shape:y,centre:A,outline:b,score:R,area:p,box:[g,_,P,M]})}let f=(y,b)=>b!==y&&b.area>y.area&&y.box[0]>=b.box[0]-1e-6&&y.box[1]>=b.box[1]-1e-6&&y.box[2]<=b.box[2]+1e-6&&y.box[3]<=b.box[3]+1e-6,m=u.filter(y=>!u.some(b=>f(y,b))),h=Math.max(0,...m.map(y=>y.score)),d=m.filter(y=>y.score>=h-.03).sort((y,b)=>b.area-y.area)[0]??null;return d?{shape:d.shape,centre:d.centre,outline:d.outline,inferred:!0}:null}function Xs(t,n,e){if(!e||e.length<3)return Math.hypot(t.x-n.x,t.y-n.y);let r=se(t,e);return Math.hypot(t.x-r.x,t.y-r.y)}function Fo(t){let n=[...t].sort((a,i)=>a.x-i.x||a.y-i.y);if(n.length<3)return n;let e=(a,i,s)=>(i.x-a.x)*(s.y-a.y)-(i.y-a.y)*(s.x-a.x),r=[];for(let a of n){for(;r.length>=2&&e(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}let o=[];for(let a=n.length-1;a>=0;a--){let i=n[a];for(;o.length>=2&&e(o[o.length-2],o[o.length-1],i)<=0;)o.pop();o.push(i)}return[...r.slice(0,-1),...o.slice(0,-1)]}function js(t){if(!t.length||t.length>ks)return[];let n=[...re(t).values()],e=n.map((s,c)=>c),r=s=>e[s]===s?s:e[s]=r(e[s]),o=Cs/$,a=n.map(s=>({minX:Math.min(...s.map(c=>c.x))-o,maxX:Math.max(...s.map(c=>c.x))+o,minY:Math.min(...s.map(c=>c.y))-o,maxY:Math.max(...s.map(c=>c.y))+o}));for(let s=0;s<n.length;s++)for(let c=s+1;c<n.length;c++){let l=a[s],u=a[c];if(l.maxX<u.minX||u.maxX<l.minX||l.maxY<u.minY||u.maxY<l.minY)continue;n[s].some(m=>n[c].some(h=>Math.hypot(m.x-h.x,m.y-h.y)<=o))&&(e[r(s)]=r(c))}let i=new Map;return n.forEach((s,c)=>{let l=r(c),u=i.get(l);u?u.push(...s):i.set(l,[...s])}),[...i.values()].filter(s=>new Set(s.map(c=>c.rowId)).size>=2)}function Us(t,n,e){if(!n.length)return null;let r=n.filter(R=>e.tableIds.has(R.rowId)||R.kind==="booth").length>n.length/2,o=re(n),a=!e.outline||ko(o,e.outline)>=fs,i=0,s=0;for(let R of o.values()){if(R.length<2)continue;let S=R[0],E=R[R.length-1],T=E.x-S.x,F=E.y-S.y,k=Math.hypot(T,F);if(k<1e-6)continue;let w={x:(S.x+E.x)/2,y:(S.y+E.y)/2},B=a?e.outline?se(w,e.outline):e.focal:e.middle,C=-F/k,L=T/k;C*(B.x-w.x)+L*(B.y-w.y)<0&&(C=-C,L=-L),i+=C*R.length,s+=L*R.length}let c={x:n.reduce((R,S)=>R+S.x,0)/n.length,y:n.reduce((R,S)=>R+S.y,0)/n.length};if(Math.hypot(i,s)<1e-9){let R=a?e.focal:e.middle;i=R.x-c.x,s=R.y-c.y}let l=Math.hypot(i,s)||1,u={x:i/l,y:s/l},f=R=>-(R.x*u.x+R.y*u.y),m=R=>-R.x*u.y+R.y*u.x,h=1/0,d=-1/0,y=1/0,b=-1/0,p=1/0,g=new Map;for(let R of n){let S=f(R),E=m(R);h=Math.min(h,S),d=Math.max(d,S),y=Math.min(y,E),b=Math.max(b,E),a&&(p=Math.min(p,Xs(R,e.focal,e.outline)));let T=R.logicalRowId??R.rowId,F=g.get(T);F?F.push(S):g.set(T,[S])}a||(p=Math.max(0,h-f(e.middle)));let P=[...g.values()].map(R=>oe(R)).sort((R,S)=>R-S),_=[];if(!r)for(let R of P)_.length&&R-_[_.length-1]<os/$||_.push(R);let M=Gs(t),x=zt(t,{floorBaseHeightM:e.baseHeightM}),A={id:t.id,section:t,authored:M,plane:e,facing:u,facesAction:a,hull:Fo(n),sample:n.filter((R,S)=>S%Math.ceil(n.length/ys)===0),frontD:h,backD:d,latMin:y,latMax:b,frontDistance:p,rowDepths:_,rowCount:_.length,level:0,height:x.height,rake:M?x.rake:0,backHeight:0};return A.backHeight=A.height+(d-h)*$*Math.tan(A.rake*Math.PI/180),A}function Ws(t,n,e,r){if(t.length<2)return 0;let o=Math.max(1,n*$),a=e+Qi-r,i=0,s=0;for(let l=1;l<t.length;l++){let u=Math.max(rs,(t[l]-t[l-1])*$),f=(a+Ji)*(o+u)/o;i+=f-a,s+=u,a=f,o+=u}let c=Math.atan(i/s)*180/Math.PI;return Math.round(Math.max(To,Math.min(ts,c))*10)/10}function Ys(t,n,e=!1){if(!e&&t.facing.x*n.facing.x+t.facing.y*n.facing.y<hs)return null;let r=-1/0,o=1/0,a=-1/0;for(let m of n.hull){r=Math.max(r,-(m.x*t.facing.x+m.y*t.facing.y));let h=-m.x*t.facing.y+m.y*t.facing.x;o=Math.min(o,h),a=Math.max(a,h)}if(Math.min(t.latMax,a)-Math.max(t.latMin,o)<(e?1e-6:Oo*(t.latMax-t.latMin)))return null;let s=Co/$,c=new Map,l=new Map;for(let m of t.sample){let h=Math.floor((-m.x*t.facing.y+m.y*t.facing.x)/s),d=-(m.x*t.facing.x+m.y*t.facing.y);c.set(h,Math.min(c.get(h)??1/0,d))}for(let m of n.sample){let h=Math.floor((-m.x*t.facing.y+m.y*t.facing.x)/s),d=-(m.x*t.facing.x+m.y*t.facing.y);l.set(h,Math.max(l.get(h)??-1/0,d))}let u=[];for(let[m,h]of c){let d=l.get(m);d!==void 0&&u.push(h-d)}let f=u.length?oe(u):t.frontD-r;return f<-1/$?null:f}function zs(t,n){if(n.plane.floorIndex>=t.plane.floorIndex)return!1;let e=-1/0,r=1/0,o=1/0,a=-1/0;for(let c of n.hull){let l=-(c.x*t.facing.x+c.y*t.facing.y);e=Math.max(e,l),r=Math.min(r,l);let u=-c.x*t.facing.y+c.y*t.facing.x;o=Math.min(o,u),a=Math.max(a,u)}let i=Math.min(t.latMax,a)-Math.max(t.latMin,o),s=Math.min(t.backD,e)-Math.max(t.frontD,r);return i>Oo*(t.latMax-t.latMin)&&s>1/$}function Ks(t,n){let e=new Set;for(let r of t){let o=(Math.atan2(r.y-n.y,r.x-n.x)*180/Math.PI+360)%360;e.add(Math.floor(o/10))}return e.size/36}function Vs(t,n){let e=1/0,r=-1/0;for(let a of n.hull){let i=-(a.x*t.facing.x+a.y*t.facing.y);e=Math.min(e,i),r=Math.max(r,i)}let o=Math.max(0,Math.min(r-e,t.frontD-e));return n.height+o*$*Math.tan(n.rake*Math.PI/180)}function Zs(t,n){if(!t.facesAction)return!1;let e={x:-t.facing.y,y:t.facing.x},r=Co/$,o=Math.max(1,Math.ceil((t.backD-t.frontD)/r)),a={left:new Map,right:new Map};for(let s of n)if(!(s===t||s.plane.floorIndex!==t.plane.floorIndex)&&!(s.facing.x*t.facing.x+s.facing.y*t.facing.y>=Ps))for(let c of s.sample){let l=-(c.x*t.facing.x+c.y*t.facing.y);if(l<t.frontD||l>t.backD)continue;let u=-c.x*t.facing.y+c.y*t.facing.x,f=u<t.latMin?"left":u>t.latMax?"right":null;if(!f)return!1;let m=Math.min(o-1,Math.floor((l-t.frontD)/r)),h=f==="left"?t.latMin-u:u-t.latMax;h<(a[f].get(m)?.gap??1/0)&&a[f].set(m,{gap:h,other:s})}let i=s=>{let c=s==="left"?t.latMin:t.latMax,l=0;for(let[u,{other:f}]of a[s]){if((f.facing.x*e.x+f.facing.y*e.y)*(s==="left"?1:-1)<gs)continue;let h=t.frontD+(u+.5)*r,d={x:-h*t.facing.x+c*e.x,y:-h*t.facing.y+c*e.y},y=-(d.x*f.facing.x+d.y*f.facing.y),b=-d.x*f.facing.y+d.y*f.facing.x;y<f.frontD&&b>=f.latMin&&b<=f.latMax&&l++}return l/o>=Ms};return i("left")&&i("right")}function qs(t,n){if(n.plane.floorIndex!==t.plane.floorIndex||n.facing.x*t.facing.x+n.facing.y*t.facing.y<As)return!1;let e=1/0,r=-1/0,o=1/0;for(let s of n.hull){let c=-s.x*t.facing.y+s.y*t.facing.x;e=Math.min(e,c),r=Math.max(r,c),o=Math.min(o,-(s.x*t.facing.x+s.y*t.facing.y))}let a=(t.frontD-o)*$;if(a<-ws||a>Es)return!1;let i=Math.max(e-t.latMax,t.latMin-r);return i*$<=Bs&&i*$>=-Ts}function $s(t,n=!1,e=!1,r){let o=n?ls:cs,a=new Set(e?[]:t.filter(y=>!y.authored&&Zs(y,t))),i=[...t].sort((y,b)=>y.plane.floorIndex-b.plane.floorIndex||Number(a.has(b))-Number(a.has(y))||y.frontDistance-b.frontDistance);for(let y of a)r?.add(y.id);let s=(y,b,p)=>{let g=new Map,P=[],_=new Map,M=x=>{if(x.plane.floorIndex===0||x.plane.baseHeightM>0)return x.plane.baseHeightM;let A=_.get(x.plane.floorIndex-1);return A===void 0?x.plane.baseHeightM:A+Ke};for(let x of i){if(a.has(x))x.height=M(x),x.level=0,x.rake=0,x.backHeight=x.height,g.set(x.id,void 0);else if(!x.authored){let R=M(x),S;for(let w of P){if(w.plane.floorIndex>x.plane.floorIndex)continue;if(zs(x,w)){let O=Vs(x,w)+ds;O>R&&(R=O,S=w);continue}let B=Ys(x,w,a.has(w));if(B==null)continue;let C=e&&!!x.plane.stageDeck&&w.level===0&&w.plane.floorIndex===x.plane.floorIndex&&Math.max(0,B)*$<=xs,L=a.has(w)?w.height+Rs:C?w.backHeight:w.backHeight+ns+Math.min(es,Math.max(0,B)*$)*Math.tan(w.rake*Math.PI/180);L>R&&(R=L,S=w)}let E=y.get(x);E&&E.height>R+.01?(R=E.height,S=void 0):E=void 0,x.height=Math.round(Math.min(R,x.plane.baseHeightM+as)*100)/100;let T=!S&&!E&&x.height>x.plane.baseHeightM;if(x.level=S?S.level+1:E?E.level:T?1:0,x.rake=Ws(x.rowDepths,x.frontDistance,x.height,x.plane.focalHeightM),!x.facesAction&&x.rowCount<ms)x.rake=0;else if(x.level===0){let w=Math.max(1e-6,(x.backD-x.frontD)*$);x.rake=Math.min(x.rake,is,Math.round(Math.atan(ss/w)*1800/Math.PI)/10)}else x.rowCount>=2&&(x.rake=Math.max(x.rake,o[Math.min(x.level,o.length)-1]));let F=(x.backD-x.frontD)*$,k=S&&a.has(S)||E&&p?.has(E.id);if(b!==void 0&&k&&x.rowCount>=2&&(x.rake=b),n&&F>0&&x.height+F*Math.tan(x.rake*Math.PI/180)>x.plane.baseHeightM+wo){let w=Math.max(0,x.plane.baseHeightM+wo-x.height);x.rake=Math.max(To,Math.round(Math.atan(w/F)*1800/Math.PI)/10)}e&&x.plane.stageDeck&&x.level>0&&(x.rake=Math.min(x.rake,bs)),x.backHeight=x.height+F*Math.tan(x.rake*Math.PI/180),g.set(x.id,S?.id??(E?g.get(E.id):void 0))}let A=x.plane.floorIndex;_.set(A,Math.min(_.get(A)??1/0,x.height)),P.push(x)}return g},c=s(new Map),l=new Map,u=y=>l.get(y)?.height??y.height;for(let y=!0,b=0;y&&b<t.length;b++){y=!1;for(let p of t)if(!(p.authored||a.has(p)))for(let g of t){let P=l.get(g)??g;g===p||P.height-P.plane.baseHeightM<Os||P.height<=u(p)+.01||qs(p,g)&&(l.set(p,P),y=!0)}}let f=new Map(t.map(y=>[y.id,y])),m=t.filter(y=>!y.authored&&y.rowCount>=2&&a.has(f.get(c.get(y.id)??""))),h=m.length?oe(m.map(y=>y.rake)):void 0;if(!l.size&&h===void 0)return c;let d=new Map([...new Set(l.values())].map(y=>[y,{...y}]));return s(new Map([...l].map(([y,b])=>[y,d.get(b)])),h,new Set(m.map(y=>y.id)))}var ne=(t,n)=>!!t&&t.x===n.x&&t.y===n.y;function Lo(t,n={x:0,y:-40}){let e=In(t),r=new Map;for(let p of e){if(!p.sectionId)continue;let g=r.get(p.sectionId);g?g.push(p):r.set(p.sectionId,[p])}let o={focalInferred:!1,confident:!1,sections:[]},a=t.floors?.length?t.floors.map((p,g)=>({objects:p.objects,floorIndex:g,floorId:p.id,baseHeightM:p.baseHeightM??0,focal:p.focalPoint??t.focalPoint})):[{objects:t.objects,floorIndex:0,floorId:void 0,baseHeightM:0,focal:t.focalPoint}],i=new Set(a.flatMap(p=>p.objects.filter(g=>g.type==="table").map(g=>g.id))),s=[],c,l=new Set,u=a.map(p=>{let g=k=>!t.floors?.length||k.floorId===p.floorId,P=js(e.filter(k=>!k.sectionId&&k.kind!=="booth"&&!i.has(k.rowId)&&g(k))),_=[];for(let k of P){let w=_t(Et(Fo(k)),Fs/$);if(e.some(C=>!g(C)&&ie(C,w)))continue;let B=`${Eo}${p.floorIndex}-${_.length}`;l.add(B),r.set(B,k),_.push({type:"section",id:B,label:"",color:Ls,outline:w})}let M=_.length?{...p,objects:[...p.objects,..._]}:p,x=new Set(M.objects.filter(k=>k.type==="section").map(k=>k.logicalSectionId??k.id)),A=[...r.entries()].filter(([k])=>x.has(k)).flatMap(([,k])=>k),R=Hs(M.objects,re(A),A),S=M.focal;(R||M.focal&&!ne(M.focal,n))&&(o.confident=!0),R&&(o.stage??={id:R.shape.id,inferred:R.inferred,...M.floorId?{floorId:M.floorId}:{}},(R.inferred||ne(M.focal,n))&&(S=R.centre,o.focalInferred=!0));let E=R&&(!R.inferred||un(R.outline)*$*$<=te),T=R?void 0:c,F={tableIds:i,floorIndex:M.floorIndex,floorId:M.floorId,baseHeightM:M.baseHeightM,focal:T?.focal??S,outline:R?.outline??T?.outline,focalHeightM:T?.focalHeightM??M.baseHeightM+(R&&E?At({...R.shape,role:"stage"}).heightM:0),stageDeck:T?.stageDeck??!!(R&&E&&un(R.outline)*$*$<=te),middle:A.length?{x:A.reduce((k,w)=>k+w.x,0)/A.length,y:A.reduce((k,w)=>k+w.y,0)/A.length}:S};for(let k of M.objects){if(k.type!=="section")continue;let w=Us(k,r.get(k.logicalSectionId??k.id)??[],F);w&&s.push(w)}return F.outline&&(c=F),ne(M.focal,F.focal)||(o.focal??=[]).push({...M.floorId?{floorId:M.floorId}:{},point:{...F.focal}}),{unit:M,plane:F,stage:R,planeSeats:A}}),f=a.flatMap(p=>p.objects).map(p=>p.type==="shape"&&!p.role&&(Jn(p.label)==="wall"||!Jn(p.label)&&Ao(p))?{...p,role:"wall"}:p),m=vt({objects:f},e)!==null;m&&(o.indoor=!0);let h=new Set,d=$s(s,m,Ks(e,u[0]?.plane.focal??n)<ps,h),y=new Map(s.filter(p=>!p.authored).map(p=>[p.id,p])),b=u.map(({unit:p,plane:g,stage:P,planeSeats:_})=>p.objects.map(M=>{let x=M.type==="shape"&&!M.role&&M.id!==P?.shape.id?Jn(M.label):null;if(M.type==="shape"&&!M.role&&M.id!==P?.shape.id&&(x==="wall"||!x&&Ao(M))&&M.type==="shape"){(o.roles??=[]).push({id:M.id,...g.floorId?{floorId:g.floorId}:{},role:"wall"});let{fill:w,...B}=M;return{...B,role:"wall"}}if(x&&M.type==="shape")return(o.roles??=[]).push({id:M.id,...g.floorId?{floorId:g.floorId}:{},role:x}),{...M,role:x};let R=P?.inferred&&M.id===P.shape.id&&M.type==="shape"?vs(M,P.outline,p.objects,_):null;if(R&&M.type==="shape")return o.stage?.id===M.id&&(o.stage.field=R),{...M,role:"stage",stageKind:R};let S=M.type==="shape"&&M.id===P?.shape.id&&M.heightM===void 0&&!M.stageKind&&s.some(w=>w.plane===g&&(h.has(w.id)||w.level===0&&w.facesAction&&w.rake<=Ss&&(w.frontDistance+w.backD-w.frontD)*$>=_s)),E=S?{heightM:Is}:{};if(P?.inferred&&M.id===P.shape.id&&M.type==="shape"&&un(P.outline)*$*$<=te)return o.stage?.id===M.id&&(o.stage.deck=!0),{...M,role:"stage",...E};if(S&&M.type==="shape"&&M.role==="stage")return{...M,...E};let T=M.type==="section"?y.get(M.id):void 0;if(!T||M.type!=="section")return M;let F=T.rowCount>=2&&T.rake>0;l.has(T.id)?o.looseRowBlocks=(o.looseRowBlocks??0)+1:o.sections.push({id:T.id,floorId:g.floorId,surfaceKind:F?"rakedRows":"flat",height:T.height,rake:T.rake,stackedOn:d.get(T.id)});let k={status:"inferred",source:"public-2d-topology",note:Ds};return{...M,height:T.height,rake:T.rake,surfaceKind:F?"rakedRows":"flat",physical3dProvenance:{height:k,rake:k,surfaceKind:k}}}));if(t.floors?.length){let p=t.floors.map((g,P)=>({...g,objects:b[P],focalPoint:u[P].plane.focal}));return{doc:{...t,floors:p,objects:p[0].objects,focalPoint:p[0].focalPoint},report:o}}return{doc:{...t,objects:b[0],focalPoint:u[0].plane.focal},report:o}}function Fu(t,n,e){return e<0?n>1?t.filter(r=>r.kind==="floor"):[...t]:t.filter(r=>r.floorIndex===void 0||r.floorIndex===e)}function Lu(t,n){let e=[...t].sort((o,a)=>o.screen.y-a.screen.y),r=[];for(let o of e){let a=r.find(i=>i.some(s=>Math.abs(s.screen.x-o.screen.x)<104&&Math.abs(s.screen.y-o.screen.y)<34));a?a.push(o):r.push([o])}return r.flatMap(o=>o.length<2?o:o.map((a,i)=>({...a,screen:{...a.screen,x:Math.max(54,Math.min(n-54,a.screen.x+(i-(o.length-1)/2)*104))}})))}var Qs=1.15,Js=2.75,ta=4.5,na=.85,ea=.5,oa=.26;function Nu(t,n,e){let r=Math.max(1e-6,n),o=t/r,a=e?.hasZoneLabels??!0,i=new Set(["stage","gate"]);return o>=.75&&i.add("floor"),o>=Qs&&i.add("zone"),o<=(a?Js:ta)&&(i.add("section"),i.add("ga")),o<=na&&(i.add("annotation"),i.add("booth")),o<=ea&&i.add("row"),o<=oa&&i.add("seat"),i}function vu(t,n,e,r,o,a=6){let i=a+n,s=r-a-n,c=a+e,l=o-a-e;return{...t,x:i>s?r/2:Math.max(i,Math.min(s,t.x)),y:c>l?o/2:Math.max(c,Math.min(l,t.y))}}function Du(t,n,e,r){let o=t,a=n[0],i=n[1],s=n[2],c=o[0]*a+o[4]*i+o[8]*s+o[12],l=o[1]*a+o[5]*i+o[9]*s+o[13],u=o[2]*a+o[6]*i+o[10]*s+o[14],f=o[3]*a+o[7]*i+o[11]*s+o[15];if(!(f>1e-6))return{x:0,y:0,depth:1/0,visible:!1};let m=c/f,h=l/f,d=u/f,y=m>=-1.05&&m<=1.05&&h>=-1.05&&h<=1.05&&d<=1;return{x:(m*.5+.5)*e,y:(1-(h*.5+.5))*r,depth:d,visible:y}}function Gu(t,n,e=n,r=()=>0){let o=[],a=[...t].sort((i,s)=>r(s)-r(i)||i.screen.depth-s.screen.depth);for(let i of a){let s=!1;for(let c of o)if(ae(i,c,n,e)){s=!0;break}s||o.push(i)}return o}var ra=6;function ae(t,n,e,r){let o=Math.abs(t.screen.x-n.screen.x),a=Math.abs(t.screen.y-n.screen.y),i=t.halfWidth!=null&&n.halfWidth!=null?Math.max(e,t.halfWidth+n.halfWidth+ra):e;return o<i&&a<r}function Hu(t,n,e){return t.length*n*.58+(e?14:0)}var ia={row:8,seat:14};function Xu(t){return t<480?{row:5,seat:8}:t<768?{row:6,seat:10}:ia}function ju(t,n,e,r){let o=Math.max(1,Math.min(e,r)*.5),a=Math.min(2,Math.hypot(t.x-e/2,t.y-r/2)/o);return n*(1+1.5*a)}function Uu(t,n,e,r,o=[]){let a=[...t].sort((s,c)=>(c.priority??0)-(s.priority??0)||s.focus-c.focus),i=[];for(let s of a){if(i.length>=r)break;let c=!1;for(let l of o)if(ae(s,l,n,e)){c=!0;break}if(!c){for(let l of i)if(ae(s,l,n,e)){c=!0;break}}c||i.push(s)}return i}function Wu(t,n,e,r){let o=t[3]*n[0]+t[7]*n[1]+t[11]*n[2]+t[15];return o<=0||!(e>0)?0:e*Math.hypot(t[0],t[4],t[8])*r/(2*o)}function $t(t,n,e){if(t.length!==4||e<=n)return null;let r=bt(t),o=Math.hypot(r[1].x-r[0].x,r[1].y-r[0].y)*I,a=Math.hypot(r[3].x-r[0].x,r[3].y-r[0].y)*I;if(o<1e-6||a<1e-6)return null;let i=Math.min(.22/o,.16),s=Math.min(.28,(e-n)*.13),c=Math.min(.065/a,.2);return{quad:r,side:i,face:c,opening:dt(r,i,1-i),openingTop:e-s}}function ce(t,n,e){if(t.length!==4||e-n<=.2)return null;let r=bt(t),o=Math.hypot(r[1].x-r[0].x,r[1].y-r[0].y)*I;if(o<=1e-6)return null;let a=Math.min(.14,(e-n)*.08,o*.08),i=a/o,s=dt(r,i,1-i);return{quad:r,side:i,trim:a,inner:s,panel:cn(s,.15,.85),bottom:n+a,top:e-a}}function No(t,n,e,r){let o=ce(t,n,e);if(!o)return;let{panel:a}=o,i=(g,P)=>({x:(g.x+P.x)/2,y:(g.y+P.y)/2}),s=i(a[0],a[1]),c=i(a[3],a[2]),l=Math.hypot(s.x-r.x,s.y-r.y)<=Math.hypot(c.x-r.x,c.y-r.y),[u,f]=l?[a[0],a[1]]:[a[3],a[2]],m=l?{x:s.x-c.x,y:s.y-c.y}:{x:c.x-s.x,y:c.y-s.y},h=Math.hypot(m.x,m.y);if(h<1e-6)return;-(f.y-u.y)*m.x+(f.x-u.x)*m.y<0&&([u,f]=[f,u]);let d=Math.min(.006,h*I*.05),y=m.x/h*d,b=m.y/h*d,p=(g,P)=>[g.x*I+y,P,g.y*I+b];return[p(u,o.bottom),p(f,o.bottom),p(u,o.top),p(f,o.top)]}import aa from"polygon-clipping";import sa from"polygon-clipping";function Ot(t,n,e,r,o,a,i,s={}){let c=Tt(n),l=s.ao??K,u=o.flatMap(y=>{if(y.role!=="entrance"&&y.role!=="exit")return[];let b=ct(y);if(!b||b.length!==4||!Vt(c,Tt(b)))return[];let p=s.portalBase??e,g=$t(b,p,p+At(y).heightM);if(!g)return[];let P=Math.min(r,g.openingTop);return P<=e?[]:[{poly:g.opening,height:P}]});if(!u.length)return!1;let f=y=>y.map(b=>[b.x,b.y]),m=[f(n),...(s.holes??[]).map(f)],h=[e,...new Set(u.map(y=>y.height)),r].sort((y,b)=>y-b),d=[];try{for(let y=1;y<h.length;y++){let b=h[y-1],p=h[y];if(p-b<1e-6)continue;let g=u.filter(_=>_.height>b+1e-6).map(_=>[f(_.poly)]),P=g.length?sa.difference(m,...g):[m];d.push({low:b,high:p,polys:P})}}catch{return!1}for(let y of d)for(let b of y.polys){let[p,...g]=b.map(_=>_.map(([M,x])=>({x:M,y:x}))),P=_=>l.wallBottom+(l.top-l.wallBottom)*(_-e)/(r-e);Z(t,p,g,()=>y.high,y.low,a,i,{...l,top:P(y.high),wallBottom:P(y.low)})}return!0}var le={depthM:1.6,thicknessM:.35,minWallM:6};function kn(t,n,e,r,o,a,i,s,c){let l=r-e;if(l<=0)return;let u=s&&(c??l)>=le.minWallM?ca(n,s):null,f=u?r-le.thicknessM:r,m=f-e,h=m<1.5?[[e,f,1]]:u?[[e,e+Math.min(.9,m*.18),.82],[e+Math.min(.9,m*.18),f,1]]:[[e,e+Math.min(.9,m*.18),.82],[e+Math.min(.9,m*.18),f-.1,1],[f-.1,f,1.1]],d=y=>K.wallBottom+(K.top-K.wallBottom)*(y-e)/l;for(let[y,b,p]of h){let g={...K,top:d(b),wallBottom:d(y)},P=V(a,p),_=V(i,p);Ot(t,n,y,b,o,P,_,{portalBase:e,ao:g})||Z(t,n,void 0,()=>b,y,P,_,g)}for(let[y,...b]of u??[])Z(t,y,b.length?b:void 0,()=>r,f,V(a,1.12),V(i,.78),K)}function ca(t,n){let e=le.depthM/I,r=t.map(i=>{let s=n.x-i.x,c=n.y-i.y,l=Math.hypot(s,c)||1;return{x:i.x+s/l*e,y:i.y+c/l*e}}),o=i=>{let s=i.map(c=>[c.x,c.y]);return s.push(s[0]),s},a=[[o(t)],[o(r)]];for(let i=0;i<t.length;i++){let s=(i+1)%t.length;a.push([o([t[i],t[s],r[s],r[i]])])}try{let[i,...s]=a,c=aa.union(i,...s);return c.length?c.map(l=>l.map(u=>u.slice(0,-1).map(([f,m])=>({x:f,y:m})))):null}catch{return null}}function fn(t,n,e){let r=it(n.stroke?.color),o=n.stroke?.width??0;if(!r||!Number.isFinite(o)||o<=0)return;let a=n.kind==="line"||n.kind==="polyline",i=a?On(n.points??[],n.rotation):ct(n);if(!i||i.length<2)return;let s=a?i.length-1:i.length,c=o*.5;for(let l=0;l<s;l++){let u=i[l],f=i[(l+1)%i.length],m=Math.hypot(f.x-u.x,f.y-u.y);if(m<1e-6)continue;let h=-(f.y-u.y)/m*c,d=(f.x-u.x)/m*c,y=[(u.x+h)*I,e,(u.y+d)*I],b=[(f.x+h)*I,e,(f.y+d)*I],p=[(f.x-h)*I,e,(f.y-d)*I],g=[(u.x-h)*I,e,(u.y-d)*I];t.tri(y,b,p,[0,1,0],r),t.tri(y,p,g,[0,1,0],r)}}function vo(t){return t==="bar"||t==="concession"||t==="coat"||t==="restroom"}var Qt=(t,n,e)=>({x:t.x+(n.x-t.x)*e,y:t.y+(n.y-t.y)*e});function Fn(t,n,e,r){let[o,a,i,s]=n?t:[t[3],t[2],t[1],t[0]];return[Qt(o,s,e),Qt(a,i,e),Qt(a,i,r),Qt(o,s,r)]}function Do(t,n,e,r,o,a,i,s,c=!1){if(e.length!==4||o-r<.4)return!1;let l=R=>c?Math.min(R,o):R,u=bt(e),f=Math.hypot(u[3].x-u[0].x,u[3].y-u[0].y)*I;if(f<.4)return!1;let m=Qt(u[0],u[1],.5),h=Qt(u[3],u[2],.5),d=Math.hypot(m.x-s.x,m.y-s.y)<=Math.hypot(h.x-s.x,h.y-s.y),y=st(i,[.92,.9,.86],.35),b=V(a,.72),p=o-r;if(n==="restroom"){let R=Math.min(.18,p*.08);return ot(t,u,o-R,r,i,a),ot(t,u,o,o-R,y,y),!0}let g=r+Math.min(1.1,p),P=n==="coat"?1:Math.min(.5,.75/f),_=Fn(u,d,0,P);if(ot(t,_,g-.05,r,b,a),ot(t,_,g,g-.05,y,y),n==="coat"||f<1.2)return!0;if(n==="bar"){let R=Fn(u,d,Math.max(P+.2,1-.45/f),1),S=l(r+Math.max(Math.min(2.2,p*2),g-r+.6));return ot(t,R,S,r,i,b),!0}let M=Fn(u,d,Math.max(P+.25,.55),1),x=l(r+Math.max(2.6,g-r+1.4));if(x-.14<=g)return!0;ot(t,M,x-.14,r,i,a),ot(t,u,x,x-.14,y,b);let A=Math.min(.08,.1/Math.max(.1,Math.hypot(u[1].x-u[0].x,u[1].y-u[0].y)*I));for(let[R,S]of[[0,A],[1-A,1]])ot(t,Fn(dt(u,R,S),d,0,Math.min(.08,.1/f)),x-.14,g,b,b);return!0}var Dt=.06,la=.05,Ho=.05,Go=.15,ue=25;function Xo(t,n,e){let r=new Map,o=new Array(n.length).fill(null),a=new Float64Array(n.length),i=new Array(n.length).fill(void 0),s=new Array(n.length).fill(void 0),c=new Map,l=[],u=new Set;for(let m=0;m<t.length;m+=1){let h=t[m];for(let d of h.objects){if(d.type==="table"&&u.add(d.id),d.type!=="section"||!d.outline||d.outline.length<3)continue;let y=_t(d.outline,It);c.set(d.id,{section:d,unit:h,frontU:1/0,hasSeats:!1,rows:new Map,seatIndices:[]}),l.push({id:d.id,floorIndex:m,box:Tt(y),section:d,unit:h,outline:y})}}let f=new Map;for(let m of l){let h=f.get(m.floorIndex);h?h.push(m):f.set(m.floorIndex,[m])}for(let m=0;m<n.length;m++){let h=n[m],d=e?f.get(e[m])??[]:l,y=h.sectionId?d.find(p=>p.id===h.sectionId)??d.find(p=>p.section.logicalSectionId===h.sectionId&&Rt({x:h.x,y:h.y},p.outline,p.section.holes)):void 0,b=y?[y]:d;for(let p of b){if(e&&p.floorIndex!==e[m]||!y&&(h.x<p.box.minX||h.x>p.box.maxX||h.y<p.box.minY||h.y>p.box.maxY||!Rt({x:h.x,y:h.y},p.outline,p.section.holes)))continue;o[m]=p.id;let g=c.get(p.id);g.hasSeats=!0;let P=h.focalPoint??p.unit.focal,_=Math.hypot(h.x-P.x,h.y-P.y);_<g.frontU&&(g.frontU=_),g.seatIndices.push(m);let M=h.rowId||`__seat-${m}`,x=g.rows.get(M);x?x.push({x:h.x,y:h.y}):g.rows.set(M,[{x:h.x,y:h.y}]);break}}for(let[m,h]of c){let d=zt(h.section,{floorBaseHeightM:h.unit.baseHeightM}),y=h.unit.baseHeightM,b=d.rake>0?Math.tan(d.rake*Math.PI/180):0,p=d.rake<=.01&&d.height<=y+.001,g=h.section.surfaceKind,P=g==="flat"?!0:g==="rakedRows"&&d.rake>.01?!1:p,_=h.hasSeats?Ce(m,n,h.seatIndices,h.unit.focal):{sectionId:m,rows:[],blockCount:0},x=_.rows.length<2?We([...h.rows.values()].map(O=>({points:O})),h.unit.focal):null,A=1/0;if(x){if(h.hasSeats)for(let O of h.rows.values())for(let D of O){let H=x.depthAt(D.x,D.y);H<A&&(A=H)}if(!h.hasSeats||!Number.isFinite(A)){A=1/0;for(let O of h.section.outline){let D=x.depthAt(O.x,O.y);D<A&&(A=D)}}}let R=y+la,S=Math.max(R,d.height),E=O=>{let D=Math.max(0,O-A)*$,H=Math.min(D*b,ue);return Math.max(R,d.height+H)},T=O=>{let D=Math.max(0,O)*$,H=Math.min(D*b,ue);return Math.max(R,d.height+H)},F=P?[]:_.rows.map(O=>({pts:O.pts,y:T(O.blockDepth),depth:O.blockDepth,blockId:O.blockId,...u.has(O.id)?{patch:uo(O.pts,It)}:{}})),k=F.length?F[0].y:S,w=F.map(O=>{let D=O.patch&&O.patch.length>=3?O.patch:O.pts,H=0,j=0;for(let X of D)H+=X.x,j+=X.y;let G=D.length||1;H/=G,j/=G;let U=0;for(let X of D){let Y=Math.hypot(X.x-H,X.y-j);Y>U&&(U=Y)}return{cx:H,cy:j,rad:U}}),B=P?()=>S:F.length>=2?(O,D)=>{let H=1/0,j=k;for(let G=0;G<F.length;G++){let U=w[G];if(Math.hypot(O-U.cx,D-U.cy)-U.rad>=H)continue;let X=F[G].patch,Y=X&&X.length>=3?xt(X,O,D)?0:Pn(X,O,D):Pn(F[G].pts,O,D);Y<H&&(H=Y,j=F[G].y)}return j}:(O,D)=>x?E(x.depthAt(O,D)):S,C=[0,1,0],L=F.length>=2||P?()=>C:(O,D)=>{if(!x)return C;let H=x.depthAt(O,D);if(H<=A)return C;let j=(H-A)*$;if(j*b>=ue||d.height+j*b<=R)return C;let[G,U]=x.gradientAt(O,D);if(G===0&&U===0)return C;let X=1/Math.hypot(b,1);return[-G*b*X,X,-U*b*X]};if(!P)for(let O of _.rows){let D=T(O.blockDepth);for(let H of O.seatIndices)i[H]=D}for(let O of _.rows){let D=[];for(let X=1;X<O.pts.length;X++){let Y=Math.hypot(O.pts[X].x-O.pts[X-1].x,O.pts[X].y-O.pts[X-1].y);Y>1e-6&&D.push(Y)}D.sort((X,Y)=>X-Y);let H=D.length?D[Math.floor(D.length/2)]:1/0,j=1/0,G=O.pts[Math.floor(O.pts.length/2)];if(G)for(let X of _.rows){if(X===O||X.blockId!==O.blockId)continue;let Y=Pn(X.pts,G.x,G.y);Y>1e-6&&Y<j&&(j=Y)}let U=Math.min(H,Math.max(j,H*.5));if(Number.isFinite(U)&&U>0)for(let X of O.seatIndices)s[X]=U}r.set(m,{sectionId:m,deckAt:B,normalAt:L,flat:P,bottomY:y,rowLevels:F,landingY:k})}for(let m=0;m<n.length;m++){let h=o[m],d=n[m];if(h){let p=i[m];a[m]=(p??r.get(h).deckAt(d.x,d.y))+Go;continue}let y=d.eyeHeightM,b=Number.isFinite(y)?Math.max(0,y-Mn):0;a[m]=d.kind==="booth"?b+Dt+Go:b}return{bySection:r,seatOwner:o,seatDeckY:m=>a[m],seatPitchU:m=>s[m]}}var ua=[.12,.38,.16],fa=[.72,.62,.45],ma=[.88,.93,.96],jo=[.95,.95,.94],ha=[.66,.29,.22],fe={length:20.12,width:3.05},ya=.14,da=9.76,Ct=[.93,.94,.95],Ln=[.1,.11,.13],pa=[.45,.85,1.25],xa=1.45,Uo=.012,Wo=.004,ba=1.07,ga=.15;function tn(t,n,e,r,o,a){t.setMaterial(a),Z(t,n,e?[e.slice().reverse()]:void 0,()=>r,r-.004,o,o,K)}var Yo=(t,n)=>Lt(t,n/I);function zo(t,n,e){let r=n.x-t.x,o=n.y-t.y,a=Math.hypot(r,o);if(a<1e-9)return null;let i=-o/a*e,s=r/a*e;return[{x:t.x+i,y:t.y+s},{x:n.x+i,y:n.y+s},{x:n.x-i,y:n.y-s},{x:t.x-i,y:t.y-s}]}function Ma(t,n,e,r){let o=n.map(a=>[a.x*I,e,a.y*I]);t.tri(o[0],o[1],o[2],[0,1,0],r),t.tri(o[0],o[2],o[3],[0,1,0],r)}function Nn(t,n,e,r,o,a){let i=e/I,s=[{x:n.x-i,y:n.y-i},{x:n.x+i,y:n.y-i},{x:n.x+i,y:n.y+i},{x:n.x-i,y:n.y+i}];Z(t,s,void 0,()=>o,r,a,V(a,.85),K)}function Jt(t,n,e,r,o,a,i){let s=zo(n,e,r/I);s&&Z(t,s,void 0,()=>a,o,i,V(i,.85),K)}function vn(t){let n=bt(t),e={x:(n[0].x+n[2].x)/2,y:(n[0].y+n[2].y)/2},r=Math.hypot(n[1].x-n[0].x,n[1].y-n[0].y)||1,o=Math.hypot(n[3].x-n[0].x,n[3].y-n[0].y)||1,a={x:(n[1].x-n[0].x)/r,y:(n[1].y-n[0].y)/r},i={x:(n[3].x-n[0].x)/o,y:(n[3].y-n[0].y)/o};return{at:(c,l)=>({x:e.x+(a.x*c+i.x*l)/I,y:e.y+(a.y*c+i.y*l)/I}),lengthM:r*I,widthM:o*I}}function Ko(t,n,e){let r=Le(n);if(!r.length)return;let o=1/0,a=-1/0,i=1/0,s=-1/0;for(let P of n.points??[])o=Math.min(o,P.x),a=Math.max(a,P.x),i=Math.min(i,P.y),s=Math.max(s,P.y);let c=(n.rotation??0)*Math.PI/180,l=Math.cos(c),u=Math.sin(c),f=(o+a)/2,m=(i+s)/2,h=P=>c?{x:f+(P.x-f)*l-(P.y-m)*u,y:m+(P.x-f)*u+(P.y-m)*l}:P,d=Math.min(a-o,s-i)*I,y=Math.max(.04,Math.min(.3,d*.004))/I,b=0;t.setMaterial(0);for(let P of r){if(!P.fill)continue;let _=P.points.map(h);tn(t,_,null,e+Uo+b*Wo,it(P.fill)??Ct,0),b++}let p=r.filter(P=>!(P.fill&&P.ink===P.fill)),g=[...new Set(p.map(P=>P.ink??zn))];for(let P of g){let _=e+Uo+b++*Wo,M=it(P)??Ct;for(let x of p){if((x.ink??zn)!==P)continue;let A=x.points.map(h),R=x.closed?A.length:A.length-1;for(let S=0;S<R;S++){let E=zo(A[S],A[(S+1)%A.length],y);E&&Ma(t,E,_,M)}}}}function Vo(t,n,e,r,o){if(n.length<3)return!1;let a=r+.006,i=o??ua;if(e==="oval-cricket"){let s=n.reduce((M,x)=>M+x.x,0)/n.length,c=n.reduce((M,x)=>M+x.y,0)/n.length,l=M=>n.map(x=>({x:s+(x.x-s)*M,y:c+(x.y-c)*M})),u=8;for(let M=0;M<u;M++){let x=l(1-M/u),A=M===u-1?null:l(1-(M+1)/u);tn(t,x,A,a,V(i,M%2?1.04:.96),4)}let f=n[0];for(let M of n)Math.hypot(M.x-s,M.y-c)>Math.hypot(f.x-s,f.y-c)&&(f=M);let m=Math.hypot(f.x-s,f.y-c)||1,h=(f.x-s)/m,d=(f.y-c)/m,y=-d,b=h,p=Math.min(1,2*m*I*ya/fe.length),g=fe.length*p/2/I,P=fe.width*p/2/I,_=[[-g,-P],[g,-P],[g,P],[-g,P]].map(([M,x])=>({x:s+h*M+y*x,y:c+d*M+b*x}));return tn(t,_,null,a+.004,fa,0),t.setMaterial(0),!0}if(e==="rink-hockey"){let s=Yo(n,ga);return tn(t,s,null,a,ma,0),t.setMaterial(0),Z(t,n,[s.slice().reverse()],()=>r+ba,r,jo,V(jo,.9),K),!0}if(e==="ring-boxing"&&n.length===4){let{at:s}=vn(n),c=[s(-3.05,-3.05),s(3.05,-3.05),s(3.05,3.05),s(-3.05,3.05)],l=[[.77,.19,.19],Ct,[.17,.42,.69],Ct];t.setMaterial(0),c.forEach((u,f)=>Nn(t,u,.07,r,r+xa,l[f]));for(let u of pa)for(let f=0;f<4;f++)Jt(t,c[f],c[(f+1)%4],.025,r+u-.025,r+u+.025,Ct);return!0}if(e==="court-tennis"&&n.length===4){let{at:s}=vn(n);t.setMaterial(0),Jt(t,s(0,-6.4),s(0,6.4),.015,r,r+.95,Ln),Jt(t,s(0,-6.4),s(0,6.4),.03,r+.95,r+1,Ct);for(let c of[-1,1])Nn(t,s(0,c*6.4),.05,r,r+1.07,Ln);return!0}if(e==="court-basketball"&&n.length===4){let{at:s,lengthM:c}=vn(n),l=Math.min(14,c/2-.5);t.setMaterial(0);for(let u of[-1,1]){let f=s(u*(l+1.2),0),m=s(u*(l-1.2),0);Nn(t,f,.12,r,r+3.4,Ln),Jt(t,f,m,.06,r+3.25,r+3.4,Ln),Jt(t,s(u*(l-1.2),-.9),s(u*(l-1.2),.9),.03,r+2.9,r+3.95,Ct)}return!0}if(e==="pitch-rugby"&&n.length===4){let{at:s,lengthM:c}=vn(n),l=c*(50/120);t.setMaterial(0);for(let u of[-1,1]){for(let f of[-2.8,2.8])Nn(t,s(u*l,f),.07,r,r+12,Ct);Jt(t,s(u*l,-2.8),s(u*l,2.8),.06,r+2.94,r+3.06,Ct)}return!0}if(e==="track-athletics"){let s=Yo(n,da);return s.length<3?!1:(tn(t,n,s,a,ha,0),tn(t,s,null,a,i,4),t.setMaterial(0),!0)}return!1}var Zo=[.19,.4,.15],Pa=.012,Xn=2.4,Ra=1,Ia=.75,Sa=.15;function wt(t){if(t.points&&t.points.length>=3)return t.points;let{center:n,width:e,height:r,rotation:o}=t;if(!e||!r)return null;let a=(o??0)*Math.PI/180,i=Math.cos(a),s=Math.sin(a),c=e/2,l=r/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,f])=>({x:n.x+u*i-f*s,y:n.y+u*s+f*i}))}function nr(t,n,e,r,o,a,i=!1){let s=wt(n);if(s){if(i){let c=jt(r,o.boothTop),l=Et([...s]);Z(t,_t(l,_a/I),[l.slice().reverse()],()=>e+.03,e,c,V(c,.8),K);return}if(!(!n.points&&a&&wa(t,s,e,r,a))){if(!n.points&&a&&s.length===4){Aa(t,s,e,r,a);return}Z(t,s,void 0,()=>e+Xn,e,jt(r,o.boothTop),o.boothWall,K)}}}var me=1.1,qo=[.9,.9,.88],_a=.1,Dn=[.87,.87,.85],$o=.08;function er(t,n){let e=c=>({x:(t[c].x+t[(c+1)%4].x)/2,y:(t[c].y+t[(c+1)%4].y)/2}),r=0,o=1/0;for(let c=0;c<4;c++){let l=e(c),u=Math.hypot(l.x-n.x,l.y-n.y);u<o&&(o=u,r=c)}let a=[0,1,2,3].map(c=>t[(r+c)%4]),i=(c,l,u)=>({x:c.x+(l.x-c.x)*u,y:c.y+(l.y-c.y)*u});return{q:a,part:(c,l,u,f)=>{let m=i(a[0],a[1],c),h=i(a[0],a[1],l),d=i(a[3],a[2],c),y=i(a[3],a[2],l);return[i(m,d,u),i(h,y,u),i(h,y,f),i(m,d,f)]},depthM:Math.hypot(a[3].x-a[0].x,a[3].y-a[0].y)*I,widthM:Math.hypot(a[1].x-a[0].x,a[1].y-a[0].y)*I}}function Aa(t,n,e,r,o){let{q:a,part:i}=er(n,o),s=r??[.35,.42,.55],c=st(s,[.78,.78,.77],.62),l=st(s,[.95,.95,.94],.45);ot(t,a,e+Dt,e,c,V(c,.8)),ot(t,i(.05,.95,.72,.98),e+me-.05,e+Dt,l,V(l,.8)),ot(t,i(.03,.97,.7,1),e+me,e+me-.05,qo,V(qo,.9))}function wa(t,n,e,r,o){if(n.length!==4)return!1;let{q:a,part:i,depthM:s,widthM:c}=er(n,o);if(s<1||c<1)return!1;let l=r??[.35,.42,.55],u=st(l,[.78,.78,.77],.62),f=e+Xn,m=$o/c,h=$o/s;ot(t,a,e+Dt,e,u,V(u,.8)),ot(t,i(0,1,1-h,1),f,e+Dt,Dn,V(Dn,.9));for(let[b,p]of[[0,m],[1-m,1]])ot(t,i(b,p,0,1-h),f,e+Dt,Dn,V(Dn,.9));ot(t,i(m,1-m,0,Math.min(.5,.06/s)),f,f-.3,l,V(l,.85));let d=Math.min(.4,.6/c),y=Math.min(.12,.3/s);return ot(t,i(.5-d,.5+d,.72-y,.72+y),e+Ra,e+Dt,st(l,[.95,.95,.94],.7),V(l,.75)),!0}function jn(t){if(t.shape==="round"){let u=t.radius;return u?wn(t.center.x,t.center.y,u,u,24):null}let{width:n,height:e,rotation:r,center:o}=t;if(!n||!e)return null;let a=(r??0)*Math.PI/180,i=Math.cos(a),s=Math.sin(a),c=n/2,l=e/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,f])=>({x:o.x+u*i-f*s,y:o.y+u*s+f*i}))}function or(t,n,e,r,o,a=!0){let i=jn(n);if(!i)return;let s=i.reduce((m,h)=>m+h.x,0)/i.length,c=i.reduce((m,h)=>m+h.y,0)/i.length,l=m=>i.map(h=>({x:s+(h.x-s)*m,y:c+(h.y-c)*m})),u=a&&r?jt(r,o.tableTop):Ea,f=e+Ia;Z(t,i,void 0,()=>f,e+Ba,u,V(u,.86),K),Z(t,l(.12),void 0,()=>f+.12,f,Qo,V(Qo,.8),K)}var Ea=[.93,.92,.89],Qo=[.78,.66,.42],Ba=.25,mn={armM:1.1,widthM:.28,insideM:1.4,low:.043,high:.048};function Ta(t,n,e){let r=t.reduce((p,g)=>p+g.x,0)/4,o=t.reduce((p,g)=>p+g.y,0)/4,a=t[3].x-t[0].x,i=t[3].y-t[0].y,s=Math.hypot(a,i)||1;a/=s,i/=s,a*(n.x-r)+i*(n.y-o)<0&&(a=-a,i=-i);let c=-i,l=a,u=mn.armM/I,f=mn.widthM/I,m=s/2+mn.insideM/I,h=e?-1:1,d=r+a*(m+(e?0:u)),y=o+i*(m+(e?0:u)),b=(p,g)=>({x:d+a*p*h+c*g,y:y+i*p*h+l*g});return[b(0,0),b(-u,u),b(-u-f,u),b(-f,0),b(-u-f,-u),b(-u,-u)]}function Oa(t,n,e,r,o){let a=[.94,.95,.96];Z(t,Ta(n,r,o),void 0,()=>e+mn.high,e+mn.low,a,a,K)}function Hn(t,n){let e=it(t);return e?{top:V(St(e,.12),.95),wall:V(St(e,.12),.85)}:{top:n.tierTop,wall:n.tierWall}}function rr(t,n,e,r,o,a,i,s,c=[]){let l=ct(n);if(!n.role&&(!n.fill||n.fill==="none"||n.fill==="transparent")||!l){fn(t,n,e+r+Pa);return}let f=s?s.kind==="stage":n.role==="stage",m=s?s.kind==="screen":n.role==="screen",h=s?{kind:f?"stage":"solid",heightM:s.topY-s.baseY}:At(n),d=s?.baseY??e,y=s?.topY??e+r;if(f&&i){let R=1/0,S=-1/0,E=1/0,T=-1/0;for(let F of l)F.x<R&&(R=F.x),F.x>S&&(S=F.x),F.y<E&&(E=F.y),F.y>T&&(T=F.y);i.push({cx:(R+S)/2*I,cz:(E+T)/2*I,y,halfX:Math.max((S-R)/2*I,.5),halfZ:Math.max((T-E)/2*I,.5)})}let b=it(n.fill),p=n.role==="wall"||n.role==="entrance"||n.role==="exit",g=p?Hn(n.fill,o).top:f&&b?st(o.stageTop,V(St(b,.18),.9),.9):!n.role&&b?b:jt(b,f?o.stageTop:o.decorTop),P=m?b:null,_=p?Hn(n.fill,o).wall:f?b?st(o.stageWall,V(b,.58),.82):o.stageWall:m?P?st(V(P,1.42),[.24,.46,.82],.08):[.24,.46,.82]:jt(it(n.fill),o.decorWall);if(n.role==="wall"&&!s){kn(t,l,d,y,c,g,_,a),fn(t,n,y+.012);return}if(m&&l.length===4&&y-d>.2){let R=ce(l,d,y);if(!R)return;let{quad:S,side:E,trim:T,inner:F,panel:k}=R,w=[.12,.15,.18];for(let[B,C]of[[0,E],[1-E,1]])ot(t,dt(S,B,C),y,d,w,w);ot(t,F,d+T,d,w,w),ot(t,F,y,y-T,w,w),ot(t,k,y-T,d+T,_,_),fn(t,n,y+.012);return}let M=b?V(St(b,.15),.82):_,x=b?V(St(b,.1),1.02):g;if(vo(n.role)&&!s&&Do(t,n.role,l,d,y,M,x,a,n.heightM!==void 0))return;if((n.role==="sound"||s?.kind==="sound_desk")&&l.length===4&&y-d>.3){let R=bt(l),S=Math.hypot(R[1].x-R[0].x,R[1].y-R[0].y)*I,E=Math.min(.12,.09/Math.max(S,.001)),T=[.18,.21,.24],F=y-Math.min(.12,(y-d)*.15);for(let[k,w]of[[0,E],[1-E,1]])ot(t,dt(R,k,w),F,d,T,T);ot(t,R,y,F,g,T);return}if(n.role==="rail"&&l.length===4&&y>d){let R=bt(l),S=Math.hypot(R[1].x-R[0].x,R[1].y-R[0].y)*I,E=Math.max(1,Math.min(128,Math.ceil(S/1.4))),T=Math.min(.08,.055/Math.max(.055,S)),F=[.58,.64,.66];for(let k=0;k<=E;k++){let w=k/E,B=Math.min(1-T,Math.max(0,w-T/2));ot(t,dt(R,B,B+T),y,d,F,V(F,.8))}for(let k of[.52,1]){let w=d+(y-d)*k;ot(t,R,w,Math.max(d,w-.055),F,V(F,.8))}return}if(n.role==="goal"&&l.length===4){let R=bt(l),S=Math.hypot(R[1].x-R[0].x,R[1].y-R[0].y)*I,E=Math.min(.12,.1/Math.max(.1,S)),T=[.9,.94,.94];for(let[F,k]of[[0,E],[1-E,1]])ot(t,dt(R,F,k),Math.max(d,y-.1),d,T,T);ot(t,R,y,Math.max(d,y-.1),T,T);return}if(h.kind==="portal"&&l.length===4){let R=$t(l,d,y);if(!R)return;let{quad:S,side:E,face:T,openingTop:F}=R;for(let[k,w,B]of[[0,T,1],[T,1-T,.67],[1-T,1,1]]){let C=cn(S,k,w),L=V(g,B),O=V(_,B);for(let[D,H]of[[0,E],[1-E,1]])ot(t,dt(C,D,H),F,d,L,O);ot(t,C,y,F,L,O)}(n.role==="entrance"||n.role==="exit")&&Oa(t,S,d,a,n.role==="exit");return}if(h.kind==="suite"&&l.length===4){let R=l.map((T,F)=>{let k=l[(F+1)%4],w=(T.x+k.x)/2,B=(T.y+k.y)/2;return Math.hypot(w-a.x,B-a.y)}),S=R.indexOf(Math.min(...R)),E=[0,1,2,3].map(T=>l[(S+T)%4]);ot(t,dt(E,0,.08),y,d,g,_),ot(t,dt(E,.92,1),y,d,g,_),ot(t,cn(E,.88,1),y,d,g,_),ot(t,E,y,Math.max(d,y-.18),g,_);return}if(f&&!n.stageKind?.startsWith("pitch-")&&y-d>.12){let R=y-Math.min(.06,(y-d)*.15);ot(t,l,R,d,g,_),ot(t,l,y,R,g,st(g,_,.2))}else ot(t,l,y,d,g,_);if((n.stageKind==="pitch-football"||n.stageKind==="pitch-rugby")&&l.length===4){t.setMaterial(4);let R=bt(l),S=st(b??Zo,Zo,b?.45:0);for(let E=0;E<12;E++){let T=dt(R,E/12,(E+1)/12),F=V(S,E%2?1.09:.91),k=T.map(w=>[w.x*I,y+.006,w.y*I]);t.tri(k[0],k[1],k[2],[0,1,0],F),t.tri(k[0],k[2],k[3],[0,1,0],F)}}n.stageKind&&n.stageKind!=="pitch-football"&&Vo(t,l,n.stageKind,y,b),f&&Kt(n.stageKind)&&Ko(t,n,y),t.setMaterial(m?1:0),fn(t,n,y+.012)}function Un(t){let{x:n,y:e,width:r,height:o}=t;if(!r||!o)return null;let a=n+r/2,i=e+o/2,s=(t.rotation??0)*Math.PI/180,c=Math.cos(s),l=Math.sin(s),u=r/2,f=o/2;return[[-u,-f],[u,-f],[u,f],[-u,f]].map(([m,h])=>({x:a+m*c-h*l,y:i+m*l+h*c}))}function Ca(t){if(!t||!t.startsWith("data:image/svg+xml"))return null;let n=t.slice(t.indexOf(",")+1);if(/;base64/i.test(t.slice(0,t.indexOf(","))))try{n=atob(n)}catch{return null}else try{n=decodeURIComponent(n)}catch{}let e=n.match(/<(?:rect|path)\b[^>]*\bfill="([^"]+)"/i);if(!e)return null;let r=e[1].trim();if(r==="none"||r==="transparent")return null;let o=r.match(/^url\(#([^)]+)\)$/);if(!o)return it(r);let a=n.match(new RegExp(`<(?:linear|radial)Gradient\\b[^>]*\\bid="${o[1]}"[^>]*>([\\s\\S]*?)</(?:linear|radial)Gradient>`,"i"));if(!a)return null;let i=[];for(let s of a[1].matchAll(/stop-color="([^"]+)"/gi)){let c=it(s[1].trim());c&&i.push(c)}return i.length?i.reduce((s,c,l)=>st(s,c,1/(l+1)),i[0]):null}function ir(t,n,e,r){if(n.layer==="foreground")return;let o=Un(n);if(!o)return;let a=e+Sa,i=jt(Ca(n.href),r.decorTop),s=Math.max(0,Math.min(1,n.opacity??1));s<1&&(i=st(r.ground,i,s)),Z(t,o,void 0,()=>a,e,i,st(i,r.decorWall,.5),K)}function sr(t,n,e,r,o){if(!n.points||n.points.length<3)return;let a=eo(r,o.gaTop);Z(t,n.points,n.holes,()=>e+Jo,e,a,o.gaWall,K),La(t,n.points,e+Jo)}var Jo=.15,Gn=[.72,.74,.76],he=1.1,tr=.12,ye=.05,ka=.06,Fa=2.4;function La(t,n,e){let r=Et([...n]),o=Lt(r,tr/I),a=Lt(r,(tr+ye)/I);if(o.length<3||a.length<3)return;for(let s of[e+he,e+he*.5])Z(t,o,[a.slice().reverse()],()=>s,s-ye,Gn,V(Gn,.85),K);let i=ka/2/I;for(let s=0;s<o.length;s++){let c=o[s],l=o[(s+1)%o.length],u=Math.hypot(l.x-c.x,l.y-c.y)*I,f=Math.max(1,Math.round(u/Fa));for(let m=0;m<f;m++){let h=m/f,d=c.x+(l.x-c.x)*h,y=c.y+(l.y-c.y)*h,b=[{x:d-i,y:y-i},{x:d+i,y:y-i},{x:d+i,y:y+i},{x:d-i,y:y+i}];Z(t,b,void 0,()=>e+he-ye,e,Gn,V(Gn,.8),K)}}}var Na=1.5,va=30,Da=4,Ga=3.6,Ha=6,de=15,Xa=3,ja=1;function Ua(t){return Math.max(Ga,Math.min(Ha,2.4+.15*t))}var hn=Math.PI*2;function Wa(t,n){let e=0,r=0;for(let f of t)e+=f.x,r+=f.y;let o=Math.atan2(r/t.length-n.y,e/t.length-n.x),a=t.map(f=>{let m=Math.atan2(f.y-n.y,f.x-n.x)-o;for(;m>Math.PI;)m-=hn;for(;m<-Math.PI;)m+=hn;return m+o}),i=a.map((f,m)=>m).sort((f,m)=>a[f]-a[m]),s=a[i[0]],c=a[i[i.length-1]];if(c-s>Math.PI)return null;let l=f=>Math.hypot(f.x-n.x,f.y-n.y),u=f=>{let m=t[f],h=(f+t.length-1)%t.length,d=(f+1)%t.length,y=Math.abs(a[h]-a[f])<=Math.abs(a[d]-a[f])?h:d,b=t[y];return l(m)<=l(b)?[m,b]:[b,m]};return{start:s,end:c,startEdge:u(i[0]),endEdge:u(i[i.length-1])}}function ar(t){return t.type==="shape"&&t.role==="wall"&&t.heightM===void 0}function pe(t,n,e=()=>!0){let r=[];for(let c of t){if(!ar(c)||!e(c))continue;let l=ct(c);if(!l||l.length<3)continue;let u=Wa(l,n);if(!u)return[];r.push(u)}if(r.length<2)return[];let o=t.flatMap(c=>{if(c.type!=="shape"||c.role!=="entrance"&&c.role!=="exit")return[];let l=ct(c);if(!l?.length)return[];let u=0,f=0;for(let m of l)u+=m.x,f+=m.y;return[{x:u/l.length,y:f/l.length}]}),a=c=>(c%hn+hn)%hn;r.sort((c,l)=>a(c.start)-a(l.start));let i=c=>Math.hypot(c.x-n.x,c.y-n.y),s=[];for(let c=0;c<r.length;c++){let l=r[c],u=r[(c+1)%r.length],f=a(u.start-l.end);if(f<=0||f>=Math.PI/2)continue;let m=x=>a(x-l.end)<f;if(r.some(x=>x!==l&&x!==u&&(m(x.start)||m(x.end)||a(l.end-x.start)<x.end-x.start)))continue;let[d,y]=l.endEdge,[b,p]=u.startEdge,g={x:(d.x+y.x)/2,y:(d.y+y.y)/2},P={x:(b.x+p.x)/2,y:(b.y+p.y)/2},_=Math.hypot(P.x-g.x,P.y-g.y)*I;if(_<Na||_>va||Math.abs(i(g)-i(P))*I>Da+.2*_)continue;let M={x:(g.x+P.x)/2,y:(g.y+P.y)/2};o.some(x=>m(Math.atan2(x.y-n.y,x.x-n.x))&&Math.abs(i(x)-i(M))*I<=Xa)||s.push({quad:[d,y,p,b],mid:M,widthM:_,openingM:Ua(_)})}return s}function cr(t,n){let e=[];for(let a of n)if(a.text?.trim())for(let i of t){let s=Math.hypot(a.position.x-i.mid.x,a.position.y-i.mid.y)*I;s<=de&&e.push({text:a,gate:i,d:s})}e.sort((a,i)=>a.d-i.d);let r=new Map,o=new Set;for(let{text:a,gate:i}of e)r.has(a.id)||o.has(i)||(r.set(a.id,i),o.add(i));return r}function lr(t,n,e,r,o,a,i,s=()=>!0){let c=pe(n,qt(e),s);if(!c.length)return;let l=n.find(f=>ar(f)&&s(f)),u=Hn(l?.fill,i);t.setMaterial(Cn);for(let f of c)o-f.openingM<ja||kn(t,f.quad,r+f.openingM,r+o,[],u.top,u.wall,a,o);t.setMaterial(0)}var Ya=6,za=2.2,xe=.1,Ka=/^(gate|entrance|entry|exit|way in|way out|door)s?$/i,Va=new Set(["stage","entrance","exit","screen","suite","obstruction","sound","bar","concession","restroom","coat"]),Za=.3,qa=1.8,$a=.9,Qa=.55,Ja=1,ur=4e3,tc=6,fr="#d8a425",nc="#e8c15a",be="#1c1608";function mr(t){let n=ec(t);if(!n)return null;let e=Ne(t).find(r=>r.icon===n.icon);return{...n,name:e?.titleFallback??n.icon}}function ec(t){let n=t.accessibility;if(n?.length)return{icon:n.includes("wheelchair")?"wheelchair":n[0],color:gn(n)};let e=t.commercial;return e?.obstructedView?{icon:"obstructedView",color:fr,ink:be}:e?.restrictedView?{icon:"restrictedView",color:fr,ink:be}:e?.premium?{icon:"premium",color:nc,ink:be}:null}function oc(t,n){if(!t)return;let e,r=0;for(let[a,i]of t)i>r&&(r=i,e=a);let o=n.categories?.find(a=>a.key===e)?.color;return o&&/^#[0-9a-f]{6}$/i.test(o)?o:void 0}var rc=6e3,ic=.25,hr=[-90,90,-135,135,-45,45];function sc(t,n,e,r){let o=t.flatMap(({id:i,a:s,members:c})=>{let l=(s.minX+s.maxX)/2,u=(s.minY+s.maxY)/2,f=.5*Math.hypot(s.maxX-s.minX,s.maxY-s.minY),m=1/0;for(let h of c)m=Math.min(m,Math.hypot(n[h].x-l,n[h].y-u));return c.length&&m>=f*ic?[{id:i,cx:l,cy:u,half:f,members:c}]:[]}).sort((i,s)=>i.half-s.half),a=new Map;return o.forEach(({id:i,cx:s,cy:c,members:l},u)=>{let f=r.x-s,m=r.y-c,y=(Math.hypot(f,m)>1e-6?Math.atan2(m,f):0)+hr[u%hr.length]*Math.PI/180,b=Math.cos(y),p=Math.sin(y),g=-1,P=-1/0;for(let _ of l){let M=(n[_].x-s)*b+(n[_].y-c)*p;M>P&&(P=M,g=_)}a.set(i,[n[g].x*I,e.seatDeckY(g),n[g].y*I])}),a}function dr(t){let{doc:n,units:e,seats:r,surfaces:o,focal:a}=t,i=n.zones??[],s=[];if(i.length){let c=new Map;for(let m of e)for(let h of m.objects)h.type==="section"&&h.zone&&c.set(h.id,h.zone);let l=new Map,u=new Map;for(let m=0;m<r.length;m++){let h=r[m],d=o.seatOwner[m],y=h.zoneId??(d?c.get(d):void 0);if(!y)continue;let b=l.get(y);b||(b={n:0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,sumY:0},l.set(y,b));let p=u.get(y);p||u.set(y,p=[]),p.push(m),b.n++,h.x<b.minX&&(b.minX=h.x),h.y<b.minY&&(b.minY=h.y),h.x>b.maxX&&(b.maxX=h.x),h.y>b.maxY&&(b.maxY=h.y),b.sumY+=o.seatDeckY(m)}let f=sc(i.flatMap(m=>{let h=l.get(m.id);return h?[{id:m.id,a:h,members:u.get(m.id)??[]}]:[]}),r,o,a);for(let m of i){let h=l.get(m.id),d=[];for(let[y,b]of c)b===m.id&&d.push(y);if(!h||h.n===0){s.push({id:m.id,label:m.label,color:it(m.color),sectionIds:d,seatCount:0,center:[0,0,0],radius:0,focalWorld:[(m.focalPoint??a).x*I,1.5,(m.focalPoint??a).y*I]});continue}s.push({id:m.id,label:m.label,color:it(m.color),sectionIds:d,seatCount:h.n,...f.has(m.id)?{labelAt:f.get(m.id)}:{},center:[(h.minX+h.maxX)/2*I,h.sumY/h.n,(h.minY+h.maxY)/2*I],radius:.5*Math.hypot((h.maxX-h.minX)*I,(h.maxY-h.minY)*I)||1,focalWorld:[(m.focalPoint??a).x*I,1.5,(m.focalPoint??a).y*I]})}}return s}function pr(t){let{doc:n,units:e,seats:r,surfaces:o,seatData:a,hintedSeatFloor:i,zones:s,focal:c}=t,l=[],u=[],f=[],m=new Map;for(let h of e)for(let d of h.objects){if(d.type!=="section"||!d.zone)continue;let y=(d.displayLabel||d.label||"").trim().toLocaleLowerCase();if(!y)continue;let b=n.floors?.[h.index]?.name?.trim().toLocaleLowerCase();if(e.length>1&&b===y)continue;let p=m.get(d.zone);p||m.set(d.zone,p=new Set),p.add(y)}for(let h of s)h.seatCount!==0&&(m.get(h.id)?.has(h.label.trim().toLocaleLowerCase())||l.push({id:`zone:${h.id}`,kind:"zone",text:h.label,anchor:[(h.labelAt??h.center)[0],(h.labelAt??h.center)[1]+Ya,(h.labelAt??h.center)[2]],color:n.zones?.find(d=>d.id===h.id)?.color}));{let h=new Map,d=new Map,y=new Map,b=new Map;for(let p=0;p<r.length;p++){let g=o.seatOwner[p];if(!g)continue;let P=h.get(g);P||(P={n:0,x:0,y:0,deck:0},h.set(g,P)),P.n++,P.x+=r[p].x,P.y+=r[p].y,P.deck+=o.seatDeckY(p);let _=r[p].categoryKey;if(_){let x=d.get(g);x||(x=new Map,d.set(g,x)),x.set(_,(x.get(_)??0)+1)}if(r[p].accessibility?.includes("wheelchair")){let x=y.get(g);x?x.push(p):y.set(g,[p])}let M=b.get(g);M||(M={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0,minDeck:1/0,maxDeck:-1/0},b.set(g,M)),M.minDeck=Math.min(M.minDeck,o.seatDeckY(p)),M.maxDeck=Math.max(M.maxDeck,o.seatDeckY(p)),r[p].x<M.minX&&(M.minX=r[p].x),r[p].x>M.maxX&&(M.maxX=r[p].x),r[p].y<M.minY&&(M.minY=r[p].y),r[p].y>M.maxY&&(M.maxY=r[p].y)}for(let p of e)for(let g of p.objects){if(g.type!=="section"||Bo(g))continue;let P=h.get(g.id);if(!P||P.n===0)continue;let _=b.get(g.id),M=[P.x/P.n*I,P.deck/P.n,P.y/P.n*I],x=g.displayLabel||g.label||g.id;u.push({id:g.id,floorIndex:p.index,label:x,seatCount:P.n,center:M,radius:Math.max(1,Math.hypot(_.maxX-_.minX,_.maxY-_.minY)*.5*I),box:{min:[_.minX*I-.4,_.minDeck,_.minY*I-.4],max:[_.maxX*I+.4,_.maxDeck+1,_.maxY*I+.4]},focalWorld:[p.focal.x*I,p.baseHeightM+1.5,p.focal.y*I]});let A=n.floors?.[p.index]?.name?.trim().toLocaleLowerCase();if(!(e.length>1&&A===x.trim().toLocaleLowerCase())){let R=oc(d.get(g.id),n),S=y.get(g.id);l.push({id:`section:${g.id}`,kind:"section",text:x,anchor:[M[0],M[1]+za,M[2]],floorIndex:p.index,...R?{tint:R}:{},...S?{wheelchairSeats:S}:{}})}}}{for(let M of e)for(let x of M.objects){if(x.type!=="gaArea")continue;let A=Yt(x.points);if(!A)continue;let R=x.labelPresentation?.visible===!1?"":x.displayLabel||x.label||x.id,S=x.capacity>0?[R,x.capacity.toLocaleString()].filter(Boolean).join(" \xB7 "):R;S&&l.push({id:`ga:${x.id}`,kind:"ga",text:S,anchor:[A.x*I,M.baseHeightM+qa,A.y*I],floorIndex:M.index})}let h=new Map,d=new Map;for(let M of e)for(let x of M.objects)if(x.type==="section"&&h.set(x.id,x.displayLabel||x.label||x.id),x.type==="row"){let A=x.displayLabel?.trim()||x.segmentedRow?.displayLabel?.trim();A&&d.set(x.id,A)}let y=new Map;for(let M=0;M<r.length;M++){let x=r[M],A=Math.hypot(x.x-c.x,x.y-c.y),R=y.get(x.rowId);(!R||A>R.far)&&y.set(x.rowId,{seat:x,index:M,far:A})}for(let[M,x]of y){let A=o.seatOwner[x.index]??x.seat.sectionId,R=yr(x.seat.label,M,h.get(A??""),d.get(M));R&&l.push({id:`row:${M}`,kind:"row",text:R,anchor:[x.seat.x*I,o.seatDeckY(x.index)+$a,x.seat.y*I],floorIndex:i[x.index]})}let b=new Map;for(let M=0;M<r.length;M++){let x=r[M],A=b.get(x.rowId);A||(A={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:yr(x.label,x.rowId,h.get(o.seatOwner[M]??x.sectionId??""),d.get(x.rowId)),sectionId:o.seatOwner[M]??x.sectionId},b.set(x.rowId,A));let R=M*3,S=a.iPosition[R],E=a.iPosition[R+1],T=a.iPosition[R+2];A.n++,A.x+=S,A.y+=E,A.z+=T,A.minX=Math.min(A.minX,S),A.maxX=Math.max(A.maxX,S),A.minZ=Math.min(A.minZ,T),A.maxZ=Math.max(A.maxZ,T)}for(let[M,x]of b)f.push({id:M,label:x.label,sectionId:x.sectionId,seatCount:x.n,center:[x.x/x.n,x.y/x.n,x.z/x.n],radius:Math.max(.8,Math.hypot(x.maxX-x.minX,x.maxZ-x.minZ)*.5)});let p=0,g=(M,x)=>{p++,l.push({id:`access:${r[M].id}`,kind:"access",text:x.name,icon:x.icon,color:x.color,...x.ink?{ink:x.ink}:{},seatWidthM:a.iChairWidth[M]*2,anchor:[r[M].x*I,o.seatDeckY(M)+Ja,r[M].y*I],floorIndex:i[M],rowId:r[M].rowId})},P=null,_=()=>{if(P){let M=mr(r[P.seats[0]]),x=P.seats.length,A=Math.max(1,Math.round(x/tc));for(let R=0;R<A&&p<ur;R++)g(P.seats[Math.min(x-1,Math.floor((R+.5)*x/A))],M)}P=null};for(let M=0;M<r.length&&p<ur;M++){let x=mr(r[M]);if(x&&r[M].accessibility?.length){_(),g(M,x);continue}if(!x){_();continue}P&&P.rowId===r[M].rowId&&P.icon===x.icon?P.seats.push(M):(_(),P={rowId:r[M].rowId,icon:x.icon,seats:[M]})}if(_(),r.length<=rc)for(let M=0;M<r.length;M++){let x=r[M],A=ac(x.displayLabel||x.label);A&&l.push({id:`seat:${x.id}`,kind:"seat",seatWidthM:a.iChairWidth[M]*2,text:A,anchor:[x.x*I,o.seatDeckY(M)+Qa,x.y*I],floorIndex:i[M],rowId:x.rowId})}}for(let h of e){let d=vt(h,e.length===1?r:r.filter((p,g)=>i[g]===h.index)),y=d?cr(pe(h.objects,qt(d)),h.objects.filter(p=>p.type==="text")):new Map,b=[...y.values()];for(let p of h.objects){let g=p.type==="text"?y.get(p.id):void 0;if(p.type==="shape"&&(p.role==="entrance"||p.role==="exit")&&Ka.test(p.label?.trim()??"")){let P=ct(p),_=P?Yt(P):null;if(_&&b.some(M=>Math.hypot(_.x-M.mid.x,_.y-M.mid.y)*I<=de+M.widthM))continue}if(g&&p.type==="text")l.push({id:`text:${p.id}`,kind:"gate",text:p.text,icon:"entrance",anchor:[g.mid.x*I,h.baseHeightM+g.openingM+xe,g.mid.y*I],color:p.color,floorIndex:h.index});else if(p.type==="shape"&&p.role&&Va.has(p.role)){let P=ct(p),_=P?Yt(P):null;if(!_||!p.label)continue;l.push({id:`architecture:${p.id}`,kind:p.role==="stage"?"stage":p.role==="entrance"||p.role==="exit"?"gate":"annotation",text:p.label,...p.role==="entrance"||p.role==="exit"?{icon:p.role}:{},anchor:[_.x*I,h.baseHeightM+At(p).heightM+xe,_.y*I],color:p.fill,floorIndex:h.index})}else if(p.type==="text"){if(!p.text)continue;l.push({id:`text:${p.id}`,kind:"annotation",text:p.text,anchor:[p.position.x*I,h.baseHeightM+xe,p.position.y*I],color:p.color,rotation:p.rotation,floorIndex:h.index})}else if(p.type==="booth"){if(p.labelPresentation?.visible===!1)continue;let P=wt(p);if(!P)continue;let _=Yt(P);if(!_)continue;l.push({id:`booth:${p.id}`,kind:"booth",text:p.displayLabel||p.label||p.id,anchor:[_.x*I,h.baseHeightM+Xn+Za,_.y*I],floorIndex:h.index})}}}return{labels:l,sections:u,rows:f}}function xr(t,n){if(n.length>1)for(let e of n)t.push({id:`floor:${e.id}`,kind:"floor",text:e.label,anchor:[e.center[0],e.box.max[1]+1.2,e.center[2]],floorIndex:e.index})}function ac(t){let n=t.lastIndexOf("-");return n>=0&&n<t.length-1?t.slice(n+1):t}function yr(t,n,e,r){if(r?.trim())return r.trim();let o=t?t.lastIndexOf("-"):-1,a=o>0?t.slice(0,o):n;return a&&Xe(a,e)}var yn=3,Ut=.38,dn=.24;function cc(t){if(t.length<3)return null;let n=t[0],e=t[Math.floor(t.length/2)],r=t[t.length-1],o=(e.x-n.x)*I,a=(e.y-n.y)*I,i=(r.x-n.x)*I,s=(r.y-n.y)*I,c=2*(o*s-a*i);if(Math.abs(c)<1e-7)return null;let l=o*o+a*a,u=i*i+s*s,f=(l*s-u*a)/c+n.x*I,m=(o*u-i*l)/c+n.y*I,h=Math.hypot(n.x*I-f,n.y*I-m);return h<1||h>200||!Number.isFinite(h)||t.some(d=>Math.abs(Math.hypot(d.x*I-f,d.y*I-m)-h)>.03)?null:{x:f,z:m,radius:h}}function br(t){let n=[],e=new Map,r=(c,l)=>`${Math.floor(c/yn)},${Math.floor(l/yn)}`;for(let c of t)for(let l of c.rows){for(let f of l.pts){let m=f.x*I,h=f.y*I,d=r(m,h),y=e.get(d)??[];y.push({x:m,z:h,y:l.y,floor:c.floorIndex}),e.set(d,y)}if(l.patch||l.pts.length<2)continue;let u=cc(l.pts);for(let f of[0,l.pts.length-1]){let m=l.pts[f],h=l.pts[f===0?1:f-1],d=m.x-h.x,y=m.y-h.y,b=Math.hypot(d,y);b<1e-6||n.push({sectionId:c.sectionId,floorIndex:c.floorIndex,curve:u,row:l,point:m,x:m.x*I,z:m.y*I,dx:d/b,dz:y/b})}}let o=new Map;n.forEach((c,l)=>{let u=r(c.x,c.z),f=o.get(u)??[];f.push(l),o.set(u,f)});let a=(c,l)=>{let u=Math.floor(c/yn),f=Math.floor(l/yn);return[-1,0,1].flatMap(m=>[-1,0,1].map(h=>`${u+m},${f+h}`))},i=new Map;n.forEach((c,l)=>{let u=-1,f=1/0,m=!1;for(let h of a(c.x,c.z))for(let d of o.get(h)??[]){let y=n[d];if(c.sectionId===y.sectionId&&c.row.blockId===y.row.blockId||c.floorIndex!==y.floorIndex||Math.abs(c.row.y-y.row.y)>.05)continue;let b=y.x-c.x,p=y.z-c.z,g=Math.hypot(b,p);if(g<Ut*2+.45||g>yn)continue;let P=c.curve&&y.curve&&Math.hypot(c.curve.x-y.curve.x,c.curve.z-y.curve.z)<=.05&&Math.abs(c.curve.radius-y.curve.radius)<=.05,_=Math.min((b*c.dx+p*c.dz)/g,(-b*y.dx-p*y.dz)/g);(P?_<.8:_<.98)||!P&&(Math.abs(b*c.dz-p*c.dx)>.15||Math.abs(b*y.dz-p*y.dx)>.15)||(g<f-.02?(u=d,f=g,m=!1):Math.abs(g-f)<=.02&&(m=!0))}u>=0&&!m&&i.set(l,u)});let s=[];for(let[c,l]of i){if(c>=l||i.get(l)!==c)continue;let u=n[c],f=n[l],m=Math.hypot(f.x-u.x,f.z-u.z),h=(f.x-u.x)/m,d=(f.z-u.z)/m,y=!1;for(let p of a((u.x+f.x)/2,(u.z+f.z)/2))for(let g of e.get(p)??[]){if(g.floor!==u.floorIndex||Math.abs(g.y-u.row.y)>.75)continue;let P=(g.x-u.x)*h+(g.z-u.z)*d,_=Math.abs((g.x-u.x)*d-(g.z-u.z)*h);P>.01&&P<m-.01&&_<dn+Ut&&(y=!0)}if(y)continue;let b=(p,g)=>({x:(u.x+h*p-d*g)/I,y:(u.z+d*p+h*g)/I});s.push({sections:[u.sectionId,f.sectionId],blocks:[u.row.blockId,f.row.blockId],floorIndex:u.floorIndex,ends:[u.point,f.point],clearWidthM:m-2*Ut,heightM:(u.row.y+f.row.y)/2,outline:[b(Ut,-dn),b(m-Ut,-dn),b(m-Ut,dn),b(Ut,dn)]})}return s}var lc=.15,uc=.9,fc=1.76;function gr(t){return!!t&&t[0]*.2126+t[1]*.7152+t[2]*.0722>.55?{zenith:[.36,.58,.84],horizon:[.82,.88,.94]}:{zenith:[.05,.08,.15],horizon:[.3,.38,.5]}}function mc(){return{background:{top:[...Zn.top],bottom:[...Zn.bottom]},sky:gr(null),structure:Vn,seatStates:{...Ve},seatScale:1,materials:{seat:null,shell:null,roughness:.78}}}function hc(t){return!!t&&t[0]*.2126+t[1]*.7152+t[2]*.0722>.55?{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87}:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87}}function Mr(t){let n=mc();t??={};let e=it(t.background);if(e){n.background={top:V(e,uc),bottom:V(e,fc)},n.sky=gr(e);let s={};for(let[l,u]of Object.entries(Vn))s[l]=st(u,e,lc);e[0]*.2126+e[1]*.7152+e[2]*.0722>.55&&(s.ground=V(e,.86)),n.structure=s}let r=it(t.selectionColor)??it(t.accent);r&&(n.seatStates={...n.seatStates,selected:r});let o=t.seatScale;typeof o=="number"&&Number.isFinite(o)&&(n.seatScale=Ue(o));let a=Object.fromEntries(Object.entries(t.venue3d??{}).filter(([,s])=>s!=null)),i={...hc(e),...a};if(i){let s=it(i.deck),c=it(i.fascia);s&&(n.structure={...n.structure,tierTop:s,gaTop:s}),c&&(n.structure={...n.structure,tierWall:c,gaWall:c}),n.materials.seat=it(i.seat),n.materials.shell=it(i.shell),typeof i.roughness=="number"&&Number.isFinite(i.roughness)&&(n.materials.roughness=Math.min(1,Math.max(0,i.roughness)))}return n}function Pr(t,n){let e=[];for(let r of n)e.push(...t.seatStates[r]);return e}var ge=.6,Rr=3,yc=.25;function dc(t,n){if(xt(n,t.x,t.y))return 0;let e=1/0;for(let r=0,o=n.length-1;r<n.length;o=r++){let a=n[o],i=n[r],s=i.x-a.x,c=i.y-a.y,l=s*s+c*c||1,u=Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*c)/l));e=Math.min(e,Math.hypot(t.x-(a.x+u*s),t.y-(a.y+u*c)))}return e}function Ir(t,n){let e=t.map(i=>({booth:i,ring:wt(i)})).filter(i=>!!i.ring&&i.ring.length===4&&!i.booth.points),r=e.map(({ring:i})=>({minX:Math.min(...i.map(s=>s.x)),maxX:Math.max(...i.map(s=>s.x)),minY:Math.min(...i.map(s=>s.y)),maxY:Math.max(...i.map(s=>s.y))})),o=(Rr+ge)/I,a=new Map;return e.forEach(({booth:i,ring:s},c)=>{let l={x:s.reduce((h,d)=>h+d.x,0)/4,y:s.reduce((h,d)=>h+d.y,0)/4},u=[0,1,2,3].map(h=>{let d=s[h],y=s[(h+1)%4],b={x:(d.x+y.x)/2,y:(d.y+y.y)/2},p=b.x-l.x,g=b.y-l.y,P=Math.hypot(p,g)||1,_={x:b.x+p/P*ge/I,y:b.y+g/P*ge/I},M=Rr/I;return r.forEach((x,A)=>{A===c||_.x<x.minX-o||_.x>x.maxX+o||_.y<x.minY-o||_.y>x.maxY+o||(M=Math.min(M,dc(_,e[A].ring)))}),{open:M*I,toward:{x:b.x+p/P*10/I,y:b.y+g/P*10/I},focal:Math.hypot(b.x-n.x,b.y-n.y)}}),f=Math.max(...u.map(h=>h.open)),m=u.filter(h=>h.open>=f-yc).sort((h,d)=>h.focal-d.focal)[0];a.set(i.id,m.toward)}),a}import pc from"polygon-clipping";var xc=.45,bc=1500,gc=200;function Sr(t,n){if(t.role!=="stage"||Kt(t.stageKind))return t;let e=ct(t);if(!e||e.length<3||Math.abs(pt(e))*I*I>bc)return t;let r=n.filter(i=>xt(e,i.x,i.y));if(!r.length||r.length>gc)return t;let o=xc/I,a=r.map(i=>[[[i.x-o,i.y-o],[i.x+o,i.y-o],[i.x+o,i.y+o],[i.x-o,i.y+o],[i.x-o,i.y-o]]]);try{let i=pc.difference([[...e.map(l=>[l.x,l.y]),[e[0].x,e[0].y]]],...a),s=null,c=0;for(let l of i){let u=l[0].slice(0,-1).map(([m,h])=>({x:m,y:h})),f=Math.abs(pt(u));f>c&&(c=f,s=u)}return!s||s.length<3?t:{...t,kind:"polygon",points:s,rotation:0}}catch{return t}}function Me(t,n,e,r,o,a,i,s,c,l=[],u=o){if(n.length!==e.length||n.length<2||a-o<1.5)return;let f=(y,b,p)=>{Ot(t,y,b,p,l,i,s,{portalBase:u,ao:c})||Z(t,y,void 0,()=>p,b,i,s,c)},m=(y,b,p)=>({x:y.x+(b.x-y.x)*p,y:y.y+(b.y-y.y)*p}),h=r?n.length:n.length-1,d=0;for(let y=0;y<h;y++){let b=(y+1)%n.length,p=Math.hypot(e[b].x-e[y].x,e[b].y-e[y].y)*$;if(p<1e-5)continue;let g=(x,A)=>[m(n[y],n[b],x),m(n[y],n[b],A),m(e[y],e[b],A),m(e[y],e[b],x)];f(g(0,1),o,o+.95),f(g(0,1),a-.22,a);let P=Math.ceil((d-.32)/6)*6,_=!1,M=!1;for(let x=P;x<d+p;x+=6){let A=Math.max(0,(x-d)/p),R=Math.min(1,(x+.32-d)/p);R<=A||(f(g(A,R),o+.95,a-.22),_||=A<1e-6,M||=R>1-1e-6)}if(!r&&(y===0&&!_||y===h-1&&!M)){let x=Math.min(1,.32/p);f(g(y===0?0:1-x,y===0?x:1),o+.95,a-.22)}d+=p}}import Wt from"polygon-clipping";var xn=.65;function Pe(t,n){let e=1/0;for(let r of n)for(let o=0;o<r.length;o++){let a=r[o],i=r[(o+1)%r.length],s=i.x-a.x,c=i.y-a.y,l=Math.max(0,Math.min(1,((t.x-a.x)*s+(t.y-a.y)*c)/(s*s+c*c||1)));e=Math.min(e,Math.hypot(t.x-a.x-l*s,t.y-a.y-l*c))}return e}var Re=.01;function _r(t,n,e,r,o,a,i,s=[],c=!0,l={bays:[],walls:[]}){if(r-o<=1e-5)return;let u=r-o>=3,f=u?r-xn:o;t.setMaterial(5);let m=u?[]:s.filter(x=>{if(x.role!=="entrance"&&x.role!=="exit")return!1;let A=ct(x);if(!A)return!1;let R=$t(A,o,o+At(x).heightM);return R!==null&&R.openingTop<=r-.12});if((!m.length||!Ot(t,n,f,r,m,a,i,{holes:e,portalBase:o}))&&Z(t,n,e,()=>r,f,a,i,K,void 0,()=>[0,1,0]),!u){t.setMaterial(0);return}let h=c&&l.bays.length?Mc(n,e,Lt(n,pn/I),l):null,d=6/I,y=.22/I,b=s.flatMap(x=>{if(x.role!=="entrance"&&x.role!=="exit")return[];let A=ct(x);return A?.length?[{minX:Math.min(...A.map(R=>R.x)),maxX:Math.max(...A.map(R=>R.x)),minY:Math.min(...A.map(R=>R.y)),maxY:Math.max(...A.map(R=>R.y))}]:[]}),p=Math.min(...n.map(x=>x.x)),g=Math.max(...n.map(x=>x.x)),P=Math.min(...n.map(x=>x.y)),_=Math.max(...n.map(x=>x.y));for(let x=p+d/2;x<g;x+=d)for(let A=P+d/2;A<_;A+=d){if(b.some(S=>x+y>=S.minX&&x-y<=S.maxX&&A+y>=S.minY&&A-y<=S.maxY))continue;let R=[{x:x-y,y:A-y},{x:x+y,y:A-y},{x:x+y,y:A+y},{x:x-y,y:A+y}];!Rt({x,y:A},n,e)||Pe({x,y:A},[n,...e??[]])<y*Math.SQRT2+(c?pn/I:0)||h&&Pe({x,y:A},h.flat())<y*Math.SQRT2+pn/I||Z(t,R,void 0,()=>f,o,a,i,K)}if(h){for(let[x,...A]of h)Z(t,x,A,()=>f,o-Re,a,i,K);t.setMaterial(0);return}let M=Lt(n,pn/I);if(c&&M.length>=3){let x=s.filter(S=>{if(S.role!=="entrance"&&S.role!=="exit")return!1;let E=ct(S);return!!E&&E.some(T=>!Rt(T,n,void 0)||Pe(T,[n])<=pn/I)}),A=[M.slice().reverse()],R=o-Re;(!x.length||!Ot(t,n,R,f,x,a,i,{holes:A,portalBase:o+Re}))&&Z(t,n,A,()=>f,R,a,i,K)}t.setMaterial(0)}var Ie=.25,pn=Ie;function Mc(t,n,e,r){if(e.length<3)return null;let o=i=>{let s=i.map(c=>[c.x,c.y]);return s.push(s[0]),s},a=i=>{let[s,...c]=i.map(l=>[o(l)]);return Wt.union(s,...c)};try{let i=[o(t),...(n??[]).map(o)],s=Wt.difference(i,[o(e)]),c=Wt.intersection(i,a(r.bays));if(!c.length)return null;let l=Wt.difference(Wt.intersection(i,a(r.walls)),c);return Wt.union(Wt.difference(s,c),l).map(f=>f.map(m=>m.slice(0,-1).map(([h,d])=>({x:h,y:d}))))}catch{return null}}var Pc=.02,Rc=.25,Ic=1.2,Sc=.6,_c=.45,Ac=2.3,wc=Math.PI/180,Ar=.005;function Bt(t,n,e){let r=e*wc;return{x:t.x+n*Math.sin(r),y:t.y+n*Math.cos(r)}}function Ec(t,n){let e=n.rings[n.rings.length-1];if(!e)return!1;let r=e.outerRMedian*.85;for(let o of t){if(o.role!=="wall")continue;let a=o.points&&o.points.length>=2?o.points:o.x!==void 0&&o.y!==void 0&&o.width!==void 0&&o.height!==void 0?[{x:o.x,y:o.y},{x:o.x+o.width,y:o.y},{x:o.x+o.width,y:o.y+o.height},{x:o.x,y:o.y+o.height}]:[];if(a.length<2)continue;let i=0;for(let s of a)Math.hypot(s.x-n.centre.x,s.y-n.centre.y)>=r&&i++;if(i>=a.length/2)return!0}return!1}var Bc=24,Tc=.01;function Oc(t,n,e,r,o,a,i,s,c){let l=e.binCount,u=Bc,f=$,m=a+.02,h=a-Tc,d=[];for(let w=0;w<l;w++){let B=(e.startBin+w+.5)*n.binStepDeg,C=new Float64Array(u+1);for(let L=0;L<=u;L++){let O=r[w]+(o[w]-r[w])*L/u;C[L]=Math.max(m,ze(n,e,B,O)-Rc)}d.push(C)}if(c){let w=0;for(let B=0;B+1<l;B++)for(let C=0;C<u;C++){let L=Bt(n.centre,r[B]+(o[B]-r[B])*C/u,(e.startBin+B+.5)*n.binStepDeg),O=Bt(n.centre,r[B+1]+(o[B+1]-r[B+1])*(C+1)/u,(e.startBin+B+1.5)*n.binStepDeg);w=Math.max(w,Math.hypot(O.x-L.x,O.y-L.y))}for(let B=0;B<l;B++){let C=(e.startBin+B+.5)*n.binStepDeg;for(let L=0;L<=u;L++){let O=Bt(n.centre,r[B]+(o[B]-r[B])*L/u,C),D=c(O.x,O.y,w*1.01);D!==null&&(d[B][L]=Math.min(d[B][L],Math.max(h+Ar,D-Ar)))}}}let y=[i.bandTop[0]*s.top,i.bandTop[1]*s.top,i.bandTop[2]*s.top],b=[i.bandTop[0]*s.bottomCap,i.bandTop[1]*s.bottomCap,i.bandTop[2]*s.bottomCap],p=[i.bandWall[0]*s.top,i.bandWall[1]*s.top,i.bandWall[2]*s.top],g=[i.bandWall[0]*s.wallBottom,i.bandWall[1]*s.wallBottom,i.bandWall[2]*s.wallBottom],P=(w,B)=>{let C=(e.startBin+w+.5)*n.binStepDeg,L=r[w]+(o[w]-r[w])*B/u,O=Bt(n.centre,L,C);return[O.x*f,d[w][B],O.y*f]};{let w=Math.tan(12*Math.PI/180);for(let B=0;B<6;B++){let C=!1;for(let O=0;O<l;O++)for(let D=u-1;D>=0;D--)d[O][D]>d[O][D+1]&&(d[O][D]=d[O][D+1],C=!0);let L=e.closed?l:l-1;for(let O=0;O<L;O++){let D=(O+1)%l;for(let H=0;H<=u;H++){let j=d[D][H]-d[O][H];if(Math.abs(j)>1)continue;let G=r[O]+(o[O]-r[O])*H/u,U=r[D]+(o[D]-r[D])*H/u,X=Bt(n.centre,G,(e.startBin+O+.5)*n.binStepDeg),Y=Bt(n.centre,U,(e.startBin+D+.5)*n.binStepDeg),nt=w*Math.hypot(Y.x-X.x,Y.y-X.y)*f;j>nt?(d[D][H]=d[O][H]+nt,C=!0):-j>nt&&(d[O][H]=d[D][H]+nt,C=!0)}}if(!C)break}}let _=1,M=(w,B)=>{for(let C=0;C<=u;C+=4)if(Math.abs(d[w][C]-d[B][C])>_)return!0;return Math.abs(d[w][u]-d[B][u])>_},x=Math.tan(38*Math.PI/180),A=w=>(o[w]-r[w])/u*f,R=(w,B)=>d[w][B+1]-d[w][B]>x*Math.max(1e-6,A(w)),S=(w,B)=>{let C=e.closed?(w-1+l)%l:Math.max(0,w-1),L=e.closed?(w+1)%l:Math.min(l-1,w+1);Math.abs(d[C][B]-d[w][B])>_&&(C=w),Math.abs(d[L][B]-d[w][B])>_&&(L=w);let O=Math.max(0,B-1),D=Math.min(u,B+1);O<B&&R(w,O)&&(O=B),D>B&&R(w,B)&&(D=B);let H=P(C,B),j=P(L,B),G=P(w,O),U=P(w,D),X=j[0]-H[0],Y=j[1]-H[1],nt=j[2]-H[2],rt=U[0]-G[0],q=U[1]-G[1],Q=U[2]-G[2],J=Y*Q-nt*q,N=nt*rt-X*Q,v=X*q-Y*rt,W=Math.hypot(J,N,v);return W>1e-12?(J/=W,N/=W,v/=W,N<0&&(J=-J,N=-N,v=-v),[J,N,v]):[0,1,0]},E=(w,B,C=!1)=>{let L=C&&Math.min(w[1],B[1])-a>=3,O=[w[0],L?w[1]-xn:h,w[2]],D=[B[0],L?B[1]-xn:h,B[2]],H=B[0]-w[0],j=B[2]-w[2],G=Math.hypot(H,j);if(!(G>1e-12))return;let U=[j/G,0,-H/G];t.tri(w,B,D,U,p,p,g),t.tri(w,D,O,U,p,g,g)},T=.05*Pt,F=w=>o[w]-r[w]<T,k=e.closed?l:l-1;for(let w=0;w<k;w++){let B=(w+1)%l;if(F(w)||F(B))continue;if(M(w,B)){let j=(e.startBin+w+1)*n.binStepDeg,G=(q,Q)=>{let J=(r[w]+r[B])/2,N=(o[w]+o[B])/2,v=J+(N-J)*Q/u,W=Bt(n.centre,v,j);return[W.x*f,d[q][Q],W.y*f]};for(let q=0;q<u;q++){let Q=P(w,q),J=P(w,q+1),N=G(w,q),v=G(w,q+1),W=S(w,q),lt=S(w,q+1);t.triN(Q,N,v,W,W,lt,y),t.triN(Q,v,J,W,lt,lt,y);let ft=P(B,q),at=P(B,q+1),tt=G(B,q),et=G(B,q+1),ht=S(B,q),z=S(B,q+1);t.triN(tt,ft,at,ht,ht,z,y),t.triN(tt,at,et,ht,z,z,y);let mt=G(w,q),yt=G(w,q+1),Gt=G(B,q+1),Ht=G(B,q),kt=yt[0]-mt[0],Ft=yt[2]-mt[2],en=Math.hypot(kt,Ft);if(en>1e-12){let bn=[Ft/en,0,-kt/en];t.tri(mt,yt,Gt,bn,p),t.tri(mt,Gt,Ht,bn,p)}}let U=P(w,0),X=P(B,0),Y=P(B,u),nt=P(w,u),rt=q=>[q[0],h,q[2]];Math.min(U[1],X[1])-a<3&&(t.tri(rt(U),rt(Y),rt(X),[0,-1,0],b),t.tri(rt(U),rt(nt),rt(Y),[0,-1,0],b)),E(U,X,!0),E(nt,Y,!0);continue}for(let j=0;j<u;j++){let G=S(w,j),U=S(B,j),X=S(B,j+1),Y=S(w,j+1);if(R(w,j)||R(B,j)){let J=(yt,Gt)=>{let Ht=(e.startBin+yt+.5)*n.binStepDeg,kt=r[yt]+(o[yt]-r[yt])*(j+.5)/u,Ft=Bt(n.centre,kt,Ht);return[Ft.x*f,Gt,Ft.y*f]},N=P(w,j),v=P(B,j),W=J(w,d[w][j]),lt=J(B,d[B][j]);t.triN(N,v,lt,G,U,U,y),t.triN(N,lt,W,G,U,G,y);let ft=P(B,j+1),at=P(w,j+1),tt=J(w,d[w][j+1]),et=J(B,d[B][j+1]);t.triN(tt,et,ft,Y,X,X,y),t.triN(tt,ft,at,Y,X,Y,y);let ht=lt[0]-W[0],z=lt[2]-W[2],mt=Math.hypot(ht,z);if(mt>1e-12){let yt=[-z/mt,0,ht/mt];t.tri(W,lt,et,yt,p),t.tri(W,et,tt,yt,p)}continue}let nt=P(w,j),rt=P(B,j),q=P(B,j+1),Q=P(w,j+1);t.triN(nt,rt,q,G,U,X,y),t.triN(nt,q,Q,G,X,Y,y)}let C=P(w,0),L=P(B,0),O=P(B,u),D=P(w,u),H=j=>[j[0],h,j[2]];Math.min(C[1],L[1])-a<3&&(t.tri(H(C),H(O),H(L),[0,-1,0],b),t.tri(H(C),H(D),H(O),[0,-1,0],b)),E(C,L,!0),E(D,O,!0)}if(!e.closed)for(let w of[0,l-1])for(let B=0;B<u;B++)E(P(w,B),P(w,B+1))}function wr(t,n,e){let{bottomY:r,colors:o,ao:a}=e,i=new Float64Array(n.binCount).fill(-1/0);for(let u of n.rings)for(let f of u.arcs){let m=new Float64Array(f.binCount),h=new Float64Array(f.binCount);for(let y=0;y<f.binCount;y++){let b=(f.startBin+y)%n.binCount,p=Math.max(0,f.innerR[y]-It);m[y]=Math.max(p,i[b]+.001),h[y]=Math.max(m[y]+.001,f.outerR[y]+It)}let d=0;for(let y=0;y<f.binCount;y++){let b=f.topLevelM[y]-r;b>d&&(d=b)}d>=Ic&&Oc(t,n,f,m,h,r,o,a,e.standTopNear);for(let y=0;y<f.binCount;y++){let b=(f.startBin+y)%n.binCount;h[y]>i[b]&&(i[b]=h[y])}}if(e.deriveShell===!1||Ec(e.shapes,n))return;let s=n.rings[n.rings.length-1],c=Sc*Pt,l=_c*Pt;for(let u of s.arcs){let f=[],m=[];for(let S=0;S<u.binCount;S++){let E=(u.startBin+S+.5)*n.binStepDeg,T=u.outerR[S]+It+c;f.push(Bt(n.centre,T,E)),m.push(Bt(n.centre,T+l,E))}let h=-1/0;for(let S=0;S<u.binCount;S++)u.topLevelM[S]>h&&(h=u.topLevelM[S]);let d=h+Ac,y=u.closed?m:[...m,...f.slice().reverse()],b=u.closed?[f.slice().reverse()]:void 0,p=st(o.shellWall,[.66,.71,.72],.62),g=(S,E,T,F,k)=>{let w=Math.abs(F-h)<1e-6?F-Pc:F;Ot(t,S,T,w,e.shapes,o.shellTop,k,{holes:E,portalBase:r,ao:a})||Z(t,S,E,()=>w,T,o.shellTop,k,a)},P=Math.max(1,Math.ceil((h-r)/4.5)),_=(h-r)/P,M=new Set,x=e.tierFrontLevels??n.rings.map(S=>{let E=S.arcs.flatMap(T=>Array.from(T.frontLevelM)).filter(Number.isFinite).sort((T,F)=>T-F);return E[Math.floor(E.length/2)]});for(let S of x)Number.isFinite(S)&&S-r>=3&&S<h&&M.add(Math.max(0,Math.min(P-1,Math.floor((S-r)/_))));let A=Math.min(...x.filter(S=>Number.isFinite(S)&&S-r>=3&&S<h));for(let S=0;S<P;S++)r+(S+1)*_<=A-xn&&Number.isFinite(A)&&M.add(S);for(let S=0;S<P;S++){let E=r+(h-r)*S/P,T=r+(h-r)*(S+1)/P;M.has(S)&&T-E>=3.2?(g(y,b,E,E+.45,p),Me(t,f,m,u.closed,E+.45,T-.16,o.shellTop,p,a,e.shapes,r)):g(y,b,E,T-.16,p),g(y,b,T-.16,T,V(p,.62))}Me(t,f,m,u.closed,h,d,o.shellTop,p,a,e.shapes,r);let R=8;for(let S=1;S<m.length;S++){if(R+=Math.hypot(m[S].x-m[S-1].x,m[S].y-m[S-1].y)*$,R<8)continue;R=0;let E=m[S],T=m[S-1],F=E.x-T.x,k=E.y-T.y,w=Math.max(1,Math.hypot(F,k)),B=F/w*.16*Pt,C=k/w*.16*Pt,L=Math.max(1,Math.hypot(E.x-n.centre.x,E.y-n.centre.y)),O=(E.x-n.centre.x)/L*.24*Pt,D=(E.y-n.centre.y)/L*.24*Pt,H=[{x:E.x-B,y:E.y-C},{x:E.x+B,y:E.y+C},{x:E.x+B+O,y:E.y+C+D},{x:E.x-B+O,y:E.y-C+D}];g(H,void 0,r,h,V(p,1.12))}}}var Cc=2.5,Er=.65,kc=2,Fc=.03;function Lc(t,n){let e=()=>{let r=n;for(;t.length>2;){let o=t[0],a=t[1],i=Math.hypot(a.x-o.x,a.y-o.y);if(i>r){t[0]={x:o.x+(a.x-o.x)/i*r,y:o.y+(a.y-o.y)/i*r};return}r-=i,t.shift()}};e(),t.reverse(),e(),t.reverse()}function Ae(t,n,e){let r=new Map;for(let a of t){let i=r.get(a.blockId);(!i||a.depth<i.depth)&&r.set(a.blockId,a)}let o=[];for(let[a,i]of r){if(i.y-e<Cc||i.pts.length<2)continue;let s=i.pts.map(u=>{let f=u.x-n.x,m=u.y-n.y,h=Math.max(1,Math.hypot(f,m));return{x:u.x-f/h*Er/I,y:u.y-m/h*Er/I}}),c=[],l=[s[0]];for(let u=1;u<s.length;u++){let f=s[u-1],m=s[u];Math.hypot(m.x-f.x,m.y-f.y)*I>kc?(l.length>=2&&c.push(l),l=[m]):l.push(m)}l.length>=2&&c.push(l);for(let u of c)Lc(u,Fc/I);c.length&&o.push({blockId:a,y:i.y,runs:c})}return o}var Br=.1,Nc=1.1,vc=.22,Se=.95,_e=.05,Tr=1.8;function Or(t,n,e,r){let o=[.72,.72,.69],a=[.48,.55,.57];for(let i of Ae(n,e,r)){let s=i.y;for(let c of i.runs){let l=Tr;for(let u=1;u<c.length;u++){let f=c[u-1],m=c[u],h=m.x-f.x,d=m.y-f.y,y=Math.hypot(h,d);if(y<1e-5)continue;let b=p=>{let g=-d/y*p/I/2,P=h/y*p/I/2;return[{x:f.x+g,y:f.y+P},{x:m.x+g,y:m.y+P},{x:m.x-g,y:m.y-P},{x:f.x-g,y:f.y-P}]};if(Z(t,b(vc),void 0,()=>s+Br,s-Nc,o,o,K),Z(t,b(_e),void 0,()=>s+Se,s+Se-_e,a,a,K),l+=y*I,l>=Tr||u===c.length-1){l=0;let p=.028/I,g=[{x:f.x-p,y:f.y-p},{x:f.x+p,y:f.y-p},{x:f.x+p,y:f.y+p},{x:f.x-p,y:f.y+p}];Z(t,g,void 0,()=>s+Se-_e,s+Br,a,a,K)}}}}}var Dc=.9,Gc=1.5,Hc=.3;function Cr(t,n,e){let r=[],o=[],a=Dc/I,i=Gc/I,s=Hc/I;for(let c of t)for(let l of c.runs){if(l.length<2)continue;let u=l.slice(),f=(b,p)=>{let g=u[b],P=u[p],_=Math.hypot(g.x-P.x,g.y-P.y)||1;u[b]={x:g.x+(g.x-P.x)/_*s,y:g.y+(g.y-P.y)/_*s}};f(0,1),f(u.length-1,u.length-2);let m=u.map((b,p)=>{let g=u[Math.max(0,p-1)],P=u[Math.min(u.length-1,p+1)],_=P.x-g.x,M=P.y-g.y,x=Math.hypot(_,M)||1,A=-M/x,R=_/x;return A*(b.x-n.x)+R*(b.y-n.y)<0&&(A=-A,R=-R),{nx:A,ny:R}}),h=u.map((b,p)=>({x:b.x-m[p].nx*i,y:b.y-m[p].ny*i})),d=u.map((b,p)=>({x:b.x+m[p].nx*a,y:b.y+m[p].ny*a})),y=u.map((b,p)=>({x:b.x+m[p].nx*(a+e/I),y:b.y+m[p].ny*(a+e/I)}));r.push([...h,...d.slice().reverse()]),o.push([...d,...y.reverse()])}return{bays:r,walls:o}}var we=.88,Wn=.27,Xc=1.2,jc=.01;function kr(t,n,e,r,o){let a=[.67,.71,.68],i=[a[0]*we,a[1]*we,a[2]*we],s=c=>!!o&&o.some((l,u)=>u!==c&&l?.belowY!=null&&Math.abs(l.belowY-n[c].y)<1e-6&&n[u].blockId===n[c].blockId);for(let c=0;c<n.length;c++){let l=n[c];if(!(l.pts.length<2))for(let u of[0,l.pts.length-1]){let f=l.pts[u],m=l.pts[u===0?1:u-1],h=f.x-m.x,d=f.y-m.y,y=Math.hypot(h,d);if(y<1e-5)continue;h/=y,d/=y;let b=1/0;for(let B=0;B<e.length;B++){let C=e[B],L=e[(B+1)%e.length],O=L.x-C.x,D=L.y-C.y,H=h*D-d*O;if(Math.abs(H)<1e-8)continue;let j=C.x-f.x,G=C.y-f.y,U=(j*D-G*O)/H,X=(j*d-G*h)/H;U>0&&X>=0&&X<=1&&(b=Math.min(b,U))}let p=.3/I,g=b-.04/I;if(!Number.isFinite(b)||b*I>2||g-p<.12/I)continue;let P=!!r&&s(c),_=o?.[c]?.pitch,M=P&&_&&Number.isFinite(_)?Math.min(Xc/I,Math.max(Wn/I,_-Wn/I-jc/I)):Wn/I,x=-d,A=h;r&&x*(r.x-f.x)+A*(r.y-f.y)<0&&(x=-x,A=-A);let R=Wn/I,S=[{x:f.x+h*p+x*R,y:f.y+d*p+A*R},{x:f.x+h*g+x*R,y:f.y+d*g+A*R},{x:f.x+h*g-x*M,y:f.y+d*g-A*M},{x:f.x+h*p-x*M,y:f.y+d*p-A*M}];if(!S.every(B=>xt(e,B.x,B.y)))continue;let E=o?.[c]?.belowY,T=E==null?0:l.y-E,F=!!r&&T>.03&&T<=.65;if(F&&r){let B=(C,L)=>Math.hypot((C.x+L.x)/2-r.x,(C.y+L.y)/2-r.y);B(S[0],S[1])>B(S[3],S[2])&&(S=[S[3],S[2],S[1],S[0]])}let k=F?Math.ceil((T-1e-8)/.2):1,w=(B,C,L)=>({x:B.x+(C.x-B.x)*L,y:B.y+(C.y-B.y)*L});for(let B=0;B<k;B++){let C=B/k,L=(B+1)/k,O=[w(S[0],S[3],C),w(S[1],S[2],C),w(S[1],S[2],L),w(S[0],S[3],L)],D=l.y+.008-(F?T*(1-L):0);Z(t,O,void 0,()=>D,D-(F?T/k+.1:.16),a,i,K)}}}}var Uc=.02,Wc=.012,Yc=.01,zc=.3,Kc=.5;function Vc(t,n,e){if(t.length===1)return Math.hypot(n-t[0].x,e-t[0].y);let r=1/0;for(let o=0;o+1<t.length;o++){let a=t[o],i=t[o+1],s=i.x-a.x,c=i.y-a.y,l=s*s+c*c,u=l>1e-12?((n-a.x)*s+(e-a.y)*c)/l:0;u=Math.max(0,Math.min(1,u)),r=Math.min(r,Math.hypot(n-(a.x+u*s),e-(a.y+u*c)))}return r}function Zc(t,n,e,r){let o=1/0,a=Number.NaN;for(let i=0;i<t.length;i++){let s=n[i];if(Math.hypot(e-s.cx,r-s.cy)-s.rad>=o)continue;let c=Vc(t[i].pts,e,r);c<o&&(o=c,a=t[i].y)}return a}function Fr(t,n,e,r,o,a,i){let s=r.filter(m=>m.pts.length>0);if(s.length<2||n.length<3)return;let c=s.map(m=>{let h=0,d=0;for(let b of m.pts)h+=b.x,d+=b.y;h/=m.pts.length,d/=m.pts.length;let y=0;for(let b of m.pts)y=Math.max(y,Math.hypot(b.x-h,b.y-d));return{cx:h,cy:d,rad:y}}),l=[...n],u=e.map(m=>[...m]),f=Uc/I;for(let m of[l,...u])for(let h=0;h<m.length;h++){let d=m[h],y=m[(h+1)%m.length],b=y.x-d.x,p=y.y-d.y,g=Math.hypot(b,p);if(g*I<.05)continue;let P=(d.x+y.x)/2,_=(d.y+y.y)/2,M=p/g,x=-b/g;Rt({x:P+M*f,y:_+x*f},l,u)&&(M=-M,x=-x);let A=o.x-P,R=o.y-_,S=Math.hypot(A,R)||1;if((M*A+x*R)/S>Kc)continue;let E=1/0;for(let O of[.2,.5,.8]){let D=Zc(s,c,d.x+b*O-M*f*2,d.y+p*O-x*f*2);Number.isFinite(D)&&(E=Math.min(E,D))}if(!Number.isFinite(E)||E-a<zc)continue;let T=a-Yc,F=E-Wc,k={x:(d.x-M*f)*I,z:(d.y-x*f)*I},w={x:(y.x-M*f)*I,z:(y.y-x*f)*I},B=[M,0,x],C=V(i,K.wallBottom),L=V(i,K.top);t.tri([k.x,F,k.z],[w.x,F,w.z],[w.x,T,w.z],B,L,L,C),t.tri([k.x,F,k.z],[w.x,T,w.z],[k.x,T,k.z],B,L,C,C)}}function Lr(t,n,e,r,o,a,i,s,c=!1){if(!n.outline||n.outline.length<3)return;let l=e.baseHeightM,u=e.objects.filter(g=>g.type==="shape"&&(g.role==="entrance"||g.role==="exit")),f=oo(r,s.tierTop);if(!o)return;let m=g=>o.deckAt(g.x,g.y),h=Po(n,i),d=h[0]??n.outline;if(o.rowLevels.length>=2){let g=Bn(o.rowLevels),P=Ro(yo(o.rowLevels,e.focal,g),h),_=Cr(Ae(o.rowLevels,e.focal,l),e.focal,Ie);for(let x of P){let A=Math.max(l,x.topY-Nr);for(let R of a.subtract(x.outline,A))_r(t,R,x.holes,A,l,s.tierTop,s.tierWall,u,!c,_);t.setMaterial(5),Fr(t,x.outline,x.holes,o.rowLevels,e.focal,A,s.tierWall),t.setMaterial(0)}P.length||Z(t,d,n.holes,()=>o.landingY,l,f,s.tierWall,K);let M={tread:[f[0]*K.top,f[1]*K.top,f[2]*K.top],riser:[f[0]*.72,f[1]*.72,f[2]*.72]};for(let x of h.length?h:[d])xo(t,o.rowLevels,e.focal,o.landingY,M,x,g);Or(t,o.rowLevels,e.focal,l),kr(t,o.rowLevels,n.outline,e.focal,g);return}let y=o.flat?1/0:Ho,b=g=>o.normalAt(g.x,g.y),p=o.flat?o.landingY:void 0;for(let g of a.subtract(d,p))Z(t,g,n.holes,m,l,f,s.tierWall,K,y,b)}function qc(t,n,e){let r=new Set;for(let i of t.objects)i.type==="section"&&r.add(i.id);let o=new Map;for(let i=0;i<n.length;i++){let s=e.seatOwner[i];if(!s||!r.has(s))continue;let c=e.bySection.get(s);if(c&&c.rowLevels.length>=2)continue;let l=n[i];if(l.kind==="booth")continue;let u=o.get(s);u||(u=new Map,o.set(s,u));let f=l.rowId||`__seat-${i}`,m=u.get(f);m||(m={pts:[],levelM:0,n:0},u.set(f,m)),m.pts.push({x:l.x,y:l.y}),m.levelM+=e.seatDeckY(i),m.n++}let a=[];for(let i of t.objects){if(i.type!=="section")continue;let s=e.bySection.get(i.id);if(s&&s.rowLevels.length>=2){let l=s.rowLevels.filter(u=>!u.patch).map(u=>({pts:u.pts,levelM:u.y}));l.length>=2&&a.push({sectionId:i.id,rows:l});continue}let c=o.get(i.id);c&&a.push({sectionId:i.id,rows:[...c.values()].map(l=>({pts:l.pts,levelM:l.levelM/l.n}))})}return a}function $c(t,n){let e=1/0;for(let r=0;r<n.length;r++){let o=n[r],a=n[(r+1)%n.length],i=a.x-o.x,s=a.y-o.y,c=Math.max(0,Math.min(1,((t.x-o.x)*i+(t.y-o.y)*s)/(i*i+s*s||1)));e=Math.min(e,Math.hypot(t.x-o.x-c*i,t.y-o.y-c*s))}return e}var Nr=.02;function Qc(t,n){let e=t.objects.filter(r=>r.type==="section"&&!!r.outline&&r.outline.length>=3).flatMap(r=>{let o=n.bySection.get(r.id);if(!o)return[];let a=1/0,i=-1/0,s=1/0,c=-1/0;for(let u of r.outline)u.x<a&&(a=u.x),u.x>i&&(i=u.x),u.y<s&&(s=u.y),u.y>c&&(c=u.y);let l=o.landingY;for(let u of o.rowLevels)l=Math.min(l,u.y-Nr);return[{outline:r.outline,holes:r.holes,surface:o,floorTop:l,minX:a,maxX:i,minY:s,maxY:c}]});return(r,o,a)=>{let i=null;for(let s of e){if(r<s.minX-a||r>s.maxX+a||o<s.minY-a||o>s.maxY+a)continue;let c={x:r,y:o};if(!Rt(c,s.outline,s.holes)&&$c(c,s.outline)>a)continue;let l=Math.min(s.surface.deckAt(r,o),s.floorTop);(i===null||l<i)&&(i=l)}return i}}var Jc=3,tl=.4;function vr(t,n,e,r,o,a,i=!0){let s=qc(n,e,r);if(s.length<Jc)return;let c=Ye(s,n.focal);if(!c)return;let l=Math.max(0,...c.rings.map(u=>u.arcs.reduce((f,m)=>f+m.binCount,0)))/c.binCount;t.setMaterial(5),wr(t,c,{bottomY:n.baseHeightM,tierFrontLevels:s.map(u=>Math.min(...u.rows.map(f=>f.levelM))),colors:{bandTop:V(o.tierTop,.8),bandWall:o.tierWall,shellTop:a??V(o.tierWall,1.15),shellWall:a??o.tierWall},ao:K,shapes:n.objects.filter(u=>u.type==="shape"),deriveShell:i&&l>=tl,standTopNear:Qc(n,r)}),t.setMaterial(0)}function Dr(t){let{doc:n,units:e,seats:r,surfaces:o,solids:a,hintedSeatFloor:i,seatFloor:s}=t,c=[];{let l=e.map(()=>({minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0}));for(let m=0;m<a.floor.length;m+=1){let h=Math.max(0,Math.min(e.length-1,Math.round(a.floor[m]))),d=m*3,y=l[h];y.minX=Math.min(y.minX,a.position[d]),y.minY=Math.min(y.minY,a.position[d+1]),y.minZ=Math.min(y.minZ,a.position[d+2]),y.maxX=Math.max(y.maxX,a.position[d]),y.maxY=Math.max(y.maxY,a.position[d+1]),y.maxZ=Math.max(y.maxZ,a.position[d+2])}let u=new Map;for(let m=0;m<e.length;m++)for(let h of e[m].objects)h.type==="section"&&u.set(h.id,m);let f=e.map(()=>({n:0,minX:1/0,minY:1/0,minDeck:1/0,maxX:-1/0,maxY:-1/0,maxDeck:-1/0,sumX:0,sumDeck:0,sumZ:0}));for(let m=0;m<r.length;m++){let h=o.seatOwner[m],d=(h!==null?u.get(h):void 0)??i[m];if(d===void 0)continue;let y=f[d],b=r[m];y.n++,b.x<y.minX&&(y.minX=b.x),b.y<y.minY&&(y.minY=b.y),b.x>y.maxX&&(y.maxX=b.x),b.y>y.maxY&&(y.maxY=b.y);let p=o.seatDeckY(m);y.sumX+=b.x*I,y.sumDeck+=p,y.sumZ+=b.y*I,y.minDeck=Math.min(y.minDeck,p),y.maxDeck=Math.max(y.maxDeck,p+1.6),s[m]=d}for(let m=0;m<e.length;m++){let h=f[m],d=n.floors?.[m],y=l[m],b=Math.min(h.n?h.minX*I:e[m].focal.x*I-1,Number.isFinite(y.minX)?y.minX:1/0),p=Math.max(h.n?h.maxX*I:e[m].focal.x*I+1,Number.isFinite(y.maxX)?y.maxX:-1/0),g=Math.min(h.n?h.minY*I:e[m].focal.y*I-1,Number.isFinite(y.minZ)?y.minZ:1/0),P=Math.max(h.n?h.maxY*I:e[m].focal.y*I+1,Number.isFinite(y.maxZ)?y.maxZ:-1/0),_=Math.min(h.n?Math.min(e[m].baseHeightM,h.minDeck):e[m].baseHeightM,Number.isFinite(y.minY)?y.minY:1/0),M=Math.max(h.n?Math.max(h.maxDeck,_+.5):_+.5,Number.isFinite(y.maxY)?y.maxY:-1/0),x=[h.n?h.sumX/h.n:(b+p)/2,h.n?h.sumDeck/h.n:(_+M)/2,h.n?h.sumZ/h.n:(g+P)/2],A=Math.max(1,.5*Math.hypot(p-b,M-_,P-g));c.push({index:m,id:d?.id??`floor-${m}`,label:d?.name??(e.length>1?`Floor ${m+1}`:"Venue"),seatCount:h.n,center:x,radius:A,box:{min:[b,_,g],max:[p,M,P]},focalWorld:[e[m].focal.x*I,e[m].baseHeightM+1.5,e[m].focal.y*I]})}}return c}function Ee(t,n){let e=1/0,r=1/0,o=-1/0,a=-1/0,i=(s,c)=>{s<e&&(e=s),c<r&&(r=c),s>o&&(o=s),c>a&&(a=c)};for(let s of n)i(s.x,s.y);for(let s of t)for(let c of s.objects)if(c.type==="section")for(let l of c.outline)i(l.x,l.y);else if(c.type==="shape"&&c.points)for(let l of c.points)i(l.x,l.y);else if(c.type==="gaArea")for(let l of c.points)i(l.x,l.y);else if(c.type==="booth"){let l=wt(c);if(l)for(let u of l)i(u.x,u.y)}else if(c.type==="table"){let l=jn(c);if(l)for(let u of l)i(u.x,u.y)}else if(c.type==="decorImage"){let l=Un(c);if(l)for(let u of l)i(u.x,u.y)}return Number.isFinite(e)||(e=-100,r=-100,o=100,a=100),{minX:e,minY:r,maxX:o,maxY:a}}function Wr(t,n,e,r,o,a,i){if(n.length===1){let s=e.map(m=>({x:m.x,y:m.y}));for(let m of n[0].objects)m.type==="section"?s.push(...m.outline):m.type==="shape"?s.push(...ct(m)??m.points??[]):m.type==="gaArea"?s.push(...m.points):m.type==="booth"?s.push(...wt(m)??[]):m.type==="table"?s.push(...jn(m)??[]):m.type==="decorImage"&&s.push(...Un(m)??[]);if(Xr(t,n[0],e,a)||Ur(t,n[0],e,s,a))return!1;if(i&&Hr(t,n[0].baseHeightM,s,a,i))return!0;let c=ln(s),l=(o.minX+o.maxX)/2,u=(o.minY+o.maxY)/2,f=c.length>=3?c.map(m=>{let h=m.x-l,d=m.y-u,y=Math.max(1,Math.hypot(h,d));return{x:m.x+h/y*80,y:m.y+d/y*80}}):an(o.minX-28,o.minY-28,o.maxX-o.minX+56,o.maxY-o.minY+56);return Z(t,f,void 0,()=>-.04,-.22,a.ground,a.ground,K),!1}else{let s=n.reduce((b,p)=>p.baseHeightM<b.baseHeightM?p:b);t.setFloor(s.index);let c={...s,objects:n.flatMap(b=>b.objects)},l=e.map(b=>({x:b.x,y:b.y}));for(let b of c.objects)b.type==="section"&&l.push(...b.outline);if(Xr(t,c,e,a)||Ur(t,c,e,l,a))return!1;if(i&&Hr(t,s.baseHeightM,l,a,i))return!0;let u=e.filter((b,p)=>r[p]===s.index),f=Ee([s],u),m=Math.hypot(f.maxX-f.minX,f.maxY-f.minY),h=Math.max(28,Math.min(80,m*.04)),d=an(f.minX-h,f.minY-h,f.maxX-f.minX+h*2,f.maxY-f.minY+h*2),y=s.baseHeightM-.03;return Z(t,d,void 0,()=>y,y-.22,a.ground,a.ground,K),!1}}function Be(t,n,e,r){let{cx:o,cz:a,radius:i}=e,s=1/0,c=1/0,l=1/0,u=-1/0,f=-1/0,m=-1/0,h=(b,p,g)=>{s=Math.min(s,b),u=Math.max(u,b),c=Math.min(c,p),f=Math.max(f,p),l=Math.min(l,g),m=Math.max(m,g)};for(let b=0;b<t.position.length;b+=3){let p=b/3;r&&p>=r[0]&&p<r[1]||h(t.position[b],t.position[b+1],t.position[b+2])}for(let b=0;b<n.count;b++){let p=b*3,g=n.iPosition[p],P=n.iPosition[p+1],_=n.iPosition[p+2],M=Math.max(.35,n.iMaxRadius[b]??.35);h(g-M,P,_-M),h(g+M,P+1.6,_+M)}Number.isFinite(s)||(s=o-i,u=o+i,c=0,f=i*.16,l=a-i,m=a+i);let d=[(s+u)/2,(c+f)/2,(l+m)/2],y=Math.max(1,.5*Math.hypot(u-s,f-c,m-l));return{center:d,radius:y,minY:c,maxY:f}}var nl=4096;function Yr(t,n,e=[]){let r=Math.max(1,Math.ceil(t.count/nl)),o=Math.ceil(t.count/r),a=new Float32Array((o*2+n.length*4+e.length)*3),i=0;for(let s=0;s<t.count;s+=r){let c=t.iPosition[s*3],l=t.iPosition[s*3+1],u=t.iPosition[s*3+2];a[i++]=c,a[i++]=l,a[i++]=u,a[i++]=c,a[i++]=0,a[i++]=u}for(let[s,c,l]of e)a[i++]=s,a[i++]=c,a[i++]=l;for(let s of n)for(let[c,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])a[i++]=s.cx+c*s.halfX,a[i++]=s.y,a[i++]=s.cz+l*s.halfZ;return a.subarray(0,i)}function zr(t,n,e,r,o,a,i=[]){let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let M=0;M<t.count;M++){let x=M*3,A=t.iPosition[x],R=t.iPosition[x+2];A<s&&(s=A),A>l&&(l=A),R<c&&(c=R),R>u&&(u=R)}for(let[M,,x]of i)M<s&&(s=M),M>l&&(l=M),x<c&&(c=x),x>u&&(u=x);for(let M of n)s=Math.min(s,M.cx-M.halfX),l=Math.max(l,M.cx+M.halfX),c=Math.min(c,M.cz-M.halfZ),u=Math.max(u,M.cz+M.halfZ);let f=e.minX*I,m=e.maxX*I,h=e.minY*I,d=e.maxY*I,y=f,b=m,p=h,g=d;if(Number.isFinite(s)){let M=Math.max(2,.06*Math.hypot(l-s,u-c));y=Math.max(f,s-M),b=Math.min(m,l+M),p=Math.max(h,c-M),g=Math.min(d,u+M)}let P=Math.min(0,r),_=Math.max(o,a*.05);return{min:[y,P,p],max:[b,_,g]}}var Gr=12,el=.6,ol=40;function Hr(t,n,e,r,o){let a=ln([...e]);if(a.length<3)return!1;let i=1/0,s=1/0,c=-1/0,l=-1/0;for(let _ of a)i=Math.min(i,_.x),c=Math.max(c,_.x),s=Math.min(s,_.y),l=Math.max(l,_.y);let u=Math.hypot(c-i,l-s)*I,f=_t(a,Gr/I,1.2),m=Math.max(ol,u*el),h=_t(a,(Gr+m)/I,1.2);if(f.length!==h.length)return!1;let d=st(r.ground,[.78,.76,.72],.35),y=st(r.ground,[.56,.62,.52],.3);Z(t,f,void 0,()=>n-.04,n-.22,d,d,K);let b=n-.05,p=f.map(_=>[_.x*I,b,_.y*I]),g=h.map(_=>[_.x*I,b,_.y*I]),P=[0,1,0];for(let _=0;_<p.length;_++){let M=(_+1)%p.length;t.tri(p[_],g[M],g[_],P,y,o,o),t.tri(p[_],p[M],g[M],P,y,y,o)}return!0}function Xr(t,n,e,r){let o=vt(n,e);if(!o)return!1;let a=n.baseHeightM,i=st(r.ground,[.62,.55,.47],.4);return Z(t,o,void 0,()=>a-.04,a-.22,i,i,K),!0}var rl=3e3,il=20,jr=1.5,sl=1.2,al=.25;function Ur(t,n,e,r,o){if(!e.length||e.length>rl||r.length<3)return!1;for(let S of n.objects){if(S.type==="shape"&&Rn(S.stageKind))return!1;if(S.type==="section"){let{height:E}=zt(S,{floorBaseHeightM:n.baseHeightM});if(E-n.baseHeightM>il)return!1}}let a=0,i=0;for(let S of r)a+=S.x,i+=S.y;a/=r.length,i/=r.length;let s=0,c=0,l=0;for(let S of r){let E=S.x-a,T=S.y-i;s+=E*E,c+=T*T,l+=E*T}let u=.5*Math.atan2(2*l,s-c),f=Math.cos(u),m=Math.sin(u),h=-m,d=f,y=1/0,b=-1/0,p=1/0,g=-1/0;for(let S of r){let E=(S.x-a)*f+(S.y-i)*m,T=(S.x-a)*h+(S.y-i)*d;y=Math.min(y,E),b=Math.max(b,E),p=Math.min(p,T),g=Math.max(g,T)}let P=S=>[[y-S,p-S],[b+S,p-S],[b+S,g+S],[y-S,g+S]].map(([E,T])=>({x:a+f*E+h*T,y:i+m*E+d*T})),_=P(jr/I),M=P((jr+al)/I),x=n.baseHeightM,A=st(o.ground,[.62,.55,.47],.4),R=st(o.ground,[.86,.86,.84],.55);return Z(t,M,void 0,()=>x-.04,x-.22,A,A,K),Z(t,M,[_.slice().reverse()],()=>x+sl,x-.04,st(R,[1,1,1],.2),R,K),!0}function Kr(t,n,e){let r=()=>({byObjectId:new Map,elements:[]});if(!n||!t)return r();let o=Te(n);if(!o.ok||o.value.id!==t)return r();let a=new Map;for(let f of e)for(let m of f.objects)m.type==="shape"&&a.set(m.id,{shape:m,unit:f});let i=new Set,s=new Set,c=new Map((n.overlay.productionElements??[]).map(f=>{let m=f.runtimeContentImageUrl;return[f.id,typeof m=="string"&&/^(?:blob:|data:image\/|https:\/\/)/.test(m)?m:void 0]})),l=[];for(let f of o.value.overlay.productionElements??[]){let m=a.get(f.objectId),h=m?ct(m.shape):null,d=f.baseElevationM??0;if(!m||!h||h.length<3||!f.id||i.has(f.id)||s.has(f.objectId)||!Number.isFinite(f.heightM)||f.heightM<.05||f.heightM>50||!Number.isFinite(d)||d<-10||d>100)return r();i.add(f.id),s.add(f.objectId);let y=h.map(R=>R.x*I),b=h.map(R=>R.y*I),p=m.unit.baseHeightM+d,g=Math.min(...y),P=Math.max(...y),_=Math.min(...b),M=Math.max(...b),x,A=c.get(f.id)??f.contentImageUrl;if(f.kind==="screen"&&A&&(x=No(h,p,p+f.heightM,m.unit.focal),!x))if(P-g>=M-_){let R=Math.abs(_-m.unit.focal.y*I)<=Math.abs(M-m.unit.focal.y*I)?_-.006:M+.006;x=[[g,p,R],[P,p,R],[g,p+f.heightM,R],[P,p+f.heightM,R]]}else{let R=Math.abs(g-m.unit.focal.x*I)<=Math.abs(P-m.unit.focal.x*I)?g-.006:P+.006;x=[[R,p,_],[R,p,M],[R,p+f.heightM,_],[R,p+f.heightM,M]]}l.push({id:f.id,objectId:f.objectId,kind:f.kind,floorIndex:m.unit.index,baseY:p,topY:p+f.heightM,bounds:{min:[g,p,_],max:[P,p+f.heightM,M]},occlusion:f.occlusion,...A?{contentImageUrl:A}:{},...x?{contentPlane:x}:{}})}let u=l.sort((f,m)=>f.id.localeCompare(m.id));return{byObjectId:new Map(u.map(f=>[f.objectId,f])),elements:u}}var Vr=[.13,.14,.17],nn=[.4,.43,.47],cl=.18,ll=.02,ul=2.4,fl=1500,ml=240,hl=.25;function Zr(t,n,e,r){let o=n.stageKind??"";if(Kt(o)||o==="round"||!r.length)return;let a=ct(n);if(!a||a.length<3)return;let i={x:a.reduce((C,L)=>C+L.x,0)/a.length,y:a.reduce((C,L)=>C+L.y,0)/a.length},s=0,c=0,l=new Set;for(let C of r)s+=C.x,c+=C.y,l.add(Math.floor(Math.atan2(C.y-i.y,C.x-i.x)*180/Math.PI/10));let u=i.x-s/r.length,f=i.y-c/r.length,m=Math.hypot(u,f);if(m<1e-6)return;let h=r.reduce((C,L)=>C+Math.hypot(L.x-i.x,L.y-i.y),0)/r.length;if(l.size*10>ml&&m<hl*h)return;let d=u/m,y=f/m,b=-y,p=d,g=-1/0,P=1/0,_=1/0,M=-1/0;for(let C of a){let L=(C.x-i.x)*d+(C.y-i.y)*y,O=(C.x-i.x)*b+(C.y-i.y)*p;g=Math.max(g,L),P=Math.min(P,L),_=Math.min(_,O),M=Math.max(M,O)}let x=(M-_)*I,A=(g-P)*I;if(x<3||A<1.5||x*A>fl)return;let R=cl/I,S=(C,L)=>({x:i.x+d*C+b*L,y:i.y+y*C+p*L}),E=(C,L,O,D)=>[S(C,O),S(C,D),S(L,D),S(L,O)],T=e+Math.max(3.5,Math.min(8,x*.35)),F=e+Math.min(ul,T-e-1),k=.2/I,w=P+Math.min(A*.25,1.5)/I,B=ll/I;Z(t,E(g-2*R+B,g-R-B,_+R+k,M-R-k),void 0,()=>F,e,Vr,Vr,K);for(let[C,L]of[[_+R,_+R+k],[M-R-k,M-R]])Z(t,E(g-2*R,g-R,C,L),void 0,()=>T+.3,e,nn,nn,K),Z(t,E(w+k,g-2*R,C,L),void 0,()=>T+.3,T,nn,nn,K);Z(t,E(w,w+k,_+R,M-R),void 0,()=>T+.3,T,nn,nn,K)}function Mt(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function gt(t){return Array.isArray(t)?t:[]}function yl(t){let n=[t];for(;n.length;){let e=n.pop();if(Array.isArray(e)){n.push(...e);continue}if(!Mt(e))continue;let r=Mt(e.extensions)?e.extensions:null;if(r&&Object.prototype.hasOwnProperty.call(r,"KHR_draco_mesh_compression"))return!0;n.push(...Object.values(e))}return!1}function Yn(t,n){return!Array.isArray(t)||t.length!==n||!t.every(e=>typeof e=="number"&&Number.isFinite(e))?null:t}function dl(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function pl(t,n){let e=new Array(16).fill(0);for(let r=0;r<4;r++)for(let o=0;o<4;o++)for(let a=0;a<4;a++)e[r*4+o]+=t[a*4+o]*n[r*4+a];return e}function xl(t){let n=Yn(t.matrix,16);if(n)return n;if(t.matrix!==void 0)return null;let e=t.translation===void 0?[0,0,0]:Yn(t.translation,3),r=t.rotation===void 0?[0,0,0,1]:Yn(t.rotation,4),o=t.scale===void 0?[1,1,1]:Yn(t.scale,3);if(!e||!r||!o)return null;let[a,i,s,c]=r,l=Math.hypot(a,i,s,c);if(!(l>1e-8))return null;let u=a/l,f=i/l,m=s/l,h=c/l,d=u+u,y=f+f,b=m+m,p=u*d,g=u*y,P=u*b,_=f*y,M=f*b,x=m*b,A=h*d,R=h*y,S=h*b;return[(1-(_+x))*o[0],(g+S)*o[0],(P-R)*o[0],0,(g-S)*o[1],(1-(p+x))*o[1],(M+A)*o[1],0,(P+R)*o[2],(M-A)*o[2],(1-(p+_))*o[2],0,e[0],e[1],e[2],1]}function bl(t,n,e,r){return[t[0]*n+t[4]*e+t[8]*r+t[12],t[1]*n+t[5]*e+t[9]*r+t[13],t[2]*n+t[6]*e+t[10]*r+t[14]]}function gl(t){let n=t[0],e=t[4],r=t[8],o=t[1],a=t[5],i=t[9],s=t[2],c=t[6],l=t[10],u=a*l-i*c,f=i*s-o*l,m=o*c-a*s,h=n*u+e*f+r*m;if(Math.abs(h)<1e-12)return null;let d=1/h;return[u*d,f*d,m*d,(r*c-e*l)*d,(n*l-r*s)*d,(e*s-n*c)*d,(e*i-r*a)*d,(r*o-n*i)*d,(n*a-e*o)*d]}function qr(t,n,e,r){let o=t[0]*n+t[1]*e+t[2]*r,a=t[3]*n+t[4]*e+t[5]*r,i=t[6]*n+t[7]*e+t[8]*r,s=Math.hypot(o,a,i)||1;return o/=s,a/=s,i/=s,[o,a,i]}function Ml(t){if(t.byteLength<20||t.byteLength>8388608)return null;let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(n.getUint32(0,!0)!==1179937895||n.getUint32(4,!0)!==2||n.getUint32(8,!0)!==t.byteLength)return null;let e=12,r=null,o=null;for(;e+8<=t.byteLength;){let a=n.getUint32(e,!0),i=n.getUint32(e+4,!0);if(e+=8,a%4!==0||e+a>t.byteLength)return null;let s=t.subarray(e,e+a);if(i===1313821514&&!r)try{let c=JSON.parse(new TextDecoder().decode(s).replace(/[\u0000 ]+$/g,""));if(!Mt(c))return null;r=c}catch{return null}else if(i===5130562&&!o)o=s;else return null;e+=a}return e===t.byteLength&&r&&o?{json:r,bin:o}:null}function Pl(t){return t===5120||t===5121?1:t===5122||t===5123?2:t===5125||t===5126?4:0}function Rl(t){return t==="SCALAR"?1:t==="VEC2"?2:t==="VEC3"?3:t==="VEC4"?4:0}function Il(t,n,e){return e===5120?t.getInt8(n):e===5121?t.getUint8(n):e===5122?t.getInt16(n,!0):e===5123?t.getUint16(n,!0):e===5125?t.getUint32(n,!0):t.getFloat32(n,!0)}function Sl(t){let n=t instanceof Uint8Array?t:new Uint8Array(t),e=Ml(n);if(!e)return{ok:!1,issue:"invalid_glb"};let{json:r,bin:o}=e;if(!Mt(r.asset)||r.asset.version!=="2.0")return{ok:!1,issue:"unsupported_glb"};let a=gt(r.extensionsUsed).filter(_=>typeof _=="string");if(a.includes("KHR_draco_mesh_compression")||yl(r))return{ok:!1,issue:"draco_not_allowed"};if(a.length||gt(r.extensionsRequired).length)return{ok:!1,issue:"unsupported_glb"};if(gt(r.images).length||gt(r.textures).length)return{ok:!1,issue:"external_resource"};let i=gt(r.buffers);if(i.length!==1||!Mt(i[0])||i[0].uri!==void 0||typeof i[0].byteLength!="number"||!Number.isInteger(i[0].byteLength)||i[0].byteLength<0||i[0].byteLength>o.byteLength)return{ok:!1,issue:"external_resource"};let s=gt(r.accessors),c=gt(r.bufferViews),l=gt(r.meshes),u=gt(r.nodes),f=gt(r.scenes),m=typeof r.scene=="number"?r.scene:0;if(!Mt(f[m]))return{ok:!1,issue:"unsupported_glb"};let h=new DataView(o.buffer,o.byteOffset,o.byteLength),d=(_,M,x)=>{if(typeof _!="number"||!Number.isInteger(_)||!Mt(s[_]))return null;let A=s[_];if(A.type!==M||A.sparse!==void 0||A.normalized===!0||typeof A.count!="number"||!Number.isInteger(A.count)||A.count<1||typeof A.componentType!="number"||!x.includes(A.componentType)||typeof A.bufferView!="number")return null;let R=c[A.bufferView];if(!Mt(R)||R.buffer!==0||typeof R.byteLength!="number"||!Number.isInteger(R.byteLength)||R.byteLength<0)return null;let S=Rl(A.type),E=Pl(A.componentType),T=typeof R.byteStride=="number"?R.byteStride:S*E,F=typeof R.byteOffset=="number"?R.byteOffset:0,k=typeof A.byteOffset=="number"?A.byteOffset:0,w=F+k,B=k+(A.count-1)*T+S*E;if(!Number.isInteger(T)||!Number.isInteger(F)||!Number.isInteger(k)||T<S*E||F<0||k<0||F+R.byteLength>o.byteLength||B>R.byteLength)return null;let C=[];for(let L=0;L<A.count;L++){let O=[];for(let D=0;D<S;D++){let H=Il(h,w+L*T+D*E,A.componentType);if(!Number.isFinite(H))return null;O.push(H)}C.push(O)}return C},y=[],b=[],p=0,g=new Set,P=(_,M)=>{if(typeof _!="number"||!Number.isInteger(_)||!Mt(u[_])||g.has(_))return!1;g.add(_);let x=u[_],A=xl(x);if(!A)return!1;let R=pl(M,A),S=gl(R);if(!S)return!1;if(x.mesh!==void 0){if(typeof x.mesh!="number")return!1;let E=l[x.mesh];if(!Mt(E))return!1;for(let T of gt(E.primitives)){if(!Mt(T)||T.mode!==void 0&&T.mode!==4||!Mt(T.attributes))return!1;let F=d(T.attributes.POSITION,"VEC3",[5126]),k=T.attributes.NORMAL===void 0?null:d(T.attributes.NORMAL,"VEC3",[5126]);if(!F||T.attributes.NORMAL!==void 0&&!k)return!1;let w=F.length;if(T.indices!==void 0){let C=typeof T.indices=="number"?s[T.indices]:null;w=Mt(C)?C.count:void 0}if(typeof w!="number"||!Number.isInteger(w)||w%3!==0||(p+=w/3,p>1e5))return!1;let B=T.indices===void 0?F.map((C,L)=>[L]):d(T.indices,"SCALAR",[5121,5123,5125]);if(!B||B.length%3!==0||B.length!==w)return!1;for(let C=0;C<B.length;C+=3){let L=[B[C][0],B[C+1][0],B[C+2][0]];if(L.some(H=>!Number.isInteger(H)||H<0||H>=F.length))return!1;let O=L.map(H=>bl(R,...F[H])),D=null;if(!k){let H=O[1][0]-O[0][0],j=O[1][1]-O[0][1],G=O[1][2]-O[0][2],U=O[2][0]-O[0][0],X=O[2][1]-O[0][1],Y=O[2][2]-O[0][2];D=qr([1,0,0,0,1,0,0,0,1],j*Y-G*X,G*U-H*Y,H*X-j*U)}for(let H=0;H<3;H++)y.push(...O[H]),b.push(...k?qr(S,...k[L[H]]):D)}}}for(let E of gt(x.children))if(!P(E,R))return!1;return g.delete(_),!0};for(let _ of gt(f[m].nodes))if(!P(_,dl()))return{ok:!1,issue:p>1e5?"triangle_limit":"unsupported_glb"};return!p||y.length!==p*9||b.length!==y.length?{ok:!1,issue:"unsupported_glb"}:{ok:!0,triangleCount:p,position:new Float32Array(y),normal:new Float32Array(b)}}function $r(t){try{return Sl(t)}catch{return{ok:!1,issue:"invalid_glb"}}}function Ry(t){let{doc:n}=t,e=Mr(n.theme),r=e.structure,o=Mo(n,t.eventConfigurationId??n.eventConfigurationId),a=Kr(t.eventConfigurationId,t.eventConfiguration,o),i=t.seats,s=new An,c=null;if(t.registeredShellGlb){let N=$r(t.registeredShellGlb);if(N.ok){let v=N.position.length/3,W=new Float32Array(N.position.length),lt=e.materials.shell??r.tierWall;for(let ft=0;ft<v;ft++){let at=N.normal[ft*3+1],tt=at<-.25?.4:.62+.38*Math.max(0,at);W[ft*3]=lt[0]*tt,W[ft*3+1]=lt[1]*tt,W[ft*3+2]=lt[2]*tt}c={position:N.position,normal:N.normal,color:W,floor:new Float32Array(v).fill(-2),material:new Float32Array(v),count:v}}}let l=new Map;for(let N of o)for(let v of N.objects)l.set(v.id,N.index),v.type==="section"&&l.set(v.logicalSectionId??v.id,N.index);let u=i.map(N=>l.get(N.sectionId??"")??l.get(N.rowId??"")??0),f=Ee(o,i),m=s.vertexCount,d=Wr(s,o,i,u,f,r,st(e.background.top,e.background.bottom,.5))?s.vertexCount:m,y=ro(n,i),b=new Map,p=new Map;for(let N of n.categories??[])b.set(N.key,N.color),N.seatGlyph&&p.set(N.key,N.seatGlyph);let g=[],P=Xo(o,i,u),_=new Map;i.forEach((N,v)=>{let W=P.seatDeckY(v);Number.isFinite(W)&&_.set(N.rowId,Math.min(_.get(N.rowId)??1/0,W))});let M=new Float32Array(i.length),x=[],A=new Map((n.floors??[]).map((N,v)=>[N.id,v])),R=o.map(()=>[]);for(let N of i){let v=N.floorId?A.get(N.floorId)??0:0;R[Math.min(v,R.length-1)]?.push(N)}let S=(N,v)=>{if(!v||v.length<3)return!1;let W=Math.min(...v.map(tt=>tt.x)),lt=Math.max(...v.map(tt=>tt.x)),ft=Math.min(...v.map(tt=>tt.y)),at=Math.max(...v.map(tt=>tt.y));for(let tt=0;tt<N;tt++)for(let et of R[tt])if(!(et.x<W||et.x>lt||et.y<ft||et.y>at)&&Rt(et,v,void 0))return!0;return!1},E=null,T=N=>o.length===1?i:i.filter((v,W)=>u[W]===N),F=(N,v)=>{let W=wt(N);if(!W)return!1;let lt=1/0,ft=1/0,at=-1/0,tt=-1/0;for(let et of W)lt=Math.min(lt,et.x),at=Math.max(at,et.x),ft=Math.min(ft,et.y),tt=Math.max(tt,et.y);return i.some((et,ht)=>et.kind!=="booth"&&(o.length===1||u[ht]===v)&&et.x>lt&&et.x<at&&et.y>ft&&et.y<tt&&xt(W,et.x,et.y))},k;for(let N=0;N<o.length;N++){let v=o[N];s.setFloor(N);let W=vt(v,T(N)),lt=0;if(W){let z=0;for(let mt of v.objects)if(mt.type==="section")for(let yt of P.bySection.get(mt.id)?.rowLevels??[])z=Math.max(z,yt.y-v.baseHeightM);if(lt=_o(z),!k){let mt=qt(W);k={centre:[mt.x*I,mt.y*I]}}}let ft=new Tn,at=[],tt=v.objects.filter(z=>z.type==="shape"&&(z.role==="entrance"||z.role==="exit")),et=v.objects.filter(z=>z.type==="section"&&!!z.outline&&z.outline.length>=3),ht=Ir(v.objects.filter(z=>z.type==="booth"),v.focal);for(let z of v.objects)if(z.type==="section"){let mt=s.vertexCount;Lr(s,z,v,io(z,y),P.bySection.get(z.id),ft,et,r,N>0&&S(N,z.outline));let yt=s.vertexCount-mt;yt>0&&x.push({sectionId:z.id,start:mt,count:yt})}else if(z.type==="shape"){let mt=a.byObjectId.get(z.id),yt=g.length,Gt=W!==null&&z.role==="wall"&&!mt;s.setMaterial(Gt?Cn:(mt?.kind??z.role)==="screen"?1:0);let Ht=z.role==="stage"&&!mt?Sr(z,T(N)):Gt&&z.heightM===void 0?{...z,heightM:lt}:z,kt=Io(Ht,at);if(rr(s,Ht,v.baseHeightM+kt.supportOffsetM,kt.topOffsetM-kt.supportOffsetM,r,v.focal,g,mt,tt),s.setMaterial(0),z.role==="stage"&&!mt&&g.length>yt&&(E??N)===N){E=N;let Ft=n.floors?.[N]?.id,en=o.length>1&&Ft?i.filter(bn=>bn.floorId===Ft):i;Zr(s,Ht,g[g.length-1].y,en)}}else z.type==="gaArea"?sr(s,z,v.baseHeightM,it(b.get(z.categoryKey)),r):z.type==="booth"?nr(s,z,v.baseHeightM,it(b.get(z.categoryKey)),r,ht.get(z.id)??v.focal,F(z,N)):z.type==="table"?or(s,z,Math.max(v.baseHeightM,_.get(z.id)??v.baseHeightM),it(z.fill??n.theme?.decorFill??"#232c40"),r,!!(z.fill??n.theme?.decorFill)):z.type==="decorImage"&&ir(s,z,v.baseHeightM,r);W&&lr(s,v.objects,W,v.baseHeightM,lt,v.focal,r,z=>!a.byObjectId.has(z.id)),vr(s,v,i,P,r,e.materials.shell,!c)}let w=o.length>1?{x:o.reduce((N,v)=>N+v.focal.x,0)/o.length,y:o.reduce((N,v)=>N+v.focal.y,0)/o.length}:n.focalPoint??{x:(f.minX+f.maxX)/2,y:(f.minY+f.maxY)/2},B=$e(c?[s.build(),c]:[s.build()]),C=no(i,t.initialState,P,M,b,p),L=dr({doc:n,units:o,seats:i,surfaces:P,focal:w}),{labels:O,sections:D,rows:H}=pr({doc:n,units:o,seats:i,surfaces:P,seatData:C,hintedSeatFloor:u,zones:L,focal:w}),j=new Map(D.map((N,v)=>[N.id,v]));P.seatOwner.forEach((N,v)=>{C.iSection[v]=N?j.get(N)??-1:-1});let G=Dr({doc:n,units:o,seats:i,surfaces:P,solids:B,hintedSeatFloor:u,seatFloor:M});xr(O,G),C.iYaw=to(C.iPosition,i.length,N=>i[N].rowId,N=>{let v=o[M[N]]?.focal??w;return[v.x*I,v.y*I]});let U=(f.minX+f.maxX)/2*I,X=(f.minY+f.maxY)/2*I,Y=.5*Math.hypot((f.maxX-f.minX)*I,(f.maxY-f.minY)*I)||10,nt=Be(B,C,{cx:U,cz:X,radius:Y},[m,d]),rt=Be(B,C,{cx:U,cz:X,radius:Y}),q=_l(o),Q=zr(C,g,f,nt.minY,nt.maxY,Y,q);return{sharedAisles:br(o.flatMap(N=>N.objects.flatMap(v=>{if(v.type!=="section")return[];let W=P.bySection.get(v.id);return W?[{sectionId:v.id,floorIndex:N.index,rows:W.rowLevels}]:[]}))),solids:B,sectionSolidRanges:x,seats:C,seatSectionIds:P.seatOwner,bounds:{center:[(Q.min[0]+Q.max[0])/2,(Q.min[1]+Q.max[1])/2,(Q.min[2]+Q.max[2])/2],radius:Y,groundY:0,box:Q,fitPoints:Yr(C,g,q)},...k?{room:k}:{},...!k&&o.some(N=>N.objects.some(v=>v.type==="shape"&&Rn(v.stageKind)))?{outdoor:!0}:{},renderBounds:{center:nt.center,radius:nt.radius},clipBounds:{center:rt.center,radius:rt.radius},stateColorLUT:Pr(e,on),theme:e,seatCount:i.length,focalWorld:[w.x*I,1.5,w.y*I],zones:L,stages:g,productionElements:a.elements,sections:D,rows:H,labels:O,floors:G}}function _l(t){let n=[];for(let e of t)for(let r of e.objects){let o=r.type==="gaArea"?r.points:r.type==="booth"?wt(r):null;for(let a of o??[])n.push([a.x*I,e.baseHeightM,a.y*I])}return n}function Al(t,n){let{doc:e,report:r}=Lo(t),o=r.confident&&(r.sections.length>0||!!r.looseRowBlocks);if(!o&&!r.roles?.length)return null;if(!o){let c=new Map(r.roles.map(h=>[h.id,h.role])),l=h=>h.map(d=>d.type==="shape"&&c.has(d.id)?{...d,role:c.get(d.id)}:d),u=t.floors?.map(h=>({...h,objects:l(h.objects)})),f=new Float64Array(n.length).fill(Number.NaN),m=new Float64Array(n.length*2).fill(Number.NaN);return n.forEach((h,d)=>{h.eyeHeightM!==void 0&&(f[d]=h.eyeHeightM),h.focalPoint&&(m[d*2]=h.focalPoint.x,m[d*2+1]=h.focalPoint.y)}),{doc:{...t,objects:u?.[0]?.objects??l(t.objects),...u?{floors:u}:{}},report:r,eyeHeightM:f,focal:m}}let a=new Map(In(e).map(c=>[c.id,c])),i=new Float64Array(n.length).fill(Number.NaN),s=new Float64Array(n.length*2).fill(Number.NaN);return n.forEach((c,l)=>{let u=a.get(c.id)??c;u.eyeHeightM!==void 0&&(i[l]=u.eyeHeightM),u.focalPoint&&(s[l*2]=u.focalPoint.x,s[l*2+1]=u.focalPoint.y)}),{doc:e,report:r,eyeHeightM:i,focal:s}}function wl(t,n){return t.map((e,r)=>{let o=n.eyeHeightM[r],a=n.focal[r*2],i=n.focal[r*2+1],s={...e};return Number.isNaN(o)?delete s.eyeHeightM:s.eyeHeightM=o,Number.isNaN(a)?delete s.focalPoint:s.focalPoint={x:a,y:i},s})}function Ay(t){let n=t.estimate===!1?null:Al(t.doc,t.seats);return n?{input:{...t,doc:n.doc,seats:wl(t.seats,n)},estimate:n}:{input:t}}export{vl as a,fi as b,mi as c,Qe as d,hi as e,Dl as f,on as g,Kn as h,Bl as i,Zn as j,I as k,En as l,Kl as m,Vl as n,Lo as o,Fu as p,Lu as q,Nu as r,vu as s,Du as t,Gu as u,ae as v,Hu as w,Xu as x,ju as y,Uu as z,Wu as A,ac as B,Ry as C,Al as D,wl as E,Ay as F};
@@ -0,0 +1 @@
1
+ var d=["horizontal","vertical","auto"],n=72;function u(e,t){return e==="vertical"?!0:e==="auto"?!!t&&t.height>t.width:!1}var g="seatmap.chart";var r=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],i=new Map(r.map(e=>[e.key,e]));function p(e){return i.get(e)}var o={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function S(e){let t=e?.[0];return t&&o[t]||"#3b82f6"}var a=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],s=new Map(a.map(e=>[e.key,e]));function y(e){return s.get(e)}var v=8,f=24,h=["start","end","both","none"],x=["inline","corner","peninsula","island"],c=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],l=new Set(c);function w(e){switch(e.type){case"row":case"table":case"gaArea":case"booth":case"section":return"interactive";case"decorImage":return e.layer==="foreground"?"foreground":"background";case"shape":return e.role&&l.has(e.role)?"surroundings":"background";case"text":return"background";default:return"interactive"}}export{d as a,n as b,u as c,g as d,r as e,p as f,o as g,S as h,a as i,y as j,v as k,f as l,h as m,x as n,c as o,w as p};
@@ -1 +1 @@
1
- var n=20,i={wheelchair:'<circle cx="10.6" cy="3.7" r="1.7" /><path d="M8.9 6.3v4.3a1.3 1.3 0 0 0 1.3 1.3h3.4l1.9 4.5h1.9" /><circle cx="9.7" cy="13.3" r="4.7" />',companion:'<circle cx="6" cy="6" r="2" /><circle cx="14" cy="6" r="2" /><path d="M2.5 16v-3.5A3.5 3.5 0 0 1 6 9a3.5 3.5 0 0 1 3.5 3.5V16M10.5 16v-3.5A3.5 3.5 0 0 1 14 9a3.5 3.5 0 0 1 3.5 3.5V16" />',"semi-ambulatory":'<circle cx="8" cy="4" r="1.7" /><path d="m8 6 2 4 3 2M10 10l-2 3-1 4M10 10l2 7M14 7l2 10" />',"designated-aisle":'<path d="M3.5 5.5v7h8.5V10H6.5M5 12.5V17M11 12.5V17" /><path d="M13.5 6.5H19M16.5 4l2.5 2.5L16.5 9" />',"step-free":'<circle cx="5.5" cy="5" r="1.7" /><path d="M5.5 7v4l3 2M2.5 16.5H8l7-7h3M8 16.5h10" />',hearing:'<path d="M7 16c-1-1.2-1.5-2.4-1.5-3.8V9a5 5 0 1 1 10 0c0 2.2-1.2 3.2-2.6 4-1.2.7-1.7 1.4-1.7 2.4A2.6 2.6 0 0 1 8.6 18" />',cart:'<path d="M8 6.5A4 4 0 1 0 8 13M17 6.5a4 4 0 1 0 0 6.5" />',"sign-language":'<path d="M6 16V8.5a1 1 0 0 1 2 0v3M8 11V5.5a1 1 0 0 1 2 0V11M10 11V4.5a1 1 0 0 1 2 0V11M12 11V6a1 1 0 0 1 2 0v6l1-1.5a1.2 1.2 0 0 1 2 1.3L14 17H9.5A3.5 3.5 0 0 1 6 13.5" />',"low-vision":'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><circle cx="10" cy="10" r="2.5" /><path d="m15 4 .5-1.5M17 5l1.5-.8" />',"sensory-friendly":'<path d="M4 11v-1a6 6 0 0 1 12 0v1M4 11h2.5v5H5a1 1 0 0 1-1-1v-4ZM16 11h-2.5v5H15a1 1 0 0 0 1-1v-4Z" /><path d="M8.5 11.5c.8.7 2.2.7 3 0M9 14c.6.4 1.4.4 2 0" />',"plus-size":'<path d="M5 9V6.5A2.5 2.5 0 0 1 7.5 4h5A2.5 2.5 0 0 1 15 6.5V9M3.5 8.5v5h13v-5M6 13.5V17M14 13.5V17" />',"lift-armrest":'<path d="M5 10V6.5A2.5 2.5 0 0 1 7.5 4h4A2.5 2.5 0 0 1 14 6.5V10M4 9v4h11V9M6 13v4M13 13v4" /><path d="M17 11V4M15 6l2-2 2 2" />',obstructedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="m4 17 12-14" />',restrictedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="M10 7.5v3.5M10 13.5h.01" />',premium:'<path d="m10 2.5 2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5-3.6-3.5 5-.7Z" />',note:'<circle cx="10" cy="10" r="7.5" /><path d="M10 9.2v4.6M10 6.3h.01" />'};function s(e){return i[e]??""}function o(e,t={}){let a=s(e);if(!a)return"";let c=t.size??18,r=20;return`<svg viewBox="0 0 ${r} ${r}" width="${c}" height="${c}" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round"`+(t.className?` class="${t.className}"`:"")+` aria-hidden="true" focusable="false">${a}</svg>`}export{n as a,i as b,s as c,o as d};
1
+ var M=20,i={wheelchair:'<circle cx="10.6" cy="3.7" r="1.7" /><path d="M8.9 6.3v4.3a1.3 1.3 0 0 0 1.3 1.3h3.4l1.9 4.5h1.9" /><circle cx="9.7" cy="13.3" r="4.7" />',companion:'<circle cx="6" cy="6" r="2" /><circle cx="14" cy="6" r="2" /><path d="M2.5 16v-3.5A3.5 3.5 0 0 1 6 9a3.5 3.5 0 0 1 3.5 3.5V16M10.5 16v-3.5A3.5 3.5 0 0 1 14 9a3.5 3.5 0 0 1 3.5 3.5V16" />',"semi-ambulatory":'<circle cx="8" cy="4" r="1.7" /><path d="m8 6 2 4 3 2M10 10l-2 3-1 4M10 10l2 7M14 7l2 10" />',"designated-aisle":'<path d="M3.5 5.5v7h8.5V10H6.5M5 12.5V17M11 12.5V17" /><path d="M13.5 6.5H19M16.5 4l2.5 2.5L16.5 9" />',"step-free":'<circle cx="5.5" cy="5" r="1.7" /><path d="M5.5 7v4l3 2M2.5 16.5H8l7-7h3M8 16.5h10" />',hearing:'<path d="M7 16c-1-1.2-1.5-2.4-1.5-3.8V9a5 5 0 1 1 10 0c0 2.2-1.2 3.2-2.6 4-1.2.7-1.7 1.4-1.7 2.4A2.6 2.6 0 0 1 8.6 18" />',cart:'<path d="M8 6.5A4 4 0 1 0 8 13M17 6.5a4 4 0 1 0 0 6.5" />',"sign-language":'<path d="M6 16V8.5a1 1 0 0 1 2 0v3M8 11V5.5a1 1 0 0 1 2 0V11M10 11V4.5a1 1 0 0 1 2 0V11M12 11V6a1 1 0 0 1 2 0v6l1-1.5a1.2 1.2 0 0 1 2 1.3L14 17H9.5A3.5 3.5 0 0 1 6 13.5" />',"low-vision":'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><circle cx="10" cy="10" r="2.5" /><path d="m15 4 .5-1.5M17 5l1.5-.8" />',"sensory-friendly":'<path d="M4 11v-1a6 6 0 0 1 12 0v1M4 11h2.5v5H5a1 1 0 0 1-1-1v-4ZM16 11h-2.5v5H15a1 1 0 0 0 1-1v-4Z" /><path d="M8.5 11.5c.8.7 2.2.7 3 0M9 14c.6.4 1.4.4 2 0" />',"plus-size":'<path d="M5 9V6.5A2.5 2.5 0 0 1 7.5 4h5A2.5 2.5 0 0 1 15 6.5V9M3.5 8.5v5h13v-5M6 13.5V17M14 13.5V17" />',"lift-armrest":'<path d="M5 10V6.5A2.5 2.5 0 0 1 7.5 4h4A2.5 2.5 0 0 1 14 6.5V10M4 9v4h11V9M6 13v4M13 13v4" /><path d="M17 11V4M15 6l2-2 2 2" />',obstructedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="m4 17 12-14" />',restrictedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="M10 7.5v3.5M10 13.5h.01" />',premium:'<path d="m10 2.5 2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5-3.6-3.5 5-.7Z" />',note:'<circle cx="10" cy="10" r="7.5" /><path d="M10 9.2v4.6M10 6.3h.01" />',aisle:'<path d="M2.5 6v7h6.5v-2.5H4.5M3.5 13v3.5M8 13v3.5" /><path d="M12.5 3v14M17 3v14" />',entrance:'<path d="M10 3.5h6.5v13H10" /><path d="M3 10h8.5M8.5 7l3 3-3 3" />',booth:'<path d="M3.5 8.5h13v8h-13ZM2.5 8.5 4 4h12l1.5 4.5M8 16.5v-4h4v4" />'};function h(e){return i[e]??""}function s(e,t={}){let a=h(e);if(!a)return"";let c=t.size??18,r=20;return`<svg viewBox="0 0 ${r} ${r}" width="${c}" height="${c}" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round"`+(t.className?` class="${t.className}"`:"")+` aria-hidden="true" focusable="false">${a}</svg>`}export{M as a,i as b,h as c,s as d};
@@ -0,0 +1 @@
1
+ import{Ja as K,Ta as F,Wa as j}from"./chunk-EIV3CAGV.js";function C(t){let o=Number(t.slice(t.lastIndexOf(":")+1));return Number.isFinite(o)?o:-1}function se(t,o,n){let e=new Map;for(let s of t){if(s.kind==="booth")continue;let r=e.get(s.rowId);r?r.push(s):e.set(s.rowId,[s])}let c=s=>n.has(s.id)||o(s.id)!=="free",a=[];for(let s of e.values())if(!(s.length<3)){s.sort((r,l)=>C(r.id)-C(l.id));for(let r=1;r<s.length-1;r++){let l=s[r];if(c(l))continue;let g=s[r-1],m=s[r+1];C(l.id)-C(g.id)!==1||C(m.id)-C(l.id)!==1||!c(g)||!c(m)||!n.has(g.id)&&!n.has(m.id)||a.push(l)}}return a}function X(t){return Array.isArray(t.objects)}function z(t,o){if(o.seatsByLabel)return o.seatsByLabel;if(!X(t))throw new Error("ticketRestrictions: a categories-only chart document requires options.seatsByLabel");return new Map(j(t,{resolveEyeHeights:!1}).map(n=>[n.label,n]))}function Z(t){return{code:"ticket_option_not_applicable",labels:t,message:"That ticket choice is not available for the selected seat."}}function D(t,o){let n=t.applicability;return n?!(n.seatLabels?.length&&!n.seatLabels.includes(o.label)||n.accessibility?.length&&!n.accessibility.some(e=>o.accessibility?.includes(e))):!0}function de(t,o){return(t.categories.find(n=>n.key===o.categoryKey)?.tiers??[]).filter(n=>D(n,o))}function G(t,o,n){let e=t.categories.find(a=>a.key===o.categoryKey)?.tiers;if(!e?.length)return{kind:"none"};let c=n==null?e.find(a=>D(a,o)):e.find(a=>a.id===n&&D(a,o));return c?{kind:"resolved",tier:c}:{kind:"invalid"}}function ee(t,o){return(t.logicalRowId??t.rowId)===(o.logicalRowId??o.rowId)}function q(t){if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let o=t.id.slice(t.id.lastIndexOf(":")+1),n=Number(o);return Number.isInteger(n)?n:void 0}function te(t,o){if(!ee(t,o))return!1;let n=q(t),e=q(o);return n!=null&&e!=null&&Math.abs(n-e)===1}function ne(t,o,n={}){if(!o.length)return null;let e=z(t,n),c=o.flatMap(r=>{let l=e.get(r.label);return l?[{selection:r,seat:l}]:[]}),a=c.map(({seat:r})=>r).filter(r=>r.accessibility?.includes("wheelchair")),s=[];for(let{selection:r,seat:l}of c){let g=G(t,l,r.tierId),m=g.kind==="resolved"?g.tier:void 0;(l.accessibility?.includes("companion")||m?.restriction==="companion")&&!a.some(x=>x.id!==l.id&&te(l,x))&&s.push(l.label)}return s.length?{code:"companion_pair_required",labels:s,message:"Select the adjacent wheelchair place with each companion ticket."}:null}function ue(t,o,n={}){if(!o.length)return null;let e=z(t,n),c=new Set(t.categories.filter(r=>r.notForSale).map(r=>r.key)),a=[],s=[];for(let r of o){let l=e.get(r.label);if(!l)continue;if(c.has(l.categoryKey)){a.push(l.label);continue}G(t,l,r.tierId).kind==="invalid"&&s.push(l.label)}return a.length?{code:"not_for_sale",labels:a,message:"These seats are not for sale."}:s.length?Z(s):ne(t,o,{seatsByLabel:e})}function $(t){return t.sectionId?`s:${t.sectionId}`:`r:${t.logicalRowId??t.rowId}`}function ie(t,o){let n=new Set,e=new Map;for(let c of t){let a=c.focalPoint??o,s=`${a.x},${a.y}`,r=e.get(s);r||(r={focal:a,seats:[]},e.set(s,r)),r.seats.push(c)}for(let{focal:c,seats:a}of e.values()){let s=E(a),r=s.x-c.x,l=s.y-c.y,g=Math.hypot(r,l),m=0;for(let y of a)m=Math.max(m,Math.abs(y.x-c.x),Math.abs(y.y-c.y));let u=Math.max(m,1)*1e-6;if(!(g>u))continue;let x=0,T=new Set;for(let y of a)((y.x-c.x)*r+(y.y-c.y)*l)/g<-u&&(x+=1,T.add($(y)));if(!T.size||x*10>a.length)continue;let w=a.filter(y=>T.has($(y)));if(!(w.length*4>a.length))for(let y of w)n.add(y.label)}return n}function O(t,o){if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;let n=t.id.lastIndexOf(":");if(n<0)return o;let e=Number(t.id.slice(n+1));return Number.isFinite(e)?e:o}function A(t,o){let n=t.x-o.x,e=t.y-o.y;return n*n+e*e}function E(t){let o=0,n=0;for(let e of t)o+=e.x,n+=e.y;return{x:o/t.length,y:n/t.length}}function U(t,o){return t.find(n=>n.focalPoint)?.focalPoint??o}function M(t){return t.commercial?.premium===!0}function oe(t,o,n){let e=Math.floor(n.qty);if(!Number.isFinite(e)||e<=0)return{labels:[],reason:"sold_out"};let{categoryKey:c,zoneId:a,focal:s,preferPremium:r,preferNearest:l,preferredRowIds:g,accessibility:m,requireContiguous:u}=n,x=n.preferAisle&&n.aisleLabels?.size?n.aisleLabels:null,T=i=>x&&!i.some(d=>x.has(d.label))?1:0,w=new Map,y=[];if(t.forEach((i,d)=>{let b=o.has(i.label)&&(!c||i.categoryKey===c)&&(!a||i.zoneId===a)&&(!m||m.some(S=>i.accessibility?.includes(S))),h=i.logicalRowId??i.rowId,f=w.get(h);f||(f=[],w.set(h,f)),f.push({seat:i,index:O(i,d),elig:b}),b&&y.push(i)}),y.length===0)return{labels:[],reason:"sold_out"};let v=!c&&!a&&!l?ie(t,s):new Set,V=i=>v.size?i.reduce((d,b)=>d+(v.has(b.label)?1:0),0):0,_=new Map([...w].map(([i,d])=>[i,E(d.map(b=>b.seat))])),L=(g??[]).map(i=>_.get(i)).filter(i=>!!i),N=i=>{let d=_.get(i);return!d||!L.length?0:Math.min(...L.map(b=>A(d,b)))},p=null,W=i=>{if(!p)return!0;if(r&&i.nonPremium!==p.nonPremium)return i.nonPremium<p.nonPremium;if(l&&i.rowD2!==p.rowD2)return i.rowD2<p.rowD2;if(l&&i.d2!==p.d2)return i.d2<p.d2;if(i.behind!==p.behind)return i.behind<p.behind;if(i.noAisle!==p.noAisle)return i.noAisle<p.noAisle;if(i.orphan!==p.orphan)return i.orphan<p.orphan;if(i.d2!==p.d2)return i.d2<p.d2;let d=i.rowId.localeCompare(p.rowId);return d!==0?d<0:i.startIndex<p.startIndex};for(let[i,d]of w){let b=[...d].sort((f,S)=>f.index-S.index),h=0;for(;h<b.length;){if(!b[h].elig){h++;continue}let f=h;for(;f<b.length&&b[f].elig&&(f===h||b[f].index===b[f-1].index+1);)f++;let S=f-h;for(let I=0;I+e<=S;I++){let H=I,Y=S-(I+e),J=H===1||Y===1?1:0,k=b.slice(h+I,h+I+e).map(R=>R.seat),B={labels:k.map(R=>R.label),seats:k,rowId:i,startIndex:b[h+I].index,orphan:J,nonPremium:r?k.reduce((R,Q)=>R+(M(Q)?0:1),0):0,behind:V(k),noAisle:T(k),rowD2:N(i),d2:A(E(k),l?s:U(k,s))};W(B)&&(p=B)}h=f}}return p?{labels:p.labels}:u?{labels:[],reason:y.length?"not_enough_together":"sold_out"}:y.length<e?{labels:[],reason:"not_enough_together"}:{labels:y.map((i,d)=>({seat:i,i:d,rowD2:N(i.logicalRowId??i.rowId),d2:A(i,l?s:i.focalPoint??s)})).sort((i,d)=>{if(r){let S=M(i.seat)?0:1,I=M(d.seat)?0:1;if(S!==I)return S-I}if(l&&i.rowD2!==d.rowD2)return i.rowD2-d.rowD2;let b=v.has(i.seat.label)?1:0,h=v.has(d.seat.label)?1:0;if(b!==h)return b-h;if(x){let S=x.has(i.seat.label)?0:1,I=x.has(d.seat.label)?0:1;if(S!==I)return S-I}if(i.d2!==d.d2)return i.d2-d.d2;let f=(i.seat.logicalRowId??i.seat.rowId).localeCompare(d.seat.logicalRowId??d.seat.rowId);return f!==0?f:O(i.seat,i.i)-O(d.seat,d.i)}).slice(0,e).map(i=>i.seat.label)}}function be(t,o,n,e){let c=Math.floor(e.qty),a=oe(t,n,e),r=o.filter(u=>u.bookingMode==="whole"&&u.capacity===c&&n.has(u.label)&&(!e.categoryKey||u.categoryKey===e.categoryKey)&&(!e.zoneId||u.zoneId===e.zoneId)&&!e.accessibility).map(u=>({table:u,d2:A(u.center,e.preferNearest?e.focal:u.focalPoint??e.focal)})).sort((u,x)=>u.d2-x.d2||u.table.label.localeCompare(x.table.label))[0];if(!r)return a;if(!a.labels.length)return{labels:[r.table.label]};if(e.preferAisle&&e.aisleLabels&&a.labels.some(u=>e.aisleLabels.has(u)))return a;let l=new Map(t.map(u=>[u.label,u])),g=a.labels.map(u=>l.get(u)).filter(u=>!!u),m=g.length?A(E(g),U(g,e.focal)):Number.POSITIVE_INFINITY;return r.d2<m?{labels:[r.table.label]}:a}var P=class extends Error{constructor(n,e){super(e);this.objectId=n;this.name="GroupedTableProjectionError"}};function re(t){let o=t.minOccupancy,n=t.maxOccupancy;if(!Number.isInteger(o)||!Number.isInteger(n)||o<1||n<o||n>t.seatCount)throw new P(t.id,`Table "${t.label}" has invalid variable-occupancy bounds`);return{min:o,max:n}}function ye(t,o){if(o!==2)return[];let n=[];for(let e of F(t)){if(e.type!=="table"||!e.bookAsWhole&&!e.variableOccupancy)continue;if(e.bookAsWhole&&e.variableOccupancy)throw new P(e.id,`Table "${e.label}" cannot be whole-table and variable-occupancy inventory`);if(!Number.isInteger(e.seatCount)||e.seatCount<1||!e.label.trim())throw new P(e.id,"Grouped tables require a label and at least one chair");let c=e.variableOccupancy?"variable":"whole",a=c==="variable"?re(e):{min:e.seatCount,max:e.seatCount};n.push({objectId:e.id,label:e.label,...e.displayLabel?{displayLabel:e.displayLabel}:{},...e.displayType?{displayType:e.displayType}:{},categoryKey:e.categoryKey,mode:c,capacity:e.seatCount,minOccupancy:a.min,maxOccupancy:a.max,chairs:K(e)})}return n}export{se as a,X as b,Z as c,D as d,de as e,G as f,ne as g,ue as h,ie as i,oe as j,be as k,P as l,ye as m};