@seatlayer/core 0.109.1 → 0.110.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 (154) hide show
  1. package/dist/{ar-TPTLODBK.js → ar-O3RHQRH3.js} +1 -1
  2. package/dist/be-SXFCG3F5.js +1 -0
  3. package/dist/bg-W7YBNYB2.js +1 -0
  4. package/dist/ca-FA7WHACR.js +1 -0
  5. package/dist/{categoryInventory-WNOXm5Il.d.cts → categoryInventory-BfvwE3nC.d.cts} +1 -1
  6. package/dist/{categoryInventory-nNbloQGE.d.ts → categoryInventory-ClZ-68jI.d.ts} +1 -1
  7. package/dist/{chunk-GPZFVQXV.js → chunk-4522UUXG.js} +1 -1
  8. package/dist/chunk-4QQG5EEP.js +1 -0
  9. package/dist/chunk-6VOUTNRV.js +1 -0
  10. package/dist/{chunk-UNSAUDO2.js → chunk-BNLANXXZ.js} +1 -1
  11. package/dist/{chunk-JRZHC75P.js → chunk-EE2CVYFJ.js} +1 -1
  12. package/dist/{chunk-33SRM2CP.js → chunk-GUNNA5LB.js} +1 -1
  13. package/dist/chunk-OJSGMXJS.js +1 -0
  14. package/dist/{chunk-WKWXU5QM.js → chunk-PBXGWYB4.js} +1 -1
  15. package/dist/{chunk-UEDS3HJ3.js → chunk-URW7MSCJ.js} +1 -1
  16. package/dist/{chunk-YH4GPHL2.js → chunk-WUNZCUE6.js} +1 -1
  17. package/dist/core/chart-ops/index.cjs +1 -1
  18. package/dist/core/chart-ops/index.d.cts +34 -6
  19. package/dist/core/chart-ops/index.d.ts +34 -6
  20. package/dist/core/chart-ops/index.js +1 -1
  21. package/dist/core/inventory/index.cjs +1 -1
  22. package/dist/core/inventory/index.d.cts +4 -4
  23. package/dist/core/inventory/index.d.ts +4 -4
  24. package/dist/core/inventory/index.js +1 -1
  25. package/dist/core/layout/index.d.cts +5 -5
  26. package/dist/core/layout/index.d.ts +5 -5
  27. package/dist/core/layout/index.js +1 -1
  28. package/dist/core/quality/index.d.cts +3 -3
  29. package/dist/core/quality/index.d.ts +3 -3
  30. package/dist/core/quality/index.js +1 -1
  31. package/dist/core/render-assets/index.d.cts +2 -2
  32. package/dist/core/render-assets/index.d.ts +2 -2
  33. package/dist/core/render-assets/index.js +1 -1
  34. package/dist/core/seatConfidence.d.cts +1 -1
  35. package/dist/core/seatConfidence.d.ts +1 -1
  36. package/dist/core/sections/index.d.cts +5 -5
  37. package/dist/core/sections/index.d.ts +5 -5
  38. package/dist/cs-RR3VIKRC.js +1 -0
  39. package/dist/cy-U4JJ5C47.js +1 -0
  40. package/dist/da-ATULGB2M.js +1 -0
  41. package/dist/de-VB543CPC.js +1 -0
  42. package/dist/el-7Y2KXU6N.js +1 -0
  43. package/dist/es-GUV5XIYC.js +1 -0
  44. package/dist/et-SZ6I4Z44.js +1 -0
  45. package/dist/{eventConfigurations-QwuBqi8E.d.ts → eventConfigurations-DsW5Mj2e.d.ts} +1 -1
  46. package/dist/{eventConfigurations-Dp0gQBxf.d.cts → eventConfigurations-dmn9FClw.d.cts} +1 -1
  47. package/dist/fa-FM6ELEN7.js +1 -0
  48. package/dist/fi-6QQ2M5JI.js +1 -0
  49. package/dist/fr-2SEQSVLR.js +1 -0
  50. package/dist/he-V3EVB7IW.js +1 -0
  51. package/dist/hi-I4QIBK5Q.js +1 -0
  52. package/dist/hr-I5DNEVUU.js +1 -0
  53. package/dist/hu-KTFWBQMF.js +1 -0
  54. package/dist/id-RZWUH426.js +1 -0
  55. package/dist/index.cjs +1 -1
  56. package/dist/index.d.cts +31 -13
  57. package/dist/index.d.ts +31 -13
  58. package/dist/index.js +1 -1
  59. package/dist/it-CNQP36V4.js +1 -0
  60. package/dist/ja-JQZOYIHI.js +1 -0
  61. package/dist/ko-6YCWWHFQ.js +1 -0
  62. package/dist/ku-33PM4OWG.js +1 -0
  63. package/dist/{labeling-Bzfv743A.d.cts → labeling-BmEjVxFt.d.cts} +1 -1
  64. package/dist/{labeling-CLrYgex2.d.ts → labeling-Bn41ByDd.d.ts} +1 -1
  65. package/dist/localeLoaders-VFQOZMUH.js +1 -0
  66. package/dist/lt-24JO2B7V.js +1 -0
  67. package/dist/lv-HTSDEEAB.js +1 -0
  68. package/dist/ms-PUEZJJ3R.js +1 -0
  69. package/dist/nl-NQPDRSCW.js +1 -0
  70. package/dist/no-3N3MUMSA.js +1 -0
  71. package/dist/pl-YHBEO6ZF.js +1 -0
  72. package/dist/pt-5RPESNZB.js +1 -0
  73. package/dist/{renderedQuality-D7adZpeD.d.cts → renderedQuality-Bt2d0uq1.d.cts} +1 -1
  74. package/dist/{renderedQuality-DL_Bwohi.d.ts → renderedQuality-MDkNe8GA.d.ts} +1 -1
  75. package/dist/{renderer-BaX5XS07.d.cts → renderer-BJrpMV6U.d.ts} +19 -2
  76. package/dist/{renderer-GIwwPupP.d.ts → renderer-DH0yI32q.d.cts} +19 -2
  77. package/dist/ro-XDFXIMHX.js +1 -0
  78. package/dist/ru-BIIALOM5.js +1 -0
  79. package/dist/{seatTypeIcons-BbHRuAXE.d.ts → seatTypeIcons-CG_Uzpaw.d.ts} +1 -1
  80. package/dist/{seatTypeIcons-CnIsRKIM.d.cts → seatTypeIcons-Ck7oEFei.d.cts} +1 -1
  81. package/dist/{sections-BOaTNaYG.d.ts → sections-C-UAqr1x.d.ts} +1 -1
  82. package/dist/{sections-DRiD7LLT.d.cts → sections-C8HApYxd.d.cts} +1 -1
  83. package/dist/{segmentedRowModel-C0MT2W3h.d.cts → segmentedRowModel-CeoMsBnt.d.cts} +1 -1
  84. package/dist/{segmentedRowModel-CDm8wEMA.d.ts → segmentedRowModel-DR1w9M13.d.ts} +1 -1
  85. package/dist/sk-LHSFRUFT.js +1 -0
  86. package/dist/sl-MPE5TPI3.js +1 -0
  87. package/dist/sr-T3N67KTP.js +1 -0
  88. package/dist/sv-LJWWYUIY.js +1 -0
  89. package/dist/{tableSizing-BvWmV_II.d.cts → tableSizing-Bz-hxLza.d.cts} +3 -3
  90. package/dist/{tableSizing-CjeVoew4.d.ts → tableSizing-RRmpxOXl.d.ts} +3 -3
  91. package/dist/th-E5POGG37.js +1 -0
  92. package/dist/{ticketRestrictions-P3RuwcmT.d.ts → ticketRestrictions-C7KUrulv.d.ts} +2 -2
  93. package/dist/{ticketRestrictions-Cp_Wkjy9.d.cts → ticketRestrictions-lq4dH4k6.d.cts} +2 -2
  94. package/dist/tr-2DCWQ2CY.js +1 -0
  95. package/dist/{types-fSWyPu3f.d.cts → types-DM-OneoD.d.cts} +1 -0
  96. package/dist/{types-fSWyPu3f.d.ts → types-DM-OneoD.d.ts} +1 -0
  97. package/dist/uk-C3VJP6EA.js +1 -0
  98. package/dist/vi-XVMTKCOL.js +1 -0
  99. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  100. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  101. package/dist/view3d/index.cjs +54 -54
  102. package/dist/view3d/index.d.cts +3 -3
  103. package/dist/view3d/index.d.ts +3 -3
  104. package/dist/view3d/index.js +1 -1
  105. package/dist/view3d/scene/scene.worker.cjs +1 -1
  106. package/dist/view3d/scene/scene.worker.js +1 -1
  107. package/dist/zh-Hans-RG4CQGBY.js +1 -0
  108. package/dist/zh-Hant-YHNTYPFS.js +1 -0
  109. package/package.json +1 -1
  110. package/dist/be-SX5AJ2EF.js +0 -1
  111. package/dist/bg-T7FBXPVU.js +0 -1
  112. package/dist/ca-TTI23CKH.js +0 -1
  113. package/dist/chunk-ASSEW6WM.js +0 -1
  114. package/dist/chunk-HSEX7LUB.js +0 -1
  115. package/dist/chunk-T2QG47QQ.js +0 -1
  116. package/dist/cs-KEMKTFP3.js +0 -1
  117. package/dist/cy-EGUWNAAE.js +0 -1
  118. package/dist/da-AHX4SSIT.js +0 -1
  119. package/dist/de-U3ISXVMR.js +0 -1
  120. package/dist/el-NBMJFLGN.js +0 -1
  121. package/dist/es-IYOV3DZF.js +0 -1
  122. package/dist/et-QHFQ3BIM.js +0 -1
  123. package/dist/fa-FEFRLXP7.js +0 -1
  124. package/dist/fi-HB6NGCIV.js +0 -1
  125. package/dist/fr-5EX7Z5Z5.js +0 -1
  126. package/dist/he-MEW7GMCW.js +0 -1
  127. package/dist/hi-V2CICZDC.js +0 -1
  128. package/dist/hr-SUZYZ3DL.js +0 -1
  129. package/dist/hu-RJFHJPXB.js +0 -1
  130. package/dist/id-LEP73A6A.js +0 -1
  131. package/dist/it-V65UNUVY.js +0 -1
  132. package/dist/ja-3HISSPHC.js +0 -1
  133. package/dist/ko-5DFMEYUO.js +0 -1
  134. package/dist/ku-H3EOMAJX.js +0 -1
  135. package/dist/localeLoaders-M2TUVL75.js +0 -1
  136. package/dist/lt-XHIM3BWS.js +0 -1
  137. package/dist/lv-P5EQD4YY.js +0 -1
  138. package/dist/ms-XC3SU4I2.js +0 -1
  139. package/dist/nl-K2N44NUV.js +0 -1
  140. package/dist/no-C4MFGLSN.js +0 -1
  141. package/dist/pl-ADABFEA3.js +0 -1
  142. package/dist/pt-4AQPHHDG.js +0 -1
  143. package/dist/ro-PZLP7BEU.js +0 -1
  144. package/dist/ru-33R4HJF2.js +0 -1
  145. package/dist/sk-XCXFOU73.js +0 -1
  146. package/dist/sl-23PMG7BB.js +0 -1
  147. package/dist/sr-SOPFKPZ5.js +0 -1
  148. package/dist/sv-PKDMDUS5.js +0 -1
  149. package/dist/th-NU4K5DFF.js +0 -1
  150. package/dist/tr-HEDRXONB.js +0 -1
  151. package/dist/uk-T7JNLCSZ.js +0 -1
  152. package/dist/vi-EWDKGL2Y.js +0 -1
  153. package/dist/zh-Hans-ED7CX2SQ.js +0 -1
  154. package/dist/zh-Hant-UKJQ2KBS.js +0 -1
@@ -1 +1 @@
1
- import{l as V,n as H,z as m}from"./chunk-JRZHC75P.js";var ie=3,k=4.5,T=3,$=24,re=20;function A(t){return t.filter(a=>a.visible&&!!a.screenBox)}function y(t,a){return t.x<a.x+a.width&&t.x+t.width>a.x&&t.y<a.y+a.height&&t.y+t.height>a.y}function p(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function o(t,a,s){return s.length?{code:t,message:a,count:s.length,samples:s.slice(0,re)}:null}function B(t,a,s){return{primaryId:t.seatId,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function F(t,a,s){return{primaryId:t.id,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function D(t,a,s){return{primaryId:t.objectId,primaryLabel:t.text,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function g(t,a,s,l){return{primaryId:t,primaryLabel:a,secondaryId:s,secondaryLabel:l}}function ae(t,a="overview",s=null){let l=A(t.labels),c=A(t.hierarchyLabels),d=A(t.freeTextLabels),f=A(t.rowLabels),C=t.gaAreas.filter(e=>e.visible),W=l.map(e=>m(e.ink,e.fill)??0),X=c.map(e=>m(e.ink,e.fill)??0),Y=d.map(e=>m(e.ink,e.background)??0),q=C.map(e=>m(e.effectiveBackground,t.canvasBackground)??0),u=s?t.labels.filter(e=>e.categoryKey===s):t.labels,v=s?t.gaAreas.filter(e=>e.categoryKey===s):t.gaAreas,h=u.filter(e=>e.selected),x=u.filter(e=>e.status==="held"),w=u.filter(e=>e.status==="booked"),R=u.filter(e=>e.pointerTarget.active),M=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),S=h.length?p(h.map(e=>m(e.selectionRingColor??t.selectionRingColor,e.fill)??0)):null,n=[],I=(e,i)=>Array.from({length:e},(b,L)=>({primaryId:`overview:${L+1}`,primaryLabel:i}));a==="overview"&&t.rung==="sections"&&(n.push(o("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",I(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),n.push(o("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",I(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),n.push(o("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",I(t.overviewStyle.visibleSectionRowHints,"section row hint"))),n.push(o("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),n.push(o("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),n.push(o("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>B(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("bookable-label-viewport-clipped","Visible interaction labels must remain fully inside the buyer viewport",a==="interaction"?l.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>B(e)):[])),n.push(o("row-label-viewport-clipped","Visible interaction row labels must remain fully inside the buyer viewport",a==="interaction"?f.flatMap((e,i)=>{let b=e.screenBox;return b.x<0||b.y<0||b.x+b.width>t.viewport.width||b.y+b.height>t.viewport.height?[{primaryId:`row-label-${i}`,primaryLabel:e.text}]:[]}):[]));let _=[];if(a==="interaction")for(let e=0;e<f.length;e+=1)for(let i=0;i<e;i+=1)y(f[e].screenBox,f[i].screenBox)&&_.push(g(`row-label-${i}`,f[i].text,`row-label-${e}`,f[e].text));if(n.push(o("row-label-collision","Visible interaction row labels must not overlap",_)),a==="interaction"){let e=u.length>0,i=v.length>0,b=e||i,L=v.filter(r=>r.visible),J=new Set([...u.flatMap(r=>r.sectionId?[r.sectionId]:[]),...v.flatMap(r=>r.sectionId?[r.sectionId]:[])]),Z=new Set([...t.labels.map(r=>r.categoryKey),...t.gaAreas.map(r=>r.categoryKey)]),P=r=>r.screenCenter.x>=0&&r.screenCenter.x<=t.viewport.width&&r.screenCenter.y>=0&&r.screenCenter.y<=t.viewport.height;n.push(o("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",b&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),n.push(o("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",b&&!u.some(P)&&!L.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),n.push(o("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!R.some(P)||!e&&i&&!L.some(r=>r.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),n.push(o("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",R.filter(r=>P(r)&&r.pointerTarget.effectiveMinimumPx<$).map(r=>B(r,r.pointerTarget.effectiveMinimumPx,$)))),n.push(o("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!h.length||!h.some(r=>t.selectionRingSeatIds.includes(r.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),n.push(o("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the seat paint",h.length&&(S??0)<T?[{primaryId:h[0].seatId,primaryLabel:h[0].label,measured:Math.round((S??0)*100)/100,minimum:T}]:[])),n.push(o("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",u.length>=2&&!x.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),n.push(o("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",u.length>=3&&!w.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let ee=new Set(x.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`)),te=new Set(w.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`));n.push(o("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",x.length&&w.length&&[...ee].some(r=>te.has(r))?[{primaryId:x[0].seatId,primaryLabel:x[0].label,secondaryId:w[0].seatId,secondaryLabel:w[0].label}]:[])),n.push(o("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",J.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),n.push(o("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",Z.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let E=t.labels.filter(r=>r.status==="free"&&!r.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey)),Q=t.gaAreas.filter(r=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey));n.push(o("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(E.length||Q.length)&&!E.some(r=>r.opacity<=.25)&&!Q.some(r=>r.opacity<=.1)?[...E.map(r=>B(r,r.opacity)),...Q.map(r=>({primaryId:r.areaId,primaryLabel:r.label,measured:r.opacity}))]:[])),n.push(o("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",s&&!M.has(s)?[{primaryId:s,primaryLabel:s}]:[])),n.push(o("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",s&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==s)?[{primaryId:s,primaryLabel:s}]:[]))}n.push(o("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",l.flatMap(e=>{let i=m(e.ink,e.fill)??0;return i<k?[B(e,i,k)]:[]})));let z=[];for(let e=0;e<l.length;e+=1)for(let i=0;i<e;i+=1)y(l[e].screenBox,l[i].screenBox)&&z.push(g(l[i].seatId,l[i].label,l[e].seatId,l[e].label));n.push(o("bookable-label-collision","Visible bookable labels must not overlap",z)),n.push(o("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",c.filter(e=>e.renderedFontPx<(e.sizeFloorPx??V)).map(e=>F(e,e.renderedFontPx,e.sizeFloorPx??V)))),n.push(o("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",c.flatMap(e=>{let i=m(e.ink,e.fill)??0,b=e.kind==="section"&&e.role==="name"?H:k;return i<b?[F(e,i,b)]:[]}))),n.push(o("hierarchy-label-viewport-clipped","Visible overview hierarchy labels must remain fully inside the buyer viewport",a==="overview"?c.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>F(e)):[])),n.push(o("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",c.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>F(e))));let K=[];for(let e=0;e<c.length;e+=1)for(let i=0;i<e;i+=1)y(c[e].screenBox,c[i].screenBox)&&K.push(g(c[i].id,c[i].label,c[e].id,c[e].label));n.push(o("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",K));let N=[];for(let e of c)for(let i of l)y(e.screenBox,i.screenBox)&&N.push(g(e.id,e.label,i.seatId,i.label));n.push(o("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",N)),n.push(o("free-text-undersized","Visible chart text must meet the rendered small-text size floor",d.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>D(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",d.flatMap(e=>{let i=m(e.ink,e.background)??0;return i<k?[D(e,i,k)]:[]})));let G=[];for(let e=0;e<d.length;e+=1)for(let i=0;i<e;i+=1)y(d[e].screenBox,d[i].screenBox)&&G.push(g(d[i].objectId,d[i].text,d[e].objectId,d[e].text));n.push(o("free-text-collision","Visible chart text labels must not overlap each other",G));let O=[];for(let e of d)for(let i of l)y(e.screenBox,i.screenBox)&&O.push(g(e.objectId,e.text,i.seatId,i.label));n.push(o("free-text-bookable-collision","Visible chart text must not overlap bookable labels",O));let U=[];for(let e of d)for(let i of c)y(e.screenBox,i.screenBox)&&U.push(g(e.objectId,e.text,i.id,i.label));n.push(o("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",U)),n.push(o("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",C.flatMap(e=>{let i=m(e.effectiveBackground,t.canvasBackground)??0;return i<T?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(i*100)/100,minimum:T}]:[]})));let j=n.filter(e=>!!e);return{version:ie,passed:j.length===0,state:a,targetCategoryKey:s,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-viewport","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...a==="interaction"?["rendered-detail-label-viewport","rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:l.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:c.length,visibleFreeTextLabels:d.length,visibleGAAreas:C.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,i)=>e.kind.localeCompare(i.kind)||e.id.localeCompare(i.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,i)=>e.objectId.localeCompare(i.objectId)||e.kind.localeCompare(i.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,i)=>e.areaId.localeCompare(i.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...M].sort()},metrics:{minimumRenderedBookableLabelPx:p(l.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:p(W),minimumRenderedHierarchyLabelPx:p(c.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:p(X),minimumRenderedFreeTextPx:p(d.map(e=>e.renderedFontPx)),minimumFreeTextContrast:p(Y),minimumGAContrast:p(q),minimumEffectivePointerTargetPx:p(R.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:S==null?null:Math.round(S*100)/100},interaction:{applicable:{detail:u.length>0||v.length>0,pointer:u.length>0||v.length>0,held:u.length>=2,booked:u.length>=3,sectionFocus:u.some(e=>!!e.sectionId)||v.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:h.length,heldUnits:x.length,bookedUnits:w.length,activePointerTargets:R.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:j}}export{ie as a,$ as b,ae as c};
1
+ import{l as V,n as H,z as m}from"./chunk-EE2CVYFJ.js";var ie=3,k=4.5,T=3,$=24,re=20;function A(t){return t.filter(a=>a.visible&&!!a.screenBox)}function y(t,a){return t.x<a.x+a.width&&t.x+t.width>a.x&&t.y<a.y+a.height&&t.y+t.height>a.y}function p(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function o(t,a,s){return s.length?{code:t,message:a,count:s.length,samples:s.slice(0,re)}:null}function B(t,a,s){return{primaryId:t.seatId,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function F(t,a,s){return{primaryId:t.id,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function D(t,a,s){return{primaryId:t.objectId,primaryLabel:t.text,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function g(t,a,s,l){return{primaryId:t,primaryLabel:a,secondaryId:s,secondaryLabel:l}}function ae(t,a="overview",s=null){let l=A(t.labels),c=A(t.hierarchyLabels),d=A(t.freeTextLabels),f=A(t.rowLabels),C=t.gaAreas.filter(e=>e.visible),W=l.map(e=>m(e.ink,e.fill)??0),X=c.map(e=>m(e.ink,e.fill)??0),Y=d.map(e=>m(e.ink,e.background)??0),q=C.map(e=>m(e.effectiveBackground,t.canvasBackground)??0),u=s?t.labels.filter(e=>e.categoryKey===s):t.labels,v=s?t.gaAreas.filter(e=>e.categoryKey===s):t.gaAreas,h=u.filter(e=>e.selected),x=u.filter(e=>e.status==="held"),w=u.filter(e=>e.status==="booked"),R=u.filter(e=>e.pointerTarget.active),M=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),S=h.length?p(h.map(e=>m(e.selectionRingColor??t.selectionRingColor,e.fill)??0)):null,n=[],I=(e,i)=>Array.from({length:e},(b,L)=>({primaryId:`overview:${L+1}`,primaryLabel:i}));a==="overview"&&t.rung==="sections"&&(n.push(o("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",I(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),n.push(o("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",I(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),n.push(o("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",I(t.overviewStyle.visibleSectionRowHints,"section row hint"))),n.push(o("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),n.push(o("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),n.push(o("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>B(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("bookable-label-viewport-clipped","Visible interaction labels must remain fully inside the buyer viewport",a==="interaction"?l.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>B(e)):[])),n.push(o("row-label-viewport-clipped","Visible interaction row labels must remain fully inside the buyer viewport",a==="interaction"?f.flatMap((e,i)=>{let b=e.screenBox;return b.x<0||b.y<0||b.x+b.width>t.viewport.width||b.y+b.height>t.viewport.height?[{primaryId:`row-label-${i}`,primaryLabel:e.text}]:[]}):[]));let _=[];if(a==="interaction")for(let e=0;e<f.length;e+=1)for(let i=0;i<e;i+=1)y(f[e].screenBox,f[i].screenBox)&&_.push(g(`row-label-${i}`,f[i].text,`row-label-${e}`,f[e].text));if(n.push(o("row-label-collision","Visible interaction row labels must not overlap",_)),a==="interaction"){let e=u.length>0,i=v.length>0,b=e||i,L=v.filter(r=>r.visible),J=new Set([...u.flatMap(r=>r.sectionId?[r.sectionId]:[]),...v.flatMap(r=>r.sectionId?[r.sectionId]:[])]),Z=new Set([...t.labels.map(r=>r.categoryKey),...t.gaAreas.map(r=>r.categoryKey)]),P=r=>r.screenCenter.x>=0&&r.screenCenter.x<=t.viewport.width&&r.screenCenter.y>=0&&r.screenCenter.y<=t.viewport.height;n.push(o("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",b&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),n.push(o("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",b&&!u.some(P)&&!L.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),n.push(o("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!R.some(P)||!e&&i&&!L.some(r=>r.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),n.push(o("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",R.filter(r=>P(r)&&r.pointerTarget.effectiveMinimumPx<$).map(r=>B(r,r.pointerTarget.effectiveMinimumPx,$)))),n.push(o("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!h.length||!h.some(r=>t.selectionRingSeatIds.includes(r.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),n.push(o("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the seat paint",h.length&&(S??0)<T?[{primaryId:h[0].seatId,primaryLabel:h[0].label,measured:Math.round((S??0)*100)/100,minimum:T}]:[])),n.push(o("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",u.length>=2&&!x.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),n.push(o("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",u.length>=3&&!w.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let ee=new Set(x.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`)),te=new Set(w.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`));n.push(o("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",x.length&&w.length&&[...ee].some(r=>te.has(r))?[{primaryId:x[0].seatId,primaryLabel:x[0].label,secondaryId:w[0].seatId,secondaryLabel:w[0].label}]:[])),n.push(o("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",J.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),n.push(o("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",Z.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let E=t.labels.filter(r=>r.status==="free"&&!r.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey)),Q=t.gaAreas.filter(r=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey));n.push(o("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(E.length||Q.length)&&!E.some(r=>r.opacity<=.25)&&!Q.some(r=>r.opacity<=.1)?[...E.map(r=>B(r,r.opacity)),...Q.map(r=>({primaryId:r.areaId,primaryLabel:r.label,measured:r.opacity}))]:[])),n.push(o("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",s&&!M.has(s)?[{primaryId:s,primaryLabel:s}]:[])),n.push(o("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",s&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==s)?[{primaryId:s,primaryLabel:s}]:[]))}n.push(o("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",l.flatMap(e=>{let i=m(e.ink,e.fill)??0;return i<k?[B(e,i,k)]:[]})));let z=[];for(let e=0;e<l.length;e+=1)for(let i=0;i<e;i+=1)y(l[e].screenBox,l[i].screenBox)&&z.push(g(l[i].seatId,l[i].label,l[e].seatId,l[e].label));n.push(o("bookable-label-collision","Visible bookable labels must not overlap",z)),n.push(o("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",c.filter(e=>e.renderedFontPx<(e.sizeFloorPx??V)).map(e=>F(e,e.renderedFontPx,e.sizeFloorPx??V)))),n.push(o("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",c.flatMap(e=>{let i=m(e.ink,e.fill)??0,b=e.kind==="section"&&e.role==="name"?H:k;return i<b?[F(e,i,b)]:[]}))),n.push(o("hierarchy-label-viewport-clipped","Visible overview hierarchy labels must remain fully inside the buyer viewport",a==="overview"?c.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>F(e)):[])),n.push(o("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",c.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>F(e))));let K=[];for(let e=0;e<c.length;e+=1)for(let i=0;i<e;i+=1)y(c[e].screenBox,c[i].screenBox)&&K.push(g(c[i].id,c[i].label,c[e].id,c[e].label));n.push(o("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",K));let N=[];for(let e of c)for(let i of l)y(e.screenBox,i.screenBox)&&N.push(g(e.id,e.label,i.seatId,i.label));n.push(o("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",N)),n.push(o("free-text-undersized","Visible chart text must meet the rendered small-text size floor",d.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>D(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",d.flatMap(e=>{let i=m(e.ink,e.background)??0;return i<k?[D(e,i,k)]:[]})));let G=[];for(let e=0;e<d.length;e+=1)for(let i=0;i<e;i+=1)y(d[e].screenBox,d[i].screenBox)&&G.push(g(d[i].objectId,d[i].text,d[e].objectId,d[e].text));n.push(o("free-text-collision","Visible chart text labels must not overlap each other",G));let O=[];for(let e of d)for(let i of l)y(e.screenBox,i.screenBox)&&O.push(g(e.objectId,e.text,i.seatId,i.label));n.push(o("free-text-bookable-collision","Visible chart text must not overlap bookable labels",O));let U=[];for(let e of d)for(let i of c)y(e.screenBox,i.screenBox)&&U.push(g(e.objectId,e.text,i.id,i.label));n.push(o("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",U)),n.push(o("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",C.flatMap(e=>{let i=m(e.effectiveBackground,t.canvasBackground)??0;return i<T?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(i*100)/100,minimum:T}]:[]})));let j=n.filter(e=>!!e);return{version:ie,passed:j.length===0,state:a,targetCategoryKey:s,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-viewport","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...a==="interaction"?["rendered-detail-label-viewport","rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:l.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:c.length,visibleFreeTextLabels:d.length,visibleGAAreas:C.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,i)=>e.kind.localeCompare(i.kind)||e.id.localeCompare(i.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,i)=>e.objectId.localeCompare(i.objectId)||e.kind.localeCompare(i.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,i)=>e.areaId.localeCompare(i.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...M].sort()},metrics:{minimumRenderedBookableLabelPx:p(l.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:p(W),minimumRenderedHierarchyLabelPx:p(c.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:p(X),minimumRenderedFreeTextPx:p(d.map(e=>e.renderedFontPx)),minimumFreeTextContrast:p(Y),minimumGAContrast:p(q),minimumEffectivePointerTargetPx:p(R.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:S==null?null:Math.round(S*100)/100},interaction:{applicable:{detail:u.length>0||v.length>0,pointer:u.length>0||v.length>0,held:u.length>=2,booked:u.length>=3,sectionFocus:u.some(e=>!!e.sectionId)||v.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:h.length,heldUnits:x.length,bookedUnits:w.length,activePointerTargets:R.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:j}}export{ie as a,$ as b,ae as c};
@@ -0,0 +1 @@
1
+ import{a as lo,c as uo,d as fo}from"./chunk-2JFCDE27.js";import{b as Qe,c as oo,d as so,e as ao,h as co}from"./chunk-PBXGWYB4.js";import{a as $t,w as mo}from"./chunk-6VOUTNRV.js";import{a as ro,c as qt,d as pt,f as xt,i as io}from"./chunk-FBXZWNND.js";import{e as no,l as eo}from"./chunk-4N5CHKHD.js";import{n as re}from"./chunk-GUNNA5LB.js";import{h as In}from"./chunk-URW7MSCJ.js";import{Aa as Zt,Ba as En,C as ze,Ca as qe,D as Kt,Ga as oe,Ia as $e,Xa as St,ca as Ke,da as Ve,eb as wn,j as Ye,ka as $,la as Rt,ua as _n,va as Vt,wa as An,ya as Ze}from"./chunk-YE4NP3XB.js";import{A as Et,D as to,b as Je,d as it,y as at}from"./chunk-JBOTRSMY.js";var ie=t=>t<=.04045?t/12.92:((t+.055)/1.055)**2.4,se=t=>t<=.0031308?12.92*t:1.055*Math.max(0,t)**.4166666666666667-.055,ae=t=>Math.min(1,Math.max(0,t));function Tn(t){let n=ie(t[0]),e=ie(t[1]),r=ie(t[2]),o=Math.cbrt(.4122214708*n+.5363325363*e+.0514459929*r),a=Math.cbrt(.2119034982*n+.6806995451*e+.1073969566*r),i=Math.cbrt(.0883024619*n+.2817188376*e+.6299787005*r);return[.2104542553*o+.793617785*a-.0040720468*i,1.9779984951*o-2.428592205*a+.4505937099*i,.0259040371*o+.7827717662*a-.808675766*i]}function Bn([t,n,e]){let r=(t+.3963377774*n+.2158037573*e)**3,o=(t-.1055613458*n-.0638541728*e)**3,a=(t-.0894841775*n-1.291485548*e)**3;return[ae(se(4.0767416621*r-3.3077115913*o+.2309699292*a)),ae(se(-1.2684380046*r+2.6097574011*o-.3413193965*a)),ae(se(-.0041960863*r-.7034186147*o+1.707614701*a))]}var On=t=>Tn(t)[0];function cn(t){let[,n,e]=Tn(t);return Math.hypot(n,e)}function Xt(t,n,e){let[,r,o]=Tn(t);if(e===void 0)return Bn([n,r,o]);let a=Math.hypot(r,o),i=a===0?0:e/a;return Bn([n,r*i,o*i])}function ho(t,n,e){let[r,o,a]=Tn(t);return r>=n&&r<=e?t:Bn([Math.min(e,Math.max(n,r)),o,a])}function Cn(t){return Bn([t,-.004,-.008])}var ln=["available","held","sold","selected","dimmed"];function ce(t){let n=ln.indexOf(t);return n<0?0:n}var po={available:[.24,.82,.52],held:[.34,.39,.45],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function Ri(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 yo={day:{ground:.9,deck:.84,fascia:.77,shell:.79,seatMin:.45,seatMax:.58,unavailable:.58,dimmed:.62,sectionDeck:.66,sectionDeckChromaShare:.8,sectionDeckChromaCap:.11,stageTop:.52,stageWall:.42},night:{ground:.26,deck:.34,fascia:.28,shell:.32,seatMin:.64,seatMax:.8,unavailable:.42,dimmed:.39,sectionDeck:.34,sectionDeckChromaShare:.45,sectionDeckChromaCap:.05,stageTop:0,stageWall:0}},kn=.012;function Fn(t){return On(t.tierTop)>.6}function jt(t){return t?yo.day:yo.night}function eu(t,n){let e=jt(n);return ho(Ri(t),e.seatMin,e.seatMax)}var le={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]},ue={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 Si from"earcut";import bo from"polygon-clipping";var S=$,Pi=.002;function Ii(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<Pi}var Ut=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)}},Nn=class{constructor(){this.pos=new Ut;this.nor=new Ut;this.col=new Ut;this.flr=new Ut;this.mat=new Ut;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){Ii(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 _i(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 Ai(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=Si(r,o.length?o:void 0,2);return{pts:e,tris:a}}function wt(t){return pt(t)<0?[...t].reverse():t}var Ei=3;function wi(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 un(t,n,e,r,o){if(o<=0)return wi(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(un(t,a,s,r,o-1),un(a,n,i,r,o-1),un(s,i,e,r,o-1),un(a,i,s,r,o-1))}function fn(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};fn(t,n,m,d,o,a,i-1,s),fn(t,m,e,h,o,a,i-1,s),fn(t,d,h,r,o,a,i-1,s),fn(t,m,h,d,o,a,i-1,s);return}let c=[n.x*S,o(n),n.y*S],l=[e.x*S,o(e),e.y*S],u=[r.x*S,o(r),r.y*S];if(s){t.triN(c,l,u,s(n),s(e),s(r),a);return}let f=_i(c,l,u);f[1]<0&&(f=[-f[0],-f[1],-f[2]]),t.tri(c,l,u,f,a)}var Bi=8;function xo(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),Bi)}return r}function Ln(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 vn=.001*Rt*.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=Ln(xo(Ln(wt(n),vn),r,c),vn),f=e?.map(x=>Ln(xo(Ln(wt(x),vn),r,c),vn)).filter(x=>x.length>=3&&Math.abs(pt(x))>=1e-4),{pts:m,tris:h}=Ai(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<Ei;g++){let x=0;for(let I=0;I<h.length;I+=3){let P=un(m[h[I]],m[h[I+1]],m[h[I+2]],r,g);P>x&&(x=P)}if(x<=c)break}for(let x=0;x<h.length;x+=3){let I=m[h[x]],P=m[h[x+1]],_=m[h[x+2]];fn(t,I,P,_,r,d,g,l);let O=[I.x*S,o,I.y*S],C=[P.x*S,o,P.y*S],F=[_.x*S,o,_.y*S];t.tri(O,F,C,[0,-1,0],y)}let R=x=>{if(g<=0)return x;let I=1<<g,P=[];for(let _=0;_<x.length;_++){let O=x[_],C=x[(_+1)%x.length];for(let F=0;F<I;F++){let k=F/I;P.push({x:O.x+(C.x-O.x)*k,y:O.y+(C.y-O.y)*k})}}return P},A=ze(u),M=[{ring:R(u),flip:!1}];if(f)for(let x of f)x.length>=3&&M.push({ring:R(x),flip:!0});for(let{ring:x,flip:I}of M)for(let P=0;P<x.length;P++){let _=x[P],O=x[(P+1)%x.length],C=(O.x-_.x)*S,k=(O.y-_.y)*S,E=-C,w=Math.hypot(k,E)||1;k/=w,E/=w;let B=(_.x+O.x)/2-A.x,L=(_.y+O.y)/2-A.y,T=k*B+E*L;I&&(T=-T),T<0&&(k=-k,E=-E);let v=[k,0,E],H=[_.x*S,r(_),_.y*S],j=[O.x*S,r(O),O.y*S],D=[_.x*S,o,_.y*S],U=[O.x*S,o,O.y*S];t.tri(H,j,U,v,b,b,p),t.tri(H,U,D,v,b,p,p)}}function go(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 It(t,n,e=2.5){if(n<=0||t.length<3)return t;let r=wt(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=bo.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=wt(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=bo.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?wt(f):[]}catch{return[]}}function Gn(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 mn(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},Ti=.44,Oi=.15,Ci=.3,ki=.24;function Ro(t){return t===void 0||!Number.isFinite(t)||t<=0?ki:Math.min(Ci,Math.max(Oi,t*Ti))}var uu=.21,Fi=.05,fe=.45,Li=fe+Fi,vi=.92,Mo=.66,Ni=1.205,Gi=-.23,Di=.38,Hi=[{part:ut.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:ut.pad,min:[-1,.36,-.95],max:[1,fe,1]},{part:ut.back,min:[-1,Li,-1],max:[1,vi,-.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]}],ji=[{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 fu(){let t=[],n=[],e=[],r=[],o=(D,U,X)=>{let Y=e.length,[nt,rt,q]=D,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],G=Q[2]*J[0]-Q[0]*J[2],W=Q[0]*J[1]-Q[1]*J[0],lt=Math.hypot(N,G,W);lt>1e-9?(N/=lt,G/=lt,W/=lt):[N,G,W]=U,N*U[0]+G*U[1]+W*U[2]<0&&(N=-N,G=-G,W=-W);for(let ft of D)t.push(...ft),n.push(N,G,W),e.push(X);r.push(Y,Y+1,Y+2,Y,Y+2,Y+3)},a=D=>{for(let U of ji){let X=U.c.map(Y=>Y.map((nt,rt)=>nt?D.max[rt]:D.min[rt]));o(X,U.n,D.part)}},i=(D,U)=>{let[X,Y,nt]=U?[0,1,2]:[0,2,1],rt=D.min[X],q=D.max[X],Q=D.min[Y],J=D.max[Y],N=(q-rt)*.1,G=(J-Q)*.1,W=U?[[rt+N,Q],[q-N,Q],[q,Q+G],[q*.94,J-(J-Q)*.23],[q*Mo,J],[rt*Mo,J],[rt*.94,J-(J-Q)*.23],[rt,Q+G]]:[[rt+N,Q],[q-N,Q],[q,Q+G],[q,J-G],[q-N,J],[rt+N,J],[rt,J-G],[rt,Q+G]],lt=(st,tt,et)=>{let ht=[0,0,0];return ht[X]=st,ht[Y]=tt,ht[nt]=et,ht},ft=[D.min[nt],D.max[nt]].map(st=>W.map(([tt,et])=>lt(tt,et,st)));for(let st=0;st<W.length;st++){let tt=(st+1)%W.length,et=[0,0,0];et[X]=(W[st][0]+W[tt][0])/2-(rt+q)/2,et[Y]=(W[st][1]+W[tt][1])/2-(Q+J)/2,o([ft[0][st],ft[0][tt],ft[1][tt],ft[1][st]],et,D.part)}for(let st=0;st<2;st++){let tt=[0,0,0];tt[nt]=st?1:-1;let et=ft[st];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(D.part);r.push(z,z+1,z+2)}}};for(let D of Hi)D.part===ut.pad||D.part===ut.back?i(D,D.part===ut.back):a(D);for(let D of Xi)a(D);let s=fe,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],R=[-u,c,h],A=[u,c,h],M=[-u,c,d],x=[u,c,d];o([b,A,x,g],[1,0,0],ut.body),o([p,M,R,y],[-1,0,0],ut.body),o([y,b,g,p],[0,-1,0],ut.body);let I=c+.07,P=.24,_=[-P,I,h],O=[P,I,h],C=[-P,I,d],F=[P,I,d];o([M,C,_,R],[-.5,1,0],ut.body),o([C,F,O,_],[0,1,0],ut.body),o([F,x,A,O],[.5,1,0],ut.body),o([g,x,M,p],[0,0,1],ut.body),o([x,F,C,M],[0,0,1],ut.body),o([y,R,A,b],[0,0,-1],ut.body),o([R,_,O,A],[0,0,-1],ut.body);let k=10,E=8,w=[0,Ni,Gi],B=[.32,.115,Di],L=e.length;for(let D=0;D<=E;D++){let U=Math.PI*D/E,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(w[0]+B[0]*q,w[1]+B[1]*X,w[2]+B[2]*Q);let J=q/B[0],N=X/B[1],G=Q/B[2],W=Math.hypot(J,N,G)||1;J/=W,N/=W,G/=W,n.push(J,N,G),e.push(ut.head)}}for(let D=0;D<E;D++)for(let U=0;U<k;U++){let X=L+D*(k+1)+U,Y=X+k+1;r.push(X,Y,X+1,X+1,Y,Y+1)}let T=new Float32Array(t),v=new Float32Array(n),H=new Float32Array(e),j=new Uint16Array(r);return{position:T,normal:v,part:H,index:j,vertexCount:e.length,indexCount:r.length}}function So(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),R=a(g)-a(p),A=i(g)-i(p),M=Math.hypot(R,A);if(M>1e-6){let x=-A/M,I=R/M;x*y+I*b<0&&(x=-x,I=-I),y=x,b=I}}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 Dn=.22;function Mu(t,n){let e=ln[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 Ui=.42;function Wi(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 R=1;R<=4;R++){for(let A=p-R;A<=p+R;A++)if(!(A<0||A>=f))for(let M=b-R;M<=b+R;M++){if(M<0||M>=u||R>1&&Math.abs(A-p)<R&&Math.abs(M-b)<R)continue;let x=m.get(A*u+M);if(x)for(let I of x){if(I===d)continue;let P=Math.hypot(t[I].x-y.x,t[I].y-y.y);P<g&&(g=P)}}if(Number.isFinite(g)&&g<=R*l)break}e[d]=g}return e}function Yi(t){let n=t.eyeHeightM;return Number.isFinite(n)?Math.max(0,n-_n):0}function Po(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=Wi(t);for(let p=0;p<i;p++){let g=t[p],A=(e?.seatPitchU(p)??b[p])*S;u[p]=Number.isFinite(A)?Math.max(.06,Math.min(Dn,A*Ui)):Dn,f[p]=Ro(Number.isFinite(A)?A:void 0);let M=eo(g.glyph,{seatGlyph:a?.get(g.categoryKey)});m[p]=no.indexOf(M),h[p]=g.wheelchairSpaceType==="no-seat"?0:1,s[p*3]=g.x*S,s[p*3+1]=e?e.seatDeckY(p):Yi(g),s[p*3+2]=g.y*S,c[p]=ce(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 I=it(In(g.accessibility));I&&(d[p*3]=I[0],d[p*3+1]=I[1],d[p*3+2]=I[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 zi=64;function Ru(t,n){let e=[];for(let i of n){let s=t.idToIndex.get(i.seatId);if(s===void 0)continue;let c=ce(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+zi){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 is from"polygon-clipping";var K={top:1,wallBottom:.58,bottomCap:.4};function Wt(t,n){if(!t)return n;let e=V(Et(t,.4),.62);return at(n,e,.22)}function Io(t,n){return t?at(n,V(Et(t,.25),.74),.62):n}function _o(t,n){let e=jt(Fn({tierTop:n}));return t?Xt(t,e.sectionDeck,Math.min(e.sectionDeckChromaShare*cn(t),e.sectionDeckChromaCap)):Xt(n,e.deck,Math.min(cn(n),kn))}function Ao(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 Eo(t,n){return it(t.color)??n.get(t.logicalSectionId??t.id)??null}import Ho from"polygon-clipping";import Oo from"polygon-clipping";import Ki from"earcut";var Vi=.58,wo=.01,Pt=Dn*1.5*Rt,Zi=.5,qi=.6;function $i(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 Qi(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 Bo=Math.PI/12;function Ji(t){if(t.length<3)return[...t];let n=$t(t);return n.length>=3?n:[...t]}function Co(t,n){if(!t.length||!(n>0))return[];let e=Ji(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/Bo)),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/Bo)),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 No(i)}function ts(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 Hn(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=ts(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 ko(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=Qi(a,Math.max(c*qi,Pt));return{pts:l,nrm:$i(l,r),front:Math.max(e[n].pitch*Vi,Pt),back:Math.max(e[n].pitch*Zi,Pt)}}var Qt=1.5,Fo=.3;function me(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=me(t.slice(0,c+1),n),u=me(t.slice(c),n);return[...l.slice(0,-1),...u]}function Lo(t,n){if(t.length<4)return t;let e=me([...t,t[0]],n);return e.pop(),e.length>=3?e:t}function ns(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 vo(t,n,e){if(t.length<2)return[];let r=e??Hn(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 R=t[g].patch;R&&R.length>=3?a.push({outline:[...R],holes:[],topY:t[g].y}):s.push(g)}if(!s.length)continue;s.sort((g,R)=>t[g].depth-t[R].depth);let l=s.map(g=>ko(t,g,r,n)).filter(g=>g!==null);if(!l.length)continue;let u=(g,R)=>({x:g.pts[R].x-g.nrm[R][0]*(g.front+Qt),y:g.pts[R].y-g.nrm[R][1]*(g.front+Qt)}),f=(g,R)=>({x:g.pts[R].x+g.nrm[R][0]*(g.back+Qt),y:g.pts[R].y+g.nrm[R][1]*(g.back+Qt)}),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=No(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 R=g.pts[Math.floor(g.pts.length/2)];return xt(y,R.x,R.y)})&&!ns(y)){a.push({outline:Lo(y,Fo),holes:[],topY:b});continue}for(let g of es(l))a.push({outline:g,holes:[],topY:b})}return a}function es(t){let n=[];for(let e of t){let r=[],o=[],a=e.front+Qt,i=e.back+Qt;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=Oo.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(Lo(a,Fo))}return r}catch{return[]}}function No(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 he=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 To(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*S,o,u.y*S],[m.x*S,o,m.y*S],[h.x*S,o,h.y*S],l,a)}return}let i=r.map(l=>[l.x,l.y]);i.push(i[0]);let s;try{s=Oo.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=Ki(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]*S,o,y[1]*S],[b[0]*S,o,b[1]*S],[p[0]*S,o,p[1]*S],c,a)}}}function Go(t,n,e,r,o,a,i){if(n.length<2)return;let s=i??Hn(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 he([[...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)To(t,l,u,M,d.y,o.tread);else{let I=M[0];for(let P=1;P+1<M.length;P++){let _=M[P],O=M[P+1];t.tri([I.x*S,d.y,I.y*S],[_.x*S,d.y,_.y*S],[O.x*S,d.y,O.y*S],c,o.tread)}}}),d.y>x+wo){let I=0,P=0;for(let _ of M)I+=_.x,P+=_.y;I/=M.length,P/=M.length,f(()=>{for(let _=0;_<M.length;_++){let O=M[_],C=M[(_+1)%M.length],F=C.x-O.x,k=C.y-O.y,E=Math.hypot(F,k);if(E<1e-6)continue;let w=k/E,B=-F/E;(O.x-I)*w+(O.y-P)*B<0&&(w=-w,B=-B);let L=[w,0,B],T=[O.x*S,d.y,O.y*S],v=[C.x*S,d.y,C.y*S],H=[O.x*S,x,O.y*S],j=[C.x*S,x,C.y*S];t.tri(T,v,j,L,o.riser),t.tri(T,j,H,L,o.riser)}})}continue}let y=ko(n,h,s,e);if(!y)continue;let{pts:b,nrm:p,front:g,back:R}=y,A=s[h].belowY??r;for(let M=0;M+1<b.length;M++){let x=b[M],I=b[M+1],P=p[M],_=p[M+1];if(Math.hypot(I.x-x.x,I.y-x.y)<1e-6||P[0]===0&&P[1]===0||_[0]===0&&_[1]===0)continue;let O=[(x.x-P[0]*g)*S,d.y,(x.y-P[1]*g)*S],C=[(I.x-_[0]*g)*S,d.y,(I.y-_[1]*g)*S],F=[(x.x+P[0]*R)*S,d.y,(x.y+P[1]*R)*S],k=[(I.x+_[0]*R)*S,d.y,(I.y+_[1]*R)*S];if(m(()=>{l&&u?To(t,l,u,[{x:x.x-P[0]*g,y:x.y-P[1]*g},{x:I.x-_[0]*g,y:I.y-_[1]*g},{x:I.x+_[0]*R,y:I.y+_[1]*R},{x:x.x+P[0]*R,y:x.y+P[1]*R}],d.y,o.tread):(t.tri(O,C,k,c,o.tread),t.tri(O,k,F,c,o.tread))}),d.y>A+wo){let E=[O[0],A,O[2]],w=[C[0],A,C[2]],B=[-P[0],0,-P[1]];f(()=>{t.tri(O,C,w,B,o.riser),t.tri(O,w,E,B,o.riser)})}}}}function os(t,n){let e=t.eventConfigurationIds;return!e?.length||!!n&&e.includes(n)}function Do(t,n){return t.filter(e=>e.type!=="shape"||os(e,n))}function Xo(t,n){let e=t.focalPoint??{x:0,y:0};return t.floors?.length?t.floors.map((r,o)=>({objects:Do(r.objects,n),focal:{x:(r.focalPoint??e).x,y:(r.focalPoint??e).y},baseHeightM:r.baseHeightM??0,index:o})):[{objects:Do(t.objects,n),focal:e,baseHeightM:0,index:0}]}var rs={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function Tt(t){return ro(t)??rs}function jo(t,n){let e=It(t.outline,Pt),r=Tt(e),o=n.filter(i=>i!==t&&i.outline&&i.outline.length>=3&&qt(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=Ho.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 Uo(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=Ho.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 ss(t,n){return t===void 0||n===void 0?!0:Math.abs(t-n)<.001}var Xn=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)=>qt(o,this.boxes[l])&&ss(e,this.levels[l])),i=[[r]];if(a.length)try{i=is.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 Jt(t,n,e=t){if(!n)return t;let r=1/0,o=-1/0,a=1/0,i=-1/0;for(let m of e)r=Math.min(r,m.x),o=Math.max(o,m.x),a=Math.min(a,m.y),i=Math.max(i,m.y);let s=(r+o)/2,c=(a+i)/2,l=n*Math.PI/180,u=Math.cos(l),f=Math.sin(l);return t.map(m=>{let h=m.x-s,d=m.y-c;return{x:s+h*u-d*f,y:c+h*f+d*u}})}function Wo(t){let n=Ve(t);return!n.length||!t.points?.length?[]:n.map(e=>Jt(e,t.rotation,t.points))}function ct(t){let n=null;if(t.kind==="polygon"&&t.points&&t.points.length>=3)return Jt(Ke(t,4),t.rotation,t.points);if(t.kind==="rect"&&t.width&&t.height&&(n=mn(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=Gn(e,r,t.width/2,t.height/2)}return n?Jt(n,t.rotation):null}function _t(t){let n=t.role??"",r=n==="stage"?{kind:"stage",heightM:qe(t.stageKind)}:{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}}[n]??{kind:"plate",heightM:.25};return{...r,heightM:t.heightM??r.heightM}}var as=.08,cs=30,ls=.015;function us(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 Yo(t,n){let e=ct(t)??(t.points?.length?Jt(t.points,t.rotation):null),r=_t(t),a=!t.role&&r.kind==="plate"&&t.heightM===void 0&&!!e&&Math.abs(pt(e))*$**2>=cs?ls: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+as),i>=h.minX-m&&c<=h.maxX+m&&s>=h.minY-m&&l<=h.maxY+m&&(!h.poly||e.every(b=>us(b,h.poly)||fs(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 fs(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 vt(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[vt(t[0],t[1],n),vt(t[0],t[1],e),vt(t[3],t[2],e),vt(t[3],t[2],n)]}function hn(t,n,e){return[vt(t[0],t[3],n),vt(t[1],t[2],n),vt(t[1],t[2],e),vt(t[0],t[3],e)]}function ot(t,n,e,r,o,a,i){Z(t,n,i?.length?i:void 0,()=>e,r,o,a,K)}function yn(t){if(t.length<3)return t.map(e=>({...e}));let n=$t(t);return n.length>=3?n:[...t].sort((e,r)=>e.x-r.x||e.y-r.y).map(e=>({...e}))}var ms=.8,hs=.6,ys=2;function Nt(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=zo(s)/2;!(c>0)||xs(s)/c*S>ys||(e.push(...s),r+=c)}if(e.length<3)return null;let o=yn(e);if(o.length<3||r<zo(o)*hs)return null;let a=0;for(let i of n)bs(i,o)&&(a+=1);return a>=n.length*ms?o:null}var jn=6,ds=5,ps=8;function Ko(t){return Math.max(ps,(Number.isFinite(t)?t:0)+ds)}function tn(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 xs(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 zo(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 bs(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 gs=[[/\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"]],Ms=1.2,Rs=12;function Vo(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*$<Rs*2?!1:2*dn(n)/e*$<=Ms}function ye(t){if(!t)return null;for(let[n,e]of gs)if(n.test(t))return e;return null}var qo="auto-rows-";function $o(t){return t.id.startsWith(qo)&&!t.label}var Ss=1.15,Ps=.09,Qo=6,Is=34,_s=.35,As=6,Es=.35,ws=.75,Bs=12,Ts=2.5,Os=40,Cs=[18,24],ks=[12,16],Zo=14,Fs=.8,Ls=.6,vs=5,Ns=.3,Jo=.4,tr=2,Gs=400,Ds=2.6,Hs=.8,Xs=4,js=26,Us=.7,Ws=.5,Ys=.985,zs=1.5,Ks=2.2,Vs=3,Zs=25,qs=.985,$s=2,Qs=6,Js=3,ta=.1,na=1.5,ea=1.6,oa=6e3,ra=.6,ia="#c3c7cd",de=300,sa=240;function aa(t,n,e,r){if(!t.fill||!/^#[0-9a-f]{6}$/i.test(t.fill))return null;let o=xe([...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<sa)return null;let{h:i,s,l:c}=to(Je(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=>Me(f,n)))?null:t.kind==="ellipse"?"oval-cricket":t.kind==="rect"?"pitch-football":null}var ca="Estimated from the drawing; confirm with the venue.",be=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},xe=t=>({x:t.reduce((n,e)=>n+e.x,0)/t.length,y:t.reduce((n,e)=>n+e.y,0)/t.length}),dn=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 la(t){return t.height!==void 0||t.rake!==void 0||t.elevation!==void 0||t.surfaceKind!==void 0}function ge(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 Me(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 Re(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 nr(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=Re(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 ua(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:xe(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=dn(b);if(p*$*$<6||p>l)continue;let g=Math.min(...b.map(_=>_.x)),R=Math.max(...b.map(_=>_.x)),A=Math.min(...b.map(_=>_.y)),M=Math.max(...b.map(_=>_.y)),x=0;for(let _ of e)_.x>g&&_.x<R&&_.y>A&&_.y<M&&Me(_,b)&&x++;if(x>e.length*.05)continue;let I=xe(b),P=nr(n,b);P>=Fs&&u.push({shape:y,centre:I,outline:b,score:P,area:p,box:[g,A,R,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 fa(t,n,e){if(!e||e.length<3)return Math.hypot(t.x-n.x,t.y-n.y);let r=Re(t,e);return Math.hypot(t.x-r.x,t.y-r.y)}function er(t){return t.length<3?[...t].sort((n,e)=>n.x-e.x||n.y-e.y):$t(t)}function ma(t){if(!t.length||t.length>oa)return[];let n=[...ge(t).values()],e=n.map((s,c)=>c),r=s=>e[s]===s?s:e[s]=r(e[s]),o=ea/$,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 ha(t,n,e){if(!n.length)return null;let r=n.filter(P=>e.tableIds.has(P.rowId)||P.kind==="booth").length>n.length/2,o=ge(n),a=!e.outline||nr(o,e.outline)>=Ls,i=0,s=0;for(let P of o.values()){if(P.length<2)continue;let _=P[0],O=P[P.length-1],C=O.x-_.x,F=O.y-_.y,k=Math.hypot(C,F);if(k<1e-6)continue;let E={x:(_.x+O.x)/2,y:(_.y+O.y)/2},w=a?e.outline?Re(E,e.outline):e.focal:e.middle,B=-F/k,L=C/k;B*(w.x-E.x)+L*(w.y-E.y)<0&&(B=-B,L=-L),i+=B*P.length,s+=L*P.length}let c={x:n.reduce((P,_)=>P+_.x,0)/n.length,y:n.reduce((P,_)=>P+_.y,0)/n.length};if(Math.hypot(i,s)<1e-9){let P=a?e.focal:e.middle;i=P.x-c.x,s=P.y-c.y}let l=Math.hypot(i,s)||1,u={x:i/l,y:s/l},f=P=>-(P.x*u.x+P.y*u.y),m=P=>-P.x*u.y+P.y*u.x,h=1/0,d=-1/0,y=1/0,b=-1/0,p=1/0,g=new Map;for(let P of n){let _=f(P),O=m(P);h=Math.min(h,_),d=Math.max(d,_),y=Math.min(y,O),b=Math.max(b,O),a&&(p=Math.min(p,fa(P,e.focal,e.outline)));let C=P.logicalRowId??P.rowId,F=g.get(C);F?F.push(_):g.set(C,[_])}a||(p=Math.max(0,h-f(e.middle)));let R=[...g.values()].map(P=>be(P)).sort((P,_)=>P-_),A=[];if(!r)for(let P of R)A.length&&P-A[A.length-1]<Es/$||A.push(P);let M=la(t),x=Vt(t,{floorBaseHeightM:e.baseHeightM}),I={id:t.id,section:t,authored:M,plane:e,facing:u,facesAction:a,hull:er(n),sample:n.filter((P,_)=>_%Math.ceil(n.length/Gs)===0),frontD:h,backD:d,latMin:y,latMax:b,frontDistance:p,rowDepths:A,rowCount:A.length,level:0,height:x.height,rake:M?x.rake:0,backHeight:0};return I.backHeight=I.height+(d-h)*$*Math.tan(I.rake*Math.PI/180),I}function ya(t,n,e,r){if(t.length<2)return 0;let o=Math.max(1,n*$),a=e+Ss-r,i=0,s=0;for(let l=1;l<t.length;l++){let u=Math.max(ws,(t[l]-t[l-1])*$),f=(a+Ps)*(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(Qo,Math.min(Is,c))*10)/10}function da(t,n,e=!1){if(!e&&t.facing.x*n.facing.x+t.facing.y*n.facing.y<Ns)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:Jo*(t.latMax-t.latMin)))return null;let s=tr/$,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?be(u):t.frontD-r;return f<-1/$?null:f}function pa(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>Jo*(t.latMax-t.latMin)&&s>1/$}function xa(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 ba(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 ga(t,n){if(!t.facesAction)return!1;let e={x:-t.facing.y,y:t.facing.x},r=tr/$,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>=Ys))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)<Us)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>=Ws};return i("left")&&i("right")}function Ma(t,n){if(n.plane.floorIndex!==t.plane.floorIndex||n.facing.x*t.facing.x+n.facing.y*t.facing.y<qs)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<-$s||a>Qs)return!1;let i=Math.max(e-t.latMax,t.latMin-r);return i*$<=Js&&i*$>=-ta}function Ra(t,n=!1,e=!1,r){let o=n?ks:Cs,a=new Set(e?[]:t.filter(y=>!y.authored&&ga(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,R=[],A=new Map,M=x=>{if(x.plane.floorIndex===0||x.plane.baseHeightM>0)return x.plane.baseHeightM;let I=A.get(x.plane.floorIndex-1);return I===void 0?x.plane.baseHeightM:I+mo};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 P=M(x),_;for(let E of R){if(E.plane.floorIndex>x.plane.floorIndex)continue;if(pa(x,E)){let T=ba(x,E)+Ds;T>P&&(P=T,_=E);continue}let w=da(x,E,a.has(E));if(w==null)continue;let B=e&&!!x.plane.stageDeck&&E.level===0&&E.plane.floorIndex===x.plane.floorIndex&&Math.max(0,w)*$<=Xs,L=a.has(E)?E.height+zs:B?E.backHeight:E.backHeight+_s+Math.min(As,Math.max(0,w)*$)*Math.tan(E.rake*Math.PI/180);L>P&&(P=L,_=E)}let O=y.get(x);O&&O.height>P+.01?(P=O.height,_=void 0):O=void 0,x.height=Math.round(Math.min(P,x.plane.baseHeightM+Os)*100)/100;let C=!_&&!O&&x.height>x.plane.baseHeightM;if(x.level=_?_.level+1:O?O.level:C?1:0,x.rake=ya(x.rowDepths,x.frontDistance,x.height,x.plane.focalHeightM),!x.facesAction&&x.rowCount<vs)x.rake=0;else if(x.level===0){let E=Math.max(1e-6,(x.backD-x.frontD)*$);x.rake=Math.min(x.rake,Bs,Math.round(Math.atan(Ts/E)*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=_&&a.has(_)||O&&p?.has(O.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+Zo){let E=Math.max(0,x.plane.baseHeightM+Zo-x.height);x.rake=Math.max(Qo,Math.round(Math.atan(E/F)*1800/Math.PI)/10)}e&&x.plane.stageDeck&&x.level>0&&(x.rake=Math.min(x.rake,js)),x.backHeight=x.height+F*Math.tan(x.rake*Math.PI/180),g.set(x.id,_?.id??(O?g.get(O.id):void 0))}let I=x.plane.floorIndex;A.set(I,Math.min(A.get(I)??1/0,x.height)),R.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 R=l.get(g)??g;g===p||R.height-R.plane.baseHeightM<na||R.height<=u(p)+.01||Ma(p,g)&&(l.set(p,R),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?be(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 pe=(t,n)=>!!t&&t.x===n.x&&t.y===n.y;function or(t,n={x:0,y:-40}){let e=wn(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,R=ma(e.filter(k=>!k.sectionId&&k.kind!=="booth"&&!i.has(k.rowId)&&g(k))),A=[];for(let k of R){let E=It(wt(er(k)),ra/$);if(e.some(B=>!g(B)&&Me(B,E)))continue;let w=`${qo}${p.floorIndex}-${A.length}`;l.add(w),r.set(w,k),A.push({type:"section",id:w,label:"",color:ia,outline:E})}let M=A.length?{...p,objects:[...p.objects,...A]}:p,x=new Set(M.objects.filter(k=>k.type==="section").map(k=>k.logicalSectionId??k.id)),I=[...r.entries()].filter(([k])=>x.has(k)).flatMap(([,k])=>k),P=ua(M.objects,ge(I),I),_=M.focal;(P||M.focal&&!pe(M.focal,n))&&(o.confident=!0),P&&(o.stage??={id:P.shape.id,inferred:P.inferred,...M.floorId?{floorId:M.floorId}:{}},(P.inferred||pe(M.focal,n))&&(_=P.centre,o.focalInferred=!0));let O=P&&(!P.inferred||dn(P.outline)*$*$<=de),C=P?void 0:c,F={tableIds:i,floorIndex:M.floorIndex,floorId:M.floorId,baseHeightM:M.baseHeightM,focal:C?.focal??_,outline:P?.outline??C?.outline,focalHeightM:C?.focalHeightM??M.baseHeightM+(P&&O?_t({...P.shape,role:"stage"}).heightM:0),stageDeck:C?.stageDeck??!!(P&&O&&dn(P.outline)*$*$<=de),middle:I.length?{x:I.reduce((k,E)=>k+E.x,0)/I.length,y:I.reduce((k,E)=>k+E.y,0)/I.length}:_};for(let k of M.objects){if(k.type!=="section")continue;let E=ha(k,r.get(k.logicalSectionId??k.id)??[],F);E&&s.push(E)}return F.outline&&(c=F),pe(M.focal,F.focal)||(o.focal??=[]).push({...M.floorId?{floorId:M.floorId}:{},point:{...F.focal}}),{unit:M,plane:F,stage:P,planeSeats:I}}),f=a.flatMap(p=>p.objects).map(p=>p.type==="shape"&&!p.role&&(ye(p.label)==="wall"||!ye(p.label)&&Vo(p))?{...p,role:"wall"}:p),m=Nt({objects:f},e)!==null;m&&(o.indoor=!0);let h=new Set,d=Ra(s,m,xa(e,u[0]?.plane.focal??n)<Hs,h),y=new Map(s.filter(p=>!p.authored).map(p=>[p.id,p])),b=u.map(({unit:p,plane:g,stage:R,planeSeats:A})=>p.objects.map(M=>{let x=M.type==="shape"&&!M.role&&M.id!==R?.shape.id?ye(M.label):null;if(M.type==="shape"&&!M.role&&M.id!==R?.shape.id&&(x==="wall"||!x&&Vo(M))&&M.type==="shape"){(o.roles??=[]).push({id:M.id,...g.floorId?{floorId:g.floorId}:{},role:"wall"});let{fill:E,...w}=M;return{...w,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 P=R?.inferred&&M.id===R.shape.id&&M.type==="shape"?aa(M,R.outline,p.objects,A):null;if(P&&M.type==="shape")return o.stage?.id===M.id&&(o.stage.field=P),{...M,role:"stage",stageKind:P};let _=M.type==="shape"&&M.id===R?.shape.id&&M.heightM===void 0&&!M.stageKind&&s.some(E=>E.plane===g&&(h.has(E.id)||E.level===0&&E.facesAction&&E.rake<=Vs&&(E.frontDistance+E.backD-E.frontD)*$>=Zs)),O=_?{heightM:Ks}:{};if(R?.inferred&&M.id===R.shape.id&&M.type==="shape"&&dn(R.outline)*$*$<=de)return o.stage?.id===M.id&&(o.stage.deck=!0),{...M,role:"stage",...O};if(_&&M.type==="shape"&&M.role==="stage")return{...M,...O};let C=M.type==="section"?y.get(M.id):void 0;if(!C||M.type!=="section")return M;let F=C.rowCount>=2&&C.rake>0;l.has(C.id)?o.looseRowBlocks=(o.looseRowBlocks??0)+1:o.sections.push({id:C.id,floorId:g.floorId,surfaceKind:F?"rakedRows":"flat",height:C.height,rake:C.rake,stackedOn:d.get(C.id)});let k={status:"inferred",source:"public-2d-topology",note:ca};return{...M,height:C.height,rake:C.rake,surfaceKind:F?"rakedRows":"flat",physical3dProvenance:{height:k,rake:k,surfaceKind:k}}}));if(t.floors?.length){let p=t.floors.map((g,R)=>({...g,objects:b[R],focalPoint:u[R].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 hf(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 yf(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 Sa=1.15,Pa=2.75,Ia=4.5,_a=.85,Aa=.5,Ea=.26;function df(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>=Sa&&i.add("zone"),o<=(a?Pa:Ia)&&(i.add("section"),i.add("ga")),o<=_a&&(i.add("annotation"),i.add("booth")),o<=Aa&&i.add("row"),o<=Ea&&i.add("seat"),i}function pf(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 xf(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 bf(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(Se(i,c,n,e)){s=!0;break}s||o.push(i)}return o}var wa=6;function Se(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+wa):e;return o<i&&a<r}function gf(t,n,e){return t.length*n*.58+(e?14:0)}var Ba={row:8,seat:14};function Mf(t){return t<480?{row:5,seat:8}:t<768?{row:6,seat:10}:Ba}function Rf(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 Sf(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(Se(s,l,n,e)){c=!0;break}if(!c){for(let l of i)if(Se(s,l,n,e)){c=!0;break}}c||i.push(s)}return i}function Pf(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 nn(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)*S,a=Math.hypot(r[3].x-r[0].x,r[3].y-r[0].y)*S;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 Pe(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)*S;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:hn(s,.15,.85),bottom:n+a,top:e-a}}function rr(t,n,e,r){let o=Pe(t,n,e);if(!o)return;let{panel:a}=o,i=(g,R)=>({x:(g.x+R.x)/2,y:(g.y+R.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*S*.05),y=m.x/h*d,b=m.y/h*d,p=(g,R)=>[g.x*S+y,R,g.y*S+b];return[p(u,o.bottom),p(f,o.bottom),p(u,o.top),p(f,o.top)]}import Oa from"polygon-clipping";import Ta 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||!qt(c,Tt(b)))return[];let p=s.portalBase??e,g=nn(b,p,p+_t(y).heightM);if(!g)return[];let R=Math.min(r,g.openingTop);return R<=e?[]:[{poly:g.opening,height:R}]});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(A=>A.height>b+1e-6).map(A=>[f(A.poly)]),R=g.length?Ta.difference(m,...g):[m];d.push({low:b,high:p,polys:R})}}catch{return!1}for(let y of d)for(let b of y.polys){let[p,...g]=b.map(A=>A.map(([M,x])=>({x:M,y:x}))),R=A=>l.wallBottom+(l.top-l.wallBottom)*(A-e)/(r-e);Z(t,p,g,()=>y.high,y.low,a,i,{...l,top:R(y.high),wallBottom:R(y.low)})}return!0}var Ie={depthM:1.6,thicknessM:.35,minWallM:6};function Un(t,n,e,r,o,a,i,s,c){let l=r-e;if(l<=0)return;let u=s&&(c??l)>=Ie.minWallM?Ca(n,s):null,f=u?r-Ie.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)},R=V(a,p),A=V(i,p);Ot(t,n,y,b,o,R,A,{portalBase:e,ao:g})||Z(t,n,void 0,()=>b,y,R,A,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=Ie.depthM/S,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=Oa.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 pn(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?Jt(n.points??[],n.rotation):ct(n);if(!i||i.length<2)return;let s=o*.5,c=so(n)?co(i,...ao(o)):Array.from({length:a?i.length-1:i.length},(l,u)=>[i[u],i[(u+1)%i.length]]);for(let[l,u]of c){let f=Math.hypot(u.x-l.x,u.y-l.y);if(f<1e-6)continue;let m=-(u.y-l.y)/f*s,h=(u.x-l.x)/f*s,d=[(l.x+m)*S,e,(l.y+h)*S],y=[(u.x+m)*S,e,(u.y+h)*S],b=[(u.x-m)*S,e,(u.y-h)*S],p=[(l.x-m)*S,e,(l.y-h)*S];t.tri(d,y,b,[0,1,0],r),t.tri(d,b,p,[0,1,0],r)}}function ir(t){return t==="bar"||t==="concession"||t==="coat"||t==="restroom"}var en=(t,n,e)=>({x:t.x+(n.x-t.x)*e,y:t.y+(n.y-t.y)*e});function Wn(t,n,e,r){let[o,a,i,s]=n?t:[t[3],t[2],t[1],t[0]];return[en(o,s,e),en(a,i,e),en(a,i,r),en(o,s,r)]}function sr(t,n,e,r,o,a,i,s,c=!1){if(e.length!==4||o-r<.4)return!1;let l=P=>c?Math.min(P,o):P,u=bt(e),f=Math.hypot(u[3].x-u[0].x,u[3].y-u[0].y)*S;if(f<.4)return!1;let m=en(u[0],u[1],.5),h=en(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=at(i,[.92,.9,.86],.35),b=V(a,.72),p=o-r;if(n==="restroom"){let P=Math.min(.18,p*.08);return ot(t,u,o-P,r,i,a),ot(t,u,o,o-P,y,y),!0}let g=r+Math.min(1.1,p),R=n==="coat"?1:Math.min(.5,.75/f),A=Wn(u,d,0,R);if(ot(t,A,g-.05,r,b,a),ot(t,A,g,g-.05,y,y),n==="coat"||f<1.2)return!0;if(n==="bar"){let P=Wn(u,d,Math.max(R+.2,1-.45/f),1),_=l(r+Math.max(Math.min(2.2,p*2),g-r+.6));return ot(t,P,_,r,i,b),!0}let M=Wn(u,d,Math.max(R+.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 I=Math.min(.08,.1/Math.max(.1,Math.hypot(u[1].x-u[0].x,u[1].y-u[0].y)*S));for(let[P,_]of[[0,I],[1-I,1]])ot(t,Wn(dt(u,P,_),d,0,Math.min(.08,.1/f)),x-.14,g,b,b);return!0}var Gt=.06,ka=.05,cr=.05,ar=.15,_e=25;function lr(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=It(d.outline,Pt);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&&St({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||!St({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 R=h.focalPoint??p.unit.focal,A=Math.hypot(h.x-R.x,h.y-R.y);A<g.frontU&&(g.frontU=A),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=Vt(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,R=g==="flat"?!0:g==="rakedRows"&&d.rake>.01?!1:p,A=h.hasSeats?Ze(m,n,h.seatIndices,h.unit.focal):{sectionId:m,rows:[],blockCount:0},x=A.rows.length<2?lo([...h.rows.values()].map(T=>({points:T})),h.unit.focal):null,I=1/0;if(x){if(h.hasSeats)for(let T of h.rows.values())for(let v of T){let H=x.depthAt(v.x,v.y);H<I&&(I=H)}if(!h.hasSeats||!Number.isFinite(I)){I=1/0;for(let T of h.section.outline){let v=x.depthAt(T.x,T.y);v<I&&(I=v)}}}let P=y+ka,_=Math.max(P,d.height),O=T=>{let v=Math.max(0,T-I)*$,H=Math.min(v*b,_e);return Math.max(P,d.height+H)},C=T=>{let v=Math.max(0,T)*$,H=Math.min(v*b,_e);return Math.max(P,d.height+H)},F=R?[]:A.rows.map(T=>({pts:T.pts,y:C(T.blockDepth),depth:T.blockDepth,blockId:T.blockId,...u.has(T.id)?{patch:Co(T.pts,Pt)}:{}})),k=F.length?F[0].y:_,E=F.map(T=>{let v=T.patch&&T.patch.length>=3?T.patch:T.pts,H=0,j=0;for(let X of v)H+=X.x,j+=X.y;let D=v.length||1;H/=D,j/=D;let U=0;for(let X of v){let Y=Math.hypot(X.x-H,X.y-j);Y>U&&(U=Y)}return{cx:H,cy:j,rad:U}}),w=R?()=>_:F.length>=2?(T,v)=>{let H=1/0,j=k;for(let D=0;D<F.length;D++){let U=E[D];if(Math.hypot(T-U.cx,v-U.cy)-U.rad>=H)continue;let X=F[D].patch,Y=X&&X.length>=3?xt(X,T,v)?0:An(X,T,v):An(F[D].pts,T,v);Y<H&&(H=Y,j=F[D].y)}return j}:(T,v)=>x?O(x.depthAt(T,v)):_,B=[0,1,0],L=F.length>=2||R?()=>B:(T,v)=>{if(!x)return B;let H=x.depthAt(T,v);if(H<=I)return B;let j=(H-I)*$;if(j*b>=_e||d.height+j*b<=P)return B;let[D,U]=x.gradientAt(T,v);if(D===0&&U===0)return B;let X=1/Math.hypot(b,1);return[-D*b*X,X,-U*b*X]};if(!R)for(let T of A.rows){let v=C(T.blockDepth);for(let H of T.seatIndices)i[H]=v}for(let T of A.rows){let v=[];for(let X=1;X<T.pts.length;X++){let Y=Math.hypot(T.pts[X].x-T.pts[X-1].x,T.pts[X].y-T.pts[X-1].y);Y>1e-6&&v.push(Y)}v.sort((X,Y)=>X-Y);let H=v.length?v[Math.floor(v.length/2)]:1/0,j=1/0,D=T.pts[Math.floor(T.pts.length/2)];if(D)for(let X of A.rows){if(X===T||X.blockId!==T.blockId)continue;let Y=An(X.pts,D.x,D.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 T.seatIndices)s[X]=U}r.set(m,{sectionId:m,deckAt:w,normalAt:L,flat:R,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))+ar;continue}let y=d.eyeHeightM,b=Number.isFinite(y)?Math.max(0,y-_n):0;a[m]=d.kind==="booth"?b+Gt+ar:b}return{bySection:r,seatOwner:o,seatDeckY:m=>a[m],seatPitchU:m=>s[m]}}var Fa=[.12,.38,.16],La=[.72,.62,.45],va=[.88,.93,.96],ur=[.95,.95,.94],Na=[.66,.29,.22],Ae={length:20.12,width:3.05},Ga=.14,Da=9.76,Ct=[.93,.94,.95],Yn=[.1,.11,.13],Ha=[.45,.85,1.25],Xa=1.45,fr=.012,mr=.004,ja=1.07,Ua=.15;function rn(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 hr=(t,n)=>Lt(t,n/S);function yr(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 Wa(t,n,e,r){let o=n.map(a=>[a.x*S,e,a.y*S]);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 zn(t,n,e,r,o,a){let i=e/S,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 on(t,n,e,r,o,a,i){let s=yr(n,e,r/S);s&&Z(t,s,void 0,()=>a,o,i,V(i,.85),K)}function Kn(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)/S,y:e.y+(a.y*c+i.y*l)/S}),lengthM:r*S,widthM:o*S}}function dr(t,n,e){let r=$e(n);if(!r.length)return;let o=1/0,a=-1/0,i=1/0,s=-1/0;for(let R of n.points??[])o=Math.min(o,R.x),a=Math.max(a,R.x),i=Math.min(i,R.y),s=Math.max(s,R.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=R=>c?{x:f+(R.x-f)*l-(R.y-m)*u,y:m+(R.x-f)*u+(R.y-m)*l}:R,d=Math.min(a-o,s-i)*S,y=Math.max(.04,Math.min(.3,d*.004))/S,b=0;t.setMaterial(0);for(let R of r){if(!R.fill)continue;let A=R.points.map(h);rn(t,A,null,e+fr+b*mr,it(R.fill)??Ct,0),b++}let p=r.filter(R=>!(R.fill&&R.ink===R.fill)),g=[...new Set(p.map(R=>R.ink??oe))];for(let R of g){let A=e+fr+b++*mr,M=it(R)??Ct;for(let x of p){if((x.ink??oe)!==R)continue;let I=x.points.map(h),P=x.closed?I.length:I.length-1;for(let _=0;_<P;_++){let O=yr(I[_],I[(_+1)%I.length],y);O&&Wa(t,O,A,M)}}}}function pr(t,n,e,r,o){if(n.length<3)return!1;let a=r+.006,i=o??Fa;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),I=M===u-1?null:l(1-(M+1)/u);rn(t,x,I,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*S*Ga/Ae.length),g=Ae.length*p/2/S,R=Ae.width*p/2/S,A=[[-g,-R],[g,-R],[g,R],[-g,R]].map(([M,x])=>({x:s+h*M+y*x,y:c+d*M+b*x}));return rn(t,A,null,a+.004,La,0),t.setMaterial(0),!0}if(e==="rink-hockey"){let s=hr(n,Ua);return rn(t,s,null,a,va,0),t.setMaterial(0),Z(t,n,[s.slice().reverse()],()=>r+ja,r,ur,V(ur,.9),K),!0}if(e==="ring-boxing"&&n.length===4){let{at:s}=Kn(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)=>zn(t,u,.07,r,r+Xa,l[f]));for(let u of Ha)for(let f=0;f<4;f++)on(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}=Kn(n);t.setMaterial(0),on(t,s(0,-6.4),s(0,6.4),.015,r,r+.95,Yn),on(t,s(0,-6.4),s(0,6.4),.03,r+.95,r+1,Ct);for(let c of[-1,1])zn(t,s(0,c*6.4),.05,r,r+1.07,Yn);return!0}if(e==="court-basketball"&&n.length===4){let{at:s,lengthM:c}=Kn(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);zn(t,f,.12,r,r+3.4,Yn),on(t,f,m,.06,r+3.25,r+3.4,Yn),on(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}=Kn(n),l=c*(50/120);t.setMaterial(0);for(let u of[-1,1]){for(let f of[-2.8,2.8])zn(t,s(u*l,f),.07,r,r+12,Ct);on(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=hr(n,Da);return s.length<3?!1:(rn(t,n,s,a,Na,0),rn(t,s,null,a,i,4),t.setMaterial(0),!0)}return!1}var xr=[.19,.4,.15],Ya=.012,$n=2.4,za=1,Ka=.75,Va=.15;function At(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 Ir(t,n,e,r,o,a,i=!1){let s=At(n);if(s){if(i){let c=Wt(r,o.boothTop),l=wt([...s]);Z(t,It(l,Za/S),[l.slice().reverse()],()=>e+.03,e,c,V(c,.8),K);return}if(!(!n.points&&a&&$a(t,s,e,r,a))){if(!n.points&&a&&s.length===4){qa(t,s,e,r,a);return}Z(t,s,void 0,()=>e+$n,e,Wt(r,o.boothTop),o.boothWall,K)}}}var Ee=1.1,br=[.9,.9,.88],Za=.1,Vn=[.87,.87,.85],gr=.08;function _r(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)*S,widthM:Math.hypot(a[1].x-a[0].x,a[1].y-a[0].y)*S}}function qa(t,n,e,r,o){let{q:a,part:i}=_r(n,o),s=r??[.35,.42,.55],c=at(s,[.78,.78,.77],.62),l=at(s,[.95,.95,.94],.45);ot(t,a,e+Gt,e,c,V(c,.8)),ot(t,i(.05,.95,.72,.98),e+Ee-.05,e+Gt,l,V(l,.8)),ot(t,i(.03,.97,.7,1),e+Ee,e+Ee-.05,br,V(br,.9))}function $a(t,n,e,r,o){if(n.length!==4)return!1;let{q:a,part:i,depthM:s,widthM:c}=_r(n,o);if(s<1||c<1)return!1;let l=r??[.35,.42,.55],u=at(l,[.78,.78,.77],.62),f=e+$n,m=gr/c,h=gr/s;ot(t,a,e+Gt,e,u,V(u,.8)),ot(t,i(0,1,1-h,1),f,e+Gt,Vn,V(Vn,.9));for(let[b,p]of[[0,m],[1-m,1]])ot(t,i(b,p,0,1-h),f,e+Gt,Vn,V(Vn,.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+za,e+Gt,at(l,[.95,.95,.94],.7),V(l,.75)),!0}function Qn(t){if(t.shape==="round"){let u=t.radius;return u?Gn(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 Ar(t,n,e,r,o,a=!0){let i=Qn(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?Wt(r,o.tableTop):Qa,f=e+Ka;Z(t,i,void 0,()=>f,e+Ja,u,V(u,.86),K),Z(t,l(.12),void 0,()=>f+.12,f,Mr,V(Mr,.8),K)}var Qa=[.93,.92,.89],Mr=[.78,.66,.42],Ja=.25,xn={armM:1.1,widthM:.28,insideM:1.4,low:.043,high:.048};function tc(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=xn.armM/S,f=xn.widthM/S,m=s/2+xn.insideM/S,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 nc(t,n,e,r,o){let a=[.94,.95,.96];Z(t,tc(n,r,o),void 0,()=>e+xn.high,e+xn.low,a,a,K)}function qn(t,n){let e=it(t);return e?{top:V(Et(e,.12),.95),wall:V(Et(e,.12),.85)}:{top:n.tierTop,wall:n.tierWall}}function Er(t,n,e,r,o,a,i,s,c=[]){let l=ct(n),u=Wo(n);if(!n.role&&(!n.fill||n.fill==="none"||n.fill==="transparent")||!l){pn(t,n,e+r+Ya);return}let m=s?s.kind==="stage":n.role==="stage",h=s?s.kind==="screen":n.role==="screen",d=s?{kind:m?"stage":"solid",heightM:s.topY-s.baseY}:_t(n),y=s?.baseY??e,b=s?.topY??e+r;if(m&&i){let F=1/0,k=-1/0,E=1/0,w=-1/0;for(let B of l)B.x<F&&(F=B.x),B.x>k&&(k=B.x),B.y<E&&(E=B.y),B.y>w&&(w=B.y);i.push({cx:(F+k)/2*S,cz:(E+w)/2*S,y:b,halfX:Math.max((k-F)/2*S,.5),halfZ:Math.max((w-E)/2*S,.5)})}let p=it(n.fill),g=n.role==="wall"||n.role==="entrance"||n.role==="exit",R=g?qn(n.fill,o).top:m&&p?at(o.stageTop,V(Et(p,.18),.9),.9):!n.role&&p?p:Wt(p,m?o.stageTop:o.decorTop),A=h?p:null,M=g?qn(n.fill,o).wall:m?p?at(o.stageWall,V(p,.58),.82):o.stageWall:h?A?at(V(A,1.42),[.24,.46,.82],.08):[.24,.46,.82]:Wt(it(n.fill),o.decorWall),x=m&&Fn(o)?jt(!0):null,I=x?Pr(R,x.stageTop):R,P=x?Pr(M,x.stageWall):M;if(n.role==="wall"&&!s){Un(t,l,y,b,c,I,P,a),pn(t,n,b+.012);return}if(h&&l.length===4&&b-y>.2){let F=Pe(l,y,b);if(!F)return;let{quad:k,side:E,trim:w,inner:B,panel:L}=F,T=[.12,.15,.18];for(let[v,H]of[[0,E],[1-E,1]])ot(t,dt(k,v,H),b,y,T,T);ot(t,B,y+w,y,T,T),ot(t,B,b,b-w,T,T),ot(t,L,b-w,y+w,P,P),pn(t,n,b+.012);return}let _=p?V(Et(p,.15),.82):P,O=p?V(Et(p,.1),1.02):I;if(ir(n.role)&&!s&&sr(t,n.role,l,y,b,_,O,a,n.heightM!==void 0))return;if((n.role==="sound"||s?.kind==="sound_desk")&&l.length===4&&b-y>.3){let F=bt(l),k=Math.hypot(F[1].x-F[0].x,F[1].y-F[0].y)*S,E=Math.min(.12,.09/Math.max(k,.001)),w=[.18,.21,.24],B=b-Math.min(.12,(b-y)*.15);for(let[L,T]of[[0,E],[1-E,1]])ot(t,dt(F,L,T),B,y,w,w);ot(t,F,b,B,I,w);return}if(n.role==="rail"&&l.length===4&&b>y){let F=bt(l),k=Math.hypot(F[1].x-F[0].x,F[1].y-F[0].y)*S,E=Math.max(1,Math.min(128,Math.ceil(k/1.4))),w=Math.min(.08,.055/Math.max(.055,k)),B=[.58,.64,.66];for(let L=0;L<=E;L++){let T=L/E,v=Math.min(1-w,Math.max(0,T-w/2));ot(t,dt(F,v,v+w),b,y,B,V(B,.8))}for(let L of[.52,1]){let T=y+(b-y)*L;ot(t,F,T,Math.max(y,T-.055),B,V(B,.8))}return}if(n.role==="goal"&&l.length===4){let F=bt(l),k=Math.hypot(F[1].x-F[0].x,F[1].y-F[0].y)*S,E=Math.min(.12,.1/Math.max(.1,k)),w=[.9,.94,.94];for(let[B,L]of[[0,E],[1-E,1]])ot(t,dt(F,B,L),Math.max(y,b-.1),y,w,w);ot(t,F,b,Math.max(y,b-.1),w,w);return}if(d.kind==="portal"&&l.length===4){let F=nn(l,y,b);if(!F)return;let{quad:k,side:E,face:w,openingTop:B}=F;for(let[L,T,v]of[[0,w,1],[w,1-w,.67],[1-w,1,1]]){let H=hn(k,L,T),j=V(I,v),D=V(P,v);for(let[U,X]of[[0,E],[1-E,1]])ot(t,dt(H,U,X),B,y,j,D);ot(t,H,b,B,j,D)}(n.role==="entrance"||n.role==="exit")&&nc(t,k,y,a,n.role==="exit");return}if(d.kind==="suite"&&l.length===4){let F=l.map((w,B)=>{let L=l[(B+1)%4],T=(w.x+L.x)/2,v=(w.y+L.y)/2;return Math.hypot(T-a.x,v-a.y)}),k=F.indexOf(Math.min(...F)),E=[0,1,2,3].map(w=>l[(k+w)%4]);ot(t,dt(E,0,.08),b,y,I,P),ot(t,dt(E,.92,1),b,y,I,P),ot(t,hn(E,.88,1),b,y,I,P),ot(t,E,b,Math.max(y,b-.18),I,P);return}if(m&&!n.stageKind?.startsWith("pitch-")&&b-y>.12){let F=b-Math.min(.06,(b-y)*.15);ot(t,l,F,y,I,P,u),ot(t,l,b,F,I,at(I,P,.2),u)}else ot(t,l,b,y,I,P,u);if((n.stageKind==="pitch-football"||n.stageKind==="pitch-rugby")&&l.length===4){t.setMaterial(4);let F=bt(l),k=at(p??xr,xr,p?.45:0);for(let E=0;E<12;E++){let w=dt(F,E/12,(E+1)/12),B=V(k,E%2?1.09:.91),L=w.map(T=>[T.x*S,b+.006,T.y*S]);t.tri(L[0],L[1],L[2],[0,1,0],B),t.tri(L[0],L[2],L[3],[0,1,0],B)}}n.stageKind&&n.stageKind!=="pitch-football"&&pr(t,l,n.stageKind,b,p),m&&Zt(n.stageKind)&&dr(t,n,b),t.setMaterial(h?1:0),pn(t,n,b+.012)}function Jn(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 ec(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)=>at(s,c,1/(l+1)),i[0]):null}function wr(t,n,e,r){if(n.layer==="foreground")return;let o=Jn(n);if(!o)return;let a=e+Va,i=Wt(ec(n.href),r.decorTop),s=Math.max(0,Math.min(1,n.opacity??1));s<1&&(i=at(r.ground,i,s)),Z(t,o,void 0,()=>a,e,i,at(i,r.decorWall,.5),K)}function Br(t,n,e,r,o){if(!n.points||n.points.length<3)return;let a=Io(r,o.gaTop);Z(t,n.points,n.holes,()=>e+Rr,e,a,o.gaWall,K),ic(t,n.points,e+Rr)}var Rr=.15,Zn=[.72,.74,.76],we=1.1,Sr=.12,Be=.05,oc=.06,rc=2.4;function ic(t,n,e){let r=wt([...n]),o=Lt(r,Sr/S),a=Lt(r,(Sr+Be)/S);if(o.length<3||a.length<3)return;for(let s of[e+we,e+we*.5])Z(t,o,[a.slice().reverse()],()=>s,s-Be,Zn,V(Zn,.85),K);let i=oc/2/S;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)*S,f=Math.max(1,Math.round(u/rc));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+we-Be,e,Zn,V(Zn,.8),K)}}}function Pr(t,n){return On(t)<n?Xt(t,n):t}var sc=1.5,ac=30,cc=4,lc=3.6,uc=6,Te=15,fc=3,mc=1;function hc(t){return Math.max(lc,Math.min(uc,2.4+.15*t))}var bn=Math.PI*2;function yc(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-=bn;for(;m<-Math.PI;)m+=bn;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 Tr(t){return t.type==="shape"&&t.role==="wall"&&t.heightM===void 0}function Oe(t,n,e=()=>!0){let r=[];for(let c of t){if(!Tr(c)||!e(c))continue;let l=ct(c);if(!l||l.length<3)continue;let u=yc(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%bn+bn)%bn;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},R={x:(b.x+p.x)/2,y:(b.y+p.y)/2},A=Math.hypot(R.x-g.x,R.y-g.y)*S;if(A<sc||A>ac||Math.abs(i(g)-i(R))*S>cc+.2*A)continue;let M={x:(g.x+R.x)/2,y:(g.y+R.y)/2};o.some(x=>m(Math.atan2(x.y-n.y,x.x-n.x))&&Math.abs(i(x)-i(M))*S<=fc)||s.push({quad:[d,y,p,b],mid:M,widthM:A,openingM:hc(A)})}return s}function Or(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)*S;s<=Te&&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 Cr(t,n,e,r,o,a,i,s=()=>!0){let c=Oe(n,tn(e),s);if(!c.length)return;let l=n.find(f=>Tr(f)&&s(f)),u=qn(l?.fill,i);t.setMaterial(jn);for(let f of c)o-f.openingM<mc||Un(t,f.quad,r+f.openingM,r+o,[],u.top,u.wall,a,o);t.setMaterial(0)}var dc=6,pc=2.2,te=.1,xc=/^(gate|entrance|entry|exit|way in|way out|door)s?$/i,bc=new Set(["stage","entrance","exit","screen","suite","obstruction","sound","bar","concession","restroom","coat"]),gc=.3,Mc=1.8,Rc=.9,Sc=.55,Pc=1,kr=4e3,Ic=6,Fr="#d8a425",_c="#e8c15a",Ce="#1c1608";function Lr(t){let n=Ac(t);if(!n)return null;let e=Qe(t).find(r=>r.icon===n.icon);return{...n,name:e?.titleFallback??n.icon}}function Ac(t){let n=t.accessibility;if(n?.length)return{icon:n.includes("wheelchair")?"wheelchair":n[0],color:In(n)};let e=t.commercial;return e?.obstructedView?{icon:"obstructedView",color:Fr,ink:Ce}:e?.restrictedView?{icon:"restrictedView",color:Fr,ink:Ce}:e?.premium?{icon:"premium",color:_c,ink:Ce}:null}function Ec(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 wc=6e3,Bc=.25,vr=[-90,90,-135,135,-45,45];function Tc(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*Bc?[{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)+vr[u%vr.length]*Math.PI/180,b=Math.cos(y),p=Math.sin(y),g=-1,R=-1/0;for(let A of l){let M=(n[A].x-s)*b+(n[A].y-c)*p;M>R&&(R=M,g=A)}a.set(i,[n[g].x*S,e.seatDeckY(g),n[g].y*S])}),a}function Gr(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=Tc(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*S,1.5,(m.focalPoint??a).y*S]});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*S,h.sumY/h.n,(h.minY+h.maxY)/2*S],radius:.5*Math.hypot((h.maxX-h.minX)*S,(h.maxY-h.minY)*S)||1,focalWorld:[(m.focalPoint??a).x*S,1.5,(m.focalPoint??a).y*S]})}}return s}function Dr(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]+dc,(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 R=h.get(g);R||(R={n:0,x:0,y:0,deck:0},h.set(g,R)),R.n++,R.x+=r[p].x,R.y+=r[p].y,R.deck+=o.seatDeckY(p);let A=r[p].categoryKey;if(A){let x=d.get(g);x||(x=new Map,d.set(g,x)),x.set(A,(x.get(A)??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"||$o(g))continue;let R=h.get(g.id);if(!R||R.n===0)continue;let A=b.get(g.id),M=[R.x/R.n*S,R.deck/R.n,R.y/R.n*S],x=g.displayLabel||g.label||g.id;u.push({id:g.id,floorIndex:p.index,label:x,seatCount:R.n,center:M,radius:Math.max(1,Math.hypot(A.maxX-A.minX,A.maxY-A.minY)*.5*S),box:{min:[A.minX*S-.4,A.minDeck,A.minY*S-.4],max:[A.maxX*S+.4,A.maxDeck+1,A.maxY*S+.4]},focalWorld:[p.focal.x*S,p.baseHeightM+1.5,p.focal.y*S]});let I=n.floors?.[p.index]?.name?.trim().toLocaleLowerCase();if(!(e.length>1&&I===x.trim().toLocaleLowerCase())){let P=Ec(d.get(g.id),n),_=y.get(g.id);l.push({id:`section:${g.id}`,kind:"section",text:x,anchor:[M[0],M[1]+pc,M[2]],floorIndex:p.index,...P?{tint:P}:{},..._?{wheelchairSeats:_}:{}})}}}{for(let M of e)for(let x of M.objects){if(x.type!=="gaArea")continue;let I=Kt(x.points);if(!I)continue;let P=x.labelPresentation?.visible===!1?"":x.displayLabel||x.label||x.id,_=x.capacity>0?[P,x.capacity.toLocaleString()].filter(Boolean).join(" \xB7 "):P;_&&l.push({id:`ga:${x.id}`,kind:"ga",text:_,anchor:[I.x*S,M.baseHeightM+Mc,I.y*S],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 I=x.displayLabel?.trim()||x.segmentedRow?.displayLabel?.trim();I&&d.set(x.id,I)}let y=new Map;for(let M=0;M<r.length;M++){let x=r[M],I=Math.hypot(x.x-c.x,x.y-c.y),P=y.get(x.rowId);(!P||I>P.far)&&y.set(x.rowId,{seat:x,index:M,far:I})}for(let[M,x]of y){let I=o.seatOwner[x.index]??x.seat.sectionId,P=Nr(x.seat.label,M,h.get(I??""),d.get(M));P&&l.push({id:`row:${M}`,kind:"row",text:P,anchor:[x.seat.x*S,o.seatDeckY(x.index)+Rc,x.seat.y*S],floorIndex:i[x.index]})}let b=new Map;for(let M=0;M<r.length;M++){let x=r[M],I=b.get(x.rowId);I||(I={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:Nr(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,I));let P=M*3,_=a.iPosition[P],O=a.iPosition[P+1],C=a.iPosition[P+2];I.n++,I.x+=_,I.y+=O,I.z+=C,I.minX=Math.min(I.minX,_),I.maxX=Math.max(I.maxX,_),I.minZ=Math.min(I.minZ,C),I.maxZ=Math.max(I.maxZ,C)}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*S,o.seatDeckY(M)+Pc,r[M].y*S],floorIndex:i[M],rowId:r[M].rowId})},R=null,A=()=>{if(R){let M=Lr(r[R.seats[0]]),x=R.seats.length,I=Math.max(1,Math.round(x/Ic));for(let P=0;P<I&&p<kr;P++)g(R.seats[Math.min(x-1,Math.floor((P+.5)*x/I))],M)}R=null};for(let M=0;M<r.length&&p<kr;M++){let x=Lr(r[M]);if(x&&r[M].accessibility?.length){A(),g(M,x);continue}if(!x){A();continue}R&&R.rowId===r[M].rowId&&R.icon===x.icon?R.seats.push(M):(A(),R={rowId:r[M].rowId,icon:x.icon,seats:[M]})}if(A(),r.length<=wc)for(let M=0;M<r.length;M++){let x=r[M],I=Oc(x.displayLabel||x.label);I&&l.push({id:`seat:${x.id}`,kind:"seat",seatWidthM:a.iChairWidth[M]*2,text:I,anchor:[x.x*S,o.seatDeckY(M)+Sc,x.y*S],floorIndex:i[M],rowId:x.rowId})}}for(let h of e){let d=Nt(h,e.length===1?r:r.filter((p,g)=>i[g]===h.index)),y=d?Or(Oe(h.objects,tn(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")&&xc.test(p.label?.trim()??"")){let R=ct(p),A=R?Kt(R):null;if(A&&b.some(M=>Math.hypot(A.x-M.mid.x,A.y-M.mid.y)*S<=Te+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*S,h.baseHeightM+g.openingM+te,g.mid.y*S],color:p.color,floorIndex:h.index});else if(p.type==="shape"&&p.role&&bc.has(p.role)){let R=ct(p),A=R?Kt(R):null;if(!A||!p.label||p.gate?.hideFromBuyers)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}:{},...p.gate?.stepFree?{stepFree:!0}:{},anchor:[A.x*S,h.baseHeightM+_t(p).heightM+te,A.y*S],color:p.fill,floorIndex:h.index})}else if(p.type==="text"){let R=p.semanticKind==="icon"?re(p.iconKey)?.key:void 0,A=p.text||(R?re(R).label:"");if(!A)continue;l.push({id:`text:${p.id}`,kind:"annotation",text:A,...R?{venueIcon:R}:{},anchor:R?[(p.position.x+p.fontSize/2)*S,h.baseHeightM+te,(p.position.y+p.fontSize/2)*S]:[p.position.x*S,h.baseHeightM+te,p.position.y*S],color:p.color,rotation:p.rotation,floorIndex:h.index})}else if(p.type==="booth"){if(p.labelPresentation?.visible===!1)continue;let R=At(p);if(!R)continue;let A=Kt(R);if(!A)continue;l.push({id:`booth:${p.id}`,kind:"booth",text:p.displayLabel||p.label||p.id,anchor:[A.x*S,h.baseHeightM+$n+gc,A.y*S],floorIndex:h.index})}}}return{labels:l,sections:u,rows:f}}function Hr(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 Oc(t){let n=t.lastIndexOf("-");return n>=0&&n<t.length-1?t.slice(n+1):t}function Nr(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&&oo(a,e)}var gn=3,Yt=.38,Mn=.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)*S,a=(e.y-n.y)*S,i=(r.x-n.x)*S,s=(r.y-n.y)*S,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*S,m=(o*u-i*l)/c+n.y*S,h=Math.hypot(n.x*S-f,n.y*S-m);return h<1||h>200||!Number.isFinite(h)||t.some(d=>Math.abs(Math.hypot(d.x*S-f,d.y*S-m)-h)>.03)?null:{x:f,z:m,radius:h}}function Xr(t){let n=[],e=new Map,r=(c,l)=>`${Math.floor(c/gn)},${Math.floor(l/gn)}`;for(let c of t)for(let l of c.rows){for(let f of l.pts){let m=f.x*S,h=f.y*S,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*S,z:m.y*S,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/gn),f=Math.floor(l/gn);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<Yt*2+.45||g>gn)continue;let R=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,A=Math.min((b*c.dx+p*c.dz)/g,(-b*y.dx-p*y.dz)/g);(R?A<.8:A<.98)||!R&&(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 R=(g.x-u.x)*h+(g.z-u.z)*d,A=Math.abs((g.x-u.x)*d-(g.z-u.z)*h);R>.01&&R<m-.01&&A<Mn+Yt&&(y=!0)}if(y)continue;let b=(p,g)=>({x:(u.x+h*p-d*g)/S,y:(u.z+d*p+h*g)/S});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*Yt,heightM:(u.row.y+f.row.y)/2,outline:[b(Yt,-Mn),b(m-Yt,-Mn),b(m-Yt,Mn),b(Yt,Mn)]})}return s}var kc=.15,Fc=.9,Lc=1.76;function jr(t){return ke(t)?{zenith:[.36,.58,.84],horizon:[.82,.88,.94]}:{zenith:[.05,.08,.15],horizon:[.3,.38,.5]}}function ke(t){return!!t&&t[0]*.2126+t[1]*.7152+t[2]*.0722>.55}function vc(){return{background:{top:[...ue.top],bottom:[...ue.bottom]},sky:jr(null),structure:le,seatStates:{...po},seatScale:1,materials:{seat:null,shell:null,roughness:.78}}}function Nc(t){return ke(t)?{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87}:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87}}function Ur(t){let n=vc();t??={};let e=it(t.background);if(e){n.background={top:V(e,Fc),bottom:V(e,Lc)},n.sky=jr(e);let s={};for(let[l,u]of Object.entries(le))s[l]=at(u,e,kc);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=io(o));let a=Object.fromEntries(Object.entries(t.venue3d??{}).filter(([,s])=>s!=null)),i={...Nc(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 Gc(n,ke(e)),n}function Gc(t,n){let e=jt(n);t.seatStates={...t.seatStates,held:Cn(e.unavailable),sold:Cn(e.unavailable),dimmed:Cn(e.dimmed)};let r=(a,i)=>Xt(a,i,Math.min(cn(a),kn)),o=t.structure;t.structure={...o,ground:r(o.ground,e.ground),tierTop:r(o.tierTop,e.deck),tierWall:r(o.tierWall,e.fascia)},t.materials.shell&&(t.materials.shell=r(t.materials.shell,e.shell))}function Wr(t,n){let e=[];for(let r of n)e.push(...t.seatStates[r]);return e}var Fe=.6,Yr=3,Dc=.25;function Hc(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 zr(t,n){let e=t.map(i=>({booth:i,ring:At(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=(Yr+Fe)/S,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,R=Math.hypot(p,g)||1,A={x:b.x+p/R*Fe/S,y:b.y+g/R*Fe/S},M=Yr/S;return r.forEach((x,I)=>{I===c||A.x<x.minX-o||A.x>x.maxX+o||A.y<x.minY-o||A.y>x.maxY+o||(M=Math.min(M,Hc(A,e[I].ring)))}),{open:M*S,toward:{x:b.x+p/R*10/S,y:b.y+g/R*10/S},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-Dc).sort((h,d)=>h.focal-d.focal)[0];a.set(i.id,m.toward)}),a}import Xc from"polygon-clipping";var jc=.45,Uc=1500,Wc=200;function Kr(t,n){if(t.role!=="stage"||Zt(t.stageKind))return t;let e=ct(t);if(!e||e.length<3||Math.abs(pt(e))*S*S>Uc)return t;let r=n.filter(i=>xt(e,i.x,i.y));if(!r.length||r.length>Wc)return t;let o=jc/S,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=Xc.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 Le(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,I)=>[m(n[y],n[b],x),m(n[y],n[b],I),m(e[y],e[b],I),m(e[y],e[b],x)];f(g(0,1),o,o+.95),f(g(0,1),a-.22,a);let R=Math.ceil((d-.32)/6)*6,A=!1,M=!1;for(let x=R;x<d+p;x+=6){let I=Math.max(0,(x-d)/p),P=Math.min(1,(x+.32-d)/p);P<=I||(f(g(I,P),o+.95,a-.22),A||=I<1e-6,M||=P>1-1e-6)}if(!r&&(y===0&&!A||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 zt from"polygon-clipping";var Sn=.65;function ve(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 Ne=.01;function Vr(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-Sn:o;t.setMaterial(5);let m=u?[]:s.filter(x=>{if(x.role!=="entrance"&&x.role!=="exit")return!1;let I=ct(x);if(!I)return!1;let P=nn(I,o,o+_t(x).heightM);return P!==null&&P.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?Yc(n,e,Lt(n,Rn/S),l):null,d=6/S,y=.22/S,b=s.flatMap(x=>{if(x.role!=="entrance"&&x.role!=="exit")return[];let I=ct(x);return I?.length?[{minX:Math.min(...I.map(P=>P.x)),maxX:Math.max(...I.map(P=>P.x)),minY:Math.min(...I.map(P=>P.y)),maxY:Math.max(...I.map(P=>P.y))}]:[]}),p=Math.min(...n.map(x=>x.x)),g=Math.max(...n.map(x=>x.x)),R=Math.min(...n.map(x=>x.y)),A=Math.max(...n.map(x=>x.y));for(let x=p+d/2;x<g;x+=d)for(let I=R+d/2;I<A;I+=d){if(b.some(_=>x+y>=_.minX&&x-y<=_.maxX&&I+y>=_.minY&&I-y<=_.maxY))continue;let P=[{x:x-y,y:I-y},{x:x+y,y:I-y},{x:x+y,y:I+y},{x:x-y,y:I+y}];!St({x,y:I},n,e)||ve({x,y:I},[n,...e??[]])<y*Math.SQRT2+(c?Rn/S:0)||h&&ve({x,y:I},h.flat())<y*Math.SQRT2+Rn/S||Z(t,P,void 0,()=>f,o,a,i,K)}if(h){for(let[x,...I]of h)Z(t,x,I,()=>f,o-Ne,a,i,K);t.setMaterial(0);return}let M=Lt(n,Rn/S);if(c&&M.length>=3){let x=s.filter(_=>{if(_.role!=="entrance"&&_.role!=="exit")return!1;let O=ct(_);return!!O&&O.some(C=>!St(C,n,void 0)||ve(C,[n])<=Rn/S)}),I=[M.slice().reverse()],P=o-Ne;(!x.length||!Ot(t,n,P,f,x,a,i,{holes:I,portalBase:o+Ne}))&&Z(t,n,I,()=>f,P,a,i,K)}t.setMaterial(0)}var Ge=.25,Rn=Ge;function Yc(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 zt.union(s,...c)};try{let i=[o(t),...(n??[]).map(o)],s=zt.difference(i,[o(e)]),c=zt.intersection(i,a(r.bays));if(!c.length)return null;let l=zt.difference(zt.intersection(i,a(r.walls)),c);return zt.union(zt.difference(s,c),l).map(f=>f.map(m=>m.slice(0,-1).map(([h,d])=>({x:h,y:d}))))}catch{return null}}var zc=.02,Kc=.25,Vc=1.2,Zc=.6,qc=.45,$c=2.3,Qc=Math.PI/180,Zr=.005;function Bt(t,n,e){let r=e*Qc;return{x:t.x+n*Math.sin(r),y:t.y+n*Math.cos(r)}}function Jc(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 tl=24,nl=.01;function el(t,n,e,r,o,a,i,s,c){let l=e.binCount,u=tl,f=$,m=a+.02,h=a-nl,d=[];for(let E=0;E<l;E++){let w=(e.startBin+E+.5)*n.binStepDeg,B=new Float64Array(u+1);for(let L=0;L<=u;L++){let T=r[E]+(o[E]-r[E])*L/u;B[L]=Math.max(m,fo(n,e,w,T)-Kc)}d.push(B)}if(c){let E=0;for(let w=0;w+1<l;w++)for(let B=0;B<u;B++){let L=Bt(n.centre,r[w]+(o[w]-r[w])*B/u,(e.startBin+w+.5)*n.binStepDeg),T=Bt(n.centre,r[w+1]+(o[w+1]-r[w+1])*(B+1)/u,(e.startBin+w+1.5)*n.binStepDeg);E=Math.max(E,Math.hypot(T.x-L.x,T.y-L.y))}for(let w=0;w<l;w++){let B=(e.startBin+w+.5)*n.binStepDeg;for(let L=0;L<=u;L++){let T=Bt(n.centre,r[w]+(o[w]-r[w])*L/u,B),v=c(T.x,T.y,E*1.01);v!==null&&(d[w][L]=Math.min(d[w][L],Math.max(h+Zr,v-Zr)))}}}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],R=(E,w)=>{let B=(e.startBin+E+.5)*n.binStepDeg,L=r[E]+(o[E]-r[E])*w/u,T=Bt(n.centre,L,B);return[T.x*f,d[E][w],T.y*f]};{let E=Math.tan(12*Math.PI/180);for(let w=0;w<6;w++){let B=!1;for(let T=0;T<l;T++)for(let v=u-1;v>=0;v--)d[T][v]>d[T][v+1]&&(d[T][v]=d[T][v+1],B=!0);let L=e.closed?l:l-1;for(let T=0;T<L;T++){let v=(T+1)%l;for(let H=0;H<=u;H++){let j=d[v][H]-d[T][H];if(Math.abs(j)>1)continue;let D=r[T]+(o[T]-r[T])*H/u,U=r[v]+(o[v]-r[v])*H/u,X=Bt(n.centre,D,(e.startBin+T+.5)*n.binStepDeg),Y=Bt(n.centre,U,(e.startBin+v+.5)*n.binStepDeg),nt=E*Math.hypot(Y.x-X.x,Y.y-X.y)*f;j>nt?(d[v][H]=d[T][H]+nt,B=!0):-j>nt&&(d[T][H]=d[v][H]+nt,B=!0)}}if(!B)break}}let A=1,M=(E,w)=>{for(let B=0;B<=u;B+=4)if(Math.abs(d[E][B]-d[w][B])>A)return!0;return Math.abs(d[E][u]-d[w][u])>A},x=Math.tan(38*Math.PI/180),I=E=>(o[E]-r[E])/u*f,P=(E,w)=>d[E][w+1]-d[E][w]>x*Math.max(1e-6,I(E)),_=(E,w)=>{let B=e.closed?(E-1+l)%l:Math.max(0,E-1),L=e.closed?(E+1)%l:Math.min(l-1,E+1);Math.abs(d[B][w]-d[E][w])>A&&(B=E),Math.abs(d[L][w]-d[E][w])>A&&(L=E);let T=Math.max(0,w-1),v=Math.min(u,w+1);T<w&&P(E,T)&&(T=w),v>w&&P(E,w)&&(v=w);let H=R(B,w),j=R(L,w),D=R(E,T),U=R(E,v),X=j[0]-H[0],Y=j[1]-H[1],nt=j[2]-H[2],rt=U[0]-D[0],q=U[1]-D[1],Q=U[2]-D[2],J=Y*Q-nt*q,N=nt*rt-X*Q,G=X*q-Y*rt,W=Math.hypot(J,N,G);return W>1e-12?(J/=W,N/=W,G/=W,N<0&&(J=-J,N=-N,G=-G),[J,N,G]):[0,1,0]},O=(E,w,B=!1)=>{let L=B&&Math.min(E[1],w[1])-a>=3,T=[E[0],L?E[1]-Sn:h,E[2]],v=[w[0],L?w[1]-Sn:h,w[2]],H=w[0]-E[0],j=w[2]-E[2],D=Math.hypot(H,j);if(!(D>1e-12))return;let U=[j/D,0,-H/D];t.tri(E,w,v,U,p,p,g),t.tri(E,v,T,U,p,g,g)},C=.05*Rt,F=E=>o[E]-r[E]<C,k=e.closed?l:l-1;for(let E=0;E<k;E++){let w=(E+1)%l;if(F(E)||F(w))continue;if(M(E,w)){let j=(e.startBin+E+1)*n.binStepDeg,D=(q,Q)=>{let J=(r[E]+r[w])/2,N=(o[E]+o[w])/2,G=J+(N-J)*Q/u,W=Bt(n.centre,G,j);return[W.x*f,d[q][Q],W.y*f]};for(let q=0;q<u;q++){let Q=R(E,q),J=R(E,q+1),N=D(E,q),G=D(E,q+1),W=_(E,q),lt=_(E,q+1);t.triN(Q,N,G,W,W,lt,y),t.triN(Q,G,J,W,lt,lt,y);let ft=R(w,q),st=R(w,q+1),tt=D(w,q),et=D(w,q+1),ht=_(w,q),z=_(w,q+1);t.triN(tt,ft,st,ht,ht,z,y),t.triN(tt,st,et,ht,z,z,y);let mt=D(E,q),yt=D(E,q+1),Dt=D(w,q+1),Ht=D(w,q),kt=yt[0]-mt[0],Ft=yt[2]-mt[2],an=Math.hypot(kt,Ft);if(an>1e-12){let Pn=[Ft/an,0,-kt/an];t.tri(mt,yt,Dt,Pn,p),t.tri(mt,Dt,Ht,Pn,p)}}let U=R(E,0),X=R(w,0),Y=R(w,u),nt=R(E,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)),O(U,X,!0),O(nt,Y,!0);continue}for(let j=0;j<u;j++){let D=_(E,j),U=_(w,j),X=_(w,j+1),Y=_(E,j+1);if(P(E,j)||P(w,j)){let J=(yt,Dt)=>{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,Dt,Ft.y*f]},N=R(E,j),G=R(w,j),W=J(E,d[E][j]),lt=J(w,d[w][j]);t.triN(N,G,lt,D,U,U,y),t.triN(N,lt,W,D,U,D,y);let ft=R(w,j+1),st=R(E,j+1),tt=J(E,d[E][j+1]),et=J(w,d[w][j+1]);t.triN(tt,et,ft,Y,X,X,y),t.triN(tt,ft,st,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=R(E,j),rt=R(w,j),q=R(w,j+1),Q=R(E,j+1);t.triN(nt,rt,q,D,U,X,y),t.triN(nt,q,Q,D,X,Y,y)}let B=R(E,0),L=R(w,0),T=R(w,u),v=R(E,u),H=j=>[j[0],h,j[2]];Math.min(B[1],L[1])-a<3&&(t.tri(H(B),H(T),H(L),[0,-1,0],b),t.tri(H(B),H(v),H(T),[0,-1,0],b)),O(B,L,!0),O(v,T,!0)}if(!e.closed)for(let E of[0,l-1])for(let w=0;w<u;w++)O(R(E,w),R(E,w+1))}function qr(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]-Pt);m[y]=Math.max(p,i[b]+.001),h[y]=Math.max(m[y]+.001,f.outerR[y]+Pt)}let d=0;for(let y=0;y<f.binCount;y++){let b=f.topLevelM[y]-r;b>d&&(d=b)}d>=Vc&&el(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||Jc(e.shapes,n))return;let s=n.rings[n.rings.length-1],c=Zc*Rt,l=qc*Rt;for(let u of s.arcs){let f=[],m=[];for(let _=0;_<u.binCount;_++){let O=(u.startBin+_+.5)*n.binStepDeg,C=u.outerR[_]+Pt+c;f.push(Bt(n.centre,C,O)),m.push(Bt(n.centre,C+l,O))}let h=-1/0;for(let _=0;_<u.binCount;_++)u.topLevelM[_]>h&&(h=u.topLevelM[_]);let d=h+$c,y=u.closed?m:[...m,...f.slice().reverse()],b=u.closed?[f.slice().reverse()]:void 0,p=at(o.shellWall,[.66,.71,.72],.62),g=(_,O,C,F,k)=>{let E=Math.abs(F-h)<1e-6?F-zc:F;Ot(t,_,C,E,e.shapes,o.shellTop,k,{holes:O,portalBase:r,ao:a})||Z(t,_,O,()=>E,C,o.shellTop,k,a)},R=Math.max(1,Math.ceil((h-r)/4.5)),A=(h-r)/R,M=new Set,x=e.tierFrontLevels??n.rings.map(_=>{let O=_.arcs.flatMap(C=>Array.from(C.frontLevelM)).filter(Number.isFinite).sort((C,F)=>C-F);return O[Math.floor(O.length/2)]});for(let _ of x)Number.isFinite(_)&&_-r>=3&&_<h&&M.add(Math.max(0,Math.min(R-1,Math.floor((_-r)/A))));let I=Math.min(...x.filter(_=>Number.isFinite(_)&&_-r>=3&&_<h));for(let _=0;_<R;_++)r+(_+1)*A<=I-Sn&&Number.isFinite(I)&&M.add(_);for(let _=0;_<R;_++){let O=r+(h-r)*_/R,C=r+(h-r)*(_+1)/R;M.has(_)&&C-O>=3.2?(g(y,b,O,O+.45,p),Le(t,f,m,u.closed,O+.45,C-.16,o.shellTop,p,a,e.shapes,r)):g(y,b,O,C-.16,p),g(y,b,C-.16,C,V(p,.62))}Le(t,f,m,u.closed,h,d,o.shellTop,p,a,e.shapes,r);let P=8;for(let _=1;_<m.length;_++){if(P+=Math.hypot(m[_].x-m[_-1].x,m[_].y-m[_-1].y)*$,P<8)continue;P=0;let O=m[_],C=m[_-1],F=O.x-C.x,k=O.y-C.y,E=Math.max(1,Math.hypot(F,k)),w=F/E*.16*Rt,B=k/E*.16*Rt,L=Math.max(1,Math.hypot(O.x-n.centre.x,O.y-n.centre.y)),T=(O.x-n.centre.x)/L*.24*Rt,v=(O.y-n.centre.y)/L*.24*Rt,H=[{x:O.x-w,y:O.y-B},{x:O.x+w,y:O.y+B},{x:O.x+w+T,y:O.y+B+v},{x:O.x-w+T,y:O.y-B+v}];g(H,void 0,r,h,V(p,1.12))}}}var ol=2.5,$r=.65,rl=2,il=.03;function sl(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 Xe(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<ol||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*$r/S,y:u.y-m/h*$r/S}}),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)*S>rl?(l.length>=2&&c.push(l),l=[m]):l.push(m)}l.length>=2&&c.push(l);for(let u of c)sl(u,il/S);c.length&&o.push({blockId:a,y:i.y,runs:c})}return o}var Qr=.1,al=1.1,cl=.22,De=.95,He=.05,Jr=1.8;function ti(t,n,e,r){let o=[.72,.72,.69],a=[.48,.55,.57];for(let i of Xe(n,e,r)){let s=i.y;for(let c of i.runs){let l=Jr;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/S/2,R=h/y*p/S/2;return[{x:f.x+g,y:f.y+R},{x:m.x+g,y:m.y+R},{x:m.x-g,y:m.y-R},{x:f.x-g,y:f.y-R}]};if(Z(t,b(cl),void 0,()=>s+Qr,s-al,o,o,K),Z(t,b(He),void 0,()=>s+De,s+De-He,a,a,K),l+=y*S,l>=Jr||u===c.length-1){l=0;let p=.028/S,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+De-He,s+Qr,a,a,K)}}}}}var ll=.9,ul=1.5,fl=.3;function ni(t,n,e){let r=[],o=[],a=ll/S,i=ul/S,s=fl/S;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],R=u[p],A=Math.hypot(g.x-R.x,g.y-R.y)||1;u[b]={x:g.x+(g.x-R.x)/A*s,y:g.y+(g.y-R.y)/A*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)],R=u[Math.min(u.length-1,p+1)],A=R.x-g.x,M=R.y-g.y,x=Math.hypot(A,M)||1,I=-M/x,P=A/x;return I*(b.x-n.x)+P*(b.y-n.y)<0&&(I=-I,P=-P),{nx:I,ny:P}}),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/S),y:b.y+m[p].ny*(a+e/S)}));r.push([...h,...d.slice().reverse()]),o.push([...d,...y.reverse()])}return{bays:r,walls:o}}var je=.88,ne=.27,ml=1.2,hl=.01;function ei(t,n,e,r,o){let a=[.67,.71,.68],i=[a[0]*je,a[1]*je,a[2]*je],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 w=0;w<e.length;w++){let B=e[w],L=e[(w+1)%e.length],T=L.x-B.x,v=L.y-B.y,H=h*v-d*T;if(Math.abs(H)<1e-8)continue;let j=B.x-f.x,D=B.y-f.y,U=(j*v-D*T)/H,X=(j*d-D*h)/H;U>0&&X>=0&&X<=1&&(b=Math.min(b,U))}let p=.3/S,g=b-.04/S;if(!Number.isFinite(b)||b*S>2||g-p<.12/S)continue;let R=!!r&&s(c),A=o?.[c]?.pitch,M=R&&A&&Number.isFinite(A)?Math.min(ml/S,Math.max(ne/S,A-ne/S-hl/S)):ne/S,x=-d,I=h;r&&x*(r.x-f.x)+I*(r.y-f.y)<0&&(x=-x,I=-I);let P=ne/S,_=[{x:f.x+h*p+x*P,y:f.y+d*p+I*P},{x:f.x+h*g+x*P,y:f.y+d*g+I*P},{x:f.x+h*g-x*M,y:f.y+d*g-I*M},{x:f.x+h*p-x*M,y:f.y+d*p-I*M}];if(!_.every(w=>xt(e,w.x,w.y)))continue;let O=o?.[c]?.belowY,C=O==null?0:l.y-O,F=!!r&&C>.03&&C<=.65;if(F&&r){let w=(B,L)=>Math.hypot((B.x+L.x)/2-r.x,(B.y+L.y)/2-r.y);w(_[0],_[1])>w(_[3],_[2])&&(_=[_[3],_[2],_[1],_[0]])}let k=F?Math.ceil((C-1e-8)/.2):1,E=(w,B,L)=>({x:w.x+(B.x-w.x)*L,y:w.y+(B.y-w.y)*L});for(let w=0;w<k;w++){let B=w/k,L=(w+1)/k,T=[E(_[0],_[3],B),E(_[1],_[2],B),E(_[1],_[2],L),E(_[0],_[3],L)],v=l.y+.008-(F?C*(1-L):0);Z(t,T,void 0,()=>v,v-(F?C/k+.1:.16),a,i,K)}}}}var yl=.02,dl=.012,pl=.01,xl=.3,bl=.5;function gl(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 Ml(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=gl(t[i].pts,e,r);c<o&&(o=c,a=t[i].y)}return a}function oi(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=yl/S;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*S<.05)continue;let R=(d.x+y.x)/2,A=(d.y+y.y)/2,M=p/g,x=-b/g;St({x:R+M*f,y:A+x*f},l,u)&&(M=-M,x=-x);let I=o.x-R,P=o.y-A,_=Math.hypot(I,P)||1;if((M*I+x*P)/_>bl)continue;let O=1/0;for(let T of[.2,.5,.8]){let v=Ml(s,c,d.x+b*T-M*f*2,d.y+p*T-x*f*2);Number.isFinite(v)&&(O=Math.min(O,v))}if(!Number.isFinite(O)||O-a<xl)continue;let C=a-pl,F=O-dl,k={x:(d.x-M*f)*S,z:(d.y-x*f)*S},E={x:(y.x-M*f)*S,z:(y.y-x*f)*S},w=[M,0,x],B=V(i,K.wallBottom),L=V(i,K.top);t.tri([k.x,F,k.z],[E.x,F,E.z],[E.x,C,E.z],w,L,L,B),t.tri([k.x,F,k.z],[E.x,C,E.z],[k.x,C,k.z],w,L,B,B)}}function ri(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=_o(r,s.tierTop);if(!o)return;let m=g=>o.deckAt(g.x,g.y),h=jo(n,i),d=h[0]??n.outline;if(o.rowLevels.length>=2){let g=Hn(o.rowLevels),R=Uo(vo(o.rowLevels,e.focal,g),h),A=ni(Xe(o.rowLevels,e.focal,l),e.focal,Ge);for(let x of R){let I=Math.max(l,x.topY-ii);for(let P of a.subtract(x.outline,I))Vr(t,P,x.holes,I,l,s.tierTop,s.tierWall,u,!c,A);t.setMaterial(5),oi(t,x.outline,x.holes,o.rowLevels,e.focal,I,s.tierWall),t.setMaterial(0)}R.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])Go(t,o.rowLevels,e.focal,o.landingY,M,x,g);ti(t,o.rowLevels,e.focal,l),ei(t,o.rowLevels,n.outline,e.focal,g);return}let y=o.flat?1/0:cr,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 Rl(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 Sl(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 ii=.02;function Pl(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-ii);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(!St(c,s.outline,s.holes)&&Sl(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 Il=3,_l=.4;function si(t,n,e,r,o,a,i=!0){let s=Rl(n,e,r);if(s.length<Il)return;let c=uo(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),qr(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>=_l,standTopNear:Pl(n,r)}),t.setMaterial(0)}function ai(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*S,y.sumDeck+=p,y.sumZ+=b.y*S,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*S:e[m].focal.x*S-1,Number.isFinite(y.minX)?y.minX:1/0),p=Math.max(h.n?h.maxX*S:e[m].focal.x*S+1,Number.isFinite(y.maxX)?y.maxX:-1/0),g=Math.min(h.n?h.minY*S:e[m].focal.y*S-1,Number.isFinite(y.minZ)?y.minZ:1/0),R=Math.max(h.n?h.maxY*S:e[m].focal.y*S+1,Number.isFinite(y.maxZ)?y.maxZ:-1/0),A=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,A+.5):A+.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:(A+M)/2,h.n?h.sumZ/h.n:(g+R)/2],I=Math.max(1,.5*Math.hypot(p-b,M-A,R-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:I,box:{min:[b,A,g],max:[p,M,R]},focalWorld:[e[m].focal.x*S,e[m].baseHeightM+1.5,e[m].focal.y*S]})}}return c}function Ue(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=At(c);if(l)for(let u of l)i(u.x,u.y)}else if(c.type==="table"){let l=Qn(c);if(l)for(let u of l)i(u.x,u.y)}else if(c.type==="decorImage"){let l=Jn(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 hi(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(...At(m)??[]):m.type==="table"?s.push(...Qn(m)??[]):m.type==="decorImage"&&s.push(...Jn(m)??[]);if(ui(t,n[0],e,a)||mi(t,n[0],e,s,a))return!1;if(i&&li(t,n[0].baseHeightM,s,a,i))return!0;let c=yn(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}}):mn(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(ui(t,c,e,a)||mi(t,c,e,l,a))return!1;if(i&&li(t,s.baseHeightM,l,a,i))return!0;let u=e.filter((b,p)=>r[p]===s.index),f=Ue([s],u),m=Math.hypot(f.maxX-f.minX,f.maxY-f.minY),h=Math.max(28,Math.min(80,m*.04)),d=mn(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 We(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],R=n.iPosition[p+1],A=n.iPosition[p+2],M=Math.max(.35,n.iMaxRadius[b]??.35);h(g-M,R,A-M),h(g+M,R+1.6,A+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 Al=4096;function yi(t,n,e=[]){let r=Math.max(1,Math.ceil(t.count/Al)),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 di(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,I=t.iPosition[x],P=t.iPosition[x+2];I<s&&(s=I),I>l&&(l=I),P<c&&(c=P),P>u&&(u=P)}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*S,m=e.maxX*S,h=e.minY*S,d=e.maxY*S,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 R=Math.min(0,r),A=Math.max(o,a*.05);return{min:[y,R,p],max:[b,A,g]}}var ci=12,El=.6,wl=40;function li(t,n,e,r,o){let a=yn([...e]);if(a.length<3)return!1;let i=1/0,s=1/0,c=-1/0,l=-1/0;for(let A of a)i=Math.min(i,A.x),c=Math.max(c,A.x),s=Math.min(s,A.y),l=Math.max(l,A.y);let u=Math.hypot(c-i,l-s)*S,f=It(a,ci/S,1.2),m=Math.max(wl,u*El),h=It(a,(ci+m)/S,1.2);if(f.length!==h.length)return!1;let d=at(r.ground,[.78,.76,.72],.35),y=at(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(A=>[A.x*S,b,A.y*S]),g=h.map(A=>[A.x*S,b,A.y*S]),R=[0,1,0];for(let A=0;A<p.length;A++){let M=(A+1)%p.length;t.tri(p[A],g[M],g[A],R,y,o,o),t.tri(p[A],p[M],g[M],R,y,y,o)}return!0}function ui(t,n,e,r){let o=Nt(n,e);if(!o)return!1;let a=n.baseHeightM,i=at(r.ground,[.62,.55,.47],.4);return Z(t,o,void 0,()=>a-.04,a-.22,i,i,K),!0}var Bl=3e3,Tl=20,fi=1.5,Ol=1.2,Cl=.25;function mi(t,n,e,r,o){if(!e.length||e.length>Bl||r.length<3)return!1;for(let _ of n.objects){if(_.type==="shape"&&En(_.stageKind))return!1;if(_.type==="section"){let{height:O}=Vt(_,{floorBaseHeightM:n.baseHeightM});if(O-n.baseHeightM>Tl)return!1}}let a=0,i=0;for(let _ of r)a+=_.x,i+=_.y;a/=r.length,i/=r.length;let s=0,c=0,l=0;for(let _ of r){let O=_.x-a,C=_.y-i;s+=O*O,c+=C*C,l+=O*C}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 _ of r){let O=(_.x-a)*f+(_.y-i)*m,C=(_.x-a)*h+(_.y-i)*d;y=Math.min(y,O),b=Math.max(b,O),p=Math.min(p,C),g=Math.max(g,C)}let R=_=>[[y-_,p-_],[b+_,p-_],[b+_,g+_],[y-_,g+_]].map(([O,C])=>({x:a+f*O+h*C,y:i+m*O+d*C})),A=R(fi/S),M=R((fi+Cl)/S),x=n.baseHeightM,I=at(o.ground,[.62,.55,.47],.4),P=at(o.ground,[.86,.86,.84],.55);return Z(t,M,void 0,()=>x-.04,x-.22,I,I,K),Z(t,M,[A.slice().reverse()],()=>x+Ol,x-.04,at(P,[1,1,1],.2),P,K),!0}function pi(t,n,e){let r=()=>({byObjectId:new Map,elements:[]});if(!n||!t)return r();let o=Ye(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(P=>P.x*S),b=h.map(P=>P.y*S),p=m.unit.baseHeightM+d,g=Math.min(...y),R=Math.max(...y),A=Math.min(...b),M=Math.max(...b),x,I=c.get(f.id)??f.contentImageUrl;if(f.kind==="screen"&&I&&(x=rr(h,p,p+f.heightM,m.unit.focal),!x))if(R-g>=M-A){let P=Math.abs(A-m.unit.focal.y*S)<=Math.abs(M-m.unit.focal.y*S)?A-.006:M+.006;x=[[g,p,P],[R,p,P],[g,p+f.heightM,P],[R,p+f.heightM,P]]}else{let P=Math.abs(g-m.unit.focal.x*S)<=Math.abs(R-m.unit.focal.x*S)?g-.006:R+.006;x=[[P,p,A],[P,p,M],[P,p+f.heightM,A],[P,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,A],max:[R,p+f.heightM,M]},occlusion:f.occlusion,...I?{contentImageUrl:I}:{},...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 xi=[.13,.14,.17],sn=[.4,.43,.47],kl=.18,Fl=.02,Ll=2.4,vl=1500,Nl=240,Gl=.25;function bi(t,n,e,r){let o=n.stageKind??"";if(Zt(o)||o==="round"||!r.length)return;let a=ct(n);if(!a||a.length<3)return;let i={x:a.reduce((B,L)=>B+L.x,0)/a.length,y:a.reduce((B,L)=>B+L.y,0)/a.length},s=0,c=0,l=new Set;for(let B of r)s+=B.x,c+=B.y,l.add(Math.floor(Math.atan2(B.y-i.y,B.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((B,L)=>B+Math.hypot(L.x-i.x,L.y-i.y),0)/r.length;if(l.size*10>Nl&&m<Gl*h)return;let d=u/m,y=f/m,b=-y,p=d,g=-1/0,R=1/0,A=1/0,M=-1/0;for(let B of a){let L=(B.x-i.x)*d+(B.y-i.y)*y,T=(B.x-i.x)*b+(B.y-i.y)*p;g=Math.max(g,L),R=Math.min(R,L),A=Math.min(A,T),M=Math.max(M,T)}let x=(M-A)*S,I=(g-R)*S;if(x<3||I<1.5||x*I>vl)return;let P=kl/S,_=(B,L)=>({x:i.x+d*B+b*L,y:i.y+y*B+p*L}),O=(B,L,T,v)=>[_(B,T),_(B,v),_(L,v),_(L,T)],C=e+Math.max(3.5,Math.min(8,x*.35)),F=e+Math.min(Ll,C-e-1),k=.2/S,E=R+Math.min(I*.25,1.5)/S,w=Fl/S;Z(t,O(g-2*P+w,g-P-w,A+P+k,M-P-k),void 0,()=>F,e,xi,xi,K);for(let[B,L]of[[A+P,A+P+k],[M-P-k,M-P]])Z(t,O(g-2*P,g-P,B,L),void 0,()=>C+.3,e,sn,sn,K),Z(t,O(E+k,g-2*P,B,L),void 0,()=>C+.3,C,sn,sn,K);Z(t,O(E,E+k,A+P,M-P),void 0,()=>C+.3,C,sn,sn,K)}function Mt(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function gt(t){return Array.isArray(t)?t:[]}function Dl(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 ee(t,n){return!Array.isArray(t)||t.length!==n||!t.every(e=>typeof e=="number"&&Number.isFinite(e))?null:t}function Hl(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Xl(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 jl(t){let n=ee(t.matrix,16);if(n)return n;if(t.matrix!==void 0)return null;let e=t.translation===void 0?[0,0,0]:ee(t.translation,3),r=t.rotation===void 0?[0,0,0,1]:ee(t.rotation,4),o=t.scale===void 0?[1,1,1]:ee(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,R=u*b,A=f*y,M=f*b,x=m*b,I=h*d,P=h*y,_=h*b;return[(1-(A+x))*o[0],(g+_)*o[0],(R-P)*o[0],0,(g-_)*o[1],(1-(p+x))*o[1],(M+I)*o[1],0,(R+P)*o[2],(M-I)*o[2],(1-(p+A))*o[2],0,e[0],e[1],e[2],1]}function Ul(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 Wl(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 gi(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 Yl(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 zl(t){return t===5120||t===5121?1:t===5122||t===5123?2:t===5125||t===5126?4:0}function Kl(t){return t==="SCALAR"?1:t==="VEC2"?2:t==="VEC3"?3:t==="VEC4"?4:0}function Vl(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 Zl(t){let n=t instanceof Uint8Array?t:new Uint8Array(t),e=Yl(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(A=>typeof A=="string");if(a.includes("KHR_draco_mesh_compression")||Dl(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=(A,M,x)=>{if(typeof A!="number"||!Number.isInteger(A)||!Mt(s[A]))return null;let I=s[A];if(I.type!==M||I.sparse!==void 0||I.normalized===!0||typeof I.count!="number"||!Number.isInteger(I.count)||I.count<1||typeof I.componentType!="number"||!x.includes(I.componentType)||typeof I.bufferView!="number")return null;let P=c[I.bufferView];if(!Mt(P)||P.buffer!==0||typeof P.byteLength!="number"||!Number.isInteger(P.byteLength)||P.byteLength<0)return null;let _=Kl(I.type),O=zl(I.componentType),C=typeof P.byteStride=="number"?P.byteStride:_*O,F=typeof P.byteOffset=="number"?P.byteOffset:0,k=typeof I.byteOffset=="number"?I.byteOffset:0,E=F+k,w=k+(I.count-1)*C+_*O;if(!Number.isInteger(C)||!Number.isInteger(F)||!Number.isInteger(k)||C<_*O||F<0||k<0||F+P.byteLength>o.byteLength||w>P.byteLength)return null;let B=[];for(let L=0;L<I.count;L++){let T=[];for(let v=0;v<_;v++){let H=Vl(h,E+L*C+v*O,I.componentType);if(!Number.isFinite(H))return null;T.push(H)}B.push(T)}return B},y=[],b=[],p=0,g=new Set,R=(A,M)=>{if(typeof A!="number"||!Number.isInteger(A)||!Mt(u[A])||g.has(A))return!1;g.add(A);let x=u[A],I=jl(x);if(!I)return!1;let P=Xl(M,I),_=Wl(P);if(!_)return!1;if(x.mesh!==void 0){if(typeof x.mesh!="number")return!1;let O=l[x.mesh];if(!Mt(O))return!1;for(let C of gt(O.primitives)){if(!Mt(C)||C.mode!==void 0&&C.mode!==4||!Mt(C.attributes))return!1;let F=d(C.attributes.POSITION,"VEC3",[5126]),k=C.attributes.NORMAL===void 0?null:d(C.attributes.NORMAL,"VEC3",[5126]);if(!F||C.attributes.NORMAL!==void 0&&!k)return!1;let E=F.length;if(C.indices!==void 0){let B=typeof C.indices=="number"?s[C.indices]:null;E=Mt(B)?B.count:void 0}if(typeof E!="number"||!Number.isInteger(E)||E%3!==0||(p+=E/3,p>1e5))return!1;let w=C.indices===void 0?F.map((B,L)=>[L]):d(C.indices,"SCALAR",[5121,5123,5125]);if(!w||w.length%3!==0||w.length!==E)return!1;for(let B=0;B<w.length;B+=3){let L=[w[B][0],w[B+1][0],w[B+2][0]];if(L.some(H=>!Number.isInteger(H)||H<0||H>=F.length))return!1;let T=L.map(H=>Ul(P,...F[H])),v=null;if(!k){let H=T[1][0]-T[0][0],j=T[1][1]-T[0][1],D=T[1][2]-T[0][2],U=T[2][0]-T[0][0],X=T[2][1]-T[0][1],Y=T[2][2]-T[0][2];v=gi([1,0,0,0,1,0,0,0,1],j*Y-D*X,D*U-H*Y,H*X-j*U)}for(let H=0;H<3;H++)y.push(...T[H]),b.push(...k?gi(_,...k[L[H]]):v)}}}for(let O of gt(x.children))if(!R(O,P))return!1;return g.delete(A),!0};for(let A of gt(f[m].nodes))if(!R(A,Hl()))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 Mi(t){try{return Zl(t)}catch{return{ok:!1,issue:"invalid_glb"}}}function rd(t){let{doc:n}=t,e=Ur(n.theme),r=e.structure,o=Xo(n,t.eventConfigurationId??n.eventConfigurationId),a=pi(t.eventConfigurationId,t.eventConfiguration,o),i=t.seats,s=new Nn,c=null;if(t.registeredShellGlb){let N=Mi(t.registeredShellGlb);if(N.ok){let G=N.position.length/3,W=new Float32Array(N.position.length),lt=e.materials.shell??r.tierWall;for(let ft=0;ft<G;ft++){let st=N.normal[ft*3+1],tt=st<-.25?.4:.62+.38*Math.max(0,st);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(G).fill(-2),material:new Float32Array(G),count:G}}}let l=new Map;for(let N of o)for(let G of N.objects)l.set(G.id,N.index),G.type==="section"&&l.set(G.logicalSectionId??G.id,N.index);let u=i.map(N=>l.get(N.sectionId??"")??l.get(N.rowId??"")??0),f=Ue(o,i),m=s.vertexCount,d=hi(s,o,i,u,f,r,at(e.background.top,e.background.bottom,.5))?s.vertexCount:m,y=Ao(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=[],R=lr(o,i,u),A=new Map;i.forEach((N,G)=>{let W=R.seatDeckY(G);Number.isFinite(W)&&A.set(N.rowId,Math.min(A.get(N.rowId)??1/0,W))});let M=new Float32Array(i.length),x=[],I=new Map((n.floors??[]).map((N,G)=>[N.id,G])),P=o.map(()=>[]);for(let N of i){let G=N.floorId?I.get(N.floorId)??0:0;P[Math.min(G,P.length-1)]?.push(N)}let _=(N,G)=>{if(!G||G.length<3)return!1;let W=Math.min(...G.map(tt=>tt.x)),lt=Math.max(...G.map(tt=>tt.x)),ft=Math.min(...G.map(tt=>tt.y)),st=Math.max(...G.map(tt=>tt.y));for(let tt=0;tt<N;tt++)for(let et of P[tt])if(!(et.x<W||et.x>lt||et.y<ft||et.y>st)&&St(et,G,void 0))return!0;return!1},O=null,C=N=>o.length===1?i:i.filter((G,W)=>u[W]===N),F=(N,G)=>{let W=At(N);if(!W)return!1;let lt=1/0,ft=1/0,st=-1/0,tt=-1/0;for(let et of W)lt=Math.min(lt,et.x),st=Math.max(st,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]===G)&&et.x>lt&&et.x<st&&et.y>ft&&et.y<tt&&xt(W,et.x,et.y))},k;for(let N=0;N<o.length;N++){let G=o[N];s.setFloor(N);let W=Nt(G,C(N)),lt=0;if(W){let z=0;for(let mt of G.objects)if(mt.type==="section")for(let yt of R.bySection.get(mt.id)?.rowLevels??[])z=Math.max(z,yt.y-G.baseHeightM);if(lt=Ko(z),!k){let mt=tn(W);k={centre:[mt.x*S,mt.y*S]}}}let ft=new Xn,st=[],tt=G.objects.filter(z=>z.type==="shape"&&(z.role==="entrance"||z.role==="exit")),et=G.objects.filter(z=>z.type==="section"&&!!z.outline&&z.outline.length>=3),ht=zr(G.objects.filter(z=>z.type==="booth"),G.focal);for(let z of G.objects)if(z.type==="section"){let mt=s.vertexCount;ri(s,z,G,Eo(z,y),R.bySection.get(z.id),ft,et,r,N>0&&_(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,Dt=W!==null&&z.role==="wall"&&!mt;s.setMaterial(Dt?jn:(mt?.kind??z.role)==="screen"?1:0);let Ht=z.role==="stage"&&!mt?Kr(z,C(N)):Dt&&z.heightM===void 0?{...z,heightM:lt}:z,kt=Yo(Ht,st);if(Er(s,Ht,G.baseHeightM+kt.supportOffsetM,kt.topOffsetM-kt.supportOffsetM,r,G.focal,g,mt,tt),s.setMaterial(0),z.role==="stage"&&!mt&&g.length>yt&&(O??N)===N){O=N;let Ft=n.floors?.[N]?.id,an=o.length>1&&Ft?i.filter(Pn=>Pn.floorId===Ft):i;bi(s,Ht,g[g.length-1].y,an)}}else z.type==="gaArea"?Br(s,z,G.baseHeightM,it(b.get(z.categoryKey)),r):z.type==="booth"?Ir(s,z,G.baseHeightM,it(b.get(z.categoryKey)),r,ht.get(z.id)??G.focal,F(z,N)):z.type==="table"?Ar(s,z,Math.max(G.baseHeightM,A.get(z.id)??G.baseHeightM),it(z.fill??n.theme?.decorFill??"#232c40"),r,!!(z.fill??n.theme?.decorFill)):z.type==="decorImage"&&wr(s,z,G.baseHeightM,r);W&&Cr(s,G.objects,W,G.baseHeightM,lt,G.focal,r,z=>!a.byObjectId.has(z.id)),si(s,G,i,R,r,e.materials.shell,!c)}let E=o.length>1?{x:o.reduce((N,G)=>N+G.focal.x,0)/o.length,y:o.reduce((N,G)=>N+G.focal.y,0)/o.length}:n.focalPoint??{x:(f.minX+f.maxX)/2,y:(f.minY+f.maxY)/2},w=go(c?[s.build(),c]:[s.build()]),B=Po(i,t.initialState,R,M,b,p),L=Gr({doc:n,units:o,seats:i,surfaces:R,focal:E}),{labels:T,sections:v,rows:H}=Dr({doc:n,units:o,seats:i,surfaces:R,seatData:B,hintedSeatFloor:u,zones:L,focal:E}),j=new Map(v.map((N,G)=>[N.id,G]));R.seatOwner.forEach((N,G)=>{B.iSection[G]=N?j.get(N)??-1:-1});let D=ai({doc:n,units:o,seats:i,surfaces:R,solids:w,hintedSeatFloor:u,seatFloor:M});Hr(T,D),B.iYaw=So(B.iPosition,i.length,N=>i[N].rowId,N=>{let G=o[M[N]]?.focal??E;return[G.x*S,G.y*S]});let U=(f.minX+f.maxX)/2*S,X=(f.minY+f.maxY)/2*S,Y=.5*Math.hypot((f.maxX-f.minX)*S,(f.maxY-f.minY)*S)||10,nt=We(w,B,{cx:U,cz:X,radius:Y},[m,d]),rt=We(w,B,{cx:U,cz:X,radius:Y}),q=ql(o),Q=di(B,g,f,nt.minY,nt.maxY,Y,q);return{sharedAisles:Xr(o.flatMap(N=>N.objects.flatMap(G=>{if(G.type!=="section")return[];let W=R.bySection.get(G.id);return W?[{sectionId:G.id,floorIndex:N.index,rows:W.rowLevels}]:[]}))),solids:w,sectionSolidRanges:x,seats:B,seatSectionIds:R.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:yi(B,g,q)},...k?{room:k}:{},...!k&&o.some(N=>N.objects.some(G=>G.type==="shape"&&En(G.stageKind)))?{outdoor:!0}:{},renderBounds:{center:nt.center,radius:nt.radius},clipBounds:{center:rt.center,radius:rt.radius},stateColorLUT:Wr(e,ln),theme:e,seatCount:i.length,focalWorld:[E.x*S,1.5,E.y*S],zones:L,stages:g,productionElements:a.elements,sections:v,rows:H,labels:T,floors:D}}function ql(t){let n=[];for(let e of t)for(let r of e.objects){let o=r.type==="gaArea"?r.points:r.type==="booth"?At(r):null;for(let a of o??[])n.push([a.x*S,e.baseHeightM,a.y*S])}return n}function $l(t,n){let{doc:e,report:r}=or(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(wn(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 Ql(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 cd(t){let n=t.estimate===!1?null:$l(t.doc,t.seats);return n?{input:{...t,doc:n.doc,seats:Ql(t.seats,n)},estimate:n}:{input:t}}export{uu as a,Li as b,vi as c,Mo as d,Ni as e,fu as f,ln as g,ce as h,Fn as i,eu as j,ue as k,S as l,Dn as m,Mu as n,Ru as o,or as p,hf as q,yf as r,df as s,pf as t,xf as u,bf as v,Se as w,gf as x,Mf as y,Rf as z,Sf as A,Pf as B,Oc as C,rd as D,$l as E,Ql as F,cd as G};
@@ -0,0 +1 @@
1
+ import{k as u,l as d}from"./chunk-URW7MSCJ.js";import{$a as s,Oa as p,Sa as y}from"./chunk-YE4NP3XB.js";var x=e=>Math.round(e*1e6)/1e6+0;function _(e){let o=e.map(r=>({x:x(r.x),y:x(r.y)})).sort((r,i)=>r.x-i.x||r.y-i.y).filter((r,i,a)=>i===0||r.x!==a[i-1].x||r.y!==a[i-1].y);if(o.length<3)return o;let t=(r,i,a)=>{let f=i.x-r.x,c=i.y-r.y,b=a.x-r.x,m=a.y-r.y;return f*m-c*b>1e-6*Math.hypot(f,c)*Math.hypot(b,m)},n=r=>{let i=[];for(let a of r){for(;i.length>=2&&!t(i[i.length-2],i[i.length-1],a);)i.pop();i.push(a)}return i.pop(),i};return[...n(o),...n([...o].reverse())]}function w(e,o){if(!e.length)return e;let t={x:e.reduce((n,r)=>n+r.x,0)/e.length,y:e.reduce((n,r)=>n+r.y,0)/e.length};return e.map(n=>{let r=n.x-t.x,i=n.y-t.y,a=Math.hypot(r,i)||1;return{x:n.x+r/a*o,y:n.y+i/a*o}})}var l=class extends Error{constructor(t,n,r={}){super(n);this.code=t;this.details=r;this.name="ChartOperationError"}};function M(e,o){let t=s(e),n=o?t.find(r=>r.id===o):t[0];if(!n)throw new l("floor_not_found",`Unknown chart floor: ${o}`,{floorId:o});return{floorId:n.id,objects:n.objects}}function E(e,o){if(!e.categories.some(t=>t.key===o))throw new l("category_not_found",`Unknown chart category: ${o}. Call get_chart to list valid category keys.`,{categoryKey:o})}function L(e,o,t,n){let r=new Set([...n,...e.categories.map(i=>i.key),...e.zones?.map(i=>i.id)??[],...e.floors?.map(i=>i.id)??[],...e.floors?.length?e.floors.flatMap(i=>i.objects.map(a=>a.id)):e.objects.map(i=>i.id)]);for(let i=0;i<100;i++){let a=t(o);if(a&&!r.has(a))return n.add(a),a}throw new l("id_generation_failed",`Unable to allocate a unique ${o} id`)}function $(e){let o=[];for(let n of e)n.type==="row"?o.push(...p(n).map(r=>({x:r.x,y:r.y}))):n.type==="table"?o.push(...y(n).map(r=>({x:r.x,y:r.y}))):n.type==="gaArea"?o.push(...n.points):n.type==="booth"&&o.push(n.center);if(o.length<3)return null;let t=w(_(o),22);return t.length>=3?t:null}function T(e,o){let t=M(e,o),n=s(e).find(r=>r.id===t.floorId);return{...e,objects:t.objects,floors:void 0,focalPoint:n.focalPoint,referenceImage:n.referenceImage,backgroundImage:n.backgroundImage}}var I=24,P=80;function F(e,o){let t=e.normalize("NFKC").trim();if(t.length>I)throw new l("invalid_operation",`${o} displayed type must be at most ${I} characters`);return t}function k(e,o){if(e.displayType===void 0)return!1;let t=F(e.displayType,o);return t?(e.displayType=t,!1):(delete e.displayType,!0)}function N(e,o){if(e.displayLabel===void 0)return!1;let t=e.displayLabel.normalize("NFKC").trim();if(t.length>P)throw new l("invalid_operation",`${o} displayed label must be at most ${P} characters`);return t?(e.displayLabel=t,!1):(delete e.displayLabel,!0)}function h(e,o){let t=e.trim().toLowerCase();if(!/^#[0-9a-f]{6}$/.test(t))throw new l("invalid_operation",`${o} must use a six-digit hex color`);return t}function C(e,o){if(!Number.isFinite(e)||e<u||e>d)throw new l("invalid_operation",`${o} label size must be from ${u} to ${d}`)}function U(e,o){e.size!==void 0&&e.size!==null&&C(e.size,o),e.color!==void 0&&e.color!==null&&h(e.color,`${o} label color`)}function R(e,o){if(e?.positionPreset!==void 0&&!["start","end","both","none"].includes(e.positionPreset))throw new l("invalid_operation",`${o} label positionPreset must be one of start, end, both, none`);let t=e?.labelStyle;t&&(t.size!==void 0&&C(t.size,o),t.color!==void 0&&h(t.color,`${o} label color`))}function B(e,o){let t=e?structuredClone(e):{},n=t.labelStyle?{...t.labelStyle}:{};return o.size===null?delete n.size:o.size!==void 0&&(n.size=o.size),o.color===null?delete n.color:o.color!==void 0&&(n.color=h(o.color,"Label color")),n.size===void 0&&n.color===void 0?delete t.labelStyle:t.labelStyle=n,o.visible!==void 0&&(t.visible=o.visible),Object.keys(t).length?t:void 0}function G(e,o,t){let n=o.normalize("NFKC").trim();if(!n||n.length>80)throw new l("invalid_operation","Zone labels must contain 1 to 80 characters");if((e.zones??[]).some(r=>r.id!==t&&r.label.normalize("NFKC").trim().toLocaleLowerCase("en")===n.toLocaleLowerCase("en")))throw new l("invalid_operation",`Zone label already exists: ${n}`);return n}function Z(e,o){if(!Number.isFinite(e?.x)||!Number.isFinite(e?.y))throw new l("invalid_operation",`${o} must contain finite x and y values`);return{x:e.x,y:e.y}}function K(e,o,t){return(o.x-e.x)*(t.y-e.y)-(o.y-e.y)*(t.x-e.x)}var Y=Math.PI/180,X=Math.PI/180;function q(e){return e.type==="row"||e.type==="table"?e.seatCount:e.type==="gaArea"?Math.max(0,Math.floor(e.capacity)):e.type==="booth"?1:0}function S(e){if(e.floors?.length){let o=e.floors[0];e.objects=o.objects,e.focalPoint=o.focalPoint,e.referenceImage=o.referenceImage,e.backgroundImage=o.backgroundImage}return e}var H=0,g=120,v=4;function j(e){if(!Number.isFinite(e)||e<H||e>g)throw new l("invalid_operation","Floor base height must be a number from 0 to 120 metres")}function Q(e,o){let t=s(e);if(t.length>=5)throw new l("invalid_operation","A chart can contain at most five physical floors");let n=(o.name??String(t.length+1)).normalize("NFKC").trim();if(!n||n.length>80)throw new l("invalid_operation","Floor names must contain 1 to 80 characters");if(t.some(c=>c.name.toLocaleLowerCase("en")===n.toLocaleLowerCase("en")))throw new l("invalid_operation",`Floor name already exists: ${n}`);e.floors?.length||(e.floors=[{id:"floor-0",name:"1",objects:e.objects,baseHeightM:0,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]);let i=e.floors[e.floors.length-1].baseHeightM??Math.min(g,(e.floors.length-1)*v),a=Math.min(g,i+v),f=L(e,"floor",o.idFactory,new Set);return e.floors.push({id:f,name:n,baseHeightM:a,objects:[],focalPoint:{...e.focalPoint}}),S(e),{changed:!0,floorId:f,floorCount:e.floors.length,baseHeightM:a}}function ee(e,o){let t=s(e),n=t.find(a=>a.id===o.floorId);if(!n)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});let r=o.name.normalize("NFKC").trim();if(!r||r.length>80)throw new l("invalid_operation","Floor names must contain 1 to 80 characters");if(t.some(a=>a.id!==n.id&&a.name.toLocaleLowerCase("en")===r.toLocaleLowerCase("en")))throw new l("invalid_operation",`Floor name already exists: ${r}`);let i=n.name!==r;return i&&(n.name=r),{changed:i,floorId:n.id,floorName:r}}function oe(e,o){if(!e.floors?.length)throw new l("invalid_operation","A single-floor chart has an implicit base height of 0 metres");let t=e.floors.find(r=>r.id===o.floorId);if(!t)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});j(o.baseHeightM);let n=t.baseHeightM!==o.baseHeightM;return n&&(t.baseHeightM=o.baseHeightM,t.physical3dProvenance={...t.physical3dProvenance,baseHeightM:{status:"confirmed",source:"user-review",note:"Physical floor height reviewed through the shared Designer/Copilot operation."}}),{changed:n,floorId:t.id,baseHeightM:o.baseHeightM}}function te(e,o){if(!e.floors?.length)throw new l("invalid_operation","A single-floor chart cannot remove its only floor");let t=e.floors.findIndex(r=>r.id===o.floorId);if(t<0)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});let[n]=e.floors.splice(t,1);if(e.floors.length===1){let[r]=e.floors;e.objects=r.objects,e.focalPoint=r.focalPoint,e.referenceImage=r.referenceImage,e.backgroundImage=r.backgroundImage,e.floors=void 0}else S(e);return{changed:!0,floorId:n.id,removedObjects:n.objects.length,floorCount:s(e).length}}export{_ as a,l as b,M as c,E as d,L as e,$ as f,T as g,F as h,k as i,N as j,h as k,U as l,R as m,B as n,G as o,Z as p,K as q,Y as r,X as s,q as t,S as u,g as v,v as w,Q as x,ee as y,oe as z,te as A};
@@ -1 +1 @@
1
- import{m as S}from"./chunk-UEDS3HJ3.js";import{$a as A,N as f,ja as w}from"./chunk-YE4NP3XB.js";var j=36,x=160;function v(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;if(!a)return{automatic:i,slots:[]};let c=a,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{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:"none";return{start:t==="start"||t==="both",end:t==="end"||t==="both"}}function p(e,t){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,v as c,l as d,D as e,I as f,E as g,N as h,U as i};
1
+ import{m as S}from"./chunk-URW7MSCJ.js";import{$a as A,N as f,ja as w}from"./chunk-YE4NP3XB.js";var j=36,x=160;function v(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;if(!a)return{automatic:i,slots:[]};let c=a,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{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:"none";return{start:t==="start"||t==="both",end:t==="end"||t==="both"}}function p(e,t){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,v as c,l as d,D as e,I as f,E as g,N as h,U as i};
@@ -1 +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};
1
+ import{h as g}from"./chunk-URW7MSCJ.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};
@@ -1 +1 @@
1
- import{q as N}from"./chunk-JRZHC75P.js";var I=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7"],R="#a4508b";var q={facilities:R,"food-drink":I[5],navigation:I[2],accessibility:I[4]},Q=N,K={minDiameterPx:12,glyphScale:.66,ringRatio:1/14,largeFromPx:24};function X(e,n){return n>=K.largeFromPx&&e.solidLarge?e.solidLarge:e.solid}var p=e=>{let n=Math.round(e*100)/100;return Object.is(n,-0)?"0":String(n)},y=e=>`${p(e[0])} ${p(e[1])}`,S=(e,n,o,t)=>[e+o*Math.cos(t*Math.PI/180),n+o*Math.sin(t*Math.PI/180)];function W(e){let n=`M${y(e.from)}`;for(let o of e.segs)n+=o.arc?`A${p(o.arc.r)} ${p(o.arc.r)} 0 ${o.arc.large} ${o.arc.sweep} ${y(o.to)}`:`L${y(o.to)}`;return`${n}Z`}function u(e){let n=[e.from,...e.segs.map(t=>t.to)],o=[];for(let t=e.segs.length-1;t>=0;t--){let i=e.segs[t].arc;o.push({to:n[t],arc:i&&{...i,sweep:i.sweep?0:1}})}return{from:n[n.length-1],segs:o}}function g(e,n,o){let t={r:o,large:0,sweep:1};return{from:[e-o,n],segs:[{to:[e+o,n],arc:t},{to:[e-o,n],arc:t}]}}function a(e,n,o,t,i){let s=Math.min(i,o/2,t/2),c={r:s,large:0,sweep:1};return s<=0?M([[e,n],[e+o,n],[e+o,n+t],[e,n+t]]):{from:[e+s,n],segs:[{to:[e+o-s,n]},{to:[e+o,n+s],arc:c},{to:[e+o,n+t-s]},{to:[e+o-s,n+t],arc:c},{to:[e+s,n+t]},{to:[e,n+t-s],arc:c},{to:[e,n+s]},{to:[e+s,n],arc:c}]}}function M(e){let n=0;for(let t=0;t<e.length;t++){let[i,s]=e[t],[c,m]=e[(t+1)%e.length];n+=i*m-c*s}let o=n>0?e:[...e].reverse();return{from:o[0],segs:[...o.slice(1).map(t=>({to:t})),{to:o[0]}]}}function l(e,n,o){let t=o/2,i=n[0]-e[0],s=n[1]-e[1],c=Math.hypot(i,s);if(c<1e-6)return g(e[0],e[1],t);let m=[s/c*t,-i/c*t],v={r:t,large:0,sweep:1},E=[e[0]+m[0],e[1]+m[1]];return{from:E,segs:[{to:[n[0]+m[0],n[1]+m[1]]},{to:[n[0]-m[0],n[1]-m[1]],arc:v},{to:[e[0]-m[0],e[1]-m[1]]},{to:E,arc:v}]}}function h(e,n,o=!1){let t=[],i=o?e.length:e.length-1;for(let s=0;s<i;s++)t.push(l(e[s],e[(s+1)%e.length],n));return t}function b(e,n,o,t,i,s){let c=s/2,m=i-t>180?1:0,v={r:c,large:0,sweep:1},E=S(e,n,o+c,t);return{from:E,segs:[{to:S(e,n,o+c,i),arc:{r:o+c,large:m,sweep:1}},{to:S(e,n,o-c,i),arc:v},{to:S(e,n,o-c,t),arc:{r:o-c,large:m,sweep:0}},{to:E,arc:v}]}}var r=(...e)=>e.flat().map(W).join(" "),d=(e,n,o)=>`M${p(e-o)} ${p(n)}a${p(o)} ${p(o)} 0 1 0 ${p(2*o)} 0a${p(o)} ${p(o)} 0 1 0 ${p(-2*o)} 0`,f=(e,n,o,t,i)=>W(a(e,n,o,t,i)),A=e=>`M${e.map(y).join("L")}`,O=(e,n,o,t,i)=>`M${y(S(e,n,o,t))}A${p(o)} ${p(o)} 0 ${i-t>180?1:0} 1 ${y(S(e,n,o,i))}`;function P(e,n,o,t=1){let i=s=>[s[0]*t+n,s[1]*t+o];return{head:[e.head[0]*t+n,e.head[1]*t+o,e.head[2]*t],limbs:e.limbs.map(s=>s.map(i)),arcs:e.arcs?.map(([s,c,m,v,E])=>[s*t+n,c*t+o,m*t,v,E])}}function _(e){return[d(e.head[0],e.head[1],e.head[2]),...e.limbs.map(A),...(e.arcs??[]).map(([n,o,t,i,s])=>O(n,o,t,i,s))].join(" ")}function k(e,n=2.6){return[g(e.head[0],e.head[1],e.head[2]+1),...e.limbs.flatMap(o=>h(o,n)),...(e.arcs??[]).map(([o,t,i,s,c])=>b(o,t,i,s,c,n-.2))]}var L={head:[10,4,2],limbs:[[[10,8.2],[10,14],[15.5,14],[18,19.5],[20.5,19.5]],[[10,10.6],[14.5,10.6]]],arcs:[[9.5,16,5.5,35,235]]},C={head:[10.6,3.9,1.9],limbs:[[[9.6,7.8],[7.6,12]],[[5.4,8.2],[9.4,8.4],[12.8,10]],[[4,15.6],[7.6,12],[11,13.6],[10.6,16.4]]]},$={cx:12,hr:1.9,arm:5,leg:3,r:2},G={cx:12,hr:1.9,sh:2.2,hem:6,leg:3},j={cx:6.2,hr:1.8,arm:3.6,leg:2.2,r:1.4},H={cx:17.8,hr:1.8,sh:1.4,hem:4.1,leg:2.2};function D({cx:e,hr:n,arm:o,leg:t,r:i}){return[d(e,2+n,n),`M${p(e-o+i)} 8.5H${p(e+o-i)}a${i} ${i} 0 0 1 ${i} ${i}V15H${p(e+t)}V22H${p(e-t)}V15H${p(e-o)}V${p(8.5+i)}a${i} ${i} 0 0 1 ${i} ${-i}Z`,`M${p(e)} 15V22`].join(" ")}function Z({cx:e,hr:n,arm:o,leg:t,r:i}){return[g(e,2+n,n+1),a(e-o-.5,7.8,2*o+1,7.7,i+.5),a(e-t-.5,13,t,9.5,1),a(e+.5,13,t,9.5,1)]}function T({cx:e,hr:n,sh:o,hem:t,leg:i}){return[d(e,2+n,n),A([[e-o,8.5],[e+o,8.5],[e+t,16],[e+i,16],[e+i,22],[e-i,22],[e-i,16],[e-t,16]])+"Z",`M${p(e)} 16V22`].join(" ")}function w({cx:e,hr:n,sh:o,hem:t,leg:i}){return[g(e,2+n,n+1),M([[e-o-.6,7.8],[e+o+.6,7.8],[e+t+.9,16.8],[e-t-.9,16.8]]),a(e-i-.1,15,i-.4,7.5,.9),a(e+.5,15,i-.4,7.5,.9)]}var z=[[14.6,1.5],[5.2,13.6],[11,13.6],[9.4,22.5],[18.8,10.4],[13,10.4]],e1="M8.5 3.5 4 5.5l-1.5 5 3 1 1-2v11h11v-11l1 2 3-1-1.5-5-4.5-2c-.5 1.5-1.8 2.5-3.5 2.5s-3-1-3.5-2.5Z",o1="M12 2.5S5 9.5 5 14.5a7 7 0 0 0 14 0c0-5-7-12-7-12Z",n1="M2.5 21.5h19V3h-6v6.2H9.2v6.2H2.5Z",B=[[9,3],[15,3],[15,9],[21,9],[21,15],[15,15],[15,21],[9,21],[9,15],[3,15],[3,9],[9,9]],t1={from:[3.8,5.2],segs:[{to:[20.2,5.2]},{to:[22,7],arc:{r:1.8,large:0,sweep:1}},{to:[22,9.7]},{to:[22,14.3],arc:{r:2.3,large:0,sweep:0}},{to:[22,17]},{to:[20.2,18.8],arc:{r:1.8,large:0,sweep:1}},{to:[3.8,18.8]},{to:[2,17],arc:{r:1.8,large:0,sweep:1}},{to:[2,14.3]},{to:[2,9.7],arc:{r:2.3,large:0,sweep:0}},{to:[2,7]},{to:[3.8,5.2],arc:{r:1.8,large:0,sweep:1}}]},i1={from:[12,1.6],segs:[{to:[20.4,4.9]},{to:[20.4,11.2]},{to:[12,22.4],arc:{r:13,large:0,sweep:1}},{to:[3.6,11.2],arc:{r:13,large:0,sweep:1}},{to:[3.6,4.9]},{to:[12,1.6]}]};function F(e,n,o){return{from:[e-o,n],segs:[{to:[e+o,n],arc:{r:o,large:0,sweep:1}},{to:[e-o,n]}]}}var U={head:[13.2,4.3,2.2],limbs:[[[12.6,8.6],[11.2,15],[17.8,18.4],[9.4,18.4]],[[12.4,9.8],[16,14.4]]]},a1=[[6,10.5],[15,10.5],[16.5,7],[18.5,5.5],[20,6.5],[21.5,8.5],[19.5,10],[18,12],[18,19],[16.5,19],[15.5,14],[9.5,14],[8.5,19],[7,19],[6.5,13]],r1=[[5.4,9.8],[14.6,9.8],[16.1,6.4],[18.4,4.6],[20.5,5.9],[22.4,8.6],[19.9,10.6],[18.8,12.3],[18.8,19.8],[15.8,19.8],[15,14.8],[10.1,14.8],[9.2,19.8],[6.2,19.8],[5.6,13.2]],V=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:D($),solid:r(Z($))},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:T(G),solid:r(w(G))},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:[f(2.5,2.5,19,19,3.5),_(P(L,4.6,4.3,.66))].join(" "),solid:r(k(L)),solidLarge:r(a(1.5,1.5,21,21,4.5),u(a(3.9,3.9,16.2,16.2,2.6)),k(P(L,4.9,4.7,.62),2.2))},{key:"first-aid",label:"First aid",group:"facilities",path:A(B)+"Z",solid:r(M(B.map(([e,n])=>[e+(e-12)*.08,n+(n-12)*.08])))},{key:"coat-check",label:"Coat check",group:"facilities",path:"M10 6.5a2 2 0 1 1 2 2V10 M12 10 3.4 16.9a1.4 1.4 0 0 0 .9 2.6h15.4a1.4 1.4 0 0 0 .9-2.6Z",solid:r(b(12,6.2,2.2,180,450,2.3),l([12,8.4],[12,10.5],2.3),h([[12,10.2],[3.2,18.8],[20.8,18.8]],2.8,!0))},{key:"atm",label:"ATM / cash",group:"facilities",path:[f(2,6,20,12,2),d(12,12,2.75),"M6 12h.01 M18 12h.01"].join(" "),solid:r(a(1.5,5.5,21,13,2.4),u(g(12,12,3.2)))},{key:"info",label:"Info point",group:"facilities",path:[d(12,12,9.5),"M10.8 11H12v5.8 M12 7.6h.01"].join(" "),solid:r(g(12,4.9,2.4),a(10.3,9.2,3.4,12.3,1),a(8.2,9.2,4,3,1),a(8.2,18.5,7.6,3,1))},{key:"lost-found",label:"Lost & found",group:"facilities",path:[d(10.5,10.5,7.5),"M16 16l5.5 5.5","M8.4 8.4a2.1 2.1 0 1 1 3 1.9c-.6.4-.9.8-.9 1.6 M10.5 14.6h.01"].join(" "),solid:r(b(12,7.6,4.2,180,405,3.4),h([[14.97,10.57],[12,13],[12,15]],3.4),g(12,20,2.1))},{key:"restrooms",label:"Toilets",group:"facilities",path:[D(j),T(H)].join(" "),solid:r(Z(j),w(H))},{key:"charging",label:"Charging point",group:"facilities",path:[f(6,2,12,20,2.5),"M13.2 6.2 9.6 12h4.8l-3.6 5.8"].join(" "),solid:r(M(z))},{key:"smoking",label:"Smoking area",group:"facilities",path:[f(2,14.5,14.5,4,1),"M6.5 14.5v4","M15.5 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4 M19 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4"].join(" "),solid:r(a(1.5,14,4.2,5,1.2),a(6.8,14,10.4,5,1.2),h([[15.9,11.4],[17.3,8.9],[15.9,6.4],[17.1,3.9]],2.2),h([[19.6,11.4],[21,8.9],[19.6,6.4],[20.8,3.9]],2.2))},{key:"no-smoking",label:"No smoking",group:"facilities",path:[d(12,12,9.5),"M5.3 5.3l13.4 13.4","M5.5 10.5h13v3h-13Z"].join(" "),solid:r(g(12,12,10.6),u(g(12,12,8)),l([6,6],[18,18],2.8),a(5,10.4,3,3.2,.6),a(16,10.4,3,3.2,.6))},{key:"food",label:"Food",group:"food-drink",path:"M5 2.5V8a2.5 2.5 0 0 0 5 0V2.5 M7.5 2.5v19 M18.5 13.5h-2c-1.3 0-2-1-2-2.5 0-4 1.5-7 4-8.5v19",solid:r(h([[4.9,2.6],[4.9,8]],2.2),h([[10.1,2.6],[10.1,8]],2.2),h([[7.5,2.6],[7.5,8]],2.2),b(7.5,8,2.6,0,180,2.2),l([7.5,10],[7.5,21.4],3),M([[19.4,2.2],[19.4,14.2],[16.2,14.2],[14.1,12],[14.1,9.4],[15.2,5.8],[17.3,3.3]]),l([18,13],[18,21.4],3))},{key:"bar",label:"Bar",group:"food-drink",path:"M3.5 3.5h17L12 13Z M6.2 6.5h11.6 M12 13v7.5 M8 20.5h8",solid:r(M([[2.8,3],[21.2,3],[12,13.6]]),l([12,12],[12,20.6],2.8),l([7.4,21],[16.6,21],2.8))},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 9h12v4.5a5.5 5.5 0 0 1-5.5 5.5h-1A5.5 5.5 0 0 1 4 13.5Z M16 10.5h1.2a2.75 2.75 0 0 1 0 5.5H16 M8 3v3 M12 3v3 M3 21.5h14",solid:r({from:[3.4,8.4],segs:[{to:[16.6,8.4]},{to:[16.6,13.4]},{to:[11,19.4],arc:{r:5.8,large:0,sweep:1}},{to:[9,19.4]},{to:[3.4,13.4],arc:{r:5.8,large:0,sweep:1}},{to:[3.4,8.4]}]},b(17.2,13.25,2.5,270,450,2.4),l([7.8,2.6],[7.8,5.6],2.4),l([12.2,2.6],[12.2,5.6],2.4),l([2.6,21.6],[17.4,21.6],2.6))},{key:"water",label:"Water / drinks",group:"food-drink",path:o1,solid:"M12 1.2S4 8.9 4 14.5a8 8 0 0 0 16 0c0-5.6-8-13.3-8-13.3Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:e1,solid:"M8.4 2.8 3.5 5l-1.9 6 4.2 1.4.4-.8v9.4h11.6v-9.4l.4.8 4.2-1.4-1.9-6-4.9-2.2c-.4 1.5-1.8 2.6-3.6 2.6s-3.2-1.1-3.6-2.6Z"},{key:"screen",label:"Screen",group:"facilities",path:[f(2,3.5,20,13.5,2),"M12 17v3.5 M8 20.5h8","M10 7.8v5.9l5-2.95Z"].join(" "),solid:r(a(1.5,3,21,14.4,2.4),u(M([[9.6,6.7],[16,10.2],[9.6,13.7]])),a(10.6,16.5,2.8,4,0),l([7.4,21],[16.6,21],2.8))},{key:"sound-booth",label:"Sound booth",group:"facilities",path:["M6 3v9 M6 16v5 M12 3v3 M12 10v11 M18 3v10 M18 17v4",d(6,14,2),d(12,8,2),d(18,15,2)].join(" "),solid:r(l([6,2.8],[6,21.2],1.8),l([12,2.8],[12,21.2],1.8),l([18,2.8],[18,21.2],1.8),a(3.2,11.6,5.6,4.8,1.4),a(9.2,5.6,5.6,4.8,1.4),a(15.2,12.6,5.6,4.8,1.4))},{key:"entrance",label:"Entrance",group:"navigation",path:"M11 7V3.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V17 M2.5 12h13.5 M12.5 8.5 16 12l-3.5 3.5",solid:r(h([[11,6.5],[11,2.6],[21,2.6],[21,21.4],[11,21.4],[11,17.5]],2.6),l([2.8,12],[13.5,12],3.2),M([[12.6,7.8],[18,12],[12.6,16.2]]))},{key:"exit",label:"Exit",group:"navigation",path:"M13 7V3.5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v17a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V17 M8 12h13.5 M18 8.5l3.5 3.5-3.5 3.5",solid:r(h([[13,6.5],[13,2.6],[3,2.6],[3,21.4],[13,21.4],[13,17.5]],2.6),l([7.2,12],[17,12],3.2),M([[16.2,7.8],[21.6,12],[16.2,16.2]]))},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:[_(P(C,-2,1.4,1.15)),"M15.5 13h6 M19 10.5l2.5 2.5-2.5 2.5"].join(" "),solid:r(k(P(C,-2,1.4,1.15),2.7),l([15.6,13],[19.5,13],2.8),M([[18.4,9.4],[22.4,13],[18.4,16.6]]))},{key:"stairs",label:"Stairs",group:"navigation",path:n1,solid:"M1.5 22.5h21V2h-7.8v6.4H8.4v6.4H1.5Z"},{key:"elevator",label:"Elevator",group:"navigation",path:[f(3.5,2.5,17,19,2.5),"M8.5 9.5 12 5.5l3.5 4Z M8.5 14.5l3.5 4 3.5-4Z"].join(" "),solid:r(M([[12,1.6],[19.6,10.2],[4.4,10.2]]),M([[4.4,13.8],[19.6,13.8],[12,22.4]]))},{key:"parking",label:"Parking",group:"navigation",path:[f(3,3,18,18,3),"M9.5 17V7h3.75a3 3 0 0 1 0 6H9.5"].join(" "),solid:"M6.5 21V3H12a5.5 5.5 0 0 1 0 11h-1.9v7Z M10.1 6.6v3.8H12a1.9 1.9 0 0 0 0-3.8Z"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:_(L),solid:r(k(L))},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:["M4 9a6 6 0 1 1 12 0c0 3-1.8 4.3-3 5.2-1.1.8-1.6 1.7-1.6 3.1a3.6 3.6 0 0 1-6.2 2.1","M7.5 9a2.5 2.5 0 0 1 5 0c0 1.2-.7 1.9-1.6 2.5","M18.5 5.5a6.5 6.5 0 0 1 0 8"].join(" "),solid:r(b(10,9,6,180,380,3),h([[15.64,11.05],[12.8,14.3],[11.5,17.2]],3),b(8.2,17.2,3.3,0,150,3),b(10,9,2.2,180,400,2.4),b(13.38,9.5,6.5,322,398,2.6))},{key:"box-office",label:"Box office / tickets",group:"navigation",path:"M3 7.5A1.5 1.5 0 0 1 4.5 6h15A1.5 1.5 0 0 1 21 7.5V10a2 2 0 0 0 0 4v2.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5V14a2 2 0 0 0 0-4Z M15 6v2 M15 11v2 M15 16v2",solid:r(t1,u(a(14.1,7,1.8,2.2,.9)),u(a(14.1,10.9,1.8,2.2,.9)),u(a(14.1,14.8,1.8,2.2,.9)))},{key:"escalator",label:"Escalator",group:"navigation",path:"M2.5 17H7l9-9h5.5v4h-4l-9 9h-6Z M11 4.5h.01 M11 8.2v3.3",solid:r(M([[2,16.4],[6.8,16.4],[15.8,7.4],[22,7.4],[22,12.6],[17.8,12.6],[8.8,21.6],[2,21.6]]),g(11,4.3,2.3),l([11,8],[11,11],2.6))},{key:"ramp",label:"Ramp",group:"navigation",path:"M2.5 19.5h19v-10Z M4.5 13.2 14 8.2 M10.53 7.76 14 8.2l-1.6 3.11",solid:r(M([[1.6,20.4],[22.4,20.4],[22.4,8.6]]),l([4.2,13.4],[13.2,8.6],2.6),M([[15.4,7.5],[13.16,11.84],[10.56,6.88]]))},{key:"taxi",label:"Taxi / rideshare",group:"navigation",path:["M9.5 2.5h5V5h-5Z M6.5 11 8 7h8l1.5 4",f(3.5,11,17,6,2),"M6.5 17v2.5 M17.5 17v2.5 M7 14h.01 M17 14h.01"].join(" "),solid:r(a(9,1.8,6,3.4,.8),M([[6,11.4],[7.6,6.4],[16.4,6.4],[18,11.4]]),a(2.8,10.6,18.4,7,2.2),u(g(6.8,14,1.3)),u(g(17.2,14,1.3)),a(4.8,16,3.6,5.2,1.2),a(15.6,16,3.6,5.2,1.2))},{key:"transit",label:"Bus / transit",group:"navigation",path:[f(4.5,2.5,15,16,3),"M4.5 10.5h15 M9 5.5h6 M7.5 18.5V21 M16.5 18.5V21 M8 14.5h.01 M16 14.5h.01"].join(" "),solid:r(a(4,2,16,17,3.2),u(a(6.2,5.8,11.6,5,1)),u(g(8,14.5,1.3)),u(g(16,14.5,1.3)),a(6,17,3.4,5,1.2),a(14.6,17,3.4,5,1.2))},{key:"bike-parking",label:"Bike parking",group:"navigation",path:[d(6,14.5,4),d(18,14.5,4),"M6 14.5 9 7.5h6.5L18 14.5 M9 7.5l2.5 7H6 M11.5 14.5l4-7 M7.5 6h3 M15.5 7.5 15 5.5h2"].join(" "),solid:r(g(6,14.5,4.9),u(g(6,14.5,2.7)),g(18,14.5,4.9),u(g(18,14.5,2.7)),h([[6,14.5],[9,7.5],[15.5,7.5],[18,14.5]],2.2),h([[9,7.5],[11.5,14.5],[15.5,7.5]],2.2),l([6,14.5],[11.5,14.5],2.2),l([7.2,5.8],[10.6,5.8],2.2),h([[15.4,7.3],[15,5.4],[17.2,5.4]],2.2))},{key:"meeting-point",label:"Meeting point",group:"navigation",path:["M9.5 2.5 12 5l2.5-2.5 M9.5 21.5 12 19l2.5 2.5 M2.5 9.5 5 12l-2.5 2.5 M21.5 9.5 19 12l2.5 2.5",d(10,9.6,1.5),d(14,9.6,1.5),"M7.5 15.5a2.5 2.5 0 0 1 5 0 M11.5 15.5a2.5 2.5 0 0 1 5 0"].join(" "),solid:r(h([[9.4,2.4],[12,5],[14.6,2.4]],2.6),h([[9.4,21.6],[12,19],[14.6,21.6]],2.6),h([[2.4,9.4],[5,12],[2.4,14.6]],2.6),h([[21.6,9.4],[19,12],[21.6,14.6]],2.6),g(9.7,9.3,2.2),g(14.3,9.3,2.2),F(9.7,16,3),F(14.3,16,3))},{key:"security",label:"Security / bag check",group:"facilities",path:"M12 2.5 19.5 5.5v6c0 4.6-3.2 8.4-7.5 10-4.3-1.6-7.5-5.4-7.5-10v-6Z M8.5 12l2.5 2.5 4.5-5",solid:r(i1,u(M([[7.4,12.2],[9,10.6],[10.9,12.5],[15,8.4],[16.6,10],[10.9,15.7]])))},{key:"lockers",label:"Lockers",group:"facilities",path:[f(3.5,2.5,17,19,1.5),"M12 2.5v19 M6 6h3 M15 6h3 M9.5 11.5v2.5 M14.5 11.5v2.5"].join(" "),solid:r(a(3,2,8.4,20,1.4),u(a(5,5,4.4,1.7,.8)),u(a(8.6,10.8,1.5,3.8,.7)),a(12.6,2,8.4,20,1.4),u(a(14.6,5,4.4,1.7,.8)),u(a(13.9,10.8,1.5,3.8,.7)))},{key:"baby-change",label:"Baby change",group:"facilities",path:"M10 6.5l.8-3.3a1.2 1.2 0 0 1 2.4 0l.8 3.3 M8.5 6.5h7 M9.5 6.5l-.9 2.2a3 3 0 0 0-.1.9V19a2.5 2.5 0 0 0 2.5 2.5h2a2.5 2.5 0 0 0 2.5-2.5V9.6a3 3 0 0 0-.1-.9l-.9-2.2 M8.5 12.5h3 M8.5 16h3",solid:r(M([[9.6,6.2],[10.6,1.8],[13.4,1.8],[14.4,6.2]]),a(7.6,5.4,8.8,2.6,1),a(7.8,7.4,8.4,15,2.6),u(a(7.8,11.8,3.4,1.5,0)),u(a(7.8,15.4,3.4,1.5,0)))},{key:"prayer-room",label:"Prayer room",group:"facilities",path:[_(U),"M3 21.5h18"].join(" "),solid:r(k(U),a(2.4,20.2,19.2,2.6,1.3))},{key:"quiet-room",label:"Quiet room",group:"facilities",path:"M4 9h3.5l5-4v14l-5-4H4Z M15.5 9.5l5 5 M20.5 9.5l-5 5",solid:r(M([[2.6,8.4],[7.2,8.4],[13,3.6],[13,20.4],[7.2,15.6],[2.6,15.6]]),l([15.4,9.2],[20.8,14.8],2.8),l([20.8,9.2],[15.4,14.8],2.8))},{key:"wifi",label:"Wi-Fi",group:"facilities",path:[O(12,19,11.5,218,322),O(12,19,7.5,218,322),O(12,19,3.5,218,322),"M12 19h.01"].join(" "),solid:r(b(12,19.2,11,218,322,2.8),b(12,19.2,6.9,218,322,2.8),g(12,19.2,2.2))},{key:"vip-lounge",label:"VIP lounge",group:"facilities",path:["M6.5 11V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4","M3.5 11.5a1.5 1.5 0 0 1 3 0V14h11v-2.5a1.5 1.5 0 0 1 3 0v6h-17Z","M5.5 17.5V20 M18.5 17.5V20"].join(" "),solid:r(a(6,4,12,8.5,2.2),a(2.4,9.6,4.6,9,2.2),a(17,9.6,4.6,9,2.2),a(6,13.2,12,5.4,.6),l([5,18],[5,20.6],2.4),l([19,18],[19,20.6],2.4))},{key:"accessible-entrance",label:"Accessible entrance",group:"accessibility",path:[_(P(L,.3,5,.62)),"M12.5 3.5H20a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-7.5"].join(" "),solid:r(k(P(L,.3,5,.62),2.2),h([[13,2.8],[21.2,2.8],[21.2,21.2],[13,21.2]],2.6))},{key:"assistance-dog",label:"Assistance-dog area",group:"accessibility",path:[A(a1)+"Z","M6 10.8 3.5 7.5","M10.5 10.5V6h4.5l1 2.5"].join(" "),solid:r(M(r1),l([6.2,11],[3.2,7.2],2.4),h([[10.5,11],[10.5,5.6],[15.2,5.6],[16.2,8.2]],2.2))}],s1=new Map(V.map(e=>[e.key,e]));function m1(e){return e?s1.get(e):void 0}var f1=24,v1=2,E1={facilities:"Facilities","food-drink":"Food & drink",navigation:"Getting around",accessibility:"Accessibility"},L1=["facilities","food-drink","navigation","accessibility"],x=V,P1="#8b93a7",k1={wall:"M3 5h18v14H3V5Z M3 9.7h18 M3 14.3h18 M9 5v4.7 M15 5v4.7 M6 9.7v4.6 M12 9.7v4.6 M18 9.7v4.6 M9 14.3v4.7 M15 14.3v4.7",rail:"M3 7h18 M4 17h16 M6 7v10 M10 7v10 M14 7v10 M18 7v10",suite:"M3 4h18v16H3V4Z M6 17v-5h12v5 M8 12V9h8v3",obstruction:"M8 3h8l-1 4v10l1 4H8l1-4V7L8 3Z M9 7h6 M9 17h6"},J=new Map(x.map(e=>[e.key,e]));function l1(e){return e?J.get(e):void 0}function S1(e){return l1(e)?.path}function y1(e){return typeof e=="string"&&J.has(e)}var _1=x.map(e=>e.key);var A1=["butt","round","square"],V1=["miter","round","bevel"],N1=["none","arrow"],c1="round",p1="round",Y="none";function u1(e){return e==="line"||e==="polyline"}function R1(e){return e==="polygon"||u1(e)}function C1(e){return{lineCap:e.lineCap??c1,lineJoin:e.lineJoin??p1,startEnding:e.startEnding??Y,endEnding:e.endEnding??Y}}function $1(e){return{pointerLength:Math.min(48,Math.max(8,e*3)),pointerWidth:Math.min(40,Math.max(8,e*2.25))}}export{I as a,q as b,Q as c,K as d,X as e,m1 as f,f1 as g,v1 as h,E1 as i,L1 as j,x as k,P1 as l,k1 as m,l1 as n,S1 as o,y1 as p,_1 as q,A1 as r,V1 as s,N1 as t,c1 as u,p1 as v,Y as w,u1 as x,R1 as y,C1 as z,$1 as A};
1
+ import{q as N}from"./chunk-EE2CVYFJ.js";var I=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7"],R="#a4508b";var q={facilities:R,"food-drink":I[5],navigation:I[2],accessibility:I[4]},Q=N,K={minDiameterPx:12,glyphScale:.66,ringRatio:1/14,largeFromPx:24};function X(e,n){return n>=K.largeFromPx&&e.solidLarge?e.solidLarge:e.solid}var p=e=>{let n=Math.round(e*100)/100;return Object.is(n,-0)?"0":String(n)},y=e=>`${p(e[0])} ${p(e[1])}`,S=(e,n,o,t)=>[e+o*Math.cos(t*Math.PI/180),n+o*Math.sin(t*Math.PI/180)];function W(e){let n=`M${y(e.from)}`;for(let o of e.segs)n+=o.arc?`A${p(o.arc.r)} ${p(o.arc.r)} 0 ${o.arc.large} ${o.arc.sweep} ${y(o.to)}`:`L${y(o.to)}`;return`${n}Z`}function u(e){let n=[e.from,...e.segs.map(t=>t.to)],o=[];for(let t=e.segs.length-1;t>=0;t--){let i=e.segs[t].arc;o.push({to:n[t],arc:i&&{...i,sweep:i.sweep?0:1}})}return{from:n[n.length-1],segs:o}}function g(e,n,o){let t={r:o,large:0,sweep:1};return{from:[e-o,n],segs:[{to:[e+o,n],arc:t},{to:[e-o,n],arc:t}]}}function a(e,n,o,t,i){let s=Math.min(i,o/2,t/2),c={r:s,large:0,sweep:1};return s<=0?M([[e,n],[e+o,n],[e+o,n+t],[e,n+t]]):{from:[e+s,n],segs:[{to:[e+o-s,n]},{to:[e+o,n+s],arc:c},{to:[e+o,n+t-s]},{to:[e+o-s,n+t],arc:c},{to:[e+s,n+t]},{to:[e,n+t-s],arc:c},{to:[e,n+s]},{to:[e+s,n],arc:c}]}}function M(e){let n=0;for(let t=0;t<e.length;t++){let[i,s]=e[t],[c,m]=e[(t+1)%e.length];n+=i*m-c*s}let o=n>0?e:[...e].reverse();return{from:o[0],segs:[...o.slice(1).map(t=>({to:t})),{to:o[0]}]}}function l(e,n,o){let t=o/2,i=n[0]-e[0],s=n[1]-e[1],c=Math.hypot(i,s);if(c<1e-6)return g(e[0],e[1],t);let m=[s/c*t,-i/c*t],v={r:t,large:0,sweep:1},E=[e[0]+m[0],e[1]+m[1]];return{from:E,segs:[{to:[n[0]+m[0],n[1]+m[1]]},{to:[n[0]-m[0],n[1]-m[1]],arc:v},{to:[e[0]-m[0],e[1]-m[1]]},{to:E,arc:v}]}}function h(e,n,o=!1){let t=[],i=o?e.length:e.length-1;for(let s=0;s<i;s++)t.push(l(e[s],e[(s+1)%e.length],n));return t}function b(e,n,o,t,i,s){let c=s/2,m=i-t>180?1:0,v={r:c,large:0,sweep:1},E=S(e,n,o+c,t);return{from:E,segs:[{to:S(e,n,o+c,i),arc:{r:o+c,large:m,sweep:1}},{to:S(e,n,o-c,i),arc:v},{to:S(e,n,o-c,t),arc:{r:o-c,large:m,sweep:0}},{to:E,arc:v}]}}var r=(...e)=>e.flat().map(W).join(" "),d=(e,n,o)=>`M${p(e-o)} ${p(n)}a${p(o)} ${p(o)} 0 1 0 ${p(2*o)} 0a${p(o)} ${p(o)} 0 1 0 ${p(-2*o)} 0`,f=(e,n,o,t,i)=>W(a(e,n,o,t,i)),A=e=>`M${e.map(y).join("L")}`,O=(e,n,o,t,i)=>`M${y(S(e,n,o,t))}A${p(o)} ${p(o)} 0 ${i-t>180?1:0} 1 ${y(S(e,n,o,i))}`;function P(e,n,o,t=1){let i=s=>[s[0]*t+n,s[1]*t+o];return{head:[e.head[0]*t+n,e.head[1]*t+o,e.head[2]*t],limbs:e.limbs.map(s=>s.map(i)),arcs:e.arcs?.map(([s,c,m,v,E])=>[s*t+n,c*t+o,m*t,v,E])}}function _(e){return[d(e.head[0],e.head[1],e.head[2]),...e.limbs.map(A),...(e.arcs??[]).map(([n,o,t,i,s])=>O(n,o,t,i,s))].join(" ")}function k(e,n=2.6){return[g(e.head[0],e.head[1],e.head[2]+1),...e.limbs.flatMap(o=>h(o,n)),...(e.arcs??[]).map(([o,t,i,s,c])=>b(o,t,i,s,c,n-.2))]}var L={head:[10,4,2],limbs:[[[10,8.2],[10,14],[15.5,14],[18,19.5],[20.5,19.5]],[[10,10.6],[14.5,10.6]]],arcs:[[9.5,16,5.5,35,235]]},C={head:[10.6,3.9,1.9],limbs:[[[9.6,7.8],[7.6,12]],[[5.4,8.2],[9.4,8.4],[12.8,10]],[[4,15.6],[7.6,12],[11,13.6],[10.6,16.4]]]},$={cx:12,hr:1.9,arm:5,leg:3,r:2},G={cx:12,hr:1.9,sh:2.2,hem:6,leg:3},j={cx:6.2,hr:1.8,arm:3.6,leg:2.2,r:1.4},H={cx:17.8,hr:1.8,sh:1.4,hem:4.1,leg:2.2};function D({cx:e,hr:n,arm:o,leg:t,r:i}){return[d(e,2+n,n),`M${p(e-o+i)} 8.5H${p(e+o-i)}a${i} ${i} 0 0 1 ${i} ${i}V15H${p(e+t)}V22H${p(e-t)}V15H${p(e-o)}V${p(8.5+i)}a${i} ${i} 0 0 1 ${i} ${-i}Z`,`M${p(e)} 15V22`].join(" ")}function Z({cx:e,hr:n,arm:o,leg:t,r:i}){return[g(e,2+n,n+1),a(e-o-.5,7.8,2*o+1,7.7,i+.5),a(e-t-.5,13,t,9.5,1),a(e+.5,13,t,9.5,1)]}function T({cx:e,hr:n,sh:o,hem:t,leg:i}){return[d(e,2+n,n),A([[e-o,8.5],[e+o,8.5],[e+t,16],[e+i,16],[e+i,22],[e-i,22],[e-i,16],[e-t,16]])+"Z",`M${p(e)} 16V22`].join(" ")}function w({cx:e,hr:n,sh:o,hem:t,leg:i}){return[g(e,2+n,n+1),M([[e-o-.6,7.8],[e+o+.6,7.8],[e+t+.9,16.8],[e-t-.9,16.8]]),a(e-i-.1,15,i-.4,7.5,.9),a(e+.5,15,i-.4,7.5,.9)]}var z=[[14.6,1.5],[5.2,13.6],[11,13.6],[9.4,22.5],[18.8,10.4],[13,10.4]],e1="M8.5 3.5 4 5.5l-1.5 5 3 1 1-2v11h11v-11l1 2 3-1-1.5-5-4.5-2c-.5 1.5-1.8 2.5-3.5 2.5s-3-1-3.5-2.5Z",o1="M12 2.5S5 9.5 5 14.5a7 7 0 0 0 14 0c0-5-7-12-7-12Z",n1="M2.5 21.5h19V3h-6v6.2H9.2v6.2H2.5Z",B=[[9,3],[15,3],[15,9],[21,9],[21,15],[15,15],[15,21],[9,21],[9,15],[3,15],[3,9],[9,9]],t1={from:[3.8,5.2],segs:[{to:[20.2,5.2]},{to:[22,7],arc:{r:1.8,large:0,sweep:1}},{to:[22,9.7]},{to:[22,14.3],arc:{r:2.3,large:0,sweep:0}},{to:[22,17]},{to:[20.2,18.8],arc:{r:1.8,large:0,sweep:1}},{to:[3.8,18.8]},{to:[2,17],arc:{r:1.8,large:0,sweep:1}},{to:[2,14.3]},{to:[2,9.7],arc:{r:2.3,large:0,sweep:0}},{to:[2,7]},{to:[3.8,5.2],arc:{r:1.8,large:0,sweep:1}}]},i1={from:[12,1.6],segs:[{to:[20.4,4.9]},{to:[20.4,11.2]},{to:[12,22.4],arc:{r:13,large:0,sweep:1}},{to:[3.6,11.2],arc:{r:13,large:0,sweep:1}},{to:[3.6,4.9]},{to:[12,1.6]}]};function F(e,n,o){return{from:[e-o,n],segs:[{to:[e+o,n],arc:{r:o,large:0,sweep:1}},{to:[e-o,n]}]}}var U={head:[13.2,4.3,2.2],limbs:[[[12.6,8.6],[11.2,15],[17.8,18.4],[9.4,18.4]],[[12.4,9.8],[16,14.4]]]},a1=[[6,10.5],[15,10.5],[16.5,7],[18.5,5.5],[20,6.5],[21.5,8.5],[19.5,10],[18,12],[18,19],[16.5,19],[15.5,14],[9.5,14],[8.5,19],[7,19],[6.5,13]],r1=[[5.4,9.8],[14.6,9.8],[16.1,6.4],[18.4,4.6],[20.5,5.9],[22.4,8.6],[19.9,10.6],[18.8,12.3],[18.8,19.8],[15.8,19.8],[15,14.8],[10.1,14.8],[9.2,19.8],[6.2,19.8],[5.6,13.2]],V=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:D($),solid:r(Z($))},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:T(G),solid:r(w(G))},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:[f(2.5,2.5,19,19,3.5),_(P(L,4.6,4.3,.66))].join(" "),solid:r(k(L)),solidLarge:r(a(1.5,1.5,21,21,4.5),u(a(3.9,3.9,16.2,16.2,2.6)),k(P(L,4.9,4.7,.62),2.2))},{key:"first-aid",label:"First aid",group:"facilities",path:A(B)+"Z",solid:r(M(B.map(([e,n])=>[e+(e-12)*.08,n+(n-12)*.08])))},{key:"coat-check",label:"Coat check",group:"facilities",path:"M10 6.5a2 2 0 1 1 2 2V10 M12 10 3.4 16.9a1.4 1.4 0 0 0 .9 2.6h15.4a1.4 1.4 0 0 0 .9-2.6Z",solid:r(b(12,6.2,2.2,180,450,2.3),l([12,8.4],[12,10.5],2.3),h([[12,10.2],[3.2,18.8],[20.8,18.8]],2.8,!0))},{key:"atm",label:"ATM / cash",group:"facilities",path:[f(2,6,20,12,2),d(12,12,2.75),"M6 12h.01 M18 12h.01"].join(" "),solid:r(a(1.5,5.5,21,13,2.4),u(g(12,12,3.2)))},{key:"info",label:"Info point",group:"facilities",path:[d(12,12,9.5),"M10.8 11H12v5.8 M12 7.6h.01"].join(" "),solid:r(g(12,4.9,2.4),a(10.3,9.2,3.4,12.3,1),a(8.2,9.2,4,3,1),a(8.2,18.5,7.6,3,1))},{key:"lost-found",label:"Lost & found",group:"facilities",path:[d(10.5,10.5,7.5),"M16 16l5.5 5.5","M8.4 8.4a2.1 2.1 0 1 1 3 1.9c-.6.4-.9.8-.9 1.6 M10.5 14.6h.01"].join(" "),solid:r(b(12,7.6,4.2,180,405,3.4),h([[14.97,10.57],[12,13],[12,15]],3.4),g(12,20,2.1))},{key:"restrooms",label:"Toilets",group:"facilities",path:[D(j),T(H)].join(" "),solid:r(Z(j),w(H))},{key:"charging",label:"Charging point",group:"facilities",path:[f(6,2,12,20,2.5),"M13.2 6.2 9.6 12h4.8l-3.6 5.8"].join(" "),solid:r(M(z))},{key:"smoking",label:"Smoking area",group:"facilities",path:[f(2,14.5,14.5,4,1),"M6.5 14.5v4","M15.5 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4 M19 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4"].join(" "),solid:r(a(1.5,14,4.2,5,1.2),a(6.8,14,10.4,5,1.2),h([[15.9,11.4],[17.3,8.9],[15.9,6.4],[17.1,3.9]],2.2),h([[19.6,11.4],[21,8.9],[19.6,6.4],[20.8,3.9]],2.2))},{key:"no-smoking",label:"No smoking",group:"facilities",path:[d(12,12,9.5),"M5.3 5.3l13.4 13.4","M5.5 10.5h13v3h-13Z"].join(" "),solid:r(g(12,12,10.6),u(g(12,12,8)),l([6,6],[18,18],2.8),a(5,10.4,3,3.2,.6),a(16,10.4,3,3.2,.6))},{key:"food",label:"Food",group:"food-drink",path:"M5 2.5V8a2.5 2.5 0 0 0 5 0V2.5 M7.5 2.5v19 M18.5 13.5h-2c-1.3 0-2-1-2-2.5 0-4 1.5-7 4-8.5v19",solid:r(h([[4.9,2.6],[4.9,8]],2.2),h([[10.1,2.6],[10.1,8]],2.2),h([[7.5,2.6],[7.5,8]],2.2),b(7.5,8,2.6,0,180,2.2),l([7.5,10],[7.5,21.4],3),M([[19.4,2.2],[19.4,14.2],[16.2,14.2],[14.1,12],[14.1,9.4],[15.2,5.8],[17.3,3.3]]),l([18,13],[18,21.4],3))},{key:"bar",label:"Bar",group:"food-drink",path:"M3.5 3.5h17L12 13Z M6.2 6.5h11.6 M12 13v7.5 M8 20.5h8",solid:r(M([[2.8,3],[21.2,3],[12,13.6]]),l([12,12],[12,20.6],2.8),l([7.4,21],[16.6,21],2.8))},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 9h12v4.5a5.5 5.5 0 0 1-5.5 5.5h-1A5.5 5.5 0 0 1 4 13.5Z M16 10.5h1.2a2.75 2.75 0 0 1 0 5.5H16 M8 3v3 M12 3v3 M3 21.5h14",solid:r({from:[3.4,8.4],segs:[{to:[16.6,8.4]},{to:[16.6,13.4]},{to:[11,19.4],arc:{r:5.8,large:0,sweep:1}},{to:[9,19.4]},{to:[3.4,13.4],arc:{r:5.8,large:0,sweep:1}},{to:[3.4,8.4]}]},b(17.2,13.25,2.5,270,450,2.4),l([7.8,2.6],[7.8,5.6],2.4),l([12.2,2.6],[12.2,5.6],2.4),l([2.6,21.6],[17.4,21.6],2.6))},{key:"water",label:"Water / drinks",group:"food-drink",path:o1,solid:"M12 1.2S4 8.9 4 14.5a8 8 0 0 0 16 0c0-5.6-8-13.3-8-13.3Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:e1,solid:"M8.4 2.8 3.5 5l-1.9 6 4.2 1.4.4-.8v9.4h11.6v-9.4l.4.8 4.2-1.4-1.9-6-4.9-2.2c-.4 1.5-1.8 2.6-3.6 2.6s-3.2-1.1-3.6-2.6Z"},{key:"screen",label:"Screen",group:"facilities",path:[f(2,3.5,20,13.5,2),"M12 17v3.5 M8 20.5h8","M10 7.8v5.9l5-2.95Z"].join(" "),solid:r(a(1.5,3,21,14.4,2.4),u(M([[9.6,6.7],[16,10.2],[9.6,13.7]])),a(10.6,16.5,2.8,4,0),l([7.4,21],[16.6,21],2.8))},{key:"sound-booth",label:"Sound booth",group:"facilities",path:["M6 3v9 M6 16v5 M12 3v3 M12 10v11 M18 3v10 M18 17v4",d(6,14,2),d(12,8,2),d(18,15,2)].join(" "),solid:r(l([6,2.8],[6,21.2],1.8),l([12,2.8],[12,21.2],1.8),l([18,2.8],[18,21.2],1.8),a(3.2,11.6,5.6,4.8,1.4),a(9.2,5.6,5.6,4.8,1.4),a(15.2,12.6,5.6,4.8,1.4))},{key:"entrance",label:"Entrance",group:"navigation",path:"M11 7V3.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V17 M2.5 12h13.5 M12.5 8.5 16 12l-3.5 3.5",solid:r(h([[11,6.5],[11,2.6],[21,2.6],[21,21.4],[11,21.4],[11,17.5]],2.6),l([2.8,12],[13.5,12],3.2),M([[12.6,7.8],[18,12],[12.6,16.2]]))},{key:"exit",label:"Exit",group:"navigation",path:"M13 7V3.5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v17a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V17 M8 12h13.5 M18 8.5l3.5 3.5-3.5 3.5",solid:r(h([[13,6.5],[13,2.6],[3,2.6],[3,21.4],[13,21.4],[13,17.5]],2.6),l([7.2,12],[17,12],3.2),M([[16.2,7.8],[21.6,12],[16.2,16.2]]))},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:[_(P(C,-2,1.4,1.15)),"M15.5 13h6 M19 10.5l2.5 2.5-2.5 2.5"].join(" "),solid:r(k(P(C,-2,1.4,1.15),2.7),l([15.6,13],[19.5,13],2.8),M([[18.4,9.4],[22.4,13],[18.4,16.6]]))},{key:"stairs",label:"Stairs",group:"navigation",path:n1,solid:"M1.5 22.5h21V2h-7.8v6.4H8.4v6.4H1.5Z"},{key:"elevator",label:"Elevator",group:"navigation",path:[f(3.5,2.5,17,19,2.5),"M8.5 9.5 12 5.5l3.5 4Z M8.5 14.5l3.5 4 3.5-4Z"].join(" "),solid:r(M([[12,1.6],[19.6,10.2],[4.4,10.2]]),M([[4.4,13.8],[19.6,13.8],[12,22.4]]))},{key:"parking",label:"Parking",group:"navigation",path:[f(3,3,18,18,3),"M9.5 17V7h3.75a3 3 0 0 1 0 6H9.5"].join(" "),solid:"M6.5 21V3H12a5.5 5.5 0 0 1 0 11h-1.9v7Z M10.1 6.6v3.8H12a1.9 1.9 0 0 0 0-3.8Z"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:_(L),solid:r(k(L))},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:["M4 9a6 6 0 1 1 12 0c0 3-1.8 4.3-3 5.2-1.1.8-1.6 1.7-1.6 3.1a3.6 3.6 0 0 1-6.2 2.1","M7.5 9a2.5 2.5 0 0 1 5 0c0 1.2-.7 1.9-1.6 2.5","M18.5 5.5a6.5 6.5 0 0 1 0 8"].join(" "),solid:r(b(10,9,6,180,380,3),h([[15.64,11.05],[12.8,14.3],[11.5,17.2]],3),b(8.2,17.2,3.3,0,150,3),b(10,9,2.2,180,400,2.4),b(13.38,9.5,6.5,322,398,2.6))},{key:"box-office",label:"Box office / tickets",group:"navigation",path:"M3 7.5A1.5 1.5 0 0 1 4.5 6h15A1.5 1.5 0 0 1 21 7.5V10a2 2 0 0 0 0 4v2.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5V14a2 2 0 0 0 0-4Z M15 6v2 M15 11v2 M15 16v2",solid:r(t1,u(a(14.1,7,1.8,2.2,.9)),u(a(14.1,10.9,1.8,2.2,.9)),u(a(14.1,14.8,1.8,2.2,.9)))},{key:"escalator",label:"Escalator",group:"navigation",path:"M2.5 17H7l9-9h5.5v4h-4l-9 9h-6Z M11 4.5h.01 M11 8.2v3.3",solid:r(M([[2,16.4],[6.8,16.4],[15.8,7.4],[22,7.4],[22,12.6],[17.8,12.6],[8.8,21.6],[2,21.6]]),g(11,4.3,2.3),l([11,8],[11,11],2.6))},{key:"ramp",label:"Ramp",group:"navigation",path:"M2.5 19.5h19v-10Z M4.5 13.2 14 8.2 M10.53 7.76 14 8.2l-1.6 3.11",solid:r(M([[1.6,20.4],[22.4,20.4],[22.4,8.6]]),l([4.2,13.4],[13.2,8.6],2.6),M([[15.4,7.5],[13.16,11.84],[10.56,6.88]]))},{key:"taxi",label:"Taxi / rideshare",group:"navigation",path:["M9.5 2.5h5V5h-5Z M6.5 11 8 7h8l1.5 4",f(3.5,11,17,6,2),"M6.5 17v2.5 M17.5 17v2.5 M7 14h.01 M17 14h.01"].join(" "),solid:r(a(9,1.8,6,3.4,.8),M([[6,11.4],[7.6,6.4],[16.4,6.4],[18,11.4]]),a(2.8,10.6,18.4,7,2.2),u(g(6.8,14,1.3)),u(g(17.2,14,1.3)),a(4.8,16,3.6,5.2,1.2),a(15.6,16,3.6,5.2,1.2))},{key:"transit",label:"Bus / transit",group:"navigation",path:[f(4.5,2.5,15,16,3),"M4.5 10.5h15 M9 5.5h6 M7.5 18.5V21 M16.5 18.5V21 M8 14.5h.01 M16 14.5h.01"].join(" "),solid:r(a(4,2,16,17,3.2),u(a(6.2,5.8,11.6,5,1)),u(g(8,14.5,1.3)),u(g(16,14.5,1.3)),a(6,17,3.4,5,1.2),a(14.6,17,3.4,5,1.2))},{key:"bike-parking",label:"Bike parking",group:"navigation",path:[d(6,14.5,4),d(18,14.5,4),"M6 14.5 9 7.5h6.5L18 14.5 M9 7.5l2.5 7H6 M11.5 14.5l4-7 M7.5 6h3 M15.5 7.5 15 5.5h2"].join(" "),solid:r(g(6,14.5,4.9),u(g(6,14.5,2.7)),g(18,14.5,4.9),u(g(18,14.5,2.7)),h([[6,14.5],[9,7.5],[15.5,7.5],[18,14.5]],2.2),h([[9,7.5],[11.5,14.5],[15.5,7.5]],2.2),l([6,14.5],[11.5,14.5],2.2),l([7.2,5.8],[10.6,5.8],2.2),h([[15.4,7.3],[15,5.4],[17.2,5.4]],2.2))},{key:"meeting-point",label:"Meeting point",group:"navigation",path:["M9.5 2.5 12 5l2.5-2.5 M9.5 21.5 12 19l2.5 2.5 M2.5 9.5 5 12l-2.5 2.5 M21.5 9.5 19 12l2.5 2.5",d(10,9.6,1.5),d(14,9.6,1.5),"M7.5 15.5a2.5 2.5 0 0 1 5 0 M11.5 15.5a2.5 2.5 0 0 1 5 0"].join(" "),solid:r(h([[9.4,2.4],[12,5],[14.6,2.4]],2.6),h([[9.4,21.6],[12,19],[14.6,21.6]],2.6),h([[2.4,9.4],[5,12],[2.4,14.6]],2.6),h([[21.6,9.4],[19,12],[21.6,14.6]],2.6),g(9.7,9.3,2.2),g(14.3,9.3,2.2),F(9.7,16,3),F(14.3,16,3))},{key:"security",label:"Security / bag check",group:"facilities",path:"M12 2.5 19.5 5.5v6c0 4.6-3.2 8.4-7.5 10-4.3-1.6-7.5-5.4-7.5-10v-6Z M8.5 12l2.5 2.5 4.5-5",solid:r(i1,u(M([[7.4,12.2],[9,10.6],[10.9,12.5],[15,8.4],[16.6,10],[10.9,15.7]])))},{key:"lockers",label:"Lockers",group:"facilities",path:[f(3.5,2.5,17,19,1.5),"M12 2.5v19 M6 6h3 M15 6h3 M9.5 11.5v2.5 M14.5 11.5v2.5"].join(" "),solid:r(a(3,2,8.4,20,1.4),u(a(5,5,4.4,1.7,.8)),u(a(8.6,10.8,1.5,3.8,.7)),a(12.6,2,8.4,20,1.4),u(a(14.6,5,4.4,1.7,.8)),u(a(13.9,10.8,1.5,3.8,.7)))},{key:"baby-change",label:"Baby change",group:"facilities",path:"M10 6.5l.8-3.3a1.2 1.2 0 0 1 2.4 0l.8 3.3 M8.5 6.5h7 M9.5 6.5l-.9 2.2a3 3 0 0 0-.1.9V19a2.5 2.5 0 0 0 2.5 2.5h2a2.5 2.5 0 0 0 2.5-2.5V9.6a3 3 0 0 0-.1-.9l-.9-2.2 M8.5 12.5h3 M8.5 16h3",solid:r(M([[9.6,6.2],[10.6,1.8],[13.4,1.8],[14.4,6.2]]),a(7.6,5.4,8.8,2.6,1),a(7.8,7.4,8.4,15,2.6),u(a(7.8,11.8,3.4,1.5,0)),u(a(7.8,15.4,3.4,1.5,0)))},{key:"prayer-room",label:"Prayer room",group:"facilities",path:[_(U),"M3 21.5h18"].join(" "),solid:r(k(U),a(2.4,20.2,19.2,2.6,1.3))},{key:"quiet-room",label:"Quiet room",group:"facilities",path:"M4 9h3.5l5-4v14l-5-4H4Z M15.5 9.5l5 5 M20.5 9.5l-5 5",solid:r(M([[2.6,8.4],[7.2,8.4],[13,3.6],[13,20.4],[7.2,15.6],[2.6,15.6]]),l([15.4,9.2],[20.8,14.8],2.8),l([20.8,9.2],[15.4,14.8],2.8))},{key:"wifi",label:"Wi-Fi",group:"facilities",path:[O(12,19,11.5,218,322),O(12,19,7.5,218,322),O(12,19,3.5,218,322),"M12 19h.01"].join(" "),solid:r(b(12,19.2,11,218,322,2.8),b(12,19.2,6.9,218,322,2.8),g(12,19.2,2.2))},{key:"vip-lounge",label:"VIP lounge",group:"facilities",path:["M6.5 11V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4","M3.5 11.5a1.5 1.5 0 0 1 3 0V14h11v-2.5a1.5 1.5 0 0 1 3 0v6h-17Z","M5.5 17.5V20 M18.5 17.5V20"].join(" "),solid:r(a(6,4,12,8.5,2.2),a(2.4,9.6,4.6,9,2.2),a(17,9.6,4.6,9,2.2),a(6,13.2,12,5.4,.6),l([5,18],[5,20.6],2.4),l([19,18],[19,20.6],2.4))},{key:"accessible-entrance",label:"Accessible entrance",group:"accessibility",path:[_(P(L,.3,5,.62)),"M12.5 3.5H20a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-7.5"].join(" "),solid:r(k(P(L,.3,5,.62),2.2),h([[13,2.8],[21.2,2.8],[21.2,21.2],[13,21.2]],2.6))},{key:"assistance-dog",label:"Assistance-dog area",group:"accessibility",path:[A(a1)+"Z","M6 10.8 3.5 7.5","M10.5 10.5V6h4.5l1 2.5"].join(" "),solid:r(M(r1),l([6.2,11],[3.2,7.2],2.4),h([[10.5,11],[10.5,5.6],[15.2,5.6],[16.2,8.2]],2.2))}],s1=new Map(V.map(e=>[e.key,e]));function m1(e){return e?s1.get(e):void 0}var f1=24,v1=2,E1={facilities:"Facilities","food-drink":"Food & drink",navigation:"Getting around",accessibility:"Accessibility"},L1=["facilities","food-drink","navigation","accessibility"],x=V,P1="#8b93a7",k1={wall:"M3 5h18v14H3V5Z M3 9.7h18 M3 14.3h18 M9 5v4.7 M15 5v4.7 M6 9.7v4.6 M12 9.7v4.6 M18 9.7v4.6 M9 14.3v4.7 M15 14.3v4.7",rail:"M3 7h18 M4 17h16 M6 7v10 M10 7v10 M14 7v10 M18 7v10",suite:"M3 4h18v16H3V4Z M6 17v-5h12v5 M8 12V9h8v3",obstruction:"M8 3h8l-1 4v10l1 4H8l1-4V7L8 3Z M9 7h6 M9 17h6"},J=new Map(x.map(e=>[e.key,e]));function l1(e){return e?J.get(e):void 0}function S1(e){return l1(e)?.path}function y1(e){return typeof e=="string"&&J.has(e)}var _1=x.map(e=>e.key);var A1=["butt","round","square"],V1=["miter","round","bevel"],N1=["none","arrow"],c1="round",p1="round",Y="none";function u1(e){return e==="line"||e==="polyline"}function R1(e){return e==="polygon"||u1(e)}function C1(e){return{lineCap:e.lineCap??c1,lineJoin:e.lineJoin??p1,startEnding:e.startEnding??Y,endEnding:e.endEnding??Y}}function $1(e){return{pointerLength:Math.min(48,Math.max(8,e*3)),pointerWidth:Math.min(40,Math.max(8,e*2.25))}}export{I as a,q as b,Q as c,K as d,X as e,m1 as f,f1 as g,v1 as h,E1 as i,L1 as j,x as k,P1 as l,k1 as m,l1 as n,S1 as o,y1 as p,_1 as q,A1 as r,V1 as s,N1 as t,c1 as u,p1 as v,Y as w,u1 as x,R1 as y,C1 as z,$1 as A};