@seatlayer/core 0.102.0 → 0.104.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 (172) hide show
  1. package/dist/ar-D6ASWQBI.js +1 -0
  2. package/dist/be-T23MSCFC.js +1 -0
  3. package/dist/bg-2MMSY43I.js +1 -0
  4. package/dist/ca-EXRTYE33.js +1 -0
  5. package/dist/{categoryInventory-7gSFTu0l.d.cts → categoryInventory-DYcNVyxN.d.cts} +1 -1
  6. package/dist/{categoryInventory-hJxuFF9L.d.ts → categoryInventory-QTVDRqNG.d.ts} +1 -1
  7. package/dist/{chunk-GPZFVQXV.js → chunk-4522UUXG.js} +1 -1
  8. package/dist/chunk-6YTPIDLM.js +1 -0
  9. package/dist/{chunk-ZS5YFXSE.js → chunk-BF3XROP5.js} +1 -1
  10. package/dist/{chunk-JRZHC75P.js → chunk-EE2CVYFJ.js} +1 -1
  11. package/dist/chunk-GUNNA5LB.js +1 -0
  12. package/dist/{chunk-4DYJCT62.js → chunk-HIU4MMID.js} +1 -1
  13. package/dist/chunk-HKVCBUON.js +1 -0
  14. package/dist/chunk-IEBXXGQC.js +1 -0
  15. package/dist/{chunk-254ABRJF.js → chunk-KYPY7GWB.js} +1 -1
  16. package/dist/{chunk-GTRYL7YV.js → chunk-O4ZAGGMP.js} +1 -1
  17. package/dist/{chunk-PHV2U54Y.js → chunk-P2BTUNG6.js} +1 -1
  18. package/dist/chunk-P6ASVG3X.js +1 -0
  19. package/dist/chunk-PBXGWYB4.js +1 -0
  20. package/dist/chunk-QFX6XSO6.js +1 -0
  21. package/dist/{chunk-FOIYJ5NT.js → chunk-TFYAMLCK.js} +1 -1
  22. package/dist/chunk-TZBJCAXH.js +1 -0
  23. package/dist/{chunk-COECA63Q.js → chunk-UKODEMIM.js} +1 -1
  24. package/dist/{chunk-UEDS3HJ3.js → chunk-URW7MSCJ.js} +1 -1
  25. package/dist/core/chart-ops/index.cjs +1 -1
  26. package/dist/core/chart-ops/index.d.cts +466 -14
  27. package/dist/core/chart-ops/index.d.ts +466 -14
  28. package/dist/core/chart-ops/index.js +1 -1
  29. package/dist/core/color.d.cts +1 -1
  30. package/dist/core/color.d.ts +1 -1
  31. package/dist/core/inventory/index.cjs +1 -1
  32. package/dist/core/inventory/index.d.cts +4 -4
  33. package/dist/core/inventory/index.d.ts +4 -4
  34. package/dist/core/inventory/index.js +1 -1
  35. package/dist/core/layout/index.cjs +1 -1
  36. package/dist/core/layout/index.d.cts +6 -72
  37. package/dist/core/layout/index.d.ts +6 -72
  38. package/dist/core/layout/index.js +1 -1
  39. package/dist/core/quality/index.d.cts +3 -3
  40. package/dist/core/quality/index.d.ts +3 -3
  41. package/dist/core/quality/index.js +1 -1
  42. package/dist/core/render-assets/index.cjs +1 -1
  43. package/dist/core/render-assets/index.d.cts +45 -5
  44. package/dist/core/render-assets/index.d.ts +45 -5
  45. package/dist/core/render-assets/index.js +1 -1
  46. package/dist/core/seatConfidence.d.cts +1 -1
  47. package/dist/core/seatConfidence.d.ts +1 -1
  48. package/dist/core/sections/index.cjs +1 -1
  49. package/dist/core/sections/index.d.cts +5 -5
  50. package/dist/core/sections/index.d.ts +5 -5
  51. package/dist/core/sections/index.js +1 -1
  52. package/dist/cs-L5EG7LLR.js +1 -0
  53. package/dist/cy-AB2Q6XHI.js +1 -0
  54. package/dist/da-EGJO7W4Q.js +1 -0
  55. package/dist/de-Q56NNVPD.js +1 -0
  56. package/dist/el-JW2YADAL.js +1 -0
  57. package/dist/es-N35HVHMD.js +1 -0
  58. package/dist/et-53UYPQR7.js +1 -0
  59. package/dist/{eventConfigurations-BHIfPJJJ.d.cts → eventConfigurations-1sMqxBpq.d.cts} +1 -1
  60. package/dist/{eventConfigurations-I5UBS6r9.d.ts → eventConfigurations-B7vGmmD3.d.ts} +1 -1
  61. package/dist/{fa-5MS3C6YX.js → fa-JL3HW42Q.js} +1 -1
  62. package/dist/fi-ZFWROLPU.js +1 -0
  63. package/dist/fr-6EKBGKIT.js +1 -0
  64. package/dist/he-KSOTIRJW.js +1 -0
  65. package/dist/hi-RWHSYCVV.js +1 -0
  66. package/dist/hr-ECH5LYKR.js +1 -0
  67. package/dist/hu-BAXHRRWC.js +1 -0
  68. package/dist/id-ECFNLK3G.js +1 -0
  69. package/dist/index.cjs +1 -1
  70. package/dist/index.d.cts +45 -120
  71. package/dist/index.d.ts +45 -120
  72. package/dist/index.js +1 -1
  73. package/dist/{it-KG53QPQF.js → it-HT57FDFI.js} +1 -1
  74. package/dist/ja-LHVHSM5J.js +1 -0
  75. package/dist/ko-G2HVHBKT.js +1 -0
  76. package/dist/ku-MNPV6BJJ.js +1 -0
  77. package/dist/{labeling-2A31f781.d.cts → labeling-B-FQz2d2.d.cts} +1 -1
  78. package/dist/{labeling-CDKZ9TO1.d.ts → labeling-DqyXzIgw.d.ts} +1 -1
  79. package/dist/localeLoaders-L36RHPNS.js +1 -0
  80. package/dist/lt-GB2GJDNS.js +1 -0
  81. package/dist/lv-3ZE6IM47.js +1 -0
  82. package/dist/ms-YH2PYOHG.js +1 -0
  83. package/dist/nl-D4FX7T7U.js +1 -0
  84. package/dist/no-5YNLYHN4.js +1 -0
  85. package/dist/pl-RUXCR6JV.js +1 -0
  86. package/dist/pt-TKFGIUL6.js +1 -0
  87. package/dist/{renderedQuality-CwZ8hY-5.d.cts → renderedQuality-D62MKRV8.d.cts} +1 -1
  88. package/dist/{renderedQuality-wDIiUId3.d.ts → renderedQuality-DZOIkUX_.d.ts} +1 -1
  89. package/dist/{renderer-CdJx5l3B.d.ts → renderer-BIR1jJrt.d.cts} +10 -18
  90. package/dist/{renderer-D6ggv3bV.d.cts → renderer-CiPst9uA.d.ts} +10 -18
  91. package/dist/ro-UFIOIOVH.js +1 -0
  92. package/dist/ru-VMRD53B7.js +1 -0
  93. package/dist/{seatTypeIcons-DMJX4rVN.d.cts → seatTypeIcons-BTw3K-yP.d.cts} +1 -1
  94. package/dist/{seatTypeIcons-UpUTD8Xf.d.ts → seatTypeIcons-qlLxwByo.d.ts} +1 -1
  95. package/dist/{sections-CempT5a0.d.cts → sections-Cr6f5csG.d.cts} +1 -1
  96. package/dist/{sections-lpdfwSdO.d.ts → sections-dqlb491l.d.ts} +1 -1
  97. package/dist/{segmentedRowModel-HwY4XuYa.d.ts → segmentedRowModel-BSXPftwU.d.ts} +1 -1
  98. package/dist/{segmentedRowModel-Ddx5ol8T.d.cts → segmentedRowModel-Dy_zNI1E.d.cts} +1 -1
  99. package/dist/sk-XIK2KO3F.js +1 -0
  100. package/dist/sl-CDZGH6C6.js +1 -0
  101. package/dist/sr-A3TESNV3.js +1 -0
  102. package/dist/sv-HKGKDGSG.js +1 -0
  103. package/dist/{tableSizing-C0zx97eg.d.ts → tableSizing-BnlXRH_v.d.ts} +40 -8
  104. package/dist/{tableSizing-BJqAuJDg.d.cts → tableSizing-DuRJVaJs.d.cts} +40 -8
  105. package/dist/th-ZPGRIY7D.js +1 -0
  106. package/dist/{ticketRestrictions-DDQHiKF-.d.cts → ticketRestrictions-BBZ5mbsi.d.cts} +2 -2
  107. package/dist/{ticketRestrictions-AU8UUmdL.d.ts → ticketRestrictions-BEHxDUyd.d.ts} +2 -2
  108. package/dist/tr-IUB54G3R.js +1 -0
  109. package/dist/{types-DL7qIUrD.d.cts → types-CB1llwVg.d.cts} +131 -14
  110. package/dist/{types-DL7qIUrD.d.ts → types-CB1llwVg.d.ts} +131 -14
  111. package/dist/uk-JQKEV42K.js +1 -0
  112. package/dist/vi-KRM5S2Q7.js +1 -0
  113. package/dist/view3d/crossfade/panorama.d.cts +1 -1
  114. package/dist/view3d/crossfade/panorama.d.ts +1 -1
  115. package/dist/view3d/index.cjs +54 -54
  116. package/dist/view3d/index.d.cts +12 -3
  117. package/dist/view3d/index.d.ts +12 -3
  118. package/dist/view3d/index.js +44 -44
  119. package/dist/view3d/scene/scene.worker.cjs +1 -1
  120. package/dist/view3d/scene/scene.worker.js +1 -1
  121. package/dist/zh-Hans-FEUYIOYS.js +1 -0
  122. package/dist/zh-Hant-PK2XOE2G.js +1 -0
  123. package/package.json +1 -1
  124. package/dist/ar-TGXEBJUB.js +0 -1
  125. package/dist/be-JIDOHWF6.js +0 -1
  126. package/dist/bg-ODVJNCC2.js +0 -1
  127. package/dist/ca-3I7TMWYU.js +0 -1
  128. package/dist/chunk-4R6TXHY2.js +0 -1
  129. package/dist/chunk-5N4H3KMR.js +0 -1
  130. package/dist/chunk-66T4EAUA.js +0 -1
  131. package/dist/chunk-AFJWTB7L.js +0 -1
  132. package/dist/chunk-EIV3CAGV.js +0 -1
  133. package/dist/chunk-FUFRWRPM.js +0 -1
  134. package/dist/chunk-TAMY7HTV.js +0 -1
  135. package/dist/chunk-TQN2VWQO.js +0 -1
  136. package/dist/cs-XXB624Z3.js +0 -1
  137. package/dist/cy-W2QNU2GO.js +0 -1
  138. package/dist/da-Q47YPK2E.js +0 -1
  139. package/dist/de-TS3DPLM5.js +0 -1
  140. package/dist/el-3JQUH6DB.js +0 -1
  141. package/dist/es-GP7VOX7S.js +0 -1
  142. package/dist/et-A22OMZ6V.js +0 -1
  143. package/dist/fi-OJLAOJO2.js +0 -1
  144. package/dist/fr-7ATOYJCF.js +0 -1
  145. package/dist/he-37LKRY5W.js +0 -1
  146. package/dist/hi-YXZ5EWK7.js +0 -1
  147. package/dist/hr-QFOPGLMR.js +0 -1
  148. package/dist/hu-RHRBK46E.js +0 -1
  149. package/dist/id-A5Q3MLSX.js +0 -1
  150. package/dist/ja-CC6EPUSN.js +0 -1
  151. package/dist/ko-7H4RGYFK.js +0 -1
  152. package/dist/ku-HFYWPSS4.js +0 -1
  153. package/dist/localeLoaders-4YMC7FIZ.js +0 -1
  154. package/dist/lt-HQXE7W47.js +0 -1
  155. package/dist/lv-AN25XXPB.js +0 -1
  156. package/dist/ms-CWAYSF6E.js +0 -1
  157. package/dist/nl-63QBRZSZ.js +0 -1
  158. package/dist/no-RAPQMKWU.js +0 -1
  159. package/dist/pl-ILSTD4ZV.js +0 -1
  160. package/dist/pt-WF3US5D7.js +0 -1
  161. package/dist/ro-XR3HT6DE.js +0 -1
  162. package/dist/ru-TLJEWDPA.js +0 -1
  163. package/dist/sk-OJC2EL3Z.js +0 -1
  164. package/dist/sl-7RGTVXCV.js +0 -1
  165. package/dist/sr-NHDJ54BS.js +0 -1
  166. package/dist/sv-ZODCCBCU.js +0 -1
  167. package/dist/th-VCZA4MP5.js +0 -1
  168. package/dist/tr-ROKZO3HC.js +0 -1
  169. package/dist/uk-LP2DPUHC.js +0 -1
  170. package/dist/vi-JDK3JRJR.js +0 -1
  171. package/dist/zh-Hans-P3GB3FAZ.js +0 -1
  172. package/dist/zh-Hant-YU4OKSFZ.js +0 -1
@@ -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};
@@ -0,0 +1 @@
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};
@@ -1 +1 @@
1
- import{k as c,l as u}from"./chunk-UEDS3HJ3.js";import{Fa as h,Ja as b,Ra as s}from"./chunk-EIV3CAGV.js";var l=class extends Error{constructor(n,t,r={}){super(t);this.code=n;this.details=r;this.name="ChartOperationError"}};function P(e,o){let n=s(e),t=o?n.find(r=>r.id===o):n[0];if(!t)throw new l("floor_not_found",`Unknown chart floor: ${o}`,{floorId:o});return{floorId:t.id,objects:t.objects}}function D(e,o){if(!e.categories.some(n=>n.key===o))throw new l("category_not_found",`Unknown chart category: ${o}. Call get_chart to list valid category keys.`,{categoryKey:o})}function y(e,o,n,t){let r=new Set([...t,...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=n(o);if(a&&!r.has(a))return t.add(a),a}throw new l("id_generation_failed",`Unable to allocate a unique ${o} id`)}function L(e){let o=e.slice().sort((i,a)=>i.x-a.x||i.y-a.y);if(o.length<3)return o;let n=(i,a,f)=>(a.x-i.x)*(f.y-i.y)-(a.y-i.y)*(f.x-i.x),t=[];for(let i of o){for(;t.length>=2&&n(t[t.length-2],t[t.length-1],i)<=0;)t.pop();t.push(i)}let r=[];for(let i=o.length-1;i>=0;i--){let a=o[i];for(;r.length>=2&&n(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}return t.pop(),r.pop(),t.concat(r)}function C(e,o){if(!e.length)return e;let n={x:e.reduce((t,r)=>t+r.x,0)/e.length,y:e.reduce((t,r)=>t+r.y,0)/e.length};return e.map(t=>{let r=t.x-n.x,i=t.y-n.y,a=Math.hypot(r,i)||1;return{x:t.x+r/a*o,y:t.y+i/a*o}})}function O(e){let o=[];for(let t of e)t.type==="row"?o.push(...h(t).map(r=>({x:r.x,y:r.y}))):t.type==="table"?o.push(...b(t).map(r=>({x:r.x,y:r.y}))):t.type==="gaArea"?o.push(...t.points):t.type==="booth"&&o.push(t.center);if(o.length<3)return null;let n=C(L(o),22);return n.length>=3?n:null}function z(e,o){let n=P(e,o),t=s(e).find(r=>r.id===n.floorId);return{...e,objects:n.objects,floors:void 0,focalPoint:t.focalPoint,referenceImage:t.referenceImage,backgroundImage:t.backgroundImage}}var p=24,m=80;function v(e,o){let n=e.normalize("NFKC").trim();if(n.length>p)throw new l("invalid_operation",`${o} displayed type must be at most ${p} characters`);return n}function H(e,o){if(e.displayType===void 0)return!1;let n=v(e.displayType,o);return n?(e.displayType=n,!1):(delete e.displayType,!0)}function A(e,o){if(e.displayLabel===void 0)return!1;let n=e.displayLabel.normalize("NFKC").trim();if(n.length>m)throw new l("invalid_operation",`${o} displayed label must be at most ${m} characters`);return n?(e.displayLabel=n,!1):(delete e.displayLabel,!0)}function d(e,o){let n=e.trim().toLowerCase();if(!/^#[0-9a-f]{6}$/.test(n))throw new l("invalid_operation",`${o} must use a six-digit hex color`);return n}function x(e,o){if(!Number.isFinite(e)||e<c||e>u)throw new l("invalid_operation",`${o} label size must be from ${c} to ${u}`)}function $(e,o){e.size!==void 0&&e.size!==null&&x(e.size,o),e.color!==void 0&&e.color!==null&&d(e.color,`${o} label color`)}function k(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 n=e?.labelStyle;n&&(n.size!==void 0&&x(n.size,o),n.color!==void 0&&d(n.color,`${o} label color`))}function E(e,o){let n=e?structuredClone(e):{},t=n.labelStyle?{...n.labelStyle}:{};return o.size===null?delete t.size:o.size!==void 0&&(t.size=o.size),o.color===null?delete t.color:o.color!==void 0&&(t.color=d(o.color,"Label color")),t.size===void 0&&t.color===void 0?delete n.labelStyle:n.labelStyle=t,o.visible!==void 0&&(n.visible=o.visible),Object.keys(n).length?n:void 0}function T(e,o,n){let t=o.normalize("NFKC").trim();if(!t||t.length>80)throw new l("invalid_operation","Zone labels must contain 1 to 80 characters");if((e.zones??[]).some(r=>r.id!==n&&r.label.normalize("NFKC").trim().toLocaleLowerCase("en")===t.toLocaleLowerCase("en")))throw new l("invalid_operation",`Zone label already exists: ${t}`);return t}function N(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 U(e,o,n){return(o.x-e.x)*(n.y-e.y)-(o.y-e.y)*(n.x-e.x)}var B=Math.PI/180,Z=Math.PI/180;function K(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 _(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 S=0,g=120,w=4;function F(e){if(!Number.isFinite(e)||e<S||e>g)throw new l("invalid_operation","Floor base height must be a number from 0 to 120 metres")}function X(e,o){let n=s(e);if(n.length>=5)throw new l("invalid_operation","A chart can contain at most five physical floors");let t=(o.name??String(n.length+1)).normalize("NFKC").trim();if(!t||t.length>80)throw new l("invalid_operation","Floor names must contain 1 to 80 characters");if(n.some(I=>I.name.toLocaleLowerCase("en")===t.toLocaleLowerCase("en")))throw new l("invalid_operation",`Floor name already exists: ${t}`);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)*w),a=Math.min(g,i+w),f=y(e,"floor",o.idFactory,new Set);return e.floors.push({id:f,name:t,baseHeightM:a,objects:[],focalPoint:{...e.focalPoint}}),_(e),{changed:!0,floorId:f,floorCount:e.floors.length,baseHeightM:a}}function q(e,o){let n=s(e),t=n.find(a=>a.id===o.floorId);if(!t)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(n.some(a=>a.id!==t.id&&a.name.toLocaleLowerCase("en")===r.toLocaleLowerCase("en")))throw new l("invalid_operation",`Floor name already exists: ${r}`);let i=t.name!==r;return i&&(t.name=r),{changed:i,floorId:t.id,floorName:r}}function V(e,o){if(!e.floors?.length)throw new l("invalid_operation","A single-floor chart has an implicit base height of 0 metres");let n=e.floors.find(r=>r.id===o.floorId);if(!n)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});F(o.baseHeightM);let t=n.baseHeightM!==o.baseHeightM;return t&&(n.baseHeightM=o.baseHeightM,n.physical3dProvenance={...n.physical3dProvenance,baseHeightM:{status:"confirmed",source:"user-review",note:"Physical floor height reviewed through the shared Designer/Copilot operation."}}),{changed:t,floorId:n.id,baseHeightM:o.baseHeightM}}function W(e,o){if(!e.floors?.length)throw new l("invalid_operation","A single-floor chart cannot remove its only floor");let n=e.floors.findIndex(r=>r.id===o.floorId);if(n<0)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});let[t]=e.floors.splice(n,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 _(e);return{changed:!0,floorId:t.id,removedObjects:t.objects.length,floorCount:s(e).length}}export{l as a,P as b,D as c,y as d,O as e,z as f,v as g,H as h,A as i,d as j,$ as k,k as l,E as m,T as n,N as o,U as p,B as q,Z as r,K as s,_ as t,g as u,w as v,X as w,q as x,V as y,W as z};
1
+ import{k as c,l as u}from"./chunk-URW7MSCJ.js";import{$a as s,Oa as h,Sa as b}from"./chunk-HKVCBUON.js";var l=class extends Error{constructor(n,t,r={}){super(t);this.code=n;this.details=r;this.name="ChartOperationError"}};function P(e,o){let n=s(e),t=o?n.find(r=>r.id===o):n[0];if(!t)throw new l("floor_not_found",`Unknown chart floor: ${o}`,{floorId:o});return{floorId:t.id,objects:t.objects}}function D(e,o){if(!e.categories.some(n=>n.key===o))throw new l("category_not_found",`Unknown chart category: ${o}. Call get_chart to list valid category keys.`,{categoryKey:o})}function y(e,o,n,t){let r=new Set([...t,...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=n(o);if(a&&!r.has(a))return t.add(a),a}throw new l("id_generation_failed",`Unable to allocate a unique ${o} id`)}function L(e){let o=e.slice().sort((i,a)=>i.x-a.x||i.y-a.y);if(o.length<3)return o;let n=(i,a,f)=>(a.x-i.x)*(f.y-i.y)-(a.y-i.y)*(f.x-i.x),t=[];for(let i of o){for(;t.length>=2&&n(t[t.length-2],t[t.length-1],i)<=0;)t.pop();t.push(i)}let r=[];for(let i=o.length-1;i>=0;i--){let a=o[i];for(;r.length>=2&&n(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a)}return t.pop(),r.pop(),t.concat(r)}function C(e,o){if(!e.length)return e;let n={x:e.reduce((t,r)=>t+r.x,0)/e.length,y:e.reduce((t,r)=>t+r.y,0)/e.length};return e.map(t=>{let r=t.x-n.x,i=t.y-n.y,a=Math.hypot(r,i)||1;return{x:t.x+r/a*o,y:t.y+i/a*o}})}function O(e){let o=[];for(let t of e)t.type==="row"?o.push(...h(t).map(r=>({x:r.x,y:r.y}))):t.type==="table"?o.push(...b(t).map(r=>({x:r.x,y:r.y}))):t.type==="gaArea"?o.push(...t.points):t.type==="booth"&&o.push(t.center);if(o.length<3)return null;let n=C(L(o),22);return n.length>=3?n:null}function z(e,o){let n=P(e,o),t=s(e).find(r=>r.id===n.floorId);return{...e,objects:n.objects,floors:void 0,focalPoint:t.focalPoint,referenceImage:t.referenceImage,backgroundImage:t.backgroundImage}}var p=24,m=80;function v(e,o){let n=e.normalize("NFKC").trim();if(n.length>p)throw new l("invalid_operation",`${o} displayed type must be at most ${p} characters`);return n}function H(e,o){if(e.displayType===void 0)return!1;let n=v(e.displayType,o);return n?(e.displayType=n,!1):(delete e.displayType,!0)}function A(e,o){if(e.displayLabel===void 0)return!1;let n=e.displayLabel.normalize("NFKC").trim();if(n.length>m)throw new l("invalid_operation",`${o} displayed label must be at most ${m} characters`);return n?(e.displayLabel=n,!1):(delete e.displayLabel,!0)}function d(e,o){let n=e.trim().toLowerCase();if(!/^#[0-9a-f]{6}$/.test(n))throw new l("invalid_operation",`${o} must use a six-digit hex color`);return n}function x(e,o){if(!Number.isFinite(e)||e<c||e>u)throw new l("invalid_operation",`${o} label size must be from ${c} to ${u}`)}function $(e,o){e.size!==void 0&&e.size!==null&&x(e.size,o),e.color!==void 0&&e.color!==null&&d(e.color,`${o} label color`)}function k(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 n=e?.labelStyle;n&&(n.size!==void 0&&x(n.size,o),n.color!==void 0&&d(n.color,`${o} label color`))}function E(e,o){let n=e?structuredClone(e):{},t=n.labelStyle?{...n.labelStyle}:{};return o.size===null?delete t.size:o.size!==void 0&&(t.size=o.size),o.color===null?delete t.color:o.color!==void 0&&(t.color=d(o.color,"Label color")),t.size===void 0&&t.color===void 0?delete n.labelStyle:n.labelStyle=t,o.visible!==void 0&&(n.visible=o.visible),Object.keys(n).length?n:void 0}function T(e,o,n){let t=o.normalize("NFKC").trim();if(!t||t.length>80)throw new l("invalid_operation","Zone labels must contain 1 to 80 characters");if((e.zones??[]).some(r=>r.id!==n&&r.label.normalize("NFKC").trim().toLocaleLowerCase("en")===t.toLocaleLowerCase("en")))throw new l("invalid_operation",`Zone label already exists: ${t}`);return t}function N(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 U(e,o,n){return(o.x-e.x)*(n.y-e.y)-(o.y-e.y)*(n.x-e.x)}var B=Math.PI/180,Z=Math.PI/180;function K(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 _(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 S=0,g=120,w=4;function F(e){if(!Number.isFinite(e)||e<S||e>g)throw new l("invalid_operation","Floor base height must be a number from 0 to 120 metres")}function X(e,o){let n=s(e);if(n.length>=5)throw new l("invalid_operation","A chart can contain at most five physical floors");let t=(o.name??String(n.length+1)).normalize("NFKC").trim();if(!t||t.length>80)throw new l("invalid_operation","Floor names must contain 1 to 80 characters");if(n.some(I=>I.name.toLocaleLowerCase("en")===t.toLocaleLowerCase("en")))throw new l("invalid_operation",`Floor name already exists: ${t}`);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)*w),a=Math.min(g,i+w),f=y(e,"floor",o.idFactory,new Set);return e.floors.push({id:f,name:t,baseHeightM:a,objects:[],focalPoint:{...e.focalPoint}}),_(e),{changed:!0,floorId:f,floorCount:e.floors.length,baseHeightM:a}}function q(e,o){let n=s(e),t=n.find(a=>a.id===o.floorId);if(!t)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(n.some(a=>a.id!==t.id&&a.name.toLocaleLowerCase("en")===r.toLocaleLowerCase("en")))throw new l("invalid_operation",`Floor name already exists: ${r}`);let i=t.name!==r;return i&&(t.name=r),{changed:i,floorId:t.id,floorName:r}}function V(e,o){if(!e.floors?.length)throw new l("invalid_operation","A single-floor chart has an implicit base height of 0 metres");let n=e.floors.find(r=>r.id===o.floorId);if(!n)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});F(o.baseHeightM);let t=n.baseHeightM!==o.baseHeightM;return t&&(n.baseHeightM=o.baseHeightM,n.physical3dProvenance={...n.physical3dProvenance,baseHeightM:{status:"confirmed",source:"user-review",note:"Physical floor height reviewed through the shared Designer/Copilot operation."}}),{changed:t,floorId:n.id,baseHeightM:o.baseHeightM}}function W(e,o){if(!e.floors?.length)throw new l("invalid_operation","A single-floor chart cannot remove its only floor");let n=e.floors.findIndex(r=>r.id===o.floorId);if(n<0)throw new l("floor_not_found",`Unknown chart floor: ${o.floorId}`,{floorId:o.floorId});let[t]=e.floors.splice(n,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 _(e);return{changed:!0,floorId:t.id,removedObjects:t.objects.length,floorCount:s(e).length}}export{l as a,P as b,D as c,y as d,O as e,z as f,v as g,H as h,A as i,d as j,$ as k,k as l,E as m,T as n,N as o,U as p,B as q,Z as r,K as s,_ as t,g as u,w as v,X as w,q as x,V as y,W as z};
@@ -0,0 +1 @@
1
+ import{h as Ae,i as he,m as Ne,o as Le}from"./chunk-KTMZ3QAO.js";import{c as je}from"./chunk-CRCGO52K.js";var lo=2e6,Tt=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,At=/[\s"'<>`\\]/;function Nt(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Tt.test(e);if(At.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function Fe(e){let t=e.trim();return Nt(t)?t:null}var Lt=2e5,fo=1e5,jt="large_venue_inventory";function ho(e){return e?.includes(jt)?2e5:1e5}var te="seatlayer.event-configuration/1",me="seatlayer.event-configuration-export/1",G=100,Ft=120,Dt=2e5,Vt=1e4,Ve=/^[a-f0-9]{64}$/,Ht=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function z(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function H(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function He(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function De(e){return!Array.isArray(e)||e.length>Dt||!e.every(t=>H(t,G))?null:[...new Set(e)].sort()}function Ue(e){return!z(e)||!H(e.chartId,G)||!H(e.version,G)||e.sha256!==void 0&&(typeof e.sha256!="string"||!Ve.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function pe(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function Ut(e){return z(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&pe(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function Gt(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>Vt)return null;let n=new Set(t),i=new Set,o=new Set,r=0,s=[];for(let l of e){if(!z(l)||!H(l.id,G)||!H(l.objectId,G)||!n.has(l.objectId)||!Ht.has(String(l.kind))||!pe(l.heightM,.05,50)||l.baseElevationM!==void 0&&!pe(l.baseElevationM,-10,100))return null;let h=Ut(l.occlusion);if(!h||i.has(l.id)||o.has(l.objectId))return null;let a=l.contentImageUrl===void 0?void 0:typeof l.contentImageUrl=="string"?Fe(l.contentImageUrl):null;if(l.contentImageUrl!==void 0&&(!a||l.kind!=="screen"||++r>1))return null;i.add(l.id),o.add(l.objectId),s.push({id:l.id,objectId:l.objectId,kind:l.kind,heightM:l.heightM,...l.baseElevationM!==void 0?{baseElevationM:l.baseElevationM}:{},occlusion:h,...a?{contentImageUrl:a}:{}})}return s.sort((l,h)=>l.id.localeCompare(h.id))}function Ge(e){let t=[];if(!z(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==te&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${te}`}),H(e.id,G)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),H(e.label,Ft)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),He(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Ue(e.baseVenue);n||t.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let i=z(e.overlay)?e.overlay:null,o=De(i?.objectIds),r=De(i?.productionKillSeatIds),s=o?Gt(i?.productionElements,o):null;return(!i||!o||!r)&&t.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),s===null&&t.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),t.length||!n||!o||!r||s===null?{issues:t}:{issues:t,value:{schema:te,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:o,productionKillSeatIds:r,...s!==void 0?{productionElements:s}:{}}}}}function yo(e){let t=Ge(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function bo(e){if(!z(e))return{ok:!1,issues:[{code:"invalid_export",path:"",message:"Export must be an object"}]};let t=[];e.schema!==me&&t.push({code:"unsupported_schema",path:"schema",message:`Export schema must be ${me}`}),(typeof e.contentSha256!="string"||!Ve.test(e.contentSha256))&&t.push({code:"invalid_checksum",path:"contentSha256",message:"Export checksum must be a lowercase SHA-256 digest"});let n=Ge(e.configuration);return t.push(...n.issues),t.length||!n.value||typeof e.contentSha256!="string"?{ok:!1,issues:t}:{ok:!0,value:{schema:me,configuration:n.value,contentSha256:e.contentSha256}}}function go(e){return JSON.stringify({schema:te,id:e.id,label:e.label,version:e.version,baseVenue:{chartId:e.baseVenue.chartId,version:e.baseVenue.version,...e.baseVenue.sha256?{sha256:e.baseVenue.sha256}:{}},overlay:{objectIds:[...new Set(e.overlay.objectIds)].sort(),productionKillSeatIds:[...new Set(e.overlay.productionKillSeatIds)].sort(),...e.overlay.productionElements!==void 0?{productionElements:[...e.overlay.productionElements].sort((t,n)=>t.id.localeCompare(n.id)).map(t=>({id:t.id,objectId:t.objectId,kind:t.kind,heightM:t.heightM,...t.baseElevationM!==void 0?{baseElevationM:t.baseElevationM}:{},occlusion:t.occlusion,...t.contentImageUrl?{contentImageUrl:t.contentImageUrl}:{}}))}:{}}})}function xo(e,t){let n=[];e.baseVenue.chartId!==t.chartId&&n.push({code:"base_venue_mismatch",message:"Configuration belongs to a different base venue"}),e.baseVenue.version!==t.version&&n.push({code:"base_venue_version_mismatch",message:"Configuration was authored against a different venue version"}),e.baseVenue.sha256&&!t.sha256?n.push({code:"base_venue_checksum_missing",message:"Venue checksum is required for this configuration"}):e.baseVenue.sha256&&e.baseVenue.sha256!==t.sha256&&n.push({code:"base_venue_checksum_mismatch",message:"Venue bytes do not match the configuration base"});let i=new Set(t.objectIds);for(let r of e.overlay.objectIds)i.has(r)||n.push({code:"overlay_object_missing",message:`Production object ${r} is missing from the base venue`,targetId:r});if(t.objectTypes)for(let r of e.overlay.productionElements??[])t.objectTypes.get(r.objectId)!=="shape"&&n.push({code:"production_element_not_shape",message:`Production element ${r.id} must reference base-venue shape geometry`,targetId:r.objectId});let o=new Set(t.seatIds);for(let r of e.overlay.productionKillSeatIds)o.has(r)||n.push({code:"production_kill_seat_missing",message:`Production-kill seat ${r} is missing from the base venue`,targetId:r});return{compatible:n.length===0,issues:n}}var Xt={draft:new Set(["review","archived"]),review:new Set(["draft","approved","archived"]),approved:new Set(["published","archived"]),published:new Set(["archived"]),archived:new Set};function So(e,t){return e===t||Xt[e].has(t)}function Mo(e,t,n){return!He(n)||n>=t.version?null:e.find(i=>i.id===t.id&&i.version===n&&i.status==="published")??null}function Kt(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function ye(e,t,n){if(!(!e||typeof e!="object")){if(Array.isArray(e)){for(let i of e)ye(i,t,n);return}for(let[i,o]of Object.entries(e)){if(i==="eventConfigurationId"){H(o,G)?t.add(o):o!==void 0&&n.add(String(o));continue}if(i==="eventConfigurationIds"){if(!Array.isArray(o))n.add(String(o));else for(let r of o)H(r,G)?t.add(r):n.add(String(r));continue}ye(o,t,n)}}}function Po(e,t){let n=Ue(t);if(!n)return{ok:!1,invalidIds:["baseVenue"]};let i=new Set,o=new Set;if(ye(e,i,o),o.size)return{ok:!1,invalidIds:[...o].sort()};let r=Kt(e);return{ok:!0,configurations:[...i].sort().map(s=>({schema:te,id:s,label:s,version:1,baseVenue:n,overlay:{objectIds:r.filter(l=>l.type==="shape"&&l.eventConfigurationIds?.includes(s)).map(l=>l.id).sort(),productionKillSeatIds:[]}}))}}var Eo=40,Io=1200,wo=.8,Co=3,_o=-2,Oo=20,ko=.1,Ro=40,To=40,Xe=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function Bt(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let i=Math.max(1,Math.floor(t/Xe(e))),o=0;for(let r of n){if(!r.length){o+=1;continue}let s=0;for(let l of r.split(/\s+/)){let h=l.length;s&&s+1+h<=i?s+=1+h:(o+=Math.max(1,Math.ceil(h/i)),s=h%i)}}return Math.max(1,o)}function Ke(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),i=Math.max(1,...n.map(l=>l.length))*Xe(e),o=e.width??i+t*2,r=Math.max(1,o-t*2),s=Bt(e,r);return{width:o,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var Be=Math.PI/180;function R(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Ye(e,t,n){let i=Math.cos(n),o=Math.sin(n),r=e.x-t.x,s=e.y-t.y;return{x:t.x+r*i-s*o,y:t.y+r*o+s*i}}function No(e,t,n){return n?Ye(e,t,n*Be):e}function Lo(e,t){return Ye(e,{x:0,y:0},t*Be)}function j(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Yt(e){let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;let i=e.length||1;return{x:t/i,y:n/i}}function jo(e){return e.length?Yt(e):null}function be(e,t){let n=1-t,i=n*n*n,o=3*n*n*t,r=3*n*t*t,s=t*t*t;return{x:i*e.start.x+o*e.control1.x+r*e.control2.x+s*e.end.x,y:i*e.start.y+o*e.control1.y+r*e.control2.y+s*e.end.y}}function Vo(e,t,n){let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2},o={x:(n.x-i.x)*4/3,y:(n.y-i.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+o.x,y:e.y+(t.y-e.y)/3+o.y},control2:{x:e.x+(t.x-e.x)*2/3+o.x,y:e.y+(t.y-e.y)*2/3+o.y},end:{...t}}}function $e(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[be(e,.5)];let i=Array.from({length:n+1},(h,a)=>be(e,a/n)),o=new Float64Array(i.length);for(let h=1;h<i.length;h+=1){let a=i[h].x-i[h-1].x,c=i[h].y-i[h-1].y;o[h]=o[h-1]+Math.hypot(a,c)}let r=o[o.length-1];if(r<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],l=1;for(let h=0;h<t;h+=1){let a=r*h/(t-1);for(;l<o.length-1&&o[l]<a;)l+=1;let c=o[l-1],u=o[l],m=u===c?0:(a-c)/(u-c);s.push({x:i[l-1].x+(i[l].x-i[l-1].x)*m,y:i[l-1].y+(i[l].y-i[l-1].y)*m})}return s}function F(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ne(e,t){return{x:e.x-t.x,y:e.y-t.y}}function D(e,t){return{x:e.x*t,y:e.y*t}}function se(e,t=13){return Array.from({length:t},(n,i)=>be(e,i/(t-1)))}function ze(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),i=Math.min(e.length-2,Math.floor(n));return j(e[i],e[i+1],n-i)}function We(e,t,n){let i=Math.max(0,Math.min(1,t)),o=Math.max(i,Math.min(1,n)),r=[ze(e,i)];for(let s=1;s<e.length-1;s+=1){let l=s/(e.length-1);l>i+1e-9&&l<o-1e-9&&r.push(e[s])}return r.push(ze(e,o)),r}function qe(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],i=0,o=Number.POSITIVE_INFINITY;n.forEach(([m,d],y)=>{let f=R(j(e[m],e[d],.5),t);f<o&&(o=f,i=y)});let r=e[i],s=e[(i+1)%4],l=e[(i+2)%4],h=e[(i+3)%4],a=j(r,s,.5),c=ne(t,a),u=Math.max(1e-9,Math.hypot(c.x,c.y));return{p0:r,p1:s,p2:l,p3:h,normal:D(c,1/u),depth:(R(r,h)+R(s,l))/2}}function Qe(e){let{p0:t,p1:n,p2:i,p3:o,normal:r,depth:s}=e,l=ne(n,t),h=ne(i,o),a=s*.22,c=s*.12;return{nearPath:{start:t,control1:F(F(t,D(l,1/3)),D(r,a)),control2:F(F(t,D(l,2/3)),D(r,a)),end:n},farPath:{start:i,control1:F(F(o,D(h,2/3)),D(r,c)),control2:F(F(o,D(h,1/3)),D(r,c)),end:o}}}function Ho(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let i=e.reduce((y,f)=>F(y,f),{x:0,y:0});i.x/=4,i.y/=4;let o=R(e[0],e[1]),r=R(e[0],e[3]),s=n==="auto"?o>r*1.25&&R(i,t)>r?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(y=>({...y}))};let l=qe(e,t),{p0:h,p1:a,p2:c,p3:u}=l;if(s==="tapered")return{mode:s,outline:[F(h,D(ne(a,h),.14)),F(h,D(ne(a,h),1-.14)),c,u]};let{nearPath:m,farPath:d}=Qe(l);return{mode:s,outline:[...se(m),...se(d).slice(1)]}}function Uo(e,t,n,i){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let o=qe(e,t),{p0:r,p1:s,p2:l,p3:h}=o,a=i==="bezier"?Qe(o):null,c=a?se(a.nearPath):null,u=a?se(a.farPath).reverse():null,m=Math.min(.055,.18/(n+1));return Array.from({length:n},(d,y)=>{let f=(y+1)/(n+1),g=f-m/2,v=f+m/2;return c&&u?[...We(c,g,v),...We(u,g,v).reverse()]:[j(r,s,g),j(r,s,v),j(h,l,v),j(h,l,g)]})}function zt(e,t,n){let i=n.x-t.x,o=n.y-t.y,r=i*i+o*o,s=r?Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/r)):0;return Math.hypot(e.x-(t.x+s*i),e.y-(t.y+s*o))}function Wt(e,t){let n=1/0;for(let i of t)if(!(i.length<2))for(let o=0,r=i.length-1;o<i.length;r=o++){let s=zt(e,i[r],i[o]);s<n&&(n=s)}return n}function Je(e,t){let n=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let r=t[i].x,s=t[i].y,l=t[o].x,h=t[o].y;s>e.y!=h>e.y&&e.x<(l-r)*(e.y-s)/(h-s)+r&&(n=!n)}return n}function et(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function $t(e,t,n){let i=Je(e,t)&&!n.some(r=>Je(e,r)),o=Wt(e,[t,...n]);return i?o:-o}function W(e,t,n,i,o){let r=$t({x:e,y:t},i,o);return{x:e,y:t,h:n,d:r,max:r+n*Math.SQRT2}}var ge=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let i=n.length-1;for(;i>0;){let o=i-1>>1;if(n[o].max>=n[i].max)break;[n[o],n[i]]=[n[i],n[o]],i=o}}pop(){let t=this.items,n=t[0],i=t.pop();if(t.length&&i){t[0]=i;let o=0;for(;;){let r=o*2+1,s=r+1,l=o;if(r<t.length&&t[r].max>t[l].max&&(l=r),s<t.length&&t[s].max>t[l].max&&(l=s),l===o)break;[t[l],t[o]]=[t[o],t[l]],o=l}}return n}};function Ze(e){if(e.length<3)return 0;let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return Math.abs(t)/2}function Xo(e,t){return Math.max(0,Ze(e)-et(t).reduce((n,i)=>n+Ze(i),0))}function tt(e,t){let n=et(t);if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let f=e.reduce((v,E)=>v+E.x,0)/e.length,g=e.reduce((v,E)=>v+E.y,0)/e.length;return{point:{x:f,y:g},radius:0}}let i=1/0,o=1/0,r=-1/0,s=-1/0;for(let f of e)f.x<i&&(i=f.x),f.y<o&&(o=f.y),f.x>r&&(r=f.x),f.y>s&&(s=f.y);let l=r-i,h=s-o,a=Math.min(l,h);if(!(a>0))return{point:{x:(i+r)/2,y:(o+s)/2},radius:0};let c=Math.max(l,h)/150,u=new ge,m=a/2;for(let f=i;f<r;f+=a)for(let g=o;g<s;g+=a)u.push(W(f+m,g+m,m,e,n));let d=W(i+l/2,o+h/2,0,e,n),y=0;for(;u.size;){let f=u.pop();if(!f)break;f.d>d.d&&(d=f),!(f.max-d.d<=c)&&(y>=4e3||(y+=1,m=f.h/2,u.push(W(f.x-m,f.y-m,m,e,n)),u.push(W(f.x+m,f.y-m,m,e,n)),u.push(W(f.x-m,f.y+m,m,e,n)),u.push(W(f.x+m,f.y+m,m,e,n))))}return{point:{x:d.x,y:d.y},radius:Math.max(0,d.d)}}function qt(e,t,n){return Math.max(t,Math.min(n,e))}function Bo(e,t,n){return e<t?t:e>n?n:e}function Qt(e){return qt(e,0,1)}function nt(e){let t=Qt(e);return t*t*(3-2*t)}var $=Math.PI*2;function q(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function Jt(e,t,n){let i=t-e;if(n){for(;i<0;)i+=$;for(;i>=$;)i-=$}else{for(;i>0;)i-=$;for(;i<=-$;)i+=$}return i}function $o(e){return e.end}function rt(e){if(e.version!==1||e.closed!==!0||!q(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!q(n.end))return!1;if(n.kind==="line"){if(R(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!q(n.control1)||!q(n.control2)||R(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!q(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(R(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(R(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||R(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return R(t,e.start)<=1e-4}function Zt(e,t,n){let i=1-n;return{x:i**3*e.x+3*i**2*n*t.control1.x+3*i*n**2*t.control2.x+n**3*t.end.x,y:i**3*e.y+3*i**2*n*t.control1.y+3*i*n**2*t.control2.y+n**3*t.end.y}}function st(e,t=2){if(!rt(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),i=[{...e.start}],o=e.start;for(let r of e.segments){if(r.kind==="line")i.push({...r.end});else if(r.kind==="arc"){let s=Math.atan2(o.y-r.center.y,o.x-r.center.x),l=Math.atan2(r.end.y-r.center.y,r.end.x-r.center.x),h=Jt(s,l,r.clockwise),a=Math.max(2,Math.ceil(Math.abs(h)*r.radius/n));for(let c=1;c<=a;c+=1){let u=s+h*c/a;i.push({x:r.center.x+Math.cos(u)*r.radius,y:r.center.y+Math.sin(u)*r.radius})}}else{let s=R(o,r.control1)+R(r.control1,r.control2)+R(r.control2,r.end),l=Math.max(2,Math.ceil(s/n));for(let h=1;h<=l;h+=1)i.push(Zt(o,r,h/l))}o=r.end}return R(i[i.length-1],i[0])<=1e-4&&i.pop(),i}function at(e,t,n){return en(e,o=>({x:o.x+t,y:o.y+n}))}function en(e,t,n=1,i=!1){return{...e,start:t(e.start),segments:e.segments.map(o=>o.kind==="line"?{...o,end:t(o.end)}:o.kind==="arc"?{...o,center:t(o.center),radius:o.radius*Math.abs(n),clockwise:i?!o.clockwise:o.clockwise,end:t(o.end)}:{...o,control1:t(o.control1),control2:t(o.control2),end:t(o.end)})}}function qo(e){return e.map(t=>t===0?0:-t)}var tn=45,xe=150,nn=60;function on(e){let t=tn/100;if(e<=t)return xe;let n=Math.min(1,(e-t)/(1-t));return xe-n*(xe-nn)}var ot=.5523;function it(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function rn(e){let t=[],n=[];for(e.forEach((i,o)=>{q(i)&&(t.length&&it(t[t.length-1],i)||(t.push({x:i.x,y:i.y}),n.push(o)))});t.length>1&&it(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function Qo(e,t,n){return Se(e,{cornerSmoothing:t,...n})}var sn=.5,an=4/3;function cn(e,t,n){let i=t.x-e.x,o=t.y-e.y,r=Math.hypot(i,o);if(r<=1e-9)return{kind:"line",end:{...t}};let s=-o/r,l=i/r,h=n*an;return{kind:"bezier",control1:{x:e.x+i/3+s*h,y:e.y+o/3+l*h},control2:{x:e.x+i*2/3+s*h,y:e.y+o*2/3+l*h},end:{...t}}}function Se(e,t){let{points:n,sourceIndex:i}=rn(e),o=n.length;if(o<3)return null;let r=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,s=t.edgeCurvature,l=new Array(o).fill(0);if(s?.length)for(let x=0;x<o;x+=1){let S=s[i[x]];l[x]=Number.isFinite(S)?Math.min(100,Math.max(-100,S))/100:0}let h=l.some(x=>Math.abs(x)>1e-6);if(r<=0&&!h)return null;let a=t.wideAngleThresholdDeg??on(r),c=[];for(let x=0;x<o;x+=1)c[x]=R(n[x],n[(x+1)%o]);let u=new Array(o).fill(0);for(let x=0;x<o;x+=1){let S=n[(x-1+o)%o],p=n[x],b=n[(x+1)%o],P={x:S.x-p.x,y:S.y-p.y},M={x:b.x-p.x,y:b.y-p.y},C=Math.hypot(P.x,P.y),T=Math.hypot(M.x,M.y);if(C<=1e-9||T<=1e-9)continue;let I=Math.min(1,Math.max(-1,(P.x*M.x+P.y*M.y)/(C*T))),_=Math.acos(I)*180/Math.PI;if(_<a)continue;let O=nt((_-a)/(180-a));u[x]=r*O*.5*Math.min(C,T)}for(let x=0;x<o;x+=1){let S=(x+1)%o,p=u[x]+u[S];if(p>c[x]&&p>1e-9){let b=c[x]/p;u[x]*=b,u[S]*=b}}let m=new Array(o),d=new Array(o);for(let x=0;x<o;x+=1){let S=n[(x-1+o)%o],p=n[x],b=n[(x+1)%o];if(u[x]<=1e-6){m[x]={...p},d[x]={...p};continue}let P=R(p,S)||1,M=R(p,b)||1;m[x]={x:p.x+(S.x-p.x)/P*u[x],y:p.y+(S.y-p.y)/P*u[x]},d[x]={x:p.x+(b.x-p.x)/M*u[x],y:p.y+(b.y-p.y)/M*u[x]}}if(u.every(x=>x<=1e-6)&&!h)return null;let y=[],f={...d[0]},g=f,v=(x,S)=>{if(R(g,x)<=1e-9)return;let p=l[S];Math.abs(p)>1e-6?y.push(cn(g,x,p*sn*c[S])):y.push({kind:"line",end:{...x}}),g=x};for(let x=1;x<=o;x+=1){let S=x%o,p=n[S];v(m[S],(x-1)%o),u[S]>1e-6&&R(m[S],d[S])>1e-9&&(y.push({kind:"bezier",control1:j(m[S],p,ot),control2:j(d[S],p,ot),end:{...d[S]}}),g=d[S])}if(!y.length)return null;let E=y[y.length-1];R(E.end,f)>1e-9&&(E.kind==="line"?E.end={...f}:y.push({kind:"line",end:{...f}}));let w={version:1,closed:!0,start:f,segments:y};return rt(w)?w:null}function Jo(e){let t=[],n=e.start;for(let o of e.segments)t.push(n),n=o.end;let i=[];for(let o=e.segments.length-1;o>=0;o-=1){let r=e.segments[o],s=t[o];r.kind==="line"?i.push({kind:"line",end:{...s}}):r.kind==="arc"?i.push({kind:"arc",center:{...r.center},radius:r.radius,clockwise:!r.clockwise,end:{...s}}):i.push({kind:"bezier",control1:{...r.control2},control2:{...r.control1},end:{...s}})}return{version:1,closed:!0,start:{...e.start},segments:i}}function ei(e,t,n){let i=[];for(let o=0;o<e.length-1;o+=1){let r=e[o],s=e[o+1],l=Math.hypot(s.x-r.x,s.y-r.y);if(l<=0)continue;let h=Math.max(1,Math.round(l/n)),a=l/h,c=Math.atan2(s.y-r.y,s.x-r.x),u=o===0,d=(o>0?t[o-1]:void 0)==="break"?2:1,y=u?{...r}:{x:r.x+Math.cos(c)*a*d,y:r.y+Math.sin(c)*a*d},f=u?h+1:Math.max(1,h-(d-1));i.push({origin:y,rotation:c*180/Math.PI,seatCount:f,seatSpacing:a})}return i}function ti(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(i,o)=>({x:e.origin.x+n.x*o*e.seatSpacing,y:e.origin.y+n.y*o*e.seatSpacing}))}function ni(e){return e.reduce((t,n)=>t+n.seatCount,0)}function ct(e){let t=new Map,n=new Map;for(let i of e){if(i.type!=="row"||!i.segmentedRow)continue;let o=n.get(i.segmentedRow.groupId)??[];o.push(i),n.set(i.segmentedRow.groupId,o)}for(let[i,o]of n){let r=o.slice().sort((m,d)=>m.segmentedRow.componentIndex-d.segmentedRow.componentIndex),s=r[0]?.segmentedRow?.componentCount??0,l=r[0]?.segmentedRow;if(!l||!(s>=2&&r.length===s&&l?.boundaryBefore==="start"&&r.every((m,d)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===i&&m.segmentedRow.componentCount===s&&m.segmentedRow.componentIndex===d&&m.segmentedRow.repeatLabelOnComponents===l.repeatLabelOnComponents&&(d===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===l.displayLabel)))continue;let a=r.reduce((m,d)=>m+d.seatCount,0),c=0,u=0;for(let m of r)m.segmentedRow.boundaryBefore==="break"&&(c+=1),t.set(m.id,{groupId:i,adjacencyOffset:c,displayOffset:u,displayLabel:l.displayLabel,totalSeats:a,canonical:r[0],viewFromSeatUrl:l.viewFromSeatUrl,viewFromSeatMeta:l.viewFromSeatMeta,confidenceEvidence:l.confidenceEvidence}),c+=m.seatCount,u+=m.seatCount}return t}var Q=.02291666666666667,ve=1/Q,ln=58,un=ln*Q,ii=0,dn=3,lt=0,Me=120,fn=0,hn=45,mn=7,J=1.2;function Pe(e,t,n,i){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):i}function pn(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=mn?e:dn}function ut(e,t={}){let n=Pe(t.floorBaseHeightM,lt,Me,0),i=Math.min(Me,n+pn(e.elevation)*un),o=e.height===void 0?i:Pe(e.height,lt,Me,i),r=Pe(e.rake,fn,hn,0);return{height:o,rake:r}}function dt(e){let t=e.length;return t<=3?[...e]:[e[Math.floor(t*.25)],e[Math.floor(t*.5)],e[Math.floor(t*.75)]]}function ft(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let i=1/0;for(let o=0;o+1<e.length;o++){let r=e[o],s=e[o+1],l=s.x-r.x,h=s.y-r.y,a=l*l+h*h,c=a>1e-12?((t-r.x)*l+(n-r.y)*h)/a:0;c<0?c=0:c>1&&(c=1);let u=t-(r.x+c*l),m=n-(r.y+c*h);if(Math.abs(u)>=i||Math.abs(m)>=i)continue;let d=Math.hypot(u,m);d<i&&(i=d)}return i}function yn(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let i=e.length||1;t/=i,n/=i;let o=0;for(let r of e){let s=Math.hypot(r.x-t,r.y-n);s>o&&(o=s)}return{cx:t,cy:n,r:o}}function ht(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Ee(e,t){let n=1/0;for(let i of dt(e)){let o=ft(t,i.x,i.y);o<n&&(n=o)}for(let i of dt(t)){let o=ft(e,i.x,i.y);o<n&&(n=o)}return n}function bn(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,i=0;for(let c of e)n+=c.x,i+=c.y;n/=e.length,i/=e.length;let o=-1,r=e[0];for(let c of e){let u=Math.hypot(c.x-n,c.y-i);u>o&&(o=u,r=c)}let s=r.x-n,l=r.y-i,h=Math.hypot(s,l);h>1e-9?(s/=h,l/=h):(s=1,l=0);let a=e.map((c,u)=>({p:c,i:u,t:(c.x-n)*s+(c.y-i)*l})).sort((c,u)=>c.t-u.t);return{pts:a.map(c=>c.p),seatIndices:a.map(c=>t[c.i])}}function gn(e){let t=e.length;if(t<3)return null;let n=0,i=0;for(let E of e)n+=E.x,i+=E.y;n/=t,i/=t;let o=0,r=0,s=0,l=0,h=0,a=0,c=0;for(let E of e){let w=E.x-n,x=E.y-i;o+=w*w,s+=x*x,r+=w*x,l+=w*w*w,h+=x*x*x,a+=w*x*x,c+=x*w*w}let u=o*s-r*r;if(Math.abs(u)<1e-9)return null;let m=(l+a)/2,d=(h+c)/2,y=(m*s-d*r)/u,f=(d*o-m*r)/u,g=y+n,v=f+i;return!Number.isFinite(g)||!Number.isFinite(v)?null:{cx:g,cy:v}}var xn=.15;function Sn(e){if(e.length<2)return null;let t=e.map(S=>{let p=0,b=0;for(let P of S.pts)p+=P.x,b+=P.y;return{x:p/S.pts.length,y:b/S.pts.length}}),n=0,i=0;for(let S of t)n+=S.x,i+=S.y;n/=t.length,i/=t.length;let o=0,r=0,s=0;for(let S of t){let p=S.x-n,b=S.y-i;o+=p*p,r+=p*b,s+=b*b}let l=o+s,h=o*s-r*r,a=l/2+Math.sqrt(Math.max(0,l*l/4-h)),c,u;Math.abs(r)>1e-12?(c=a-s,u=r):o>=s?(c=1,u=0):(c=0,u=1);let m=Math.hypot(c,u);if(!(m>1e-12))return null;c/=m,u/=m;let d=0,y=0,f=0;for(let S of e){if(S.pts.length<2)continue;let p=S.pts[0],b=S.pts[S.pts.length-1],P=b.x-p.x,M=b.y-p.y,C=Math.hypot(P,M);if(!(C>1e-9))continue;let T=P/C,I=M/C;d+=(T*T-I*I)*C,y+=2*T*I*C,f+=C}if(f>0&&Math.hypot(d,y)>=Pn*f){let S=Math.atan2(y,d)/2,p=Math.cos(S),b=Math.sin(S);Math.abs(c*p+u*b)>vn&&(c=-b,u=p)}let g=1/0,v=-1/0,E=[];for(let S of e){let p=1/0,b=-1/0;for(let P of S.pts){let M=P.x*c+P.y*u;M<p&&(p=M),M>b&&(b=M),M<g&&(g=M),M>v&&(v=M)}E.push(b-p)}let w=v-g;return w>1e-9?(E.sort((S,p)=>S-p),E[Math.min(E.length-1,Math.floor(E.length*.9))]/w<=Mn?{x:c,y:u}:null):null}var Mn=.35,Pn=.8,vn=.7;function mt(e,t,n,i){let o=new Map;for(let p of n){let b=t[p],P=b.rowId||`__seat-${p}`,M=o.get(P);M||(M={pts:[],idx:[]},o.set(P,M)),M.pts.push({x:b.x,y:b.y}),M.idx.push(p)}if(!o.size)return{sectionId:e,rows:[],blockCount:0};let r=[];for(let[p,b]of o){let P=bn(b.pts,b.idx),M=0;for(let C of P.pts)M+=Math.hypot(C.x-i.x,C.y-i.y);r.push({id:p,pts:P.pts,seatIndices:P.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:M/P.pts.length})}let s=r.map(p=>yn(p.pts)),l=r.length<=256?r.length*(r.length-1)/2:0,h=l?new Float64Array(l):null;h?.fill(Number.NaN);let a=h?new Map(r.map((p,b)=>[p,b])):null,c=(p,b)=>(p>b&&([p,b]=[b,p]),p*(2*r.length-p-1)/2+(b-p-1)),u=(p,b)=>{if(!h)return Ee(r[p].pts,r[b].pts);let P=c(p,b),M=h[P];if(!Number.isNaN(M))return M;let C=Ee(r[p].pts,r[b].pts);return h[P]=C,C},m=(p,b)=>a?u(a.get(p),a.get(b)):Ee(p.pts,b.pts),d=[];for(let p=0;p<r.length;p++){let b=1/0;for(let P=0;P<r.length;P++){if(p===P||ht(s[p],s[P])>=b)continue;let M=u(p,P);M<b&&(b=M)}Number.isFinite(b)&&d.push(b)}d.sort((p,b)=>p-b);let y=d.length?d[Math.floor(d.length/2)]:1,f=Math.max(y*1.8,1e-6),g=r.map(()=>[]);for(let p=0;p<r.length;p++)for(let b=p+1;b<r.length;b++)ht(s[p],s[b])>f||u(p,b)<=f&&(g[p].push(b),g[b].push(p));let v=0;for(let p=0;p<r.length;p++){if(r[p].blockId!==-1)continue;let b=v++,P=[p];for(r[p].blockId=b;P.length;){let M=P.pop();for(let C of g[M])r[C].blockId===-1&&(r[C].blockId=b,P.push(C))}}let E=new Map;for(let p of r){let b=E.get(p.blockId)??[];b.push(p),E.set(p.blockId,b)}let w=[];for(let p of r){if(p.pts.length<4)continue;let b=gn(p.pts);b&&(!Number.isFinite(b.cx)||!Number.isFinite(b.cy)||w.push({x:b.cx,y:b.cy}))}let x=w.length>=2?(()=>{let p=w.map(M=>M.x).sort((M,C)=>M-C),b=w.map(M=>M.y).sort((M,C)=>M-C),P=Math.floor(w.length/2);return{cx:p[P],cy:b[P]}})():null;if(x){let p=I=>Math.hypot(I.x-x.cx,I.y-x.cy),b=1/0,P=-1/0,M=[];for(let I of r){let _=1/0,O=-1/0;for(let N of I.pts){let A=p(N);A<_&&(_=A),A>O&&(O=A)}M.push(O-_),_<b&&(b=_),O>P&&(P=O)}let C=P-b;M.sort((I,_)=>I-_);let T=M[Math.min(M.length-1,Math.floor(M.length*.9))];if(C>1e-9&&T/C<=xn){let I=r.map(k=>{let re=0;for(let Rt of k.pts)re+=p(Rt);return{row:k,radius:re/k.pts.length}}),_=0,O=0;for(let k of I)_+=k.radius,O+=k.row.focalDistance;_/=I.length,O/=I.length;let N=0;for(let k of I)N+=(k.radius-_)*(k.row.focalDistance-O);if(N<0)for(let k of I)k.radius=-k.radius;let L=1/0;for(let k of I)k.radius<L&&(L=k.radius);I.sort((k,re)=>k.radius-re.radius);let V=-1,Y=-1/0,kt=C/Math.max(1,I.length)*.5,Te=[];for(let k of I)k.radius-Y>kt&&(V++,Y=k.radius),k.row.ordinal=V,k.row.blockDepth=k.radius-L,Te.push(k.row);return{sectionId:e,rows:Te,blockCount:v}}}let S=[];for(let[,p]of E){let b=Sn(p);if(b){let P=I=>{let _=0;for(let O of I.pts)_+=O.x*b.x+O.y*b.y;return _/I.pts.length};p.sort((I,_)=>P(I)-P(_)),p.length>=2&&p[0].focalDistance>p[p.length-1].focalDistance&&p.reverse();let M=[],C=y*.5;for(let I of p){let _=M[M.length-1];_&&Math.abs(P(I)-P(_[0]))<C?_.push(I):M.push([I])}let T=0;for(let I=0;I<M.length;I++){if(I>0){let _=1/0;for(let O of M[I-1])for(let N of M[I])_=Math.min(_,m(O,N));T+=_}for(let _ of M[I])_.ordinal=I,_.blockDepth=T,S.push(_)}}else{let P=1/0;for(let M of p)M.focalDistance<P&&(P=M.focalDistance);p.sort((M,C)=>M.focalDistance-C.focalDistance);for(let M=0;M<p.length;M++)p[M].ordinal=M,p[M].blockDepth=Math.max(0,p[M].focalDistance-P),S.push(p[M])}}return{sectionId:e,rows:S,blockCount:v}}function En(e,t){return Math.abs(e.x-t.x)<=1e-7&&Math.abs(e.y-t.y)<=1e-7}function oe(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function ae(e,t,n){let i=oe(t,n,e);return Math.abs(i)>1e-7?!1:e.x>=Math.min(t.x,n.x)-1e-7&&e.x<=Math.max(t.x,n.x)+1e-7&&e.y>=Math.min(t.y,n.y)-1e-7&&e.y<=Math.max(t.y,n.y)+1e-7}function In(e,t,n,i){let o=oe(e,t,n),r=oe(e,t,i),s=oe(n,i,e),l=oe(n,i,t);return(o>1e-7&&r<-1e-7||o<-1e-7&&r>1e-7)&&(s>1e-7&&l<-1e-7||s<-1e-7&&l>1e-7)?!0:Math.abs(o)<=1e-7&&ae(n,e,t)||Math.abs(r)<=1e-7&&ae(i,e,t)||Math.abs(s)<=1e-7&&ae(e,n,i)||Math.abs(l)<=1e-7&&ae(t,n,i)}function wn(e){return e.reduce((t,n,i)=>{let o=e[(i+1)%e.length];return t+n.x*o.y-o.x*n.y},0)}function Cn(e){for(let t=0;t<e.length;t+=1){let n=(t+1)%e.length;for(let i=t+1;i<e.length;i+=1){let o=(i+1)%e.length;if(!(t===i||n===i||o===t)&&In(e[t],e[n],e[i],e[o]))return!0}}return!1}function ai(e){return e.length<3?{ok:!1,code:"too_few_vertices",message:"Add at least three vertices to create a polygon."}:e.length>256?{ok:!1,code:"too_many_vertices",message:"A polygon can contain at most 256 vertices."}:e.some(t=>!Number.isFinite(t.x)||!Number.isFinite(t.y)||Math.abs(t.x)>1e7||Math.abs(t.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((t,n)=>En(t,e[(n+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(wn(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:Cn(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}var di=64;function _n(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((i,o)=>{let r=e.edgeCurvature[o];return Number.isFinite(r)?Math.min(100,Math.max(-100,r)):0});return n.some(i=>Math.abs(i)>.5)?n:[]}function On(e){let t=_n(e);return t.length?Se(e.points,{edgeCurvature:t}):null}function ie(e,t=2){let n=On(e);return n?st(n,t):e.points??[]}function fi(e){return e.kind==="polygon"?X(e.holes):[]}function hi(e,t){let n=ie(e);return n.length<3||t.length<3||!t.flatMap((o,r)=>{let s=t[(r+1)%t.length];return[o,{x:(o.x+s.x)/2,y:(o.y+s.y)/2}]}).every(o=>Z(o,n)||Ie(o,n))?!1:!t.some((o,r)=>{let s=t[(r+1)%t.length];return n.some((l,h)=>pt(o,s,l,n[(h+1)%n.length]))})}function pt(e,t,n,i){let o=(a,c,u)=>(c.x-a.x)*(u.y-a.y)-(c.y-a.y)*(u.x-a.x),r=o(e,t,n),s=o(e,t,i),l=o(n,i,e),h=o(n,i,t);return r*s<-1e-9&&l*h<-1e-9}function mi(e,t){return Z(e[0],t)||Z(t[0],e)?!0:e.some((n,i)=>{let o=e[(i+1)%e.length];return t.some((r,s)=>pt(n,o,r,t[(s+1)%t.length]))})}var bi=[{key:"rect",label:"Flat stage",blurb:"Classic proscenium box."},{key:"rounded",label:"Rounded",blurb:"Softened corners."},{key:"arc",label:"Curved front",blurb:"Front edge bows toward the audience."},{key:"thrust",label:"Thrust (T)",blurb:"Central tongue projects into the crowd."},{key:"runway",label:"Runway",blurb:"Long catwalk into the audience."},{key:"round",label:"In the round",blurb:"Central platform, audience all around."},{key:"pitch-football",label:"Football pitch",blurb:"105 \xD7 68 m pitch with centre circle and penalty boxes."},{key:"rink-hockey",label:"Hockey rink",blurb:"60 \xD7 30 m ice rink with blue lines and faceoff circles."},{key:"track-athletics",label:"Athletics track",blurb:"400 m track: two straights, two semicircles, eight lanes."},{key:"oval-cricket",label:"Cricket oval",blurb:"~150 \xD7 140 m oval with boundary rope and pitch strip."},{key:"pitch-rugby",label:"Rugby pitch",blurb:"100 \xD7 70 m field of play with in-goal areas, 22 m and 10 m lines."},{key:"diamond-baseball",label:"Baseball field",blurb:"Diamond, infield, mound and foul lines out to 99 m poles."},{key:"court-basketball",label:"Basketball court",blurb:"28 \xD7 15 m court with keys and three-point lines."},{key:"court-tennis",label:"Tennis court",blurb:"23.77 \xD7 10.97 m doubles court with run-off and net."},{key:"ring-boxing",label:"Boxing ring",blurb:"Raised ring, 6.1 m inside the ropes, coloured corners."}],kn=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]),Rn=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function Tn(e){return!!e&&kn.has(e)}function gi(e){return!!e&&Rn.has(e)}var Ce=1.1;function xi(e){return ce(e)?e==="ring-boxing"?Ce:.06:1}var yt={round:{width:6,height:6},"pitch-football":{width:105,height:68},"rink-hockey":{width:60,height:30},"track-athletics":{width:176.9,height:92.5},"oval-cricket":{width:150,height:140},"pitch-rugby":{width:120,height:70},"diamond-baseball":{width:140,height:140},"court-basketball":{width:32,height:19},"court-tennis":{width:36.57,height:18.29},"ring-boxing":{width:7.8,height:7.8}},bt={"pitch-football":"#2f7d4f","rink-hockey":"#e8f1f8","track-athletics":"#a4472f","oval-cricket":"#3d8a53","pitch-rugby":"#2f7d4f","diamond-baseball":"#2f7d4f","court-basketball":"#c8894f","court-tennis":"#3f7a5a","ring-boxing":"#2a4d8f"};function Si(e){let t=yt[e];return t?{width:t.width*ve,height:t.height*ve}:{width:300,height:70}}var An="#232c40",gt=Math.PI*2;function xt(e,t,n,i,o,r){return{x:o+e*n-t*i,y:r+e*i+t*n}}function Nn(e){let{kind:t,cx:n,cy:i,width:o,height:r}=e,s=(e.rotation??0)*Math.PI/180,l=Math.cos(s),h=Math.sin(s),a=o/2,c=r/2,u=[],m=(d,y)=>{u.push({x:d,y})};switch(t){case"rect":{m(-a,-c),m(a,-c),m(a,c),m(-a,c);break}case"rounded":{let d=Math.min(o,r)*.18,y=5,f=(g,v,E)=>{for(let w=0;w<=y;w++){let x=E+w/y*(Math.PI/2);m(g+d*Math.cos(x),v+d*Math.sin(x))}};f(a-d,-c+d,-Math.PI/2),f(a-d,c-d,0),f(-a+d,c-d,Math.PI/2),f(-a+d,-c+d,Math.PI);break}case"arc":{let d=r*.45;m(-a,-c),m(a,-c);let y=24;for(let f=0;f<=y;f++){let g=f/y,v=a-g*o,E=c+d*(1-Math.pow(2*v/o,2));m(v,E)}break}case"thrust":{let d=o*.18,y=r*1.1;m(-a,-c),m(a,-c),m(a,c),m(d,c),m(d,c+y),m(-d,c+y),m(-d,c),m(-a,c);break}case"runway":{let d=o*.1,y=r*3;m(-a,-c),m(a,-c),m(a,c),m(d,c),m(d,c+y),m(-d,c+y),m(-d,c),m(-a,c);break}case"round":case"oval-cricket":{for(let y=0;y<40;y++){let f=y/40*gt;m(a*Math.cos(f),c*Math.sin(f))}break}case"pitch-football":case"pitch-rugby":case"court-basketball":case"court-tennis":case"ring-boxing":{m(-a,-c),m(a,-c),m(a,c),m(-a,c);break}case"diamond-baseball":{for(let d of jn(a,c))m(d.x,d.y);break}case"rink-hockey":{for(let d of Ln(a,c,a*(8.5/60),c*(8.5/30)))m(d.x,d.y);break}case"track-athletics":{for(let d of we(a,c))m(d.x,d.y);break}}return u.map(d=>xt(d.x,d.y,l,h,n,i))}function Mi(e,t="stage"){return{type:"shape",id:t,kind:"polygon",points:Nn(e),fill:e.fill??bt[e.kind]??An,label:e.label??"STAGE",role:"stage",stageKind:e.kind}}function Ln(e,t,n,i){let o=[],s=(l,h,a)=>{for(let c=0;c<=8;c++){let u=a+c/8*(Math.PI/2);o.push({x:l+n*Math.cos(u),y:h+i*Math.sin(u)})}};return s(e-n,-t+i,-Math.PI/2),s(e-n,t-i,0),s(-e+n,t-i,Math.PI/2),s(-e+n,-t+i,Math.PI),o}function we(e,t){let n=Math.max(0,e-t),i=[],o=20;for(let r=0;r<=o;r++){let s=-Math.PI/2+r/o*Math.PI;i.push({x:n+t*Math.cos(s),y:t*Math.sin(s)})}for(let r=0;r<=o;r++){let s=Math.PI/2+r/o*Math.PI;i.push({x:-n+t*Math.cos(s),y:t*Math.sin(s)})}return i}var B=(()=>{let t={x:0,y:52},n=25,i={x:70,y:t.y-70},o=(i.x*i.x+i.y*i.y-4900)/(2*(i.y+70)),r=o+70,s=[],l=Math.atan2(i.y-o,i.x),h=Math.atan2(i.y-o,-i.x);for(let a=0;a<=24;a++){let c=l+(h-l)*a/24;s.push({x:r*Math.cos(c),y:o+r*Math.sin(c)})}return{half:70,home:t,backstop:n,fence:s}})();function jn(e,t){let n=e/B.half,i=t/B.half;return[{x:-B.backstop*n,y:t},{x:B.backstop*n,y:t},...B.fence.map(o=>({x:o.x*n,y:o.y*i}))]}var Fn="#f1f5f9";function Pi(e){switch(e){case"pitch-football":return"PITCH";case"rink-hockey":return"RINK";case"track-athletics":return"TRACK";case"oval-cricket":return"OVAL";case"pitch-rugby":return"PITCH";case"diamond-baseball":return"FIELD";case"court-basketball":case"court-tennis":return"COURT";case"ring-boxing":return"RING";default:return"STAGE"}}function ce(e){return Tn(e)}function K(e,t,n,i,o=32){let r=[];for(let s=0;s<o;s++){let l=s/o*gt;r.push({x:e+n*Math.cos(l),y:t+i*Math.sin(l)})}return r}function U(e,t,n,i){return[{x:e-n,y:t-i},{x:e+n,y:t-i},{x:e+n,y:t+i},{x:e-n,y:t+i}]}function Dn(e){let{kind:t,cx:n,cy:i,width:o,height:r}=e,s=(e.rotation??0)*Math.PI/180,l=Math.cos(s),h=Math.sin(s),a=o/2,c=r/2,u=[],m=yt[t],d=f=>m?f/m.width*o:0,y=f=>m?f/m.height*r:0;switch(t){case"pitch-football":{u.push({points:[{x:0,y:-c},{x:0,y:c}],closed:!1}),u.push({points:K(0,0,d(9.15),y(9.15)),closed:!0});for(let f of[-1,1])u.push({points:U(f*(a-d(16.5)/2),0,d(16.5)/2,y(40.32)/2),closed:!0}),u.push({points:U(f*(a-d(5.5)/2),0,d(5.5)/2,y(18.32)/2),closed:!0});break}case"rink-hockey":{u.push({points:[{x:0,y:-c},{x:0,y:c}],closed:!1,ink:"#d63b3b"});for(let f of[-1,1]){u.push({points:[{x:f*d(7.5),y:-c},{x:f*d(7.5),y:c}],closed:!1,ink:"#2f6ecb"}),u.push({points:[{x:f*(a-d(4)),y:-y(11)},{x:f*(a-d(4)),y:y(11)}],closed:!1,ink:"#d63b3b"});for(let g of[-1,1])u.push({points:K(f*d(20.5),g*y(7),d(4.5),y(4.5)),closed:!0,ink:"#2f6ecb"})}u.push({points:K(0,0,d(4.5),y(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let g=c-y(1.22)*8;g>0&&u.push({points:we(a-d(1.22)*8,g),closed:!0,fill:"#2f7d4f"});for(let v=1;v<8;v++){let E=y(1.22)*v,w=c-E;if(w<=0)break;u.push({points:we(a-d(1.22)*v,w),closed:!0})}break}case"oval-cricket":{u.push({points:K(0,0,d(27.4),y(27.4+20.12/2),40),closed:!0}),u.push({points:U(0,0,d(3.05)/2,y(20.12)/2),closed:!0,ink:"#d8cfae"});break}case"pitch-rugby":{let f=g=>({points:[{x:d(g),y:-c},{x:d(g),y:c}],closed:!1});u.push(f(0));for(let g of[-1,1]){u.push(f(g*50),f(g*28));for(let v=-35;v<35;v+=4)u.push({points:[{x:d(g*10),y:y(v)},{x:d(g*10),y:y(Math.min(35,v+2))}],closed:!1})}break}case"diamond-baseball":{let f=(A,L)=>({x:d(A),y:y(L)}),{home:g}=B,v=27.43,E=v/Math.SQRT2,w={x:g.x+E,y:g.y-E},x={x:g.x,y:g.y-2*E},S={x:g.x-E,y:g.y-E},p={x:g.x,y:g.y-18.44},b="#b98a59",P=bt["diamond-baseball"],M=38.94,C=[f(g.x,g.y)],T=Math.atan2(g.y-M/Math.SQRT2-p.y,M/Math.SQRT2),I=Math.PI-T;for(let A=0;A<=16;A++){let L=T-(T+Math.PI*2-I)%(Math.PI*2)*(A/16);C.push(f(p.x+29*Math.cos(L),p.y+29*Math.sin(L)))}u.push({points:C,closed:!0,fill:b,ink:b});let _={x:g.x,y:g.y-E},O=[{x:g.x,y:g.y},w,x,S].map(A=>f(_.x+(A.x-_.x)*.84,_.y+(A.y-_.y)*.84));u.push({points:O,closed:!0,fill:P,ink:P}),u.push({points:K(d(p.x),y(p.y),d(2.74),y(2.74),20),closed:!0,fill:b,ink:b}),u.push({points:K(d(g.x),y(g.y),d(3.96),y(3.96),20),closed:!0,fill:b,ink:b});let N=B.fence;u.push({points:[f(g.x,g.y),f(N[0].x,N[0].y)],closed:!1}),u.push({points:[f(g.x,g.y),f(N[N.length-1].x,N[N.length-1].y)],closed:!1});for(let A of[w,x,S])u.push({points:U(d(A.x),y(A.y),d(.3),y(.3)),closed:!0,fill:Fn});break}case"court-basketball":{u.push({points:U(0,0,d(14),y(7.5)),closed:!0}),u.push({points:[{x:0,y:-y(7.5)},{x:0,y:y(7.5)}],closed:!1}),u.push({points:K(0,0,d(1.8),y(1.8),24),closed:!0});for(let f of[-1,1]){let g=f*14,v=f*(14-5.8),E=f*(14-1.575);u.push({points:U(d((g+v)/2),0,d(2.9),y(2.45)),closed:!0,fill:"#2f5d8a"}),u.push({points:K(d(v),0,d(1.8),y(1.8),24),closed:!0});let w=Math.sqrt(6.75*6.75-6.6*6.6),x=[{x:d(g),y:-y(6.6)}],S=Math.atan2(-6.6,-f*w),p=2*Math.atan2(6.6,w);for(let b=0;b<=16;b++){let P=S-f*p*(b/16);x.push({x:d(E+6.75*Math.cos(P)),y:y(6.75*Math.sin(P))})}x.push({x:d(g),y:y(6.6)}),u.push({points:x,closed:!1})}break}case"court-tennis":{u.push({points:U(0,0,d(11.885),y(5.485)),closed:!0,fill:"#2b5f99"});for(let f of[-1,1])u.push({points:[{x:-d(11.885),y:f*y(4.115)},{x:d(11.885),y:f*y(4.115)}],closed:!1}),u.push({points:[{x:f*d(6.4),y:-y(4.115)},{x:f*d(6.4),y:y(4.115)}],closed:!1});u.push({points:[{x:-d(6.4),y:0},{x:d(6.4),y:0}],closed:!1}),u.push({points:[{x:0,y:-y(6.4)},{x:0,y:y(6.4)}],closed:!1,ink:"#d1d5db"});break}case"ring-boxing":{u.push({points:U(0,0,d(3.05),y(3.05)),closed:!0});let v=[[-1,-1,"#c53030"],[1,1,"#2b6cb0"],[1,-1,"#e2e8f0"],[-1,1,"#e2e8f0"]];for(let[E,w,x]of v)u.push({points:U(E*d(3.05),w*y(3.05),d(.3),y(.3)),closed:!0,fill:x,ink:x});break}default:return[]}return u.map(f=>({...f,points:f.points.map(g=>xt(g.x,g.y,l,h,n,i))}))}function vi(e){if(e.role!=="stage"||!ce(e.stageKind))return[];let t=null;if(e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null&&e.width>0&&e.height>0&&[e.x,e.y,e.width,e.height].every(Number.isFinite))t={cx:e.x+e.width/2,cy:e.y+e.height/2,width:e.width,height:e.height};else if(e.points&&e.points.length>=3&&e.points.every(n=>Number.isFinite(n.x)&&Number.isFinite(n.y))){let n=e.points.map(c=>c.x),i=e.points.map(c=>c.y),o=Math.min(...n),r=Math.max(...n),s=Math.min(...i),l=Math.max(...i),h=Math.max(1,r-o),a=Math.max(1,l-s);t={cx:o+h/2,cy:s+a/2,width:h,height:a}}return t?Dn({kind:e.stageKind,...t}):[]}function Vn(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?ie(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,i=e.width,o=e.height;return[{x:t,y:n},{x:t+i,y:n},{x:t+i,y:n+o},{x:t,y:n+o}]}function Hn(e,t,n){let i=n*Math.PI/180,o=Math.cos(i),r=Math.sin(i),s=e.x-t.x,l=e.y-t.y;return{x:t.x+s*o-l*r,y:t.y+s*r+l*o}}function St(e){let t=Vn(e);if(!t||t.length<2)return null;let n=e.rotation??0,i=Math.abs(n)<1e-6?t:t.map(h=>Hn(h,{x:t.reduce((a,c)=>a+c.x,0)/t.length,y:t.reduce((a,c)=>a+c.y,0)/t.length},n)),o=1/0,r=1/0,s=-1/0,l=-1/0;for(let h of i)o=Math.min(o,h.x),r=Math.min(r,h.y),s=Math.max(s,h.x),l=Math.max(l,h.y);return!Number.isFinite(o)||s-o<1e-6||l-r<1e-6?null:{minX:o,minY:r,maxX:s,maxY:l}}var Un=5,Gn=3,Xn=.92,Kn=1.9,Bn=2,Yn=.6,zn=1,Wn=.06;function $n(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?Ce:ce(e.stageKind)?Wn:zn}function Mt(e){let t=1/0,n=1/0,i=-1/0,o=-1/0,r=-1/0;for(let s of _e(e)){let l=s.baseHeightM??0;for(let h of s.objects){if(h.type!=="shape"||h.role!=="stage")continue;let a=St(h);a&&(t=Math.min(t,a.minX),n=Math.min(n,a.minY),i=Math.max(i,a.maxX),o=Math.max(o,a.maxY),r=Math.max(r,l+$n(h)))}}return!Number.isFinite(t)||!Number.isFinite(r)?null:{minX:t,minY:n,maxX:i,maxY:o,deckTopM:r}}function qn(e,t,n,i){let o=1/0,r=1/0,s=-1/0,l=-1/0;for(let d of e)Number.isFinite(d.eyeHeightM)&&(o=Math.min(o,d.x),s=Math.max(s,d.x),r=Math.min(r,d.y),l=Math.max(l,d.y));if(!Number.isFinite(o))return null;let h=o*t,a=r*t,c=Math.max(1,Math.ceil((s-o)*t/n)+1),u=Math.max(1,Math.ceil((l-r)*t/n)+1),m=new Float64Array(c*u).fill(-1/0);for(let d of e){if(!Number.isFinite(d.eyeHeightM))continue;let y=d.eyeHeightM-J,f=Math.min(c-1,Math.max(0,Math.floor((d.x*t-h)/n))),v=Math.min(u-1,Math.max(0,Math.floor((d.y*t-a)/n)))*c+f,E=y+i;E>m[v]&&(m[v]=E)}return{cellM:n,minX:h,minY:a,cols:c,rows:u,top:m}}function Qn(e,t,n){let i=Math.floor((t-e.minX)/e.cellM),o=Math.floor((n-e.minY)/e.cellM);return i<0||o<0||i>=e.cols||o>=e.rows?-1/0:e.top[o*e.cols+i]}function Pt(e,t,n={}){let i=new Map;if(!t||!e.length)return i;let o=n.metresPerChartUnit??Q,r=n.cellM??Yn,s=n.chairBackM??Xn,l=n.selfRowSkipM??Bn,h=n.clearThreshold??.9,a=n.partialThreshold??.25,c=Math.max(1,n.columns??Un),u=Math.max(1,n.rows??Gn),m=qn(e,o,r,s);if(!m)return i;let d=(t.maxX-t.minX)*o,y=(t.maxY-t.minY)*o,f=d>=y,g=(t.minX+t.maxX)/2*o,v=(t.minY+t.maxY)/2*o,E=[];for(let x=0;x<c;x++){let S=(x+.5)/c-.5,p=f?g+S*d:g,b=f?v:v+S*y;for(let P=0;P<u;P++){let M=t.deckTopM+(u===1?0:P/(u-1)*Kn);E.push({x:p,y:b,z:M})}}let w=r/2;for(let x of e){if(!Number.isFinite(x.eyeHeightM))continue;let S=x.x*o,p=x.y*o,b=x.eyeHeightM,P=0,M=1/0;for(let T of E){let I=T.x-S,_=T.y-p,O=Math.hypot(I,_);if(!(O>l)){P++;continue}let N=I/O,A=_/O,L=0;for(let V=l;V<O;V+=w){let Y=Qn(m,S+N*V,p+A*V);if(!(!Number.isFinite(Y)||Y>=b)&&Y>b+(T.z-b)*V/O){L=V;break}}L?M=Math.min(M,L):P++}let C=P/E.length;C>=h||i.set(x.id,{seatId:x.id,mark:C<a?"obstructedView":"restrictedView",visibleFraction:C,totalRays:E.length,atDistanceM:Number.isFinite(M)?M:0})}return i}function vt(e,t){if(!t.size)return 0;let n=0;for(let i of e){let o=t.get(i.id);if(!o)continue;let r=i.commercial;r?.restrictedView!==void 0||r?.obstructedView!==void 0||(i.commercial={...r,[o.mark]:!0},n++)}return n}function Oe(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var de=Math.PI/180,Jn=9,ee=16;function ke(e,t,n,i){let o=n*de,r=Math.cos(o),s=Math.sin(o);return{x:i.x+e*r-t*s,y:i.y+e*s+t*r}}function Re(e){let{seatCount:t,seatSpacing:n,curve:i,rotation:o,origin:r}=e,s=[];if(e.path)return $e(e.path,t);if(t<=1)return t===1&&s.push({x:r.x,y:r.y}),s;if(i===0){for(let a=0;a<t;a++)s.push(ke(a*n,0,o,r));return s}let l=i/(t-1)*de,h=n/(2*Math.sin(Math.abs(l)/2));for(let a=0;a<t;a++){let c=a*l,u=h*Math.sin(c),m=-h+h*Math.cos(c);s.push(ke(u,m,o,r))}return s}function Ct(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Wi(e){let t=new Set((e.overrides??[]).filter(n=>n.skip&&Number.isInteger(n.index)&&n.index>=0&&n.index<e.seatCount).map(n=>n.index));return Math.max(0,e.seatCount-t.size)}function Zn(e,t){let n=Ct(e);return Re(e).map((i,o)=>{let r=n.get(o),s=Oe(r),l=Ae(e,o,r),h={...e.commercial,...r?.commercial};return{index:o,x:i.x+(r?.dx??0),y:i.y+(r?.dy??0),label:l,displayLabel:he(e,o,t,r),categoryKey:r?.categoryKey??e.categoryKey,skipped:!!r?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:r?.wheelchairSpaceType,commercial:Object.values(h).some(a=>a!==void 0&&a!==!1&&a!=="")?h:void 0,glyph:r?.glyph,viewUrl:r?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:r?.viewFromSeatUrl?r.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:r?.labelStyle??e.seatLabelStyle}})}function eo(e){let t=[];for(let n of Zn(e))n.skipped||t.push({id:`${e.id}:${n.index}`,label:n.label,displayLabel:n.displayLabel===n.label?void 0:n.displayLabel,x:n.x,y:n.y,rowId:e.id,categoryKey:n.categoryKey,accessible:n.accessible||void 0,accessibility:n.accessibility.length?n.accessibility:void 0,wheelchairSpaceType:n.wheelchairSpaceType,commercial:n.commercial,glyph:n.glyph,viewUrl:n.viewUrl,viewMeta:n.viewMeta,labelStyle:n.labelStyle});return t}function to(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(r=>t.includes(r)),i={top:0,bottom:0,left:0,right:0};if(!n.length)return i;let o=Math.max(0,Math.round(e.seatCount));for(let r=0;r<o;r++)i[n[r%n.length]]+=1;return i}function _t(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let i=new Map((e.overrides??[]).map(c=>[c.index,c])),o=(c,u,m,d)=>{let y=i.get(c),f=Oe(y),g=y?.label??Ne(e,c);return{index:c,label:g,displayLabel:y?.displayLabel??Le(e,c),x:u+(y?.dx??0),y:m+(y?.dy??0),categoryKey:y?.categoryKey??e.categoryKey,skipped:!!y?.skip,accessible:f.length>0,accessibility:f,wheelchairSpaceType:y?.wheelchairSpaceType,commercial:y?.commercial,glyph:y?.glyph,viewUrl:y?.viewFromSeatUrl,viewMeta:y?.viewFromSeatUrl?y.viewFromSeatMeta:void 0,labelStyle:y?.labelStyle,...d?{side:d}:{}}};if(e.shape==="round"){let c=(e.radius??40)+ee,u=e.rotation*de,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||n===1){for(let g=0;g<n;g++){let v=u+g/n*2*Math.PI;t.push(o(g,e.center.x+c*Math.cos(v),e.center.y+c*Math.sin(v)))}return t}let d=m*de,y=(2*Math.PI-d)/2,f=u+y;for(let g=0;g<n;g++){let v=f+g/(n-1)*d;t.push(o(g,e.center.x+c*Math.cos(v),e.center.y+c*Math.sin(v)))}return t}let r=e.width??80,s=e.height??50,l=to(e),h=["top","bottom","left","right"],a=0;for(let c of h){let u=l[c];for(let m=0;m<u;m++){let d,y;c==="top"?(d=-r/2+(m+.5)*r/u,y=-s/2-ee):c==="bottom"?(d=-r/2+(m+.5)*r/u,y=s/2+ee):c==="left"?(d=-r/2-ee,y=-s/2+(m+.5)*s/u):(d=r/2+ee,y=-s/2+(m+.5)*s/u);let f=ke(d,y,e.rotation,e.center);t.push(o(a++,f.x,f.y,c))}}return t}function $i(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):_t(e).filter(t=>!t.skipped).length}function no(e){return _t(e).filter(t=>!t.skipped).map(t=>({id:`${e.id}:${t.index}`,label:t.label,...t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.x,y:t.y,rowId:e.id,categoryKey:t.categoryKey,...t.accessible?{accessible:!0}:{},...t.accessibility.length?{accessibility:t.accessibility}:{},...t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:{},...t.commercial?{commercial:t.commercial}:{},...t.glyph?{glyph:t.glyph}:{},...t.viewUrl?{viewUrl:t.viewUrl}:{},...t.viewUrl&&t.viewMeta?{viewMeta:t.viewMeta}:{},...t.labelStyle?{labelStyle:t.labelStyle}:{}}))}function oo(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function Z(e,t){let n=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){let r=t[i].x,s=t[i].y,l=t[o].x,h=t[o].y;s>e.y!=h>e.y&&e.x<(l-r)*(e.y-s)/(h-s)+r&&(n=!n)}return n}function Ie(e,t){return t.some((n,i)=>{let o=t[(i+1)%t.length],r=(e.y-n.y)*(o.x-n.x)-(e.x-n.x)*(o.y-n.y);if(Math.abs(r)>1e-7)return!1;let s=(e.x-n.x)*(o.x-n.x)+(e.y-n.y)*(o.y-n.y),l=(o.x-n.x)**2+(o.y-n.y)**2;return s>=-1e-7&&s<=l+1e-7})}function X(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function fe(e,t,n){return Z(e,t)&&!X(n).some(i=>Z(e,i)||Ie(e,i))}function qi(e,t){return tt(e,t).point}function ue(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;return{x:t/e.length,y:n/e.length}}function Ot(e){switch(e.type){case"row":{let t=Re(e),n=Ct(e),i=0,o=0,r=0;for(let s=0;s<t.length;s++){let l=n.get(s);l?.skip||(i+=t[s].x+(l?.dx??0),o+=t[s].y+(l?.dy??0),r++)}return r?{x:i/r,y:o/r}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ue(e.points);case"section":return ue(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ue(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function Et(e,t){return e.length===t.length&&e.every((n,i)=>n.x===t[i].x&&n.y===t[i].y)}function io(e,t){if(e.type!=="gaArea"||!Et(e.points,t.outline))return!1;let n=X(e.holes),i=X(t.holes);return n.length===i.length&&n.every((o,r)=>Et(o,i[r]))}function ro(e,t,n=e.filter(o=>o.type==="section"),i=Ot(t)){let o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(o?n.find(s=>(s.logicalSectionId??s.id)===o&&(io(t,s)||fe(i,s.outline,s.holes))):void 0)??n.find(s=>fe(i,s.outline,s.holes))}function _e(e){return e.floors&&e.floors.length?e.floors:[{id:"floor-0",name:"Main",objects:e.objects,focalPoint:e.focalPoint,referenceImage:e.referenceImage,backgroundImage:e.backgroundImage}]}function Qi(e,t){let n=_e(e);return(t?n.find(i=>i.id===t):n[0])?.objects??[]}function so(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function ao(e,t,n){let i=r=>({x:r.x+t,y:r.y+n}),o=r=>r.map(i);switch(e.type){case"row":return{...e,origin:i(e.origin)};case"table":case"booth":return{...e,center:i(e.center)};case"gaArea":return{...e,points:o(e.points),...e.holes?{holes:X(e.holes).map(o)}:{}};case"section":return{...e,outline:o(e.outline),...e.outlinePath?{outlinePath:at(e.outlinePath,t,n)}:{},...e.holes?{holes:X(e.holes).map(o)}:{}};case"text":return{...e,position:i(e.position)};case"shape":return{...e,...e.points?{points:o(e.points)}:{},...e.holes?{holes:X(e.holes).map(o)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function Ji(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((i,o)=>{let r=-o*t;for(let s of i.objects)n.push(r===0?s:ao(s,0,r))}),{...e,objects:n,floors:void 0}}function It(e,t,n,i,o,r,s,l,h){let a=[],c=e.filter(f=>f.type==="section"),u=ct(e),m=f=>!f?.eventConfigurationId||f.eventConfigurationId===i&&(f.eventConfigurationVersion===void 0||f.eventConfigurationVersion===h),d=f=>je(f,{activeConfigurationId:i,activeConfigurationVersion:h,activeBasisSha256:o,now:l}),y=(f,g)=>d(f)?{...f,coverage:g}:void 0;for(let f of e){let g=[];if(f.type==="row"?g=eo(f):f.type==="table"?g=no(f):f.type==="booth"&&(g=oo(f)),!g.length)continue;for(let S of g)S.viewUrl&&!m(S.viewMeta)&&(S.viewUrl=void 0,S.viewMeta=void 0);if(f.type==="row"){let S=u.get(f.id);if(S){let p=new Map((f.overrides??[]).map(b=>[b.index,b]));for(let b of g){let P=Number(b.id.slice(b.id.lastIndexOf(":")+1));if(!Number.isInteger(P))continue;b.logicalRowId=S.groupId,b.logicalSeatIndex=S.adjacencyOffset+P,p.get(P)?.displayLabel||(b.displayLabel=he(f,P,S)),!b.viewUrl&&S.viewFromSeatUrl&&m(S.viewFromSeatMeta)&&(b.viewUrl=S.viewFromSeatUrl,b.viewMeta=S.viewFromSeatMeta);let M=p.get(P)?.confidenceEvidence;b.confidenceEvidence=y(M,"exact-seat")??y(f.confidenceEvidence,"row-representative")??y(S.confidenceEvidence,"row-representative")}}}let v=ro(e,f,c,f.type==="row"?ue(g):Ot(f)),E=v?.viewFromSeatUrl,x=(v?.zone?t?.find(S=>S.id===v.zone):void 0)?.focalPoint??n;for(let S of g){if(!S.confidenceEvidence){let p=Number(S.id.slice(S.id.lastIndexOf(":")+1)),b=(f.type==="row"||f.type==="table")&&Number.isInteger(p)?f.overrides?.find(P=>P.index===p)?.confidenceEvidence:void 0;S.confidenceEvidence=y(b,"exact-seat")??(f.type==="row"?y(f.confidenceEvidence,"row-representative"):void 0)}S.confidenceEvidence??=y(v?.confidenceEvidence,"section-representative")??(s?y(s.evidence,s.coverage):void 0),!S.viewUrl&&E&&m(v?.viewFromSeatMeta)&&(S.viewUrl=E,S.viewMeta=v?.viewFromSeatMeta),!S.viewUrl&&r&&m(r.meta)&&(S.viewUrl=r.url,S.viewMeta=r.meta),v&&(S.sectionId=v.logicalSectionId??v.id),v?.zone&&(S.zoneId=v.zone),x&&(S.focalPoint={...x})}a.push(...g)}return a}function Zi(e,t={}){if(e.floors?.length){let i=[];for(let o of e.floors){let r=o.focalPoint??e.focalPoint,s=o.viewFromSeatUrl?{url:o.viewFromSeatUrl,meta:o.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,l=o.confidenceEvidence?{evidence:o.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,h=It(o.objects,e.zones,r,e.eventConfigurationId,e.confidenceBasisSha256,s,l,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&wt(o.objects,o.focalPoint??e.focalPoint,o.baseHeightM??0,h);for(let a of h)a.floorId=o.id;for(let a of h)i.push(a)}return i}let n=It(e.objects,e.zones,e.focalPoint,e.eventConfigurationId,e.confidenceBasisSha256,e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);return t.resolveEyeHeights!==!1&&wt(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),co(e,n,t)}function co(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||vt(t,Pt(t,Mt(e))),t}function wt(e,t,n,i){let o=e.filter(u=>u.type==="section"),r=n>0||o.some(u=>u.height!==void 0||u.rake!==void 0||(u.elevation??0)>0);if(!o.length||!r||!t){for(let u of i)u.eyeHeightM=n+J;return}let s=new Array(i.length),l=new Map;for(let u of o)l.has(u.id)||l.set(u.id,u);let h=new Map,a=new Map;for(let u=0;u<i.length;u++){let m=i[u],y=(m.sectionId?l.get(m.sectionId)??o.find(g=>g.logicalSectionId===m.sectionId&&fe({x:m.x,y:m.y},g.outline,g.holes)):void 0)??o.find(g=>fe({x:m.x,y:m.y},g.outline,g.holes))??null;if(s[u]=y,!y)continue;h.has(y.id)||h.set(y.id,ut(y,{floorBaseHeightM:n}));let f=a.get(y.id);f?f.push(u):a.set(y.id,[u])}let c=new Array(i.length).fill(void 0);for(let[u,m]of a){let d=h.get(u);if(!d)continue;let y=d.rake>0?Math.tan(d.rake*Math.PI/180):0,f=mt(u,i,m,t);for(let g of f.rows){let v=g.blockDepth*Q*y,E=d.height+v;for(let w of g.seatIndices)c[w]=E}}for(let u=0;u<i.length;u++){let m=i[u],d=s[u];if(!d){m.eyeHeightM=n+J;continue}let y=h.get(d.id);m.eyeHeightM=(c[u]??y.height)+J}}var le=40;function er(e,t){let n=t?.freeText==="exclude",i=1/0,o=1/0,r=-1/0,s=-1/0,l=(a,c)=>{a<i&&(i=a),c<o&&(o=c),a>r&&(r=a),c>s&&(s=c)},h=a=>{if(Array.isArray(a))for(let c of a)!c||typeof c!="object"||l(c.x,c.y)};for(let a of so(e))if(a.type==="row"){let c=new Map((a.overrides??[]).map(u=>[u.index,u]));Re(a).forEach((u,m)=>{let d=c.get(m);d?.skip||l(u.x+(d?.dx??0),u.y+(d?.dy??0))})}else if(a.type==="gaArea")h(a.points);else if(a.type==="section")h(a.outline);else if(a.type==="decorImage")l(a.x,a.y),l(a.x+a.width,a.y+a.height);else if(a.type==="shape")a.points&&a.points.length?h(ie(a)):a.x!=null&&a.y!=null&&a.width!=null&&a.height!=null&&(l(a.x,a.y),l(a.x+a.width,a.y+a.height));else if(a.type==="table"){let c=ee+Jn,u=a.shape==="round"?(a.radius??40)+c:Math.max((a.width??80)/2,(a.height??50)/2)+c;l(a.center.x-u,a.center.y-u),l(a.center.x+u,a.center.y+u)}else if(a.type==="booth"){let c=Math.max(a.width,a.height)/2;l(a.center.x-c,a.center.y-c),l(a.center.x+c,a.center.y+c)}else if(a.type==="text"){if(n)continue;let c=Ke(a);l(a.position.x,a.position.y),l(a.position.x+c.width,a.position.y+c.height)}for(let a of[e.referenceImage,e.backgroundImage]){if(!a)continue;let{center:c,width:u}=a;if(!c||!Number.isFinite(c.x)||!Number.isFinite(c.y)||!Number.isFinite(u))continue;let m=u*3/4;l(c.x-u/2,c.y-m/2),l(c.x+u/2,c.y+m/2)}if(!isFinite(i)){let a=e.focalPoint??{x:0,y:0};return{x:a.x-200,y:a.y-200,width:400,height:400}}return{x:i-le,y:o-le,width:r-i+le*2,height:s-o+le*2}}export{lo as a,Nt as b,Fe as c,Lt as d,fo as e,jt as f,ho as g,te as h,me as i,yo as j,bo as k,go as l,xo as m,So as n,Mo as o,Po as p,Eo as q,Io as r,wo as s,Co as t,_o as u,Oo as v,ko as w,Ro as x,To as y,Ke as z,No as A,Lo as B,Yt as C,jo as D,be as E,Vo as F,$e as G,Ho as H,Uo as I,Wt as J,Ze as K,Xo as L,tt as M,qt as N,Bo as O,$o as P,rt as Q,st as R,at as S,en as T,qo as U,tn as V,on as W,Qo as X,sn as Y,Se as Z,Jo as _,ai as $,di as aa,On as ba,ie as ca,fi as da,hi as ea,mi as fa,ei as ga,ti as ha,ni as ia,ct as ja,Q as ka,ve as la,un as ma,ii as na,dn as oa,lt as pa,Me as qa,fn as ra,hn as sa,mn as ta,J as ua,ut as va,ft as wa,gn as xa,mt as ya,bi as za,Tn as Aa,gi as Ba,xi as Ca,Si as Da,Nn as Ea,Mi as Fa,Fn as Ga,Pi as Ha,vi as Ia,Oe as Ja,ee as Ka,Re as La,Wi as Ma,Zn as Na,eo as Oa,to as Pa,_t as Qa,$i as Ra,no as Sa,oo as Ta,Z as Ua,Ie as Va,X as Wa,fe as Xa,qi as Ya,Ot as Za,ro as _a,_e as $a,Qi as ab,so as bb,ao as cb,Ji as db,Zi as eb,er as fb};
@@ -0,0 +1 @@
1
+ import{b as ht,e as V,i as vt,j as St,m as xt,n as Ct,o as $t}from"./chunk-QFX6XSO6.js";import{c as rt,d as bt}from"./chunk-P2BTUNG6.js";import{p as ae,r as It,s as wt,t as ke,x as Ae}from"./chunk-GUNNA5LB.js";import{o as ot}from"./chunk-TFYAMLCK.js";import{A as je,E as pt,a as ft,c as gt,k as $e,l as yt,r as mt}from"./chunk-EE2CVYFJ.js";import{e as q,k as pe,l as be,n as Ke}from"./chunk-URW7MSCJ.js";import{b as H,c as xe,e as st,g as Ce,i as at,k as ct,u as lt}from"./chunk-UKODEMIM.js";import{$ as Xe,$a as G,B as Ve,C as ve,Ma as nt,N as oe,Oa as K,Pa as it,Q as Qe,R as He,Sa as ee,Xa as te,Za as se,aa as We,b as he,e as Ue,ea as qe,fa as Ye,la as re,na as Ie,oa as Y,pa as Z,q as un,qa as J,r as fn,ra as we,s as gn,sa as Se,t as yn,ta as et,u as mn,v as pn,va as tt,w as ze,x as bn,y as hn,z as Ge}from"./chunk-HKVCBUON.js";import{h as Ze,p as Je}from"./chunk-KTMZ3QAO.js";import{a as dt,i as ut,n as _}from"./chunk-JBOTRSMY.js";var Oe=[{key:"row-seats",label:"row seats",suffix:"rows",labelSuffix:"Rows",creationWord:"Seats",objectType:"row"},{key:"table-chairs",label:"table chairs",suffix:"tables",labelSuffix:"Tables",creationWord:"Tables",objectType:"table"},{key:"booth-units",label:"booth units",suffix:"booths",labelSuffix:"Booths",creationWord:"Booths",objectType:"booth"},{key:"ga-capacity",label:"GA capacity",suffix:"ga",labelSuffix:"GA",creationWord:"Standing",objectType:"gaArea"}];function jt(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function vn(e){return Oe.find(n=>n.key===e)}function le(e){let n=new Map,o=Math.max(0,Math.floor(e.seatCount)),i=new Map((e.overrides??[]).filter(r=>Number.isInteger(r.index)&&r.index>=0&&r.index<e.seatCount).map(r=>[r.index,r])),s=(r,d=1)=>{r&&d>0&&n.set(r,(n.get(r)??0)+d)};s(e.categoryKey,o-i.size);for(let r of i.values())r.skip||s(r.categoryKey??e.categoryKey);return n}function In(e){return e.type==="row"||e.type==="table"?[...le(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function kt(e){return Oe.find(n=>n.objectType===e.type)??null}function At(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function ce(e){let n=new Map;for(let s of jt(e))for(let r of s.objects){if(!At(r))continue;let d=kt(r);for(let p of In(r)){let g=n.get(p)??new Map,l=g.get(d.key)??[];if(!l.some(c=>c.id===r.id)){let c=r.displayLabel||r.label||r.id;l.push({id:r.id,label:c,type:d.objectType,floorId:s.id})}g.set(d.key,l),n.set(p,g)}}let o=new Map(e.categories.map(s=>[s.key,s.label]));return[...e.categories.map(s=>s.key),...[...n.keys()].filter(s=>!o.has(s)).sort()].flatMap(s=>{let r=n.get(s);if(!r||r.size<2)return[];let d=Oe.flatMap(p=>{let g=r.get(p.key);return g?.length?[{family:p.key,label:p.label,objectType:p.objectType,targets:g}]:[]});return[{categoryKey:s,categoryLabel:o.get(s)??s,families:d,objectIds:[...new Set(d.flatMap(p=>p.targets.map(g=>g.id)))]}]})}function Ot(e){let n=e.families.map(o=>`${o.label} (${o.targets.map(i=>i.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory: ${n}. Each category can belong to only one kind. Use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function Tt(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function wn(e,n,o){for(let i=1;i<=1e4;i+=1){let s=i===1?`--${n}`:`--${n}-${i}`,d=`${e.slice(0,Math.max(1,160-s.length))}${s}`;if(!o.has(d))return o.add(d),d}throw new Error(`Unable to allocate a category key for ${e} (${n})`)}function Sn(e,n,o){for(let i=1;i<=1e4;i+=1){let s=i===1?` (${n})`:` (${n} ${i})`,d=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-s.length)).trimEnd()}${s}`,p=Tt(d);if(!o.has(p))return o.add(p),d}throw new Error(`Unable to allocate a category label for ${e} (${n})`)}function xn(e,n,o,i){let s=vn(n);return{...structuredClone(e),key:wn(e.key,s.suffix,o),label:Sn(e.label,s.labelSuffix,i)}}function Cn(e,n,o){let i=[];for(let s of jt(e))for(let r of s.objects){if(!At(r))continue;let d=kt(r),p=o.get(d.key);if(!(!p||p===n))if(r.type==="row"||r.type==="table"){let g=[];r.categoryKey===n&&(r.categoryKey=p);for(let l of r.overrides??[])l.categoryKey===n&&(l.categoryKey=p,g.push(l.index));(r.categoryKey===p||g.length)&&i.push({family:d.key,floorId:s.id,objectId:r.id,objectType:d.objectType,fromCategoryKey:n,toCategoryKey:p,...g.length?{seatOverrideIndices:g.sort((l,c)=>l-c)}:{}})}else r.categoryKey===n&&(r.categoryKey=p,i.push({family:d.key,floorId:s.id,objectId:r.id,objectType:d.objectType,fromCategoryKey:n,toCategoryKey:p}))}return i}function Et(e){let n=structuredClone(e),o=ce(n);if(!o.length)return{doc:n,changed:!1,changes:[],before:o,after:o};let i=new Set(n.categories.map(p=>p.key)),s=new Set(n.categories.map(p=>Tt(p.label))),r=[];for(let p of o){let g=n.categories.findIndex(w=>w.key===p.categoryKey);if(g<0)continue;let l=n.categories[g],c=p.families[0].family,y=new Map([[c,l.key]]),m=p.families.slice(1).map(w=>{let C=xn(l,w.family,i,s);return y.set(w.family,C.key),{family:w.family,key:C.key,label:C.label,category:C}});n.categories.splice(g+1,0,...m.map(w=>w.category));let b=Cn(n,l.key,y);r.push({categoryKey:l.key,categoryLabel:l.label,retainedFamily:c,clones:m.map(({family:w,key:C,label:v})=>({family:w,key:C,label:v})),reassignments:b})}n.floors?.length&&(n.objects=n.floors[0].objects);let d=ce(n);return{doc:n,changed:r.length>0,changes:r,before:o,after:d}}function Mt(e){return e.notForSale===!0?!0:e.tiers?.length?e.tiers.every(n=>Number.isFinite(n.price)&&n.price>=0):e.price!=null}function z(e){return e.length>=3&&e.every(n=>Number.isFinite(n.x)&&Number.isFinite(n.y))}function X(e,n,o){let i=(e.y-n.y)*(o.x-n.x)-(e.x-n.x)*(o.y-n.y);if(Math.abs(i)>1e-7)return!1;let s=(e.x-n.x)*(o.x-n.x)+(e.y-n.y)*(o.y-n.y);if(s<-1e-7)return!1;let r=(o.x-n.x)**2+(o.y-n.y)**2;return s<=r+1e-7}function W(e,n){let o=!1;for(let i=0,s=n.length-1;i<n.length;s=i++){let r=n[s],d=n[i];if(X(e,r,d))return!0;r.y>e.y!=d.y>e.y&&e.x<(d.x-r.x)*(e.y-r.y)/(d.y-r.y)+r.x&&(o=!o)}return o}function U(e,n,o){return(n.x-e.x)*(o.y-e.y)-(n.y-e.y)*(o.x-e.x)}function Rt(e,n,o,i){let s=U(e,n,o),r=U(e,n,i),d=U(o,i,e),p=U(o,i,n);return(s>1e-7&&r<-1e-7||s<-1e-7&&r>1e-7)&&(d>1e-7&&p<-1e-7||d<-1e-7&&p>1e-7)?!0:Math.abs(s)<=1e-7&&X(o,e,n)||Math.abs(r)<=1e-7&&X(i,e,n)||Math.abs(d)<=1e-7&&X(e,o,i)||Math.abs(p)<=1e-7&&X(n,o,i)}function Q(e){for(let n=0;n<e.length;n+=1){let o=(n+1)%e.length;for(let i=n+1;i<e.length;i+=1){let s=(i+1)%e.length;if(!(n===i||o===i||s===n)&&Rt(e[n],e[o],e[i],e[s]))return!0}}return!1}function ne(e,n){for(let o=0;o<e.length;o+=1)for(let i=0;i<n.length;i+=1)if(Rt(e[o],e[(o+1)%e.length],n[i],n[(i+1)%n.length]))return!0;return W(e[0],n)||W(n[0],e)}function Ft(e,n){return!n.some((o,i)=>X(e,o,n[(i+1)%n.length]))&&W(e,n)}function Lt(e){let n=e.outlinePath;if(!n?.segments.length)return;let o=r=>Number.isFinite(r.x)&&Number.isFinite(r.y),i=(r,d)=>Math.hypot(r.x-d.x,r.y-d.y);if(!o(n.start))return 0;let s=n.start;for(let r=0;r<n.segments.length;r++){let d=n.segments[r];if(!d||!o(d.end)||i(s,d.end)<=1e-9||d.kind==="bezier"&&(!o(d.control1)||!o(d.control2)))return r;if(d.kind==="arc"){if(!o(d.center)||!Number.isFinite(d.radius)||d.radius<=1e-6)return r;let p=Math.max(1e-4,d.radius*1e-4);if(Math.abs(i(s,d.center)-d.radius)>p||Math.abs(i(d.end,d.center)-d.radius)>p)return r}s=d.end}return i(s,n.start)>1e-4,n.segments.length-1}function $n(e,n,o,i){let s=U(e,n,o),r=U(e,n,i),d=U(o,i,e),p=U(o,i,n);return(s>1e-7&&r<-1e-7||s<-1e-7&&r>1e-7)&&(d>1e-7&&p<-1e-7||d<-1e-7&&p>1e-7)}function Nt(e,n){for(let o=0;o<e.length;o+=1)for(let i=0;i<n.length;i+=1)if($n(e[o],e[(o+1)%e.length],n[i],n[(i+1)%n.length]))return!0;return e.some(o=>Ft(o,n))||n.some(o=>Ft(o,e))}function Pt(e){return e.role!=="reference-focal"||!e.points||!z(e.points)?null:e.points}var Te=(e,n)=>typeof e=="string"&&e===e.normalize("NFKC").trim()&&e.length>=1&&e.length<=n,Ee=e=>e===void 0||typeof e=="boolean";function jn(e){let n=e.gate;if(!n||typeof n!="object")return"has an unreadable gate record";let o=n;return St.includes(o.use)?e.kind==="line"||e.kind==="polyline"?"must be a closed shape":e.role!==Ct(o.use)?"must be an entrance (in, both) or an exit (out)":Te(e.label,40)?o.opens!==void 0&&!Te(o.opens,40)?`must say when it opens in 1 to ${40} characters`:!Ee(o.stepFree)||!Ee(o.hideFromBuyers)?"has a step-free or buyer setting that is not on or off":null:`needs a name of 1 to ${40} characters`:"must be used for in, out or both"}function kn(e){let n=e.route;return!n||typeof n!="object"?"has an unreadable route record":e.kind!=="line"&&e.kind!=="polyline"?"must be a line or path":Te(e.label,40)?Ee(n.stepFree)?null:"has a step-free setting that is not on or off":`needs a name of 1 to ${40} characters`}function Me(e,n,o){let i=G(e).flatMap(r=>r.objects),s=new Set;for(let r of i)if(r.type==="shape"){if(r.gate!==void 0){s.add(r.id);let d=jn(r);d&&n.push({severity:"error",code:"invalid-gate",message:`Gate "${r.label??r.id}" ${d}`,objectId:r.id})}if(r.route!==void 0){let d=kn(r);d&&n.push({severity:"error",code:"invalid-route",message:`Route "${r.label??r.id}" ${d}`,objectId:r.id})}}for(let r of i){if(!xt(r)||r.entranceGateId===void 0)continue;let d=r.entranceGateId;typeof d!="string"||!d.trim()?n.push({severity:"error",code:"invalid-entrance-gate",message:`"${r.label}" has an empty entrance gate`,objectId:r.id}):s.has(d)||o.push({severity:"warning",code:"unknown-entrance-gate",message:`"${r.label}" enters by a gate that is no longer on the map`,objectId:r.id})}}function zt(e,n){if(e.displayLabel!==void 0){let o=e.displayLabel.normalize("NFKC").trim();!(e.type==="row"&&e.displayLabel==="")&&(!o||o!==e.displayLabel||o.length>80)&&n.push({severity:"error",code:"invalid-display-label",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:e.id})}if(e.displayType!==void 0){let o=e.displayType.normalize("NFKC").trim();(!o||o!==e.displayType||o.length>24)&&n.push({severity:"error",code:"invalid-display-type",message:`${e.type==="gaArea"?"GA area":e.type} "${e.label}" must use a normalized buyer type of 1 to 24 characters`,objectId:e.id})}e.type!=="row"&&An(e,n)}var Kt=(e,n)=>typeof e=="string"&&e===e.normalize("NFKC").trim()&&e.length>=1&&e.length<=n;function An(e,n){let o=e.type==="gaArea"?"GA area":e.type==="table"?"Table":"Booth",i=(r,d)=>n.push({severity:"error",code:r,message:`${o} "${e.label}" ${d}`,objectId:e.id});e.entrance!==void 0&&!Kt(e.entrance,40)&&i("invalid-entrance","must use a normalized entrance of 1 to 40 characters");let s=e.labelPresentation;if(s!==void 0){let r=s?.labelStyle?.size,d=r!==void 0&&(!Number.isFinite(r)||r<pe||r>be);(!s||typeof s!="object"||s.visible!==void 0&&typeof s.visible!="boolean"||d)&&i("invalid-label-presentation",`has an invalid name-on-map setting (size ${pe}\u2013${be})`)}if(e.type==="table"){let r=Je(e.chairNumbering);r&&i("invalid-chair-numbering",`has invalid chair numbering: ${r}`)}e.type==="booth"&&(e.boothType!==void 0&&!Ke.includes(e.boothType)&&i("invalid-booth-type","must use inline, corner, peninsula or island as its booth type"),e.commercial!==void 0&&(!e.commercial||typeof e.commercial!="object"||Object.keys(e.commercial).some(r=>r!=="note")||e.commercial.note!==void 0&&!Kt(e.commercial.note,160))&&i("invalid-booth-note","must use a normalized buyer note of 1 to 160 characters"))}function Ut(e,n,o,i){let s=e.crop,r=s&&(!Number.isFinite(s.x)||!Number.isFinite(s.y)||!Number.isFinite(s.width)||!Number.isFinite(s.height)||s.x<0||s.y<0||s.width<=0||s.height<=0||s.x+s.width>1.000001||s.y+s.height>1.000001);(!Number.isFinite(e.center?.x)||!Number.isFinite(e.center?.y)||!Number.isFinite(e.width)||e.width<=0||!Number.isFinite(e.opacity)||e.opacity<0||e.opacity>1||e.rotation!==void 0&&!Number.isFinite(e.rotation)||r)&&o.push({severity:"error",code:"invalid-background-placement",message:`The ${n} image has an invalid position, size, opacity, rotation, or crop`,...i?{floorId:i}:{}})}function Fe(e,n,o,i){let s=e.referenceImage,r=e.backgroundImage;s&&(Ut(s,"reference",n,i),!s.assetId&&!s.url&&n.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...i?{floorId:i}:{}})),r&&(Ut(r,r.assetId?"legacy reference":"buyer background",n,i),!r.assetId&&!r.url&&n.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...i?{floorId:i}:{}}),r.assetId&&o.push({severity:"warning",code:"legacy-reference-background",message:"This legacy asset-backed background is trace-only and will migrate to the private reference layer when edited",...i?{floorId:i}:{}})),ot(e)&&n.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...i?{floorId:i}:{}})}function ie(e){let n=new Set(q.map(o=>o.key));return!e||/^ref_[0-9a-f-]{36}$/.test(e.assetId)&&!!e.logicalSectionId.trim()&&["user-confirmed","authoritative-source"].includes(e.evidence)&&!!e.sourceDescription.trim()&&(e.derivation===void 0||["explicit-inventory","server-synthesized-from-aggregate"].includes(e.derivation))&&(e.aggregateEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.aggregateEvidence))&&(e.derivation!=="server-synthesized-from-aggregate"||e.evidence==="user-confirmed")&&(e.sectionAssignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(e.sectionAssignmentEvidence))&&e.sectionAssignmentEvidence===void 0==!e.sectionAssignmentSourceDescription?.trim()&&(e.sectionAssignmentSourceDescription?.trim().length??0)<=240&&(e.numberingEvidence===void 0||e.numberingEvidence==="user-confirmed")&&e.numberingEvidence===void 0==!e.numberingSourceDescription?.trim()&&(e.numberingSourceDescription?.trim().length??0)<=240&&(!e.accessibility||e.accessibility.placementDerivation==="server-synthesized-row-edges"&&e.accessibility.groupLogicalSectionIds.length>0&&e.accessibility.groupLogicalSectionIds.length<=100&&new Set(e.accessibility.groupLogicalSectionIds).size===e.accessibility.groupLogicalSectionIds.length&&e.accessibility.groupLogicalSectionIds.includes(e.logicalSectionId)&&e.accessibility.groupLogicalSectionIds.every(o=>!!o.trim()&&o.length<=160)&&["user-confirmed","authoritative-source"].includes(e.accessibility.assignmentEvidence)&&!!e.accessibility.assignmentSourceDescription.trim()&&e.accessibility.assignmentSourceDescription.trim().length<=240&&e.accessibility.counts.length>0&&e.accessibility.counts.length<=q.length&&new Set(e.accessibility.counts.map(o=>o.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(o=>n.has(o.type)&&Number.isInteger(o.count)&&o.count>0&&["user-confirmed","authoritative-source"].includes(o.evidence)&&!!o.sourceDescription.trim()&&o.sourceDescription.trim().length<=240))}function Gt(e){let n=e.referenceInventoryExclusion;return!n||typeof n.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(n.assetId)&&n.assetId===e.referenceSource?.assetId&&typeof n.logicalSectionId=="string"&&n.logicalSectionId===(e.logicalSectionId??e.id)&&typeof n.reason=="string"&&!!n.reason.trim()&&n.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(n.evidence)&&typeof n.sourceDescription=="string"&&!!n.sourceDescription.trim()&&n.sourceDescription.trim().length<=240}function Vt(e){let n=e.referenceCategorySource;return!n||/^ref_[0-9a-f-]{36}$/.test(n.assetId)&&/^#[0-9a-f]{6}$/i.test(n.sourceColor)&&(n.sourceColors===void 0||n.sourceColors.length>0&&n.sourceColors.includes(n.sourceColor)&&new Set(n.sourceColors).size===n.sourceColors.length&&n.sourceColors.every(o=>/^#[0-9a-f]{6}$/i.test(o)&&`${o[1]}${o[3]}${o[5]}`.toLowerCase()===`${n.sourceColor[1]}${n.sourceColor[3]}${n.sourceColor[5]}`.toLowerCase()))&&(n.logicalSectionIds===void 0||n.logicalSectionIds.length>0&&new Set(n.logicalSectionIds).size===n.logicalSectionIds.length&&n.logicalSectionIds.every(o=>!!o.trim()&&o.length<=160))&&(n.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(n.assignmentDerivation))&&n.assignmentEvidence===void 0==!n.assignmentSourceDescription?.trim()&&(n.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(n.assignmentEvidence))&&(n.assignmentSourceDescription?.trim().length??0)<=240&&(n.assignmentDerivation!=="confirmed-logical-sections"||n.assignmentEvidence!==void 0&&!!n.assignmentSourceDescription?.trim())&&n.sourcePaletteColor===void 0==(n.sourcePaletteColorEvidence===void 0)&&n.sourcePaletteColorEvidence===void 0==!n.sourcePaletteColorSourceDescription?.trim()&&(n.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(n.sourcePaletteColor))&&(n.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(n.sourcePaletteColorEvidence))&&(n.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(n.labelEvidence)&&!!n.labelSourceDescription.trim()&&n.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(n.priceEvidence)&&!!n.priceSourceDescription.trim()&&n.priceSourceDescription.trim().length<=240&&n.outputColorEvidence===void 0==!n.outputColorSourceDescription?.trim()&&(n.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(n.outputColorEvidence))&&(n.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(n.sourcePaletteColor??n.sourceColor).toLowerCase()&&new Set((n.sourceColors??[n.sourceColor]).map(o=>`${o[1]}${o[3]}${o[5]}`.toLowerCase())).size===1||n.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(n.outputColorEvidence))}function Qt(e){let n=e.referenceDirectSeatImport;return!n||/^ref_[0-9a-f-]{36}$/.test(n.assetId)&&/^source-color:(?:#[0-9a-f]{6}(?:\+#[0-9a-f]{6})*|unclassified)$/i.test(n.familyId)}function Ht(e,n){let o=e.floors?.length?e.floors.map(r=>({id:r.id,objects:r.objects})):[{id:"floor-0",objects:e.objects}],i=new Map,s=new Map;for(let r of o){let d=r.objects.filter(l=>l.type==="row"),p=new Map,g=new Map;for(let l of d){if(l.segmentedRow){let c=p.get(l.segmentedRow.groupId)??[];c.push(l),p.set(l.segmentedRow.groupId,c)}if(l.rowBlockGeneration){let c=g.get(l.rowBlockGeneration.groupId)??[];c.push(l),g.set(l.rowBlockGeneration.groupId,c)}l.segmentedRow&&l.rowBlockGeneration&&n.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${l.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:l.id,floorId:r.id})}for(let[l,c]of p){let y=i.get(l);y&&y!==r.id&&n.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${l}" cannot span multiple floors`,objectId:c[0].id,floorId:r.id}),i.set(l,r.id);let m=c.slice().sort((j,A)=>j.segmentedRow.componentIndex-A.segmentedRow.componentIndex),b=m[0]?.segmentedRow,w=b?.componentCount??0,C=b?JSON.stringify({displayLabel:b.displayLabel,repeatLabelOnComponents:b.repeatLabelOnComponents,displayType:b.displayType,labelPresentation:b.labelPresentation,viewFromSeatUrl:b.viewFromSeatUrl,viewFromSeatMeta:b.viewFromSeatMeta,confidenceEvidence:b.confidenceEvidence,smoothing:b.smoothing}):"";b&&w>=2&&w<=64&&m.length===w&&b.boundaryBefore==="start"&&m.every((j,A)=>{let $=j.segmentedRow;return $.kind==="segmented-row-v1"&&$.groupId===l&&$.componentCount===w&&$.componentIndex===A&&(A===0?$.boundaryBefore==="start":$.boundaryBefore!=="start")&&$.displayLabel.normalize("NFKC").trim()===$.displayLabel&&$.displayLabel.length>0&&$.displayLabel.length<=80&&JSON.stringify({displayLabel:$.displayLabel,repeatLabelOnComponents:$.repeatLabelOnComponents,displayType:$.displayType,labelPresentation:$.labelPresentation,viewFromSeatUrl:$.viewFromSeatUrl,viewFromSeatMeta:$.viewFromSeatMeta,confidenceEvidence:$.confidenceEvidence,smoothing:$.smoothing})===C})||n.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${l}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:c[0]?.id,floorId:r.id})}for(let[l,c]of g){let y=s.get(l);y&&y!==r.id&&n.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:c[0].id,floorId:r.id}),s.set(l,r.id)}}}function Xt(e,n){let o=(r,d)=>n.push({severity:"error",code:r,message:`GA area "${e.label}" ${d}`,objectId:e.id});e.bookAsWhole!==void 0&&typeof e.bookAsWhole!="boolean"&&o("invalid-ga-booking","has an invalid whole-area setting"),e.variableOccupancy!==void 0&&typeof e.variableOccupancy!="boolean"&&o("invalid-ga-booking","has an invalid party-size setting"),e.bookAsWhole===!0&&e.variableOccupancy===!0&&o("invalid-ga-booking","cannot be sold whole and by party size at the same time");let i=at(e);if(i&&e.inventorySegments!==void 0&&o("invalid-ga-booking","was joined from other areas and must be sold per person, not as one box"),i&&e.capacity>Ce&&o("invalid-ga-booking",`is sold to one party but holds ${e.capacity} guests; at most ${Ce} can book in one go`),i&&H(e.label)&&o("reserved-seat-label",`uses SeatLayer's reserved GA namespace for its box label "${e.label}"`),i==="variable"){let r=e.minOccupancy,d=e.maxOccupancy;(!Number.isInteger(r)||!Number.isInteger(d)||r<1||d<r||d>e.capacity)&&o("invalid-ga-occupancy",`needs whole-number fewest and most guests from 1 to its ${e.capacity}-person capacity`)}else(e.minOccupancy!==void 0||e.maxOccupancy!==void 0)&&o("invalid-ga-occupancy","has guest bounds without party-size selling");let s=e.wheelchairPlaces;s!==void 0&&(!Number.isInteger(s)||s<0||s>e.capacity)&&o("invalid-ga-wheelchair-places",`must have from 0 to ${e.capacity} wheelchair places`)}function Wt(e){return e==="m"||e==="ft"}function On(e){return e==="ft"?.3048:1}function de(e,n){return e/On(n)}var Tn=e=>Math.abs(e)<1e-9?0:e;function ue(e,n="m"){let o=Tn(de(e,n)),i=Math.abs(o);return n==="ft"?i<100?`${o.toFixed(1)} ft`:`${Math.round(o)} ft`:i<1?`${o.toFixed(2)} m`:i<100?`${o.toFixed(1)} m`:`${Math.round(o)} m`}var En=.5,Mn=5e3,Fn=e=>typeof e=="number"&&Number.isFinite(e),Rn=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function qt(e){let n=e?.designerSettings;return Rn(n)?n:null}function fe(e){let n=qt(e)?.units;return Wt(n)?n:"m"}function ge(e){let n=qt(e)?.unitsPerMetre;return Fn(n)&&n>=En&&n<=Mn?n:null}function Re(e,n){let o=n/(ge(e)??re),i=fe(e);return i==="ft"&&de(o,"ft")<.1?`${de(o,"ft").toFixed(2)} ft`:ue(o,i)}function Ln(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function Nn(e){let n=[],o=new Map((e.overrides??[]).map(i=>[i.index,i]));for(let i=0;i<e.seatCount;i++){let s=o.get(i);s?.skip||n.push({label:Ze(e,i,s),index:i})}return n}function Yt(e){let n=[],o=new Map((e.overrides??[]).map(i=>[i.index,i]));for(let i=0;i<e.seatCount;i++){let s=o.get(i);s?.skip||n.push({label:s?.label??`${e.label}-${i+1}`,index:i})}return n}function Le(e){return Array.isArray(e)&&e.every(n=>!!n&&typeof n=="object")}function Ne(e){return Array.isArray(e)&&e.every(n=>Array.isArray(n)&&n.every(o=>!!o&&typeof o=="object"))}function Zt(e,n={}){let o=n.maxInventory??1e5,i=[];e.floorOverview!==void 0&&e.floorOverview!=="combined"&&e.floorOverview!=="separated"&&i.push({severity:"error",code:"invalid-floor-overview",message:"Whole venue view must be Combined plan or Separate levels"}),e.eventConfigurationId!==void 0&&(typeof e.eventConfigurationId!="string"||e.eventConfigurationId.normalize("NFKC").trim()!==e.eventConfigurationId||e.eventConfigurationId.length<1||e.eventConfigurationId.length>100)&&i.push({severity:"error",code:"invalid-event-configuration",message:"Active event configuration must contain 1 to 100 normalized characters"});let s=[],r=new Set(e.categories.map(t=>t.key)),d=new Set(q.map(t=>t.key)),p=new Map(e.categories.map(t=>[t.key,Mt(t)])),g=new Set;Fe(e,i,s),Me(e,i,s),e.theme?.sectionDetail!==void 0&&!["rows","seats"].includes(e.theme.sectionDetail)&&i.push({severity:"error",code:"invalid-section-detail",message:"Section detail must be rows or seats"}),e.theme?.logoUrl!==void 0&&!he(e.theme.logoUrl)&&i.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let l=he,c=(t,x,a,u={})=>{if(x===void 0)return;if(!x||typeof x!="object"||Array.isArray(x)){i.push({severity:"error",code:"invalid-seat-view-metadata",message:`${a} view metadata is invalid`,...u});return}let f=x;t||s.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${a} view metadata has no image`,...u});let I=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);f.projection!==void 0&&f.projection!=="equirectangular"&&i.push({severity:"error",code:"invalid-seat-view-projection",message:`${a} view projection must be equirectangular`,...u}),f.coverage!==void 0&&!I.has(f.coverage)&&i.push({severity:"error",code:"invalid-seat-view-coverage",message:`${a} view coverage is invalid`,...u});let h=(S,k,O)=>typeof S=="number"&&Number.isFinite(S)&&S>=k&&S<=O;if(f.initialBearingDeg!==void 0&&!h(f.initialBearingDeg,-360,360)&&i.push({severity:"error",code:"invalid-seat-view-bearing",message:`${a} view bearing must be between -360\xB0 and 360\xB0`,...u}),f.initialPitchDeg!==void 0&&!h(f.initialPitchDeg,-90,90)&&i.push({severity:"error",code:"invalid-seat-view-pitch",message:`${a} view pitch must be between -90\xB0 and 90\xB0`,...u}),f.capturedAt!==void 0&&(typeof f.capturedAt!="string"||f.capturedAt.length>40||!Number.isFinite(Date.parse(f.capturedAt)))&&i.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${a} view capture date is invalid`,...u}),f.sourceLabel!==void 0&&(typeof f.sourceLabel!="string"||f.sourceLabel.trim().length>100)&&i.push({severity:"error",code:"invalid-seat-view-source",message:`${a} view source label is invalid`,...u}),f.previewUrl!==void 0&&!l(f.previewUrl)&&i.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${a} view preview URL is invalid`,...u}),f.variants!==void 0){let S=Array.isArray(f.variants)?f.variants:[];if(!Array.isArray(f.variants)||S.length<1||S.length>4)i.push({severity:"error",code:"invalid-seat-view-variants",message:`${a} view variants must contain between 1 and 4 tiers`,...u});else{let k=new Set;for(let O of S){if(!O||typeof O!="object"||!l(O.url)||!Number.isInteger(O.width)||O.width<1||O.width>12e3||!Number.isInteger(O.height)||O.height<1||O.height>12e3||O.width!==O.height*2||typeof O.sha256!="string"||!/^[a-f0-9]{64}$/.test(O.sha256)||k.has(O.width)){i.push({severity:"error",code:"invalid-seat-view-variant",message:`${a} view variant is not a unique immutable 2:1 equirectangular tier`,...u});break}k.add(O.width)}}}for(let[S,k]of[["width",f.sourceWidth],["height",f.sourceHeight],["preview width",f.previewWidth],["preview height",f.previewHeight]])k!==void 0&&(!Number.isInteger(k)||k<1||k>32768)&&i.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${a} view source ${S} is invalid`,...u});f.captureEyeHeightM!==void 0&&!h(f.captureEyeHeightM,.5,3)&&i.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${a} capture eye height must be between 0.5 m and 3 m`,...u}),f.eventConfigurationId!==void 0&&(typeof f.eventConfigurationId!="string"||!f.eventConfigurationId.trim()||f.eventConfigurationId.length>100)&&i.push({severity:"error",code:"invalid-seat-view-configuration",message:`${a} event configuration id is invalid`,...u}),f.eventConfigurationVersion!==void 0&&(!Number.isInteger(f.eventConfigurationVersion)||f.eventConfigurationVersion<1)&&i.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${a} event configuration version is invalid`,...u}),f.eventConfigurationVersion!==void 0&&!f.eventConfigurationId&&i.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${a} event configuration version requires an id`,...u})},y=(t,x,a={})=>{if(t===void 0)return;let u=k=>{i.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${x} confidence evidence ${k}`,...a})};if(!t||typeof t!="object"||Array.isArray(t)){u("is invalid");return}let f=t;f.schema!=="seatlayer.seat-confidence/1"&&u("has an unsupported schema");let I=(k,O)=>typeof k=="string"&&k.normalize("NFKC").trim()===k&&k.length>0&&k.length<=O;I(f.evidenceId,120)||u("has an invalid evidence id"),I(f.modelVersion,120)||u("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(f.evidenceKind)||u("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(f.modelLevel)||u("has an invalid model level");let h=f.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(h)||u("has an invalid reality level"),f.eventConfigurationId!==void 0&&!I(f.eventConfigurationId,100)&&u("has an invalid event configuration id"),f.eventConfigurationVersion!==void 0&&(!Number.isInteger(f.eventConfigurationVersion)||f.eventConfigurationVersion<1)&&u("has an invalid event configuration version"),f.status!==void 0&&!new Set(["draft","approved","retracted"]).has(f.status)&&u("has an invalid publication status"),f.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(f.basisSha256)&&u("has an invalid venue basis SHA-256"),f.basisSha256!==void 0&&f.status!=="approved"&&u("can carry a venue basis SHA-256 only after approval");for(let[k,O]of[["assessment",f.assessedAt],["expiry",f.validUntil]])O!==void 0&&(!I(O,40)||!Number.isFinite(Date.parse(O)))&&u(`has an invalid ${k} date`);f.approvedByRole!==void 0&&!I(f.approvedByRole,100)&&u("has an invalid approving organization or role"),f.sourceLabel!==void 0&&!I(f.sourceLabel,120)&&u("has an invalid source label"),f.limitations!==void 0&&(!Array.isArray(f.limitations)||f.limitations.length>6||f.limitations.some(k=>!I(k,160)))&&u("has invalid limitations"),f.evidenceKind==="synthetic-model"&&(f.modelLevel!=="generated"||h!=="none")&&u("cannot describe synthetic data as verified or reality checked"),f.modelLevel!=="generated"&&(!f.assessedAt||!f.approvedByRole)&&u("requires an assessment date and approving organization or role for verified model levels"),f.modelLevel==="configuration-verified"&&!f.eventConfigurationId&&u("requires an event configuration id for configuration verification"),h!=="none"&&(!f.assessedAt||!f.sourceLabel)&&u("requires an assessment date and source for reality evidence"),h==="actual-build-checked"&&(f.modelLevel!=="configuration-verified"||!f.eventConfigurationId)&&u("requires a configuration-verified model and event configuration for an actual-build check");let S=f.modeledTarget;S!==void 0&&(!S||typeof S!="object"||Array.isArray(S)?u("has an invalid modeled target"):((!I(S.label,80)||!I(S.methodLabel,100))&&u("has invalid modeled-target labels"),(!Number.isInteger(S.totalRayCount)||S.totalRayCount<1||S.totalRayCount>1e3||!Number.isInteger(S.clearRayCount)||S.clearRayCount<0||S.clearRayCount>S.totalRayCount)&&u("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(S.classification)||u("has an invalid modeled-target classification"),S.occluderLabels!==void 0&&(!Array.isArray(S.occluderLabels)||S.occluderLabels.length>10||S.occluderLabels.some(k=>!I(k,100)))&&u("has invalid modeled-target occluders")))};c(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),y(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!l(e.viewFromSeatUrl)&&i.push({severity:"error",code:"invalid-venue-view-url",message:"The whole-venue view-from-seat image URL is invalid"});for(let t of e.floors??[])t.viewFromSeatUrl!==void 0&&!l(t.viewFromSeatUrl)&&i.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${t.name}" has an invalid view-from-seat image URL`}),c(t.viewFromSeatUrl,t.viewFromSeatMeta,`Floor "${t.name}"`,{floorId:t.id}),y(t.confidenceEvidence,`Floor "${t.name}"`,{floorId:t.id});let m=e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects;for(let t of m)if((t.type==="row"||t.type==="section")&&(t.viewFromSeatUrl!==void 0&&!l(t.viewFromSeatUrl)&&i.push({severity:"error",code:t.type==="row"?"invalid-row-view-url":"invalid-section-view-url",message:`${t.type==="row"?"Row":"Section"} "${t.label}" has an invalid view-from-seat image URL`,objectId:t.id}),c(t.viewFromSeatUrl,t.viewFromSeatMeta,`${t.type==="row"?"Row":"Section"} "${t.label}"`,{objectId:t.id}),y(t.confidenceEvidence,`${t.type==="row"?"Row":"Section"} "${t.label}"`,{objectId:t.id})),t.type==="row"&&t.segmentedRow&&(t.segmentedRow.viewFromSeatUrl!==void 0&&!l(t.segmentedRow.viewFromSeatUrl)&&i.push({severity:"error",code:"invalid-segmented-row-view-url",message:`Segmented row "${t.segmentedRow.displayLabel}" has an invalid view-from-seat image URL`,objectId:t.id}),c(t.segmentedRow.viewFromSeatUrl,t.segmentedRow.viewFromSeatMeta,`Segmented row "${t.segmentedRow.displayLabel}"`,{objectId:t.id}),y(t.segmentedRow.confidenceEvidence,`Segmented row "${t.segmentedRow.displayLabel}"`,{objectId:t.id})),t.type==="row"||t.type==="table")for(let x of t.overrides??[])x.viewFromSeatUrl!==void 0&&!l(x.viewFromSeatUrl)&&i.push({severity:"error",code:"invalid-seat-view-url",message:`Seat ${x.index+1} has an invalid view-from-seat image URL`,objectId:t.id,seatIndices:[x.index]}),c(x.viewFromSeatUrl,x.viewFromSeatMeta,`Seat ${x.index+1}`,{objectId:t.id,seatIndices:[x.index]}),y(x.confidenceEvidence,`Seat ${x.index+1}`,{objectId:t.id,seatIndices:[x.index]});let b=new Set;for(let t of e.categories){b.has(t.key)&&i.push({severity:"error",code:"duplicate-category-key",message:`Category key "${t.key}" is used more than once`,categoryKey:t.key}),b.add(t.key);let x=new Set;for(let a of t.tiers??[]){if(x.has(a.id)&&i.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${a.id}" is used more than once in category "${t.key}"`,categoryKey:t.key}),a.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(a.restriction)&&i.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${a.name}" has an unknown restriction`,categoryKey:t.key}),a.buyerMessage!=null&&(!a.buyerMessage.trim()||a.buyerMessage.length>240)&&i.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${a.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:t.key}),a.currency!=null&&!/^[A-Z]{3}$/.test(a.currency)&&i.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${a.name}" must use a three-letter ISO currency`,categoryKey:t.key}),a.applicability!=null){let u=a.applicability.seatLabels,f=a.applicability.accessibility;(u!==void 0&&(!Array.isArray(u)||!u.length||u.length>1e4||u.some(I=>typeof I!="string"||!I.trim()||I.length>160)||new Set(u).size!==u.length)||f!==void 0&&(!Array.isArray(f)||!f.length||f.some(I=>!d.has(I))||new Set(f).size!==f.length))&&i.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${a.name}" has invalid seat applicability`,categoryKey:t.key})}a.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(a.evidence.provenance)||!a.evidence.sourceDescription.trim()||a.evidence.sourceDescription.length>240||a.evidence.capturedAt!==void 0&&(a.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(a.evidence.capturedAt))))&&i.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${a.name}" has invalid evidence provenance`,categoryKey:t.key}),x.add(a.id)}Vt(t)||i.push({severity:"error",code:"invalid-reference-category-source",message:`Category ${t.label||t.key} has incomplete or invalid reference evidence`,categoryKey:t.key}),Qt(t)||i.push({severity:"error",code:"invalid-reference-direct-seat-import",message:`Category ${t.label||t.key} has invalid direct-seat import provenance`,categoryKey:t.key})}let w=new Map,C=new Map,v=[],j=new Map,A=0,$=0,R=new Set;for(let t of e.floors??[])Fe(t,i,s,t.id),R.has(t.id)&&i.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${t.id}" is used more than once`,floorId:t.id}),R.add(t.id),t.baseHeightM!==void 0&&(!Number.isFinite(t.baseHeightM)||t.baseHeightM<Z||t.baseHeightM>J)&&i.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${t.name}" base height must be between ${Z} and ${J} metres`,floorId:t.id});let N=e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects;Ht(e,i);let E=new Set;for(let t of N)E.has(t.id)&&i.push({severity:"error",code:"duplicate-object-id",message:`Object id "${t.id}" is used more than once`,objectId:t.id}),E.add(t.id);let P=new Set;for(let t of e.zones??[])P.has(t.id)&&i.push({severity:"error",code:"duplicate-zone-id",message:`Zone id "${t.id}" is used more than once`}),P.add(t.id),t.focalPoint!==void 0&&(!Number.isFinite(t.focalPoint.x)||!Number.isFinite(t.focalPoint.y))&&i.push({severity:"error",code:"invalid-zone-focal-point",message:`Zone "${t.label}" must use a finite focal point`});let L=new Map;for(let t of N)if(!(t.type!=="section"||!t.zone)){if(e.zones?.length&&!P.has(t.zone)){i.push({severity:"error",code:"unknown-section-zone",message:`Section "${t.displayLabel??t.label}" references unknown zone "${t.zone}"`,objectId:t.id});continue}L.has(t.zone)||L.set(t.zone,t)}for(let[t,x]of L){let a=e.zones?.find(u=>u.id===t);a&&(a?.focalPoint||s.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${a?.label??t}" uses the legacy floor focal; set its own focal point before publishing`,objectId:x.id}))}for(let t of N)if((t.type==="row"||t.type==="table"||t.type==="booth"||t.type==="gaArea")&&zt(t,i),Ln(t)){if(A++,$+=t.type==="booth"?1:t.type==="row"?nt(t):t.bookAsWhole||t.variableOccupancy?t.seatCount:Yt(t).length,w.get(t.label)!==void 0?t.type!=="row"&&i.push({severity:"error",code:"duplicate-object-label",message:`Label "${t.label}" is used by more than one object`,objectId:t.id}):w.set(t.label,t.id),r.has(t.categoryKey)?g.add(t.categoryKey):i.push({severity:"error",code:"unknown-category",message:`"${t.label}" references unknown category "${t.categoryKey}"`,objectId:t.id,categoryKey:t.categoryKey}),t.type==="row"){ie(t.referenceInventorySource)||i.push({severity:"error",code:"invalid-reference-inventory-source",message:`Row "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),t.seatCount<1&&i.push({severity:"error",code:"empty-row",message:`Row "${t.label}" has no seats`,objectId:t.id}),t.aisleSeats!==void 0&&!bt(t.aisleSeats)&&i.push({severity:"error",code:"invalid-row-aisle-seats",message:`Row "${t.label}" must mark its aisle seats at the start, end, both or none`,objectId:t.id});let a=new Set;for(let u of t.overrides??[]){(u.accessibility??[]).filter(S=>!d.has(S)).length&&i.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${t.label}" seat ${u.index+1} uses an unknown accessibility type`,objectId:t.id,seatIndices:[u.index]}),(!Number.isInteger(u.index)||u.index<0||u.index>=t.seatCount||a.has(u.index))&&i.push({severity:"error",code:"invalid-seat-override",message:`Row "${t.label}" has a duplicated or out-of-range seat override`,objectId:t.id,...Number.isInteger(u.index)?{seatIndices:[u.index]}:{}}),a.add(u.index);let I=u.wheelchairSpaceType,h=u.accessible===!0||u.accessibility?.includes("wheelchair");I!==void 0&&I!=="seat-present"&&I!=="no-seat"?i.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${t.label}" seat ${u.index+1} has an invalid wheelchair-space type`,objectId:t.id,seatIndices:[u.index]}):I&&(!h||u.skip)&&i.push({severity:"error",code:"invalid-wheelchair-space",message:u.skip?`Row "${t.label}" seat ${u.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${t.label}" seat ${u.index+1} must include wheelchair accessibility for its physical-space type`,objectId:t.id,seatIndices:[u.index]})}for(let u of Nn(t))H(u.label)&&i.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${u.label}" uses SeatLayer's reserved GA namespace`,objectId:t.id,seatIndices:[u.index]}),C.get(u.label)!==void 0?v.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${u.label}" is used more than once`,objectId:t.id,seatIndices:[u.index]}):C.set(u.label,t.id)}else if(t.type==="table"){let a=t.bookAsWhole===!0||t.variableOccupancy===!0;if(t.fill!==void 0&&!dt(t.fill)&&i.push({severity:"error",code:"invalid-table-fill",message:`Table "${t.label}" has an invalid surface color`,objectId:t.id}),t.automaticRadius!==void 0&&typeof t.automaticRadius!="boolean"?i.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${t.label}" has an invalid automatic-radius setting`,objectId:t.id}):t.automaticRadius===!0&&(t.shape!=="round"||t.radius!==rt(t.seatCount,t.seatArc))&&i.push({severity:"error",code:"invalid-table-automatic-radius",message:`Table "${t.label}" needs a radius that matches its automatic chair spacing`,objectId:t.id}),t.seatCountsBySide){let h=["top","bottom","left","right"],S=Object.keys(t.seatCountsBySide),k=h.every(B=>Number.isInteger(t.seatCountsBySide[B])&&t.seatCountsBySide[B]>=0&&t.seatCountsBySide[B]<=40),O=k?h.reduce((B,dn)=>B+t.seatCountsBySide[dn],0):Number.NaN;(t.shape!=="rect"||S.length!==h.length||S.some(B=>!h.includes(B))||!k||O!==t.seatCount||O<1||O>40)&&i.push({severity:"error",code:"invalid-table-side-counts",message:`Table "${t.label}" needs top, bottom, left, and right whole-number chair counts totaling its ${t.seatCount}-chair capacity`,objectId:t.id})}a&&t.overrides?.length&&i.push({severity:"error",code:"grouped-table-chair-overrides",message:`Grouped table "${t.label}" cannot carry individual-chair overrides`,objectId:t.id,seatIndices:t.overrides.map(h=>h.index)});let u=new Set;for(let h of t.overrides??[]){(h.accessibility??[]).filter(B=>!d.has(B)).length&&i.push({severity:"error",code:"invalid-accessibility-type",message:`Table "${t.label}" chair ${h.index+1} uses an unknown accessibility type`,objectId:t.id,seatIndices:[h.index]}),(!Number.isInteger(h.index)||h.index<0||h.index>=t.seatCount||u.has(h.index))&&i.push({severity:"error",code:"invalid-seat-override",message:`Table "${t.label}" has a duplicated or out-of-range chair override`,objectId:t.id,...Number.isInteger(h.index)?{seatIndices:[h.index]}:{}}),u.add(h.index),h.categoryKey&&!r.has(h.categoryKey)?i.push({severity:"error",code:"unknown-category",message:`Table "${t.label}" chair ${h.index+1} references unknown category "${h.categoryKey}"`,objectId:t.id,seatIndices:[h.index],categoryKey:h.categoryKey}):h.categoryKey&&g.add(h.categoryKey);let k=h.wheelchairSpaceType,O=h.accessible===!0||h.accessibility?.includes("wheelchair");k!==void 0&&k!=="seat-present"&&k!=="no-seat"?i.push({severity:"error",code:"invalid-wheelchair-space",message:`Table "${t.label}" chair ${h.index+1} has an invalid wheelchair-space type`,objectId:t.id,seatIndices:[h.index]}):k&&(!O||h.skip)&&i.push({severity:"error",code:"invalid-wheelchair-space",message:h.skip?`Table "${t.label}" chair ${h.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Table "${t.label}" chair ${h.index+1} must include wheelchair accessibility for its physical-space type`,objectId:t.id,seatIndices:[h.index]})}t.bookAsWhole&&t.variableOccupancy?i.push({severity:"error",code:"invalid-table-booking-mode",message:`Table "${t.label}" cannot be sold both as a whole table and with variable occupancy`,objectId:t.id}):t.variableOccupancy?(!Number.isInteger(t.minOccupancy)||!Number.isInteger(t.maxOccupancy)||t.minOccupancy<1||t.maxOccupancy<t.minOccupancy||t.maxOccupancy>t.seatCount)&&i.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${t.label}" needs whole-number minimum and maximum guests from 1 to its ${t.seatCount}-chair capacity`,objectId:t.id}):(t.minOccupancy!=null||t.maxOccupancy!=null)&&i.push({severity:"error",code:"invalid-table-occupancy",message:`Table "${t.label}" has guest bounds without variable-occupancy selling`,objectId:t.id}),ie(t.referenceInventorySource)||i.push({severity:"error",code:"invalid-reference-inventory-source",message:`Table "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),(t.shape==="round"&&t.radius==null||t.shape==="rect"&&(t.width==null||t.height==null)||t.seatCount<1)&&i.push({severity:"error",code:"bad-table",message:`Table "${t.label}" is missing required dimensions or seats`,objectId:t.id});let I=a?[{label:t.label,index:void 0}]:Yt(t);for(let h of I)H(h.label)&&i.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${h.label}" uses SeatLayer's reserved GA namespace`,objectId:t.id}),C.get(h.label)!==void 0?v.push({severity:"error",code:"duplicate-seat-label",message:`Inventory label "${h.label}" is used more than once; grouped table labels must be unique`,objectId:t.id,...h.index===void 0?{}:{seatIndices:[h.index]}}):C.set(h.label,t.id)}else if(t.type==="booth"){ie(t.referenceInventorySource)||i.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${t.label}" has invalid reference-inventory provenance`,objectId:t.id});let a=t.label;H(a)&&i.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${a}" uses SeatLayer's reserved GA namespace`,objectId:t.id}),C.get(a)!==void 0?v.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${a}" is used more than once`,objectId:t.id}):C.set(a,t.id)}}else if(t.type==="gaArea"){if(Xt(t,i),!st(t))i.push({severity:"error",code:"invalid-ga-inventory-segments",message:`GA area "${t.label}" has invalid joined-area inventory provenance`,objectId:t.id});else for(let u of ct(t))C.get(u)!==void 0?v.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${u}" is used more than once`,objectId:t.id}):C.set(u,t.id);if(ie(t.referenceInventorySource)||i.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),!Le(t.points)){i.push({severity:"error",code:"invalid-polygon-points",message:`GA area "${t.label}" outline must be a list of points`,objectId:t.id});continue}(!z(t.points)||Math.abs(V(t.points))<=1e-7||Q(t.points))&&i.push({severity:"error",code:"invalid-ga-outline",message:`GA area "${t.label}" must have a finite, non-self-intersecting polygon outline`,objectId:t.id});let a=t.holes??[];if(!Ne(a))i.push({severity:"error",code:"invalid-hole-collection",message:`GA area "${t.label}" cutouts must be a list of point lists`,objectId:t.id});else{let u=a.length<=64?a.findIndex(f=>f.length>512||!z(f)||Math.abs(V(f))<=1e-7||Q(f)?!0:!f.flatMap((h,S)=>{let k=f[(S+1)%f.length];return[h,{x:(h.x+k.x)/2,y:(h.y+k.y)/2}]}).every(h=>W(h,t.points))):0;if(u>=0)i.push({severity:"error",code:"invalid-ga-hole",message:`GA area "${t.label}" has a cutout outside its outline or with invalid geometry`,objectId:t.id,holeIndex:u});else if(a.some((f,I)=>a.slice(I+1).some(h=>ne(f,h)))){let f=a.findIndex((I,h)=>a.slice(h+1).some(S=>ne(I,S)));i.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${t.label}" has overlapping cutout polygons`,objectId:t.id,holeIndex:f})}}r.has(t.categoryKey)?g.add(t.categoryKey):i.push({severity:"error",code:"unknown-category",message:`"${t.label}" references unknown category "${t.categoryKey}"`,objectId:t.id,categoryKey:t.categoryKey}),t.capacity<1&&i.push({severity:"error",code:"empty-ga",message:`GA area "${t.label}" has zero capacity`,objectId:t.id}),(!Number.isInteger(t.capacity)||t.capacity>xe)&&i.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${t.label}" capacity must be a whole number from 1 to ${xe}`,objectId:t.id}),A++,$+=Math.max(0,Math.floor(t.capacity))}else if(t.type==="section"){if(t.displayLabel!==void 0){let u=t.displayLabel.normalize("NFKC").trim();u?(u!==t.displayLabel||u.length>80)&&i.push({severity:"error",code:"invalid-display-label",message:`Section "${t.label}" must use a normalized buyer label of 1 to 80 characters`,objectId:t.id}):i.push({severity:"error",code:"unnamed-section",message:`${t.label} has no buyer name`,objectId:t.id})}if(t.editor?.defaultCategoryKey&&!r.has(t.editor.defaultCategoryKey)&&i.push({severity:"error",code:"unknown-category",message:`Section "${t.label}" references unknown future-seat category "${t.editor.defaultCategoryKey}"`,objectId:t.id}),t.elevation!==void 0&&(!Number.isInteger(t.elevation)||t.elevation<Ie||t.elevation>Y)){let u=Number.isInteger(t.elevation)&&t.elevation>Y&&t.elevation<=et;s.push({severity:"warning",code:u?"legacy-section-elevation":"invalid-section-elevation",message:u?`Section "${t.label}" uses legacy tier ${t.elevation}; set an exact height before normalizing it to tier ${Y}`:`Section "${t.label}" elevation must be a whole-number tier from ${Ie} to ${Y}`,objectId:t.id})}if(t.height!==void 0&&(!Number.isFinite(t.height)||t.height<Z||t.height>J)&&i.push({severity:"error",code:"invalid-section-height",message:`Section "${t.label}" exact height must be between ${Z} and ${J} metres`,objectId:t.id}),t.rake!==void 0&&(!Number.isFinite(t.rake)||t.rake<we||t.rake>Se)&&i.push({severity:"error",code:"invalid-section-rake",message:`Section "${t.label}" rake must be between ${we}\xB0 and ${Se}\xB0`,objectId:t.id}),t.surfaceKind!==void 0&&t.surfaceKind!=="flat"&&t.surfaceKind!=="rakedRows"&&i.push({severity:"error",code:"invalid-section-surface-kind",message:`Section "${t.label}" surfaceKind must be 'flat' or 'rakedRows'`,objectId:t.id}),!Le(t.outline)){i.push({severity:"error",code:"invalid-polygon-points",message:`Section "${t.label}" outline must be a list of points`,objectId:t.id});continue}if(!z(t.outline)||Math.abs(V(t.outline))<=1e-7||Q(t.outline)){i.push({severity:"error",code:"invalid-section-outline",message:`Section "${t.label}" must have a finite, non-self-intersecting polygon outline`,objectId:t.id});continue}if(t.outlinePath){let u=[];try{u=He(t.outlinePath)}catch{}(!Qe(t.outlinePath)||!u.length||Math.hypot(t.outlinePath.start.x-t.outline[0].x,t.outlinePath.start.y-t.outline[0].y)>1e-4||!z(u)||Math.abs(V(u))<=1e-7||Q(u))&&i.push({severity:"error",code:"invalid-section-outline-path",message:`Section "${t.label}" has an invalid or inconsistent curved outline path`,objectId:t.id,edgeIndex:Lt(t)})}if(t.referenceSource&&(!/^ref_[0-9a-f-]{36}$/.test(t.referenceSource.assetId)||!/^(?:reg|ai)_[0-9a-f]{16}$/.test(t.referenceSource.regionId))&&i.push({severity:"error",code:"invalid-section-reference-source",message:`Section "${t.label}" has invalid opaque reference provenance`,objectId:t.id}),Gt(t)||i.push({severity:"error",code:"invalid-section-inventory-exclusion",message:`Section "${t.label}" has incomplete or mismatched non-sellable evidence`,objectId:t.id}),t.logicalSectionId!==void 0&&!t.logicalSectionId.trim())i.push({severity:"error",code:"invalid-logical-section-id",message:`Section "${t.label}" has an empty logical section id`,objectId:t.id});else if(t.logicalSectionId){let u=JSON.stringify({displayLabel:t.displayLabel??null,entrance:t.entrance??null,viewFromSeatUrl:t.viewFromSeatUrl??null,viewFromSeatMeta:t.viewFromSeatMeta??null,confidenceEvidence:t.confidenceEvidence??null,zone:t.zone??null,labelStyle:t.labelPresentation?.labelStyle??null,labelVisible:t.labelPresentation?.visible!==!1}),f=j.get(t.logicalSectionId);f&&(f.label!==t.label||f.semanticSignature!==u)?i.push({severity:"error",code:"inconsistent-logical-section",message:`Logical section "${t.logicalSectionId}" must use one technical label and buyer-facing presentation across every component`,objectId:t.id}):f||j.set(t.logicalSectionId,{label:t.label,semanticSignature:u})}let x=t.holes??[];if(!Ne(x)){i.push({severity:"error",code:"invalid-hole-collection",message:`Section "${t.label}" openings must be a list of point lists`,objectId:t.id});continue}if(x.length>64){i.push({severity:"error",code:"invalid-section-hole",message:`Section "${t.label}" has an invalid opening collection`,objectId:t.id});continue}let a=-1;for(let u=0;u<x.length;u++){let f=x[u];if(f.length>512||!z(f)||Math.abs(V(f))<=1e-7||Q(f)){a=u;break}if(!f.flatMap((h,S)=>{let k=f[(S+1)%f.length];return[h,{x:(h.x+k.x)/2,y:(h.y+k.y)/2}]}).every(h=>W(h,t.outline))){a=u;break}}if(a>=0)i.push({severity:"error",code:"invalid-section-hole",message:`Section "${t.label}" has an opening outside its outline or with an invalid shape`,objectId:t.id,holeIndex:a});else if(x.some((u,f)=>x.slice(f+1).some(I=>ne(u,I)))){let u=x.findIndex((f,I)=>x.slice(I+1).some(h=>ne(f,h)));i.push({severity:"error",code:"overlapping-section-holes",message:`Section "${t.label}" has overlapping openings`,objectId:t.id,holeIndex:u})}}let D=e.floors?.length?e.floors.map(t=>t.objects):[e.objects];for(let t of D){let x=t.filter(a=>a.type==="section");for(let a of t.filter(u=>u.type==="text")){let u=a.iconKey;u!==void 0&&!ae(u)&&i.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${a.text||a.id}" references an unknown symbol`,objectId:a.id});let f=a.fontFamily;f!==void 0&&(typeof f!="string"||f.normalize("NFKC").trim()!==f||f.length<1||f.length>120)&&i.push({severity:"error",code:"invalid-text-font-family",message:`Text "${a.text||a.id}" font family must contain 1 to 120 normalized characters`,objectId:a.id});let I=a.background;(a.width!==void 0&&(!Number.isFinite(a.width)||a.width<40||a.width>1200)||a.align!==void 0&&!["left","center","right"].includes(a.align)||a.lineHeight!==void 0&&(!Number.isFinite(a.lineHeight)||a.lineHeight<.8||a.lineHeight>3)||a.letterSpacing!==void 0&&(!Number.isFinite(a.letterSpacing)||a.letterSpacing<-2||a.letterSpacing>20)||a.opacity!==void 0&&(!Number.isFinite(a.opacity)||a.opacity<.1||a.opacity>1)||I!==void 0&&(!/^#[0-9a-f]{6}$/i.test(I.color)||I.padding!==void 0&&(!Number.isFinite(I.padding)||I.padding<0||I.padding>40)||I.cornerRadius!==void 0&&(!Number.isFinite(I.cornerRadius)||I.cornerRadius<0||I.cornerRadius>40)||I.opacity!==void 0&&(!Number.isFinite(I.opacity)||I.opacity<.1||I.opacity>1)))&&i.push({severity:"error",code:"invalid-text-layout",message:`Text "${a.text||a.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:a.id})}for(let a of t.filter(u=>u.type==="shape")){if(a.eventConfigurationIds!==void 0){let I=a.eventConfigurationIds;Array.isArray(I)&&I.length>0&&I.length<=20&&I.every(S=>typeof S=="string"&&S.normalize("NFKC").trim()===S&&S.length>=1&&S.length<=100)&&new Set(I).size===I.length||i.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${a.label||a.id}" must reference 1 to 20 unique event configuration ids`,objectId:a.id})}if(a.heightM!==void 0&&(!Number.isFinite(a.heightM)||a.heightM<.05||a.heightM>50)&&i.push({severity:"error",code:"invalid-shape-height",message:`Shape "${a.label||a.id}" height must be between 0.05 m and 50 m`,objectId:a.id}),a.stroke!==void 0&&(!a.stroke||typeof a.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(a.stroke.color)||!Number.isFinite(a.stroke.width)||a.stroke.width<.5||a.stroke.width>40)&&i.push({severity:"error",code:"invalid-shape-stroke",objectId:a.id,message:`Shape "${a.label||a.id}" stroke must use a six-digit colour and a width from ${Re(e,.5)} to ${Re(e,40)}`}),(a.lineCap!==void 0||a.lineJoin!==void 0||a.startEnding!==void 0||a.endEnding!==void 0)&&!Ae(a.kind)?i.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${a.label||a.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:a.id}):Ae(a.kind)&&(a.lineCap!==void 0&&!It.includes(a.lineCap)||a.lineJoin!==void 0&&!wt.includes(a.lineJoin)||a.startEnding!==void 0&&!ke.includes(a.startEnding)||a.endEnding!==void 0&&!ke.includes(a.endEnding))&&i.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${a.label||a.id}" has an unsupported line cap, join, or ending`,objectId:a.id}),a.points!==void 0&&!Le(a.points)){i.push({severity:"error",code:"invalid-polygon-points",message:`Shape "${a.label||a.id}" points must be a list of points`,objectId:a.id});continue}if(a.kind==="polygon"){let I=Xe(a.points??[]);if(!I.ok)i.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${a.label||a.id}" has invalid polygon geometry: ${I.message}`,objectId:a.id});else{let h=Pn(a);h&&i.push({severity:"error",code:"invalid-shape-outline",message:`Shape "${a.label||a.id}" ${h}`,objectId:a.id})}}else(a.edgeCurvature!==void 0||a.holes!==void 0)&&i.push({severity:"error",code:"invalid-shape-outline",message:`Shape "${a.label||a.id}" has curved sides or cut-outs, which only a custom outline can have`,objectId:a.id});let f=Pt(a);if(f){for(let I of x)if(Nt(f,I.outline)){i.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${a.label??a.id}" overlaps section "${I.label}"`,objectId:a.id});break}}}}$>o&&i.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${$} bookable units; the maximum is ${o}`}),i.push(...v.slice(0,5)),v.length>5&&i.push({severity:"error",code:"duplicate-seat-label",message:`${v.length} seats share a label with another seat; the first 5 are listed above. Seat labels must be unique across the whole chart.`});for(let t of ce(e)){let x=t.families[0]?.targets[0];s.push({severity:"warning",code:"category-inventory-family-conflict",message:Ot(t),categoryKey:t.categoryKey,...x?{objectId:x.id,floorId:x.floorId}:{},relatedObjectIds:t.objectIds,categoryInventoryFamilies:t.families})}e.focalPoint||s.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),A===0&&s.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let t of g)if(p.get(t)===!1){let x=e.categories.find(a=>a.key===t);s.push({severity:"warning",code:"unpriced-category",message:`Category "${x?.label??t}" is used but has no price`,categoryKey:t})}return[...i,...s]}function Pn(e){let n=e.points??[];if(e.edgeCurvature!==void 0&&(!Array.isArray(e.edgeCurvature)||e.edgeCurvature.length!==n.length||e.edgeCurvature.some(o=>typeof o!="number"||!Number.isFinite(o)||o<-100||o>100)))return"needs one side curve from -100 to 100 for each side";if(e.holes===void 0)return null;if(!Ne(e.holes)||e.holes.length>We)return"has an invalid cut-out collection";for(let o=0;o<e.holes.length;o+=1){let i=e.holes[o];if(i.length<3||i.length>512||!z(i)||Math.abs(V(i))<=1e-7||Q(i))return`has an invalid cut-out ${o+1}`;if(!qe(e,i))return`has cut-out ${o+1} outside its outline`;for(let s=0;s<o;s+=1){let r=e.holes[s];if(Ye(i,r))return`has cut-outs ${s+1} and ${o+1} overlapping`}}return null}var Jt=e=>!!("entrance"in e&&e.entrance?.trim()||"entranceGateId"in e&&e.entranceGateId);function _n(e){return e.type==="row"||e.type==="table"?e.seatCount:e.type==="booth"?1:e.type==="gaArea"?e.capacity??0:0}function Dn(e){let n=$t(e).size,o=[];if(!n)return{gates:n,gaps:o,missingAreas:0,missingPlaces:0};let i=lt(e);for(let s of G(e)){let r=new Map;for(let g of s.objects){if(g.type!=="section")continue;let l=g.logicalSectionId??g.id;r.set(l,[...r.get(l)??[],g])}let d={floorId:s.id,selectIds:[],names:[],places:0},p=new Set;for(let g of s.objects){if(g.type!=="row"&&g.type!=="table"&&g.type!=="booth"&&g.type!=="gaArea"||Jt(g))continue;let l=i.get(g.id),c=l?r.get(l):void 0;if(!c?.some(Jt))if(d.places+=_n(g),c){if(p.has(l))continue;p.add(l),d.selectIds.push(...c.map(y=>y.id)),d.names.push(c[0].displayLabel??c[0].label)}else d.selectIds.push(g.id),d.names.push(g.label||g.id)}d.names.length&&o.push(d)}return{gates:n,gaps:o,missingAreas:o.reduce((s,r)=>s+r.names.length,0),missingPlaces:o.reduce((s,r)=>s+r.places,0)}}function Bn(e){let n=e.slice(0,3).map(i=>`\u201C${i}\u201D`),o=e.length-n.length;return o>0?`${n.join(", ")} and ${o} more`:n.join(n.length===2?" and ":", ")}function en(e,n){for(let o of Dn(e).gaps){let i=o.names.length;n.push({severity:"warning",code:"entrance-missing",dimension:"navigation",source:"quality",title:`${i} ${i===1?"area has":"areas have"} no entrance`,message:`Buyers in ${Bn(o.names)} are not told which gate to use.`,action:"Select them, then choose a gate for them in the Gate panel, or use Pick on the map there.",objectId:o.selectIds[0],relatedObjectIds:o.selectIds,floorId:o.floorId,autoFixable:!1})}}var Kn=9,sn="#f7f8fb",Un="#f5f6f8",an="#8b93a7",zn="#0b1220",Gn="#0b1220",Vn="#ffffff",Qn=100,De=e=>e.semanticKind==="icon"&&ae(e.iconKey);function T(e,n=2){let o=10**n;return Math.round(e*o)/o}function M(e){return{source:"quality",...e}}function Hn(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function Be(e){return Kn*vt(e.theme?.seatScale)}function cn(e){let n=[];for(let o of e.objects)o.type==="row"?n.push(...K(o)):o.type==="table"&&n.push(...ee(o));return n}function Xn(e){let n={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let o of e)for(let i of o.objects)i.type==="row"?n.rowSeats+=K(i).length:i.type==="table"?n.tableSeats+=ee(i).length:i.type==="booth"?n.booths+=1:i.type==="gaArea"&&(n.gaCapacity+=Math.max(0,Math.floor(i.capacity)));return{inventoryByKind:n,bookableUnits:n.rowSeats+n.tableSeats+n.booths+n.gaCapacity}}function F(e,n){e.filter(o=>o.code===n.code).length<Qn&&e.push(n)}function Wn(e,n,o){let i=Be(e),s=2*i,r=2.3*i,d=0,p=0,g=1/0;for(let l of n){let c=new Map(l.objects.filter(v=>v.type==="row").map(v=>[v.id,v])),y=v=>{let j=l.objects.find(E=>E.id===v);if(!j||j.type!=="row"&&j.type!=="table")return"another seating object";let A=j.type==="row"?K(j):ee(j),$=A.length?{x:A.reduce((E,P)=>E+P.x,0)/A.length,y:A.reduce((E,P)=>E+P.y,0)/A.length}:j.type==="row"?j.origin:j.center,R=l.objects.find(E=>E.type==="section"&&te($,E.outline,E.holes)),N=j.type==="row"?`Row \u201C${j.label}\u201D`:`Table \u201C${j.label}\u201D`;return R?.type==="section"?`${N} in \u201C${R.label}\u201D`:N},m=cn(l);d+=m.length;let b=r,w=new Map,C=new Map;for(let v of m){let j=Math.floor(v.x/b),A=Math.floor(v.y/b);for(let N=-1;N<=1;N++)for(let E=-1;E<=1;E++){let P=w.get(`${j+N}:${A+E}`)??[];for(let L of P){p++;let D=Math.hypot(v.x-L.x,v.y-L.y);if(g=Math.min(g,D),D>=r)continue;let x=(v.rowId<L.rowId?[v.rowId,L.rowId]:[L.rowId,v.rowId]).join("|"),a=C.get(x);(!a||D<a.distance)&&C.set(x,{a:v,b:L,distance:D})}}let $=`${j}:${A}`,R=w.get($)??[];R.push(v),w.set($,R)}for(let v of C.values()){let j=v.a.rowId===v.b.rowId,A=c.get(v.a.rowId),$=c.get(v.b.rowId),R=!j&&A?.segmentedRow?.repeatLabelOnComponents===!0&&$?.segmentedRow?.repeatLabelOnComponents===!0&&A.segmentedRow.groupId===$.segmentedRow.groupId,N=!!A?.referenceScan&&!!$?.referenceScan&&A.referenceScan.assetId===$.referenceScan.assetId&&A.referenceScan.sectionId===$.referenceScan.sectionId,E=v.distance<s;if((R||N)&&!E)continue;let P=E?"seat-overlap":"seat-cramped",L=y(v.a.rowId),D=y(v.b.rowId),t=T(E?s:r);F(o,M({severity:"warning",code:P,dimension:"geometry",title:E?j?`${L} has overlapping seats`:`${L} and ${D} overlap`:j?`${L} has seats too close together`:`${L} and ${D} are too close together`,message:E?`The closest seats are ${ye(e,v.distance)} apart, so their markers overlap on the buyer map; at least ${ye(e,t)} keeps them apart.`:`The closest seats are ${ye(e,v.distance)} apart; at least ${ye(e,t)} is needed.`,action:j?`Increase the seat spacing for ${L}, or use Review safe fixes.`:`Move ${L} or ${D} until they no longer overlap.`,objectId:v.a.rowId,relatedObjectIds:j?[v.a.rowId]:[v.a.rowId,v.b.rowId],floorId:l.id,measured:T(v.distance),minimum:t,autoFixable:j}))}}return{seats:d,checkedSeatPairs:p,minimumSeatDistance:Number.isFinite(g)?T(g):null}}function me(e){let{width:n,height:o}=De(e)?{width:e.fontSize,height:e.fontSize}:Ge(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:n,height:o};let i=[{x:0,y:0},{x:n,y:0},{x:n,y:o},{x:0,y:o}].map(s=>{let r=Ve(s,e.rotation);return{x:e.position.x+r.x,y:e.position.y+r.y}});return ht(i)}function ln(e,n,o=0){return e.x<n.x+n.width+o&&e.x+e.width+o>n.x&&e.y<n.y+n.height+o&&e.y+e.height+o>n.y}function _e(e,n,o){let i=oe(n.x,e.x,e.x+e.width),s=oe(n.y,e.y,e.y+e.height);return(n.x-i)**2+(n.y-s)**2<o**2}function qn(e,n,o){let i=Be(e),s=0;for(let r of n){let d=r.objects.filter(g=>g.type==="text"),p=cn(r);s+=d.length;for(let g=0;g<d.length;g++){let l=d[g],c=me(l),y=p.find(m=>_e(c,m,i));y&&F(o,M({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${l.text}\u201D overlaps seat ${y.label}`,objectId:l.id,relatedObjectIds:[l.id,y.rowId],floorId:r.id,autoFixable:!0}));for(let m=0;m<g;m++){let b=d[m];ln(c,me(b),2)&&F(o,M({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${l.text}\u201D overlaps text \u201C${b.text}\u201D`,objectId:l.id,relatedObjectIds:[l.id,b.id],floorId:r.id,autoFixable:!0}))}}}return s}function Yn(e,n){let o=!e.categoryKey.trim();if(e.type==="booth")return{places:o?1:0};if(e.type==="gaArea")return{places:o?Math.max(1,Math.floor(e.capacity)):0};if(e.type==="table"&&(e.bookAsWhole||e.variableOccupancy))return{places:o?e.seatCount:0};let i=new Map((e.overrides??[]).map(d=>[d.index,d])),s=[],r=0;for(let d=0;d<e.seatCount;d+=1){let p=i.get(d);if(p?.skip)continue;r+=1;let g=p?.categoryKey;(g===void 0?o:!g.trim()||!n.has(g))&&s.push(d)}return s.length?s.length===r?{places:r}:{places:s.length,seatIndices:s}:{places:0}}function Pe(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function Zn(e,n,o){let i=new Map,s=new Set(e.categories.map(g=>g.key));for(let g of n)for(let l of g.objects){let c=l.type,y=c==="row"||c==="table"||c==="booth"||c==="gaArea",m=y||c==="section",b=y?Yn(l,s):null;if(y&&b&&b.places>0){let C=`${c==="gaArea"?"GA area":c==="row"?"Row":c==="table"?"Table":"Booth"} \u201C${l.label||l.id}\u201D`,v=c==="gaArea"?"place":c==="table"?"chair":c==="booth"?"booth":"seat",j=`${b.places} ${v}${b.places===1?"":"s"}`;F(o,M({severity:"warning",code:"object-uncategorized",dimension:"structure",title:b.seatIndices?`${C} has ${j} with no category`:`${C} has no category`,message:b.seatIndices?`${j} in ${C} have no category, so buyers see no price or colour for them.`:`${C} is not assigned to any category (${j}), so buyers see no price or colour for it.`,action:"Select it and pick a category on the Categories bar, or create one there first.",objectId:l.id,floorId:g.id,autoFixable:!1,...b.seatIndices?{seatIndices:b.seatIndices}:{}}))}if(m){let w=(l.type==="section"?l.displayLabel??l.label:l.label)??"";if(w.trim()){if(c==="table"||c==="booth"||c==="gaArea"){let C=Pe(w),v=i.get(C);v&&v.raw!==w?F(o,M({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${w}\u201D and \u201C${v.raw}\u201D read as the same label`,message:`Labels \u201C${w}\u201D and \u201C${v.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:l.id,relatedObjectIds:[l.id,v.id],floorId:g.id,autoFixable:!1})):v||i.set(C,{id:l.id,raw:w})}}else{let C=c==="gaArea"?"A GA area":c==="section"?"A section":c==="row"?"A row":c==="table"?"A table":"A booth";F(o,M({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${C} has no label`,message:`${C} has an empty label; buyers rely on labels to identify what they are booking.`,action:"Give this object a short, unique label in the inspector.",objectId:l.id,floorId:g.id,autoFixable:!1}))}}}let r=[];for(let g of n){let l=g.objects.filter(c=>c.type==="row"||c.type==="table"||c.type==="booth"||c.type==="gaArea");for(let c of g.objects)if(!(c.type!=="section"||c.referenceInventoryExclusion||l.some(m=>te(se(m),c.outline,c.holes)))){if(c.referenceSource){r.push({id:c.id,floorId:g.id});continue}F(o,M({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${c.displayLabel??c.label}\u201D is empty`,message:`Section \u201C${c.displayLabel??c.label}\u201D contains no rows, tables, booths, or GA areas.`,action:"Add seating inside this section (Fill with rows), or remove the empty section.",objectId:c.id,floorId:g.id,autoFixable:!1}))}}r.length&&F(o,M({severity:"warning",code:"empty-section",dimension:"structure",title:r.length===1?"1 traced section has no seating yet":`${r.length} traced sections have no seating yet`,message:`${r.length} section${r.length===1?"":"s"} traced from the reference image contain${r.length===1?"s":""} no rows, tables, booths, or GA areas.`,action:"Fill them with rows, or remove the ones the venue does not sell.",objectId:r[0].id,relatedObjectIds:r.map(g=>g.id),floorId:r[0].floorId,autoFixable:!1}));let d=new Map,p=new Map;for(let g of n){let l=[];for(let c of g.objects)c.type!=="section"||c.outline.length<3||l.push({id:c.logicalSectionId??c.id,outline:c.outline,...c.holes?{holes:c.holes}:{},bounds:ii(c.outline)});for(let c of g.objects){if(c.type!=="row")continue;let y=(c.segmentedRow?.displayLabel??c.displayLabel??c.label??"").trim(),m=(c.displayType??"").trim(),b=y&&m&&Pe(m)!=="row"?`${m} ${y}`:y,w="";if(l.length){let A=se(c),$=l.find(R=>A.x>=R.bounds.minX&&A.x<=R.bounds.maxX&&A.y>=R.bounds.minY&&A.y<=R.bounds.maxY&&te(A,R.outline,R.holes));$&&(w=$.id)}let C=`${g.id}\0${w}\0${Pe(b)}`,v=c.segmentedRow?.groupId??c.id;if(!b){let A=`${g.id}\0${w}`,$=p.get(A);$?($.ids.push(c.id),$.logical.set(v,[...$.logical.get(v)??[],c])):p.set(A,{ids:[c.id],logical:new Map([[v,[c]]]),floorId:g.id});continue}let j=d.get(C);j?(j.ids.push(c.id),j.logical.set(v,[...j.logical.get(v)??[],c])):d.set(C,{ids:[c.id],logical:new Map([[v,[c]]]),floorId:g.id,raw:b})}}for(let{ids:g,logical:l,floorId:c,raw:y}of d.values()){let m=l.size;m<2||tn([...l.values()])&&F(o,M({severity:"warning",code:"duplicate-row-label",dimension:"labels",title:`${m} rows share the name \u201C${y}\u201D`,message:`${m} rows share the label \u201C${y}\u201D, so buyers cannot tell which row a seat belongs to.`,action:"Rename them so each row reads differently: for example the section or box each belongs to.",objectId:g[0],relatedObjectIds:g,floorId:c,autoFixable:!1}))}for(let{ids:g,logical:l,floorId:c}of p.values()){let y=l.size;y<2||tn([...l.values()])&&F(o,M({severity:"warning",code:"unnamed-row-collision",dimension:"labels",title:`${y} rows have no name`,message:`${y} rows in the same area have no name and repeat each other\u2019s seat numbers, so buyers cannot tell which row a seat belongs to.`,action:"Give each of these rows a name, for example the box each belongs to, so a ticket can say which row a seat is in.",objectId:g[0],relatedObjectIds:g,floorId:c,autoFixable:!1}))}if(e.floors&&e.floors.length>1)for(let g of e.floors)g.objects.length===0&&F(o,M({severity:"warning",code:"unused-floor",dimension:"structure",title:`${rn(g.name)} is empty`,message:`${rn(g.name)} has nothing on it yet.`,action:"Add seating to this floor, copy the floor below, or remove it in Structure.",floorId:g.id,autoFixable:!1}))}var Jn=5,ei=16;function ti(e,n,o){for(let i of n){let s=i.focalPoint??e.focalPoint;if(s)for(let r of i.objects){if(r.type!=="section"||r.outline.length<3)continue;let{rake:d}=tt(r);if(d<Jn)continue;let p=r.outline.map(m=>Math.hypot(m.x-s.x,m.y-s.y)),g=Math.max(...p);if(g<=0)continue;let l=(g-Math.min(...p))/g;if(d*l<=ei)continue;let y=r.displayLabel??r.label;F(o,M({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${y}\u201D is too deep for a single rake`,message:`Section \u201C${y}\u201D spans ${Math.round(l*100)}% of its distance to the stage at a ${Math.round(d)}\xB0 rake, so one rake can't represent its sightlines faithfully: a real tier this deep changes slope at a cross-aisle.`,action:"Split this section at the cross-aisle into two sections, each with its own rake.",objectId:r.id,floorId:i.id,autoFixable:!1}))}}}function ni(e,n,o){let i=e.theme?.background??sn,s=Un,r=new Map;for(let l of n)for(let c of l.objects){if(c.type!=="gaArea")continue;let y=r.get(c.categoryKey)??[];y.push({id:c.id,floorId:l.id}),r.set(c.categoryKey,y)}for(let l of e.categories){let c=_(l.color,i),y=_(l.color,s);if(c==null||y==null){F(o,M({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${l.label}\u201D does not use a supported hex color`,categoryKey:l.key}));continue}let m=Math.min(c,y);m<3&&F(o,M({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${l.label}\u201D is hard to see`,message:`Its colour is too close to light or dark chart backgrounds (${T(m)}:1, needs 3:1). Pick a stronger colour.`,action:`Choose a lighter or darker color for \u201C${l.label}\u201D until this warning clears.`,categoryKey:l.key,measured:T(m),minimum:3,autoFixable:!1}));let b=r.get(l.key)??[];if(b.length){let w=je(l.color,i,$e),C=je(l.color,s,$e),v=Math.min(_(w,i)??0,_(C,s)??0);v<3&&F(o,M({severity:"warning",code:"ga-contrast-low",dimension:"contrast",title:`Standing areas in \u201C${l.label}\u201D are hard to see`,message:`Their pale fill is too close to the chart background (${T(v)}:1, needs 3:1). Pick a stronger colour for \u201C${l.label}\u201D.`,objectId:b[0].id,categoryKey:l.key,floorId:b[0].floorId,relatedObjectIds:b.map(j=>j.id),measured:T(v),minimum:3,autoFixable:!1}))}}for(let l=0;l<e.categories.length;l++)for(let c=0;c<l;c++){let y=e.categories[l],m=e.categories[c],b=ut(y.color,m.color);b!=null&&b<25&&F(o,M({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${y.label}\u201D and \u201C${m.label}\u201D look too similar`,message:`Categories \u201C${y.label}\u201D and \u201C${m.label}\u201D are only \u0394E ${T(b)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:y.key,measured:T(b),minimum:25,autoFixable:!1}))}for(let l of n){let c=l.objects.filter(y=>y.type==="text");for(let y of c){if(De(y))continue;let m=y.color??e.theme?.textColor??an,b=_(m,i),w=y.fontSize>=18?3:4.5;(b==null||b<w)&&F(o,M({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${y.text}\u201D has ${T(b??0)}:1 contrast against the chart background; ${w}:1 is required`,objectId:y.id,floorId:l.id,measured:T(b??0),minimum:w,autoFixable:!0}))}}if(e.theme?.selectionColor){let l=_(e.theme.selectionColor,i);(l==null||l<3)&&F(o,M({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${T(l??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Selection color that stands out clearly from the Background color.",measured:T(l??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let l=_(e.theme.textColor,i);(l==null||l<3)&&F(o,M({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${T(l??0)}:1 contrast against the chart background; 3:1 is required.`,action:"In Theme, choose a Text color with stronger contrast against the Background color.",measured:T(l??0),minimum:3,autoFixable:!1}))}let d=e.theme?.seatLabelColor??zn,p=new Map,g=(l,c,y)=>{let m=p.get(l)??new Map,b=m.get(c)??[];b.push(y),m.set(c,b),p.set(l,m)};for(let l of n)for(let c of l.objects)if(c.type==="row")for(let y of le(c).keys())g(y,"seat",c.id);else if(c.type==="table")for(let y of le(c).keys())g(y,"table seat",c.id);else c.type==="booth"&&g(c.categoryKey,"booth",c.id);for(let l of e.categories){let c=p.get(l.key);if(c)for(let[y,m]of c){let b=y==="booth"?gt:ft,w=mt(yt,600),C=pt(l.color,d),v=_(C,l.color);(v==null||v<w)&&F(o,M({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${y==="booth"?"Booth":y==="seat"?"Seat":"Table-seat"} labels use ${b}u type and have ${T(v??0)}:1 contrast on category \u201C${l.label}\u201D; ${w}:1 is required for small text`,objectId:m[0],relatedObjectIds:m,measured:T(v??0),minimum:w,autoFixable:!0}))}}}function tn(e){if(e.length>24)return!0;let n=new Set;for(let o of e){let i=new Set;for(let s of o)for(let r of K(s)){let d=r.label,p=d.lastIndexOf("-");i.add(p>=0?d.slice(p+1):d)}if(!i.size)return!0;for(let s of i)if(n.has(s))return!0;for(let s of i)n.add(s)}return!1}function ii(e){let n=1/0,o=1/0,i=-1/0,s=-1/0;for(let r of e)r.x<n&&(n=r.x),r.y<o&&(o=r.y),r.x>i&&(i=r.x),r.y>s&&(s=r.y);return{minX:n,minY:o,maxX:i,maxY:s}}function oi(e,n){for(let o of e){let i=o.objects.filter(s=>s.type==="section");if(!(i.length<2))for(let s of o.objects){if(!(s.type==="row"||s.type==="table"||s.type==="booth"||s.type==="gaArea"))continue;let d=se(s),p=i.filter(b=>te(d,b.outline,b.holes)),g=new Map;for(let b of p){let w=b.logicalSectionId??b.id,C=g.get(w)??[];C.push(b),g.set(w,C)}if(g.size<2)continue;let l=[...g.values()],c=l.map(b=>`Section \u201C${b[0].displayLabel??b[0].label}\u201D`),y=c.length===2?c.join(" and "):`${c.slice(0,-1).join(", ")}, and ${c[c.length-1]}`,m=s.type==="gaArea"?"GA area":s.type==="row"?"Row":s.type==="table"?"Table":"Booth";F(n,M({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${m} \u201C${s.label}\u201D belongs to more than one section`,message:`${m} \u201C${s.label}\u201D has its center inside ${y}, so its buyer section is unclear.`,action:"Adjust the boundaries until this object sits in one Section. If the overlapping shapes are meant to form one Section, combine them first.",objectId:s.id,relatedObjectIds:[s.id,...l.flatMap(b=>b.map(w=>w.id))],floorId:o.id,autoFixable:!1}))}}}var ri={structure:20,geometry:30,contrast:25,labels:15,navigation:10},si={"seat-overlap":15,"seat-cramped":4,"label-collision":4,"category-contrast-low":3,"ga-contrast-low":3,"category-colors-too-similar":3,"invalid-category-color":10,"text-contrast-low":4,"bookable-label-contrast-low":3,"selection-contrast-low":3,"theme-text-contrast-low":3,"missing-focal-point":10,"object-uncategorized":3,"object-unlabeled":3,"duplicate-object-label-normalized":2,"empty-section":2,"unused-floor":2,"ambiguous-section-ownership":4,"category-inventory-family-conflict":10};function ai(e){let n={...ri};for(let s of e){let r=s.severity==="error"?10:2;n[s.dimension]=Math.max(0,n[s.dimension]-(si[s.code]??r))}let o=Object.values(n).reduce((s,r)=>s+r,0),i=o>=95?"A":o>=85?"B":o>=70?"C":o>=55?"D":"F";return{overall:o,dimensions:n,errorFree:e.every(s=>s.severity!=="error"),grade:i}}var ci=new Set(["unpriced-category","object-uncategorized"]);function nn(e,n={}){let o=G(e),i=Zt(e,{maxInventory:n.maxInventory}).filter(c=>c.code!=="missing-zone-focal-point"||n.requireExplicitZoneFocals).map(c=>{let y=c.objectId?o.find(w=>w.objects.some(C=>C.id===c.objectId))?.id:void 0,m=c.code==="category-inventory-family-conflict",b=m?e.categories.find(w=>w.key===c.categoryKey):void 0;return M({...c,...m?{severity:"error",title:`Category \u201C${b?.label??c.categoryKey??"Unknown"}\u201D spans incompatible inventory types`,action:"Show the affected objects, then review the safe category split. The repair preserves price, ticket tiers, accessibility assignments, and source provenance."}:{},...n.requireExplicitZoneFocals&&c.code==="missing-zone-focal-point"?{severity:"error"}:{},...y?{floorId:y}:{},source:"structural",dimension:Hn(c),autoFixable:m})}),s=Wn(e,o,i),r=Xn(o),d=qn(e,o,i);if(Zn(e,o,i),oi(o,i),ti(e,o,i),ni(e,o,i),en(e,i),o.reduce((c,y)=>c+y.objects.filter(m=>m.type==="row"||m.type==="table"||m.type==="booth"||m.type==="gaArea").length,0)===0){let c=new Set(["missing-focal-point","no-bookables"]);for(let y=i.length-1;y>=0;y--)c.has(i[y].code)&&i.splice(y,1)}if(n.requirePricedInventory)for(let c=0;c<i.length;c++)ci.has(i[c].code)&&(i[c]={...i[c],severity:"error"});let g=i.filter(c=>c.severity==="error"),l=i.filter(c=>c.severity==="warning");return{issues:i,errors:g,warnings:l,metrics:{floors:o.length,objects:o.reduce((c,y)=>c+y.objects.length,0),seats:s.seats,bookableUnits:r.bookableUnits,inventoryByKind:r.inventoryByKind,categories:e.categories.length,freeTextLabels:d,checkedSeatPairs:s.checkedSeatPairs,minimumSeatDistance:s.minimumSeatDistance},score:ai(i),deferredRules:["rendered-row-label-decollision","rendered-bookable-state-contrast","section-focus-opacity-and-backdrop","24px-pointer-hit-target","reference-image-diff","sightline-blocked","ga-density-high"]}}function li(e,n){if(e.seatCount<2||e.seatSpacing>=n)return!1;let o=ve(K(e));e.seatSpacing=T(n,3);let i=ve(K(e));return e.origin.x=T(e.origin.x+o.x-i.x,3),e.origin.y=T(e.origin.y+o.y-i.y,3),!0}function di(e,n){if(e.seatCount<2)return!1;let o=!1;if(e.shape==="round"){let i=oe(e.seatArc??360,0,360),s=(i>=360?360/e.seatCount:i/(e.seatCount-1))*Math.PI/180;if(s>0){let r=n/(2*Math.sin(s/2)),d=Math.max(1,r-16);(e.radius??40)<d&&(e.radius=T(d,3),o=!0)}}else{let i=it(e),s=Math.max(i.top,i.bottom),r=Math.max(i.left,i.right);s>1&&(e.width??80)/s<n&&(e.width=T(s*n,3),o=!0),r>1&&(e.height??50)/r<n&&(e.height=T(r*n,3),o=!0)}return o}function ui(e){return[Gn,Vn].map(o=>({color:o,minimum:Math.min(...e.map(i=>_(o,i)??0))})).sort((o,i)=>i.minimum-o.minimum)[0].color}function on(e,n,o){let i=me(e),s=0;for(let r of n)r.type==="row"?s+=K(r).filter(d=>_e(i,d,o)).length:r.type==="table"?s+=ee(r).filter(d=>_e(i,d,o)).length:r.type==="text"&&r.id!==e.id&&ln(i,me(r),2)&&s++;return s}function fi(e,n,o){if(on(e,n,o)===0)return!1;let s={...e.position},r=Math.max(12,e.fontSize*1.25),d=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let p=1;p<=12;p++)for(let[g,l]of d)if(e.position={x:T(s.x+g*r*p,3),y:T(s.y+l*r*p,3)},on(e,n,o)===0)return!0;return e.position=s,!1}function Co(e,n={}){let o=JSON.parse(JSON.stringify(e)),i=nn(o,n),s=[],r=Et(o);if(r.changed){o=r.doc;for(let y of r.changes){let m=r.before.find(w=>w.categoryKey===y.categoryKey),b=m?.families.map(w=>w.label).join(", ")??"inventory families";s.push({code:"category-inventory-family-conflict",objectId:m?.objectIds[0],message:`Split category \u201C${y.categoryLabel}\u201D across ${b}; preserved its commercial metadata and reassigned ${y.reassignments.length} affected object${y.reassignments.length===1?"":"s"}`})}}let d=Be(o),p=2.5*d,g=G(o);for(let y of g)for(let m of y.objects)if(m.type==="row"){let b=m.seatSpacing;li(m,p)&&s.push({code:b<2*d?"seat-overlap":"seat-cramped",objectId:m.id,message:`Expanded ${m.id} to the ${T(p)}u target pitch while preserving its centre`})}else m.type==="table"&&di(m,p)&&s.push({code:"seat-cramped",objectId:m.id,message:`Expanded ${m.id} so its perimeter seats meet the ${T(p)}u target pitch`});let l=o.theme?.background??sn;for(let y of g)for(let m of y.objects){if(m.type!=="text"||De(m))continue;let b=m.color??o.theme?.textColor??an,w=m.fontSize>=18?3:4.5;(_(b,l)??0)<w&&(m.color=ui([l]),s.push({code:"text-contrast-low",objectId:m.id,message:`Changed ${m.id} to the highest-contrast black/white ink`}))}for(let y of g){let m=y.objects.filter(b=>b.type==="text");for(let b of m)fi(b,y.objects,d)&&s.push({code:"label-collision",objectId:b.id,message:`Moved ${b.id} to the nearest collision-free deterministic label position`})}o.floors?.length&&(o.objects=o.floors[0].objects);let c=nn(o,n);return{doc:o,changed:s.length>0,fixes:s,before:i,after:c}}function rn(e){let n=e.trim();return/^\d+( copy)?$/.test(n)?`Floor ${n}`:`\u201C${n}\u201D`}function ye(e,n){return ue(n/(ge(e)??re),fe(e))}export{Oe as a,le as b,ce as c,Ot as d,Et as e,Co as f};
@@ -1 +1 @@
1
- import{g as D}from"./chunk-4R6TXHY2.js";import{g as A,i as P}from"./chunk-COECA63Q.js";import{B as M,Da as w,Fa as C,Ga as S,Ia as O,Ja as j,M as v}from"./chunk-EIV3CAGV.js";function x(r){return r.floors?.length?r.floors.flatMap(o=>o.objects):r.objects}function B(r){return x(r).reduce((o,n)=>n.type==="row"?o+w(n):n.type==="table"?o+O(n):n.type==="gaArea"?o+Math.max(0,Math.floor(n.capacity)):n.type==="booth"?o+1:o,0)}function G(r){let o={};for(let a of r.categories??[])o[a.key]=0;let n=(a,s)=>{s>0&&(o[a]=(o[a]??0)+s)};for(let a of x(r))if(a.type==="row")for(let s of C(a))n(s.categoryKey,1);else if(a.type==="table")if(a.bookAsWhole||a.variableOccupancy)n(a.categoryKey,Math.max(0,Math.round(a.seatCount)));else for(let s of j(a))n(s.categoryKey,1);else a.type==="gaArea"?n(a.categoryKey,Math.max(0,Math.floor(a.capacity))):a.type==="booth"&&n(a.categoryKey,1);return o}function _(r){if(!r.template)return null;let o=x(r),n=o.filter(c=>c.type==="row"||c.type==="table"||c.type==="gaArea");if(!n.length)return null;let s=o.filter(c=>c.type==="booth").length+n.reduce((c,l)=>c+(l.type==="table"?2:1),0),y=B(r),h=Math.max(s+1,Math.min(5e4,y*4)),d=[.5,1,1.5,2].map(c=>v(Math.round(y*c),s,h));return{family:r.template.family,display:r.template.family.replace(/-/g," ").replace(/\b\w/g,c=>c.toUpperCase()),min:s,max:h,presets:["S","M","L","XL"].map((c,l)=>({size:c,seats:d[l]}))}}function R(r){let o=C(r);return o.length?M(o):{...r.origin}}function N(r,o){let n=_(r);if(!n)return structuredClone(r);let a=structuredClone(r),s=x(a),y=s.filter(t=>t.type==="row"||t.type==="table"||t.type==="gaArea"),h=s.filter(t=>t.type==="booth").length,d=Math.max(n.min,Math.min(n.max,Math.round(o))),c=d-h,l=y.map((t,e)=>{let u=t.type==="gaArea"?Math.max(0,Math.floor(t.capacity)):t.seatCount,p=t.type==="table"?2:1;return{object:t,index:e,current:u,minimum:p,value:p,fraction:0}}),K=l.reduce((t,e)=>t+e.minimum,0),g=Math.max(0,c-K),T=l.reduce((t,e)=>t+Math.max(1,e.current-e.minimum),0);for(let t of l){let e=g*Math.max(1,t.current-t.minimum)/T,u=Math.floor(e);t.value+=u,t.fraction=e-u}g=c-l.reduce((t,e)=>t+e.value,0),l.sort((t,e)=>e.fraction-t.fraction||t.index-e.index);for(let t=0;t<g;t++)l[t%l.length].value++;l.sort((t,e)=>t.index-e.index);for(let t of l)if(t.object.type==="row"){let e=R(t.object);t.object.seatCount=t.value;let u=R(t.object);t.object.origin.x+=e.x-u.x,t.object.origin.y+=e.y-u.y}else if(t.object.type==="table"){let e=t.object;if(e.seatCountsBySide){let u=["top","bottom","left","right"],p=S(e),z=u.reduce((i,f)=>i+p[f],0)||1,m=u.map((i,f)=>{let b=t.value*p[i]/z;return{side:i,index:f,value:Math.floor(b),fraction:b-Math.floor(b)}}),L=t.value-m.reduce((i,f)=>i+f.value,0);m.sort((i,f)=>f.fraction-i.fraction||i.index-f.index);for(let i=0;i<L;i++)m[i%m.length].value+=1;m.sort((i,f)=>i.index-f.index),e.seatCountsBySide={top:m[0].value,bottom:m[1].value,left:m[2].value,right:m[3].value},e.sides=u.filter(i=>e.seatCountsBySide[i]>0)}e.seatCount=t.value,e.overrides&&(e.overrides=e.overrides.filter(u=>u.index<t.value),e.overrides.length||delete e.overrides)}else{let e=t.object;e.capacity=P(e)?Math.min(t.value,A):t.value,e.variableOccupancy&&(e.maxOccupancy=Math.min(e.maxOccupancy??e.capacity,e.capacity),e.minOccupancy=Math.min(e.minOccupancy??1,e.maxOccupancy)),e.wheelchairPlaces&&(e.wheelchairPlaces=Math.min(e.wheelchairPlaces,e.capacity))}return a.floors?.length&&(a.objects=a.floors[0].objects),a.template={family:a.template.family,targetSeats:d},a=D(a).doc,a.template={family:r.template.family,targetSeats:B(a)},a}export{B as a,G as b,_ as c,N as d};
1
+ import{f as D}from"./chunk-IEBXXGQC.js";import{g as A,i as P}from"./chunk-UKODEMIM.js";import{C as M,Ma as w,N as v,Oa as C,Pa as S,Ra as O,Sa as j}from"./chunk-HKVCBUON.js";function x(r){return r.floors?.length?r.floors.flatMap(o=>o.objects):r.objects}function B(r){return x(r).reduce((o,n)=>n.type==="row"?o+w(n):n.type==="table"?o+O(n):n.type==="gaArea"?o+Math.max(0,Math.floor(n.capacity)):n.type==="booth"?o+1:o,0)}function G(r){let o={};for(let a of r.categories??[])o[a.key]=0;let n=(a,s)=>{s>0&&(o[a]=(o[a]??0)+s)};for(let a of x(r))if(a.type==="row")for(let s of C(a))n(s.categoryKey,1);else if(a.type==="table")if(a.bookAsWhole||a.variableOccupancy)n(a.categoryKey,Math.max(0,Math.round(a.seatCount)));else for(let s of j(a))n(s.categoryKey,1);else a.type==="gaArea"?n(a.categoryKey,Math.max(0,Math.floor(a.capacity))):a.type==="booth"&&n(a.categoryKey,1);return o}function _(r){if(!r.template)return null;let o=x(r),n=o.filter(c=>c.type==="row"||c.type==="table"||c.type==="gaArea");if(!n.length)return null;let s=o.filter(c=>c.type==="booth").length+n.reduce((c,l)=>c+(l.type==="table"?2:1),0),y=B(r),h=Math.max(s+1,Math.min(5e4,y*4)),d=[.5,1,1.5,2].map(c=>v(Math.round(y*c),s,h));return{family:r.template.family,display:r.template.family.replace(/-/g," ").replace(/\b\w/g,c=>c.toUpperCase()),min:s,max:h,presets:["S","M","L","XL"].map((c,l)=>({size:c,seats:d[l]}))}}function R(r){let o=C(r);return o.length?M(o):{...r.origin}}function N(r,o){let n=_(r);if(!n)return structuredClone(r);let a=structuredClone(r),s=x(a),y=s.filter(t=>t.type==="row"||t.type==="table"||t.type==="gaArea"),h=s.filter(t=>t.type==="booth").length,d=Math.max(n.min,Math.min(n.max,Math.round(o))),c=d-h,l=y.map((t,e)=>{let u=t.type==="gaArea"?Math.max(0,Math.floor(t.capacity)):t.seatCount,p=t.type==="table"?2:1;return{object:t,index:e,current:u,minimum:p,value:p,fraction:0}}),K=l.reduce((t,e)=>t+e.minimum,0),g=Math.max(0,c-K),T=l.reduce((t,e)=>t+Math.max(1,e.current-e.minimum),0);for(let t of l){let e=g*Math.max(1,t.current-t.minimum)/T,u=Math.floor(e);t.value+=u,t.fraction=e-u}g=c-l.reduce((t,e)=>t+e.value,0),l.sort((t,e)=>e.fraction-t.fraction||t.index-e.index);for(let t=0;t<g;t++)l[t%l.length].value++;l.sort((t,e)=>t.index-e.index);for(let t of l)if(t.object.type==="row"){let e=R(t.object);t.object.seatCount=t.value;let u=R(t.object);t.object.origin.x+=e.x-u.x,t.object.origin.y+=e.y-u.y}else if(t.object.type==="table"){let e=t.object;if(e.seatCountsBySide){let u=["top","bottom","left","right"],p=S(e),z=u.reduce((i,f)=>i+p[f],0)||1,m=u.map((i,f)=>{let b=t.value*p[i]/z;return{side:i,index:f,value:Math.floor(b),fraction:b-Math.floor(b)}}),L=t.value-m.reduce((i,f)=>i+f.value,0);m.sort((i,f)=>f.fraction-i.fraction||i.index-f.index);for(let i=0;i<L;i++)m[i%m.length].value+=1;m.sort((i,f)=>i.index-f.index),e.seatCountsBySide={top:m[0].value,bottom:m[1].value,left:m[2].value,right:m[3].value},e.sides=u.filter(i=>e.seatCountsBySide[i]>0)}e.seatCount=t.value,e.overrides&&(e.overrides=e.overrides.filter(u=>u.index<t.value),e.overrides.length||delete e.overrides)}else{let e=t.object;e.capacity=P(e)?Math.min(t.value,A):t.value,e.variableOccupancy&&(e.maxOccupancy=Math.min(e.maxOccupancy??e.capacity,e.capacity),e.minOccupancy=Math.min(e.minOccupancy??1,e.maxOccupancy)),e.wheelchairPlaces&&(e.wheelchairPlaces=Math.min(e.wheelchairPlaces,e.capacity))}return a.floors?.length&&(a.objects=a.floors[0].objects),a.template={family:a.template.family,targetSeats:d},a=D(a).doc,a.template={family:r.template.family,targetSeats:B(a)},a}export{B as a,G as b,_ as c,N as d};
@@ -1 +1 @@
1
- import{qa as Y}from"./chunk-EIV3CAGV.js";function nn(c){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(l,a)=>Math.hypot(l-c.x,a-c.y),gradientAt:(l,a)=>{let e=l-c.x,f=a-c.y,i=Math.hypot(e,f);return i<1e-9?[0,0]:[e/i,f/i]}}}function tn(c,l){if(!c.length)return null;let a=0,e=0,f=0;for(let n of c)a+=n.x,e+=n.y,f+=Math.hypot(n.x-l.x,n.y-l.y);let i=c.length;a/=i,e/=i,f/=i;let u=c[0],R=-1;for(let n of c){let o=Math.hypot(n.x-a,n.y-e);o>R&&(R=o,u=n)}let b=u.x-a,m=u.y-e,d=Math.hypot(b,m);d>1e-9?(b/=d,m/=d):(b=1,m=0);let y=[...c].sort((n,o)=>(n.x-a)*b+(n.y-e)*m-((o.x-a)*b+(o.y-e)*m)),t=0;for(let n of y){let o=Math.hypot(n.x-a,n.y-e);o>t&&(t=o)}return{pts:y,cx:a,cy:e,radius:t,depth:f}}function Z(c,l,a){let e=c.pts;if(e.length===1)return Math.hypot(l-e[0].x,a-e[0].y);let f=1/0;for(let i=0;i+1<e.length;i++){let u=e[i],R=e[i+1],b=R.x-u.x,m=R.y-u.y,d=b*b+m*m,y=d>1e-12?((l-u.x)*b+(a-u.y)*m)/d:0;y<0?y=0:y>1&&(y=1);let t=Math.hypot(l-(u.x+y*b),a-(u.y+y*m));t<f&&(f=t)}return f}var U=8;function en(c,l,a){let e=new Array(U).fill(1/0),f=new Array(U).fill(-1);for(let d=0;d<c.length;d++){let y=c[d],t=Math.hypot(l-y.cx,a-y.cy)-y.radius;for(let n=0;n<U;n++)if(t<e[n]){for(let o=U-1;o>n;o--)e[o]=e[o-1],f[o]=f[o-1];e[n]=t,f[n]=d;break}}let i=new Array(3).fill(1/0),u=new Array(3).fill(-1);for(let d of f){if(d<0)continue;let y=Z(c[d],l,a);for(let t=0;t<3;t++)if(y<i[t]){for(let n=2;n>t;n--)i[n]=i[n-1],u[n]=u[n-1];i[t]=y,u[t]=d;break}}if(u[0]<0)return 0;if(i[0]<1e-6)return c[u[0]].depth;let R=i[0]*2.2,b=0,m=0;for(let d=0;d<3;d++){let y=u[d];if(y<0||i[d]>R)continue;let t=1/(i[d]*i[d]);b+=t*c[y].depth,m+=t}return m>0?b/m:c[u[0]].depth}function on(c){let l=(e,f)=>en(c,e,f),a=(e,f)=>{let i=1/0,u=-1;for(let R=0;R<c.length;R++){let b=c[R];if(Math.hypot(e-b.cx,f-b.cy)-b.radius>=i)continue;let m=Z(b,e,f);m<i&&(i=m,u=R)}return u};return{kind:"rows",rowCount:c.length,rows:c,nearestRow:a,depthAt:l,gradientAt:(e,f)=>{let i=(l(e+.5,f)-l(e-.5,f))/1,u=(l(e,f+.5)-l(e,f-.5))/(2*.5),R=Math.hypot(i,u);return R<1e-9?[0,0]:[i/R,u/R]}}}function bn(c,l){let a=[];for(let e of c){let f=tn(e.points,l);f&&a.push(f)}return a.length<2?nn(l):(a.sort((e,f)=>e.depth-f.depth),on(a))}var rn=Math.PI/180,h=96,sn=6,ln=60,cn=150,$=.2,an=.35;function fn(c,l){let a=Math.atan2(l.x-c.x,l.y-c.y)/rn;return a<0?a+360:a}function z(c){if(!c.length)return NaN;let l=[...c].sort((a,e)=>a-e);return l[Math.floor(l.length/2)]}function J(c,l,a=2){let e=c.length,f=new Float64Array(e);for(let i=0;i<e;i++){let u=0,R=0;for(let b=-a;b<=a;b++){let m=i+b;if(l)m=(m%e+e)%e;else if(m<0||m>=e)continue;u+=c[m],R++}f[i]=u/R}return f}function hn(c,l){let a=c.filter(t=>t.rows.length>=1);if(a.length<1)return null;let e=[],f=0,i=0,u=0;for(let t of a)for(let n of t.rows){for(let o of n.pts)f+=o.x,i+=o.y,u++;if(n.pts.length>=4){let o=Y(n.pts);o&&Number.isFinite(o.cx)&&Number.isFinite(o.cy)&&e.push({x:o.cx,y:o.cy})}}if(!u)return null;let R={x:f/u,y:i/u},b=R;if(e.length>=8){let t=z(e.map(D=>D.x)),n=z(e.map(D=>D.y)),o=0;for(let D of a)for(let j of D.rows)for(let F of j.pts){let W=Math.hypot(F.x-R.x,F.y-R.y);W>o&&(o=W)}let B=0,S=o*.2;for(let D of a)for(let j of D.rows)for(let F of j.pts)Math.hypot(F.x-t,F.y-n)<S&&B++;Math.hypot(t-R.x,n-R.y)<=o&&B/u<.01&&(b={x:t,y:n})}let m=[];for(let t of a){let n={sectionId:t.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let o of t.rows)for(let B of o.pts){let S=Math.hypot(B.x-b.x,B.y-b.y),D=Math.min(h-1,Math.floor(fn(b,B)/(360/h)));n.samples.push({r:S,bin:D,levelM:o.levelM}),S<n.rMin&&(n.rMin=S),S>n.rMax&&(n.rMax=S)}n.samples.length&&m.push(n)}if(!m.length)return null;m.sort((t,n)=>t.rMin+t.rMax-(n.rMin+n.rMax));let d=[];for(let t of m){let n=!1;for(let o of d){let B=Math.min(t.rMax,o.rMax)-Math.max(t.rMin,o.rMin),S=Math.min(t.rMax-t.rMin,o.rMax-o.rMin);if(S>1e-9&&B>=an*S){o.members.push(t),o.rMin=Math.min(o.rMin,t.rMin),o.rMax=Math.max(o.rMax,t.rMax),n=!0;break}}n||d.push({members:[t],rMin:t.rMin,rMax:t.rMax})}let y=[];for(let t of d){let n=new Array(h).fill(null);for(let r of t.members)for(let p of r.samples){let x=n[p.bin];x||(x={samples:[]},n[p.bin]=x),x.samples.push({r:p.r,levelM:p.levelM})}let o=n.map(r=>!!r);if(!o.filter(Boolean).length)continue;let S=[],D=[];for(let r of n){if(!r)continue;let p=1/0,x=-1/0;for(let A of r.samples)A.r<p&&(p=A.r),A.r>x&&(x=A.r);S.push(p),D.push(x)}let j=z(S),F=z(D);if(!(j>=$*F)||!(F>0))continue;let W=[...S].sort((r,p)=>r-p);if(!(W[Math.floor(W.length*.1)]>=$*F))continue;let V=n.map(r=>{if(!r)return null;let p=[...r.samples].sort((w,k)=>w.r-k.r),x=p[0].r,A=p[p.length-1].r,P=p[0].levelM,N=-1/0;for(let w of p)w.levelM>N&&(N=w.levelM);let M=[];for(let w of p){let k={r:w.r,l:w.levelM};for(;M.length&&Math.abs(M[M.length-1].r-k.r)<1e-9;){if(M[M.length-1].l<=k.l){k.skip=!0;break}M.pop()}if(!k.skip){for(;M.length>=2;){let L=M[M.length-2],v=M[M.length-1];if((v.r-L.r)*(k.l-L.l)-(v.l-L.l)*(k.r-L.r)<=0)M.pop();else break}M.push(k)}}let C=M.map(w=>w.r),_=M.map(w=>w.l);return{inner:x,outer:A,front:P,top:N,profile:{rs:C,ls:_}}}),O=o.slice();for(let r=0;r<h;r++){if(O[r])continue;let p=-1,x=-1,A=0;for(let s=1;s<=h;s++){let g=(r-s+h*2)%h;if(O[g]){p=g;break}}for(let s=1;s<=h;s++){let g=(r+s)%h;if(O[g]){x=g,A=s;break}}if(p<0||x<0)continue;let P=0;for(let s=1;s<=h;s++){let g=(r-s+h*2)%h;if(o[g]){P=s;break}}if(P-1+A>sn)continue;let M=V[p],C=V[x],_=P/(P+A),w=M.inner+(C.inner-M.inner)*_,k=M.outer+(C.outer-M.outer)*_,L=M.front+(C.front-M.front)*_,v=M.top+(C.top-M.top)*_;V[r]={inner:w,outer:k,front:L,top:v,profile:{rs:[w,k],ls:[L,v]}}}for(let r=0;r<h;r++)V[r]&&(O[r]=!0);let X=360/h,K=[],q=O.filter(Boolean).length,Q=[];if(q===h)Q.push({start:0,len:h});else{let r=0;for(;O[r];)r=(r+1)%h;let p=-1;for(let x=0;x<=h;x++){let A=(r+x)%h,P=x<h&&O[A];if(P&&p<0)p=A;else if(!P&&p>=0){let N=(A-p+h)%h||h;Q.push({start:p,len:N}),p=-1}}}for(let r of Q){if(r.len*X<ln&&r.len<h)continue;let p=r.len===h,x=new Float64Array(r.len),A=new Float64Array(r.len),P=new Float64Array(r.len),N=new Float64Array(r.len),M=[];for(let s=0;s<r.len;s++){let g=V[(r.start+s)%h];x[s]=g.inner,A[s]=g.outer,P[s]=g.front,N[s]=g.top,M.push(g.profile??{rs:[g.inner,g.outer],ls:[g.front,g.top]})}let C=J(x,p),_=J(A,p),w=J(P,p),k=J(N,p);for(let s=0;s<r.len;s++)C[s]>x[s]&&(C[s]=x[s]),_[s]<A[s]&&(_[s]=A[s]),C[s]>_[s]-1e-6&&(C[s]=Math.max(0,_[s]-1e-6)),k[s]<w[s]&&(k[s]=w[s]);let L={startBin:r.start,binCount:r.len,closed:p,innerR:C,outerR:_,frontLevelM:w,topLevelM:k,profiles:M},v=(s,g,I)=>{let H=M[s],T=H.rs,E=H.ls;if(g<=T[0]){E[0]>I&&(E[0]=I);return}if(g>=T[T.length-1]){E[E.length-1]>I&&(E[E.length-1]=I);return}for(let G=0;G+1<T.length;G++)if(g<=T[G+1]){E[G]>I&&(E[G]=I),E[G+1]>I&&(E[G+1]=I);return}};for(let s=0;s<r.len;s++){let g=n[(r.start+s)%h];if(g)for(let I of g.samples){v(s,I.r,I.levelM);let H=p?(s-1+r.len)%r.len:s-1,T=p?(s+1)%r.len:s+1;H>=0&&v(H,I.r,I.levelM),T<r.len&&v(T,I.r,I.levelM)}}K.push(L)}K.reduce((r,p)=>r+p.binCount*X,0)<cn||y.push({arcs:K,sectionIds:t.members.map(r=>r.sectionId),innerRMedian:j,outerRMedian:F})}if(!y.length)return null;if(y.sort((t,n)=>t.innerRMedian-n.innerRMedian),l){let t=y[y.length-1].outerRMedian;if(Math.hypot(l.x-b.x,l.y-b.y)>.9*t)return null}return{centre:b,binCount:h,binStepDeg:360/h,rings:y}}function dn(c,l,a,e){let f=c.binStepDeg,i=a/f-.5-l.startBin;i=(i%c.binCount+c.binCount)%c.binCount,i>l.binCount-1&&(l.closed?i=i-l.binCount<l.binCount-i?0:l.binCount-1:i=i-(l.binCount-1)<c.binCount-i?l.binCount-1:0);let u=Math.floor(i),R=l.closed?(u+1)%l.binCount:Math.min(l.binCount-1,u+1),b=i-u,m=d=>{let y=l.profiles[d],t=y.rs,n=y.ls;if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];for(let o=0;o+1<t.length;o++)if(e<=t[o+1]){let B=t[o+1]-t[o],S=B>1e-9?(e-t[o])/B:0;return n[o]+(n[o+1]-n[o])*S}return n[n.length-1]};return m(u)*(1-b)+m(R)*b}export{bn as a,fn as b,hn as c,dn as d};
1
+ import{xa as Y}from"./chunk-HKVCBUON.js";function nn(c){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(l,a)=>Math.hypot(l-c.x,a-c.y),gradientAt:(l,a)=>{let e=l-c.x,f=a-c.y,i=Math.hypot(e,f);return i<1e-9?[0,0]:[e/i,f/i]}}}function tn(c,l){if(!c.length)return null;let a=0,e=0,f=0;for(let n of c)a+=n.x,e+=n.y,f+=Math.hypot(n.x-l.x,n.y-l.y);let i=c.length;a/=i,e/=i,f/=i;let u=c[0],R=-1;for(let n of c){let o=Math.hypot(n.x-a,n.y-e);o>R&&(R=o,u=n)}let b=u.x-a,m=u.y-e,d=Math.hypot(b,m);d>1e-9?(b/=d,m/=d):(b=1,m=0);let y=[...c].sort((n,o)=>(n.x-a)*b+(n.y-e)*m-((o.x-a)*b+(o.y-e)*m)),t=0;for(let n of y){let o=Math.hypot(n.x-a,n.y-e);o>t&&(t=o)}return{pts:y,cx:a,cy:e,radius:t,depth:f}}function Z(c,l,a){let e=c.pts;if(e.length===1)return Math.hypot(l-e[0].x,a-e[0].y);let f=1/0;for(let i=0;i+1<e.length;i++){let u=e[i],R=e[i+1],b=R.x-u.x,m=R.y-u.y,d=b*b+m*m,y=d>1e-12?((l-u.x)*b+(a-u.y)*m)/d:0;y<0?y=0:y>1&&(y=1);let t=Math.hypot(l-(u.x+y*b),a-(u.y+y*m));t<f&&(f=t)}return f}var U=8;function en(c,l,a){let e=new Array(U).fill(1/0),f=new Array(U).fill(-1);for(let d=0;d<c.length;d++){let y=c[d],t=Math.hypot(l-y.cx,a-y.cy)-y.radius;for(let n=0;n<U;n++)if(t<e[n]){for(let o=U-1;o>n;o--)e[o]=e[o-1],f[o]=f[o-1];e[n]=t,f[n]=d;break}}let i=new Array(3).fill(1/0),u=new Array(3).fill(-1);for(let d of f){if(d<0)continue;let y=Z(c[d],l,a);for(let t=0;t<3;t++)if(y<i[t]){for(let n=2;n>t;n--)i[n]=i[n-1],u[n]=u[n-1];i[t]=y,u[t]=d;break}}if(u[0]<0)return 0;if(i[0]<1e-6)return c[u[0]].depth;let R=i[0]*2.2,b=0,m=0;for(let d=0;d<3;d++){let y=u[d];if(y<0||i[d]>R)continue;let t=1/(i[d]*i[d]);b+=t*c[y].depth,m+=t}return m>0?b/m:c[u[0]].depth}function on(c){let l=(e,f)=>en(c,e,f),a=(e,f)=>{let i=1/0,u=-1;for(let R=0;R<c.length;R++){let b=c[R];if(Math.hypot(e-b.cx,f-b.cy)-b.radius>=i)continue;let m=Z(b,e,f);m<i&&(i=m,u=R)}return u};return{kind:"rows",rowCount:c.length,rows:c,nearestRow:a,depthAt:l,gradientAt:(e,f)=>{let i=(l(e+.5,f)-l(e-.5,f))/1,u=(l(e,f+.5)-l(e,f-.5))/(2*.5),R=Math.hypot(i,u);return R<1e-9?[0,0]:[i/R,u/R]}}}function bn(c,l){let a=[];for(let e of c){let f=tn(e.points,l);f&&a.push(f)}return a.length<2?nn(l):(a.sort((e,f)=>e.depth-f.depth),on(a))}var rn=Math.PI/180,h=96,sn=6,ln=60,cn=150,$=.2,an=.35;function fn(c,l){let a=Math.atan2(l.x-c.x,l.y-c.y)/rn;return a<0?a+360:a}function z(c){if(!c.length)return NaN;let l=[...c].sort((a,e)=>a-e);return l[Math.floor(l.length/2)]}function J(c,l,a=2){let e=c.length,f=new Float64Array(e);for(let i=0;i<e;i++){let u=0,R=0;for(let b=-a;b<=a;b++){let m=i+b;if(l)m=(m%e+e)%e;else if(m<0||m>=e)continue;u+=c[m],R++}f[i]=u/R}return f}function hn(c,l){let a=c.filter(t=>t.rows.length>=1);if(a.length<1)return null;let e=[],f=0,i=0,u=0;for(let t of a)for(let n of t.rows){for(let o of n.pts)f+=o.x,i+=o.y,u++;if(n.pts.length>=4){let o=Y(n.pts);o&&Number.isFinite(o.cx)&&Number.isFinite(o.cy)&&e.push({x:o.cx,y:o.cy})}}if(!u)return null;let R={x:f/u,y:i/u},b=R;if(e.length>=8){let t=z(e.map(D=>D.x)),n=z(e.map(D=>D.y)),o=0;for(let D of a)for(let j of D.rows)for(let F of j.pts){let W=Math.hypot(F.x-R.x,F.y-R.y);W>o&&(o=W)}let B=0,S=o*.2;for(let D of a)for(let j of D.rows)for(let F of j.pts)Math.hypot(F.x-t,F.y-n)<S&&B++;Math.hypot(t-R.x,n-R.y)<=o&&B/u<.01&&(b={x:t,y:n})}let m=[];for(let t of a){let n={sectionId:t.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let o of t.rows)for(let B of o.pts){let S=Math.hypot(B.x-b.x,B.y-b.y),D=Math.min(h-1,Math.floor(fn(b,B)/(360/h)));n.samples.push({r:S,bin:D,levelM:o.levelM}),S<n.rMin&&(n.rMin=S),S>n.rMax&&(n.rMax=S)}n.samples.length&&m.push(n)}if(!m.length)return null;m.sort((t,n)=>t.rMin+t.rMax-(n.rMin+n.rMax));let d=[];for(let t of m){let n=!1;for(let o of d){let B=Math.min(t.rMax,o.rMax)-Math.max(t.rMin,o.rMin),S=Math.min(t.rMax-t.rMin,o.rMax-o.rMin);if(S>1e-9&&B>=an*S){o.members.push(t),o.rMin=Math.min(o.rMin,t.rMin),o.rMax=Math.max(o.rMax,t.rMax),n=!0;break}}n||d.push({members:[t],rMin:t.rMin,rMax:t.rMax})}let y=[];for(let t of d){let n=new Array(h).fill(null);for(let r of t.members)for(let p of r.samples){let x=n[p.bin];x||(x={samples:[]},n[p.bin]=x),x.samples.push({r:p.r,levelM:p.levelM})}let o=n.map(r=>!!r);if(!o.filter(Boolean).length)continue;let S=[],D=[];for(let r of n){if(!r)continue;let p=1/0,x=-1/0;for(let A of r.samples)A.r<p&&(p=A.r),A.r>x&&(x=A.r);S.push(p),D.push(x)}let j=z(S),F=z(D);if(!(j>=$*F)||!(F>0))continue;let W=[...S].sort((r,p)=>r-p);if(!(W[Math.floor(W.length*.1)]>=$*F))continue;let V=n.map(r=>{if(!r)return null;let p=[...r.samples].sort((w,k)=>w.r-k.r),x=p[0].r,A=p[p.length-1].r,P=p[0].levelM,N=-1/0;for(let w of p)w.levelM>N&&(N=w.levelM);let M=[];for(let w of p){let k={r:w.r,l:w.levelM};for(;M.length&&Math.abs(M[M.length-1].r-k.r)<1e-9;){if(M[M.length-1].l<=k.l){k.skip=!0;break}M.pop()}if(!k.skip){for(;M.length>=2;){let L=M[M.length-2],v=M[M.length-1];if((v.r-L.r)*(k.l-L.l)-(v.l-L.l)*(k.r-L.r)<=0)M.pop();else break}M.push(k)}}let C=M.map(w=>w.r),_=M.map(w=>w.l);return{inner:x,outer:A,front:P,top:N,profile:{rs:C,ls:_}}}),O=o.slice();for(let r=0;r<h;r++){if(O[r])continue;let p=-1,x=-1,A=0;for(let s=1;s<=h;s++){let g=(r-s+h*2)%h;if(O[g]){p=g;break}}for(let s=1;s<=h;s++){let g=(r+s)%h;if(O[g]){x=g,A=s;break}}if(p<0||x<0)continue;let P=0;for(let s=1;s<=h;s++){let g=(r-s+h*2)%h;if(o[g]){P=s;break}}if(P-1+A>sn)continue;let M=V[p],C=V[x],_=P/(P+A),w=M.inner+(C.inner-M.inner)*_,k=M.outer+(C.outer-M.outer)*_,L=M.front+(C.front-M.front)*_,v=M.top+(C.top-M.top)*_;V[r]={inner:w,outer:k,front:L,top:v,profile:{rs:[w,k],ls:[L,v]}}}for(let r=0;r<h;r++)V[r]&&(O[r]=!0);let X=360/h,K=[],q=O.filter(Boolean).length,Q=[];if(q===h)Q.push({start:0,len:h});else{let r=0;for(;O[r];)r=(r+1)%h;let p=-1;for(let x=0;x<=h;x++){let A=(r+x)%h,P=x<h&&O[A];if(P&&p<0)p=A;else if(!P&&p>=0){let N=(A-p+h)%h||h;Q.push({start:p,len:N}),p=-1}}}for(let r of Q){if(r.len*X<ln&&r.len<h)continue;let p=r.len===h,x=new Float64Array(r.len),A=new Float64Array(r.len),P=new Float64Array(r.len),N=new Float64Array(r.len),M=[];for(let s=0;s<r.len;s++){let g=V[(r.start+s)%h];x[s]=g.inner,A[s]=g.outer,P[s]=g.front,N[s]=g.top,M.push(g.profile??{rs:[g.inner,g.outer],ls:[g.front,g.top]})}let C=J(x,p),_=J(A,p),w=J(P,p),k=J(N,p);for(let s=0;s<r.len;s++)C[s]>x[s]&&(C[s]=x[s]),_[s]<A[s]&&(_[s]=A[s]),C[s]>_[s]-1e-6&&(C[s]=Math.max(0,_[s]-1e-6)),k[s]<w[s]&&(k[s]=w[s]);let L={startBin:r.start,binCount:r.len,closed:p,innerR:C,outerR:_,frontLevelM:w,topLevelM:k,profiles:M},v=(s,g,I)=>{let H=M[s],T=H.rs,E=H.ls;if(g<=T[0]){E[0]>I&&(E[0]=I);return}if(g>=T[T.length-1]){E[E.length-1]>I&&(E[E.length-1]=I);return}for(let G=0;G+1<T.length;G++)if(g<=T[G+1]){E[G]>I&&(E[G]=I),E[G+1]>I&&(E[G+1]=I);return}};for(let s=0;s<r.len;s++){let g=n[(r.start+s)%h];if(g)for(let I of g.samples){v(s,I.r,I.levelM);let H=p?(s-1+r.len)%r.len:s-1,T=p?(s+1)%r.len:s+1;H>=0&&v(H,I.r,I.levelM),T<r.len&&v(T,I.r,I.levelM)}}K.push(L)}K.reduce((r,p)=>r+p.binCount*X,0)<cn||y.push({arcs:K,sectionIds:t.members.map(r=>r.sectionId),innerRMedian:j,outerRMedian:F})}if(!y.length)return null;if(y.sort((t,n)=>t.innerRMedian-n.innerRMedian),l){let t=y[y.length-1].outerRMedian;if(Math.hypot(l.x-b.x,l.y-b.y)>.9*t)return null}return{centre:b,binCount:h,binStepDeg:360/h,rings:y}}function dn(c,l,a,e){let f=c.binStepDeg,i=a/f-.5-l.startBin;i=(i%c.binCount+c.binCount)%c.binCount,i>l.binCount-1&&(l.closed?i=i-l.binCount<l.binCount-i?0:l.binCount-1:i=i-(l.binCount-1)<c.binCount-i?l.binCount-1:0);let u=Math.floor(i),R=l.closed?(u+1)%l.binCount:Math.min(l.binCount-1,u+1),b=i-u,m=d=>{let y=l.profiles[d],t=y.rs,n=y.ls;if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];for(let o=0;o+1<t.length;o++)if(e<=t[o+1]){let B=t[o+1]-t[o],S=B>1e-9?(e-t[o])/B:0;return n[o]+(n[o+1]-n[o])*S}return n[n.length-1]};return m(u)*(1-b)+m(R)*b}export{bn as a,fn as b,hn as c,dn as d};
@@ -1 +1 @@
1
- import{m as S}from"./chunk-UEDS3HJ3.js";import{M as f,Ra as A,ba as w}from"./chunk-EIV3CAGV.js";var j=36,x=160;function C(e,t=360){let o=f(Math.round(Number.isFinite(e)?e:1),1,40),s=f(Number.isFinite(t)?t:360,120,360);return Math.round(f(o*4*(360/s),j,x))}function l(e){return typeof e=="string"&&S.includes(e)}function b(e,t){return e&&t?"both":e?"start":t?"end":"none"}function g(e){let t=new Map,o=w(e);if(!o.size)return t;let s=new Map;for(let r of e){if(r.type!=="row"||!o.has(r.id))continue;let i=r.segmentedRow.groupId,a=s.get(i)??[];a.push(r),s.set(i,a)}for(let r of s.values())r.sort((i,a)=>i.segmentedRow.componentIndex-a.segmentedRow.componentIndex),r.forEach((i,a)=>{let c=r[a+1];t.set(i.id,{start:a>0&&i.segmentedRow.boundaryBefore==="continuous",end:!!c&&c.segmentedRow.boundaryBefore==="continuous"})});return t}function h(e,t){let o=Number.isInteger(e.seatCount)&&e.seatCount>0?e.seatCount:0,s=new Set;for(let n of e.overrides??[])n.skip&&s.add(n.index);let r=n=>n>=0&&n<o&&!s.has(n),i=b(!t?.start,!t?.end),a=l(e.aisleSeats)?e.aisleSeats:void 0,c=a??i,d=-1,m=-1;for(let n=0;n<o;n+=1)r(n)&&(d<0&&(d=n),m=n);let u=new Set;if(d>=0){(c==="start"||c==="both")&&u.add(d),(c==="end"||c==="both")&&u.add(m);for(let n of s)r(n-1)&&u.add(n-1),r(n+1)&&u.add(n+1)}return{...a?{override:a}:{},automatic:i,slots:[...u].sort((n,O)=>n-O)}}function D(e,t=[e]){return h(e,e.segmentedRow?g(t).get(e.id):void 0)}function I(e){let t=new Set;for(let o of A(e)){let s=g(o.objects);for(let r of o.objects)if(r.type==="row")for(let i of h(r,s.get(r.id)).slots)t.add(`${r.id}:${i}`)}return t}function E(e,t,o){return I(e).has(`${t}:${o}`)}function R(e){let t=l(e.aisleSeats)?e.aisleSeats:"both";return{start:t==="start"||t==="both",end:t==="end"||t==="both"}}function p(e,t){t==="both"?delete e.aisleSeats:e.aisleSeats=t}function N(e,t,o){if(!l(e.aisleSeats)){delete t.aisleSeats,delete o.aisleSeats;return}let s=R(e);p(t,b(s.start,!0)),p(o,b(!0,s.end))}function U(e,t){let o=e[0],s=e[e.length-1];if(!o||!s||!l(o.aisleSeats)&&!l(s.aisleSeats)){delete t.aisleSeats;return}p(t,b(R(o).start,R(s).end))}export{j as a,x as b,C as c,l as d,D as e,I as f,E as g,N as h,U as i};
1
+ import{m as S}from"./chunk-URW7MSCJ.js";import{$a as A,N as f,ja as w}from"./chunk-HKVCBUON.js";var j=36,x=160;function C(e,t=360){let o=f(Math.round(Number.isFinite(e)?e:1),1,40),s=f(Number.isFinite(t)?t:360,120,360);return Math.round(f(o*4*(360/s),j,x))}function l(e){return typeof e=="string"&&S.includes(e)}function b(e,t){return e&&t?"both":e?"start":t?"end":"none"}function g(e){let t=new Map,o=w(e);if(!o.size)return t;let s=new Map;for(let r of e){if(r.type!=="row"||!o.has(r.id))continue;let i=r.segmentedRow.groupId,a=s.get(i)??[];a.push(r),s.set(i,a)}for(let r of s.values())r.sort((i,a)=>i.segmentedRow.componentIndex-a.segmentedRow.componentIndex),r.forEach((i,a)=>{let c=r[a+1];t.set(i.id,{start:a>0&&i.segmentedRow.boundaryBefore==="continuous",end:!!c&&c.segmentedRow.boundaryBefore==="continuous"})});return t}function h(e,t){let o=Number.isInteger(e.seatCount)&&e.seatCount>0?e.seatCount:0,s=new Set;for(let n of e.overrides??[])n.skip&&s.add(n.index);let r=n=>n>=0&&n<o&&!s.has(n),i=b(!t?.start,!t?.end),a=l(e.aisleSeats)?e.aisleSeats:void 0,c=a??i,d=-1,m=-1;for(let n=0;n<o;n+=1)r(n)&&(d<0&&(d=n),m=n);let u=new Set;if(d>=0){(c==="start"||c==="both")&&u.add(d),(c==="end"||c==="both")&&u.add(m);for(let n of s)r(n-1)&&u.add(n-1),r(n+1)&&u.add(n+1)}return{...a?{override:a}:{},automatic:i,slots:[...u].sort((n,O)=>n-O)}}function D(e,t=[e]){return h(e,e.segmentedRow?g(t).get(e.id):void 0)}function I(e){let t=new Set;for(let o of A(e)){let s=g(o.objects);for(let r of o.objects)if(r.type==="row")for(let i of h(r,s.get(r.id)).slots)t.add(`${r.id}:${i}`)}return t}function E(e,t,o){return I(e).has(`${t}:${o}`)}function R(e){let t=l(e.aisleSeats)?e.aisleSeats:"both";return{start:t==="start"||t==="both",end:t==="end"||t==="both"}}function p(e,t){t==="both"?delete e.aisleSeats:e.aisleSeats=t}function N(e,t,o){if(!l(e.aisleSeats)){delete t.aisleSeats,delete o.aisleSeats;return}let s=R(e);p(t,b(s.start,!0)),p(o,b(!0,s.end))}function U(e,t){let o=e[0],s=e[e.length-1];if(!o||!s||!l(o.aisleSeats)&&!l(s.aisleSeats)){delete t.aisleSeats;return}p(t,b(R(o).start,R(s).end))}export{j as a,x as b,C as c,l as d,D as e,I as f,E as g,N as h,U as i};