@seatlayer/core 0.96.0 → 0.98.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.
- package/dist/ar-Q44JP5JY.js +1 -0
- package/dist/be-CGFFSIQL.js +1 -0
- package/dist/bg-WOYK6OLH.js +1 -0
- package/dist/ca-77ZVI3X5.js +1 -0
- package/dist/chunk-2MXDWZQ4.js +1 -0
- package/dist/chunk-2P72QUJR.js +1 -0
- package/dist/chunk-5N4H3KMR.js +1 -0
- package/dist/chunk-ASIIXY5M.js +1 -0
- package/dist/{chunk-O3DGXAIC.js → chunk-CUACREZL.js} +1 -1
- package/dist/{chunk-CEIVHWRB.js → chunk-FLMKHAUT.js} +1 -1
- package/dist/{chunk-TKYTTEJ2.js → chunk-IW7QZIMF.js} +1 -1
- package/dist/chunk-M5VINTGE.js +1 -0
- package/dist/{chunk-U7CVRE4P.js → chunk-OLGPAFXW.js} +1 -1
- package/dist/{chunk-M5X6G7FD.js → chunk-P4C24CIZ.js} +1 -1
- package/dist/{chunk-A3ZL3R75.js → chunk-QEPYNCBJ.js} +1 -1
- package/dist/chunk-VAI2VDQR.js +1 -0
- package/dist/{chunk-Q3MSDG4S.js → chunk-YPESNMTC.js} +1 -1
- package/dist/chunk-Z43H6AWN.js +1 -0
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +40 -18
- package/dist/core/chart-ops/index.d.ts +40 -18
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/sections/index.js +1 -1
- package/dist/cs-OSBZYCSR.js +1 -0
- package/dist/cy-ZCOJW2WH.js +1 -0
- package/dist/da-2PDK6JTR.js +1 -0
- package/dist/de-R5LLVFUU.js +1 -0
- package/dist/el-ZPFVDCWA.js +1 -0
- package/dist/es-7YASJP32.js +1 -0
- package/dist/et-J4TV6KQL.js +1 -0
- package/dist/fa-4TEO7UGM.js +1 -0
- package/dist/fi-GIUDDKMH.js +1 -0
- package/dist/fr-J5J2XJLA.js +1 -0
- package/dist/he-OCEHSVUJ.js +1 -0
- package/dist/hi-EK5CTBW5.js +1 -0
- package/dist/hr-SLDTQOYC.js +1 -0
- package/dist/hu-2QNE77NO.js +1 -0
- package/dist/id-LGDAFQJK.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +8 -16
- package/dist/index.d.ts +8 -16
- package/dist/index.js +1 -1
- package/dist/it-DT4Y3IYB.js +1 -0
- package/dist/ja-D5EY2XCQ.js +1 -0
- package/dist/ko-DD2NV45Q.js +1 -0
- package/dist/ku-KZCMVLBE.js +1 -0
- package/dist/localeLoaders-GGAKX22E.js +1 -0
- package/dist/lt-QWGTJ47Y.js +1 -0
- package/dist/lv-LYAIG3VK.js +1 -0
- package/dist/ms-XTF4KNGD.js +1 -0
- package/dist/nl-QEXY6XHS.js +1 -0
- package/dist/no-HCOXN2CN.js +1 -0
- package/dist/pl-BWY53TSD.js +1 -0
- package/dist/pt-2UJUBCPL.js +1 -0
- package/dist/ro-GGXOLTED.js +1 -0
- package/dist/ru-ZTFK3WCU.js +1 -0
- package/dist/sk-KU543Y2U.js +1 -0
- package/dist/sl-FT576R7A.js +1 -0
- package/dist/sr-WE3J46JE.js +1 -0
- package/dist/stage-CKb7aNoH.d.cts +18 -0
- package/dist/stage-CKb7aNoH.d.ts +18 -0
- package/dist/sv-YEAOPSEB.js +1 -0
- package/dist/th-BEBRDHJA.js +1 -0
- package/dist/tr-LOAHUPSH.js +1 -0
- package/dist/uk-2GMICSHN.js +1 -0
- package/dist/vi-TC5B6AUR.js +1 -0
- package/dist/view3d/index.cjs +283 -78
- package/dist/view3d/index.d.cts +152 -78
- package/dist/view3d/index.d.ts +152 -78
- package/dist/view3d/index.js +281 -76
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/dist/zh-Hans-TSZWTZQY.js +1 -0
- package/dist/zh-Hant-TLB4FZYM.js +1 -0
- package/package.json +1 -1
- package/dist/ar-3S65PDDG.js +0 -1
- package/dist/be-WJKGEBTI.js +0 -1
- package/dist/bg-TZUF36MP.js +0 -1
- package/dist/ca-WLW64J7W.js +0 -1
- package/dist/chunk-F2EXXZSZ.js +0 -1
- package/dist/chunk-F7TP67LK.js +0 -1
- package/dist/chunk-LAX7F5ML.js +0 -1
- package/dist/chunk-LFJUXTIO.js +0 -1
- package/dist/chunk-M7JA4BGP.js +0 -1
- package/dist/cs-HQXANWJA.js +0 -1
- package/dist/cy-EG5BJOG7.js +0 -1
- package/dist/da-5XEBRUEE.js +0 -1
- package/dist/de-SCVAU32D.js +0 -1
- package/dist/el-KBW7YAF5.js +0 -1
- package/dist/es-IFLC65KX.js +0 -1
- package/dist/et-OXB22VMP.js +0 -1
- package/dist/fa-GFAZXHP6.js +0 -1
- package/dist/fi-AI67VYYH.js +0 -1
- package/dist/fr-V3RG2KYP.js +0 -1
- package/dist/he-J3I6MRUR.js +0 -1
- package/dist/hr-SA4WZ3AG.js +0 -1
- package/dist/hu-TM35NZ4U.js +0 -1
- package/dist/it-E4QYIYC4.js +0 -1
- package/dist/ja-S5M7EINH.js +0 -1
- package/dist/ku-DNZQIUUG.js +0 -1
- package/dist/localeLoaders-JTNNRDK2.js +0 -1
- package/dist/lt-ETQDX2HL.js +0 -1
- package/dist/lv-FYFIWI4F.js +0 -1
- package/dist/nl-XOG5SBZQ.js +0 -1
- package/dist/no-7UGUTFXW.js +0 -1
- package/dist/pl-5HR7DQIK.js +0 -1
- package/dist/pt-L4CCONDZ.js +0 -1
- package/dist/ro-KZVPOCZ6.js +0 -1
- package/dist/ru-CD7HYORB.js +0 -1
- package/dist/sk-AQZOHJYW.js +0 -1
- package/dist/sl-XYRITXI6.js +0 -1
- package/dist/sr-6VTXFVHT.js +0 -1
- package/dist/sv-EJWP7WJV.js +0 -1
- package/dist/tr-VKVADTIZ.js +0 -1
- package/dist/uk-QSJV3LDS.js +0 -1
- package/dist/zh-Hans-2FN4LFAW.js +0 -1
- package/dist/zh-Hant-5T2AB4FR.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Xe,e as G,i as Ye}from"./chunk-P4C24CIZ.js";import{c as De}from"./chunk-IW7QZIMF.js";import{A as qe,J as he,N as He,c as H,m as Ge,o as Ve,t as pe,u as Qe}from"./chunk-Z43H6AWN.js";import{i as We,k as Ze,l as Je,m as ve,q as Ie}from"./chunk-TQN2VWQO.js";import{o as _e}from"./chunk-5BMXWOE7.js";import{b as re,c as be,e as Ke,g as Be}from"./chunk-FLMKHAUT.js";import{A as Ee,B as ue,Ca as Fe,Ea as B,Fa as Ne,Ia as Z,M as ie,Ma as J,Oa as ne,P as Te,Q as Le,Qa as me,b as de,e as ke,ea as fe,fa as X,ga as Y,ha as W,ia as ye,ja as ge,ka as Pe,na as Me,q as At,r as Et,s as Tt,t as Lt,u as Rt,v as Pt,w as Oe,x as Mt,y as Ft,z as Ae}from"./chunk-VAI2VDQR.js";import{h as Re}from"./chunk-5ITK5236.js";import{a as ze,i as Ue,n as N}from"./chunk-JBOTRSMY.js";var we=[{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 et(e){return e.floors?.length?e.floors:[{id:"floor-0",objects:e.objects}]}function Nt(e){return we.find(o=>o.key===e)}function se(e){let o=new Map,n=Math.max(0,Math.floor(e.seatCount)),i=new Map((e.overrides??[]).filter(s=>Number.isInteger(s.index)&&s.index>=0&&s.index<e.seatCount).map(s=>[s.index,s])),r=(s,y=1)=>{s&&y>0&&o.set(s,(o.get(s)??0)+y)};r(e.categoryKey,n-i.size);for(let s of i.values())s.skip||r(s.categoryKey??e.categoryKey);return o}function _t(e){return e.type==="row"||e.type==="table"?[...se(e).keys()]:e.type==="booth"?e.categoryKey?[e.categoryKey]:[]:e.type==="gaArea"?e.capacity>0&&e.categoryKey?[e.categoryKey]:[]:[]}function tt(e){return we.find(o=>o.objectType===e.type)??null}function ot(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function ae(e){let o=new Map;for(let r of et(e))for(let s of r.objects){if(!ot(s))continue;let y=tt(s);for(let f of _t(s)){let m=o.get(f)??new Map,a=m.get(y.key)??[];if(!a.some(u=>u.id===s.id)){let u=s.displayLabel||s.label||s.id;a.push({id:s.id,label:u,type:y.objectType,floorId:r.id})}m.set(y.key,a),o.set(f,m)}}let n=new Map(e.categories.map(r=>[r.key,r.label]));return[...e.categories.map(r=>r.key),...[...o.keys()].filter(r=>!n.has(r)).sort()].flatMap(r=>{let s=o.get(r);if(!s||s.size<2)return[];let y=we.flatMap(f=>{let m=s.get(f.key);return m?.length?[{family:f.key,label:f.label,objectType:f.objectType,targets:m}]:[]});return[{categoryKey:r,categoryLabel:n.get(r)??r,families:y,objectIds:[...new Set(y.flatMap(f=>f.targets.map(m=>m.id)))]}]})}function it(e){let o=e.families.map(n=>`${n.label} (${n.targets.map(i=>i.label).join(", ")})`).join(" and ");return`Category \u201C${e.categoryLabel}\u201D is used by more than one kind of inventory: ${o}. Each category can belong to only one kind. Use the safe split to separate them (prices, ticket tiers, accessibility, and provenance are preserved).`}function nt(e){return e.normalize("NFKC").trim().toLocaleLowerCase("en")}function Dt(e,o,n){for(let i=1;i<=1e4;i+=1){let r=i===1?`--${o}`:`--${o}-${i}`,y=`${e.slice(0,Math.max(1,160-r.length))}${r}`;if(!n.has(y))return n.add(y),y}throw new Error(`Unable to allocate a category key for ${e} (${o})`)}function Kt(e,o,n){for(let i=1;i<=1e4;i+=1){let r=i===1?` (${o})`:` (${o} ${i})`,y=`${e.normalize("NFKC").trim().slice(0,Math.max(1,80-r.length)).trimEnd()}${r}`,f=nt(y);if(!n.has(f))return n.add(f),y}throw new Error(`Unable to allocate a category label for ${e} (${o})`)}function Bt(e,o,n,i){let r=Nt(o);return{...structuredClone(e),key:Dt(e.key,r.suffix,n),label:Kt(e.label,r.labelSuffix,i)}}function zt(e,o,n){let i=[];for(let r of et(e))for(let s of r.objects){if(!ot(s))continue;let y=tt(s),f=n.get(y.key);if(!(!f||f===o))if(s.type==="row"||s.type==="table"){let m=[];s.categoryKey===o&&(s.categoryKey=f);for(let a of s.overrides??[])a.categoryKey===o&&(a.categoryKey=f,m.push(a.index));(s.categoryKey===f||m.length)&&i.push({family:y.key,floorId:r.id,objectId:s.id,objectType:y.objectType,fromCategoryKey:o,toCategoryKey:f,...m.length?{seatOverrideIndices:m.sort((a,u)=>a-u)}:{}})}else s.categoryKey===o&&(s.categoryKey=f,i.push({family:y.key,floorId:r.id,objectId:s.id,objectType:y.objectType,fromCategoryKey:o,toCategoryKey:f}))}return i}function rt(e){let o=structuredClone(e),n=ae(o);if(!n.length)return{doc:o,changed:!1,changes:[],before:n,after:n};let i=new Set(o.categories.map(f=>f.key)),r=new Set(o.categories.map(f=>nt(f.label))),s=[];for(let f of n){let m=o.categories.findIndex(I=>I.key===f.categoryKey);if(m<0)continue;let a=o.categories[m],u=f.families[0].family,g=new Map([[u,a.key]]),b=f.families.slice(1).map(I=>{let $=Bt(a,I.family,i,r);return g.set(I.family,$.key),{family:I.family,key:$.key,label:$.label,category:$}});o.categories.splice(m+1,0,...b.map(I=>I.category));let p=zt(o,a.key,g);s.push({categoryKey:a.key,categoryLabel:a.label,retainedFamily:u,clones:b.map(({family:I,key:$,label:w})=>({family:I,key:$,label:w})),reassignments:p})}o.floors?.length&&(o.objects=o.floors[0].objects);let y=ae(o);return{doc:o,changed:s.length>0,changes:s,before:n,after:y}}function Ut(e,o){return Math.abs(e.x-o.x)<=1e-7&&Math.abs(e.y-o.y)<=1e-7}function ee(e,o,n){return(o.x-e.x)*(n.y-e.y)-(o.y-e.y)*(n.x-e.x)}function ce(e,o,n){let i=ee(o,n,e);return Math.abs(i)>1e-7?!1:e.x>=Math.min(o.x,n.x)-1e-7&&e.x<=Math.max(o.x,n.x)+1e-7&&e.y>=Math.min(o.y,n.y)-1e-7&&e.y<=Math.max(o.y,n.y)+1e-7}function Gt(e,o,n,i){let r=ee(e,o,n),s=ee(e,o,i),y=ee(n,i,e),f=ee(n,i,o);return(r>1e-7&&s<-1e-7||r<-1e-7&&s>1e-7)&&(y>1e-7&&f<-1e-7||y<-1e-7&&f>1e-7)?!0:Math.abs(r)<=1e-7&&ce(n,e,o)||Math.abs(s)<=1e-7&&ce(i,e,o)||Math.abs(y)<=1e-7&&ce(e,n,i)||Math.abs(f)<=1e-7&&ce(o,n,i)}function Vt(e){return e.reduce((o,n,i)=>{let r=e[(i+1)%e.length];return o+n.x*r.y-r.x*n.y},0)}function Qt(e){for(let o=0;o<e.length;o+=1){let n=(o+1)%e.length;for(let i=o+1;i<e.length;i+=1){let r=(i+1)%e.length;if(!(o===i||n===i||r===o)&&Gt(e[o],e[n],e[i],e[r]))return!0}}return!1}function at(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(o=>!Number.isFinite(o.x)||!Number.isFinite(o.y)||Math.abs(o.x)>1e7||Math.abs(o.y)>1e7)?{ok:!1,code:"invalid_coordinate",message:"Every polygon vertex must use a finite coordinate inside the safe chart range."}:e.some((o,n)=>Ut(o,e[(n+1)%e.length]))?{ok:!1,code:"duplicate_vertex",message:"Move or remove duplicate neighbouring vertices."}:Math.abs(Vt(e))<2?{ok:!1,code:"degenerate_polygon",message:"The polygon needs a visible enclosed area."}:Qt(e)?{ok:!1,code:"self_intersection",message:"Polygon edges cannot cross or touch each other."}:{ok:!0}}function U(e){return e.length>=3&&e.every(o=>Number.isFinite(o.x)&&Number.isFinite(o.y))}function V(e,o,n){let i=(e.y-o.y)*(n.x-o.x)-(e.x-o.x)*(n.y-o.y);if(Math.abs(i)>1e-7)return!1;let r=(e.x-o.x)*(n.x-o.x)+(e.y-o.y)*(n.y-o.y);if(r<-1e-7)return!1;let s=(n.x-o.x)**2+(n.y-o.y)**2;return r<=s+1e-7}function Q(e,o){let n=!1;for(let i=0,r=o.length-1;i<o.length;r=i++){let s=o[r],y=o[i];if(V(e,s,y))return!0;s.y>e.y!=y.y>e.y&&e.x<(y.x-s.x)*(e.y-s.y)/(y.y-s.y)+s.x&&(n=!n)}return n}function z(e,o,n){return(o.x-e.x)*(n.y-e.y)-(o.y-e.y)*(n.x-e.x)}function ct(e,o,n,i){let r=z(e,o,n),s=z(e,o,i),y=z(n,i,e),f=z(n,i,o);return(r>1e-7&&s<-1e-7||r<-1e-7&&s>1e-7)&&(y>1e-7&&f<-1e-7||y<-1e-7&&f>1e-7)?!0:Math.abs(r)<=1e-7&&V(n,e,o)||Math.abs(s)<=1e-7&&V(i,e,o)||Math.abs(y)<=1e-7&&V(e,n,i)||Math.abs(f)<=1e-7&&V(o,n,i)}function q(e){for(let o=0;o<e.length;o+=1){let n=(o+1)%e.length;for(let i=o+1;i<e.length;i+=1){let r=(i+1)%e.length;if(!(o===i||n===i||r===o)&&ct(e[o],e[n],e[i],e[r]))return!0}}return!1}function te(e,o){for(let n=0;n<e.length;n+=1)for(let i=0;i<o.length;i+=1)if(ct(e[n],e[(n+1)%e.length],o[i],o[(i+1)%o.length]))return!0;return Q(e[0],o)||Q(o[0],e)}function st(e,o){return!o.some((n,i)=>V(e,n,o[(i+1)%o.length]))&&Q(e,o)}function lt(e){let o=e.outlinePath;if(!o?.segments.length)return;let n=s=>Number.isFinite(s.x)&&Number.isFinite(s.y),i=(s,y)=>Math.hypot(s.x-y.x,s.y-y.y);if(!n(o.start))return 0;let r=o.start;for(let s=0;s<o.segments.length;s++){let y=o.segments[s];if(!y||!n(y.end)||i(r,y.end)<=1e-9||y.kind==="bezier"&&(!n(y.control1)||!n(y.control2)))return s;if(y.kind==="arc"){if(!n(y.center)||!Number.isFinite(y.radius)||y.radius<=1e-6)return s;let f=Math.max(1e-4,y.radius*1e-4);if(Math.abs(i(r,y.center)-y.radius)>f||Math.abs(i(y.end,y.center)-y.radius)>f)return s}r=y.end}return i(r,o.start)>1e-4,o.segments.length-1}function qt(e,o,n,i){let r=z(e,o,n),s=z(e,o,i),y=z(n,i,e),f=z(n,i,o);return(r>1e-7&&s<-1e-7||r<-1e-7&&s>1e-7)&&(y>1e-7&&f<-1e-7||y<-1e-7&&f>1e-7)}function dt(e,o){for(let n=0;n<e.length;n+=1)for(let i=0;i<o.length;i+=1)if(qt(e[n],e[(n+1)%e.length],o[i],o[(i+1)%o.length]))return!0;return e.some(n=>st(n,o))||o.some(n=>st(n,e))}function ut(e){return e.role!=="reference-focal"||!e.points||!U(e.points)?null:e.points}function yt(e,o){if(e.displayLabel!==void 0){let n=e.displayLabel.normalize("NFKC").trim();!(e.type==="row"&&e.displayLabel==="")&&(!n||n!==e.displayLabel||n.length>80)&&o.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 n=e.displayType.normalize("NFKC").trim();(!n||n!==e.displayType||n.length>24)&&o.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})}}function ft(e,o,n,i){let r=e.crop,s=r&&(!Number.isFinite(r.x)||!Number.isFinite(r.y)||!Number.isFinite(r.width)||!Number.isFinite(r.height)||r.x<0||r.y<0||r.width<=0||r.height<=0||r.x+r.width>1.000001||r.y+r.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)||s)&&n.push({severity:"error",code:"invalid-background-placement",message:`The ${o} image has an invalid position, size, opacity, rotation, or crop`,...i?{floorId:i}:{}})}function Se(e,o,n,i){let r=e.referenceImage,s=e.backgroundImage;r&&(ft(r,"reference",o,i),!r.assetId&&!r.url&&o.push({severity:"error",code:"invalid-reference-image",message:"A trace reference must identify a private asset or self-contained image",...i?{floorId:i}:{}})),s&&(ft(s,s.assetId?"legacy reference":"buyer background",o,i),!s.assetId&&!s.url&&o.push({severity:"error",code:"invalid-buyer-background",message:"A buyer background must contain a renderable image URL",...i?{floorId:i}:{}}),s.assetId&&n.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}:{}})),_e(e)&&o.push({severity:"error",code:"conflicting-reference-images",message:"The canonical reference and legacy asset-backed background identify different private sources",...i?{floorId:i}:{}})}function oe(e){let o=new Set(H.map(n=>n.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(n=>!!n.trim()&&n.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<=H.length&&new Set(e.accessibility.counts.map(n=>n.type)).size===e.accessibility.counts.length&&e.accessibility.counts.every(n=>o.has(n.type)&&Number.isInteger(n.count)&&n.count>0&&["user-confirmed","authoritative-source"].includes(n.evidence)&&!!n.sourceDescription.trim()&&n.sourceDescription.trim().length<=240))}function gt(e){let o=e.referenceInventoryExclusion;return!o||typeof o.assetId=="string"&&/^ref_[0-9a-f-]{36}$/.test(o.assetId)&&o.assetId===e.referenceSource?.assetId&&typeof o.logicalSectionId=="string"&&o.logicalSectionId===(e.logicalSectionId??e.id)&&typeof o.reason=="string"&&!!o.reason.trim()&&o.reason.trim().length<=80&&["user-confirmed","authoritative-source"].includes(o.evidence)&&typeof o.sourceDescription=="string"&&!!o.sourceDescription.trim()&&o.sourceDescription.trim().length<=240}function mt(e){let o=e.referenceCategorySource;return!o||/^ref_[0-9a-f-]{36}$/.test(o.assetId)&&/^#[0-9a-f]{6}$/i.test(o.sourceColor)&&(o.sourceColors===void 0||o.sourceColors.length>0&&o.sourceColors.includes(o.sourceColor)&&new Set(o.sourceColors).size===o.sourceColors.length&&o.sourceColors.every(n=>/^#[0-9a-f]{6}$/i.test(n)&&`${n[1]}${n[3]}${n[5]}`.toLowerCase()===`${o.sourceColor[1]}${o.sourceColor[3]}${o.sourceColor[5]}`.toLowerCase()))&&(o.logicalSectionIds===void 0||o.logicalSectionIds.length>0&&new Set(o.logicalSectionIds).size===o.logicalSectionIds.length&&o.logicalSectionIds.every(n=>!!n.trim()&&n.length<=160))&&(o.assignmentDerivation===void 0||["source-color-class","confirmed-logical-sections"].includes(o.assignmentDerivation))&&o.assignmentEvidence===void 0==!o.assignmentSourceDescription?.trim()&&(o.assignmentEvidence===void 0||["user-confirmed","authoritative-source"].includes(o.assignmentEvidence))&&(o.assignmentSourceDescription?.trim().length??0)<=240&&(o.assignmentDerivation!=="confirmed-logical-sections"||o.assignmentEvidence!==void 0&&!!o.assignmentSourceDescription?.trim())&&o.sourcePaletteColor===void 0==(o.sourcePaletteColorEvidence===void 0)&&o.sourcePaletteColorEvidence===void 0==!o.sourcePaletteColorSourceDescription?.trim()&&(o.sourcePaletteColor===void 0||/^#[0-9a-f]{6}$/i.test(o.sourcePaletteColor))&&(o.sourcePaletteColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(o.sourcePaletteColorEvidence))&&(o.sourcePaletteColorSourceDescription?.trim().length??0)<=240&&["user-confirmed","authoritative-source"].includes(o.labelEvidence)&&!!o.labelSourceDescription.trim()&&o.labelSourceDescription.trim().length<=240&&e.price!==void 0&&["user-confirmed","authoritative-source"].includes(o.priceEvidence)&&!!o.priceSourceDescription.trim()&&o.priceSourceDescription.trim().length<=240&&o.outputColorEvidence===void 0==!o.outputColorSourceDescription?.trim()&&(o.outputColorEvidence===void 0||["user-confirmed","authoritative-source"].includes(o.outputColorEvidence))&&(o.outputColorSourceDescription?.trim().length??0)<=240&&(e.color.toLowerCase()===(o.sourcePaletteColor??o.sourceColor).toLowerCase()&&new Set((o.sourceColors??[o.sourceColor]).map(n=>`${n[1]}${n[3]}${n[5]}`.toLowerCase())).size===1||o.outputColorEvidence!==void 0&&["user-confirmed","authoritative-source"].includes(o.outputColorEvidence))}function bt(e){let o=e.referenceDirectSeatImport;return!o||/^ref_[0-9a-f-]{36}$/.test(o.assetId)&&/^source-color:(?:#[0-9a-f]{6}(?:\+#[0-9a-f]{6})*|unclassified)$/i.test(o.familyId)}function pt(e,o){let n=e.floors?.length?e.floors.map(s=>({id:s.id,objects:s.objects})):[{id:"floor-0",objects:e.objects}],i=new Map,r=new Map;for(let s of n){let y=s.objects.filter(a=>a.type==="row"),f=new Map,m=new Map;for(let a of y){if(a.segmentedRow){let u=f.get(a.segmentedRow.groupId)??[];u.push(a),f.set(a.segmentedRow.groupId,u)}if(a.rowBlockGeneration){let u=m.get(a.rowBlockGeneration.groupId)??[];u.push(a),m.set(a.rowBlockGeneration.groupId,u)}a.segmentedRow&&a.rowBlockGeneration&&o.push({severity:"error",code:"invalid-row-group-membership",message:`Row "${a.label}" cannot be both a segmented-row component and a generated row-block member`,objectId:a.id,floorId:s.id})}for(let[a,u]of f){let g=i.get(a);g&&g!==s.id&&o.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${a}" cannot span multiple floors`,objectId:u[0].id,floorId:s.id}),i.set(a,s.id);let b=u.slice().sort((j,O)=>j.segmentedRow.componentIndex-O.segmentedRow.componentIndex),p=b[0]?.segmentedRow,I=p?.componentCount??0,$=p?JSON.stringify({displayLabel:p.displayLabel,repeatLabelOnComponents:p.repeatLabelOnComponents,displayType:p.displayType,labelPresentation:p.labelPresentation,viewFromSeatUrl:p.viewFromSeatUrl,viewFromSeatMeta:p.viewFromSeatMeta,confidenceEvidence:p.confidenceEvidence,smoothing:p.smoothing}):"";p&&I>=2&&I<=64&&b.length===I&&p.boundaryBefore==="start"&&b.every((j,O)=>{let C=j.segmentedRow;return C.kind==="segmented-row-v1"&&C.groupId===a&&C.componentCount===I&&C.componentIndex===O&&(O===0?C.boundaryBefore==="start":C.boundaryBefore!=="start")&&C.displayLabel.normalize("NFKC").trim()===C.displayLabel&&C.displayLabel.length>0&&C.displayLabel.length<=80&&JSON.stringify({displayLabel:C.displayLabel,repeatLabelOnComponents:C.repeatLabelOnComponents,displayType:C.displayType,labelPresentation:C.labelPresentation,viewFromSeatUrl:C.viewFromSeatUrl,viewFromSeatMeta:C.viewFromSeatMeta,confidenceEvidence:C.confidenceEvidence,smoothing:C.smoothing})===$})||o.push({severity:"error",code:"invalid-segmented-row",message:`Segmented row "${a}" has missing, duplicated, cyclic, or inconsistent component metadata`,objectId:u[0]?.id,floorId:s.id})}for(let[a,u]of m){let g=r.get(a);g&&g!==s.id&&o.push({severity:"error",code:"invalid-row-block-generation",message:"A generated row block cannot span multiple floors",objectId:u[0].id,floorId:s.id}),r.set(a,s.id)}}}function Ht(e){return e.type==="row"||e.type==="table"||e.type==="booth"}function Xt(e){let o=[],n=new Map((e.overrides??[]).map(i=>[i.index,i]));for(let i=0;i<e.seatCount;i++){let r=n.get(i);r?.skip||o.push({label:Re(e,i,r),index:i})}return o}function ht(e){let o=[],n=new Map((e.overrides??[]).map(i=>[i.index,i]));for(let i=0;i<e.seatCount;i++){let r=n.get(i);r?.skip||o.push({label:r?.label??`${e.label}-${i+1}`,index:i})}return o}function xe(e){return Array.isArray(e)&&e.every(o=>!!o&&typeof o=="object")}function vt(e){return Array.isArray(e)&&e.every(o=>Array.isArray(o)&&o.every(n=>!!n&&typeof n=="object"))}function It(e,o={}){let n=o.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 r=[],s=new Set(e.categories.map(t=>t.key)),y=new Set(H.map(t=>t.key)),f=new Map(e.categories.map(t=>[t.key,t.price!=null||t.notForSale===!0])),m=new Set;Se(e,i,r),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&&!de(e.theme.logoUrl)&&i.push({severity:"error",code:"invalid-theme-logo-url",message:"The buyer-facing theme logo URL is invalid"});let a=de,u=(t,x,c,l={})=>{if(x===void 0)return;if(!x||typeof x!="object"||Array.isArray(x)){i.push({severity:"error",code:"invalid-seat-view-metadata",message:`${c} view metadata is invalid`,...l});return}let d=x;t||r.push({severity:"warning",code:"orphaned-seat-view-metadata",message:`${c} view metadata has no image`,...l});let v=new Set(["exact-seat","row-representative","section-representative","floor-representative","venue-representative"]);d.projection!==void 0&&d.projection!=="equirectangular"&&i.push({severity:"error",code:"invalid-seat-view-projection",message:`${c} view projection must be equirectangular`,...l}),d.coverage!==void 0&&!v.has(d.coverage)&&i.push({severity:"error",code:"invalid-seat-view-coverage",message:`${c} view coverage is invalid`,...l});let h=(S,k,A)=>typeof S=="number"&&Number.isFinite(S)&&S>=k&&S<=A;if(d.initialBearingDeg!==void 0&&!h(d.initialBearingDeg,-360,360)&&i.push({severity:"error",code:"invalid-seat-view-bearing",message:`${c} view bearing must be between -360\xB0 and 360\xB0`,...l}),d.initialPitchDeg!==void 0&&!h(d.initialPitchDeg,-90,90)&&i.push({severity:"error",code:"invalid-seat-view-pitch",message:`${c} view pitch must be between -90\xB0 and 90\xB0`,...l}),d.capturedAt!==void 0&&(typeof d.capturedAt!="string"||d.capturedAt.length>40||!Number.isFinite(Date.parse(d.capturedAt)))&&i.push({severity:"error",code:"invalid-seat-view-capture-date",message:`${c} view capture date is invalid`,...l}),d.sourceLabel!==void 0&&(typeof d.sourceLabel!="string"||d.sourceLabel.trim().length>100)&&i.push({severity:"error",code:"invalid-seat-view-source",message:`${c} view source label is invalid`,...l}),d.previewUrl!==void 0&&!a(d.previewUrl)&&i.push({severity:"error",code:"invalid-seat-view-preview-url",message:`${c} view preview URL is invalid`,...l}),d.variants!==void 0){let S=Array.isArray(d.variants)?d.variants:[];if(!Array.isArray(d.variants)||S.length<1||S.length>4)i.push({severity:"error",code:"invalid-seat-view-variants",message:`${c} view variants must contain between 1 and 4 tiers`,...l});else{let k=new Set;for(let A of S){if(!A||typeof A!="object"||!a(A.url)||!Number.isInteger(A.width)||A.width<1||A.width>12e3||!Number.isInteger(A.height)||A.height<1||A.height>12e3||A.width!==A.height*2||typeof A.sha256!="string"||!/^[a-f0-9]{64}$/.test(A.sha256)||k.has(A.width)){i.push({severity:"error",code:"invalid-seat-view-variant",message:`${c} view variant is not a unique immutable 2:1 equirectangular tier`,...l});break}k.add(A.width)}}}for(let[S,k]of[["width",d.sourceWidth],["height",d.sourceHeight],["preview width",d.previewWidth],["preview height",d.previewHeight]])k!==void 0&&(!Number.isInteger(k)||k<1||k>32768)&&i.push({severity:"error",code:"invalid-seat-view-dimensions",message:`${c} view source ${S} is invalid`,...l});d.captureEyeHeightM!==void 0&&!h(d.captureEyeHeightM,.5,3)&&i.push({severity:"error",code:"invalid-seat-view-eye-height",message:`${c} capture eye height must be between 0.5 m and 3 m`,...l}),d.eventConfigurationId!==void 0&&(typeof d.eventConfigurationId!="string"||!d.eventConfigurationId.trim()||d.eventConfigurationId.length>100)&&i.push({severity:"error",code:"invalid-seat-view-configuration",message:`${c} event configuration id is invalid`,...l}),d.eventConfigurationVersion!==void 0&&(!Number.isInteger(d.eventConfigurationVersion)||d.eventConfigurationVersion<1)&&i.push({severity:"error",code:"invalid-seat-view-configuration-version",message:`${c} event configuration version is invalid`,...l}),d.eventConfigurationVersion!==void 0&&!d.eventConfigurationId&&i.push({severity:"error",code:"invalid-seat-view-configuration-pin",message:`${c} event configuration version requires an id`,...l})},g=(t,x,c={})=>{if(t===void 0)return;let l=k=>{i.push({severity:"error",code:"invalid-seat-confidence-evidence",message:`${x} confidence evidence ${k}`,...c})};if(!t||typeof t!="object"||Array.isArray(t)){l("is invalid");return}let d=t;d.schema!=="seatlayer.seat-confidence/1"&&l("has an unsupported schema");let v=(k,A)=>typeof k=="string"&&k.normalize("NFKC").trim()===k&&k.length>0&&k.length<=A;v(d.evidenceId,120)||l("has an invalid evidence id"),v(d.modelVersion,120)||l("has an invalid model version"),new Set(["synthetic-model","organizer-approved","calibrated-provider"]).has(d.evidenceKind)||l("has an invalid evidence kind"),new Set(["generated","geometry-verified","configuration-verified"]).has(d.modelLevel)||l("has an invalid model level");let h=d.realityLevel??"none";new Set(["none","comparable-build-reference","actual-build-checked"]).has(h)||l("has an invalid reality level"),d.eventConfigurationId!==void 0&&!v(d.eventConfigurationId,100)&&l("has an invalid event configuration id"),d.eventConfigurationVersion!==void 0&&(!Number.isInteger(d.eventConfigurationVersion)||d.eventConfigurationVersion<1)&&l("has an invalid event configuration version"),d.status!==void 0&&!new Set(["draft","approved","retracted"]).has(d.status)&&l("has an invalid publication status"),d.basisSha256!==void 0&&!/^[a-f0-9]{64}$/.test(d.basisSha256)&&l("has an invalid venue basis SHA-256"),d.basisSha256!==void 0&&d.status!=="approved"&&l("can carry a venue basis SHA-256 only after approval");for(let[k,A]of[["assessment",d.assessedAt],["expiry",d.validUntil]])A!==void 0&&(!v(A,40)||!Number.isFinite(Date.parse(A)))&&l(`has an invalid ${k} date`);d.approvedByRole!==void 0&&!v(d.approvedByRole,100)&&l("has an invalid approving organization or role"),d.sourceLabel!==void 0&&!v(d.sourceLabel,120)&&l("has an invalid source label"),d.limitations!==void 0&&(!Array.isArray(d.limitations)||d.limitations.length>6||d.limitations.some(k=>!v(k,160)))&&l("has invalid limitations"),d.evidenceKind==="synthetic-model"&&(d.modelLevel!=="generated"||h!=="none")&&l("cannot describe synthetic data as verified or reality checked"),d.modelLevel!=="generated"&&(!d.assessedAt||!d.approvedByRole)&&l("requires an assessment date and approving organization or role for verified model levels"),d.modelLevel==="configuration-verified"&&!d.eventConfigurationId&&l("requires an event configuration id for configuration verification"),h!=="none"&&(!d.assessedAt||!d.sourceLabel)&&l("requires an assessment date and source for reality evidence"),h==="actual-build-checked"&&(d.modelLevel!=="configuration-verified"||!d.eventConfigurationId)&&l("requires a configuration-verified model and event configuration for an actual-build check");let S=d.modeledTarget;S!==void 0&&(!S||typeof S!="object"||Array.isArray(S)?l("has an invalid modeled target"):((!v(S.label,80)||!v(S.methodLabel,100))&&l("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)&&l("has invalid modeled-target ray counts"),new Set(["clear","partial","obstructed"]).has(S.classification)||l("has an invalid modeled-target classification"),S.occluderLabels!==void 0&&(!Array.isArray(S.occluderLabels)||S.occluderLabels.length>10||S.occluderLabels.some(k=>!v(k,100)))&&l("has invalid modeled-target occluders")))};u(e.viewFromSeatUrl,e.viewFromSeatMeta,"Venue"),g(e.confidenceEvidence,"Venue"),e.viewFromSeatUrl!==void 0&&!a(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&&!a(t.viewFromSeatUrl)&&i.push({severity:"error",code:"invalid-floor-view-url",message:`Floor "${t.name}" has an invalid view-from-seat image URL`}),u(t.viewFromSeatUrl,t.viewFromSeatMeta,`Floor "${t.name}"`,{floorId:t.id}),g(t.confidenceEvidence,`Floor "${t.name}"`,{floorId:t.id});let b=e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects;for(let t of b)if((t.type==="row"||t.type==="section")&&(t.viewFromSeatUrl!==void 0&&!a(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}),u(t.viewFromSeatUrl,t.viewFromSeatMeta,`${t.type==="row"?"Row":"Section"} "${t.label}"`,{objectId:t.id}),g(t.confidenceEvidence,`${t.type==="row"?"Row":"Section"} "${t.label}"`,{objectId:t.id})),t.type==="row"&&t.segmentedRow&&(t.segmentedRow.viewFromSeatUrl!==void 0&&!a(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}),u(t.segmentedRow.viewFromSeatUrl,t.segmentedRow.viewFromSeatMeta,`Segmented row "${t.segmentedRow.displayLabel}"`,{objectId:t.id}),g(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&&!a(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]}),u(x.viewFromSeatUrl,x.viewFromSeatMeta,`Seat ${x.index+1}`,{objectId:t.id,seatIndices:[x.index]}),g(x.confidenceEvidence,`Seat ${x.index+1}`,{objectId:t.id,seatIndices:[x.index]});let p=new Set;for(let t of e.categories){p.has(t.key)&&i.push({severity:"error",code:"duplicate-category-key",message:`Category key "${t.key}" is used more than once`,categoryKey:t.key}),p.add(t.key);let x=new Set;for(let c of t.tiers??[]){if(x.has(c.id)&&i.push({severity:"error",code:"duplicate-category-tier-id",message:`Ticket tier id "${c.id}" is used more than once in category "${t.key}"`,categoryKey:t.key}),c.restriction!=null&&!["companion","child","senior","student","membership","custom"].includes(c.restriction)&&i.push({severity:"error",code:"invalid-category-tier-restriction",message:`Ticket tier "${c.name}" has an unknown restriction`,categoryKey:t.key}),c.buyerMessage!=null&&(!c.buyerMessage.trim()||c.buyerMessage.length>240)&&i.push({severity:"error",code:"invalid-category-tier-buyer-message",message:`Ticket tier "${c.name}" buyer guidance must contain 1 to 240 characters`,categoryKey:t.key}),c.currency!=null&&!/^[A-Z]{3}$/.test(c.currency)&&i.push({severity:"error",code:"invalid-category-tier-currency",message:`Ticket tier "${c.name}" must use a three-letter ISO currency`,categoryKey:t.key}),c.applicability!=null){let l=c.applicability.seatLabels,d=c.applicability.accessibility;(l!==void 0&&(!Array.isArray(l)||!l.length||l.length>1e4||l.some(v=>typeof v!="string"||!v.trim()||v.length>160)||new Set(l).size!==l.length)||d!==void 0&&(!Array.isArray(d)||!d.length||d.some(v=>!y.has(v))||new Set(d).size!==d.length))&&i.push({severity:"error",code:"invalid-category-tier-applicability",message:`Ticket tier "${c.name}" has invalid seat applicability`,categoryKey:t.key})}c.evidence!=null&&(!["public-host","public-event","user-confirmed"].includes(c.evidence.provenance)||!c.evidence.sourceDescription.trim()||c.evidence.sourceDescription.length>240||c.evidence.capturedAt!==void 0&&(c.evidence.capturedAt.length>40||!Number.isFinite(Date.parse(c.evidence.capturedAt))))&&i.push({severity:"error",code:"invalid-category-tier-evidence",message:`Ticket tier "${c.name}" has invalid evidence provenance`,categoryKey:t.key}),x.add(c.id)}mt(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}),bt(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 I=new Map,$=new Map,w=[],j=new Map,O=0,C=0,_=new Set;for(let t of e.floors??[])Se(t,i,r,t.id),_.has(t.id)&&i.push({severity:"error",code:"duplicate-floor-id",message:`Floor id "${t.id}" is used more than once`,floorId:t.id}),_.add(t.id),t.baseHeightM!==void 0&&(!Number.isFinite(t.baseHeightM)||t.baseHeightM<Y||t.baseHeightM>W)&&i.push({severity:"error",code:"invalid-floor-base-height",message:`Floor "${t.name}" base height must be between ${Y} and ${W} metres`,floorId:t.id});let M=e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects;pt(e,i);let T=new Set;for(let t of M)T.has(t.id)&&i.push({severity:"error",code:"duplicate-object-id",message:`Object id "${t.id}" is used more than once`,objectId:t.id}),T.add(t.id);let F=new Set;for(let t of e.zones??[])F.has(t.id)&&i.push({severity:"error",code:"duplicate-zone-id",message:`Zone id "${t.id}" is used more than once`}),F.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 P=new Map;for(let t of M)if(!(t.type!=="section"||!t.zone)){if(e.zones?.length&&!F.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}P.has(t.zone)||P.set(t.zone,t)}for(let[t,x]of P){let c=e.zones?.find(l=>l.id===t);c&&(c?.focalPoint||r.push({severity:"warning",code:"missing-zone-focal-point",message:`Zone "${c?.label??t}" uses the legacy floor focal; set its own focal point before publishing`,objectId:x.id}))}for(let t of M)if((t.type==="row"||t.type==="table"||t.type==="booth"||t.type==="gaArea")&&yt(t,i),Ht(t)){if(O++,C+=t.type==="booth"?1:t.type==="row"?Fe(t):t.bookAsWhole||t.variableOccupancy?t.seatCount:ht(t).length,I.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}):I.set(t.label,t.id),s.has(t.categoryKey)?m.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"){oe(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});let c=new Set;for(let l of t.overrides??[]){(l.accessibility??[]).filter(S=>!y.has(S)).length&&i.push({severity:"error",code:"invalid-accessibility-type",message:`Row "${t.label}" seat ${l.index+1} uses an unknown accessibility type`,objectId:t.id,seatIndices:[l.index]}),(!Number.isInteger(l.index)||l.index<0||l.index>=t.seatCount||c.has(l.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(l.index)?{seatIndices:[l.index]}:{}}),c.add(l.index);let v=l.wheelchairSpaceType,h=l.accessible===!0||l.accessibility?.includes("wheelchair");v!==void 0&&v!=="seat-present"&&v!=="no-seat"?i.push({severity:"error",code:"invalid-wheelchair-space",message:`Row "${t.label}" seat ${l.index+1} has an invalid wheelchair-space type`,objectId:t.id,seatIndices:[l.index]}):v&&(!h||l.skip)&&i.push({severity:"error",code:"invalid-wheelchair-space",message:l.skip?`Row "${t.label}" seat ${l.index+1} cannot have a wheelchair-space physical type while skipped from inventory`:`Row "${t.label}" seat ${l.index+1} must include wheelchair accessibility for its physical-space type`,objectId:t.id,seatIndices:[l.index]})}for(let l of Xt(t))re(l.label)&&i.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${l.label}" uses SeatLayer's reserved GA namespace`,objectId:t.id,seatIndices:[l.index]}),$.get(l.label)!==void 0?w.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${l.label}" is used more than once`,objectId:t.id,seatIndices:[l.index]}):$.set(l.label,t.id)}else if(t.type==="table"){let c=t.bookAsWhole===!0||t.variableOccupancy===!0;if(t.fill!==void 0&&!ze(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!==De(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(K=>Number.isInteger(t.seatCountsBySide[K])&&t.seatCountsBySide[K]>=0&&t.seatCountsBySide[K]<=40),A=k?h.reduce((K,Ot)=>K+t.seatCountsBySide[Ot],0):Number.NaN;(t.shape!=="rect"||S.length!==h.length||S.some(K=>!h.includes(K))||!k||A!==t.seatCount||A<1||A>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})}c&&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 l=new Set;for(let h of t.overrides??[]){(h.accessibility??[]).filter(K=>!y.has(K)).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||l.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]}:{}}),l.add(h.index),h.categoryKey&&!s.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&&m.add(h.categoryKey);let k=h.wheelchairSpaceType,A=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&&(!A||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}),oe(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 v=c?[{label:t.label,index:void 0}]:ht(t);for(let h of v)re(h.label)&&i.push({severity:"error",code:"reserved-seat-label",message:`Inventory label "${h.label}" uses SeatLayer's reserved GA namespace`,objectId:t.id}),$.get(h.label)!==void 0?w.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]}}):$.set(h.label,t.id)}else if(t.type==="booth"){oe(t.referenceInventorySource)||i.push({severity:"error",code:"invalid-reference-inventory-source",message:`Booth "${t.label}" has invalid reference-inventory provenance`,objectId:t.id});let c=t.label;re(c)&&i.push({severity:"error",code:"reserved-seat-label",message:`Seat label "${c}" uses SeatLayer's reserved GA namespace`,objectId:t.id}),$.get(c)!==void 0?w.push({severity:"error",code:"duplicate-seat-label",message:`Seat label "${c}" is used more than once`,objectId:t.id}):$.set(c,t.id)}}else if(t.type==="gaArea"){if(!Ke(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 l of Be(t))$.get(l)!==void 0?w.push({severity:"error",code:"duplicate-seat-label",message:`GA inventory label "${l}" is used more than once`,objectId:t.id}):$.set(l,t.id);if(oe(t.referenceInventorySource)||i.push({severity:"error",code:"invalid-reference-inventory-source",message:`GA area "${t.label}" has invalid reference-inventory provenance`,objectId:t.id}),!xe(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}(!U(t.points)||Math.abs(G(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 c=t.holes??[];if(!vt(c))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 l=c.length<=64?c.findIndex(d=>d.length>512||!U(d)||Math.abs(G(d))<=1e-7||q(d)?!0:!d.flatMap((h,S)=>{let k=d[(S+1)%d.length];return[h,{x:(h.x+k.x)/2,y:(h.y+k.y)/2}]}).every(h=>Q(h,t.points))):0;if(l>=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:l});else if(c.some((d,v)=>c.slice(v+1).some(h=>te(d,h)))){let d=c.findIndex((v,h)=>c.slice(h+1).some(S=>te(v,S)));i.push({severity:"error",code:"overlapping-ga-holes",message:`GA area "${t.label}" has overlapping cutout polygons`,objectId:t.id,holeIndex:d})}}s.has(t.categoryKey)?m.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>be)&&i.push({severity:"error",code:"invalid-ga-capacity",message:`GA area "${t.label}" capacity must be a whole number from 1 to ${be}`,objectId:t.id}),O++,C+=Math.max(0,Math.floor(t.capacity))}else if(t.type==="section"){if(t.displayLabel!==void 0){let l=t.displayLabel.normalize("NFKC").trim();l?(l!==t.displayLabel||l.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:`Section "${t.label}" needs a buyer-facing name before seats are added`,objectId:t.id})}if(t.editor?.defaultCategoryKey&&!s.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<fe||t.elevation>X)){let l=Number.isInteger(t.elevation)&&t.elevation>X&&t.elevation<=Pe;r.push({severity:"warning",code:l?"legacy-section-elevation":"invalid-section-elevation",message:l?`Section "${t.label}" uses legacy tier ${t.elevation}; set an exact height before normalizing it to tier ${X}`:`Section "${t.label}" elevation must be a whole-number tier from ${fe} to ${X}`,objectId:t.id})}if(t.height!==void 0&&(!Number.isFinite(t.height)||t.height<Y||t.height>W)&&i.push({severity:"error",code:"invalid-section-height",message:`Section "${t.label}" exact height must be between ${Y} and ${W} metres`,objectId:t.id}),t.rake!==void 0&&(!Number.isFinite(t.rake)||t.rake<ye||t.rake>ge)&&i.push({severity:"error",code:"invalid-section-rake",message:`Section "${t.label}" rake must be between ${ye}\xB0 and ${ge}\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}),!xe(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(!U(t.outline)||Math.abs(G(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 l=[];try{l=Le(t.outlinePath)}catch{}(!Te(t.outlinePath)||!l.length||Math.hypot(t.outlinePath.start.x-t.outline[0].x,t.outlinePath.start.y-t.outline[0].y)>1e-4||!U(l)||Math.abs(G(l))<=1e-7||q(l))&&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 l=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}),d=j.get(t.logicalSectionId);d&&(d.label!==t.label||d.semanticSignature!==l)?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}):d||j.set(t.logicalSectionId,{label:t.label,semanticSignature:l})}let x=t.holes??[];if(!vt(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 c=-1;for(let l=0;l<x.length;l++){let d=x[l];if(d.length>512||!U(d)||Math.abs(G(d))<=1e-7||q(d)){c=l;break}if(!d.flatMap((h,S)=>{let k=d[(S+1)%d.length];return[h,{x:(h.x+k.x)/2,y:(h.y+k.y)/2}]}).every(h=>Q(h,t.outline))){c=l;break}}if(c>=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:c});else if(x.some((l,d)=>x.slice(d+1).some(v=>te(l,v)))){let l=x.findIndex((d,v)=>x.slice(v+1).some(h=>te(d,h)));i.push({severity:"error",code:"overlapping-section-holes",message:`Section "${t.label}" has overlapping openings`,objectId:t.id,holeIndex:l})}}let D=e.floors?.length?e.floors.map(t=>t.objects):[e.objects];for(let t of D){let x=t.filter(c=>c.type==="section");for(let c of t.filter(l=>l.type==="text")){let l=c.iconKey;l!==void 0&&!We(l)&&i.push({severity:"error",code:"invalid-icon-key",message:`Venue icon "${c.text||c.id}" references an unknown symbol`,objectId:c.id});let d=c.fontFamily;d!==void 0&&(typeof d!="string"||d.normalize("NFKC").trim()!==d||d.length<1||d.length>120)&&i.push({severity:"error",code:"invalid-text-font-family",message:`Text "${c.text||c.id}" font family must contain 1 to 120 normalized characters`,objectId:c.id});let v=c.background;(c.width!==void 0&&(!Number.isFinite(c.width)||c.width<40||c.width>1200)||c.align!==void 0&&!["left","center","right"].includes(c.align)||c.lineHeight!==void 0&&(!Number.isFinite(c.lineHeight)||c.lineHeight<.8||c.lineHeight>3)||c.letterSpacing!==void 0&&(!Number.isFinite(c.letterSpacing)||c.letterSpacing<-2||c.letterSpacing>20)||c.opacity!==void 0&&(!Number.isFinite(c.opacity)||c.opacity<.1||c.opacity>1)||v!==void 0&&(!/^#[0-9a-f]{6}$/i.test(v.color)||v.padding!==void 0&&(!Number.isFinite(v.padding)||v.padding<0||v.padding>40)||v.cornerRadius!==void 0&&(!Number.isFinite(v.cornerRadius)||v.cornerRadius<0||v.cornerRadius>40)||v.opacity!==void 0&&(!Number.isFinite(v.opacity)||v.opacity<.1||v.opacity>1)))&&i.push({severity:"error",code:"invalid-text-layout",message:`Text "${c.text||c.id}" has invalid width, spacing, opacity, alignment, or background layout`,objectId:c.id})}for(let c of t.filter(l=>l.type==="shape")){if(c.eventConfigurationIds!==void 0){let v=c.eventConfigurationIds;Array.isArray(v)&&v.length>0&&v.length<=20&&v.every(S=>typeof S=="string"&&S.normalize("NFKC").trim()===S&&S.length>=1&&S.length<=100)&&new Set(v).size===v.length||i.push({severity:"error",code:"invalid-shape-configurations",message:`Shape "${c.label||c.id}" must reference 1 to 20 unique event configuration ids`,objectId:c.id})}if(c.heightM!==void 0&&(!Number.isFinite(c.heightM)||c.heightM<.05||c.heightM>50)&&i.push({severity:"error",code:"invalid-shape-height",message:`Shape "${c.label||c.id}" height must be between 0.05 m and 50 m`,objectId:c.id}),c.stroke!==void 0&&(!c.stroke||typeof c.stroke.color!="string"||!/^#[0-9a-f]{6}$/i.test(c.stroke.color)||!Number.isFinite(c.stroke.width)||c.stroke.width<.5||c.stroke.width>40)&&i.push({severity:"error",code:"invalid-shape-stroke",message:`Shape "${c.label||c.id}" stroke must use a six-digit color and width from 0.5 to 40 chart units`,objectId:c.id}),(c.lineCap!==void 0||c.lineJoin!==void 0||c.startEnding!==void 0||c.endEnding!==void 0)&&!Ie(c.kind)?i.push({severity:"error",code:"invalid-shape-line-style-applicability",message:`Shape "${c.label||c.id}" may use line caps, joins, and end decorations only when it is an open line or polyline`,objectId:c.id}):Ie(c.kind)&&(c.lineCap!==void 0&&!Ze.includes(c.lineCap)||c.lineJoin!==void 0&&!Je.includes(c.lineJoin)||c.startEnding!==void 0&&!ve.includes(c.startEnding)||c.endEnding!==void 0&&!ve.includes(c.endEnding))&&i.push({severity:"error",code:"invalid-shape-line-style",message:`Shape "${c.label||c.id}" has an unsupported line cap, join, or ending`,objectId:c.id}),c.points!==void 0&&!xe(c.points)){i.push({severity:"error",code:"invalid-polygon-points",message:`Shape "${c.label||c.id}" points must be a list of points`,objectId:c.id});continue}if(c.kind==="polygon"){let v=at(c.points??[]);v.ok||i.push({severity:"error",code:"invalid-shape-polygon",message:`Shape "${c.label||c.id}" has invalid polygon geometry: ${v.message}`,objectId:c.id})}let d=ut(c);if(d){for(let v of x)if(dt(d,v.outline)){i.push({severity:"error",code:"reference-focal-overlaps-section",message:`Reference focal area "${c.label??c.id}" overlaps section "${v.label}"`,objectId:c.id});break}}}}C>n&&i.push({severity:"error",code:"inventory-capacity-exceeded",message:`Chart has ${C} bookable units; the maximum is ${n}`}),i.push(...w.slice(0,5)),w.length>5&&i.push({severity:"error",code:"duplicate-seat-label",message:`${w.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 ae(e)){let x=t.families[0]?.targets[0];r.push({severity:"warning",code:"category-inventory-family-conflict",message:it(t),categoryKey:t.categoryKey,...x?{objectId:x.id,floorId:x.floorId}:{},relatedObjectIds:t.objectIds,categoryInventoryFamilies:t.families})}e.focalPoint||r.push({severity:"warning",code:"missing-focal-point",message:"Chart has no focal point set"}),O===0&&r.push({severity:"warning",code:"no-bookables",message:"Chart has no rows, tables, booths, or GA areas"});for(let t of m)if(f.get(t)===!1){let x=e.categories.find(c=>c.key===t);r.push({severity:"warning",code:"unpriced-category",message:`Category "${x?.label??t}" is used but has no price`,categoryKey:t})}return[...i,...r]}var Yt=9,Ct="#f7f8fb",Wt="#f5f6f8",jt="#8b93a7",Zt="#0b1220",Jt="#0b1220",eo="#ffffff",to=100;function E(e,o=2){let n=10**o;return Math.round(e*n)/n}function L(e){return{source:"quality",...e}}function oo(e){return e.code==="missing-focal-point"||e.code==="missing-zone-focal-point"?"navigation":"structure"}function $e(e){return Yt*Ye(e.theme?.seatScale)}function $t(e){let o=[];for(let n of e.objects)n.type==="row"?o.push(...B(n)):n.type==="table"&&o.push(...Z(n));return o}function io(e){let o={rowSeats:0,tableSeats:0,booths:0,gaCapacity:0};for(let n of e)for(let i of n.objects)i.type==="row"?o.rowSeats+=B(i).length:i.type==="table"?o.tableSeats+=Z(i).length:i.type==="booth"?o.booths+=1:i.type==="gaArea"&&(o.gaCapacity+=Math.max(0,Math.floor(i.capacity)));return{inventoryByKind:o,bookableUnits:o.rowSeats+o.tableSeats+o.booths+o.gaCapacity}}function R(e,o){e.filter(n=>n.code===o.code).length<to&&e.push(o)}function no(e,o,n){let i=$e(e),r=2*i,s=2.3*i,y=0,f=0,m=1/0;for(let a of o){let u=new Map(a.objects.filter(w=>w.type==="row").map(w=>[w.id,w])),g=w=>{let j=a.objects.find(T=>T.id===w);if(!j||j.type!=="row"&&j.type!=="table")return"another seating object";let O=j.type==="row"?B(j):Z(j),C=O.length?{x:O.reduce((T,F)=>T+F.x,0)/O.length,y:O.reduce((T,F)=>T+F.y,0)/O.length}:j.type==="row"?j.origin:j.center,_=a.objects.find(T=>T.type==="section"&&J(C,T.outline,T.holes)),M=j.type==="row"?`Row \u201C${j.label}\u201D`:`Table \u201C${j.label}\u201D`;return _?.type==="section"?`${M} in \u201C${_.label}\u201D`:M},b=$t(a);y+=b.length;let p=s,I=new Map,$=new Map;for(let w of b){let j=Math.floor(w.x/p),O=Math.floor(w.y/p);for(let M=-1;M<=1;M++)for(let T=-1;T<=1;T++){let F=I.get(`${j+M}:${O+T}`)??[];for(let P of F){f++;let D=Math.hypot(w.x-P.x,w.y-P.y);if(m=Math.min(m,D),D>=s)continue;let x=(w.rowId<P.rowId?[w.rowId,P.rowId]:[P.rowId,w.rowId]).join("|"),c=$.get(x);(!c||D<c.distance)&&$.set(x,{a:w,b:P,distance:D})}}let C=`${j}:${O}`,_=I.get(C)??[];_.push(w),I.set(C,_)}for(let w of $.values()){let j=w.a.rowId===w.b.rowId,O=u.get(w.a.rowId),C=u.get(w.b.rowId),_=!j&&O?.segmentedRow?.repeatLabelOnComponents===!0&&C?.segmentedRow?.repeatLabelOnComponents===!0&&O.segmentedRow.groupId===C.segmentedRow.groupId,M=!!O?.referenceScan&&!!C?.referenceScan&&O.referenceScan.assetId===C.referenceScan.assetId&&O.referenceScan.sectionId===C.referenceScan.sectionId,T=w.distance<r;if((_||M)&&!T)continue;let F=T?"seat-overlap":"seat-cramped",P=g(w.a.rowId),D=g(w.b.rowId),t=E(T?r:s);R(n,L({severity:"warning",code:F,dimension:"geometry",title:T?j?`${P} has overlapping seats`:`${P} and ${D} overlap`:j?`${P} has seats too close together`:`${P} and ${D} are too close together`,message:T?`The closest seats are ${E(w.distance)} chart units apart, so their markers overlap on the buyer map; at least ${t} keeps them apart.`:`The closest seats are ${E(w.distance)} chart units apart; at least ${t} are required.`,action:j?`Increase the seat spacing for ${P}, or use Review safe fixes.`:`Move ${P} or ${D} until they no longer overlap.`,objectId:w.a.rowId,relatedObjectIds:j?[w.a.rowId]:[w.a.rowId,w.b.rowId],floorId:a.id,measured:E(w.distance),minimum:t,autoFixable:j}))}}return{seats:y,checkedSeatPairs:f,minimumSeatDistance:Number.isFinite(m)?E(m):null}}function le(e){let{width:o,height:n}=Ae(e);if(!e.rotation)return{x:e.position.x,y:e.position.y,width:o,height:n};let i=[{x:0,y:0},{x:o,y:0},{x:o,y:n},{x:0,y:n}].map(r=>{let s=Ee(r,e.rotation);return{x:e.position.x+s.x,y:e.position.y+s.y}});return Xe(i)}function kt(e,o,n=0){return e.x<o.x+o.width+n&&e.x+e.width+n>o.x&&e.y<o.y+o.height+n&&e.y+e.height+n>o.y}function je(e,o,n){let i=ie(o.x,e.x,e.x+e.width),r=ie(o.y,e.y,e.y+e.height);return(o.x-i)**2+(o.y-r)**2<n**2}function ro(e,o,n){let i=$e(e),r=0;for(let s of o){let y=s.objects.filter(m=>m.type==="text"),f=$t(s);r+=y.length;for(let m=0;m<y.length;m++){let a=y[m],u=le(a),g=f.find(b=>je(u,b,i));g&&R(n,L({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${a.text}\u201D overlaps seat ${g.label}`,objectId:a.id,relatedObjectIds:[a.id,g.rowId],floorId:s.id,autoFixable:!0}));for(let b=0;b<m;b++){let p=y[b];kt(u,le(p),2)&&R(n,L({severity:"warning",code:"label-collision",dimension:"labels",message:`Text \u201C${a.text}\u201D overlaps text \u201C${p.text}\u201D`,objectId:a.id,relatedObjectIds:[a.id,p.id],floorId:s.id,autoFixable:!0}))}}}return r}function Ce(e){return e.normalize("NFKC").trim().toLowerCase().replace(/\s+/g," ")}function ao(e,o,n){let i=new Map;for(let f of o)for(let m of f.objects){let a=m.type,u=a==="row"||a==="table"||a==="booth"||a==="gaArea",g=u||a==="section";if(u&&!m.categoryKey.trim()){let b=a==="gaArea"?"GA area":a==="row"?"Row":a==="table"?"Table":"Booth";R(n,L({severity:"warning",code:"object-uncategorized",dimension:"structure",title:`${b} \u201C${m.label||m.id}\u201D has no category`,message:`${b} \u201C${m.label||m.id}\u201D is not assigned to any category, so buyers see no price or colour for it.`,action:"Assign a category to this object in the inspector, or create one in the Categories tab first.",objectId:m.id,floorId:f.id,autoFixable:!1}))}if(g){let b=(m.type==="section"?m.displayLabel??m.label:m.label)??"";if(b.trim()){if(a==="table"||a==="booth"||a==="gaArea"){let p=Ce(b),I=i.get(p);I&&I.raw!==b?R(n,L({severity:"warning",code:"duplicate-object-label-normalized",dimension:"labels",title:`\u201C${b}\u201D and \u201C${I.raw}\u201D read as the same label`,message:`Labels \u201C${b}\u201D and \u201C${I.raw}\u201D differ only by case, spacing, or accents, so buyers cannot tell them apart.`,action:"Make the two labels visibly distinct.",objectId:m.id,relatedObjectIds:[m.id,I.id],floorId:f.id,autoFixable:!1})):I||i.set(p,{id:m.id,raw:b})}}else{let p=a==="gaArea"?"A GA area":a==="section"?"A section":a==="row"?"A row":a==="table"?"A table":"A booth";R(n,L({severity:"warning",code:"object-unlabeled",dimension:"labels",title:`${p} has no label`,message:`${p} 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:m.id,floorId:f.id,autoFixable:!1}))}}}let r=[];for(let f of o){let m=f.objects.filter(a=>a.type==="row"||a.type==="table"||a.type==="booth"||a.type==="gaArea");for(let a of f.objects)if(!(a.type!=="section"||a.referenceInventoryExclusion||m.some(g=>J(ne(g),a.outline,a.holes)))){if(a.referenceSource){r.push({id:a.id,floorId:f.id});continue}R(n,L({severity:"warning",code:"empty-section",dimension:"structure",title:`Section \u201C${a.displayLabel??a.label}\u201D is empty`,message:`Section \u201C${a.displayLabel??a.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:a.id,floorId:f.id,autoFixable:!1}))}}r.length&&R(n,L({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(f=>f.id),floorId:r[0].floorId,autoFixable:!1}));let s=new Map,y=new Map;for(let f of o){let m=[];for(let a of f.objects)a.type!=="section"||a.outline.length<3||m.push({id:a.logicalSectionId??a.id,outline:a.outline,...a.holes?{holes:a.holes}:{},bounds:fo(a.outline)});for(let a of f.objects){if(a.type!=="row")continue;let u=(a.segmentedRow?.displayLabel??a.displayLabel??a.label??"").trim(),g=(a.displayType??"").trim(),b=u&&g&&Ce(g)!=="row"?`${g} ${u}`:u,p="";if(m.length){let j=ne(a),O=m.find(C=>j.x>=C.bounds.minX&&j.x<=C.bounds.maxX&&j.y>=C.bounds.minY&&j.y<=C.bounds.maxY&&J(j,C.outline,C.holes));O&&(p=O.id)}let I=`${f.id}\0${p}\0${Ce(b)}`,$=a.segmentedRow?.groupId??a.id;if(!b){let j=`${f.id}\0${p}`,O=y.get(j);O?(O.ids.push(a.id),O.logical.set($,[...O.logical.get($)??[],a])):y.set(j,{ids:[a.id],logical:new Map([[$,[a]]]),floorId:f.id});continue}let w=s.get(I);w?(w.ids.push(a.id),w.logical.set($,[...w.logical.get($)??[],a])):s.set(I,{ids:[a.id],logical:new Map([[$,[a]]]),floorId:f.id,raw:b})}}for(let{ids:f,logical:m,floorId:a,raw:u}of s.values()){let g=m.size;g<2||wt([...m.values()])&&R(n,L({severity:"warning",code:"duplicate-row-label",dimension:"labels",title:`${g} rows share the name \u201C${u}\u201D`,message:`${g} rows share the label \u201C${u}\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:f[0],relatedObjectIds:f,floorId:a,autoFixable:!1}))}for(let{ids:f,logical:m,floorId:a}of y.values()){let u=m.size;u<2||wt([...m.values()])&&R(n,L({severity:"warning",code:"unnamed-row-collision",dimension:"labels",title:`${u} rows have no name`,message:`${u} 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:f[0],relatedObjectIds:f,floorId:a,autoFixable:!1}))}if(e.floors&&e.floors.length>1)for(let f of e.floors)f.objects.length===0&&R(n,L({severity:"warning",code:"unused-floor",dimension:"structure",title:`Floor \u201C${f.name}\u201D is empty`,message:`Floor \u201C${f.name}\u201D has no objects on it.`,action:"Add seating to this floor, or delete it from the floor list below the canvas.",floorId:f.id,autoFixable:!1}))}var so=5,co=16;function lo(e,o,n){for(let i of o){let r=i.focalPoint??e.focalPoint;if(r)for(let s of i.objects){if(s.type!=="section"||s.outline.length<3)continue;let{rake:y}=Me(s);if(y<so)continue;let f=s.outline.map(b=>Math.hypot(b.x-r.x,b.y-r.y)),m=Math.max(...f);if(m<=0)continue;let a=(m-Math.min(...f))/m;if(y*a<=co)continue;let g=s.displayLabel??s.label;R(n,L({severity:"warning",code:"section-rake-inconsistent",dimension:"geometry",title:`Section \u201C${g}\u201D is too deep for a single rake`,message:`Section \u201C${g}\u201D spans ${Math.round(a*100)}% of its distance to the stage at a ${Math.round(y)}\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:s.id,floorId:i.id,autoFixable:!1}))}}}function uo(e,o,n){let i=e.theme?.background??Ct,r=Wt,s=new Map;for(let a of o)for(let u of a.objects){if(u.type!=="gaArea")continue;let g=s.get(u.categoryKey)??[];g.push({id:u.id,floorId:a.id}),s.set(u.categoryKey,g)}for(let a of e.categories){let u=N(a.color,i),g=N(a.color,r);if(u==null||g==null){R(n,L({severity:"error",code:"invalid-category-color",dimension:"contrast",message:`Category \u201C${a.label}\u201D does not use a supported hex color`,categoryKey:a.key}));continue}let b=Math.min(u,g);b<3&&R(n,L({severity:"warning",code:"category-contrast-low",dimension:"contrast",title:`Category \u201C${a.label}\u201D is hard to see`,message:`Category \u201C${a.label}\u201D reaches only ${E(b)}:1 across dark and light chart backgrounds; 3:1 is required`,action:`Choose a lighter or darker color for \u201C${a.label}\u201D until this warning clears.`,categoryKey:a.key,measured:E(b),minimum:3,autoFixable:!1}));let p=s.get(a.key)??[];if(p.length){let I=he(a.color,i,pe),$=he(a.color,r,pe),w=Math.min(N(I,i)??0,N($,r)??0);w<3&&R(n,L({severity:"warning",code:"ga-contrast-low",dimension:"contrast",message:`GA category \u201C${a.label}\u201D reaches only ${E(w)}:1 after its rendered opacity is composited; 3:1 is required`,objectId:p[0].id,categoryKey:a.key,floorId:p[0].floorId,relatedObjectIds:p.map(j=>j.id),measured:E(w),minimum:3,autoFixable:!1}))}}for(let a=0;a<e.categories.length;a++)for(let u=0;u<a;u++){let g=e.categories[a],b=e.categories[u],p=Ue(g.color,b.color);p!=null&&p<25&&R(n,L({severity:"warning",code:"category-colors-too-similar",dimension:"contrast",title:`\u201C${g.label}\u201D and \u201C${b.label}\u201D look too similar`,message:`Categories \u201C${g.label}\u201D and \u201C${b.label}\u201D are only \u0394E ${E(p)} apart; 25 is required`,action:"Pick a visibly different color for either category so buyers can tell them apart.",categoryKey:g.key,measured:E(p),minimum:25,autoFixable:!1}))}for(let a of o){let u=a.objects.filter(g=>g.type==="text");for(let g of u){let b=g.color??e.theme?.textColor??jt,p=N(b,i),I=g.fontSize>=18?3:4.5;(p==null||p<I)&&R(n,L({severity:"warning",code:"text-contrast-low",dimension:"contrast",message:`Text \u201C${g.text}\u201D has ${E(p??0)}:1 contrast against the chart background; ${I}:1 is required`,objectId:g.id,floorId:a.id,measured:E(p??0),minimum:I,autoFixable:!0}))}}if(e.theme?.selectionColor){let a=N(e.theme.selectionColor,i);(a==null||a<3)&&R(n,L({severity:"warning",code:"selection-contrast-low",dimension:"contrast",title:"The selection color is hard to see",message:`Selection rings have ${E(a??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:E(a??0),minimum:3,autoFixable:!1}))}if(e.theme?.textColor){let a=N(e.theme.textColor,i);(a==null||a<3)&&R(n,L({severity:"warning",code:"theme-text-contrast-low",dimension:"contrast",title:"The theme text color is hard to read",message:`Theme text has ${E(a??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:E(a??0),minimum:3,autoFixable:!1}))}let y=e.theme?.seatLabelColor??Zt,f=new Map,m=(a,u,g)=>{let b=f.get(a)??new Map,p=b.get(u)??[];p.push(g),b.set(u,p),f.set(a,b)};for(let a of o)for(let u of a.objects)if(u.type==="row")for(let g of se(u).keys())m(g,"seat",u.id);else if(u.type==="table")for(let g of se(u).keys())m(g,"table seat",u.id);else u.type==="booth"&&m(u.categoryKey,"booth",u.id);for(let a of e.categories){let u=f.get(a.key);if(u)for(let[g,b]of u){let p=g==="booth"?Ve:Ge,I=qe(Qe,600),$=He(a.color,y),w=N($,a.color);(w==null||w<I)&&R(n,L({severity:"warning",code:"bookable-label-contrast-low",dimension:"contrast",message:`${g==="booth"?"Booth":g==="seat"?"Seat":"Table-seat"} labels use ${p}u type and have ${E(w??0)}:1 contrast on category \u201C${a.label}\u201D; ${I}:1 is required for small text`,objectId:b[0],relatedObjectIds:b,measured:E(w??0),minimum:I,autoFixable:!0}))}}}function wt(e){if(e.length>24)return!0;let o=new Set;for(let n of e){let i=new Set;for(let r of n)for(let s of B(r)){let y=s.label,f=y.lastIndexOf("-");i.add(f>=0?y.slice(f+1):y)}if(!i.size)return!0;for(let r of i)if(o.has(r))return!0;for(let r of i)o.add(r)}return!1}function fo(e){let o=1/0,n=1/0,i=-1/0,r=-1/0;for(let s of e)s.x<o&&(o=s.x),s.y<n&&(n=s.y),s.x>i&&(i=s.x),s.y>r&&(r=s.y);return{minX:o,minY:n,maxX:i,maxY:r}}function yo(e,o){for(let n of e){let i=n.objects.filter(r=>r.type==="section");if(!(i.length<2))for(let r of n.objects){if(!(r.type==="row"||r.type==="table"||r.type==="booth"||r.type==="gaArea"))continue;let y=ne(r),f=i.filter(p=>J(y,p.outline,p.holes)),m=new Map;for(let p of f){let I=p.logicalSectionId??p.id,$=m.get(I)??[];$.push(p),m.set(I,$)}if(m.size<2)continue;let a=[...m.values()],u=a.map(p=>`Section \u201C${p[0].displayLabel??p[0].label}\u201D`),g=u.length===2?u.join(" and "):`${u.slice(0,-1).join(", ")}, and ${u[u.length-1]}`,b=r.type==="gaArea"?"GA area":r.type==="row"?"Row":r.type==="table"?"Table":"Booth";R(o,L({severity:"warning",code:"ambiguous-section-ownership",dimension:"structure",title:`${b} \u201C${r.label}\u201D belongs to more than one section`,message:`${b} \u201C${r.label}\u201D has its center inside ${g}, 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:r.id,relatedObjectIds:[r.id,...a.flatMap(p=>p.map(I=>I.id))],floorId:n.id,autoFixable:!1}))}}}var go={structure:20,geometry:30,contrast:25,labels:15,navigation:10},mo={"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 bo(e){let o={...go};for(let r of e){let s=r.severity==="error"?10:2;o[r.dimension]=Math.max(0,o[r.dimension]-(mo[r.code]??s))}let n=Object.values(o).reduce((r,s)=>r+s,0),i=n>=95?"A":n>=85?"B":n>=70?"C":n>=55?"D":"F";return{overall:n,dimensions:o,errorFree:e.every(r=>r.severity!=="error"),grade:i}}var po=new Set(["unpriced-category","object-uncategorized"]);function St(e,o={}){let n=me(e),i=It(e,{maxInventory:o.maxInventory}).filter(u=>u.code!=="missing-zone-focal-point"||o.requireExplicitZoneFocals).map(u=>{let g=u.objectId?n.find(I=>I.objects.some($=>$.id===u.objectId))?.id:void 0,b=u.code==="category-inventory-family-conflict",p=b?e.categories.find(I=>I.key===u.categoryKey):void 0;return L({...u,...b?{severity:"error",title:`Category \u201C${p?.label??u.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."}:{},...o.requireExplicitZoneFocals&&u.code==="missing-zone-focal-point"?{severity:"error"}:{},...g?{floorId:g}:{},source:"structural",dimension:oo(u),autoFixable:b})}),r=no(e,n,i),s=io(n),y=ro(e,n,i);if(ao(e,n,i),yo(n,i),lo(e,n,i),uo(e,n,i),n.reduce((u,g)=>u+g.objects.filter(b=>b.type==="row"||b.type==="table"||b.type==="booth"||b.type==="gaArea").length,0)===0){let u=new Set(["missing-focal-point","no-bookables"]);for(let g=i.length-1;g>=0;g--)u.has(i[g].code)&&i.splice(g,1)}if(o.requirePricedInventory)for(let u=0;u<i.length;u++)po.has(i[u].code)&&(i[u]={...i[u],severity:"error"});let m=i.filter(u=>u.severity==="error"),a=i.filter(u=>u.severity==="warning");return{issues:i,errors:m,warnings:a,metrics:{floors:n.length,objects:n.reduce((u,g)=>u+g.objects.length,0),seats:r.seats,bookableUnits:s.bookableUnits,inventoryByKind:s.inventoryByKind,categories:e.categories.length,freeTextLabels:y,checkedSeatPairs:r.checkedSeatPairs,minimumSeatDistance:r.minimumSeatDistance},score:bo(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 ho(e,o){if(e.seatCount<2||e.seatSpacing>=o)return!1;let n=ue(B(e));e.seatSpacing=E(o,3);let i=ue(B(e));return e.origin.x=E(e.origin.x+n.x-i.x,3),e.origin.y=E(e.origin.y+n.y-i.y,3),!0}function vo(e,o){if(e.seatCount<2)return!1;let n=!1;if(e.shape==="round"){let i=ie(e.seatArc??360,0,360),r=(i>=360?360/e.seatCount:i/(e.seatCount-1))*Math.PI/180;if(r>0){let s=o/(2*Math.sin(r/2)),y=Math.max(1,s-16);(e.radius??40)<y&&(e.radius=E(y,3),n=!0)}}else{let i=Ne(e),r=Math.max(i.top,i.bottom),s=Math.max(i.left,i.right);r>1&&(e.width??80)/r<o&&(e.width=E(r*o,3),n=!0),s>1&&(e.height??50)/s<o&&(e.height=E(s*o,3),n=!0)}return n}function Io(e){return[Jt,eo].map(n=>({color:n,minimum:Math.min(...e.map(i=>N(n,i)??0))})).sort((n,i)=>i.minimum-n.minimum)[0].color}function xt(e,o,n){let i=le(e),r=0;for(let s of o)s.type==="row"?r+=B(s).filter(y=>je(i,y,n)).length:s.type==="table"?r+=Z(s).filter(y=>je(i,y,n)).length:s.type==="text"&&s.id!==e.id&&kt(i,le(s),2)&&r++;return r}function wo(e,o,n){if(xt(e,o,n)===0)return!1;let r={...e.position},s=Math.max(12,e.fontSize*1.25),y=[[0,-1],[1,0],[0,1],[-1,0],[1,-1],[1,1],[-1,1],[-1,-1]];for(let f=1;f<=12;f++)for(let[m,a]of y)if(e.position={x:E(r.x+m*s*f,3),y:E(r.y+a*s*f,3)},xt(e,o,n)===0)return!0;return e.position=r,!1}function ni(e,o={}){let n=JSON.parse(JSON.stringify(e)),i=St(n,o),r=[],s=rt(n);if(s.changed){n=s.doc;for(let g of s.changes){let b=s.before.find(I=>I.categoryKey===g.categoryKey),p=b?.families.map(I=>I.label).join(", ")??"inventory families";r.push({code:"category-inventory-family-conflict",objectId:b?.objectIds[0],message:`Split category \u201C${g.categoryLabel}\u201D across ${p}; preserved its commercial metadata and reassigned ${g.reassignments.length} affected object${g.reassignments.length===1?"":"s"}`})}}let y=$e(n),f=2.5*y,m=me(n);for(let g of m)for(let b of g.objects)if(b.type==="row"){let p=b.seatSpacing;ho(b,f)&&r.push({code:p<2*y?"seat-overlap":"seat-cramped",objectId:b.id,message:`Expanded ${b.id} to the ${E(f)}u target pitch while preserving its centre`})}else b.type==="table"&&vo(b,f)&&r.push({code:"seat-cramped",objectId:b.id,message:`Expanded ${b.id} so its perimeter seats meet the ${E(f)}u target pitch`});let a=n.theme?.background??Ct;for(let g of m)for(let b of g.objects){if(b.type!=="text")continue;let p=b.color??n.theme?.textColor??jt,I=b.fontSize>=18?3:4.5;(N(p,a)??0)<I&&(b.color=Io([a]),r.push({code:"text-contrast-low",objectId:b.id,message:`Changed ${b.id} to the highest-contrast black/white ink`}))}for(let g of m){let b=g.objects.filter(p=>p.type==="text");for(let p of b)wo(p,g.objects,y)&&r.push({code:"label-collision",objectId:p.id,message:`Moved ${p.id} to the nearest collision-free deterministic label position`})}n.floors?.length&&(n.objects=n.floors[0].objects);let u=St(n,o);return{doc:n,changed:r.length>0,fixes:r,before:i,after:u}}export{we as a,se as b,ae as c,it as d,rt as e,at as f,ni as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{pa as Y}from"./chunk-
|
|
1
|
+
import{pa as Y}from"./chunk-VAI2VDQR.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 x}from"./chunk-
|
|
1
|
+
import{M as x}from"./chunk-VAI2VDQR.js";function a(n){let e=0;for(let o=0,i=n.length;o<i;o+=1){let r=n[o],m=n[(o+1)%i];e+=r.x*m.y-m.x*r.y}return e/2}function X(n){return a(n)*2}function d(n,e,o){let i=!1;for(let r=0,m=n.length-1;r<n.length;m=r++){let t=n[r],u=n[m];t.y>o!=u.y>o&&e<(u.x-t.x)*(o-t.y)/(u.y-t.y)+t.x&&(i=!i)}return i}var l=.15,f=1.6;function P(n){return x(n??1,l,f)}function y(n){let e=1/0,o=1/0,i=-1/0,r=-1/0,m=!1;for(let t of n)!Number.isFinite(t.x)||!Number.isFinite(t.y)||(m=!0,t.x<e&&(e=t.x),t.y<o&&(o=t.y),t.x>i&&(i=t.x),t.y>r&&(r=t.y));return m?{minX:e,minY:o,maxX:i,maxY:r}:null}function A(n){let e=y(n);return e?c(e):null}function c(n){return{x:n.minX,y:n.minY,width:n.maxX-n.minX,height:n.maxY-n.minY}}function g(n,e){return n.minX<=e.maxX&&e.minX<=n.maxX&&n.minY<=e.maxY&&e.minY<=n.maxY}export{y as a,A as b,g as c,a as d,X as e,d as f,l as g,f as h,P as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as E}from"./chunk-5BMXWOE7.js";import{N as v,
|
|
1
|
+
import{l as E}from"./chunk-5BMXWOE7.js";import{N as v,Ta as _,Wa as R}from"./chunk-VAI2VDQR.js";var T=.08,Y=.045;function L(t){return`__floor__:${encodeURIComponent(t)}`}function X(t,e,o){return{...t,objects:e,floors:void 0,...o?{focalPoint:o}:{},referenceImage:void 0,backgroundImage:void 0}}function j(t,e,o){let s=t.focalPoint??e.focalPoint;return s?s.x:o.x+o.width/2}function Q(t){let e=t.floors??[];if(!e.length)return[];let o=e.map(n=>R(X(t,n.objects,n.focalPoint),{freeText:"exclude"})),a=Math.max(1,...o.map(n=>n.width))*T,r=0;return e.map((n,c)=>{let h=o[c],u=r-(h.y+h.height);return r-=h.height+a,{floorId:n.id,label:n.name??n.id,level:c,levelBadge:c===0?"G":String(c),translation:{x:-j(n,t,h),y:u},bounds:h}})}function z(t,e,o,s){let a=e==="name"?t.label:t.levelBadge;if(!a)return[];let r=Math.max(1,o*Y),n=t.bounds.x+t.translation.x,c=t.bounds.y+t.translation.y+r*.4,h=`floor-level-${t.floorId}`,u={type:"text",id:`${h}-text`,text:a,position:{x:n,y:c},fontSize:r,rotation:0,color:s,bold:!0};if(e==="name")return[u];let x=r*.95;return[{type:"shape",id:`${h}-badge`,kind:"ellipse",x:n-x*.35,y:c-x*.3,width:x*2,height:x*2,fill:"transparent",stroke:{color:s,width:Math.max(1,r*.09)},opacity:.8},u]}function V(t,e={}){let o=t.floors;if(!o||o.length<2)return t;let s=Q(t),a=[];o.forEach((u,x)=>{let{x:y,y:S}=s[x].translation;for(let I of u.objects)x>0&&I.type==="shape"&&I.role==="stage"||a.push(_(I,y,S))});let r={...t,objects:a,floors:void 0},n=R(r,{freeText:"exclude"}),c=Math.max(1,n.width,n.height),h=t.theme?.textColor??"#94a3b8";for(let u of s)a.push(...z(u,e.labelStyle??"number",c,h));return{...r,objects:a,referenceImage:void 0,backgroundImage:void 0}}function W(t){if(!t.floors||t.floors.length<2)return t;let e=!t.zones?.length,o=new Set,s=t.floors.flatMap(r=>r.objects.flatMap(n=>{if(n.type==="shape"&&n.role==="stage"){let c=JSON.stringify([n.kind,n.x,n.y,n.width,n.height,n.points,n.rotation??0,n.label,n.heightM,n.eventConfigurationIds]);if(o.has(c))return[];o.add(c)}return e&&n.type==="section"?[{...n,zone:L(r.id)}]:[n]})),a=e?t.floors.map(r=>({id:L(r.id),label:r.name,focalPoint:{...r.focalPoint}})):t.zones;return{...t,objects:s,zones:a,floors:void 0,referenceImage:void 0,backgroundImage:E(t)}}function N(t){let e=t.floors;if(!e?.length)return null;let o=e.find(r=>r.objects.some(n=>n.type==="shape"&&n.role==="stage"));if(o)return o.id;let s=e[0],a=-1;for(let r of e){let n=R(X(t,r.objects,r.focalPoint),{freeText:"exclude"}),c=n.width*n.height;c>a&&(a=c,s=r)}return s.id}var U=640;function tt(t,e){return(t.floors?.length??0)<2?null:t.floorOverview==="combined"||!Number.isFinite(e)||e<=0||e>=U?"all":N(t)}var Z=9;function $(t){if(t.kind==="circle")return{hx:t.r,hy:t.r};let e=t.width/2,o=t.height/2,s=t.rotation??0;if(!s)return{hx:e,hy:o};let a=s*Math.PI/180,r=Math.abs(Math.cos(a)),n=Math.abs(Math.sin(a));return{hx:e*r+o*n,hy:e*n+o*r}}function q(t,e,o){let s=e-t.seat.x,a=o-t.seat.y;if(t.shape.kind==="circle")return s*s+a*a<=t.shape.r*t.shape.r;let r=t.shape.rotation??0,n=s,c=a;if(r){let h=-r*Math.PI/180,u=Math.cos(h),x=Math.sin(h);n=s*u-a*x,c=s*x+a*u}return Math.abs(n)<=t.shape.width/2&&Math.abs(c)<=t.shape.height/2}function G(t,e,o,s,a){if(t.shape.kind==="circle"){let f=Math.min(Math.max(t.seat.x,e),s),m=Math.min(Math.max(t.seat.y,o),a),d=t.seat.x-f,p=t.seat.y-m;return d*d+p*p<=t.shape.r*t.shape.r}let r=t.shape.rotation??0;if(!r)return t.seat.x-t.hx<=s&&t.seat.x+t.hx>=e&&t.seat.y-t.hy<=a&&t.seat.y+t.hy>=o;let n=r*Math.PI/180,c=Math.cos(n),h=Math.sin(n),u=t.shape.width/2,x=t.shape.height/2,y=[[-u,-x],[u,-x],[u,x],[-u,x]].map(([f,m])=>[t.seat.x+f*c-m*h,t.seat.y+f*h+m*c]),S=[[e,o],[s,o],[s,a],[e,a]],I=[[1,0],[0,1],[c,h],[-h,c]];for(let[f,m]of I){let d=1/0,p=-1/0;for(let[P,O]of y){let i=P*f+O*m;i<d&&(d=i),i>p&&(p=i)}let M=1/0,w=-1/0;for(let[P,O]of S){let i=P*f+O*m;i<M&&(M=i),i>w&&(w=i)}if(p<M||w<d)return!1}return!0}function ot(t,e={}){let o=e.seatRadius??Z,s=t.length,a=new Array(s),r=1/0,n=1/0,c=-1/0,h=-1/0,u=0;for(let i=0;i<s;i++){let l=t[i],D=e.shapeOf?.(l)??{kind:"circle",r:o},{hx:g,hy:b}=$(D);a[i]={seat:l,shape:D,hx:g,hy:b},l.x-g<r&&(r=l.x-g),l.y-b<n&&(n=l.y-b),l.x+g>c&&(c=l.x+g),l.y+b>h&&(h=l.y+b),g>u&&(u=g),b>u&&(u=b)}s===0&&(r=0,n=0,c=0,h=0);let x=u>0?u*4:1,y=Math.max(c-r,0),S=Math.max(h-n,0),I=Math.max(64,e.maxCells??s*4),f=x,m=Math.max(1,Math.ceil(y/f)||1),d=Math.max(1,Math.ceil(S/f)||1);for(;m*d>I&&(m>1||d>1);)f*=2,m=Math.max(1,Math.ceil(y/f)||1),d=Math.max(1,Math.ceil(S/f)||1);let p=m*d,M=new Int32Array(p+1),w=0;for(let i=0;i<s;i++){let l=a[i],D=v(Math.floor((l.seat.x-l.hx-r)/f),0,m-1),g=v(Math.floor((l.seat.x+l.hx-r)/f),0,m-1),b=v(Math.floor((l.seat.y-l.hy-n)/f),0,d-1),F=v(Math.floor((l.seat.y+l.hy-n)/f),0,d-1);for(let A=b;A<=F;A++)for(let C=D;C<=g;C++)M[A*m+C+1]++,w++}for(let i=0;i<p;i++)M[i+1]+=M[i];let P=new Int32Array(w),O=M.slice(0,p);for(let i=0;i<s;i++){let l=a[i],D=v(Math.floor((l.seat.x-l.hx-r)/f),0,m-1),g=v(Math.floor((l.seat.x+l.hx-r)/f),0,m-1),b=v(Math.floor((l.seat.y-l.hy-n)/f),0,d-1),F=v(Math.floor((l.seat.y+l.hy-n)/f),0,d-1);for(let A=b;A<=F;A++)for(let C=D;C<=g;C++){let k=A*m+C;P[O[k]++]=i}}return{seats:t,entries:a,minX:r,minY:n,cell:f,cols:m,rows:d,cellStart:M,items:P,stamp:new Int32Array(s),epoch:0}}function rt(t,e,o={}){let{cols:s,rows:a,cell:r,minX:n,minY:c,cellStart:h,items:u,entries:x}=t,y=Math.floor((e.x-n)/r),S=Math.floor((e.y-c)/r);if(y<0||S<0||y>=s||S>=a)return null;let I=S*s+y,f=h[I+1],m=-1,d=1/0;for(let p=h[I];p<f;p++){let M=u[p],w=x[M];if(o.filter&&!o.filter(w.seat.id,w.seat)||!q(w,e.x,e.y))continue;let P=e.x-w.seat.x,O=e.y-w.seat.y,i=P*P+O*O;(i<d||i===d&&M<m)&&(d=i,m=M)}return m<0?null:x[m].seat.id}function st(t,e,o,s={}){if(!(o>0))return null;let{cols:a,rows:r,cell:n,minX:c,minY:h,cellStart:u,items:x,entries:y}=t,S=Math.max(0,Math.floor((e.x-o-c)/n)),I=Math.min(a-1,Math.floor((e.x+o-c)/n)),f=Math.max(0,Math.floor((e.y-o-h)/n)),m=Math.min(r-1,Math.floor((e.y+o-h)/n));if(S>I||f>m)return null;let d=-1,p=o*o,M=t.stamp,w=++t.epoch;for(let P=f;P<=m;P++){let O=P*a;for(let i=S;i<=I;i++){let l=O+i,D=u[l+1];for(let g=u[l];g<D;g++){let b=x[g];if(M[b]===w)continue;M[b]=w;let F=y[b];if(s.filter&&!s.filter(F.seat.id,F.seat))continue;let A=e.x-F.seat.x,C=e.y-F.seat.y,k=A*A+C*C;(k<p||k===p&&b<d)&&(p=k,d=b)}}}return d<0?null:y[d].seat.id}function at(t,e,o={}){let s=Math.min(e.x,e.x+e.width),a=Math.max(e.x,e.x+e.width),r=Math.min(e.y,e.y+e.height),n=Math.max(e.y,e.y+e.height),c=o.mode??"center",{cols:h,rows:u,cell:x,minX:y,minY:S,cellStart:I,items:f,entries:m}=t,d=Math.max(0,Math.floor((s-y)/x)),p=Math.min(h-1,Math.floor((a-y)/x)),M=Math.max(0,Math.floor((r-S)/x)),w=Math.min(u-1,Math.floor((n-S)/x));if(d>p||M>w)return[];let P=[],O=t.stamp,i=++t.epoch;for(let l=M;l<=w;l++){let D=l*h;for(let g=d;g<=p;g++){let b=D+g,F=I[b+1];for(let A=I[b];A<F;A++){let C=f[A];if(O[C]===i)continue;O[C]=i;let k=m[C];if(o.filter&&!o.filter(k.seat.id,k.seat))continue;(c==="center"?k.seat.x>=s&&k.seat.x<=a&&k.seat.y>=r&&k.seat.y<=n:G(k,s,r,a,n))&&P.push(C)}}}return P.sort((l,D)=>l-D),P.map(l=>m[l].seat.id)}function ct(t){let e=t.cols*t.rows,o=0,s=0;for(let r=0;r<e;r++){let n=t.cellStart[r+1]-t.cellStart[r];n>0&&o++,n>s&&(s=n)}let a=t.items.length;return{cell:t.cell,cols:t.cols,rows:t.rows,cells:e,occupiedCells:o,refs:a,maxPerCell:s,meanPerOccupiedCell:o?a/o:0}}function lt(t,e=0){let o=Math.max(1,t.width,t.height),s={x:t.x+t.width/2,y:t.y+t.height/2},a=o*1.55,r=Math.max(o*.82,Math.max(0,e)+o*.45);return{target:s,distance:a,height:r,focalLength:Math.hypot(a,r),yawRad:-8*Math.PI/180}}function B(t,e,o=0){let s=e.x-t.target.x,a=e.y-t.target.y,r=Math.cos(t.yawRad),n=Math.sin(t.yawRad),c=s*r-a*n,u=s*n+a*r-t.distance,x=o-t.height,y=Math.hypot(t.distance,t.height),S=(-t.distance*u-t.height*x)/y,I=(-t.height*u+t.distance*x)/y,f=Math.max(y*.08,S),m=t.focalLength/f;return{x:t.target.x+c*m,y:t.target.y-I*m,depth:f,scale:m}}function ht(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function ut(t){let e=t.a*t.d-t.b*t.c;if(!Number.isFinite(e)||Math.abs(e)<1e-9)throw new Error("perspective projection produced a singular affine");let o=t.d/e,s=-t.b/e,a=-t.c/e,r=t.a/e;return{a:o,b:s,c:a,d:r,e:-(o*t.e+a*t.f),f:-(s*t.e+r*t.f)}}function mt(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function xt(t,e,o=()=>0){let s=B(t,e,o(e)),a={x:e.x+1,y:e.y},r={x:e.x,y:e.y+1},n=B(t,a,o(a)),c=B(t,r,o(r)),h=n.x-s.x,u=n.y-s.y,x=c.x-s.x,y=c.y-s.y;return{a:h,b:u,c:x,d:y,e:s.x-h*e.x-x*e.y,f:s.y-u*e.x-y*e.y}}function ft(t){let e=Math.hypot(t.a,t.b),o=t.a*t.d-t.b*t.c;return{rotationDeg:Math.atan2(t.b,t.a)*180/Math.PI,scaleX:e,scaleY:o/Math.max(e,1e-9),skewX:(t.a*t.c+t.b*t.d)/Math.max(o,1e-9)}}export{T as a,L as b,Q as c,V as d,W as e,N as f,U as g,tt as h,Z as i,ot as j,rt as k,st as l,at as m,ct as n,lt as o,B as p,ht as q,ut as r,mt as s,xt as t,ft as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as Ie,i as ce}from"./chunk-5ITK5236.js";import{c as Pe}from"./chunk-CRCGO52K.js";var Yn=2e6,Mt=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,St=/[\s"'<>`\\]/;function vt(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Mt.test(e);if(St.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function Ce(e){let t=e.trim();return vt(t)?t:null}var wt=2e5,Wn=1e5,Et="large_venue_inventory";function $n(e){return e?.includes(Et)?2e5:1e5}var Z="seatlayer.event-configuration/1",le="seatlayer.event-configuration-export/1",K=100,It=120,Pt=2e5,Ct=1e4,ke=/^[a-f0-9]{64}$/,_t=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function Y(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 Re(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function _e(e){return!Array.isArray(e)||e.length>Pt||!e.every(t=>H(t,K))?null:[...new Set(e)].sort()}function Te(e){return!Y(e)||!H(e.chartId,K)||!H(e.version,K)||e.sha256!==void 0&&(typeof e.sha256!="string"||!ke.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function ue(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function kt(e){return Y(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&ue(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function Rt(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>Ct)return null;let n=new Set(t),i=new Set,o=new Set,r=0,s=[];for(let l of e){if(!Y(l)||!H(l.id,K)||!H(l.objectId,K)||!n.has(l.objectId)||!_t.has(String(l.kind))||!ue(l.heightM,.05,50)||l.baseElevationM!==void 0&&!ue(l.baseElevationM,-10,100))return null;let m=kt(l.occlusion);if(!m||i.has(l.id)||o.has(l.objectId))return null;let a=l.contentImageUrl===void 0?void 0:typeof l.contentImageUrl=="string"?Ce(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:m,...a?{contentImageUrl:a}:{}})}return s.sort((l,m)=>l.id.localeCompare(m.id))}function Oe(e){let t=[];if(!Y(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==Z&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${Z}`}),H(e.id,K)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),H(e.label,It)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),Re(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Te(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=Y(e.overlay)?e.overlay:null,o=_e(i?.objectIds),r=_e(i?.productionKillSeatIds),s=o?Rt(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:Z,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:o,productionKillSeatIds:r,...s!==void 0?{productionElements:s}:{}}}}}function Jn(e){let t=Oe(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function Zn(e){if(!Y(e))return{ok:!1,issues:[{code:"invalid_export",path:"",message:"Export must be an object"}]};let t=[];e.schema!==le&&t.push({code:"unsupported_schema",path:"schema",message:`Export schema must be ${le}`}),(typeof e.contentSha256!="string"||!ke.test(e.contentSha256))&&t.push({code:"invalid_checksum",path:"contentSha256",message:"Export checksum must be a lowercase SHA-256 digest"});let n=Oe(e.configuration);return t.push(...n.issues),t.length||!n.value||typeof e.contentSha256!="string"?{ok:!1,issues:t}:{ok:!0,value:{schema:le,configuration:n.value,contentSha256:e.contentSha256}}}function eo(e){return JSON.stringify({schema:Z,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 to(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 Tt={draft:new Set(["review","archived"]),review:new Set(["draft","approved","archived"]),approved:new Set(["published","archived"]),published:new Set(["archived"]),archived:new Set};function no(e,t){return e===t||Tt[e].has(t)}function oo(e,t,n){return!Re(n)||n>=t.version?null:e.find(i=>i.id===t.id&&i.version===n&&i.status==="published")??null}function Ot(e){return e.floors?.length?e.floors.flatMap(t=>t.objects):e.objects}function de(e,t,n){if(!(!e||typeof e!="object")){if(Array.isArray(e)){for(let i of e)de(i,t,n);return}for(let[i,o]of Object.entries(e)){if(i==="eventConfigurationId"){H(o,K)?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,K)?t.add(r):n.add(String(r));continue}de(o,t,n)}}}function io(e,t){let n=Te(t);if(!n)return{ok:!1,invalidIds:["baseVenue"]};let i=new Set,o=new Set;if(de(e,i,o),o.size)return{ok:!1,invalidIds:[...o].sort()};let r=Ot(e);return{ok:!0,configurations:[...i].sort().map(s=>({schema:Z,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 so=40,ao=1200,co=.8,lo=3,uo=-2,fo=20,ho=.1,mo=40,po=40,Ae=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function At(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/Ae(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 m=l.length;s&&s+1+m<=i?s+=1+m:(o+=Math.max(1,Math.ceil(m/i)),s=m%i)}}return Math.max(1,o)}function Ne(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),i=Math.max(1,...n.map(l=>l.length))*Ae(e),o=e.width??i+t*2,r=Math.max(1,o-t*2),s=At(e,r);return{width:o,height:s*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:s,padding:t}}var Nt=Math.PI/180;function k(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function jt(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 yo(e,t){return jt(e,{x:0,y:0},t*Nt)}function L(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Lt(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 go(e){return e.length?Lt(e):null}function fe(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 So(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 Fe(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[fe(e,.5)];let i=Array.from({length:n+1},(m,a)=>fe(e,a/n)),o=new Float64Array(i.length);for(let m=1;m<i.length;m+=1){let a=i[m].x-i[m-1].x,c=i[m].y-i[m-1].y;o[m]=o[m-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 m=0;m<t;m+=1){let a=r*m/(t-1);for(;l<o.length-1&&o[l]<a;)l+=1;let c=o[l-1],u=o[l],h=u===c?0:(a-c)/(u-c);s.push({x:i[l-1].x+(i[l].x-i[l-1].x)*h,y:i[l-1].y+(i[l].y-i[l-1].y)*h})}return s}function F(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ee(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 oe(e,t=13){return Array.from({length:t},(n,i)=>fe(e,i/(t-1)))}function je(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),i=Math.min(e.length-2,Math.floor(n));return L(e[i],e[i+1],n-i)}function Le(e,t,n){let i=Math.max(0,Math.min(1,t)),o=Math.max(i,Math.min(1,n)),r=[je(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(je(e,o)),r}function De(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],i=0,o=Number.POSITIVE_INFINITY;n.forEach(([h,d],p)=>{let f=k(L(e[h],e[d],.5),t);f<o&&(o=f,i=p)});let r=e[i],s=e[(i+1)%4],l=e[(i+2)%4],m=e[(i+3)%4],a=L(r,s,.5),c=ee(t,a),u=Math.max(1e-9,Math.hypot(c.x,c.y));return{p0:r,p1:s,p2:l,p3:m,normal:D(c,1/u),depth:(k(r,m)+k(s,l))/2}}function Ve(e){let{p0:t,p1:n,p2:i,p3:o,normal:r,depth:s}=e,l=ee(n,t),m=ee(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(m,2/3)),D(r,c)),control2:F(F(o,D(m,1/3)),D(r,c)),end:o}}}function vo(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let i=e.reduce((p,f)=>F(p,f),{x:0,y:0});i.x/=4,i.y/=4;let o=k(e[0],e[1]),r=k(e[0],e[3]),s=n==="auto"?o>r*1.25&&k(i,t)>r?"bezier":"tapered":n;if(s==="rectangle")return{mode:s,outline:e.map(p=>({...p}))};let l=De(e,t),{p0:m,p1:a,p2:c,p3:u}=l;if(s==="tapered")return{mode:s,outline:[F(m,D(ee(a,m),.14)),F(m,D(ee(a,m),1-.14)),c,u]};let{nearPath:h,farPath:d}=Ve(l);return{mode:s,outline:[...oe(h),...oe(d).slice(1)]}}function wo(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=De(e,t),{p0:r,p1:s,p2:l,p3:m}=o,a=i==="bezier"?Ve(o):null,c=a?oe(a.nearPath):null,u=a?oe(a.farPath).reverse():null,h=Math.min(.055,.18/(n+1));return Array.from({length:n},(d,p)=>{let f=(p+1)/(n+1),y=f-h/2,S=f+h/2;return c&&u?[...Le(c,y,S),...Le(u,y,S).reverse()]:[L(r,s,y),L(r,s,S),L(m,l,S),L(m,l,y)]})}function Ft(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 Dt(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=Ft(e,i[r],i[o]);s<n&&(n=s)}return n}function He(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,m=t[o].y;s>e.y!=m>e.y&&e.x<(l-r)*(e.y-s)/(m-s)+r&&(n=!n)}return n}function Ke(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function Vt(e,t,n){let i=He(e,t)&&!n.some(r=>He(e,r)),o=Dt(e,[t,...n]);return i?o:-o}function z(e,t,n,i,o){let r=Vt({x:e,y:t},i,o);return{x:e,y:t,h:n,d:r,max:r+n*Math.SQRT2}}var he=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 Ue(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 Io(e,t){return Math.max(0,Ue(e)-Ke(t).reduce((n,i)=>n+Ue(i),0))}function Ge(e,t){let n=Ke(t);if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let f=e.reduce((S,E)=>S+E.x,0)/e.length,y=e.reduce((S,E)=>S+E.y,0)/e.length;return{point:{x:f,y},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,m=s-o,a=Math.min(l,m);if(!(a>0))return{point:{x:(i+r)/2,y:(o+s)/2},radius:0};let c=Math.max(l,m)/150,u=new he,h=a/2;for(let f=i;f<r;f+=a)for(let y=o;y<s;y+=a)u.push(z(f+h,y+h,h,e,n));let d=z(i+l/2,o+m/2,0,e,n),p=0;for(;u.size;){let f=u.pop();if(!f)break;f.d>d.d&&(d=f),!(f.max-d.d<=c)&&(p>=4e3||(p+=1,h=f.h/2,u.push(z(f.x-h,f.y-h,h,e,n)),u.push(z(f.x+h,f.y-h,h,e,n)),u.push(z(f.x-h,f.y+h,h,e,n)),u.push(z(f.x+h,f.y+h,h,e,n))))}return{point:{x:d.x,y:d.y},radius:Math.max(0,d.d)}}function Ht(e,t,n){return Math.max(t,Math.min(n,e))}function Co(e,t,n){return e<t?t:e>n?n:e}function Ut(e){return Ht(e,0,1)}function Xe(e){let t=Ut(e);return t*t*(3-2*t)}var W=Math.PI*2;function $(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function Kt(e,t,n){let i=t-e;if(n){for(;i<0;)i+=W;for(;i>=W;)i-=W}else{for(;i>0;)i-=W;for(;i<=-W;)i+=W}return i}function To(e){return e.end}function ze(e){if(e.version!==1||e.closed!==!0||!$(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||!$(n.end))return!1;if(n.kind==="line"){if(k(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!$(n.control1)||!$(n.control2)||k(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!$(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(k(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(k(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||k(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return k(t,e.start)<=1e-4}function Gt(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 Oo(e,t=2){if(!ze(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),m=Kt(s,l,r.clockwise),a=Math.max(2,Math.ceil(Math.abs(m)*r.radius/n));for(let c=1;c<=a;c+=1){let u=s+m*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=k(o,r.control1)+k(r.control1,r.control2)+k(r.control2,r.end),l=Math.max(2,Math.ceil(s/n));for(let m=1;m<=l;m+=1)i.push(Gt(o,r,m/l))}o=r.end}return k(i[i.length-1],i[0])<=1e-4&&i.pop(),i}function We(e,t,n){return Xt(e,o=>({x:o.x+t,y:o.y+n}))}function Xt(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)})}}var Bt=45,me=150,Yt=60;function zt(e){let t=Bt/100;if(e<=t)return me;let n=Math.min(1,(e-t)/(1-t));return me-n*(me-Yt)}var Be=.5523;function Ye(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function Wt(e){let t=[],n=[];for(e.forEach((i,o)=>{$(i)&&(t.length&&Ye(t[t.length-1],i)||(t.push({x:i.x,y:i.y}),n.push(o)))});t.length>1&&Ye(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function Ao(e,t,n){return Jt(e,{cornerSmoothing:t,...n})}var $t=.5,qt=4/3;function Qt(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,m=n*qt;return{kind:"bezier",control1:{x:e.x+i/3+s*m,y:e.y+o/3+l*m},control2:{x:e.x+i*2/3+s*m,y:e.y+o*2/3+l*m},end:{...t}}}function Jt(e,t){let{points:n,sourceIndex:i}=Wt(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 g=0;g<o;g+=1){let M=s[i[g]];l[g]=Number.isFinite(M)?Math.min(100,Math.max(-100,M))/100:0}let m=l.some(g=>Math.abs(g)>1e-6);if(r<=0&&!m)return null;let a=t.wideAngleThresholdDeg??zt(r),c=[];for(let g=0;g<o;g+=1)c[g]=k(n[g],n[(g+1)%o]);let u=new Array(o).fill(0);for(let g=0;g<o;g+=1){let M=n[(g-1+o)%o],b=n[g],x=n[(g+1)%o],w={x:M.x-b.x,y:M.y-b.y},v={x:x.x-b.x,y:x.y-b.y},P=Math.hypot(w.x,w.y),A=Math.hypot(v.x,v.y);if(P<=1e-9||A<=1e-9)continue;let C=Math.min(1,Math.max(-1,(w.x*v.x+w.y*v.y)/(P*A))),R=Math.acos(C)*180/Math.PI;if(R<a)continue;let T=Xe((R-a)/(180-a));u[g]=r*T*.5*Math.min(P,A)}for(let g=0;g<o;g+=1){let M=(g+1)%o,b=u[g]+u[M];if(b>c[g]&&b>1e-9){let x=c[g]/b;u[g]*=x,u[M]*=x}}let h=new Array(o),d=new Array(o);for(let g=0;g<o;g+=1){let M=n[(g-1+o)%o],b=n[g],x=n[(g+1)%o];if(u[g]<=1e-6){h[g]={...b},d[g]={...b};continue}let w=k(b,M)||1,v=k(b,x)||1;h[g]={x:b.x+(M.x-b.x)/w*u[g],y:b.y+(M.y-b.y)/w*u[g]},d[g]={x:b.x+(x.x-b.x)/v*u[g],y:b.y+(x.y-b.y)/v*u[g]}}if(u.every(g=>g<=1e-6)&&!m)return null;let p=[],f={...d[0]},y=f,S=(g,M)=>{if(k(y,g)<=1e-9)return;let b=l[M];Math.abs(b)>1e-6?p.push(Qt(y,g,b*$t*c[M])):p.push({kind:"line",end:{...g}}),y=g};for(let g=1;g<=o;g+=1){let M=g%o,b=n[M];S(h[M],(g-1)%o),u[M]>1e-6&&k(h[M],d[M])>1e-9&&(p.push({kind:"bezier",control1:L(h[M],b,Be),control2:L(d[M],b,Be),end:{...d[M]}}),y=d[M])}if(!p.length)return null;let E=p[p.length-1];k(E.end,f)>1e-9&&(E.kind==="line"?E.end={...f}:p.push({kind:"line",end:{...f}}));let I={version:1,closed:!0,start:f,segments:p};return ze(I)?I:null}function No(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 Lo(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 m=Math.max(1,Math.round(l/n)),a=l/m,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,p=u?{...r}:{x:r.x+Math.cos(c)*a*d,y:r.y+Math.sin(c)*a*d},f=u?m+1:Math.max(1,m-(d-1));i.push({origin:p,rotation:c*180/Math.PI,seatCount:f,seatSpacing:a})}return i}function Fo(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 Do(e){return e.reduce((t,n)=>t+n.seatCount,0)}function $e(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((h,d)=>h.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((h,d)=>h.segmentedRow?.kind==="segmented-row-v1"&&h.segmentedRow.groupId===i&&h.segmentedRow.componentCount===s&&h.segmentedRow.componentIndex===d&&h.segmentedRow.repeatLabelOnComponents===l.repeatLabelOnComponents&&(d===0?h.segmentedRow.boundaryBefore==="start":h.segmentedRow.boundaryBefore!=="start")&&h.segmentedRow.displayLabel===l.displayLabel)))continue;let a=r.reduce((h,d)=>h+d.seatCount,0),c=0,u=0;for(let h of r)h.segmentedRow.boundaryBefore==="break"&&(c+=1),t.set(h.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+=h.seatCount,u+=h.seatCount}return t}var q=.02291666666666667,Ho=1/q,Zt=58,en=Zt*q,qe=0,Je=3,Qe=0,pe=120,tn=0,nn=45,on=7,Q=1.2;function be(e,t,n,i){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):i}function Uo(e){return Number.isFinite(e)?Math.max(qe,Math.min(Je,Math.round(e))):qe}function rn(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=on?e:Je}function Ze(e,t={}){let n=be(t.floorBaseHeightM,Qe,pe,0),i=Math.min(pe,n+rn(e.elevation)*en),o=e.height===void 0?i:be(e.height,Qe,pe,i),r=be(e.rake,tn,nn,0);return{height:o,rake:r}}function et(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 tt(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,m=s.y-r.y,a=l*l+m*m,c=a>1e-12?((t-r.x)*l+(n-r.y)*m)/a:0;c<0?c=0:c>1&&(c=1);let u=t-(r.x+c*l),h=n-(r.y+c*m);if(Math.abs(u)>=i||Math.abs(h)>=i)continue;let d=Math.hypot(u,h);d<i&&(i=d)}return i}function sn(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 nt(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function ye(e,t){let n=1/0;for(let i of et(e)){let o=tt(t,i.x,i.y);o<n&&(n=o)}for(let i of et(t)){let o=tt(e,i.x,i.y);o<n&&(n=o)}return n}function an(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,m=Math.hypot(s,l);m>1e-9?(s/=m,l/=m):(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 cn(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,m=0,a=0,c=0;for(let E of e){let I=E.x-n,g=E.y-i;o+=I*I,s+=g*g,r+=I*g,l+=I*I*I,m+=g*g*g,a+=I*g*g,c+=g*I*I}let u=o*s-r*r;if(Math.abs(u)<1e-9)return null;let h=(l+a)/2,d=(m+c)/2,p=(h*s-d*r)/u,f=(d*o-h*r)/u,y=p+n,S=f+i;return!Number.isFinite(y)||!Number.isFinite(S)?null:{cx:y,cy:S}}var ln=.15;function un(e){if(e.length<2)return null;let t=e.map(E=>{let I=0,g=0;for(let M of E.pts)I+=M.x,g+=M.y;return{x:I/E.pts.length,y:g/E.pts.length}}),n=0,i=0;for(let E of t)n+=E.x,i+=E.y;n/=t.length,i/=t.length;let o=0,r=0,s=0;for(let E of t){let I=E.x-n,g=E.y-i;o+=I*I,r+=I*g,s+=g*g}let l=o+s,m=o*s-r*r,a=l/2+Math.sqrt(Math.max(0,l*l/4-m)),c,u;Math.abs(r)>1e-12?(c=a-s,u=r):o>=s?(c=1,u=0):(c=0,u=1);let h=Math.hypot(c,u);if(!(h>1e-12))return null;c/=h,u/=h;let d=1/0,p=-1/0,f=[];for(let E of e){let I=1/0,g=-1/0;for(let M of E.pts){let b=M.x*c+M.y*u;b<I&&(I=b),b>g&&(g=b),b<d&&(d=b),b>p&&(p=b)}f.push(g-I)}let y=p-d;return y>1e-9?(f.sort((E,I)=>E-I),f[Math.min(f.length-1,Math.floor(f.length*.9))]/y<=dn?{x:c,y:u}:null):null}var dn=.35;function ot(e,t,n,i){let o=new Map;for(let b of n){let x=t[b],w=x.rowId||`__seat-${b}`,v=o.get(w);v||(v={pts:[],idx:[]},o.set(w,v)),v.pts.push({x:x.x,y:x.y}),v.idx.push(b)}if(!o.size)return{sectionId:e,rows:[],blockCount:0};let r=[];for(let[b,x]of o){let w=an(x.pts,x.idx),v=0;for(let P of w.pts)v+=Math.hypot(P.x-i.x,P.y-i.y);r.push({id:b,pts:w.pts,seatIndices:w.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:v/w.pts.length})}let s=r.map(b=>sn(b.pts)),l=r.length<=256?r.length*(r.length-1)/2:0,m=l?new Float64Array(l):null;m?.fill(Number.NaN);let a=m?new Map(r.map((b,x)=>[b,x])):null,c=(b,x)=>(b>x&&([b,x]=[x,b]),b*(2*r.length-b-1)/2+(x-b-1)),u=(b,x)=>{if(!m)return ye(r[b].pts,r[x].pts);let w=c(b,x),v=m[w];if(!Number.isNaN(v))return v;let P=ye(r[b].pts,r[x].pts);return m[w]=P,P},h=(b,x)=>a?u(a.get(b),a.get(x)):ye(b.pts,x.pts),d=[];for(let b=0;b<r.length;b++){let x=1/0;for(let w=0;w<r.length;w++){if(b===w||nt(s[b],s[w])>=x)continue;let v=u(b,w);v<x&&(x=v)}Number.isFinite(x)&&d.push(x)}d.sort((b,x)=>b-x);let p=d.length?d[Math.floor(d.length/2)]:1,f=Math.max(p*1.8,1e-6),y=r.map(()=>[]);for(let b=0;b<r.length;b++)for(let x=b+1;x<r.length;x++)nt(s[b],s[x])>f||u(b,x)<=f&&(y[b].push(x),y[x].push(b));let S=0;for(let b=0;b<r.length;b++){if(r[b].blockId!==-1)continue;let x=S++,w=[b];for(r[b].blockId=x;w.length;){let v=w.pop();for(let P of y[v])r[P].blockId===-1&&(r[P].blockId=x,w.push(P))}}let E=new Map;for(let b of r){let x=E.get(b.blockId)??[];x.push(b),E.set(b.blockId,x)}let I=[];for(let b of r){if(b.pts.length<4)continue;let x=cn(b.pts);x&&(!Number.isFinite(x.cx)||!Number.isFinite(x.cy)||I.push({x:x.cx,y:x.cy}))}let g=I.length>=2?(()=>{let b=I.map(v=>v.x).sort((v,P)=>v-P),x=I.map(v=>v.y).sort((v,P)=>v-P),w=Math.floor(I.length/2);return{cx:b[w],cy:x[w]}})():null;if(g){let b=C=>Math.hypot(C.x-g.cx,C.y-g.cy),x=1/0,w=-1/0,v=[];for(let C of r){let R=1/0,T=-1/0;for(let N of C.pts){let O=b(N);O<R&&(R=O),O>T&&(T=O)}v.push(T-R),R<x&&(x=R),T>w&&(w=T)}let P=w-x;v.sort((C,R)=>C-R);let A=v[Math.min(v.length-1,Math.floor(v.length*.9))];if(P>1e-9&&A/P<=ln){let C=r.map(_=>{let ne=0;for(let xt of _.pts)ne+=b(xt);return{row:_,radius:ne/_.pts.length}}),R=0,T=0;for(let _ of C)R+=_.radius,T+=_.row.focalDistance;R/=C.length,T/=C.length;let N=0;for(let _ of C)N+=(_.radius-R)*(_.row.focalDistance-T);if(N<0)for(let _ of C)_.radius=-_.radius;let j=1/0;for(let _ of C)_.radius<j&&(j=_.radius);C.sort((_,ne)=>_.radius-ne.radius);let V=-1,B=-1/0,gt=P/Math.max(1,C.length)*.5,Ee=[];for(let _ of C)_.radius-B>gt&&(V++,B=_.radius),_.row.ordinal=V,_.row.blockDepth=_.radius-j,Ee.push(_.row);return{sectionId:e,rows:Ee,blockCount:S}}}let M=[];for(let[,b]of E){let x=un(b);if(x){let w=P=>{let A=0;for(let C of P.pts)A+=C.x*x.x+C.y*x.y;return A/P.pts.length};b.sort((P,A)=>w(P)-w(A)),b.length>=2&&b[0].focalDistance>b[b.length-1].focalDistance&&b.reverse();let v=0;for(let P=0;P<b.length;P++)P>0&&(v+=h(b[P-1],b[P])),b[P].ordinal=P,b[P].blockDepth=v,M.push(b[P])}else{let w=1/0;for(let v of b)v.focalDistance<w&&(w=v.focalDistance);b.sort((v,P)=>v.focalDistance-P.focalDistance);for(let v=0;v<b.length;v++)b[v].ordinal=v,b[v].blockDepth=Math.max(0,b[v].focalDistance-w),M.push(b[v])}}return{sectionId:e,rows:M,blockCount:S}}var Xo=[{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."}],fn=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]),hn=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function mn(e){return!!e&&fn.has(e)}function Bo(e){return!!e&&hn.has(e)}var it=1.1,pn={"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}},bn={"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"};var rt=Math.PI*2;function st(e,t,n,i,o,r){return{x:o+e*n-t*i,y:r+e*i+t*n}}function Yo(e){let{kind:t,cx:n,cy:i,width:o,height:r}=e,s=(e.rotation??0)*Math.PI/180,l=Math.cos(s),m=Math.sin(s),a=o/2,c=r/2,u=[],h=(d,p)=>{u.push({x:d,y:p})};switch(t){case"rect":{h(-a,-c),h(a,-c),h(a,c),h(-a,c);break}case"rounded":{let d=Math.min(o,r)*.18,p=5,f=(y,S,E)=>{for(let I=0;I<=p;I++){let g=E+I/p*(Math.PI/2);h(y+d*Math.cos(g),S+d*Math.sin(g))}};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;h(-a,-c),h(a,-c);let p=24;for(let f=0;f<=p;f++){let y=f/p,S=a-y*o,E=c+d*(1-Math.pow(2*S/o,2));h(S,E)}break}case"thrust":{let d=o*.18,p=r*1.1;h(-a,-c),h(a,-c),h(a,c),h(d,c),h(d,c+p),h(-d,c+p),h(-d,c),h(-a,c);break}case"runway":{let d=o*.1,p=r*3;h(-a,-c),h(a,-c),h(a,c),h(d,c),h(d,c+p),h(-d,c+p),h(-d,c),h(-a,c);break}case"round":case"oval-cricket":{for(let p=0;p<40;p++){let f=p/40*rt;h(a*Math.cos(f),c*Math.sin(f))}break}case"pitch-football":case"pitch-rugby":case"court-basketball":case"court-tennis":case"ring-boxing":{h(-a,-c),h(a,-c),h(a,c),h(-a,c);break}case"diamond-baseball":{for(let d of gn(a,c))h(d.x,d.y);break}case"rink-hockey":{for(let d of yn(a,c,a*(8.5/60),c*(8.5/30)))h(d.x,d.y);break}case"track-athletics":{for(let d of ge(a,c))h(d.x,d.y);break}}return u.map(d=>st(d.x,d.y,l,m,n,i))}function yn(e,t,n,i){let o=[],s=(l,m,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:m+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 ge(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 X=(()=>{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),m=Math.atan2(i.y-o,-i.x);for(let a=0;a<=24;a++){let c=l+(m-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 gn(e,t){let n=e/X.half,i=t/X.half;return[{x:-X.backstop*n,y:t},{x:X.backstop*n,y:t},...X.fence.map(o=>({x:o.x*n,y:o.y*i}))]}var xn="#f1f5f9";function xe(e){return mn(e)}function G(e,t,n,i,o=32){let r=[];for(let s=0;s<o;s++){let l=s/o*rt;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 Mn(e){let{kind:t,cx:n,cy:i,width:o,height:r}=e,s=(e.rotation??0)*Math.PI/180,l=Math.cos(s),m=Math.sin(s),a=o/2,c=r/2,u=[],h=pn[t],d=f=>h?f/h.width*o:0,p=f=>h?f/h.height*r:0;switch(t){case"pitch-football":{u.push({points:[{x:0,y:-c},{x:0,y:c}],closed:!1}),u.push({points:G(0,0,d(9.15),p(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,p(40.32)/2),closed:!0}),u.push({points:U(f*(a-d(5.5)/2),0,d(5.5)/2,p(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:-p(11)},{x:f*(a-d(4)),y:p(11)}],closed:!1,ink:"#d63b3b"});for(let y of[-1,1])u.push({points:G(f*d(20.5),y*p(7),d(4.5),p(4.5)),closed:!0,ink:"#2f6ecb"})}u.push({points:G(0,0,d(4.5),p(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let y=c-p(1.22)*8;y>0&&u.push({points:ge(a-d(1.22)*8,y),closed:!0,fill:"#2f7d4f"});for(let S=1;S<8;S++){let E=p(1.22)*S,I=c-E;if(I<=0)break;u.push({points:ge(a-d(1.22)*S,I),closed:!0})}break}case"oval-cricket":{u.push({points:G(0,0,d(27.4),p(27.4+20.12/2),40),closed:!0}),u.push({points:U(0,0,d(3.05)/2,p(20.12)/2),closed:!0,ink:"#d8cfae"});break}case"pitch-rugby":{let f=y=>({points:[{x:d(y),y:-c},{x:d(y),y:c}],closed:!1});u.push(f(0));for(let y of[-1,1]){u.push(f(y*50),f(y*28));for(let S=-35;S<35;S+=4)u.push({points:[{x:d(y*10),y:p(S)},{x:d(y*10),y:p(Math.min(35,S+2))}],closed:!1})}break}case"diamond-baseball":{let f=(O,j)=>({x:d(O),y:p(j)}),{home:y}=X,S=27.43,E=S/Math.SQRT2,I={x:y.x+E,y:y.y-E},g={x:y.x,y:y.y-2*E},M={x:y.x-E,y:y.y-E},b={x:y.x,y:y.y-18.44},x="#b98a59",w=bn["diamond-baseball"],v=38.94,P=[f(y.x,y.y)],A=Math.atan2(y.y-v/Math.SQRT2-b.y,v/Math.SQRT2),C=Math.PI-A;for(let O=0;O<=16;O++){let j=A-(A+Math.PI*2-C)%(Math.PI*2)*(O/16);P.push(f(b.x+29*Math.cos(j),b.y+29*Math.sin(j)))}u.push({points:P,closed:!0,fill:x,ink:x});let R={x:y.x,y:y.y-E},T=[{x:y.x,y:y.y},I,g,M].map(O=>f(R.x+(O.x-R.x)*.84,R.y+(O.y-R.y)*.84));u.push({points:T,closed:!0,fill:w,ink:w}),u.push({points:G(d(b.x),p(b.y),d(2.74),p(2.74),20),closed:!0,fill:x,ink:x}),u.push({points:G(d(y.x),p(y.y),d(3.96),p(3.96),20),closed:!0,fill:x,ink:x});let N=X.fence;u.push({points:[f(y.x,y.y),f(N[0].x,N[0].y)],closed:!1}),u.push({points:[f(y.x,y.y),f(N[N.length-1].x,N[N.length-1].y)],closed:!1});for(let O of[I,g,M])u.push({points:U(d(O.x),p(O.y),d(.3),p(.3)),closed:!0,fill:xn});break}case"court-basketball":{u.push({points:U(0,0,d(14),p(7.5)),closed:!0}),u.push({points:[{x:0,y:-p(7.5)},{x:0,y:p(7.5)}],closed:!1}),u.push({points:G(0,0,d(1.8),p(1.8),24),closed:!0});for(let f of[-1,1]){let y=f*14,S=f*(14-5.8),E=f*(14-1.575);u.push({points:U(d((y+S)/2),0,d(2.9),p(2.45)),closed:!0,fill:"#2f5d8a"}),u.push({points:G(d(S),0,d(1.8),p(1.8),24),closed:!0});let I=Math.sqrt(6.75*6.75-6.6*6.6),g=[{x:d(y),y:-p(6.6)}],M=Math.atan2(-6.6,-f*I),b=2*Math.atan2(6.6,I);for(let x=0;x<=16;x++){let w=M-f*b*(x/16);g.push({x:d(E+6.75*Math.cos(w)),y:p(6.75*Math.sin(w))})}g.push({x:d(y),y:p(6.6)}),u.push({points:g,closed:!1})}break}case"court-tennis":{u.push({points:U(0,0,d(11.885),p(5.485)),closed:!0,fill:"#2b5f99"});for(let f of[-1,1])u.push({points:[{x:-d(11.885),y:f*p(4.115)},{x:d(11.885),y:f*p(4.115)}],closed:!1}),u.push({points:[{x:f*d(6.4),y:-p(4.115)},{x:f*d(6.4),y:p(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:-p(6.4)},{x:0,y:p(6.4)}],closed:!1,ink:"#d1d5db"});break}case"ring-boxing":{u.push({points:U(0,0,d(3.05),p(3.05)),closed:!0});let S=[[-1,-1,"#c53030"],[1,1,"#2b6cb0"],[1,-1,"#e2e8f0"],[-1,1,"#e2e8f0"]];for(let[E,I,g]of S)u.push({points:U(E*d(3.05),I*p(3.05),d(.3),p(.3)),closed:!0,fill:g,ink:g});break}default:return[]}return u.map(f=>({...f,points:f.points.map(y=>st(y.x,y.y,l,m,n,i))}))}function zo(e){if(e.role!=="stage"||!xe(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),m=Math.max(1,r-o),a=Math.max(1,l-s);t={cx:o+m/2,cy:s+a/2,width:m,height:a}}return t?Mn({kind:e.stageKind,...t}):[]}function Sn(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return 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 vn(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 at(e){let t=Sn(e);if(!t||t.length<2)return null;let n=e.rotation??0,i=Math.abs(n)<1e-6?t:t.map(m=>vn(m,{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 m of i)o=Math.min(o,m.x),r=Math.min(r,m.y),s=Math.max(s,m.x),l=Math.max(l,m.y);return!Number.isFinite(o)||s-o<1e-6||l-r<1e-6?null:{minX:o,minY:r,maxX:s,maxY:l}}var wn=5,En=3,In=.92,Pn=1.9,Cn=2,_n=.6,kn=1,Rn=.06;function Tn(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?it:xe(e.stageKind)?Rn:kn}function ct(e){let t=1/0,n=1/0,i=-1/0,o=-1/0,r=-1/0;for(let s of Me(e)){let l=s.baseHeightM??0;for(let m of s.objects){if(m.type!=="shape"||m.role!=="stage")continue;let a=at(m);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+Tn(m)))}}return!Number.isFinite(t)||!Number.isFinite(r)?null:{minX:t,minY:n,maxX:i,maxY:o,deckTopM:r}}function On(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 m=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),h=new Float64Array(c*u).fill(-1/0);for(let d of e){if(!Number.isFinite(d.eyeHeightM))continue;let p=d.eyeHeightM-Q,f=Math.min(c-1,Math.max(0,Math.floor((d.x*t-m)/n))),S=Math.min(u-1,Math.max(0,Math.floor((d.y*t-a)/n)))*c+f,E=p+i;E>h[S]&&(h[S]=E)}return{cellM:n,minX:m,minY:a,cols:c,rows:u,top:h}}function An(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 lt(e,t,n={}){let i=new Map;if(!t||!e.length)return i;let o=n.metresPerChartUnit??q,r=n.cellM??_n,s=n.chairBackM??In,l=n.selfRowSkipM??Cn,m=n.clearThreshold??.9,a=n.partialThreshold??.25,c=Math.max(1,n.columns??wn),u=Math.max(1,n.rows??En),h=On(e,o,r,s);if(!h)return i;let d=(t.maxX-t.minX)*o,p=(t.maxY-t.minY)*o,f=d>=p,y=(t.minX+t.maxX)/2*o,S=(t.minY+t.maxY)/2*o,E=[];for(let g=0;g<c;g++){let M=(g+.5)/c-.5,b=f?y+M*d:y,x=f?S:S+M*p;for(let w=0;w<u;w++){let v=t.deckTopM+(u===1?0:w/(u-1)*Pn);E.push({x:b,y:x,z:v})}}let I=r/2;for(let g of e){if(!Number.isFinite(g.eyeHeightM))continue;let M=g.x*o,b=g.y*o,x=g.eyeHeightM,w=0,v=1/0;for(let A of E){let C=A.x-M,R=A.y-b,T=Math.hypot(C,R);if(!(T>l)){w++;continue}let N=C/T,O=R/T,j=0;for(let V=l;V<T;V+=I){let B=An(h,M+N*V,b+O*V);if(!(!Number.isFinite(B)||B>=x)&&B>x+(A.z-x)*V/T){j=V;break}}j?v=Math.min(v,j):w++}let P=w/E.length;P>=m||i.set(g.id,{seatId:g.id,mark:P<a?"obstructedView":"restrictedView",visibleFraction:P,totalRays:E.length,atDistanceM:Number.isFinite(v)?v:0})}return i}function ut(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 Se(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var se=Math.PI/180,Nn=9,J=16;function ve(e,t,n,i){let o=n*se,r=Math.cos(o),s=Math.sin(o);return{x:i.x+e*r-t*s,y:i.y+e*s+t*r}}function we(e){let{seatCount:t,seatSpacing:n,curve:i,rotation:o,origin:r}=e,s=[];if(e.path)return Fe(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(ve(a*n,0,o,r));return s}let l=i/(t-1)*se,m=n/(2*Math.sin(Math.abs(l)/2));for(let a=0;a<t;a++){let c=a*l,u=m*Math.sin(c),h=-m+m*Math.cos(c);s.push(ve(u,h,o,r))}return s}function pt(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function pi(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 jn(e,t){let n=pt(e);return we(e).map((i,o)=>{let r=n.get(o),s=Se(r),l=Ie(e,o,r),m={...e.commercial,...r?.commercial};return{index:o,x:i.x+(r?.dx??0),y:i.y+(r?.dy??0),label:l,displayLabel:ce(e,o,t,r),categoryKey:r?.categoryKey??e.categoryKey,skipped:!!r?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:r?.wheelchairSpaceType,commercial:Object.values(m).some(a=>a!==void 0&&a!==!1&&a!=="")?m:void 0,glyph:r?.glyph,viewUrl:r?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:r?.viewFromSeatUrl?r.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:r?.labelStyle??e.seatLabelStyle}})}function Ln(e){let t=[];for(let n of jn(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 Fn(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 bt(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,h,d)=>{let p=i.get(c),f=Se(p),y=p?.label??`${e.label}-${c+1}`,S=e.displayLabel??e.label;return{index:c,label:y,displayLabel:p?.displayLabel??`${S}-${c+1}`,x:u+(p?.dx??0),y:h+(p?.dy??0),categoryKey:p?.categoryKey??e.categoryKey,skipped:!!p?.skip,accessible:f.length>0,accessibility:f,wheelchairSpaceType:p?.wheelchairSpaceType,commercial:p?.commercial,glyph:p?.glyph,viewUrl:p?.viewFromSeatUrl,viewMeta:p?.viewFromSeatUrl?p.viewFromSeatMeta:void 0,labelStyle:p?.labelStyle,...d?{side:d}:{}}};if(e.shape==="round"){let c=(e.radius??40)+J,u=e.rotation*se,h=Math.max(0,Math.min(360,e.seatArc??360));if(h>=360||n===1){for(let y=0;y<n;y++){let S=u+y/n*2*Math.PI;t.push(o(y,e.center.x+c*Math.cos(S),e.center.y+c*Math.sin(S)))}return t}let d=h*se,p=(2*Math.PI-d)/2,f=u+p;for(let y=0;y<n;y++){let S=f+y/(n-1)*d;t.push(o(y,e.center.x+c*Math.cos(S),e.center.y+c*Math.sin(S)))}return t}let r=e.width??80,s=e.height??50,l=Fn(e),m=["top","bottom","left","right"],a=0;for(let c of m){let u=l[c];for(let h=0;h<u;h++){let d,p;c==="top"?(d=-r/2+(h+.5)*r/u,p=-s/2-J):c==="bottom"?(d=-r/2+(h+.5)*r/u,p=s/2+J):c==="left"?(d=-r/2-J,p=-s/2+(h+.5)*s/u):(d=r/2+J,p=-s/2+(h+.5)*s/u);let f=ve(d,p,e.rotation,e.center);t.push(o(a++,f.x,f.y,c))}}return t}function bi(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):bt(e).filter(t=>!t.skipped).length}function Dn(e){return bt(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 Vn(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth"}]}function dt(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,m=t[o].y;s>e.y!=m>e.y&&e.x<(l-r)*(e.y-s)/(m-s)+r&&(n=!n)}return n}function Hn(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 te(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function ae(e,t,n){return dt(e,t)&&!te(n).some(i=>dt(e,i)||Hn(e,i))}function yi(e,t){return Ge(e,t).point}function re(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;return{x:t/e.length,y:n/e.length}}function yt(e){switch(e.type){case"row":{let t=we(e),n=pt(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 re(e.points);case"section":return re(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?re(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function ft(e,t){return e.length===t.length&&e.every((n,i)=>n.x===t[i].x&&n.y===t[i].y)}function Un(e,t){if(e.type!=="gaArea"||!ft(e.points,t.outline))return!1;let n=te(e.holes),i=te(t.holes);return n.length===i.length&&n.every((o,r)=>ft(o,i[r]))}function Kn(e,t,n=e.filter(o=>o.type==="section"),i=yt(t)){let o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(o?n.find(s=>(s.logicalSectionId??s.id)===o&&(Un(t,s)||ae(i,s.outline,s.holes))):void 0)??n.find(s=>ae(i,s.outline,s.holes))}function Me(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 gi(e,t){let n=Me(e);return(t?n.find(i=>i.id===t):n[0])?.objects??[]}function Gn(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function Xn(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:te(e.holes).map(o)}:{}};case"section":return{...e,outline:o(e.outline),...e.outlinePath?{outlinePath:We(e.outlinePath,t,n)}:{},...e.holes?{holes:te(e.holes).map(o)}:{}};case"text":return{...e,position:i(e.position)};case"shape":return{...e,...e.points?{points:o(e.points)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function xi(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:Xn(s,0,r))}),{...e,objects:n,floors:void 0}}function ht(e,t,n,i,o,r,s,l,m){let a=[],c=e.filter(f=>f.type==="section"),u=$e(e),h=f=>!f?.eventConfigurationId||f.eventConfigurationId===i&&(f.eventConfigurationVersion===void 0||f.eventConfigurationVersion===m),d=f=>Pe(f,{activeConfigurationId:i,activeConfigurationVersion:m,activeBasisSha256:o,now:l}),p=(f,y)=>d(f)?{...f,coverage:y}:void 0;for(let f of e){let y=[];if(f.type==="row"?y=Ln(f):f.type==="table"?y=Dn(f):f.type==="booth"&&(y=Vn(f)),!y.length)continue;for(let M of y)M.viewUrl&&!h(M.viewMeta)&&(M.viewUrl=void 0,M.viewMeta=void 0);if(f.type==="row"){let M=u.get(f.id);if(M){let b=new Map((f.overrides??[]).map(x=>[x.index,x]));for(let x of y){let w=Number(x.id.slice(x.id.lastIndexOf(":")+1));if(!Number.isInteger(w))continue;x.logicalRowId=M.groupId,x.logicalSeatIndex=M.adjacencyOffset+w,b.get(w)?.displayLabel||(x.displayLabel=ce(f,w,M)),!x.viewUrl&&M.viewFromSeatUrl&&h(M.viewFromSeatMeta)&&(x.viewUrl=M.viewFromSeatUrl,x.viewMeta=M.viewFromSeatMeta);let v=b.get(w)?.confidenceEvidence;x.confidenceEvidence=p(v,"exact-seat")??p(f.confidenceEvidence,"row-representative")??p(M.confidenceEvidence,"row-representative")}}}let S=Kn(e,f,c,f.type==="row"?re(y):yt(f)),E=S?.viewFromSeatUrl,g=(S?.zone?t?.find(M=>M.id===S.zone):void 0)?.focalPoint??n;for(let M of y){if(!M.confidenceEvidence){let b=Number(M.id.slice(M.id.lastIndexOf(":")+1)),x=(f.type==="row"||f.type==="table")&&Number.isInteger(b)?f.overrides?.find(w=>w.index===b)?.confidenceEvidence:void 0;M.confidenceEvidence=p(x,"exact-seat")??(f.type==="row"?p(f.confidenceEvidence,"row-representative"):void 0)}M.confidenceEvidence??=p(S?.confidenceEvidence,"section-representative")??(s?p(s.evidence,s.coverage):void 0),!M.viewUrl&&E&&h(S?.viewFromSeatMeta)&&(M.viewUrl=E,M.viewMeta=S?.viewFromSeatMeta),!M.viewUrl&&r&&h(r.meta)&&(M.viewUrl=r.url,M.viewMeta=r.meta),S&&(M.sectionId=S.logicalSectionId??S.id),S?.zone&&(M.zoneId=S.zone),g&&(M.focalPoint={...g})}a.push(...y)}return a}function Mi(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,m=ht(o.objects,e.zones,r,e.eventConfigurationId,e.confidenceBasisSha256,s,l,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&mt(o.objects,o.focalPoint??e.focalPoint,o.baseHeightM??0,m);for(let a of m)a.floorId=o.id;for(let a of m)i.push(a)}return i}let n=ht(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&&mt(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),Bn(e,n,t)}function Bn(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||ut(t,lt(t,ct(e))),t}function mt(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+Q;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 m=new Map,a=new Map;for(let u=0;u<i.length;u++){let h=i[u],p=(h.sectionId?l.get(h.sectionId)??o.find(y=>y.logicalSectionId===h.sectionId&&ae({x:h.x,y:h.y},y.outline,y.holes)):void 0)??o.find(y=>ae({x:h.x,y:h.y},y.outline,y.holes))??null;if(s[u]=p,!p)continue;m.has(p.id)||m.set(p.id,Ze(p,{floorBaseHeightM:n}));let f=a.get(p.id);f?f.push(u):a.set(p.id,[u])}let c=new Array(i.length).fill(void 0);for(let[u,h]of a){let d=m.get(u);if(!d)continue;let p=d.rake>0?Math.tan(d.rake*Math.PI/180):0,f=ot(u,i,h,t);for(let y of f.rows){let S=y.blockDepth*q*p,E=d.height+S;for(let I of y.seatIndices)c[I]=E}}for(let u=0;u<i.length;u++){let h=i[u],d=s[u];if(!d){h.eyeHeightM=n+Q;continue}let p=m.get(d.id);h.eyeHeightM=(c[u]??p.height)+Q}}var ie=40;function Si(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)},m=a=>{if(Array.isArray(a))for(let c of a)!c||typeof c!="object"||l(c.x,c.y)};for(let a of Gn(e))if(a.type==="row"){let c=new Map((a.overrides??[]).map(u=>[u.index,u]));we(a).forEach((u,h)=>{let d=c.get(h);d?.skip||l(u.x+(d?.dx??0),u.y+(d?.dy??0))})}else if(a.type==="gaArea")m(a.points);else if(a.type==="section")m(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?m(a.points):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=J+Nn,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=Ne(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 h=u*3/4;l(c.x-u/2,c.y-h/2),l(c.x+u/2,c.y+h/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-ie,y:o-ie,width:r-i+ie*2,height:s-o+ie*2}}export{Yn as a,vt as b,Ce as c,wt as d,Wn as e,Et as f,$n as g,Z as h,le as i,Jn as j,Zn as k,eo as l,to as m,no as n,oo as o,io as p,so as q,ao as r,co as s,lo as t,uo as u,fo as v,ho as w,mo as x,po as y,Ne as z,yo as A,Lt as B,go as C,fe as D,So as E,Fe as F,vo as G,wo as H,Dt as I,Ue as J,Io as K,Ge as L,Ht as M,Co as N,To as O,ze as P,Oo as Q,We as R,Xt as S,Bt as T,zt as U,Ao as V,$t as W,Jt as X,No as Y,Lo as Z,Fo as _,Do as $,$e as aa,q as ba,Ho as ca,en as da,qe as ea,Je as fa,Qe as ga,pe as ha,tn as ia,nn as ja,on as ka,Q as la,Uo as ma,Ze as na,tt as oa,cn as pa,ot as qa,Xo as ra,mn as sa,Bo as ta,it as ua,Yo as va,xn as wa,xe as xa,zo as ya,Se as za,J as Aa,we as Ba,pi as Ca,jn as Da,Ln as Ea,Fn as Fa,bt as Ga,bi as Ha,Dn as Ia,Vn as Ja,dt as Ka,te as La,ae as Ma,yi as Na,yt as Oa,Kn as Pa,Me as Qa,gi as Ra,Gn as Sa,Xn as Ta,xi as Ua,Mi as Va,Si as Wa};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as V,k as H,w as m}from"./chunk-LAX7F5ML.js";var ie=3,k=4.5,T=3,$=24,re=20;function A(t){return t.filter(a=>a.visible&&!!a.screenBox)}function y(t,a){return t.x<a.x+a.width&&t.x+t.width>a.x&&t.y<a.y+a.height&&t.y+t.height>a.y}function p(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function o(t,a,s){return s.length?{code:t,message:a,count:s.length,samples:s.slice(0,re)}:null}function B(t,a,s){return{primaryId:t.seatId,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function F(t,a,s){return{primaryId:t.id,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function D(t,a,s){return{primaryId:t.objectId,primaryLabel:t.text,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function g(t,a,s,l){return{primaryId:t,primaryLabel:a,secondaryId:s,secondaryLabel:l}}function ae(t,a="overview",s=null){let l=A(t.labels),c=A(t.hierarchyLabels),d=A(t.freeTextLabels),f=A(t.rowLabels),C=t.gaAreas.filter(e=>e.visible),W=l.map(e=>m(e.ink,e.fill)??0),X=c.map(e=>m(e.ink,e.fill)??0),Y=d.map(e=>m(e.ink,e.background)??0),q=C.map(e=>m(e.effectiveBackground,t.canvasBackground)??0),u=s?t.labels.filter(e=>e.categoryKey===s):t.labels,v=s?t.gaAreas.filter(e=>e.categoryKey===s):t.gaAreas,h=u.filter(e=>e.selected),x=u.filter(e=>e.status==="held"),w=u.filter(e=>e.status==="booked"),R=u.filter(e=>e.pointerTarget.active),M=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),S=h.length?p(h.map(e=>m(e.selectionRingColor??t.selectionRingColor,e.fill)??0)):null,n=[],I=(e,i)=>Array.from({length:e},(b,L)=>({primaryId:`overview:${L+1}`,primaryLabel:i}));a==="overview"&&t.rung==="sections"&&(n.push(o("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",I(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),n.push(o("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",I(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),n.push(o("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",I(t.overviewStyle.visibleSectionRowHints,"section row hint"))),n.push(o("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),n.push(o("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),n.push(o("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>B(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("bookable-label-viewport-clipped","Visible interaction labels must remain fully inside the buyer viewport",a==="interaction"?l.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>B(e)):[])),n.push(o("row-label-viewport-clipped","Visible interaction row labels must remain fully inside the buyer viewport",a==="interaction"?f.flatMap((e,i)=>{let b=e.screenBox;return b.x<0||b.y<0||b.x+b.width>t.viewport.width||b.y+b.height>t.viewport.height?[{primaryId:`row-label-${i}`,primaryLabel:e.text}]:[]}):[]));let _=[];if(a==="interaction")for(let e=0;e<f.length;e+=1)for(let i=0;i<e;i+=1)y(f[e].screenBox,f[i].screenBox)&&_.push(g(`row-label-${i}`,f[i].text,`row-label-${e}`,f[e].text));if(n.push(o("row-label-collision","Visible interaction row labels must not overlap",_)),a==="interaction"){let e=u.length>0,i=v.length>0,b=e||i,L=v.filter(r=>r.visible),J=new Set([...u.flatMap(r=>r.sectionId?[r.sectionId]:[]),...v.flatMap(r=>r.sectionId?[r.sectionId]:[])]),Z=new Set([...t.labels.map(r=>r.categoryKey),...t.gaAreas.map(r=>r.categoryKey)]),P=r=>r.screenCenter.x>=0&&r.screenCenter.x<=t.viewport.width&&r.screenCenter.y>=0&&r.screenCenter.y<=t.viewport.height;n.push(o("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",b&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),n.push(o("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",b&&!u.some(P)&&!L.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),n.push(o("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!R.some(P)||!e&&i&&!L.some(r=>r.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),n.push(o("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",R.filter(r=>P(r)&&r.pointerTarget.effectiveMinimumPx<$).map(r=>B(r,r.pointerTarget.effectiveMinimumPx,$)))),n.push(o("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!h.length||!h.some(r=>t.selectionRingSeatIds.includes(r.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),n.push(o("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the seat paint",h.length&&(S??0)<T?[{primaryId:h[0].seatId,primaryLabel:h[0].label,measured:Math.round((S??0)*100)/100,minimum:T}]:[])),n.push(o("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",u.length>=2&&!x.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),n.push(o("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",u.length>=3&&!w.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let ee=new Set(x.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`)),te=new Set(w.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`));n.push(o("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",x.length&&w.length&&[...ee].some(r=>te.has(r))?[{primaryId:x[0].seatId,primaryLabel:x[0].label,secondaryId:w[0].seatId,secondaryLabel:w[0].label}]:[])),n.push(o("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",J.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),n.push(o("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",Z.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let E=t.labels.filter(r=>r.status==="free"&&!r.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey)),Q=t.gaAreas.filter(r=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey));n.push(o("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(E.length||Q.length)&&!E.some(r=>r.opacity<=.25)&&!Q.some(r=>r.opacity<=.1)?[...E.map(r=>B(r,r.opacity)),...Q.map(r=>({primaryId:r.areaId,primaryLabel:r.label,measured:r.opacity}))]:[])),n.push(o("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",s&&!M.has(s)?[{primaryId:s,primaryLabel:s}]:[])),n.push(o("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",s&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==s)?[{primaryId:s,primaryLabel:s}]:[]))}n.push(o("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",l.flatMap(e=>{let i=m(e.ink,e.fill)??0;return i<k?[B(e,i,k)]:[]})));let z=[];for(let e=0;e<l.length;e+=1)for(let i=0;i<e;i+=1)y(l[e].screenBox,l[i].screenBox)&&z.push(g(l[i].seatId,l[i].label,l[e].seatId,l[e].label));n.push(o("bookable-label-collision","Visible bookable labels must not overlap",z)),n.push(o("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",c.filter(e=>e.renderedFontPx<(e.sizeFloorPx??V)).map(e=>F(e,e.renderedFontPx,e.sizeFloorPx??V)))),n.push(o("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",c.flatMap(e=>{let i=m(e.ink,e.fill)??0,b=e.kind==="section"&&e.role==="name"?H:k;return i<b?[F(e,i,b)]:[]}))),n.push(o("hierarchy-label-viewport-clipped","Visible overview hierarchy labels must remain fully inside the buyer viewport",a==="overview"?c.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>F(e)):[])),n.push(o("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",c.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>F(e))));let K=[];for(let e=0;e<c.length;e+=1)for(let i=0;i<e;i+=1)y(c[e].screenBox,c[i].screenBox)&&K.push(g(c[i].id,c[i].label,c[e].id,c[e].label));n.push(o("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",K));let N=[];for(let e of c)for(let i of l)y(e.screenBox,i.screenBox)&&N.push(g(e.id,e.label,i.seatId,i.label));n.push(o("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",N)),n.push(o("free-text-undersized","Visible chart text must meet the rendered small-text size floor",d.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>D(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",d.flatMap(e=>{let i=m(e.ink,e.background)??0;return i<k?[D(e,i,k)]:[]})));let G=[];for(let e=0;e<d.length;e+=1)for(let i=0;i<e;i+=1)y(d[e].screenBox,d[i].screenBox)&&G.push(g(d[i].objectId,d[i].text,d[e].objectId,d[e].text));n.push(o("free-text-collision","Visible chart text labels must not overlap each other",G));let O=[];for(let e of d)for(let i of l)y(e.screenBox,i.screenBox)&&O.push(g(e.objectId,e.text,i.seatId,i.label));n.push(o("free-text-bookable-collision","Visible chart text must not overlap bookable labels",O));let U=[];for(let e of d)for(let i of c)y(e.screenBox,i.screenBox)&&U.push(g(e.objectId,e.text,i.id,i.label));n.push(o("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",U)),n.push(o("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",C.flatMap(e=>{let i=m(e.effectiveBackground,t.canvasBackground)??0;return i<T?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(i*100)/100,minimum:T}]:[]})));let j=n.filter(e=>!!e);return{version:ie,passed:j.length===0,state:a,targetCategoryKey:s,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-viewport","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...a==="interaction"?["rendered-detail-label-viewport","rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:l.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:c.length,visibleFreeTextLabels:d.length,visibleGAAreas:C.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,i)=>e.kind.localeCompare(i.kind)||e.id.localeCompare(i.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,i)=>e.objectId.localeCompare(i.objectId)||e.kind.localeCompare(i.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,i)=>e.areaId.localeCompare(i.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...M].sort()},metrics:{minimumRenderedBookableLabelPx:p(l.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:p(W),minimumRenderedHierarchyLabelPx:p(c.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:p(X),minimumRenderedFreeTextPx:p(d.map(e=>e.renderedFontPx)),minimumFreeTextContrast:p(Y),minimumGAContrast:p(q),minimumEffectivePointerTargetPx:p(R.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:S==null?null:Math.round(S*100)/100},interaction:{applicable:{detail:u.length>0||v.length>0,pointer:u.length>0||v.length>0,held:u.length>=2,booked:u.length>=3,sectionFocus:u.some(e=>!!e.sectionId)||v.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:h.length,heldUnits:x.length,bookedUnits:w.length,activePointerTargets:R.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:j}}export{ie as a,$ as b,ae as c};
|
|
1
|
+
import{I as m,u as V,w as H}from"./chunk-Z43H6AWN.js";var ie=3,k=4.5,T=3,$=24,re=20;function A(t){return t.filter(a=>a.visible&&!!a.screenBox)}function y(t,a){return t.x<a.x+a.width&&t.x+t.width>a.x&&t.y<a.y+a.height&&t.y+t.height>a.y}function p(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function o(t,a,s){return s.length?{code:t,message:a,count:s.length,samples:s.slice(0,re)}:null}function B(t,a,s){return{primaryId:t.seatId,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function F(t,a,s){return{primaryId:t.id,primaryLabel:t.label,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function D(t,a,s){return{primaryId:t.objectId,primaryLabel:t.text,...a==null?{}:{measured:Math.round(a*100)/100},...s==null?{}:{minimum:s}}}function g(t,a,s,l){return{primaryId:t,primaryLabel:a,secondaryId:s,secondaryLabel:l}}function ae(t,a="overview",s=null){let l=A(t.labels),c=A(t.hierarchyLabels),d=A(t.freeTextLabels),f=A(t.rowLabels),C=t.gaAreas.filter(e=>e.visible),W=l.map(e=>m(e.ink,e.fill)??0),X=c.map(e=>m(e.ink,e.fill)??0),Y=d.map(e=>m(e.ink,e.background)??0),q=C.map(e=>m(e.effectiveBackground,t.canvasBackground)??0),u=s?t.labels.filter(e=>e.categoryKey===s):t.labels,v=s?t.gaAreas.filter(e=>e.categoryKey===s):t.gaAreas,h=u.filter(e=>e.selected),x=u.filter(e=>e.status==="held"),w=u.filter(e=>e.status==="booked"),R=u.filter(e=>e.pointerTarget.active),M=new Set([...t.labels.filter(e=>e.visible&&(e.opacity>.25||e.selected||e.status!=="free")).map(e=>e.categoryKey),...t.gaAreas.filter(e=>e.visible&&e.opacity>.1).map(e=>e.categoryKey)]),S=h.length?p(h.map(e=>m(e.selectionRingColor??t.selectionRingColor,e.fill)??0)):null,n=[],I=(e,i)=>Array.from({length:e},(b,L)=>({primaryId:`overview:${L+1}`,primaryLabel:i}));a==="overview"&&t.rung==="sections"&&(n.push(o("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",I(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),n.push(o("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",I(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),n.push(o("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",I(t.overviewStyle.visibleSectionRowHints,"section row hint"))),n.push(o("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),n.push(o("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",I(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),n.push(o("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",l.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>B(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("bookable-label-viewport-clipped","Visible interaction labels must remain fully inside the buyer viewport",a==="interaction"?l.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>B(e)):[])),n.push(o("row-label-viewport-clipped","Visible interaction row labels must remain fully inside the buyer viewport",a==="interaction"?f.flatMap((e,i)=>{let b=e.screenBox;return b.x<0||b.y<0||b.x+b.width>t.viewport.width||b.y+b.height>t.viewport.height?[{primaryId:`row-label-${i}`,primaryLabel:e.text}]:[]}):[]));let _=[];if(a==="interaction")for(let e=0;e<f.length;e+=1)for(let i=0;i<e;i+=1)y(f[e].screenBox,f[i].screenBox)&&_.push(g(`row-label-${i}`,f[i].text,`row-label-${e}`,f[e].text));if(n.push(o("row-label-collision","Visible interaction row labels must not overlap",_)),a==="interaction"){let e=u.length>0,i=v.length>0,b=e||i,L=v.filter(r=>r.visible),J=new Set([...u.flatMap(r=>r.sectionId?[r.sectionId]:[]),...v.flatMap(r=>r.sectionId?[r.sectionId]:[])]),Z=new Set([...t.labels.map(r=>r.categoryKey),...t.gaAreas.map(r=>r.categoryKey)]),P=r=>r.screenCenter.x>=0&&r.screenCenter.x<=t.viewport.width&&r.screenCenter.y>=0&&r.screenCenter.y<=t.viewport.height;n.push(o("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",b&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),n.push(o("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",b&&!u.some(P)&&!L.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),n.push(o("pointer-target-inactive","Interaction evidence must expose a live production pointer target",e&&!R.some(P)||!e&&i&&!L.some(r=>r.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),n.push(o("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",R.filter(r=>P(r)&&r.pointerTarget.effectiveMinimumPx<$).map(r=>B(r,r.pointerTarget.effectiveMinimumPx,$)))),n.push(o("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",e&&(!h.length||!h.some(r=>t.selectionRingSeatIds.includes(r.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),n.push(o("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the seat paint",h.length&&(S??0)<T?[{primaryId:h[0].seatId,primaryLabel:h[0].label,measured:Math.round((S??0)*100)/100,minimum:T}]:[])),n.push(o("held-state-missing","Interaction evidence must paint a held state when the floor has at least two status-managed units",u.length>=2&&!x.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),n.push(o("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",u.length>=3&&!w.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));let ee=new Set(x.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`)),te=new Set(w.map(r=>`${r.fill.toLowerCase()}:${r.opacity}`));n.push(o("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",x.length&&w.length&&[...ee].some(r=>te.has(r))?[{primaryId:x[0].seatId,primaryLabel:x[0].label,secondaryId:w[0].seatId,secondaryLabel:w[0].label}]:[])),n.push(o("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",J.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),n.push(o("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",Z.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));let E=t.labels.filter(r=>r.status==="free"&&!r.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey)),Q=t.gaAreas.filter(r=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(r.categoryKey));n.push(o("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(E.length||Q.length)&&!E.some(r=>r.opacity<=.25)&&!Q.some(r=>r.opacity<=.1)?[...E.map(r=>B(r,r.opacity)),...Q.map(r=>({primaryId:r.areaId,primaryLabel:r.label,measured:r.opacity}))]:[])),n.push(o("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",s&&!M.has(s)?[{primaryId:s,primaryLabel:s}]:[])),n.push(o("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",s&&(t.categoryFilterKeys?.length!==1||t.categoryFilterKeys[0]!==s)?[{primaryId:s,primaryLabel:s}]:[]))}n.push(o("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",l.flatMap(e=>{let i=m(e.ink,e.fill)??0;return i<k?[B(e,i,k)]:[]})));let z=[];for(let e=0;e<l.length;e+=1)for(let i=0;i<e;i+=1)y(l[e].screenBox,l[i].screenBox)&&z.push(g(l[i].seatId,l[i].label,l[e].seatId,l[e].label));n.push(o("bookable-label-collision","Visible bookable labels must not overlap",z)),n.push(o("hierarchy-label-undersized","Visible section and zone labels must meet the rendered small-text size floor",c.filter(e=>e.renderedFontPx<(e.sizeFloorPx??V)).map(e=>F(e,e.renderedFontPx,e.sizeFloorPx??V)))),n.push(o("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",c.flatMap(e=>{let i=m(e.ink,e.fill)??0,b=e.kind==="section"&&e.role==="name"?H:k;return i<b?[F(e,i,b)]:[]}))),n.push(o("hierarchy-label-viewport-clipped","Visible overview hierarchy labels must remain fully inside the buyer viewport",a==="overview"?c.filter(e=>e.screenBox.x<0||e.screenBox.y<0||e.screenBox.x+e.screenBox.width>t.viewport.width||e.screenBox.y+e.screenBox.height>t.viewport.height).map(e=>F(e)):[])),n.push(o("hierarchy-label-outside-section","Visible section labels must remain inside the filled section surface and outside holes",c.filter(e=>e.kind==="section"&&e.fitsContainer===!1).map(e=>F(e))));let K=[];for(let e=0;e<c.length;e+=1)for(let i=0;i<e;i+=1)y(c[e].screenBox,c[i].screenBox)&&K.push(g(c[i].id,c[i].label,c[e].id,c[e].label));n.push(o("hierarchy-label-collision","Visible hierarchy labels must not overlap each other",K));let N=[];for(let e of c)for(let i of l)y(e.screenBox,i.screenBox)&&N.push(g(e.id,e.label,i.seatId,i.label));n.push(o("hierarchy-bookable-collision","Visible hierarchy labels must not overlap bookable labels",N)),n.push(o("free-text-undersized","Visible chart text must meet the rendered small-text size floor",d.filter(e=>e.renderedFontPx<t.minimumVisibleLabelPx).map(e=>D(e,e.renderedFontPx,t.minimumVisibleLabelPx)))),n.push(o("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",d.flatMap(e=>{let i=m(e.ink,e.background)??0;return i<k?[D(e,i,k)]:[]})));let G=[];for(let e=0;e<d.length;e+=1)for(let i=0;i<e;i+=1)y(d[e].screenBox,d[i].screenBox)&&G.push(g(d[i].objectId,d[i].text,d[e].objectId,d[e].text));n.push(o("free-text-collision","Visible chart text labels must not overlap each other",G));let O=[];for(let e of d)for(let i of l)y(e.screenBox,i.screenBox)&&O.push(g(e.objectId,e.text,i.seatId,i.label));n.push(o("free-text-bookable-collision","Visible chart text must not overlap bookable labels",O));let U=[];for(let e of d)for(let i of c)y(e.screenBox,i.screenBox)&&U.push(g(e.objectId,e.text,i.id,i.label));n.push(o("free-text-hierarchy-collision","Visible chart text must not overlap hierarchy labels",U)),n.push(o("ga-contrast-low","Visible GA surfaces must maintain 3:1 graphical contrast with the canvas",C.flatMap(e=>{let i=m(e.effectiveBackground,t.canvasBackground)??0;return i<T?[{primaryId:e.areaId,primaryLabel:e.label,measured:Math.round(i*100)/100,minimum:T}]:[]})));let j=n.filter(e=>!!e);return{version:ie,passed:j.length===0,state:a,targetCategoryKey:s,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-viewport","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...a==="interaction"?["rendered-detail-label-viewport","rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:l.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:c.length,visibleFreeTextLabels:d.length,visibleGAAreas:C.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(e=>e.role==="name").map(e=>({id:e.id,kind:e.kind,label:e.label,visible:e.visible})).sort((e,i)=>e.kind.localeCompare(i.kind)||e.id.localeCompare(i.id)),labelledObjects:t.freeTextLabels.map(e=>({objectId:e.objectId,kind:e.kind,text:e.text,visible:e.visible})).sort((e,i)=>e.objectId.localeCompare(i.objectId)||e.kind.localeCompare(i.kind)),gaAreas:t.gaAreas.map(e=>({areaId:e.areaId,label:e.label,categoryKey:e.categoryKey,...e.sectionId?{sectionId:e.sectionId}:{},visible:e.visible})).sort((e,i)=>e.areaId.localeCompare(i.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(e=>e.sectionId?[e.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)])].sort(),activeCategoryKeys:[...M].sort()},metrics:{minimumRenderedBookableLabelPx:p(l.map(e=>e.renderedFontPx)),minimumBookableLabelContrast:p(W),minimumRenderedHierarchyLabelPx:p(c.map(e=>e.renderedFontPx)),minimumHierarchyLabelContrast:p(X),minimumRenderedFreeTextPx:p(d.map(e=>e.renderedFontPx)),minimumFreeTextContrast:p(Y),minimumGAContrast:p(q),minimumEffectivePointerTargetPx:p(R.map(e=>e.pointerTarget.effectiveMinimumPx)),selectedRingContrast:S==null?null:Math.round(S*100)/100},interaction:{applicable:{detail:u.length>0||v.length>0,pointer:u.length>0||v.length>0,held:u.length>=2,booked:u.length>=3,sectionFocus:u.some(e=>!!e.sectionId)||v.some(e=>!!e.sectionId),categoryFilter:new Set([...t.labels.map(e=>e.categoryKey),...t.gaAreas.map(e=>e.categoryKey)]).size>=2},selectedUnits:h.length,heldUnits:x.length,bookedUnits:w.length,activePointerTargets:R.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:j}}export{ie as a,$ as b,ae as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as b,k as y,n as f,t as g}from"./chunk-JBOTRSMY.js";var A=72;var N="seatmap.chart";var I=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"\u267F"},{key:"companion",label:"Companion seat",short:"Companion",icon:"\u{1F9D1}\u200D\u{1F91D}\u200D\u{1F9D1}"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"\u{1F9AF}"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"\u{1F9BB}"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"\u{1F91F}"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"\u{1F4BA}"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"\u2195\uFE0F"}],R=new Map(I.map(e=>[e.key,e]));function W(e){return R.get(e)}var w={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function v(e){let t=e?.[0];return t&&w[t]||"#3b82f6"}var k=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"\u26D4"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"\u{1F441}"},{key:"premium",label:"Premium seat",short:"Premium",icon:"\u2605"}],M=new Map(k.map(e=>[e.key,e]));function Y(e){return M.get(e)}var X=8,q=24,E=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],T=new Set(E);function Q(e){switch(e.type){case"row":case"table":case"gaArea":case"booth":case"section":return"interactive";case"decorImage":return e.layer==="foreground"?"foreground":"background";case"shape":return e.role&&T.has(e.role)?"surroundings":"background";case"text":return"background";default:return"interactive"}}var ie=7,oe=10,L=10,P=.39,O=.8,_=.62;function ae(e){let t=Math.min(Math.abs(e.width),Math.abs(e.height));if(!(t>0))return L;let n=Math.max(1,e.text.length),r=Math.abs(e.width)*O/(n*_);return Math.max(L,Math.min(t*P,r))}var se=15,ce=11,le=.85,B=12,d=4.5,de=3,F=3,o="#000000",a="#ffffff",D=24,z=18.67;function ue(e,t=400){return e>=D||t>=700&&e>=z?F:d}function be(e,t){return e*t>=B}var ge=24,x={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"},me=x.wheelchair;function pe(e){if(!e?.length)return null;let t=e.includes("wheelchair")?"wheelchair":e[0];return x[t]??null}function Se(e,t){return t.colorblind?G(t.canvasBackground):v(e)}function ye(e){return/-(\d{1,5})$/.exec(e)?.[1]??e}var s=f;function fe(e,t,n){let r=b(e),c=b(t);if(!r||!c)return t;let i=Math.max(0,Math.min(1,n));return`#${r.map((l,m)=>Math.round(l*i+c[m]*(1-i))).map(l=>l.toString(16).padStart(2,"0")).join("")}`}var ve=3;function Le(e){let t=s(a,e)??0,n=s(o,e)??0;return t>=d?a:n>=d&&g(e)||g(e)?o:a}function G(e){return g(e)?o:a}function C(e,t,n=d){let r=s(t,e);if(r!=null&&r>=n)return t;let c=s(o,e)??0,i=s(a,e)??0;return c===0&&i===0?t:c>=i?o:a}function he(e,t,n,r=d){return t??C(e,n,r)}var V=3;function xe(e){let t=s("#ffffff",e);if(t!=null&&t>=V)return"#ffffff";let n=s(o,e)??0,r=s(a,e)??0;return n===0&&r===0?"#ffffff":n>=r?o:a}var h=/^#[0-9a-f]{6}$/i;function H(e){let t=b(e);return t!=null&&y(t)>.5}var Z="#e5e7eb",K="#273142";function Ce(e){return H(e)?Z:K}function Ae(e,t,n=d){let r=h.test(e.trim()),c=e.trim().toLowerCase(),i=0,u=0,l=null;for(let p of t){if(!r||!h.test(p.trim()))continue;i+=1;let S=C(p,e,n);S.toLowerCase()!==c&&(u+=1,l=S)}return{total:i,overridden:u,status:i===0?"none":u===0?"applies":u===i?"overridden":"mixed",overrideInk:l}}export{A as a,N as b,I as c,W as d,w as e,v as f,k as g,Y as h,X as i,q as j,E as k,Q as l,ie as m,oe as n,L as o,P as p,ae as q,se as r,ce as s,le as t,B as u,d as v,de as w,F as x,o as y,a as z,ue as A,be as B,ge as C,x as D,me as E,pe as F,Se as G,ye as H,s as I,fe as J,ve as K,Le as L,G as M,C as N,he as O,xe as P,H as Q,Z as R,K as S,Ce as T,Ae as U};
|