@seatlayer/core 0.106.0 → 0.106.1
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/{chunk-BVEVCXMJ.js → chunk-3DHQYZ47.js} +1 -1
- package/dist/{chunk-HYTPOZJY.js → chunk-3YNO3XCY.js} +1 -1
- package/dist/{chunk-HKVCBUON.js → chunk-5R6I2XL7.js} +1 -1
- package/dist/{chunk-O4ZAGGMP.js → chunk-C5GKFG36.js} +1 -1
- package/dist/{chunk-QFX6XSO6.js → chunk-FQTSVDD4.js} +1 -1
- package/dist/{chunk-BF3XROP5.js → chunk-INCPWAWP.js} +1 -1
- package/dist/{chunk-4VVFOAKY.js → chunk-M4J7U2E2.js} +1 -1
- package/dist/chunk-M4NGX5NM.js +1 -0
- package/dist/{chunk-UKODEMIM.js → chunk-MLPJTJFE.js} +1 -1
- package/dist/chunk-S3VH7IDA.js +1 -0
- package/dist/{chunk-A2S3YDR5.js → chunk-TAKLS47V.js} +1 -1
- package/dist/{chunk-SH3ZYWJT.js → chunk-UGMXII72.js} +1 -1
- package/dist/{chunk-VHFSP53L.js → chunk-V65VJE6F.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- 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/render-assets/index.js +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.d.cts +14 -2
- package/dist/core/sections/index.d.ts +14 -2
- package/dist/core/sections/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/view3d/index.cjs +28 -28
- package/dist/view3d/index.js +1 -1
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-KTMZ3QAO.js +0 -1
- package/dist/chunk-TFYAMLCK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as D,b as Y,c as $,d as q,e as H,f as Q,g as U,h as V,i as Z,j as tt,k as nt,l as ot,m as et}from"../../chunk-
|
|
1
|
+
import{a as m}from"../../chunk-TZBJCAXH.js";import{a as D,b as Y,c as $,d as q,e as H,f as Q,g as U,h as V,i as Z,j as tt,k as nt,l as ot,m as et}from"../../chunk-INCPWAWP.js";import{a as ut,b as lt,c as pt,d as ft}from"../../chunk-UGMXII72.js";import{a as rt,b as it,c as at,d as ct,e as st}from"../../chunk-3YNO3XCY.js";import"../../chunk-FQTSVDD4.js";import"../../chunk-TAKLS47V.js";import"../../chunk-JXIX3PNI.js";import"../../chunk-M4NGX5NM.js";import"../../chunk-MADX5HYP.js";import"../../chunk-R6BN4HDQ.js";import{a as C,b as N,c as g,d as k,e as G,f as B,g as W,h as A,i as E,j as F,k as T,l as L,m as X,n as K,o as J,p as z}from"../../chunk-MLPJTJFE.js";import{Za as f,d as _,e as v,f as I,g as j}from"../../chunk-5R6I2XL7.js";import"../../chunk-S3VH7IDA.js";import"../../chunk-JBOTRSMY.js";import"../../chunk-CRCGO52K.js";var b=1,d=100;function w(t,n){if(!Number.isInteger(n)||n<b||n>d)return null;let e=t.rotation*Math.PI/180,i={x:Math.cos(e),y:Math.sin(e)},o={x:-i.y,y:i.x};return Array.from({length:n},(r,a)=>{let c=t.style==="intertwined"&&a%2===1?t.seatSpacing/2:0;return{type:"row",id:`__block_preview_${a}`,label:"",origin:{x:t.origin.x+o.x*a*t.rowGap+i.x*c,y:t.origin.y+o.y*a*t.rowGap+i.y*c},rotation:t.rotation,curve:t.curve,seatCount:t.seatsPerRow,seatSpacing:t.seatSpacing,categoryKey:"__preview__"}})}function x(t,n=t.rowCount){let e=w(t,n);return e?.length?f(e[e.length-1]):null}function xt(t,n){if(!Number.isFinite(n.x)||!Number.isFinite(n.y)||t.rowGap<=0)return null;let e=x(t,1);if(!e)return null;let i=t.rotation*Math.PI/180,o={x:-Math.sin(i),y:Math.cos(i)},r=(n.x-e.x)*o.x+(n.y-e.y)*o.y,a=Math.max(b,Math.min(d,Math.round(r/t.rowGap)+1)),c=x(t,a);return c?{rowCount:a,edgePoint:c}:null}function bt(t,n){return t.length!==n.rowCount?!1:[...t].sort((i,o)=>(i.rowBlockGeneration?.rowIndex??1/0)-(o.rowBlockGeneration?.rowIndex??1/0)).every((i,o)=>{let r=i.rowBlockGeneration;return r?.kind==="row-block-v1"&&r.groupId===n.groupId&&r.rowIndex===o&&r.signature===n.signature&&JSON.stringify(r)===JSON.stringify({...n,rowIndex:o})})}var s=1,u=300,y=330;function l(t){return t.seatCount>1?t.curve/(t.seatCount-1):0}function h(t,n){let e=t.rotation*Math.PI/180,i=l(t)*Math.PI/180,o,r;if(Math.abs(i)<1e-9)o=n*t.seatSpacing,r=0;else{let a=t.seatSpacing/(2*Math.sin(Math.abs(i)/2)),c=i*n;o=a*Math.sin(c),r=-a+a*Math.cos(c)}return{x:t.origin.x+o*Math.cos(e)-r*Math.sin(e),y:t.origin.y+o*Math.sin(e)+r*Math.cos(e)}}function M(t,n,e){let i=(t??[]).map(o=>({...o,index:o.index+n})).filter(o=>o.index>=0&&o.index<e);return i.length?i:void 0}function R(t,n){if(t.path||!Number.isInteger(n)||n<s||n>u)return null;let e=l(t);return{...t,seatCount:n,curve:e*(n-1)}}function O(t,n){if(t.path||!Number.isInteger(n)||n<s||n>u)return null;let e=l(t),i=t.seatCount-n,o=-i;return{...t,origin:h(t,i),rotation:m(t.rotation-e*i),seatCount:n,curve:e*(n-1),overrides:M(t.overrides,o,n)}}function P(t,n=t.seatCount){let e=R(t,n);return e?h(e,n-1):null}function S(t,n=t.seatCount){return O(t,n)?.origin??null}function ht(t,n){if(t.path||!Number.isFinite(n.x)||!Number.isFinite(n.y))return null;let e=l(t),i=Math.abs(e)<1e-9?u:Math.min(u,Math.floor(y/Math.abs(e))+1),o=null;for(let r=s;r<=Math.max(s,i);r+=1){let a=P(t,r);if(!a)continue;let c=Math.hypot(a.x-n.x,a.y-n.y),p=e*(r-1);(!o||c<o.distance||c===o.distance&&r<o.seatCount)&&(o={seatCount:r,curve:p,endpoint:a,distance:c})}return o}function wt(t,n){if(t.path||!Number.isFinite(n.x)||!Number.isFinite(n.y))return null;let e=l(t),i=Math.abs(e)<1e-9?u:Math.min(u,Math.floor(y/Math.abs(e))+1),o=null;for(let r=s;r<=Math.max(s,i);r+=1){let a=S(t,r);if(!a)continue;let c=Math.hypot(a.x-n.x,a.y-n.y),p=e*(r-1);(!o||c<o.distance||c===o.distance&&r<o.seatCount)&&(o={seatCount:r,curve:p,endpoint:a,distance:c})}return o}export{rt as CATEGORY_INVENTORY_FAMILIES,v as DEFAULT_EVENT_INVENTORY_LIMIT,C as GA_UNIT_LABEL_PREFIX,ot as GroupedTableProjectionError,I as LARGE_VENUE_INVENTORY_MODULE,y as MAX_DIRECT_ROW_SWEEP,_ as MAX_EVENT_INVENTORY,g as MAX_GA_CAPACITY,W as MAX_ONE_PARTY_GUESTS,d as MAX_ROW_BLOCK_ROWS,u as MAX_ROW_SEATS,b as MIN_ROW_BLOCK_ROWS,s as MIN_ROW_SEATS,A as ONE_PARTY_LIMIT_MESSAGE,H as applicableTicketTiers,Z as behindStageLabels,pt as capacityControl,lt as categoryCapacity,ut as chartCapacity,U as companionSelectionIssue,ct as describeCategoryInventoryConflict,it as effectiveSeatOwnerCategoryCounts,j as eventInventoryLimitFor,z as gaAreasOf,F as gaBoxBounds,E as gaBoxMode,B as gaInventorySegments,k as gaUnitLabel,T as gaUnitLabels,L as gaUnitLabelsForModel,X as gaWheelchairPlaceCount,K as gaWheelchairUnitLabels,et as groupedTableInventory,J as growJoinedGAInventory,at as inspectCategoryInventoryConflicts,bt as intactRowBlockMembers,Y as isFullChartDoc,N as isGaUnitLabel,tt as pickBestAvailable,nt as pickBestAvailableInventory,st as remediateCategoryInventoryConflicts,ft as resizeChartCapacity,xt as resolveRowBlockCount,wt as resolveRowStartCapacity,ht as resolveRowTerminalCapacity,Q as resolveTicketTierForSeat,x as rowBlockEdgePoint,w as rowBlockPreviewRows,S as rowStartEndpoint,P as rowTerminalEndpoint,O as rowWithStartCapacity,R as rowWithTerminalCapacity,D as strandedSingles,$ as ticketOptionNotApplicableIssue,V as ticketSelectionIssue,q as ticketTierAppliesToSeat,G as validGAInventorySegments};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ye=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var qt=Object.getOwnPropertyNames;var Qt=Object.prototype.hasOwnProperty;var Zt=(e,t)=>{for(var n in t)ye(e,n,{get:t[n],enumerable:!0})},Jt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qt(t))!Qt.call(e,r)&&r!==n&&ye(e,r,{get:()=>t[r],enumerable:!(o=Wt(t,r))||o.enumerable});return e};var en=e=>Jt(ye({},"__esModule",{value:!0}),e);var Jo={};Zt(Jo,{AUTOMATIC_ROUND_TABLE_RADIUS_MAX:()=>pt,AUTOMATIC_ROUND_TABLE_RADIUS_MIN:()=>bt,CHAIR_NUMBERING_DIRECTIONS:()=>it,CHAIR_NUMBERING_FORMATS:()=>at,CHAIR_NUMBERING_START_MAX:()=>Ie,DEFAULT_SEAT_RADIUS:()=>Vt,FLOOR_COVER_LIMIT:()=>Gt,FLOOR_STACK_GAP_RATIO:()=>Nt,FLOOR_STACK_MIN_SURFACE_PX:()=>jo,LEVEL_CONTEXT_PREFIX:()=>be,TABLE_SEAT_OFFSET:()=>G,TEXT_BACKGROUND_PADDING_MAX:()=>fr,TEXT_BACKGROUND_RADIUS_MAX:()=>mr,TEXT_LETTER_SPACING_MAX:()=>ur,TEXT_LETTER_SPACING_MIN:()=>lr,TEXT_LINE_HEIGHT_MAX:()=>cr,TEXT_LINE_HEIGHT_MIN:()=>sr,TEXT_OPACITY_MIN:()=>dr,TEXT_WIDTH_MAX:()=>ar,TEXT_WIDTH_MIN:()=>ir,aisleSeatIds:()=>Yt,allObjects:()=>_t,automaticRoundTableRadius:()=>to,buildAisleHoles:()=>on,buildSeatIndex:()=>Go,buildSectionShell:()=>nn,chairNumberingProblem:()=>Tn,chartBounds:()=>X,combinedFloorZoneId:()=>Ne,compactChairNumbering:()=>Ln,cubicPoint:()=>ae,distanceToRings:()=>$e,distributeAlongCubic:()=>ge,effectiveFloorOverview:()=>Ht,expandBooth:()=>At,expandChart:()=>Fe,expandRow:()=>Rt,expandRowSlots:()=>kt,expandTable:()=>Et,expandTableSlots:()=>_e,floorObjects:()=>wo,floorStackPlacements:()=>Bt,floorsOf:()=>Q,gridStats:()=>Ko,hitTest:()=>Vo,initialFloorMode:()=>Fo,isAisleSeat:()=>qo,isRowAisleSeats:()=>Z,layoutCombinedFloorPlan:()=>Oo,layoutFloorStack:()=>Ro,levelContextOutlines:()=>Lo,mainFloorId:()=>Do,mergeRowAisleSeats:()=>Zo,nearestWithin:()=>Uo,objectCenter:()=>je,owningSectionForObject:()=>Lt,pointInPolygon:()=>Le,pointInPolygonWithHoles:()=>U,pointOnPolygonBoundary:()=>Tt,polygonArea:()=>Me,polygonInscribedAnchor:()=>we,polygonLabelPoint:()=>De,polygonNetArea:()=>cn,queryRect:()=>Xo,resolveRowAisleSeats:()=>Wo,resolveSegmentedRowGroups:()=>te,rowInventoryCount:()=>xo,rowSeatPositions:()=>me,segmentedRowComponentSeats:()=>vn,segmentedRowComponents:()=>wn,segmentedRowSeatTotal:()=>Pn,smoothCubicThroughMiddle:()=>tn,splitRowAisleSeats:()=>Qo,stackFloors:()=>vo,suggestedFloorOverview:()=>Eo,tableChairBookingLabel:()=>Ce,tableChairDisplayLabel:()=>ke,tableChairToken:()=>st,tableInventoryCount:()=>So,tableSeatCountsBySide:()=>Ot,textLayoutMetrics:()=>xe,translateObject:()=>he,usableHoles:()=>V});module.exports=en(Jo);var tr=Math.PI/180;function T(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function L(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function ae(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+a*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+a*e.end.y}}function tn(e,t,n){let o={x:(e.x+t.x)/2,y:(e.y+t.y)/2},r={x:(n.x-o.x)*4/3,y:(n.y-o.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+r.x,y:e.y+(t.y-e.y)/3+r.y},control2:{x:e.x+(t.x-e.x)*2/3+r.x,y:e.y+(t.y-e.y)*2/3+r.y},end:{...t}}}function ge(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[ae(e,.5)];let o=Array.from({length:n+1},(u,c)=>ae(e,c/n)),r=new Float64Array(o.length);for(let u=1;u<o.length;u+=1){let c=o[u].x-o[u-1].x,l=o[u].y-o[u-1].y;r[u]=r[u-1]+Math.hypot(c,l)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let a=[],s=1;for(let u=0;u<t;u+=1){let c=i*u/(t-1);for(;s<r.length-1&&r[s]<c;)s+=1;let l=r[s-1],d=r[s],m=d===l?0:(c-l)/(d-l);a.push({x:o[s-1].x+(o[s].x-o[s-1].x)*m,y:o[s-1].y+(o[s].y-o[s-1].y)*m})}return a}function _(e,t){return{x:e.x+t.x,y:e.y+t.y}}function J(e,t){return{x:e.x-t.x,y:e.y-t.y}}function D(e,t){return{x:e.x*t,y:e.y*t}}function se(e,t=13){return Array.from({length:t},(n,o)=>ae(e,o/(t-1)))}function Ve(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return L(e[o],e[o+1],n-o)}function Ue(e,t,n){let o=Math.max(0,Math.min(1,t)),r=Math.max(o,Math.min(1,n)),i=[Ve(e,o)];for(let a=1;a<e.length-1;a+=1){let s=a/(e.length-1);s>o+1e-9&&s<r-1e-9&&i.push(e[a])}return i.push(Ve(e,r)),i}function Xe(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([m,p],y)=>{let b=T(L(e[m],e[p],.5),t);b<r&&(r=b,o=y)});let i=e[o],a=e[(o+1)%4],s=e[(o+2)%4],u=e[(o+3)%4],c=L(i,a,.5),l=J(t,c),d=Math.max(1e-9,Math.hypot(l.x,l.y));return{p0:i,p1:a,p2:s,p3:u,normal:D(l,1/d),depth:(T(i,u)+T(a,s))/2}}function Ke(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:a}=e,s=J(n,t),u=J(o,r),c=a*.22,l=a*.12;return{nearPath:{start:t,control1:_(_(t,D(s,1/3)),D(i,c)),control2:_(_(t,D(s,2/3)),D(i,c)),end:n},farPath:{start:o,control1:_(_(r,D(u,2/3)),D(i,l)),control2:_(_(r,D(u,1/3)),D(i,l)),end:r}}}function nn(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let o=e.reduce((y,b)=>_(y,b),{x:0,y:0});o.x/=4,o.y/=4;let r=T(e[0],e[1]),i=T(e[0],e[3]),a=n==="auto"?r>i*1.25&&T(o,t)>i?"bezier":"tapered":n;if(a==="rectangle")return{mode:a,outline:e.map(y=>({...y}))};let s=Xe(e,t),{p0:u,p1:c,p2:l,p3:d}=s;if(a==="tapered")return{mode:a,outline:[_(u,D(J(c,u),.14)),_(u,D(J(c,u),1-.14)),l,d]};let{nearPath:m,farPath:p}=Ke(s);return{mode:a,outline:[...se(m),...se(p).slice(1)]}}function on(e,t,n,o){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let r=Xe(e,t),{p0:i,p1:a,p2:s,p3:u}=r,c=o==="bezier"?Ke(r):null,l=c?se(c.nearPath):null,d=c?se(c.farPath).reverse():null,m=Math.min(.055,.18/(n+1));return Array.from({length:n},(p,y)=>{let b=(y+1)/(n+1),M=b-m/2,v=b+m/2;return l&&d?[...Ue(l,M,v),...Ue(d,M,v).reverse()]:[L(i,a,M),L(i,a,v),L(u,s,v),L(u,s,M)]})}var ir=40,ar=1200,sr=.8,cr=3,lr=-2,ur=20,dr=.1,fr=40,mr=40,Ye=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function rn(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let o=Math.max(1,Math.floor(t/Ye(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let a=0;for(let s of i.split(/\s+/)){let u=s.length;a&&a+1+u<=o?a+=1+u:(r+=Math.max(1,Math.ceil(u/o)),a=u%o)}}return Math.max(1,r)}function xe(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(s=>s.length))*Ye(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),a=rn(e,i);return{width:r,height:a*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:a,padding:t}}function an(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,a=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return Math.hypot(e.x-(t.x+a*o),e.y-(t.y+a*r))}function $e(e,t){let n=1/0;for(let o of t)if(!(o.length<2))for(let r=0,i=o.length-1;r<o.length;i=r++){let a=an(e,o[i],o[r]);a<n&&(n=a)}return n}function ze(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,a=t[o].y,s=t[r].x,u=t[r].y;a>e.y!=u>e.y&&e.x<(s-i)*(e.y-a)/(u-a)+i&&(n=!n)}return n}function We(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function sn(e,t,n){let o=ze(e,t)&&!n.some(i=>ze(e,i)),r=$e(e,[t,...n]);return o?r:-r}function Y(e,t,n,o,r){let i=sn({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var Se=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let o=n.length-1;for(;o>0;){let r=o-1>>1;if(n[r].max>=n[o].max)break;[n[r],n[o]]=[n[o],n[r]],o=r}}pop(){let t=this.items,n=t[0],o=t.pop();if(t.length&&o){t[0]=o;let r=0;for(;;){let i=r*2+1,a=i+1,s=r;if(i<t.length&&t[i].max>t[s].max&&(s=i),a<t.length&&t[a].max>t[s].max&&(s=a),s===r)break;[t[s],t[r]]=[t[r],t[s]],r=s}}return n}};function Me(e){if(e.length<3)return 0;let t=0;for(let n=0,o=e.length-1;n<e.length;o=n++)t+=(e[o].x+e[n].x)*(e[o].y-e[n].y);return Math.abs(t)/2}function cn(e,t){return Math.max(0,Me(e)-We(t).reduce((n,o)=>n+Me(o),0))}function we(e,t){let n=We(t);if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let b=e.reduce((v,C)=>v+C.x,0)/e.length,M=e.reduce((v,C)=>v+C.y,0)/e.length;return{point:{x:b,y:M},radius:0}}let o=1/0,r=1/0,i=-1/0,a=-1/0;for(let b of e)b.x<o&&(o=b.x),b.y<r&&(r=b.y),b.x>i&&(i=b.x),b.y>a&&(a=b.y);let s=i-o,u=a-r,c=Math.min(s,u);if(!(c>0))return{point:{x:(o+i)/2,y:(r+a)/2},radius:0};let l=Math.max(s,u)/150,d=new Se,m=c/2;for(let b=o;b<i;b+=c)for(let M=r;M<a;M+=c)d.push(Y(b+m,M+m,m,e,n));let p=Y(o+s/2,r+u/2,0,e,n),y=0;for(;d.size;){let b=d.pop();if(!b)break;b.d>p.d&&(p=b),!(b.max-p.d<=l)&&(y>=4e3||(y+=1,m=b.h/2,d.push(Y(b.x-m,b.y-m,m,e,n)),d.push(Y(b.x+m,b.y-m,m,e,n)),d.push(Y(b.x-m,b.y+m,m,e,n)),d.push(Y(b.x+m,b.y+m,m,e,n))))}return{point:{x:p.x,y:p.y},radius:Math.max(0,p.d)}}function ee(e,t,n){return Math.max(t,Math.min(n,e))}function N(e,t,n){return e<t?t:e>n?n:e}function ln(e){return ee(e,0,1)}function qe(e){let t=ln(e);return t*t*(3-2*t)}var z=Math.PI*2;function $(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function un(e,t,n){let o=t-e;if(n){for(;o<0;)o+=z;for(;o>=z;)o-=z}else{for(;o>0;)o-=z;for(;o<=-z;)o+=z}return o}function Je(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(T(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!$(n.control1)||!$(n.control2)||T(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(T(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(T(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||T(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return T(t,e.start)<=1e-4}function dn(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function et(e,t=2){if(!Je(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let a=Math.atan2(r.y-i.center.y,r.x-i.center.x),s=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),u=un(a,s,i.clockwise),c=Math.max(2,Math.ceil(Math.abs(u)*i.radius/n));for(let l=1;l<=c;l+=1){let d=a+u*l/c;o.push({x:i.center.x+Math.cos(d)*i.radius,y:i.center.y+Math.sin(d)*i.radius})}}else{let a=T(r,i.control1)+T(i.control1,i.control2)+T(i.control2,i.end),s=Math.max(2,Math.ceil(a/n));for(let u=1;u<=s;u+=1)o.push(dn(r,i,u/s))}r=i.end}return T(o[o.length-1],o[0])<=1e-4&&o.pop(),o}function tt(e,t,n){return fn(e,r=>({x:r.x+t,y:r.y+n}))}function fn(e,t,n=1,o=!1){return{...e,start:t(e.start),segments:e.segments.map(r=>r.kind==="line"?{...r,end:t(r.end)}:r.kind==="arc"?{...r,center:t(r.center),radius:r.radius*Math.abs(n),clockwise:o?!r.clockwise:r.clockwise,end:t(r.end)}:{...r,control1:t(r.control1),control2:t(r.control2),end:t(r.end)})}}var mn=45,ve=150,hn=60;function bn(e){let t=mn/100;if(e<=t)return ve;let n=Math.min(1,(e-t)/(1-t));return ve-n*(ve-hn)}var Qe=.5523;function Ze(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function pn(e){let t=[],n=[];for(e.forEach((o,r)=>{$(o)&&(t.length&&Ze(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&Ze(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var yn=.5,gn=4/3;function xn(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let a=-r/i,s=o/i,u=n*gn;return{kind:"bezier",control1:{x:e.x+o/3+a*u,y:e.y+r/3+s*u},control2:{x:e.x+o*2/3+a*u,y:e.y+r*2/3+s*u},end:{...t}}}function nt(e,t){let{points:n,sourceIndex:o}=pn(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,a=t.edgeCurvature,s=new Array(r).fill(0);if(a?.length)for(let x=0;x<r;x+=1){let g=a[o[x]];s[x]=Number.isFinite(g)?Math.min(100,Math.max(-100,g))/100:0}let u=s.some(x=>Math.abs(x)>1e-6);if(i<=0&&!u)return null;let c=t.wideAngleThresholdDeg??bn(i),l=[];for(let x=0;x<r;x+=1)l[x]=T(n[x],n[(x+1)%r]);let d=new Array(r).fill(0);for(let x=0;x<r;x+=1){let g=n[(x-1+r)%r],f=n[x],h=n[(x+1)%r],w={x:g.x-f.x,y:g.y-f.y},S={x:h.x-f.x,y:h.y-f.y},P=Math.hypot(w.x,w.y),E=Math.hypot(S.x,S.y);if(P<=1e-9||E<=1e-9)continue;let I=Math.min(1,Math.max(-1,(w.x*S.x+w.y*S.y)/(P*E))),k=Math.acos(I)*180/Math.PI;if(k<c)continue;let O=qe((k-c)/(180-c));d[x]=i*O*.5*Math.min(P,E)}for(let x=0;x<r;x+=1){let g=(x+1)%r,f=d[x]+d[g];if(f>l[x]&&f>1e-9){let h=l[x]/f;d[x]*=h,d[g]*=h}}let m=new Array(r),p=new Array(r);for(let x=0;x<r;x+=1){let g=n[(x-1+r)%r],f=n[x],h=n[(x+1)%r];if(d[x]<=1e-6){m[x]={...f},p[x]={...f};continue}let w=T(f,g)||1,S=T(f,h)||1;m[x]={x:f.x+(g.x-f.x)/w*d[x],y:f.y+(g.y-f.y)/w*d[x]},p[x]={x:f.x+(h.x-f.x)/S*d[x],y:f.y+(h.y-f.y)/S*d[x]}}if(d.every(x=>x<=1e-6)&&!u)return null;let y=[],b={...p[0]},M=b,v=(x,g)=>{if(T(M,x)<=1e-9)return;let f=s[g];Math.abs(f)>1e-6?y.push(xn(M,x,f*yn*l[g])):y.push({kind:"line",end:{...x}}),M=x};for(let x=1;x<=r;x+=1){let g=x%r,f=n[g];v(m[g],(x-1)%r),d[g]>1e-6&&T(m[g],p[g])>1e-9&&(y.push({kind:"bezier",control1:L(m[g],f,Qe),control2:L(p[g],f,Qe),end:{...p[g]}}),M=p[g])}if(!y.length)return null;let C=y[y.length-1];T(C.end,b)>1e-9&&(C.kind==="line"?C.end={...b}:y.push({kind:"line",end:{...b}}));let R={version:1,closed:!0,start:b,segments:y};return Je(R)?R:null}function Sn(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((o,r)=>{let i=e.edgeCurvature[r];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(o=>Math.abs(o)>.5)?n:[]}function Mn(e){let t=Sn(e);return t.length?nt(e.points,{edgeCurvature:t}):null}function ce(e,t=2){let n=Mn(e);return n?et(n,t):e.points??[]}function wn(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],a=e[r+1],s=Math.hypot(a.x-i.x,a.y-i.y);if(s<=0)continue;let u=Math.max(1,Math.round(s/n)),c=s/u,l=Math.atan2(a.y-i.y,a.x-i.x),d=r===0,p=(r>0?t[r-1]:void 0)==="break"?2:1,y=d?{...i}:{x:i.x+Math.cos(l)*c*p,y:i.y+Math.sin(l)*c*p},b=d?u+1:Math.max(1,u-(p-1));o.push({origin:y,rotation:l*180/Math.PI,seatCount:b,seatSpacing:c})}return o}function vn(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(o,r)=>({x:e.origin.x+n.x*r*e.seatSpacing,y:e.origin.y+n.y*r*e.seatSpacing}))}function Pn(e){return e.reduce((t,n)=>t+n.seatCount,0)}function te(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((m,p)=>m.segmentedRow.componentIndex-p.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,s=i[0]?.segmentedRow;if(!s||!(a>=2&&i.length===a&&s?.boundaryBefore==="start"&&i.every((m,p)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===o&&m.segmentedRow.componentCount===a&&m.segmentedRow.componentIndex===p&&m.segmentedRow.repeatLabelOnComponents===s.repeatLabelOnComponents&&(p===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===s.displayLabel)))continue;let c=i.reduce((m,p)=>m+p.seatCount,0),l=0,d=0;for(let m of i)m.segmentedRow.boundaryBefore==="break"&&(l+=1),t.set(m.id,{groupId:o,adjacencyOffset:l,displayOffset:d,displayLabel:s.displayLabel,totalSeats:c,canonical:i[0],viewFromSeatUrl:s.viewFromSeatUrl,viewFromSeatMeta:s.viewFromSeatMeta,confidenceEvidence:s.confidenceEvidence}),l+=m.seatCount,d+=m.seatCount}return t}var In="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Cn="abcdefghijklmnopqrstuvwxyz";function kn(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function ne(e,t=!1){let n=t?Cn:In;return kn(Math.max(0,Math.floor(e)-1),n)}var Rn=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function ot(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Rn)for(;t>=o;)n+=r,t-=o;return n}function On(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function le(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",a=e.seatNumbering?.prefix??"",s=e.seatNumbering?.endAt,u=e.seatCount;if(i==="updown"||i==="updown-descending"){let p=Math.ceil(u/2),y=i==="updown"?t<p?n+2*t:n-1+2*(u-t):t<p?n+2*(p-1-t):n+1+2*(t-p);return`${a}${y}`}let c=i==="odd"||i==="even"?2:r,l=s!=null&&Number.isFinite(s)?s-(u-1)*c:n,d=o==="center"?On(u)[t]:o==="rtl"?u-1-t:t,m;switch(i){case"odd":{let p=l%2===1?l:l+1;m=String(p+d*2);break}case"even":{let p=l%2===0?l:l+1;m=String(p+d*2);break}case"roman":m=ot(l+d*r);break;case"letters-upper":m=ne(l+d*r,!1);break;case"letters-lower":m=ne(l+d*r,!0);break;default:m=String(l+d*r);break}return`${a}${m}`}function En(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function rt(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${le(e,t)}`}function Pe(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(e.seatDisplayLabelMode==="number")return le(e,t);if(!n)return`${e.displayLabel||e.label}-${le(e,t)}`;let r=En(n),i=n.displayOffset+t;return`${n.displayLabel}-${le(r,i)}`}var Ie=999,it=["clockwise","anticlockwise"],at=["table-number","number","letter"];function Ce(e,t){return`${e.label}-${t+1}`}function An(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function st(e,t){let n=e.chairNumbering,o=n?.start??1,r=An(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?ne(Math.max(1,o)+r):String(o+r)}function ke(e,t){let n=st(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function Tn(e){if(e===void 0)return null;if(!e||typeof e!="object"||Array.isArray(e))return"chairNumbering must be an object";let t=e,n=Object.keys(t).filter(o=>!["start","direction","format"].includes(o));return n.length?`chairNumbering has unsupported field(s): ${n.join(", ")}`:t.start!==void 0&&(!Number.isInteger(t.start)||t.start<0||t.start>Ie)?`chairNumbering.start must be a whole number from 0 to ${Ie}`:t.direction!==void 0&&!it.includes(t.direction)?"chairNumbering.direction must be clockwise or anticlockwise":t.format!==void 0&&!at.includes(t.format)?"chairNumbering.format must be table-number, number or letter":null}function Ln(e){let t={};return e.start!==void 0&&e.start!==1&&(t.start=e.start),e.direction==="anticlockwise"&&(t.direction="anticlockwise"),e.format&&e.format!=="table-number"&&(t.format=e.format),Object.keys(t).length?t:void 0}var W=.02291666666666667,Rr=1/W,_n=58,Dn=_n*W;var jn=3,ct=0,Re=120,Fn=0,Nn=45,Bn=7,q=1.2;function Oe(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function Hn(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Bn?e:jn}function lt(e,t={}){let n=Oe(t.floorBaseHeightM,ct,Re,0),o=Math.min(Re,n+Hn(e.elevation)*Dn),r=e.height===void 0?o:Oe(e.height,ct,Re,o),i=Oe(e.rake,Fn,Nn,0);return{height:r,rake:i}}function ut(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 dt(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,u=a.y-i.y,c=s*s+u*u,l=c>1e-12?((t-i.x)*s+(n-i.y)*u)/c:0;l<0?l=0:l>1&&(l=1);let d=t-(i.x+l*s),m=n-(i.y+l*u);if(Math.abs(d)>=o||Math.abs(m)>=o)continue;let p=Math.hypot(d,m);p<o&&(o=p)}return o}function Gn(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>r&&(r=a)}return{cx:t,cy:n,r}}function ft(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Ee(e,t){let n=1/0;for(let o of ut(e)){let r=dt(t,o.x,o.y);r<n&&(n=r)}for(let o of ut(t)){let r=dt(e,o.x,o.y);r<n&&(n=r)}return n}function Vn(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let l of e)n+=l.x,o+=l.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let l of e){let d=Math.hypot(l.x-n,l.y-o);d>r&&(r=d,i=l)}let a=i.x-n,s=i.y-o,u=Math.hypot(a,s);u>1e-9?(a/=u,s/=u):(a=1,s=0);let c=e.map((l,d)=>({p:l,i:d,t:(l.x-n)*a+(l.y-o)*s})).sort((l,d)=>l.t-d.t);return{pts:c.map(l=>l.p),seatIndices:c.map(l=>t[l.i])}}function Un(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let C of e)n+=C.x,o+=C.y;n/=t,o/=t;let r=0,i=0,a=0,s=0,u=0,c=0,l=0;for(let C of e){let R=C.x-n,x=C.y-o;r+=R*R,a+=x*x,i+=R*x,s+=R*R*R,u+=x*x*x,c+=R*x*x,l+=x*R*R}let d=r*a-i*i;if(Math.abs(d)<1e-9)return null;let m=(s+c)/2,p=(u+l)/2,y=(m*a-p*i)/d,b=(p*r-m*i)/d,M=y+n,v=b+o;return!Number.isFinite(M)||!Number.isFinite(v)?null:{cx:M,cy:v}}var Xn=.15;function Kn(e){if(e.length<2)return null;let t=e.map(g=>{let f=0,h=0;for(let w of g.pts)f+=w.x,h+=w.y;return{x:f/g.pts.length,y:h/g.pts.length}}),n=0,o=0;for(let g of t)n+=g.x,o+=g.y;n/=t.length,o/=t.length;let r=0,i=0,a=0;for(let g of t){let f=g.x-n,h=g.y-o;r+=f*f,i+=f*h,a+=h*h}let s=r+a,u=r*a-i*i,c=s/2+Math.sqrt(Math.max(0,s*s/4-u)),l,d;Math.abs(i)>1e-12?(l=c-a,d=i):r>=a?(l=1,d=0):(l=0,d=1);let m=Math.hypot(l,d);if(!(m>1e-12))return null;l/=m,d/=m;let p=0,y=0,b=0;for(let g of e){if(g.pts.length<2)continue;let f=g.pts[0],h=g.pts[g.pts.length-1],w=h.x-f.x,S=h.y-f.y,P=Math.hypot(w,S);if(!(P>1e-9))continue;let E=w/P,I=S/P;p+=(E*E-I*I)*P,y+=2*E*I*P,b+=P}if(b>0&&Math.hypot(p,y)>=zn*b){let g=Math.atan2(y,p)/2,f=Math.cos(g),h=Math.sin(g);Math.abs(l*f+d*h)>$n&&(l=-h,d=f)}let M=1/0,v=-1/0,C=[];for(let g of e){let f=1/0,h=-1/0;for(let w of g.pts){let S=w.x*l+w.y*d;S<f&&(f=S),S>h&&(h=S),S<M&&(M=S),S>v&&(v=S)}C.push(h-f)}let R=v-M;return R>1e-9?(C.sort((g,f)=>g-f),C[Math.min(C.length-1,Math.floor(C.length*.9))]/R<=Yn?{x:l,y:d}:null):null}var Yn=.35,zn=.8,$n=.7;function mt(e,t,n,o){let r=new Map;for(let f of n){let h=t[f],w=h.rowId||`__seat-${f}`,S=r.get(w);S||(S={pts:[],idx:[]},r.set(w,S)),S.pts.push({x:h.x,y:h.y}),S.idx.push(f)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[f,h]of r){let w=Vn(h.pts,h.idx),S=0;for(let P of w.pts)S+=Math.hypot(P.x-o.x,P.y-o.y);i.push({id:f,pts:w.pts,seatIndices:w.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:S/w.pts.length})}let a=i.map(f=>Gn(f.pts)),s=i.length<=256?i.length*(i.length-1)/2:0,u=s?new Float64Array(s):null;u?.fill(Number.NaN);let c=u?new Map(i.map((f,h)=>[f,h])):null,l=(f,h)=>(f>h&&([f,h]=[h,f]),f*(2*i.length-f-1)/2+(h-f-1)),d=(f,h)=>{if(!u)return Ee(i[f].pts,i[h].pts);let w=l(f,h),S=u[w];if(!Number.isNaN(S))return S;let P=Ee(i[f].pts,i[h].pts);return u[w]=P,P},m=(f,h)=>c?d(c.get(f),c.get(h)):Ee(f.pts,h.pts),p=[];for(let f=0;f<i.length;f++){let h=1/0;for(let w=0;w<i.length;w++){if(f===w||ft(a[f],a[w])>=h)continue;let S=d(f,w);S<h&&(h=S)}Number.isFinite(h)&&p.push(h)}p.sort((f,h)=>f-h);let y=p.length?p[Math.floor(p.length/2)]:1,b=Math.max(y*1.8,1e-6),M=i.map(()=>[]);for(let f=0;f<i.length;f++)for(let h=f+1;h<i.length;h++)ft(a[f],a[h])>b||d(f,h)<=b&&(M[f].push(h),M[h].push(f));let v=0;for(let f=0;f<i.length;f++){if(i[f].blockId!==-1)continue;let h=v++,w=[f];for(i[f].blockId=h;w.length;){let S=w.pop();for(let P of M[S])i[P].blockId===-1&&(i[P].blockId=h,w.push(P))}}let C=new Map;for(let f of i){let h=C.get(f.blockId)??[];h.push(f),C.set(f.blockId,h)}let R=[];for(let f of i){if(f.pts.length<4)continue;let h=Un(f.pts);h&&(!Number.isFinite(h.cx)||!Number.isFinite(h.cy)||R.push({x:h.cx,y:h.cy}))}let x=R.length>=2?(()=>{let f=R.map(S=>S.x).sort((S,P)=>S-P),h=R.map(S=>S.y).sort((S,P)=>S-P),w=Math.floor(R.length/2);return{cx:f[w],cy:h[w]}})():null;if(x){let f=I=>Math.hypot(I.x-x.cx,I.y-x.cy),h=1/0,w=-1/0,S=[];for(let I of i){let k=1/0,O=-1/0;for(let j of I.pts){let B=f(j);B<k&&(k=B),B>O&&(O=B)}S.push(O-k),k<h&&(h=k),O>w&&(w=O)}let P=w-h;S.sort((I,k)=>I-k);let E=S[Math.min(S.length-1,Math.floor(S.length*.9))];if(P>1e-9&&E/P<=Xn){let I=i.map(A=>{let ie=0;for(let $t of A.pts)ie+=f($t);return{row:A,radius:ie/A.pts.length}}),k=0,O=0;for(let A of I)k+=A.radius,O+=A.row.focalDistance;k/=I.length,O/=I.length;let j=0;for(let A of I)j+=(A.radius-k)*(A.row.focalDistance-O);if(j<0)for(let A of I)A.radius=-A.radius;let H=1/0;for(let A of I)A.radius<H&&(H=A.radius);I.sort((A,ie)=>A.radius-ie.radius);let F=-1,K=-1/0,zt=P/Math.max(1,I.length)*.5,Ge=[];for(let A of I)A.radius-K>zt&&(F++,K=A.radius),A.row.ordinal=F,A.row.blockDepth=A.radius-H,Ge.push(A.row);return{sectionId:e,rows:Ge,blockCount:v}}}let g=[];for(let[,f]of C){let h=Kn(f);if(h){let w=I=>{let k=0;for(let O of I.pts)k+=O.x*h.x+O.y*h.y;return k/I.pts.length};f.sort((I,k)=>w(I)-w(k)),f.length>=2&&f[0].focalDistance>f[f.length-1].focalDistance&&f.reverse();let S=[],P=y*.5;for(let I of f){let k=S[S.length-1];k&&Math.abs(w(I)-w(k[0]))<P?k.push(I):S.push([I])}let E=0;for(let I=0;I<S.length;I++){if(I>0){let k=1/0;for(let O of S[I-1])for(let j of S[I])k=Math.min(k,m(O,j));E+=k}for(let k of S[I])k.ordinal=I,k.blockDepth=E,g.push(k)}}else{let w=1/0;for(let S of f)S.focalDistance<w&&(w=S.focalDistance);f.sort((S,P)=>S.focalDistance-P.focalDistance);for(let S=0;S<f.length;S++)f[S].ordinal=S,f[S].blockDepth=Math.max(0,f[S].focalDistance-w),g.push(f[S])}}return{sectionId:e,rows:g,blockCount:v}}var Wn=/^\d{4}-\d{2}-\d{2}$/;function qn(e){let t=Date.parse(e);return Number.isFinite(t)?Wn.test(e)?t+864e5:t:null}function Qn(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=qn(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Zn(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function Jn(e){return e.status!=="draft"&&e.status!=="retracted"}function eo(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function ht(e,t={}){return!!e&&Jn(e)&&Zn(e,t.activeConfigurationId,t.activeConfigurationVersion)&&eo(e,t.activeBasisSha256)&&Qn(e,t.now)}var bt=36,pt=160;function to(e,t=360){let n=ee(Math.round(Number.isFinite(e)?e:1),1,40),o=ee(Number.isFinite(t)?t:360,120,360);return Math.round(ee(n*4*(360/o),bt,pt))}var no=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]);function oo(e){return!!e&&no.has(e)}var yt=1.1;var _r=Math.PI*2;var Dr=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,a=[],s=Math.atan2(o.y-r,o.x),u=Math.atan2(o.y-r,-o.x);for(let c=0;c<=24;c++){let l=s+(u-s)*c/24;a.push({x:i*Math.cos(l),y:r+i*Math.sin(l)})}return{half:70,home:t,backstop:n,fence:a}})();function gt(e){return oo(e)}function ro(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?ce(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function io(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*r-s*i,y:t.y+a*i+s*r}}function xt(e){let t=ro(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(u=>io(u,{x:t.reduce((c,l)=>c+l.x,0)/t.length,y:t.reduce((c,l)=>c+l.y,0)/t.length},n)),r=1/0,i=1/0,a=-1/0,s=-1/0;for(let u of o)r=Math.min(r,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),s=Math.max(s,u.y);return!Number.isFinite(r)||a-r<1e-6||s-i<1e-6?null:{minX:r,minY:i,maxX:a,maxY:s}}var ao=5,so=3,co=.92,lo=1.9,uo=2,fo=.6,mo=1,ho=.06;function bo(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?yt:gt(e.stageKind)?ho:mo}function St(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let a of Q(e)){let s=a.baseHeightM??0;for(let u of a.objects){if(u.type!=="shape"||u.role!=="stage")continue;let c=xt(u);c&&(t=Math.min(t,c.minX),n=Math.min(n,c.minY),o=Math.max(o,c.maxX),r=Math.max(r,c.maxY),i=Math.max(i,s+bo(u)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function po(e,t,n,o){let r=1/0,i=1/0,a=-1/0,s=-1/0;for(let p of e)Number.isFinite(p.eyeHeightM)&&(r=Math.min(r,p.x),a=Math.max(a,p.x),i=Math.min(i,p.y),s=Math.max(s,p.y));if(!Number.isFinite(r))return null;let u=r*t,c=i*t,l=Math.max(1,Math.ceil((a-r)*t/n)+1),d=Math.max(1,Math.ceil((s-i)*t/n)+1),m=new Float64Array(l*d).fill(-1/0);for(let p of e){if(!Number.isFinite(p.eyeHeightM))continue;let y=p.eyeHeightM-q,b=Math.min(l-1,Math.max(0,Math.floor((p.x*t-u)/n))),v=Math.min(d-1,Math.max(0,Math.floor((p.y*t-c)/n)))*l+b,C=y+o;C>m[v]&&(m[v]=C)}return{cellM:n,minX:u,minY:c,cols:l,rows:d,top:m}}function yo(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function Mt(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??W,i=n.cellM??fo,a=n.chairBackM??co,s=n.selfRowSkipM??uo,u=n.clearThreshold??.9,c=n.partialThreshold??.25,l=Math.max(1,n.columns??ao),d=Math.max(1,n.rows??so),m=po(e,r,i,a);if(!m)return o;let p=(t.maxX-t.minX)*r,y=(t.maxY-t.minY)*r,b=p>=y,M=(t.minX+t.maxX)/2*r,v=(t.minY+t.maxY)/2*r,C=[];for(let x=0;x<l;x++){let g=(x+.5)/l-.5,f=b?M+g*p:M,h=b?v:v+g*y;for(let w=0;w<d;w++){let S=t.deckTopM+(d===1?0:w/(d-1)*lo);C.push({x:f,y:h,z:S})}}let R=i/2;for(let x of e){if(!Number.isFinite(x.eyeHeightM))continue;let g=x.x*r,f=x.y*r,h=x.eyeHeightM,w=0,S=1/0;for(let E of C){let I=E.x-g,k=E.y-f,O=Math.hypot(I,k);if(!(O>s)){w++;continue}let j=I/O,B=k/O,H=0;for(let F=s;F<O;F+=R){let K=yo(m,g+j*F,f+B*F);if(!(!Number.isFinite(K)||K>=h)&&K>h+(E.z-h)*F/O){H=F;break}}H?S=Math.min(S,H):w++}let P=w/C.length;P>=u||o.set(x.id,{seatId:x.id,mark:P<c?"obstructedView":"restrictedView",visibleFraction:P,totalRays:C.length,atDistanceM:Number.isFinite(S)?S:0})}return o}function wt(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function Ae(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var fe=Math.PI/180,go=9,G=16;function Te(e,t,n,o){let r=n*fe,i=Math.cos(r),a=Math.sin(r);return{x:o.x+e*i-t*a,y:o.y+e*a+t*i}}function me(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,a=[];if(e.path)return ge(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(o===0){for(let c=0;c<t;c++)a.push(Te(c*n,0,r,i));return a}let s=o/(t-1)*fe,u=n/(2*Math.sin(Math.abs(s)/2));for(let c=0;c<t;c++){let l=c*s,d=u*Math.sin(l),m=-u+u*Math.cos(l);a.push(Te(d,m,r,i))}return a}function Ct(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function xo(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 kt(e,t){let n=Ct(e);return me(e).map((o,r)=>{let i=n.get(r),a=Ae(i),s=rt(e,r,i),u={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:s,displayLabel:Pe(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(u).some(c=>c!==void 0&&c!==!1&&c!=="")?u:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function Rt(e){let t=[];for(let n of kt(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 Ot(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function _e(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(l=>[l.index,l])),r=(l,d,m,p)=>{let y=o.get(l),b=Ae(y),M=y?.label??Ce(e,l);return{index:l,label:M,displayLabel:y?.displayLabel??ke(e,l),x:d+(y?.dx??0),y:m+(y?.dy??0),categoryKey:y?.categoryKey??e.categoryKey,skipped:!!y?.skip,accessible:b.length>0,accessibility:b,wheelchairSpaceType:y?.wheelchairSpaceType,commercial:y?.commercial,glyph:y?.glyph,viewUrl:y?.viewFromSeatUrl,viewMeta:y?.viewFromSeatUrl?y.viewFromSeatMeta:void 0,labelStyle:y?.labelStyle,...p?{side:p}:{}}};if(e.shape==="round"){let l=(e.radius??40)+G,d=e.rotation*fe,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||n===1){for(let M=0;M<n;M++){let v=d+M/n*2*Math.PI;t.push(r(M,e.center.x+l*Math.cos(v),e.center.y+l*Math.sin(v)))}return t}let p=m*fe,y=(2*Math.PI-p)/2,b=d+y;for(let M=0;M<n;M++){let v=b+M/(n-1)*p;t.push(r(M,e.center.x+l*Math.cos(v),e.center.y+l*Math.sin(v)))}return t}let i=e.width??80,a=e.height??50,s=Ot(e),u=["top","bottom","left","right"],c=0;for(let l of u){let d=s[l];for(let m=0;m<d;m++){let p,y;l==="top"?(p=-i/2+(m+.5)*i/d,y=-a/2-G):l==="bottom"?(p=-i/2+(m+.5)*i/d,y=a/2+G):l==="left"?(p=-i/2-G,y=-a/2+(m+.5)*a/d):(p=i/2+G,y=-a/2+(m+.5)*a/d);let b=Te(p,y,e.rotation,e.center);t.push(r(c++,b.x,b.y,l))}}return t}function So(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):_e(e).filter(t=>!t.skipped).length}function Et(e){return _e(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 At(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function Le(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,a=t[o].y,s=t[r].x,u=t[r].y;a>e.y!=u>e.y&&e.x<(s-i)*(e.y-a)/(u-a)+i&&(n=!n)}return n}function Tt(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),s=(r.x-n.x)**2+(r.y-n.y)**2;return a>=-1e-7&&a<=s+1e-7})}function V(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function U(e,t,n){return Le(e,t)&&!V(n).some(o=>Le(e,o)||Tt(e,o))}function De(e,t){return we(e,t).point}function de(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function je(e){switch(e.type){case"row":{let t=me(e),n=Ct(e),o=0,r=0,i=0;for(let a=0;a<t.length;a++){let s=n.get(a);s?.skip||(o+=t[a].x+(s?.dx??0),r+=t[a].y+(s?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return de(e.points);case"section":return de(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?de(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 vt(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function Mo(e,t){if(e.type!=="gaArea"||!vt(e.points,t.outline))return!1;let n=V(e.holes),o=V(t.holes);return n.length===o.length&&n.every((r,i)=>vt(r,o[i]))}function Lt(e,t,n=e.filter(r=>r.type==="section"),o=je(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(a=>(a.logicalSectionId??a.id)===r&&(Mo(t,a)||U(o,a.outline,a.holes))):void 0)??n.find(a=>U(o,a.outline,a.holes))}function Q(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 wo(e,t){let n=Q(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function _t(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function he(e,t,n){let o=i=>({x:i.x+t,y:i.y+n}),r=i=>i.map(o);switch(e.type){case"row":return{...e,origin:o(e.origin)};case"table":case"booth":return{...e,center:o(e.center)};case"gaArea":return{...e,points:r(e.points),...e.holes?{holes:V(e.holes).map(r)}:{}};case"section":return{...e,outline:r(e.outline),...e.outlinePath?{outlinePath:tt(e.outlinePath,t,n)}:{},...e.holes?{holes:V(e.holes).map(r)}:{}};case"text":return{...e,position:o(e.position)};case"shape":return{...e,...e.points?{points:r(e.points)}:{},...e.holes?{holes:V(e.holes).map(r)}:{},...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 vo(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((o,r)=>{let i=-r*t;for(let a of o.objects)n.push(i===0?a:he(a,0,i))}),{...e,objects:n,floors:void 0}}function Pt(e,t,n,o,r,i,a,s,u){let c=[],l=e.filter(b=>b.type==="section"),d=te(e),m=b=>!b?.eventConfigurationId||b.eventConfigurationId===o&&(b.eventConfigurationVersion===void 0||b.eventConfigurationVersion===u),p=b=>ht(b,{activeConfigurationId:o,activeConfigurationVersion:u,activeBasisSha256:r,now:s}),y=(b,M)=>p(b)?{...b,coverage:M}:void 0;for(let b of e){let M=[];if(b.type==="row"?M=Rt(b):b.type==="table"?M=Et(b):b.type==="booth"&&(M=At(b)),!M.length)continue;for(let g of M)g.viewUrl&&!m(g.viewMeta)&&(g.viewUrl=void 0,g.viewMeta=void 0);if(b.type==="row"){let g=d.get(b.id);if(g){let f=new Map((b.overrides??[]).map(h=>[h.index,h]));for(let h of M){let w=Number(h.id.slice(h.id.lastIndexOf(":")+1));if(!Number.isInteger(w))continue;h.logicalRowId=g.groupId,h.logicalSeatIndex=g.adjacencyOffset+w,f.get(w)?.displayLabel||(h.displayLabel=Pe(b,w,g)),!h.viewUrl&&g.viewFromSeatUrl&&m(g.viewFromSeatMeta)&&(h.viewUrl=g.viewFromSeatUrl,h.viewMeta=g.viewFromSeatMeta);let S=f.get(w)?.confidenceEvidence;h.confidenceEvidence=y(S,"exact-seat")??y(b.confidenceEvidence,"row-representative")??y(g.confidenceEvidence,"row-representative")}}}let v=Lt(e,b,l,b.type==="row"?de(M):je(b)),C=v?.viewFromSeatUrl,x=(v?.zone?t?.find(g=>g.id===v.zone):void 0)?.focalPoint??n;for(let g of M){if(!g.confidenceEvidence){let f=Number(g.id.slice(g.id.lastIndexOf(":")+1)),h=(b.type==="row"||b.type==="table")&&Number.isInteger(f)?b.overrides?.find(w=>w.index===f)?.confidenceEvidence:void 0;g.confidenceEvidence=y(h,"exact-seat")??(b.type==="row"?y(b.confidenceEvidence,"row-representative"):void 0)}g.confidenceEvidence??=y(v?.confidenceEvidence,"section-representative")??(a?y(a.evidence,a.coverage):void 0),!g.viewUrl&&C&&m(v?.viewFromSeatMeta)&&(g.viewUrl=C,g.viewMeta=v?.viewFromSeatMeta),!g.viewUrl&&i&&m(i.meta)&&(g.viewUrl=i.url,g.viewMeta=i.meta),v&&(g.sectionId=v.logicalSectionId??v.id),v?.zone&&(g.zoneId=v.zone),x&&(g.focalPoint={...x})}c.push(...M)}return c}function Fe(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,a=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,s=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,u=Pt(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,s,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&It(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,u);for(let c of u)c.floorId=r.id;for(let c of u)o.push(c)}return o}let n=Pt(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&&It(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),Po(e,n,t)}function Po(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||wt(t,Mt(t,St(e))),t}function It(e,t,n,o){let r=e.filter(d=>d.type==="section"),i=n>0||r.some(d=>d.height!==void 0||d.rake!==void 0||(d.elevation??0)>0);if(!r.length||!i||!t){for(let d of o)d.eyeHeightM=n+q;return}let a=new Array(o.length),s=new Map;for(let d of r)s.has(d.id)||s.set(d.id,d);let u=new Map,c=new Map;for(let d=0;d<o.length;d++){let m=o[d],y=(m.sectionId?s.get(m.sectionId)??r.find(M=>M.logicalSectionId===m.sectionId&&U({x:m.x,y:m.y},M.outline,M.holes)):void 0)??r.find(M=>U({x:m.x,y:m.y},M.outline,M.holes))??null;if(a[d]=y,!y)continue;u.has(y.id)||u.set(y.id,lt(y,{floorBaseHeightM:n}));let b=c.get(y.id);b?b.push(d):c.set(y.id,[d])}let l=new Array(o.length).fill(void 0);for(let[d,m]of c){let p=u.get(d);if(!p)continue;let y=p.rake>0?Math.tan(p.rake*Math.PI/180):0,b=mt(d,o,m,t);for(let M of b.rows){let v=M.blockDepth*W*y,C=p.height+v;for(let R of M.seatIndices)l[R]=C}}for(let d=0;d<o.length;d++){let m=o[d],p=a[d];if(!p){m.eyeHeightM=n+q;continue}let y=u.get(p.id);m.eyeHeightM=(l[d]??y.height)+q}}var ue=40;function X(e,t){let n=t?.freeText==="exclude",o=1/0,r=1/0,i=-1/0,a=-1/0,s=(c,l)=>{c<o&&(o=c),l<r&&(r=l),c>i&&(i=c),l>a&&(a=l)},u=c=>{if(Array.isArray(c))for(let l of c)!l||typeof l!="object"||s(l.x,l.y)};for(let c of _t(e))if(c.type==="row"){let l=new Map((c.overrides??[]).map(d=>[d.index,d]));me(c).forEach((d,m)=>{let p=l.get(m);p?.skip||s(d.x+(p?.dx??0),d.y+(p?.dy??0))})}else if(c.type==="gaArea")u(c.points);else if(c.type==="section")u(c.outline);else if(c.type==="decorImage")s(c.x,c.y),s(c.x+c.width,c.y+c.height);else if(c.type==="shape")c.points&&c.points.length?u(ce(c)):c.x!=null&&c.y!=null&&c.width!=null&&c.height!=null&&(s(c.x,c.y),s(c.x+c.width,c.y+c.height));else if(c.type==="table"){let l=G+go,d=c.shape==="round"?(c.radius??40)+l:Math.max((c.width??80)/2,(c.height??50)/2)+l;s(c.center.x-d,c.center.y-d),s(c.center.x+d,c.center.y+d)}else if(c.type==="booth"){let l=Math.max(c.width,c.height)/2;s(c.center.x-l,c.center.y-l),s(c.center.x+l,c.center.y+l)}else if(c.type==="text"){if(n)continue;let l=xe(c);s(c.position.x,c.position.y),s(c.position.x+l.width,c.position.y+l.height)}for(let c of[e.referenceImage,e.backgroundImage]){if(!c)continue;let{center:l,width:d}=c;if(!l||!Number.isFinite(l.x)||!Number.isFinite(l.y)||!Number.isFinite(d))continue;let m=d*3/4;s(l.x-d/2,l.y-m/2),s(l.x+d/2,l.y+m/2)}if(!isFinite(o)){let c=e.focalPoint??{x:0,y:0};return{x:c.x-200,y:c.y-200,width:400,height:400}}return{x:o-ue,y:r-ue,width:i-o+ue*2,height:a-r+ue*2}}function Dt(e){let t=e.backgroundImage;return t?.url&&!t.assetId?t:void 0}var Nt=.08,Io=.045;function Ne(e){return`__floor__:${encodeURIComponent(e)}`}function re(e,t,n){return{...e,objects:t,floors:void 0,...n?{focalPoint:n}:{},referenceImage:void 0,backgroundImage:void 0}}function Co(e,t,n){let o=e.focalPoint??t.focalPoint;return o?o.x:n.x+n.width/2}function Bt(e){let t=e.floors??[];if(!t.length)return[];let n=t.map(a=>X(re(e,a.objects,a.focalPoint),{freeText:"exclude"})),r=Math.max(1,...n.map(a=>a.width))*Nt,i=0;return t.map((a,s)=>{let u=n[s],c=i-(u.y+u.height);return i-=u.height+r,{floorId:a.id,label:a.name??a.id,level:s,levelBadge:s===0?"G":String(s),translation:{x:-Co(a,e,u),y:c},bounds:u}})}function ko(e,t,n,o){let r=t==="name"?e.label:e.levelBadge;if(!r)return[];let i=Math.max(1,n*Io),a=e.bounds.x+e.translation.x-i*2.4,s=e.bounds.y+e.translation.y+i*.4,u=`floor-level-${e.floorId}`;if(t==="name")return[{type:"text",id:`${u}-text`,text:r,position:{x:a,y:s},fontSize:i,rotation:0,color:o,bold:!0}];let c=i*.95,l={type:"shape",id:`${u}-badge`,kind:"ellipse",x:a-c*.35,y:s-c*.3,width:c*2,height:c*2,fill:"transparent",stroke:{color:o,width:Math.max(1,i*.09)},opacity:.8},d={type:"text",id:`${u}-text`,text:r,position:{x:l.x,y:l.y+c-i/2},width:c*2,align:"center",lineHeight:1,fontSize:i,rotation:0,color:o,bold:!0};return[l,d]}function Ro(e,t={}){let n=e.floors;if(!n||n.length<2)return e;let o=Bt(e),r=[];n.forEach((c,l)=>{let{x:d,y:m}=o[l].translation;for(let p of c.objects)l>0&&p.type==="shape"&&p.role==="stage"||r.push(he(p,d,m))});let i={...e,objects:r,floors:void 0},a=X(i,{freeText:"exclude"}),s=Math.max(1,a.width,a.height),u=e.theme?.textColor??"#94a3b8";for(let c of o)r.push(...ko(c,t.labelStyle??"number",s,u));return{...i,objects:r,referenceImage:void 0,backgroundImage:void 0}}function Oo(e){if(!e.floors||e.floors.length<2)return e;let t=!e.zones?.length,n=new Set,o=e.floors.flatMap(i=>i.objects.flatMap(a=>{if(a.type==="shape"&&a.role==="stage"){let s=JSON.stringify([a.kind,a.x,a.y,a.width,a.height,a.points,a.rotation??0,a.label,a.heightM,a.eventConfigurationIds]);if(n.has(s))return[];n.add(s)}return t&&a.type==="section"?[{...a,zone:Ne(i.id)}]:[a]})),r=t?e.floors.map(i=>({id:Ne(i.id),label:i.name,focalPoint:{...i.focalPoint}})):e.zones;return{...e,objects:o,zones:r,floors:void 0,referenceImage:void 0,backgroundImage:Dt(e)}}function Ht(e){return e.floorOverview==="combined"?"combined":"separated"}function Eo(e){let t=e.floors??[];if(t.length<2||t.some(r=>!r.objects.some(i=>Ao.has(i.type))))return"separated";let n=jt.get(e);if(n)return n;let o=To(e)?"separated":"combined";return jt.set(e,o),o}var Ao=new Set(["row","table","booth","gaArea","section"]),Gt=.1,oe=18,jt=new WeakMap;function To(e){let t=e.floors??[],n=(i,a)=>`${Math.floor(i/oe)}:${Math.floor(a/oe)}`,o=t.map(i=>{let a=Fe(re(e,i.objects,i.focalPoint)).map(u=>({x:u.x,y:u.y})),s={areas:[],seats:new Map};for(let u of i.objects)u.type==="section"&&u.outline?.length>=3&&s.areas.push({outer:u.outline,holes:u.holes}),u.type==="gaArea"&&u.points?.length>=3&&s.areas.push({outer:u.points,holes:u.holes});for(let u of a){let c=n(u.x,u.y),l=s.seats.get(c);l?l.push(u):s.seats.set(c,[u])}return{seats:a,footprint:s}}),r=(i,a)=>{let s=Math.floor(i.x/oe),u=Math.floor(i.y/oe);for(let c=-1;c<=1;c+=1)for(let l=-1;l<=1;l+=1)for(let d of a.seats.get(`${s+c}:${u+l}`)??[])if(Math.hypot(d.x-i.x,d.y-i.y)<oe)return!0;return!1};return o.some((i,a)=>{if(!i.seats.length)return!1;let s=o.filter((c,l)=>l!==a).map(c=>c.footprint),u=0;for(let c of i.seats)s.some(l=>l.areas.some(d=>U(c,d.outer,d.holes))||r(c,l))&&(u+=1);return u/i.seats.length>Gt})}var be="level-context:";function Lo(e,t){let n=e.floors??[];if(n.length<2||Ht(e)!=="combined")return[];let o="#8a93a6",r=[],i=n.find(s=>s.id===t),a=i?X(re(e,i.objects,i.focalPoint),{freeText:"exclude"}):null;for(let s of n){if(s.id===t)continue;let u=0;for(let m of s.objects){let p=m.type==="section"?m.outline:m.type==="gaArea"?m.points:null;if(!p||p.length<3)continue;let y={type:"shape",id:`${be}${s.id}:${u++}`,kind:"polygon",label:"",points:p.map(b=>({...b})),fill:"transparent",stroke:{color:o,width:1.5},opacity:.35};r.push(y)}let c=X(re(e,s.objects,s.focalPoint),{freeText:"exclude"});if(!u||!a||!_o(c,a))continue;let l=r.filter(m=>m.type==="shape"&&m.id.startsWith(`${be}${s.id}:`)&&!!m.points),d=l.reduce((m,p)=>Ft(p.points)>Ft(m.points)?p:m,l[0]);r.push({type:"text",id:`${be}${s.id}:name`,text:s.name??s.id,position:De(d.points,void 0),fontSize:Math.max(1,Math.max(a.width,a.height)*.024),rotation:0,color:o,opacity:.6})}return r}function _o(e,t){return e.x>=t.x&&e.y>=t.y&&e.x+e.width<=t.x+t.width&&e.y+e.height<=t.y+t.height}function Ft(e){let t=e.map(o=>o.x),n=e.map(o=>o.y);return(Math.max(...t)-Math.min(...t))*(Math.max(...n)-Math.min(...n))}function Do(e){let t=e.floors;if(!t?.length)return null;let n=t.find(i=>i.objects.some(a=>a.type==="shape"&&a.role==="stage"));if(n)return n.id;let o=t[0],r=-1;for(let i of t){let a=X(re(e,i.objects,i.focalPoint),{freeText:"exclude"}),s=a.width*a.height;s>r&&(r=s,o=i)}return o.id}var jo=640;function Fo(e,t){return(e.floors?.length??0)<2?null:"all"}var Vt=9;function No(e){if(e.kind==="circle")return{hx:e.r,hy:e.r};let t=e.width/2,n=e.height/2,o=e.rotation??0;if(!o)return{hx:t,hy:n};let r=o*Math.PI/180,i=Math.abs(Math.cos(r)),a=Math.abs(Math.sin(r));return{hx:t*i+n*a,hy:t*a+n*i}}function Bo(e,t,n){let o=t-e.seat.x,r=n-e.seat.y;if(e.shape.kind==="circle")return o*o+r*r<=e.shape.r*e.shape.r;let i=e.shape.rotation??0,a=o,s=r;if(i){let u=-i*Math.PI/180,c=Math.cos(u),l=Math.sin(u);a=o*c-r*l,s=o*l+r*c}return Math.abs(a)<=e.shape.width/2&&Math.abs(s)<=e.shape.height/2}function Ho(e,t,n,o,r){if(e.shape.kind==="circle"){let y=Math.min(Math.max(e.seat.x,t),o),b=Math.min(Math.max(e.seat.y,n),r),M=e.seat.x-y,v=e.seat.y-b;return M*M+v*v<=e.shape.r*e.shape.r}let i=e.shape.rotation??0;if(!i)return e.seat.x-e.hx<=o&&e.seat.x+e.hx>=t&&e.seat.y-e.hy<=r&&e.seat.y+e.hy>=n;let a=i*Math.PI/180,s=Math.cos(a),u=Math.sin(a),c=e.shape.width/2,l=e.shape.height/2,d=[[-c,-l],[c,-l],[c,l],[-c,l]].map(([y,b])=>[e.seat.x+y*s-b*u,e.seat.y+y*u+b*s]),m=[[t,n],[o,n],[o,r],[t,r]],p=[[1,0],[0,1],[s,u],[-u,s]];for(let[y,b]of p){let M=1/0,v=-1/0;for(let[x,g]of d){let f=x*y+g*b;f<M&&(M=f),f>v&&(v=f)}let C=1/0,R=-1/0;for(let[x,g]of m){let f=x*y+g*b;f<C&&(C=f),f>R&&(R=f)}if(v<C||R<M)return!1}return!0}function Go(e,t={}){let n=t.seatRadius??Vt,o=e.length,r=new Array(o),i=1/0,a=1/0,s=-1/0,u=-1/0,c=0;for(let f=0;f<o;f++){let h=e[f],w=t.shapeOf?.(h)??{kind:"circle",r:n},{hx:S,hy:P}=No(w);r[f]={seat:h,shape:w,hx:S,hy:P},h.x-S<i&&(i=h.x-S),h.y-P<a&&(a=h.y-P),h.x+S>s&&(s=h.x+S),h.y+P>u&&(u=h.y+P),S>c&&(c=S),P>c&&(c=P)}o===0&&(i=0,a=0,s=0,u=0);let l=c>0?c*4:1,d=Math.max(s-i,0),m=Math.max(u-a,0),p=Math.max(64,t.maxCells??o*4),y=l,b=Math.max(1,Math.ceil(d/y)||1),M=Math.max(1,Math.ceil(m/y)||1);for(;b*M>p&&(b>1||M>1);)y*=2,b=Math.max(1,Math.ceil(d/y)||1),M=Math.max(1,Math.ceil(m/y)||1);let v=b*M,C=new Int32Array(v+1),R=0;for(let f=0;f<o;f++){let h=r[f],w=N(Math.floor((h.seat.x-h.hx-i)/y),0,b-1),S=N(Math.floor((h.seat.x+h.hx-i)/y),0,b-1),P=N(Math.floor((h.seat.y-h.hy-a)/y),0,M-1),E=N(Math.floor((h.seat.y+h.hy-a)/y),0,M-1);for(let I=P;I<=E;I++)for(let k=w;k<=S;k++)C[I*b+k+1]++,R++}for(let f=0;f<v;f++)C[f+1]+=C[f];let x=new Int32Array(R),g=C.slice(0,v);for(let f=0;f<o;f++){let h=r[f],w=N(Math.floor((h.seat.x-h.hx-i)/y),0,b-1),S=N(Math.floor((h.seat.x+h.hx-i)/y),0,b-1),P=N(Math.floor((h.seat.y-h.hy-a)/y),0,M-1),E=N(Math.floor((h.seat.y+h.hy-a)/y),0,M-1);for(let I=P;I<=E;I++)for(let k=w;k<=S;k++){let O=I*b+k;x[g[O]++]=f}}return{seats:e,entries:r,minX:i,minY:a,cell:y,cols:b,rows:M,cellStart:C,items:x,stamp:new Int32Array(o),epoch:0}}function Vo(e,t,n={}){let{cols:o,rows:r,cell:i,minX:a,minY:s,cellStart:u,items:c,entries:l}=e,d=Math.floor((t.x-a)/i),m=Math.floor((t.y-s)/i);if(d<0||m<0||d>=o||m>=r)return null;let p=m*o+d,y=u[p+1],b=-1,M=1/0;for(let v=u[p];v<y;v++){let C=c[v],R=l[C];if(n.filter&&!n.filter(R.seat.id,R.seat)||!Bo(R,t.x,t.y))continue;let x=t.x-R.seat.x,g=t.y-R.seat.y,f=x*x+g*g;(f<M||f===M&&C<b)&&(M=f,b=C)}return b<0?null:l[b].seat.id}function Uo(e,t,n,o={}){if(!(n>0))return null;let{cols:r,rows:i,cell:a,minX:s,minY:u,cellStart:c,items:l,entries:d}=e,m=Math.max(0,Math.floor((t.x-n-s)/a)),p=Math.min(r-1,Math.floor((t.x+n-s)/a)),y=Math.max(0,Math.floor((t.y-n-u)/a)),b=Math.min(i-1,Math.floor((t.y+n-u)/a));if(m>p||y>b)return null;let M=-1,v=n*n,C=e.stamp,R=++e.epoch;for(let x=y;x<=b;x++){let g=x*r;for(let f=m;f<=p;f++){let h=g+f,w=c[h+1];for(let S=c[h];S<w;S++){let P=l[S];if(C[P]===R)continue;C[P]=R;let E=d[P];if(o.filter&&!o.filter(E.seat.id,E.seat))continue;let I=t.x-E.seat.x,k=t.y-E.seat.y,O=I*I+k*k;(O<v||O===v&&P<M)&&(v=O,M=P)}}}return M<0?null:d[M].seat.id}function Xo(e,t,n={}){let o=Math.min(t.x,t.x+t.width),r=Math.max(t.x,t.x+t.width),i=Math.min(t.y,t.y+t.height),a=Math.max(t.y,t.y+t.height),s=n.mode??"center",{cols:u,rows:c,cell:l,minX:d,minY:m,cellStart:p,items:y,entries:b}=e,M=Math.max(0,Math.floor((o-d)/l)),v=Math.min(u-1,Math.floor((r-d)/l)),C=Math.max(0,Math.floor((i-m)/l)),R=Math.min(c-1,Math.floor((a-m)/l));if(M>v||C>R)return[];let x=[],g=e.stamp,f=++e.epoch;for(let h=C;h<=R;h++){let w=h*u;for(let S=M;S<=v;S++){let P=w+S,E=p[P+1];for(let I=p[P];I<E;I++){let k=y[I];if(g[k]===f)continue;g[k]=f;let O=b[k];if(n.filter&&!n.filter(O.seat.id,O.seat))continue;(s==="center"?O.seat.x>=o&&O.seat.x<=r&&O.seat.y>=i&&O.seat.y<=a:Ho(O,o,i,r,a))&&x.push(k)}}}return x.sort((h,w)=>h-w),x.map(h=>b[h].seat.id)}function Ko(e){let t=e.cols*e.rows,n=0,o=0;for(let i=0;i<t;i++){let a=e.cellStart[i+1]-e.cellStart[i];a>0&&n++,a>o&&(o=a)}let r=e.items.length;return{cell:e.cell,cols:e.cols,rows:e.rows,cells:t,occupiedCells:n,refs:r,maxPerCell:o,meanPerOccupiedCell:n?r/n:0}}var Yo=[{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"}],mi=new Map(Yo.map(e=>[e.key,e]));var zo=[{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"}],hi=new Map(zo.map(e=>[e.key,e]));var Ut=["start","end","both","none"];var $o=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],bi=new Set($o);function Z(e){return typeof e=="string"&&Ut.includes(e)}function pe(e,t){return e&&t?"both":e?"start":t?"end":"none"}function Xt(e){let t=new Map,n=te(e);if(!n.size)return t;let o=new Map;for(let r of e){if(r.type!=="row"||!n.has(r.id))continue;let i=r.segmentedRow.groupId,a=o.get(i)??[];a.push(r),o.set(i,a)}for(let r of o.values())r.sort((i,a)=>i.segmentedRow.componentIndex-a.segmentedRow.componentIndex),r.forEach((i,a)=>{let s=r[a+1];t.set(i.id,{start:a>0&&i.segmentedRow.boundaryBefore==="continuous",end:!!s&&s.segmentedRow.boundaryBefore==="continuous"})});return t}function Kt(e,t){let n=Number.isInteger(e.seatCount)&&e.seatCount>0?e.seatCount:0,o=new Set;for(let d of e.overrides??[])d.skip&&o.add(d.index);let r=d=>d>=0&&d<n&&!o.has(d),i=pe(!t?.start,!t?.end),a=Z(e.aisleSeats)?e.aisleSeats:void 0,s=a??i,u=-1,c=-1;for(let d=0;d<n;d+=1)r(d)&&(u<0&&(u=d),c=d);let l=new Set;if(u>=0){(s==="start"||s==="both")&&l.add(u),(s==="end"||s==="both")&&l.add(c);for(let d of o)r(d-1)&&l.add(d-1),r(d+1)&&l.add(d+1)}return{...a?{override:a}:{},automatic:i,slots:[...l].sort((d,m)=>d-m)}}function Wo(e,t=[e]){return Kt(e,e.segmentedRow?Xt(t).get(e.id):void 0)}function Yt(e){let t=new Set;for(let n of Q(e)){let o=Xt(n.objects);for(let r of n.objects)if(r.type==="row")for(let i of Kt(r,o.get(r.id)).slots)t.add(`${r.id}:${i}`)}return t}function qo(e,t,n){return Yt(e).has(`${t}:${n}`)}function Be(e){let t=Z(e.aisleSeats)?e.aisleSeats:"both";return{start:t==="start"||t==="both",end:t==="end"||t==="both"}}function He(e,t){t==="both"?delete e.aisleSeats:e.aisleSeats=t}function Qo(e,t,n){if(!Z(e.aisleSeats)){delete t.aisleSeats,delete n.aisleSeats;return}let o=Be(e);He(t,pe(o.start,!0)),He(n,pe(!0,o.end))}function Zo(e,t){let n=e[0],o=e[e.length-1];if(!n||!o||!Z(n.aisleSeats)&&!Z(o.aisleSeats)){delete t.aisleSeats;return}He(t,pe(Be(n).start,Be(o).end))}0&&(module.exports={AUTOMATIC_ROUND_TABLE_RADIUS_MAX,AUTOMATIC_ROUND_TABLE_RADIUS_MIN,CHAIR_NUMBERING_DIRECTIONS,CHAIR_NUMBERING_FORMATS,CHAIR_NUMBERING_START_MAX,DEFAULT_SEAT_RADIUS,FLOOR_COVER_LIMIT,FLOOR_STACK_GAP_RATIO,FLOOR_STACK_MIN_SURFACE_PX,LEVEL_CONTEXT_PREFIX,TABLE_SEAT_OFFSET,TEXT_BACKGROUND_PADDING_MAX,TEXT_BACKGROUND_RADIUS_MAX,TEXT_LETTER_SPACING_MAX,TEXT_LETTER_SPACING_MIN,TEXT_LINE_HEIGHT_MAX,TEXT_LINE_HEIGHT_MIN,TEXT_OPACITY_MIN,TEXT_WIDTH_MAX,TEXT_WIDTH_MIN,aisleSeatIds,allObjects,automaticRoundTableRadius,buildAisleHoles,buildSeatIndex,buildSectionShell,chairNumberingProblem,chartBounds,combinedFloorZoneId,compactChairNumbering,cubicPoint,distanceToRings,distributeAlongCubic,effectiveFloorOverview,expandBooth,expandChart,expandRow,expandRowSlots,expandTable,expandTableSlots,floorObjects,floorStackPlacements,floorsOf,gridStats,hitTest,initialFloorMode,isAisleSeat,isRowAisleSeats,layoutCombinedFloorPlan,layoutFloorStack,levelContextOutlines,mainFloorId,mergeRowAisleSeats,nearestWithin,objectCenter,owningSectionForObject,pointInPolygon,pointInPolygonWithHoles,pointOnPolygonBoundary,polygonArea,polygonInscribedAnchor,polygonLabelPoint,polygonNetArea,queryRect,resolveRowAisleSeats,resolveSegmentedRowGroups,rowInventoryCount,rowSeatPositions,segmentedRowComponentSeats,segmentedRowComponents,segmentedRowSeatTotal,smoothCubicThroughMiddle,splitRowAisleSeats,stackFloors,suggestedFloorOverview,tableChairBookingLabel,tableChairDisplayLabel,tableChairToken,tableInventoryCount,tableSeatCountsBySide,textLayoutMetrics,translateObject,usableHoles});
|
|
1
|
+
"use strict";var pe=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var qt=Object.getOwnPropertyNames;var Qt=Object.prototype.hasOwnProperty;var Zt=(e,t)=>{for(var n in t)pe(e,n,{get:t[n],enumerable:!0})},Jt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qt(t))!Qt.call(e,r)&&r!==n&&pe(e,r,{get:()=>t[r],enumerable:!(o=Wt(t,r))||o.enumerable});return e};var en=e=>Jt(pe({},"__esModule",{value:!0}),e);var er={};Zt(er,{AUTOMATIC_ROUND_TABLE_RADIUS_MAX:()=>pt,AUTOMATIC_ROUND_TABLE_RADIUS_MIN:()=>bt,CHAIR_NUMBERING_DIRECTIONS:()=>it,CHAIR_NUMBERING_FORMATS:()=>at,CHAIR_NUMBERING_START_MAX:()=>Ie,DEFAULT_SEAT_RADIUS:()=>Vt,FLOOR_COVER_LIMIT:()=>Gt,FLOOR_STACK_GAP_RATIO:()=>Nt,FLOOR_STACK_MIN_SURFACE_PX:()=>Fo,LEVEL_CONTEXT_PREFIX:()=>he,TABLE_SEAT_OFFSET:()=>G,TEXT_BACKGROUND_PADDING_MAX:()=>mr,TEXT_BACKGROUND_RADIUS_MAX:()=>hr,TEXT_LETTER_SPACING_MAX:()=>dr,TEXT_LETTER_SPACING_MIN:()=>ur,TEXT_LINE_HEIGHT_MAX:()=>lr,TEXT_LINE_HEIGHT_MIN:()=>cr,TEXT_OPACITY_MIN:()=>fr,TEXT_WIDTH_MAX:()=>sr,TEXT_WIDTH_MIN:()=>ar,aisleSeatIds:()=>Yt,allObjects:()=>_t,automaticRoundTableRadius:()=>no,buildAisleHoles:()=>on,buildSeatIndex:()=>Vo,buildSectionShell:()=>nn,chairNumberingProblem:()=>Ln,chartBounds:()=>X,combinedFloorZoneId:()=>Ne,compactChairNumbering:()=>_n,cubicPoint:()=>ae,distanceToRings:()=>$e,distributeAlongCubic:()=>ye,effectiveFloorOverview:()=>Ht,expandBooth:()=>At,expandChart:()=>Fe,expandRow:()=>Rt,expandRowSlots:()=>kt,expandTable:()=>Et,expandTableSlots:()=>_e,floorObjects:()=>vo,floorStackPlacements:()=>Bt,floorsOf:()=>Q,gridStats:()=>Yo,hitTest:()=>Uo,initialFloorMode:()=>No,isAisleSeat:()=>Qo,isRowAisleSeats:()=>Z,layoutCombinedFloorPlan:()=>Eo,layoutFloorStack:()=>Oo,levelContextOutlines:()=>_o,mainFloorId:()=>jo,mergeRowAisleSeats:()=>Jo,nearestWithin:()=>Xo,objectCenter:()=>je,owningSectionForObject:()=>Lt,pointInPolygon:()=>Le,pointInPolygonWithHoles:()=>U,pointOnPolygonBoundary:()=>Tt,polygonArea:()=>Se,polygonInscribedAnchor:()=>Me,polygonLabelPoint:()=>De,polygonNetArea:()=>cn,queryRect:()=>Ko,resolveRowAisleSeats:()=>qo,resolveSegmentedRowGroups:()=>te,rowInventoryCount:()=>So,rowSeatPositions:()=>fe,segmentedRowComponentSeats:()=>vn,segmentedRowComponents:()=>wn,segmentedRowSeatTotal:()=>Pn,smoothCubicThroughMiddle:()=>tn,splitRowAisleSeats:()=>Zo,stackFloors:()=>Po,suggestedFloorOverview:()=>Ao,tableChairBookingLabel:()=>Ce,tableChairDisplayLabel:()=>ke,tableChairToken:()=>st,tableInventoryCount:()=>Mo,tableSeatCountsBySide:()=>Ot,textLayoutMetrics:()=>ge,translateObject:()=>me,usableHoles:()=>V});module.exports=en(er);var nr=Math.PI/180;function T(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function L(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function ae(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+a*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+a*e.end.y}}function tn(e,t,n){let o={x:(e.x+t.x)/2,y:(e.y+t.y)/2},r={x:(n.x-o.x)*4/3,y:(n.y-o.y)*4/3};return{start:{...e},control1:{x:e.x+(t.x-e.x)/3+r.x,y:e.y+(t.y-e.y)/3+r.y},control2:{x:e.x+(t.x-e.x)*2/3+r.x,y:e.y+(t.y-e.y)*2/3+r.y},end:{...t}}}function ye(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[ae(e,.5)];let o=Array.from({length:n+1},(u,c)=>ae(e,c/n)),r=new Float64Array(o.length);for(let u=1;u<o.length;u+=1){let c=o[u].x-o[u-1].x,l=o[u].y-o[u-1].y;r[u]=r[u-1]+Math.hypot(c,l)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let a=[],s=1;for(let u=0;u<t;u+=1){let c=i*u/(t-1);for(;s<r.length-1&&r[s]<c;)s+=1;let l=r[s-1],d=r[s],m=d===l?0:(c-l)/(d-l);a.push({x:o[s-1].x+(o[s].x-o[s-1].x)*m,y:o[s-1].y+(o[s].y-o[s-1].y)*m})}return a}function _(e,t){return{x:e.x+t.x,y:e.y+t.y}}function J(e,t){return{x:e.x-t.x,y:e.y-t.y}}function D(e,t){return{x:e.x*t,y:e.y*t}}function se(e,t=13){return Array.from({length:t},(n,o)=>ae(e,o/(t-1)))}function Ve(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return L(e[o],e[o+1],n-o)}function Ue(e,t,n){let o=Math.max(0,Math.min(1,t)),r=Math.max(o,Math.min(1,n)),i=[Ve(e,o)];for(let a=1;a<e.length-1;a+=1){let s=a/(e.length-1);s>o+1e-9&&s<r-1e-9&&i.push(e[a])}return i.push(Ve(e,r)),i}function Xe(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([m,p],y)=>{let b=T(L(e[m],e[p],.5),t);b<r&&(r=b,o=y)});let i=e[o],a=e[(o+1)%4],s=e[(o+2)%4],u=e[(o+3)%4],c=L(i,a,.5),l=J(t,c),d=Math.max(1e-9,Math.hypot(l.x,l.y));return{p0:i,p1:a,p2:s,p3:u,normal:D(l,1/d),depth:(T(i,u)+T(a,s))/2}}function Ke(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:a}=e,s=J(n,t),u=J(o,r),c=a*.22,l=a*.12;return{nearPath:{start:t,control1:_(_(t,D(s,1/3)),D(i,c)),control2:_(_(t,D(s,2/3)),D(i,c)),end:n},farPath:{start:o,control1:_(_(r,D(u,2/3)),D(i,l)),control2:_(_(r,D(u,1/3)),D(i,l)),end:r}}}function nn(e,t,n){if(e.length!==4)throw new Error("A section shell requires four mapped bounds corners");let o=e.reduce((y,b)=>_(y,b),{x:0,y:0});o.x/=4,o.y/=4;let r=T(e[0],e[1]),i=T(e[0],e[3]),a=n==="auto"?r>i*1.25&&T(o,t)>i?"bezier":"tapered":n;if(a==="rectangle")return{mode:a,outline:e.map(y=>({...y}))};let s=Xe(e,t),{p0:u,p1:c,p2:l,p3:d}=s;if(a==="tapered")return{mode:a,outline:[_(u,D(J(c,u),.14)),_(u,D(J(c,u),1-.14)),l,d]};let{nearPath:m,farPath:p}=Ke(s);return{mode:a,outline:[...se(m),...se(p).slice(1)]}}function on(e,t,n,o){if(e.length!==4)throw new Error("Aisle generation requires four mapped bounds corners");if(!Number.isInteger(n)||n<0||n>3)throw new Error("Aisle count must be an integer from 0 to 3");if(n===0)return[];let r=Xe(e,t),{p0:i,p1:a,p2:s,p3:u}=r,c=o==="bezier"?Ke(r):null,l=c?se(c.nearPath):null,d=c?se(c.farPath).reverse():null,m=Math.min(.055,.18/(n+1));return Array.from({length:n},(p,y)=>{let b=(y+1)/(n+1),M=b-m/2,v=b+m/2;return l&&d?[...Ue(l,M,v),...Ue(d,M,v).reverse()]:[L(i,a,M),L(i,a,v),L(u,s,v),L(u,s,M)]})}var ar=40,sr=1200,cr=.8,lr=3,ur=-2,dr=20,fr=.1,mr=40,hr=40,Ye=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function rn(e,t){let n=e.text.split(/\r?\n/);if(!e.width)return Math.max(1,n.length);let o=Math.max(1,Math.floor(t/Ye(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let a=0;for(let s of i.split(/\s+/)){let u=s.length;a&&a+1+u<=o?a+=1+u:(r+=Math.max(1,Math.ceil(u/o)),a=u%o)}}return Math.max(1,r)}function ge(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(s=>s.length))*Ye(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),a=rn(e,i);return{width:r,height:a*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:a,padding:t}}function an(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,a=i?Math.max(0,Math.min(1,((e.x-t.x)*o+(e.y-t.y)*r)/i)):0;return Math.hypot(e.x-(t.x+a*o),e.y-(t.y+a*r))}function $e(e,t){let n=1/0;for(let o of t)if(!(o.length<2))for(let r=0,i=o.length-1;r<o.length;i=r++){let a=an(e,o[i],o[r]);a<n&&(n=a)}return n}function ze(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,a=t[o].y,s=t[r].x,u=t[r].y;a>e.y!=u>e.y&&e.x<(s-i)*(e.y-a)/(u-a)+i&&(n=!n)}return n}function We(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function sn(e,t,n){let o=ze(e,t)&&!n.some(i=>ze(e,i)),r=$e(e,[t,...n]);return o?r:-r}function Y(e,t,n,o,r){let i=sn({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var xe=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){let n=this.items;n.push(t);let o=n.length-1;for(;o>0;){let r=o-1>>1;if(n[r].max>=n[o].max)break;[n[r],n[o]]=[n[o],n[r]],o=r}}pop(){let t=this.items,n=t[0],o=t.pop();if(t.length&&o){t[0]=o;let r=0;for(;;){let i=r*2+1,a=i+1,s=r;if(i<t.length&&t[i].max>t[s].max&&(s=i),a<t.length&&t[a].max>t[s].max&&(s=a),s===r)break;[t[s],t[r]]=[t[r],t[s]],r=s}}return n}};function Se(e){if(e.length<3)return 0;let t=0;for(let n=0,o=e.length-1;n<e.length;o=n++)t+=(e[o].x+e[n].x)*(e[o].y-e[n].y);return Math.abs(t)/2}function cn(e,t){return Math.max(0,Se(e)-We(t).reduce((n,o)=>n+Se(o),0))}function Me(e,t){let n=We(t);if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let b=e.reduce((v,C)=>v+C.x,0)/e.length,M=e.reduce((v,C)=>v+C.y,0)/e.length;return{point:{x:b,y:M},radius:0}}let o=1/0,r=1/0,i=-1/0,a=-1/0;for(let b of e)b.x<o&&(o=b.x),b.y<r&&(r=b.y),b.x>i&&(i=b.x),b.y>a&&(a=b.y);let s=i-o,u=a-r,c=Math.min(s,u);if(!(c>0))return{point:{x:(o+i)/2,y:(r+a)/2},radius:0};let l=Math.max(s,u)/150,d=new xe,m=c/2;for(let b=o;b<i;b+=c)for(let M=r;M<a;M+=c)d.push(Y(b+m,M+m,m,e,n));let p=Y(o+s/2,r+u/2,0,e,n),y=0;for(;d.size;){let b=d.pop();if(!b)break;b.d>p.d&&(p=b),!(b.max-p.d<=l)&&(y>=4e3||(y+=1,m=b.h/2,d.push(Y(b.x-m,b.y-m,m,e,n)),d.push(Y(b.x+m,b.y-m,m,e,n)),d.push(Y(b.x-m,b.y+m,m,e,n)),d.push(Y(b.x+m,b.y+m,m,e,n))))}return{point:{x:p.x,y:p.y},radius:Math.max(0,p.d)}}function ee(e,t,n){return Math.max(t,Math.min(n,e))}function N(e,t,n){return e<t?t:e>n?n:e}function ln(e){return ee(e,0,1)}function qe(e){let t=ln(e);return t*t*(3-2*t)}var z=Math.PI*2;function $(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function un(e,t,n){let o=t-e;if(n){for(;o<0;)o+=z;for(;o>=z;)o-=z}else{for(;o>0;)o-=z;for(;o<=-z;)o+=z}return o}function Je(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(T(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!$(n.control1)||!$(n.control2)||T(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(T(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(T(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||T(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return T(t,e.start)<=1e-4}function dn(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function et(e,t=2){if(!Je(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let a=Math.atan2(r.y-i.center.y,r.x-i.center.x),s=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),u=un(a,s,i.clockwise),c=Math.max(2,Math.ceil(Math.abs(u)*i.radius/n));for(let l=1;l<=c;l+=1){let d=a+u*l/c;o.push({x:i.center.x+Math.cos(d)*i.radius,y:i.center.y+Math.sin(d)*i.radius})}}else{let a=T(r,i.control1)+T(i.control1,i.control2)+T(i.control2,i.end),s=Math.max(2,Math.ceil(a/n));for(let u=1;u<=s;u+=1)o.push(dn(r,i,u/s))}r=i.end}return T(o[o.length-1],o[0])<=1e-4&&o.pop(),o}function tt(e,t,n){return fn(e,r=>({x:r.x+t,y:r.y+n}))}function fn(e,t,n=1,o=!1){return{...e,start:t(e.start),segments:e.segments.map(r=>r.kind==="line"?{...r,end:t(r.end)}:r.kind==="arc"?{...r,center:t(r.center),radius:r.radius*Math.abs(n),clockwise:o?!r.clockwise:r.clockwise,end:t(r.end)}:{...r,control1:t(r.control1),control2:t(r.control2),end:t(r.end)})}}var mn=45,we=150,hn=60;function bn(e){let t=mn/100;if(e<=t)return we;let n=Math.min(1,(e-t)/(1-t));return we-n*(we-hn)}var Qe=.5523;function Ze(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function pn(e){let t=[],n=[];for(e.forEach((o,r)=>{$(o)&&(t.length&&Ze(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&Ze(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var yn=.5,gn=4/3;function xn(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let a=-r/i,s=o/i,u=n*gn;return{kind:"bezier",control1:{x:e.x+o/3+a*u,y:e.y+r/3+s*u},control2:{x:e.x+o*2/3+a*u,y:e.y+r*2/3+s*u},end:{...t}}}function nt(e,t){let{points:n,sourceIndex:o}=pn(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,a=t.edgeCurvature,s=new Array(r).fill(0);if(a?.length)for(let x=0;x<r;x+=1){let g=a[o[x]];s[x]=Number.isFinite(g)?Math.min(100,Math.max(-100,g))/100:0}let u=s.some(x=>Math.abs(x)>1e-6);if(i<=0&&!u)return null;let c=t.wideAngleThresholdDeg??bn(i),l=[];for(let x=0;x<r;x+=1)l[x]=T(n[x],n[(x+1)%r]);let d=new Array(r).fill(0);for(let x=0;x<r;x+=1){let g=n[(x-1+r)%r],f=n[x],h=n[(x+1)%r],w={x:g.x-f.x,y:g.y-f.y},S={x:h.x-f.x,y:h.y-f.y},P=Math.hypot(w.x,w.y),E=Math.hypot(S.x,S.y);if(P<=1e-9||E<=1e-9)continue;let I=Math.min(1,Math.max(-1,(w.x*S.x+w.y*S.y)/(P*E))),k=Math.acos(I)*180/Math.PI;if(k<c)continue;let O=qe((k-c)/(180-c));d[x]=i*O*.5*Math.min(P,E)}for(let x=0;x<r;x+=1){let g=(x+1)%r,f=d[x]+d[g];if(f>l[x]&&f>1e-9){let h=l[x]/f;d[x]*=h,d[g]*=h}}let m=new Array(r),p=new Array(r);for(let x=0;x<r;x+=1){let g=n[(x-1+r)%r],f=n[x],h=n[(x+1)%r];if(d[x]<=1e-6){m[x]={...f},p[x]={...f};continue}let w=T(f,g)||1,S=T(f,h)||1;m[x]={x:f.x+(g.x-f.x)/w*d[x],y:f.y+(g.y-f.y)/w*d[x]},p[x]={x:f.x+(h.x-f.x)/S*d[x],y:f.y+(h.y-f.y)/S*d[x]}}if(d.every(x=>x<=1e-6)&&!u)return null;let y=[],b={...p[0]},M=b,v=(x,g)=>{if(T(M,x)<=1e-9)return;let f=s[g];Math.abs(f)>1e-6?y.push(xn(M,x,f*yn*l[g])):y.push({kind:"line",end:{...x}}),M=x};for(let x=1;x<=r;x+=1){let g=x%r,f=n[g];v(m[g],(x-1)%r),d[g]>1e-6&&T(m[g],p[g])>1e-9&&(y.push({kind:"bezier",control1:L(m[g],f,Qe),control2:L(p[g],f,Qe),end:{...p[g]}}),M=p[g])}if(!y.length)return null;let C=y[y.length-1];T(C.end,b)>1e-9&&(C.kind==="line"?C.end={...b}:y.push({kind:"line",end:{...b}}));let R={version:1,closed:!0,start:b,segments:y};return Je(R)?R:null}function Sn(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((o,r)=>{let i=e.edgeCurvature[r];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(o=>Math.abs(o)>.5)?n:[]}function Mn(e){let t=Sn(e);return t.length?nt(e.points,{edgeCurvature:t}):null}function ce(e,t=2){let n=Mn(e);return n?et(n,t):e.points??[]}function wn(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],a=e[r+1],s=Math.hypot(a.x-i.x,a.y-i.y);if(s<=0)continue;let u=Math.max(1,Math.round(s/n)),c=s/u,l=Math.atan2(a.y-i.y,a.x-i.x),d=r===0,p=(r>0?t[r-1]:void 0)==="break"?2:1,y=d?{...i}:{x:i.x+Math.cos(l)*c*p,y:i.y+Math.sin(l)*c*p},b=d?u+1:Math.max(1,u-(p-1));o.push({origin:y,rotation:l*180/Math.PI,seatCount:b,seatSpacing:c})}return o}function vn(e){let t=e.rotation*Math.PI/180,n={x:Math.cos(t),y:Math.sin(t)};return Array.from({length:e.seatCount},(o,r)=>({x:e.origin.x+n.x*r*e.seatSpacing,y:e.origin.y+n.y*r*e.seatSpacing}))}function Pn(e){return e.reduce((t,n)=>t+n.seatCount,0)}function te(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((m,p)=>m.segmentedRow.componentIndex-p.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,s=i[0]?.segmentedRow;if(!s||!(a>=2&&i.length===a&&s?.boundaryBefore==="start"&&i.every((m,p)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===o&&m.segmentedRow.componentCount===a&&m.segmentedRow.componentIndex===p&&m.segmentedRow.repeatLabelOnComponents===s.repeatLabelOnComponents&&(p===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===s.displayLabel)))continue;let c=i.reduce((m,p)=>m+p.seatCount,0),l=0,d=0;for(let m of i)m.segmentedRow.boundaryBefore==="break"&&(l+=1),t.set(m.id,{groupId:o,adjacencyOffset:l,displayOffset:d,displayLabel:s.displayLabel,totalSeats:c,canonical:i[0],viewFromSeatUrl:s.viewFromSeatUrl,viewFromSeatMeta:s.viewFromSeatMeta,confidenceEvidence:s.confidenceEvidence}),l+=m.seatCount,d+=m.seatCount}return t}var In="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Cn="abcdefghijklmnopqrstuvwxyz";function kn(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function ne(e,t=!1){let n=t?Cn:In;return kn(Math.max(0,Math.floor(e)-1),n)}var Rn=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function ot(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Rn)for(;t>=o;)n+=r,t-=o;return n}function On(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function ve(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",a=e.seatNumbering?.prefix??"",s=e.seatNumbering?.endAt,u=e.seatCount;if(i==="updown"||i==="updown-descending"){let p=Math.ceil(u/2),y=i==="updown"?t<p?n+2*t:n-1+2*(u-t):t<p?n+2*(p-1-t):n+1+2*(t-p);return`${a}${y}`}let c=i==="odd"||i==="even"?2:r,l=s!=null&&Number.isFinite(s)?s-(u-1)*c:n,d=o==="center"?On(u)[t]:o==="rtl"?u-1-t:t,m;switch(i){case"odd":{let p=l%2===1?l:l+1;m=String(p+d*2);break}case"even":{let p=l%2===0?l:l+1;m=String(p+d*2);break}case"roman":m=ot(l+d*r);break;case"letters-upper":m=ne(l+d*r,!1);break;case"letters-lower":m=ne(l+d*r,!0);break;default:m=String(l+d*r);break}return`${a}${m}`}function En(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function rt(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${ve(e,t)}`}function An(e,t,n,o){if(o?.displayLabel)return null;if(e.seatDisplayLabelMode==="number"||!n)return{row:e.displayLabel||e.label,seat:ve(e,t)};let r=En(n);return{row:n.displayLabel,seat:ve(r,n.displayOffset+t)}}function Pe(e,t,n,o){let r=An(e,t,n,o);return r?e.seatDisplayLabelMode==="number"?r.seat:`${r.row}-${r.seat}`:o.displayLabel}var Ie=999,it=["clockwise","anticlockwise"],at=["table-number","number","letter"];function Ce(e,t){return`${e.label}-${t+1}`}function Tn(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function st(e,t){let n=e.chairNumbering,o=n?.start??1,r=Tn(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?ne(Math.max(1,o)+r):String(o+r)}function ke(e,t){let n=st(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function Ln(e){if(e===void 0)return null;if(!e||typeof e!="object"||Array.isArray(e))return"chairNumbering must be an object";let t=e,n=Object.keys(t).filter(o=>!["start","direction","format"].includes(o));return n.length?`chairNumbering has unsupported field(s): ${n.join(", ")}`:t.start!==void 0&&(!Number.isInteger(t.start)||t.start<0||t.start>Ie)?`chairNumbering.start must be a whole number from 0 to ${Ie}`:t.direction!==void 0&&!it.includes(t.direction)?"chairNumbering.direction must be clockwise or anticlockwise":t.format!==void 0&&!at.includes(t.format)?"chairNumbering.format must be table-number, number or letter":null}function _n(e){let t={};return e.start!==void 0&&e.start!==1&&(t.start=e.start),e.direction==="anticlockwise"&&(t.direction="anticlockwise"),e.format&&e.format!=="table-number"&&(t.format=e.format),Object.keys(t).length?t:void 0}var W=.02291666666666667,Or=1/W,Dn=58,jn=Dn*W;var Fn=3,ct=0,Re=120,Nn=0,Bn=45,Hn=7,q=1.2;function Oe(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function Gn(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Hn?e:Fn}function lt(e,t={}){let n=Oe(t.floorBaseHeightM,ct,Re,0),o=Math.min(Re,n+Gn(e.elevation)*jn),r=e.height===void 0?o:Oe(e.height,ct,Re,o),i=Oe(e.rake,Nn,Bn,0);return{height:r,rake:i}}function ut(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 dt(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,u=a.y-i.y,c=s*s+u*u,l=c>1e-12?((t-i.x)*s+(n-i.y)*u)/c:0;l<0?l=0:l>1&&(l=1);let d=t-(i.x+l*s),m=n-(i.y+l*u);if(Math.abs(d)>=o||Math.abs(m)>=o)continue;let p=Math.hypot(d,m);p<o&&(o=p)}return o}function Vn(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>r&&(r=a)}return{cx:t,cy:n,r}}function ft(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Ee(e,t){let n=1/0;for(let o of ut(e)){let r=dt(t,o.x,o.y);r<n&&(n=r)}for(let o of ut(t)){let r=dt(e,o.x,o.y);r<n&&(n=r)}return n}function Un(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let l of e)n+=l.x,o+=l.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let l of e){let d=Math.hypot(l.x-n,l.y-o);d>r&&(r=d,i=l)}let a=i.x-n,s=i.y-o,u=Math.hypot(a,s);u>1e-9?(a/=u,s/=u):(a=1,s=0);let c=e.map((l,d)=>({p:l,i:d,t:(l.x-n)*a+(l.y-o)*s})).sort((l,d)=>l.t-d.t);return{pts:c.map(l=>l.p),seatIndices:c.map(l=>t[l.i])}}function Xn(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let C of e)n+=C.x,o+=C.y;n/=t,o/=t;let r=0,i=0,a=0,s=0,u=0,c=0,l=0;for(let C of e){let R=C.x-n,x=C.y-o;r+=R*R,a+=x*x,i+=R*x,s+=R*R*R,u+=x*x*x,c+=R*x*x,l+=x*R*R}let d=r*a-i*i;if(Math.abs(d)<1e-9)return null;let m=(s+c)/2,p=(u+l)/2,y=(m*a-p*i)/d,b=(p*r-m*i)/d,M=y+n,v=b+o;return!Number.isFinite(M)||!Number.isFinite(v)?null:{cx:M,cy:v}}var Kn=.15;function Yn(e){if(e.length<2)return null;let t=e.map(g=>{let f=0,h=0;for(let w of g.pts)f+=w.x,h+=w.y;return{x:f/g.pts.length,y:h/g.pts.length}}),n=0,o=0;for(let g of t)n+=g.x,o+=g.y;n/=t.length,o/=t.length;let r=0,i=0,a=0;for(let g of t){let f=g.x-n,h=g.y-o;r+=f*f,i+=f*h,a+=h*h}let s=r+a,u=r*a-i*i,c=s/2+Math.sqrt(Math.max(0,s*s/4-u)),l,d;Math.abs(i)>1e-12?(l=c-a,d=i):r>=a?(l=1,d=0):(l=0,d=1);let m=Math.hypot(l,d);if(!(m>1e-12))return null;l/=m,d/=m;let p=0,y=0,b=0;for(let g of e){if(g.pts.length<2)continue;let f=g.pts[0],h=g.pts[g.pts.length-1],w=h.x-f.x,S=h.y-f.y,P=Math.hypot(w,S);if(!(P>1e-9))continue;let E=w/P,I=S/P;p+=(E*E-I*I)*P,y+=2*E*I*P,b+=P}if(b>0&&Math.hypot(p,y)>=$n*b){let g=Math.atan2(y,p)/2,f=Math.cos(g),h=Math.sin(g);Math.abs(l*f+d*h)>Wn&&(l=-h,d=f)}let M=1/0,v=-1/0,C=[];for(let g of e){let f=1/0,h=-1/0;for(let w of g.pts){let S=w.x*l+w.y*d;S<f&&(f=S),S>h&&(h=S),S<M&&(M=S),S>v&&(v=S)}C.push(h-f)}let R=v-M;return R>1e-9?(C.sort((g,f)=>g-f),C[Math.min(C.length-1,Math.floor(C.length*.9))]/R<=zn?{x:l,y:d}:null):null}var zn=.35,$n=.8,Wn=.7;function mt(e,t,n,o){let r=new Map;for(let f of n){let h=t[f],w=h.rowId||`__seat-${f}`,S=r.get(w);S||(S={pts:[],idx:[]},r.set(w,S)),S.pts.push({x:h.x,y:h.y}),S.idx.push(f)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[f,h]of r){let w=Un(h.pts,h.idx),S=0;for(let P of w.pts)S+=Math.hypot(P.x-o.x,P.y-o.y);i.push({id:f,pts:w.pts,seatIndices:w.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:S/w.pts.length})}let a=i.map(f=>Vn(f.pts)),s=i.length<=256?i.length*(i.length-1)/2:0,u=s?new Float64Array(s):null;u?.fill(Number.NaN);let c=u?new Map(i.map((f,h)=>[f,h])):null,l=(f,h)=>(f>h&&([f,h]=[h,f]),f*(2*i.length-f-1)/2+(h-f-1)),d=(f,h)=>{if(!u)return Ee(i[f].pts,i[h].pts);let w=l(f,h),S=u[w];if(!Number.isNaN(S))return S;let P=Ee(i[f].pts,i[h].pts);return u[w]=P,P},m=(f,h)=>c?d(c.get(f),c.get(h)):Ee(f.pts,h.pts),p=[];for(let f=0;f<i.length;f++){let h=1/0;for(let w=0;w<i.length;w++){if(f===w||ft(a[f],a[w])>=h)continue;let S=d(f,w);S<h&&(h=S)}Number.isFinite(h)&&p.push(h)}p.sort((f,h)=>f-h);let y=p.length?p[Math.floor(p.length/2)]:1,b=Math.max(y*1.8,1e-6),M=i.map(()=>[]);for(let f=0;f<i.length;f++)for(let h=f+1;h<i.length;h++)ft(a[f],a[h])>b||d(f,h)<=b&&(M[f].push(h),M[h].push(f));let v=0;for(let f=0;f<i.length;f++){if(i[f].blockId!==-1)continue;let h=v++,w=[f];for(i[f].blockId=h;w.length;){let S=w.pop();for(let P of M[S])i[P].blockId===-1&&(i[P].blockId=h,w.push(P))}}let C=new Map;for(let f of i){let h=C.get(f.blockId)??[];h.push(f),C.set(f.blockId,h)}let R=[];for(let f of i){if(f.pts.length<4)continue;let h=Xn(f.pts);h&&(!Number.isFinite(h.cx)||!Number.isFinite(h.cy)||R.push({x:h.cx,y:h.cy}))}let x=R.length>=2?(()=>{let f=R.map(S=>S.x).sort((S,P)=>S-P),h=R.map(S=>S.y).sort((S,P)=>S-P),w=Math.floor(R.length/2);return{cx:f[w],cy:h[w]}})():null;if(x){let f=I=>Math.hypot(I.x-x.cx,I.y-x.cy),h=1/0,w=-1/0,S=[];for(let I of i){let k=1/0,O=-1/0;for(let j of I.pts){let B=f(j);B<k&&(k=B),B>O&&(O=B)}S.push(O-k),k<h&&(h=k),O>w&&(w=O)}let P=w-h;S.sort((I,k)=>I-k);let E=S[Math.min(S.length-1,Math.floor(S.length*.9))];if(P>1e-9&&E/P<=Kn){let I=i.map(A=>{let ie=0;for(let $t of A.pts)ie+=f($t);return{row:A,radius:ie/A.pts.length}}),k=0,O=0;for(let A of I)k+=A.radius,O+=A.row.focalDistance;k/=I.length,O/=I.length;let j=0;for(let A of I)j+=(A.radius-k)*(A.row.focalDistance-O);if(j<0)for(let A of I)A.radius=-A.radius;let H=1/0;for(let A of I)A.radius<H&&(H=A.radius);I.sort((A,ie)=>A.radius-ie.radius);let F=-1,K=-1/0,zt=P/Math.max(1,I.length)*.5,Ge=[];for(let A of I)A.radius-K>zt&&(F++,K=A.radius),A.row.ordinal=F,A.row.blockDepth=A.radius-H,Ge.push(A.row);return{sectionId:e,rows:Ge,blockCount:v}}}let g=[];for(let[,f]of C){let h=Yn(f);if(h){let w=I=>{let k=0;for(let O of I.pts)k+=O.x*h.x+O.y*h.y;return k/I.pts.length};f.sort((I,k)=>w(I)-w(k)),f.length>=2&&f[0].focalDistance>f[f.length-1].focalDistance&&f.reverse();let S=[],P=y*.5;for(let I of f){let k=S[S.length-1];k&&Math.abs(w(I)-w(k[0]))<P?k.push(I):S.push([I])}let E=0;for(let I=0;I<S.length;I++){if(I>0){let k=1/0;for(let O of S[I-1])for(let j of S[I])k=Math.min(k,m(O,j));E+=k}for(let k of S[I])k.ordinal=I,k.blockDepth=E,g.push(k)}}else{let w=1/0;for(let S of f)S.focalDistance<w&&(w=S.focalDistance);f.sort((S,P)=>S.focalDistance-P.focalDistance);for(let S=0;S<f.length;S++)f[S].ordinal=S,f[S].blockDepth=Math.max(0,f[S].focalDistance-w),g.push(f[S])}}return{sectionId:e,rows:g,blockCount:v}}var qn=/^\d{4}-\d{2}-\d{2}$/;function Qn(e){let t=Date.parse(e);return Number.isFinite(t)?qn.test(e)?t+864e5:t:null}function Zn(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=Qn(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Jn(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function eo(e){return e.status!=="draft"&&e.status!=="retracted"}function to(e,t){return e.status===void 0?t===void 0:e.status!=="approved"?!0:typeof t=="string"&&typeof e.basisSha256=="string"&&e.basisSha256===t}function ht(e,t={}){return!!e&&eo(e)&&Jn(e,t.activeConfigurationId,t.activeConfigurationVersion)&&to(e,t.activeBasisSha256)&&Zn(e,t.now)}var bt=36,pt=160;function no(e,t=360){let n=ee(Math.round(Number.isFinite(e)?e:1),1,40),o=ee(Number.isFinite(t)?t:360,120,360);return Math.round(ee(n*4*(360/o),bt,pt))}var oo=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]);function ro(e){return!!e&&oo.has(e)}var yt=1.1;var Dr=Math.PI*2;var jr=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,a=[],s=Math.atan2(o.y-r,o.x),u=Math.atan2(o.y-r,-o.x);for(let c=0;c<=24;c++){let l=s+(u-s)*c/24;a.push({x:i*Math.cos(l),y:r+i*Math.sin(l)})}return{half:70,home:t,backstop:n,fence:a}})();function gt(e){return ro(e)}function io(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?ce(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function ao(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*r-s*i,y:t.y+a*i+s*r}}function xt(e){let t=io(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(u=>ao(u,{x:t.reduce((c,l)=>c+l.x,0)/t.length,y:t.reduce((c,l)=>c+l.y,0)/t.length},n)),r=1/0,i=1/0,a=-1/0,s=-1/0;for(let u of o)r=Math.min(r,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),s=Math.max(s,u.y);return!Number.isFinite(r)||a-r<1e-6||s-i<1e-6?null:{minX:r,minY:i,maxX:a,maxY:s}}var so=5,co=3,lo=.92,uo=1.9,fo=2,mo=.6,ho=1,bo=.06;function po(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?yt:gt(e.stageKind)?bo:ho}function St(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let a of Q(e)){let s=a.baseHeightM??0;for(let u of a.objects){if(u.type!=="shape"||u.role!=="stage")continue;let c=xt(u);c&&(t=Math.min(t,c.minX),n=Math.min(n,c.minY),o=Math.max(o,c.maxX),r=Math.max(r,c.maxY),i=Math.max(i,s+po(u)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function yo(e,t,n,o){let r=1/0,i=1/0,a=-1/0,s=-1/0;for(let p of e)Number.isFinite(p.eyeHeightM)&&(r=Math.min(r,p.x),a=Math.max(a,p.x),i=Math.min(i,p.y),s=Math.max(s,p.y));if(!Number.isFinite(r))return null;let u=r*t,c=i*t,l=Math.max(1,Math.ceil((a-r)*t/n)+1),d=Math.max(1,Math.ceil((s-i)*t/n)+1),m=new Float64Array(l*d).fill(-1/0);for(let p of e){if(!Number.isFinite(p.eyeHeightM))continue;let y=p.eyeHeightM-q,b=Math.min(l-1,Math.max(0,Math.floor((p.x*t-u)/n))),v=Math.min(d-1,Math.max(0,Math.floor((p.y*t-c)/n)))*l+b,C=y+o;C>m[v]&&(m[v]=C)}return{cellM:n,minX:u,minY:c,cols:l,rows:d,top:m}}function go(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function Mt(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??W,i=n.cellM??mo,a=n.chairBackM??lo,s=n.selfRowSkipM??fo,u=n.clearThreshold??.9,c=n.partialThreshold??.25,l=Math.max(1,n.columns??so),d=Math.max(1,n.rows??co),m=yo(e,r,i,a);if(!m)return o;let p=(t.maxX-t.minX)*r,y=(t.maxY-t.minY)*r,b=p>=y,M=(t.minX+t.maxX)/2*r,v=(t.minY+t.maxY)/2*r,C=[];for(let x=0;x<l;x++){let g=(x+.5)/l-.5,f=b?M+g*p:M,h=b?v:v+g*y;for(let w=0;w<d;w++){let S=t.deckTopM+(d===1?0:w/(d-1)*uo);C.push({x:f,y:h,z:S})}}let R=i/2;for(let x of e){if(!Number.isFinite(x.eyeHeightM))continue;let g=x.x*r,f=x.y*r,h=x.eyeHeightM,w=0,S=1/0;for(let E of C){let I=E.x-g,k=E.y-f,O=Math.hypot(I,k);if(!(O>s)){w++;continue}let j=I/O,B=k/O,H=0;for(let F=s;F<O;F+=R){let K=go(m,g+j*F,f+B*F);if(!(!Number.isFinite(K)||K>=h)&&K>h+(E.z-h)*F/O){H=F;break}}H?S=Math.min(S,H):w++}let P=w/C.length;P>=u||o.set(x.id,{seatId:x.id,mark:P<c?"obstructedView":"restrictedView",visibleFraction:P,totalRays:C.length,atDistanceM:Number.isFinite(S)?S:0})}return o}function wt(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function Ae(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var de=Math.PI/180,xo=9,G=16;function Te(e,t,n,o){let r=n*de,i=Math.cos(r),a=Math.sin(r);return{x:o.x+e*i-t*a,y:o.y+e*a+t*i}}function fe(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,a=[];if(e.path)return ye(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(o===0){for(let c=0;c<t;c++)a.push(Te(c*n,0,r,i));return a}let s=o/(t-1)*de,u=n/(2*Math.sin(Math.abs(s)/2));for(let c=0;c<t;c++){let l=c*s,d=u*Math.sin(l),m=-u+u*Math.cos(l);a.push(Te(d,m,r,i))}return a}function Ct(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function So(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 kt(e,t){let n=Ct(e);return fe(e).map((o,r)=>{let i=n.get(r),a=Ae(i),s=rt(e,r,i),u={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:s,displayLabel:Pe(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(u).some(c=>c!==void 0&&c!==!1&&c!=="")?u:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function Rt(e){let t=[];for(let n of kt(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 Ot(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function _e(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(l=>[l.index,l])),r=(l,d,m,p)=>{let y=o.get(l),b=Ae(y),M=y?.label??Ce(e,l);return{index:l,label:M,displayLabel:y?.displayLabel??ke(e,l),x:d+(y?.dx??0),y:m+(y?.dy??0),categoryKey:y?.categoryKey??e.categoryKey,skipped:!!y?.skip,accessible:b.length>0,accessibility:b,wheelchairSpaceType:y?.wheelchairSpaceType,commercial:y?.commercial,glyph:y?.glyph,viewUrl:y?.viewFromSeatUrl,viewMeta:y?.viewFromSeatUrl?y.viewFromSeatMeta:void 0,labelStyle:y?.labelStyle,...p?{side:p}:{}}};if(e.shape==="round"){let l=(e.radius??40)+G,d=e.rotation*de,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||n===1){for(let M=0;M<n;M++){let v=d+M/n*2*Math.PI;t.push(r(M,e.center.x+l*Math.cos(v),e.center.y+l*Math.sin(v)))}return t}let p=m*de,y=(2*Math.PI-p)/2,b=d+y;for(let M=0;M<n;M++){let v=b+M/(n-1)*p;t.push(r(M,e.center.x+l*Math.cos(v),e.center.y+l*Math.sin(v)))}return t}let i=e.width??80,a=e.height??50,s=Ot(e),u=["top","bottom","left","right"],c=0;for(let l of u){let d=s[l];for(let m=0;m<d;m++){let p,y;l==="top"?(p=-i/2+(m+.5)*i/d,y=-a/2-G):l==="bottom"?(p=-i/2+(m+.5)*i/d,y=a/2+G):l==="left"?(p=-i/2-G,y=-a/2+(m+.5)*a/d):(p=i/2+G,y=-a/2+(m+.5)*a/d);let b=Te(p,y,e.rotation,e.center);t.push(r(c++,b.x,b.y,l))}}return t}function Mo(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):_e(e).filter(t=>!t.skipped).length}function Et(e){return _e(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 At(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function Le(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,a=t[o].y,s=t[r].x,u=t[r].y;a>e.y!=u>e.y&&e.x<(s-i)*(e.y-a)/(u-a)+i&&(n=!n)}return n}function Tt(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),s=(r.x-n.x)**2+(r.y-n.y)**2;return a>=-1e-7&&a<=s+1e-7})}function V(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function U(e,t,n){return Le(e,t)&&!V(n).some(o=>Le(e,o)||Tt(e,o))}function De(e,t){return Me(e,t).point}function ue(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function je(e){switch(e.type){case"row":{let t=fe(e),n=Ct(e),o=0,r=0,i=0;for(let a=0;a<t.length;a++){let s=n.get(a);s?.skip||(o+=t[a].x+(s?.dx??0),r+=t[a].y+(s?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ue(e.points);case"section":return ue(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ue(e.points):e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null?{x:e.x+e.width/2,y:e.y+e.height/2}:{x:e.x??0,y:e.y??0};case"decorImage":return{x:e.x+e.width/2,y:e.y+e.height/2}}}function vt(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function wo(e,t){if(e.type!=="gaArea"||!vt(e.points,t.outline))return!1;let n=V(e.holes),o=V(t.holes);return n.length===o.length&&n.every((r,i)=>vt(r,o[i]))}function Lt(e,t,n=e.filter(r=>r.type==="section"),o=je(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(a=>(a.logicalSectionId??a.id)===r&&(wo(t,a)||U(o,a.outline,a.holes))):void 0)??n.find(a=>U(o,a.outline,a.holes))}function Q(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 vo(e,t){let n=Q(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function _t(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function me(e,t,n){let o=i=>({x:i.x+t,y:i.y+n}),r=i=>i.map(o);switch(e.type){case"row":return{...e,origin:o(e.origin)};case"table":case"booth":return{...e,center:o(e.center)};case"gaArea":return{...e,points:r(e.points),...e.holes?{holes:V(e.holes).map(r)}:{}};case"section":return{...e,outline:r(e.outline),...e.outlinePath?{outlinePath:tt(e.outlinePath,t,n)}:{},...e.holes?{holes:V(e.holes).map(r)}:{}};case"text":return{...e,position:o(e.position)};case"shape":return{...e,...e.points?{points:r(e.points)}:{},...e.holes?{holes:V(e.holes).map(r)}:{},...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 Po(e,t=900){if(!e.floors||e.floors.length<2)return e;let n=[];return e.floors.forEach((o,r)=>{let i=-r*t;for(let a of o.objects)n.push(i===0?a:me(a,0,i))}),{...e,objects:n,floors:void 0}}function Pt(e,t,n,o,r,i,a,s,u){let c=[],l=e.filter(b=>b.type==="section"),d=te(e),m=b=>!b?.eventConfigurationId||b.eventConfigurationId===o&&(b.eventConfigurationVersion===void 0||b.eventConfigurationVersion===u),p=b=>ht(b,{activeConfigurationId:o,activeConfigurationVersion:u,activeBasisSha256:r,now:s}),y=(b,M)=>p(b)?{...b,coverage:M}:void 0;for(let b of e){let M=[];if(b.type==="row"?M=Rt(b):b.type==="table"?M=Et(b):b.type==="booth"&&(M=At(b)),!M.length)continue;for(let g of M)g.viewUrl&&!m(g.viewMeta)&&(g.viewUrl=void 0,g.viewMeta=void 0);if(b.type==="row"){let g=d.get(b.id);if(g){let f=new Map((b.overrides??[]).map(h=>[h.index,h]));for(let h of M){let w=Number(h.id.slice(h.id.lastIndexOf(":")+1));if(!Number.isInteger(w))continue;h.logicalRowId=g.groupId,h.logicalSeatIndex=g.adjacencyOffset+w,f.get(w)?.displayLabel||(h.displayLabel=Pe(b,w,g)),!h.viewUrl&&g.viewFromSeatUrl&&m(g.viewFromSeatMeta)&&(h.viewUrl=g.viewFromSeatUrl,h.viewMeta=g.viewFromSeatMeta);let S=f.get(w)?.confidenceEvidence;h.confidenceEvidence=y(S,"exact-seat")??y(b.confidenceEvidence,"row-representative")??y(g.confidenceEvidence,"row-representative")}}}let v=Lt(e,b,l,b.type==="row"?ue(M):je(b)),C=v?.viewFromSeatUrl,x=(v?.zone?t?.find(g=>g.id===v.zone):void 0)?.focalPoint??n;for(let g of M){if(!g.confidenceEvidence){let f=Number(g.id.slice(g.id.lastIndexOf(":")+1)),h=(b.type==="row"||b.type==="table")&&Number.isInteger(f)?b.overrides?.find(w=>w.index===f)?.confidenceEvidence:void 0;g.confidenceEvidence=y(h,"exact-seat")??(b.type==="row"?y(b.confidenceEvidence,"row-representative"):void 0)}g.confidenceEvidence??=y(v?.confidenceEvidence,"section-representative")??(a?y(a.evidence,a.coverage):void 0),!g.viewUrl&&C&&m(v?.viewFromSeatMeta)&&(g.viewUrl=C,g.viewMeta=v?.viewFromSeatMeta),!g.viewUrl&&i&&m(i.meta)&&(g.viewUrl=i.url,g.viewMeta=i.meta),v&&(g.sectionId=v.logicalSectionId??v.id),v?.zone&&(g.zoneId=v.zone),x&&(g.focalPoint={...x})}c.push(...M)}return c}function Fe(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,a=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,s=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,u=Pt(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,s,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&It(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,u);for(let c of u)c.floorId=r.id;for(let c of u)o.push(c)}return o}let n=Pt(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&&It(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),Io(e,n,t)}function Io(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||wt(t,Mt(t,St(e))),t}function It(e,t,n,o){let r=e.filter(d=>d.type==="section"),i=n>0||r.some(d=>d.height!==void 0||d.rake!==void 0||(d.elevation??0)>0);if(!r.length||!i||!t){for(let d of o)d.eyeHeightM=n+q;return}let a=new Array(o.length),s=new Map;for(let d of r)s.has(d.id)||s.set(d.id,d);let u=new Map,c=new Map;for(let d=0;d<o.length;d++){let m=o[d],y=(m.sectionId?s.get(m.sectionId)??r.find(M=>M.logicalSectionId===m.sectionId&&U({x:m.x,y:m.y},M.outline,M.holes)):void 0)??r.find(M=>U({x:m.x,y:m.y},M.outline,M.holes))??null;if(a[d]=y,!y)continue;u.has(y.id)||u.set(y.id,lt(y,{floorBaseHeightM:n}));let b=c.get(y.id);b?b.push(d):c.set(y.id,[d])}let l=new Array(o.length).fill(void 0);for(let[d,m]of c){let p=u.get(d);if(!p)continue;let y=p.rake>0?Math.tan(p.rake*Math.PI/180):0,b=mt(d,o,m,t);for(let M of b.rows){let v=M.blockDepth*W*y,C=p.height+v;for(let R of M.seatIndices)l[R]=C}}for(let d=0;d<o.length;d++){let m=o[d],p=a[d];if(!p){m.eyeHeightM=n+q;continue}let y=u.get(p.id);m.eyeHeightM=(l[d]??y.height)+q}}var le=40;function X(e,t){let n=t?.freeText==="exclude",o=1/0,r=1/0,i=-1/0,a=-1/0,s=(c,l)=>{c<o&&(o=c),l<r&&(r=l),c>i&&(i=c),l>a&&(a=l)},u=c=>{if(Array.isArray(c))for(let l of c)!l||typeof l!="object"||s(l.x,l.y)};for(let c of _t(e))if(c.type==="row"){let l=new Map((c.overrides??[]).map(d=>[d.index,d]));fe(c).forEach((d,m)=>{let p=l.get(m);p?.skip||s(d.x+(p?.dx??0),d.y+(p?.dy??0))})}else if(c.type==="gaArea")u(c.points);else if(c.type==="section")u(c.outline);else if(c.type==="decorImage")s(c.x,c.y),s(c.x+c.width,c.y+c.height);else if(c.type==="shape")c.points&&c.points.length?u(ce(c)):c.x!=null&&c.y!=null&&c.width!=null&&c.height!=null&&(s(c.x,c.y),s(c.x+c.width,c.y+c.height));else if(c.type==="table"){let l=G+xo,d=c.shape==="round"?(c.radius??40)+l:Math.max((c.width??80)/2,(c.height??50)/2)+l;s(c.center.x-d,c.center.y-d),s(c.center.x+d,c.center.y+d)}else if(c.type==="booth"){let l=Math.max(c.width,c.height)/2;s(c.center.x-l,c.center.y-l),s(c.center.x+l,c.center.y+l)}else if(c.type==="text"){if(n)continue;let l=ge(c);s(c.position.x,c.position.y),s(c.position.x+l.width,c.position.y+l.height)}for(let c of[e.referenceImage,e.backgroundImage]){if(!c)continue;let{center:l,width:d}=c;if(!l||!Number.isFinite(l.x)||!Number.isFinite(l.y)||!Number.isFinite(d))continue;let m=d*3/4;s(l.x-d/2,l.y-m/2),s(l.x+d/2,l.y+m/2)}if(!isFinite(o)){let c=e.focalPoint??{x:0,y:0};return{x:c.x-200,y:c.y-200,width:400,height:400}}return{x:o-le,y:r-le,width:i-o+le*2,height:a-r+le*2}}function Dt(e){let t=e.backgroundImage;return t?.url&&!t.assetId?t:void 0}var Nt=.08,Co=.045;function Ne(e){return`__floor__:${encodeURIComponent(e)}`}function re(e,t,n){return{...e,objects:t,floors:void 0,...n?{focalPoint:n}:{},referenceImage:void 0,backgroundImage:void 0}}function ko(e,t,n){let o=e.focalPoint??t.focalPoint;return o?o.x:n.x+n.width/2}function Bt(e){let t=e.floors??[];if(!t.length)return[];let n=t.map(a=>X(re(e,a.objects,a.focalPoint),{freeText:"exclude"})),r=Math.max(1,...n.map(a=>a.width))*Nt,i=0;return t.map((a,s)=>{let u=n[s],c=i-(u.y+u.height);return i-=u.height+r,{floorId:a.id,label:a.name??a.id,level:s,levelBadge:s===0?"G":String(s),translation:{x:-ko(a,e,u),y:c},bounds:u}})}function Ro(e,t,n,o){let r=t==="name"?e.label:e.levelBadge;if(!r)return[];let i=Math.max(1,n*Co),a=e.bounds.x+e.translation.x-i*2.4,s=e.bounds.y+e.translation.y+i*.4,u=`floor-level-${e.floorId}`;if(t==="name")return[{type:"text",id:`${u}-text`,text:r,position:{x:a,y:s},fontSize:i,rotation:0,color:o,bold:!0}];let c=i*.95,l={type:"shape",id:`${u}-badge`,kind:"ellipse",x:a-c*.35,y:s-c*.3,width:c*2,height:c*2,fill:"transparent",stroke:{color:o,width:Math.max(1,i*.09)},opacity:.8},d={type:"text",id:`${u}-text`,text:r,position:{x:l.x,y:l.y+c-i/2},width:c*2,align:"center",lineHeight:1,fontSize:i,rotation:0,color:o,bold:!0};return[l,d]}function Oo(e,t={}){let n=e.floors;if(!n||n.length<2)return e;let o=Bt(e),r=[];n.forEach((c,l)=>{let{x:d,y:m}=o[l].translation;for(let p of c.objects)l>0&&p.type==="shape"&&p.role==="stage"||r.push(me(p,d,m))});let i={...e,objects:r,floors:void 0},a=X(i,{freeText:"exclude"}),s=Math.max(1,a.width,a.height),u=e.theme?.textColor??"#94a3b8";for(let c of o)r.push(...Ro(c,t.labelStyle??"number",s,u));return{...i,objects:r,referenceImage:void 0,backgroundImage:void 0}}function Eo(e){if(!e.floors||e.floors.length<2)return e;let t=!e.zones?.length,n=new Set,o=e.floors.flatMap(i=>i.objects.flatMap(a=>{if(a.type==="shape"&&a.role==="stage"){let s=JSON.stringify([a.kind,a.x,a.y,a.width,a.height,a.points,a.rotation??0,a.label,a.heightM,a.eventConfigurationIds]);if(n.has(s))return[];n.add(s)}return t&&a.type==="section"?[{...a,zone:Ne(i.id)}]:[a]})),r=t?e.floors.map(i=>({id:Ne(i.id),label:i.name,focalPoint:{...i.focalPoint}})):e.zones;return{...e,objects:o,zones:r,floors:void 0,referenceImage:void 0,backgroundImage:Dt(e)}}function Ht(e){return e.floorOverview==="combined"?"combined":"separated"}function Ao(e){let t=e.floors??[];if(t.length<2||t.some(r=>!r.objects.some(i=>To.has(i.type))))return"separated";let n=jt.get(e);if(n)return n;let o=Lo(e)?"separated":"combined";return jt.set(e,o),o}var To=new Set(["row","table","booth","gaArea","section"]),Gt=.1,oe=18,jt=new WeakMap;function Lo(e){let t=e.floors??[],n=(i,a)=>`${Math.floor(i/oe)}:${Math.floor(a/oe)}`,o=t.map(i=>{let a=Fe(re(e,i.objects,i.focalPoint)).map(u=>({x:u.x,y:u.y})),s={areas:[],seats:new Map};for(let u of i.objects)u.type==="section"&&u.outline?.length>=3&&s.areas.push({outer:u.outline,holes:u.holes}),u.type==="gaArea"&&u.points?.length>=3&&s.areas.push({outer:u.points,holes:u.holes});for(let u of a){let c=n(u.x,u.y),l=s.seats.get(c);l?l.push(u):s.seats.set(c,[u])}return{seats:a,footprint:s}}),r=(i,a)=>{let s=Math.floor(i.x/oe),u=Math.floor(i.y/oe);for(let c=-1;c<=1;c+=1)for(let l=-1;l<=1;l+=1)for(let d of a.seats.get(`${s+c}:${u+l}`)??[])if(Math.hypot(d.x-i.x,d.y-i.y)<oe)return!0;return!1};return o.some((i,a)=>{if(!i.seats.length)return!1;let s=o.filter((c,l)=>l!==a).map(c=>c.footprint),u=0;for(let c of i.seats)s.some(l=>l.areas.some(d=>U(c,d.outer,d.holes))||r(c,l))&&(u+=1);return u/i.seats.length>Gt})}var he="level-context:";function _o(e,t){let n=e.floors??[];if(n.length<2||Ht(e)!=="combined")return[];let o="#8a93a6",r=[],i=n.find(s=>s.id===t),a=i?X(re(e,i.objects,i.focalPoint),{freeText:"exclude"}):null;for(let s of n){if(s.id===t)continue;let u=0;for(let m of s.objects){let p=m.type==="section"?m.outline:m.type==="gaArea"?m.points:null;if(!p||p.length<3)continue;let y={type:"shape",id:`${he}${s.id}:${u++}`,kind:"polygon",label:"",points:p.map(b=>({...b})),fill:"transparent",stroke:{color:o,width:1.5},opacity:.35};r.push(y)}let c=X(re(e,s.objects,s.focalPoint),{freeText:"exclude"});if(!u||!a||!Do(c,a))continue;let l=r.filter(m=>m.type==="shape"&&m.id.startsWith(`${he}${s.id}:`)&&!!m.points),d=l.reduce((m,p)=>Ft(p.points)>Ft(m.points)?p:m,l[0]);r.push({type:"text",id:`${he}${s.id}:name`,text:s.name??s.id,position:De(d.points,void 0),fontSize:Math.max(1,Math.max(a.width,a.height)*.024),rotation:0,color:o,opacity:.6})}return r}function Do(e,t){return e.x>=t.x&&e.y>=t.y&&e.x+e.width<=t.x+t.width&&e.y+e.height<=t.y+t.height}function Ft(e){let t=e.map(o=>o.x),n=e.map(o=>o.y);return(Math.max(...t)-Math.min(...t))*(Math.max(...n)-Math.min(...n))}function jo(e){let t=e.floors;if(!t?.length)return null;let n=t.find(i=>i.objects.some(a=>a.type==="shape"&&a.role==="stage"));if(n)return n.id;let o=t[0],r=-1;for(let i of t){let a=X(re(e,i.objects,i.focalPoint),{freeText:"exclude"}),s=a.width*a.height;s>r&&(r=s,o=i)}return o.id}var Fo=640;function No(e,t){return(e.floors?.length??0)<2?null:"all"}var Vt=9;function Bo(e){if(e.kind==="circle")return{hx:e.r,hy:e.r};let t=e.width/2,n=e.height/2,o=e.rotation??0;if(!o)return{hx:t,hy:n};let r=o*Math.PI/180,i=Math.abs(Math.cos(r)),a=Math.abs(Math.sin(r));return{hx:t*i+n*a,hy:t*a+n*i}}function Ho(e,t,n){let o=t-e.seat.x,r=n-e.seat.y;if(e.shape.kind==="circle")return o*o+r*r<=e.shape.r*e.shape.r;let i=e.shape.rotation??0,a=o,s=r;if(i){let u=-i*Math.PI/180,c=Math.cos(u),l=Math.sin(u);a=o*c-r*l,s=o*l+r*c}return Math.abs(a)<=e.shape.width/2&&Math.abs(s)<=e.shape.height/2}function Go(e,t,n,o,r){if(e.shape.kind==="circle"){let y=Math.min(Math.max(e.seat.x,t),o),b=Math.min(Math.max(e.seat.y,n),r),M=e.seat.x-y,v=e.seat.y-b;return M*M+v*v<=e.shape.r*e.shape.r}let i=e.shape.rotation??0;if(!i)return e.seat.x-e.hx<=o&&e.seat.x+e.hx>=t&&e.seat.y-e.hy<=r&&e.seat.y+e.hy>=n;let a=i*Math.PI/180,s=Math.cos(a),u=Math.sin(a),c=e.shape.width/2,l=e.shape.height/2,d=[[-c,-l],[c,-l],[c,l],[-c,l]].map(([y,b])=>[e.seat.x+y*s-b*u,e.seat.y+y*u+b*s]),m=[[t,n],[o,n],[o,r],[t,r]],p=[[1,0],[0,1],[s,u],[-u,s]];for(let[y,b]of p){let M=1/0,v=-1/0;for(let[x,g]of d){let f=x*y+g*b;f<M&&(M=f),f>v&&(v=f)}let C=1/0,R=-1/0;for(let[x,g]of m){let f=x*y+g*b;f<C&&(C=f),f>R&&(R=f)}if(v<C||R<M)return!1}return!0}function Vo(e,t={}){let n=t.seatRadius??Vt,o=e.length,r=new Array(o),i=1/0,a=1/0,s=-1/0,u=-1/0,c=0;for(let f=0;f<o;f++){let h=e[f],w=t.shapeOf?.(h)??{kind:"circle",r:n},{hx:S,hy:P}=Bo(w);r[f]={seat:h,shape:w,hx:S,hy:P},h.x-S<i&&(i=h.x-S),h.y-P<a&&(a=h.y-P),h.x+S>s&&(s=h.x+S),h.y+P>u&&(u=h.y+P),S>c&&(c=S),P>c&&(c=P)}o===0&&(i=0,a=0,s=0,u=0);let l=c>0?c*4:1,d=Math.max(s-i,0),m=Math.max(u-a,0),p=Math.max(64,t.maxCells??o*4),y=l,b=Math.max(1,Math.ceil(d/y)||1),M=Math.max(1,Math.ceil(m/y)||1);for(;b*M>p&&(b>1||M>1);)y*=2,b=Math.max(1,Math.ceil(d/y)||1),M=Math.max(1,Math.ceil(m/y)||1);let v=b*M,C=new Int32Array(v+1),R=0;for(let f=0;f<o;f++){let h=r[f],w=N(Math.floor((h.seat.x-h.hx-i)/y),0,b-1),S=N(Math.floor((h.seat.x+h.hx-i)/y),0,b-1),P=N(Math.floor((h.seat.y-h.hy-a)/y),0,M-1),E=N(Math.floor((h.seat.y+h.hy-a)/y),0,M-1);for(let I=P;I<=E;I++)for(let k=w;k<=S;k++)C[I*b+k+1]++,R++}for(let f=0;f<v;f++)C[f+1]+=C[f];let x=new Int32Array(R),g=C.slice(0,v);for(let f=0;f<o;f++){let h=r[f],w=N(Math.floor((h.seat.x-h.hx-i)/y),0,b-1),S=N(Math.floor((h.seat.x+h.hx-i)/y),0,b-1),P=N(Math.floor((h.seat.y-h.hy-a)/y),0,M-1),E=N(Math.floor((h.seat.y+h.hy-a)/y),0,M-1);for(let I=P;I<=E;I++)for(let k=w;k<=S;k++){let O=I*b+k;x[g[O]++]=f}}return{seats:e,entries:r,minX:i,minY:a,cell:y,cols:b,rows:M,cellStart:C,items:x,stamp:new Int32Array(o),epoch:0}}function Uo(e,t,n={}){let{cols:o,rows:r,cell:i,minX:a,minY:s,cellStart:u,items:c,entries:l}=e,d=Math.floor((t.x-a)/i),m=Math.floor((t.y-s)/i);if(d<0||m<0||d>=o||m>=r)return null;let p=m*o+d,y=u[p+1],b=-1,M=1/0;for(let v=u[p];v<y;v++){let C=c[v],R=l[C];if(n.filter&&!n.filter(R.seat.id,R.seat)||!Ho(R,t.x,t.y))continue;let x=t.x-R.seat.x,g=t.y-R.seat.y,f=x*x+g*g;(f<M||f===M&&C<b)&&(M=f,b=C)}return b<0?null:l[b].seat.id}function Xo(e,t,n,o={}){if(!(n>0))return null;let{cols:r,rows:i,cell:a,minX:s,minY:u,cellStart:c,items:l,entries:d}=e,m=Math.max(0,Math.floor((t.x-n-s)/a)),p=Math.min(r-1,Math.floor((t.x+n-s)/a)),y=Math.max(0,Math.floor((t.y-n-u)/a)),b=Math.min(i-1,Math.floor((t.y+n-u)/a));if(m>p||y>b)return null;let M=-1,v=n*n,C=e.stamp,R=++e.epoch;for(let x=y;x<=b;x++){let g=x*r;for(let f=m;f<=p;f++){let h=g+f,w=c[h+1];for(let S=c[h];S<w;S++){let P=l[S];if(C[P]===R)continue;C[P]=R;let E=d[P];if(o.filter&&!o.filter(E.seat.id,E.seat))continue;let I=t.x-E.seat.x,k=t.y-E.seat.y,O=I*I+k*k;(O<v||O===v&&P<M)&&(v=O,M=P)}}}return M<0?null:d[M].seat.id}function Ko(e,t,n={}){let o=Math.min(t.x,t.x+t.width),r=Math.max(t.x,t.x+t.width),i=Math.min(t.y,t.y+t.height),a=Math.max(t.y,t.y+t.height),s=n.mode??"center",{cols:u,rows:c,cell:l,minX:d,minY:m,cellStart:p,items:y,entries:b}=e,M=Math.max(0,Math.floor((o-d)/l)),v=Math.min(u-1,Math.floor((r-d)/l)),C=Math.max(0,Math.floor((i-m)/l)),R=Math.min(c-1,Math.floor((a-m)/l));if(M>v||C>R)return[];let x=[],g=e.stamp,f=++e.epoch;for(let h=C;h<=R;h++){let w=h*u;for(let S=M;S<=v;S++){let P=w+S,E=p[P+1];for(let I=p[P];I<E;I++){let k=y[I];if(g[k]===f)continue;g[k]=f;let O=b[k];if(n.filter&&!n.filter(O.seat.id,O.seat))continue;(s==="center"?O.seat.x>=o&&O.seat.x<=r&&O.seat.y>=i&&O.seat.y<=a:Go(O,o,i,r,a))&&x.push(k)}}}return x.sort((h,w)=>h-w),x.map(h=>b[h].seat.id)}function Yo(e){let t=e.cols*e.rows,n=0,o=0;for(let i=0;i<t;i++){let a=e.cellStart[i+1]-e.cellStart[i];a>0&&n++,a>o&&(o=a)}let r=e.items.length;return{cell:e.cell,cols:e.cols,rows:e.rows,cells:t,occupiedCells:n,refs:r,maxPerCell:o,meanPerOccupiedCell:n?r/n:0}}var zo=[{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"}],hi=new Map(zo.map(e=>[e.key,e]));var $o=[{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"}],bi=new Map($o.map(e=>[e.key,e]));var Ut=["start","end","both","none"];var Wo=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],pi=new Set(Wo);function Z(e){return typeof e=="string"&&Ut.includes(e)}function be(e,t){return e&&t?"both":e?"start":t?"end":"none"}function Xt(e){let t=new Map,n=te(e);if(!n.size)return t;let o=new Map;for(let r of e){if(r.type!=="row"||!n.has(r.id))continue;let i=r.segmentedRow.groupId,a=o.get(i)??[];a.push(r),o.set(i,a)}for(let r of o.values())r.sort((i,a)=>i.segmentedRow.componentIndex-a.segmentedRow.componentIndex),r.forEach((i,a)=>{let s=r[a+1];t.set(i.id,{start:a>0&&i.segmentedRow.boundaryBefore==="continuous",end:!!s&&s.segmentedRow.boundaryBefore==="continuous"})});return t}function Kt(e,t){let n=Number.isInteger(e.seatCount)&&e.seatCount>0?e.seatCount:0,o=new Set;for(let d of e.overrides??[])d.skip&&o.add(d.index);let r=d=>d>=0&&d<n&&!o.has(d),i=be(!t?.start,!t?.end),a=Z(e.aisleSeats)?e.aisleSeats:void 0,s=a??i,u=-1,c=-1;for(let d=0;d<n;d+=1)r(d)&&(u<0&&(u=d),c=d);let l=new Set;if(u>=0){(s==="start"||s==="both")&&l.add(u),(s==="end"||s==="both")&&l.add(c);for(let d of o)r(d-1)&&l.add(d-1),r(d+1)&&l.add(d+1)}return{...a?{override:a}:{},automatic:i,slots:[...l].sort((d,m)=>d-m)}}function qo(e,t=[e]){return Kt(e,e.segmentedRow?Xt(t).get(e.id):void 0)}function Yt(e){let t=new Set;for(let n of Q(e)){let o=Xt(n.objects);for(let r of n.objects)if(r.type==="row")for(let i of Kt(r,o.get(r.id)).slots)t.add(`${r.id}:${i}`)}return t}function Qo(e,t,n){return Yt(e).has(`${t}:${n}`)}function Be(e){let t=Z(e.aisleSeats)?e.aisleSeats:"both";return{start:t==="start"||t==="both",end:t==="end"||t==="both"}}function He(e,t){t==="both"?delete e.aisleSeats:e.aisleSeats=t}function Zo(e,t,n){if(!Z(e.aisleSeats)){delete t.aisleSeats,delete n.aisleSeats;return}let o=Be(e);He(t,be(o.start,!0)),He(n,be(!0,o.end))}function Jo(e,t){let n=e[0],o=e[e.length-1];if(!n||!o||!Z(n.aisleSeats)&&!Z(o.aisleSeats)){delete t.aisleSeats;return}He(t,be(Be(n).start,Be(o).end))}0&&(module.exports={AUTOMATIC_ROUND_TABLE_RADIUS_MAX,AUTOMATIC_ROUND_TABLE_RADIUS_MIN,CHAIR_NUMBERING_DIRECTIONS,CHAIR_NUMBERING_FORMATS,CHAIR_NUMBERING_START_MAX,DEFAULT_SEAT_RADIUS,FLOOR_COVER_LIMIT,FLOOR_STACK_GAP_RATIO,FLOOR_STACK_MIN_SURFACE_PX,LEVEL_CONTEXT_PREFIX,TABLE_SEAT_OFFSET,TEXT_BACKGROUND_PADDING_MAX,TEXT_BACKGROUND_RADIUS_MAX,TEXT_LETTER_SPACING_MAX,TEXT_LETTER_SPACING_MIN,TEXT_LINE_HEIGHT_MAX,TEXT_LINE_HEIGHT_MIN,TEXT_OPACITY_MIN,TEXT_WIDTH_MAX,TEXT_WIDTH_MIN,aisleSeatIds,allObjects,automaticRoundTableRadius,buildAisleHoles,buildSeatIndex,buildSectionShell,chairNumberingProblem,chartBounds,combinedFloorZoneId,compactChairNumbering,cubicPoint,distanceToRings,distributeAlongCubic,effectiveFloorOverview,expandBooth,expandChart,expandRow,expandRowSlots,expandTable,expandTableSlots,floorObjects,floorStackPlacements,floorsOf,gridStats,hitTest,initialFloorMode,isAisleSeat,isRowAisleSeats,layoutCombinedFloorPlan,layoutFloorStack,levelContextOutlines,mainFloorId,mergeRowAisleSeats,nearestWithin,objectCenter,owningSectionForObject,pointInPolygon,pointInPolygonWithHoles,pointOnPolygonBoundary,polygonArea,polygonInscribedAnchor,polygonLabelPoint,polygonNetArea,queryRect,resolveRowAisleSeats,resolveSegmentedRowGroups,rowInventoryCount,rowSeatPositions,segmentedRowComponentSeats,segmentedRowComponents,segmentedRowSeatTotal,smoothCubicThroughMiddle,splitRowAisleSeats,stackFloors,suggestedFloorOverview,tableChairBookingLabel,tableChairDisplayLabel,tableChairToken,tableInventoryCount,tableSeatCountsBySide,textLayoutMetrics,translateObject,usableHoles});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ro,b as eo,c as fo,d as mo,e as po,f as to,g as xo,h as ao,i as bo,j as co,k as go,l as ho,m as io,n as yo,o as zo,p as Ao,q as Bo,r as Co,s as Do}from"../../chunk-
|
|
1
|
+
import{a as ro,b as eo,c as fo,d as mo,e as po,f as to,g as xo,h as ao,i as bo,j as co,k as go,l as ho,m as io,n as yo,o as zo,p as Ao,q as Bo,r as Co,s as Do}from"../../chunk-V65VJE6F.js";import{a as jo,b as ko,c as lo,d as no,e as qo,f as so,g as uo,h as vo,i as wo}from"../../chunk-TAKLS47V.js";import"../../chunk-M4NGX5NM.js";import"../../chunk-R6BN4HDQ.js";import{$a as W,E as c,F as d,G as g,H as h,I as i,J as j,K as k,Ka as F,L as l,La as G,M as n,Ma as H,Na as I,Oa as J,Pa as K,Qa as L,Ra as M,Sa as N,Ta as O,Ua as P,Va as Q,Wa as R,Xa as S,Ya as T,Za as U,_a as V,ab as X,bb as Y,cb as Z,db as _,eb as $,fb as oo,ga as q,ha as s,ia as u,ja as v,q as o,r,s as e,t as f,u as m,v as p,w as t,x,y as a,z as b}from"../../chunk-5R6I2XL7.js";import{k as w,l as y,m as z,n as A,o as B,p as C,q as D,r as E}from"../../chunk-S3VH7IDA.js";import"../../chunk-CRCGO52K.js";export{ko as AUTOMATIC_ROUND_TABLE_RADIUS_MAX,jo as AUTOMATIC_ROUND_TABLE_RADIUS_MIN,y as CHAIR_NUMBERING_DIRECTIONS,z as CHAIR_NUMBERING_FORMATS,w as CHAIR_NUMBERING_START_MAX,yo as DEFAULT_SEAT_RADIUS,ao as FLOOR_COVER_LIMIT,ro as FLOOR_STACK_GAP_RATIO,ho as FLOOR_STACK_MIN_SURFACE_PX,bo as LEVEL_CONTEXT_PREFIX,F as TABLE_SEAT_OFFSET,x as TEXT_BACKGROUND_PADDING_MAX,a as TEXT_BACKGROUND_RADIUS_MAX,p as TEXT_LETTER_SPACING_MAX,m as TEXT_LETTER_SPACING_MIN,f as TEXT_LINE_HEIGHT_MAX,e as TEXT_LINE_HEIGHT_MIN,t as TEXT_OPACITY_MIN,r as TEXT_WIDTH_MAX,o as TEXT_WIDTH_MIN,so as aisleSeatIds,Y as allObjects,lo as automaticRoundTableRadius,i as buildAisleHoles,zo as buildSeatIndex,h as buildSectionShell,D as chairNumberingProblem,oo as chartBounds,eo as combinedFloorZoneId,E as compactChairNumbering,c as cubicPoint,j as distanceToRings,g as distributeAlongCubic,to as effectiveFloorOverview,O as expandBooth,$ as expandChart,J as expandRow,I as expandRowSlots,N as expandTable,L as expandTableSlots,X as floorObjects,fo as floorStackPlacements,W as floorsOf,Do as gridStats,Ao as hitTest,io as initialFloorMode,uo as isAisleSeat,no as isRowAisleSeats,po as layoutCombinedFloorPlan,mo as layoutFloorStack,co as levelContextOutlines,go as mainFloorId,wo as mergeRowAisleSeats,Bo as nearestWithin,U as objectCenter,V as owningSectionForObject,P as pointInPolygon,S as pointInPolygonWithHoles,Q as pointOnPolygonBoundary,k as polygonArea,n as polygonInscribedAnchor,T as polygonLabelPoint,l as polygonNetArea,Co as queryRect,qo as resolveRowAisleSeats,v as resolveSegmentedRowGroups,H as rowInventoryCount,G as rowSeatPositions,s as segmentedRowComponentSeats,q as segmentedRowComponents,u as segmentedRowSeatTotal,d as smoothCubicThroughMiddle,vo as splitRowAisleSeats,_ as stackFloors,xo as suggestedFloorOverview,A as tableChairBookingLabel,C as tableChairDisplayLabel,B as tableChairToken,M as tableInventoryCount,K as tableSeatCountsBySide,b as textLayoutMetrics,Z as translateObject,R as usableHoles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p,b as t,c as x,d as a}from"../../chunk-YPVYZYMH.js";import{a as b,b as c,c as d,d as g,e as h,f as i,g as j,h as k,i as l,j as n,k as q,l as s}from"../../chunk-4N5CHKHD.js";import{A as T,b as u,c as v,d as w,e as y,g as z,h as A,i as B,j as C,k as D,l as E,m as F,n as G,o as H,p as I,q as J,r as K,s as L,t as M,u as N,v as O,w as P,x as Q,y as R,z as S}from"../../chunk-JXIX3PNI.js";import{k as o,l as r,m as e,n as f,o as m}from"../../chunk-
|
|
1
|
+
import{a as p,b as t,c as x,d as a}from"../../chunk-YPVYZYMH.js";import{a as b,b as c,c as d,d as g,e as h,f as i,g as j,h as k,i as l,j as n,k as q,l as s}from"../../chunk-4N5CHKHD.js";import{A as T,b as u,c as v,d as w,e as y,g as z,h as A,i as B,j as C,k as D,l as E,m as F,n as G,o as H,p as I,q as J,r as K,s as L,t as M,u as N,v as O,w as P,x as Q,y as R,z as S}from"../../chunk-JXIX3PNI.js";import{k as o,l as r,m as e,n as f,o as m}from"../../chunk-M4NGX5NM.js";import"../../chunk-MADX5HYP.js";import"../../chunk-R6BN4HDQ.js";import"../../chunk-S3VH7IDA.js";import"../../chunk-JBOTRSMY.js";export{F as DECOR_STAMP_ICON_PATHS,N as DEFAULT_SHAPE_LINE_CAP,P as DEFAULT_SHAPE_LINE_ENDING,O as DEFAULT_SHAPE_LINE_JOIN,g as SEAT_GLYPHS,c as SEAT_GLYPH_DETAIL_MIN_PX,d as SEAT_GLYPH_INSET,h as SEAT_GLYPH_ORDER,b as SEAT_GLYPH_VIEWBOX,t as SEAT_TYPE_ICON_BODY,p as SEAT_TYPE_ICON_VIEWBOX,K as SHAPE_LINE_CAPS,M as SHAPE_LINE_ENDINGS,L as SHAPE_LINE_JOINS,D as VENUE_ICONS,w as VENUE_ICON_BADGE,v as VENUE_ICON_BADGE_INK,u as VENUE_ICON_GROUP_COLORS,B as VENUE_ICON_GROUP_LABELS,C as VENUE_ICON_GROUP_ORDER,J as VENUE_ICON_KEYS,E as VENUE_ICON_LEGACY_DEFAULT_INK,A as VENUE_ICON_STROKE,z as VENUE_ICON_VIEWBOX,r as buyerBackgroundImage,f as buyerFacingChartDoc,m as hasConflictingLegacyTrace,Q as isOpenShapeKind,R as isPointShapeKind,q as isSeatGlyphKind,I as isVenueIconKey,e as migrateLegacyBackgroundLayersInPlace,s as resolveSeatGlyph,S as resolvedShapeLineStyle,i as seatGlyph,l as seatGlyphFit,j as seatGlyphLabel,n as seatGlyphMarkOnSeat,k as seatGlyphPath,x as seatTypeIconBody,a as seatTypeIconSvg,T as shapeArrowMetrics,o as traceReferenceImage,G as venueIcon,y as venueIconBadgeGlyph,H as venueIconPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var le=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var xt=Object.prototype.hasOwnProperty;var St=(e,t)=>{for(var n in t)le(e,n,{get:t[n],enumerable:!0})},Mt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of gt(t))!xt.call(e,r)&&r!==n&&le(e,r,{get:()=>t[r],enumerable:!(o=yt(t,r))||o.enumerable});return e};var wt=e=>Mt(le({},"__esModule",{value:!0}),e);var Vn={};St(Vn,{DEFAULT_SECTION_CORNER_SMOOTHING:()=>Ve,MAX_EDGE_SAGITTA_RATIO:()=>$e,TIER_HEIGHT_M:()=>Me,UNGROUPED_ID:()=>ae,applyHidden:()=>Hn,arcLevelAt:()=>jt,bearingDeg:()=>_e,buildSectionRake:()=>Wt,computeSections:()=>Un,computeSectionsPerFloor:()=>ht,cornerSmoothingThresholdDeg:()=>ze,distanceToPolyline:()=>fe,fitBowlProfile:()=>Dt,fitCircle:()=>ne,hiddenObjectIds:()=>mt,indexLabel:()=>ke,isSectionHidden:()=>bt,logicalNumberingRow:()=>Fe,reflectEdgeCurvature:()=>ln,relabelRows:()=>Ut,resolveSection:()=>Ot,reverseSectionOutlinePath:()=>bn,sampleSectionOutlinePath:()=>cn,seatConfidenceDisclosure:()=>Zt,seatDisplayLabel:()=>be,seatInventoryLabel:()=>he,seatLabelPart:()=>ee,sectionCornerSmoothingPath:()=>dn,sectionEntrancesById:()=>Bn,sectionGeometry:()=>Ze,sectionIdentitiesById:()=>Ce,sectionLabelsById:()=>Gn,sectionOutlinePathFrom:()=>We,sectionOwnersByObject:()=>dt,sectionPathSegmentEnd:()=>rn,toBijectiveBase:()=>de,toLetters:()=>q,toRoman:()=>pe,transformSectionOutlinePath:()=>He,translateSectionOutlinePath:()=>an,validSectionOutlinePath:()=>ge});module.exports=wt(Vn);function Ee(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 fe(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],s=e[r+1],u=s.x-i.x,l=s.y-i.y,b=u*u+l*l,c=b>1e-12?((t-i.x)*u+(n-i.y)*l)/b:0;c<0?c=0:c>1&&(c=1);let p=t-(i.x+c*u),d=n-(i.y+c*l);if(Math.abs(p)>=o||Math.abs(d)>=o)continue;let f=Math.hypot(p,d);f<o&&(o=f)}return o}function vt(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let s=Math.hypot(i.x-t,i.y-n);s>r&&(r=s)}return{cx:t,cy:n,r}}function Oe(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function ue(e,t){let n=1/0;for(let o of Ee(e)){let r=fe(t,o.x,o.y);r<n&&(n=r)}for(let o of Ee(t)){let r=fe(e,o.x,o.y);r<n&&(n=r)}return n}function It(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let c of e)n+=c.x,o+=c.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let c of e){let p=Math.hypot(c.x-n,c.y-o);p>r&&(r=p,i=c)}let s=i.x-n,u=i.y-o,l=Math.hypot(s,u);l>1e-9?(s/=l,u/=l):(s=1,u=0);let b=e.map((c,p)=>({p:c,i:p,t:(c.x-n)*s+(c.y-o)*u})).sort((c,p)=>c.t-p.t);return{pts:b.map(c=>c.p),seatIndices:b.map(c=>t[c.i])}}function ne(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let k of e)n+=k.x,o+=k.y;n/=t,o/=t;let r=0,i=0,s=0,u=0,l=0,b=0,c=0;for(let k of e){let E=k.x-n,g=k.y-o;r+=E*E,s+=g*g,i+=E*g,u+=E*E*E,l+=g*g*g,b+=E*g*g,c+=g*E*E}let p=r*s-i*i;if(Math.abs(p)<1e-9)return null;let d=(u+b)/2,f=(l+c)/2,h=(d*s-f*i)/p,R=(f*r-d*i)/p,I=h+n,O=R+o;return!Number.isFinite(I)||!Number.isFinite(O)?null:{cx:I,cy:O}}var Pt=.15;function At(e){if(e.length<2)return null;let t=e.map(w=>{let a=0,m=0;for(let S of w.pts)a+=S.x,m+=S.y;return{x:a/w.pts.length,y:m/w.pts.length}}),n=0,o=0;for(let w of t)n+=w.x,o+=w.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let w of t){let a=w.x-n,m=w.y-o;r+=a*a,i+=a*m,s+=m*m}let u=r+s,l=r*s-i*i,b=u/2+Math.sqrt(Math.max(0,u*u/4-l)),c,p;Math.abs(i)>1e-12?(c=b-s,p=i):r>=s?(c=1,p=0):(c=0,p=1);let d=Math.hypot(c,p);if(!(d>1e-12))return null;c/=d,p/=d;let f=0,h=0,R=0;for(let w of e){if(w.pts.length<2)continue;let a=w.pts[0],m=w.pts[w.pts.length-1],S=m.x-a.x,x=m.y-a.y,C=Math.hypot(S,x);if(!(C>1e-9))continue;let B=S/C,A=x/C;f+=(B*B-A*A)*C,h+=2*B*A*C,R+=C}if(R>0&&Math.hypot(f,h)>=Ct*R){let w=Math.atan2(h,f)/2,a=Math.cos(w),m=Math.sin(w);Math.abs(c*a+p*m)>Et&&(c=-m,p=a)}let I=1/0,O=-1/0,k=[];for(let w of e){let a=1/0,m=-1/0;for(let S of w.pts){let x=S.x*c+S.y*p;x<a&&(a=x),x>m&&(m=x),x<I&&(I=x),x>O&&(O=x)}k.push(m-a)}let E=O-I;return E>1e-9?(k.sort((w,a)=>w-a),k[Math.min(k.length-1,Math.floor(k.length*.9))]/E<=Rt?{x:c,y:p}:null):null}var Rt=.35,Ct=.8,Et=.7;function Ot(e,t,n,o){let r=new Map;for(let a of n){let m=t[a],S=m.rowId||`__seat-${a}`,x=r.get(S);x||(x={pts:[],idx:[]},r.set(S,x)),x.pts.push({x:m.x,y:m.y}),x.idx.push(a)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[a,m]of r){let S=It(m.pts,m.idx),x=0;for(let C of S.pts)x+=Math.hypot(C.x-o.x,C.y-o.y);i.push({id:a,pts:S.pts,seatIndices:S.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:x/S.pts.length})}let s=i.map(a=>vt(a.pts)),u=i.length<=256?i.length*(i.length-1)/2:0,l=u?new Float64Array(u):null;l?.fill(Number.NaN);let b=l?new Map(i.map((a,m)=>[a,m])):null,c=(a,m)=>(a>m&&([a,m]=[m,a]),a*(2*i.length-a-1)/2+(m-a-1)),p=(a,m)=>{if(!l)return ue(i[a].pts,i[m].pts);let S=c(a,m),x=l[S];if(!Number.isNaN(x))return x;let C=ue(i[a].pts,i[m].pts);return l[S]=C,C},d=(a,m)=>b?p(b.get(a),b.get(m)):ue(a.pts,m.pts),f=[];for(let a=0;a<i.length;a++){let m=1/0;for(let S=0;S<i.length;S++){if(a===S||Oe(s[a],s[S])>=m)continue;let x=p(a,S);x<m&&(m=x)}Number.isFinite(m)&&f.push(m)}f.sort((a,m)=>a-m);let h=f.length?f[Math.floor(f.length/2)]:1,R=Math.max(h*1.8,1e-6),I=i.map(()=>[]);for(let a=0;a<i.length;a++)for(let m=a+1;m<i.length;m++)Oe(s[a],s[m])>R||p(a,m)<=R&&(I[a].push(m),I[m].push(a));let O=0;for(let a=0;a<i.length;a++){if(i[a].blockId!==-1)continue;let m=O++,S=[a];for(i[a].blockId=m;S.length;){let x=S.pop();for(let C of I[x])i[C].blockId===-1&&(i[C].blockId=m,S.push(C))}}let k=new Map;for(let a of i){let m=k.get(a.blockId)??[];m.push(a),k.set(a.blockId,m)}let E=[];for(let a of i){if(a.pts.length<4)continue;let m=ne(a.pts);m&&(!Number.isFinite(m.cx)||!Number.isFinite(m.cy)||E.push({x:m.cx,y:m.cy}))}let g=E.length>=2?(()=>{let a=E.map(x=>x.x).sort((x,C)=>x-C),m=E.map(x=>x.y).sort((x,C)=>x-C),S=Math.floor(E.length/2);return{cx:a[S],cy:m[S]}})():null;if(g){let a=A=>Math.hypot(A.x-g.cx,A.y-g.cy),m=1/0,S=-1/0,x=[];for(let A of i){let y=1/0,M=-1/0;for(let T of A.pts){let L=a(T);L<y&&(y=L),L>M&&(M=L)}x.push(M-y),y<m&&(m=y),M>S&&(S=M)}let C=S-m;x.sort((A,y)=>A-y);let B=x[Math.min(x.length-1,Math.floor(x.length*.9))];if(C>1e-9&&B/C<=Pt){let A=i.map(P=>{let j=0;for(let $ of P.pts)j+=a($);return{row:P,radius:j/P.pts.length}}),y=0,M=0;for(let P of A)y+=P.radius,M+=P.row.focalDistance;y/=A.length,M/=A.length;let T=0;for(let P of A)T+=(P.radius-y)*(P.row.focalDistance-M);if(T<0)for(let P of A)P.radius=-P.radius;let G=1/0;for(let P of A)P.radius<G&&(G=P.radius);A.sort((P,j)=>P.radius-j.radius);let z=-1,_=-1/0,V=C/Math.max(1,A.length)*.5,U=[];for(let P of A)P.radius-_>V&&(z++,_=P.radius),P.row.ordinal=z,P.row.blockDepth=P.radius-G,U.push(P.row);return{sectionId:e,rows:U,blockCount:O}}}let w=[];for(let[,a]of k){let m=At(a);if(m){let S=A=>{let y=0;for(let M of A.pts)y+=M.x*m.x+M.y*m.y;return y/A.pts.length};a.sort((A,y)=>S(A)-S(y)),a.length>=2&&a[0].focalDistance>a[a.length-1].focalDistance&&a.reverse();let x=[],C=h*.5;for(let A of a){let y=x[x.length-1];y&&Math.abs(S(A)-S(y[0]))<C?y.push(A):x.push([A])}let B=0;for(let A=0;A<x.length;A++){if(A>0){let y=1/0;for(let M of x[A-1])for(let T of x[A])y=Math.min(y,d(M,T));B+=y}for(let y of x[A])y.ordinal=A,y.blockDepth=B,w.push(y)}}else{let S=1/0;for(let x of a)x.focalDistance<S&&(S=x.focalDistance);a.sort((x,C)=>x.focalDistance-C.focalDistance);for(let x=0;x<a.length;x++)a[x].ordinal=x,a[x].blockDepth=Math.max(0,a[x].focalDistance-S),w.push(a[x])}}return{sectionId:e,rows:w,blockCount:O}}var Tt=Math.PI/180,N=96,_t=6,Nt=60,kt=150,Te=.2,Lt=.35;function _e(e,t){let n=Math.atan2(t.x-e.x,t.y-e.y)/Tt;return n<0?n+360:n}function oe(e){if(!e.length)return NaN;let t=[...e].sort((n,o)=>n-o);return t[Math.floor(t.length/2)]}function re(e,t,n=2){let o=e.length,r=new Float64Array(o);for(let i=0;i<o;i++){let s=0,u=0;for(let l=-n;l<=n;l++){let b=i+l;if(t)b=(b%o+o)%o;else if(b<0||b>=o)continue;s+=e[b],u++}r[i]=s/u}return r}function Dt(e,t){let n=e.filter(d=>d.rows.length>=1);if(n.length<1)return null;let o=[],r=0,i=0,s=0;for(let d of n)for(let f of d.rows){for(let h of f.pts)r+=h.x,i+=h.y,s++;if(f.pts.length>=4){let h=ne(f.pts);h&&Number.isFinite(h.cx)&&Number.isFinite(h.cy)&&o.push({x:h.cx,y:h.cy})}}if(!s)return null;let u={x:r/s,y:i/s},l=u;if(o.length>=8){let d=oe(o.map(O=>O.x)),f=oe(o.map(O=>O.y)),h=0;for(let O of n)for(let k of O.rows)for(let E of k.pts){let g=Math.hypot(E.x-u.x,E.y-u.y);g>h&&(h=g)}let R=0,I=h*.2;for(let O of n)for(let k of O.rows)for(let E of k.pts)Math.hypot(E.x-d,E.y-f)<I&&R++;Math.hypot(d-u.x,f-u.y)<=h&&R/s<.01&&(l={x:d,y:f})}let b=[];for(let d of n){let f={sectionId:d.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let h of d.rows)for(let R of h.pts){let I=Math.hypot(R.x-l.x,R.y-l.y),O=Math.min(N-1,Math.floor(_e(l,R)/(360/N)));f.samples.push({r:I,bin:O,levelM:h.levelM}),I<f.rMin&&(f.rMin=I),I>f.rMax&&(f.rMax=I)}f.samples.length&&b.push(f)}if(!b.length)return null;b.sort((d,f)=>d.rMin+d.rMax-(f.rMin+f.rMax));let c=[];for(let d of b){let f=!1;for(let h of c){let R=Math.min(d.rMax,h.rMax)-Math.max(d.rMin,h.rMin),I=Math.min(d.rMax-d.rMin,h.rMax-h.rMin);if(I>1e-9&&R>=Lt*I){h.members.push(d),h.rMin=Math.min(h.rMin,d.rMin),h.rMax=Math.max(h.rMax,d.rMax),f=!0;break}}f||c.push({members:[d],rMin:d.rMin,rMax:d.rMax})}let p=[];for(let d of c){let f=new Array(N).fill(null);for(let y of d.members)for(let M of y.samples){let T=f[M.bin];T||(T={samples:[]},f[M.bin]=T),T.samples.push({r:M.r,levelM:M.levelM})}let h=f.map(y=>!!y);if(!h.filter(Boolean).length)continue;let I=[],O=[];for(let y of f){if(!y)continue;let M=1/0,T=-1/0;for(let L of y.samples)L.r<M&&(M=L.r),L.r>T&&(T=L.r);I.push(M),O.push(T)}let k=oe(I),E=oe(O);if(!(k>=Te*E)||!(E>0))continue;let g=[...I].sort((y,M)=>y-M);if(!(g[Math.floor(g.length*.1)]>=Te*E))continue;let a=f.map(y=>{if(!y)return null;let M=[...y.samples].sort((P,j)=>P.r-j.r),T=M[0].r,L=M[M.length-1].r,G=M[0].levelM,z=-1/0;for(let P of M)P.levelM>z&&(z=P.levelM);let _=[];for(let P of M){let j={r:P.r,l:P.levelM};for(;_.length&&Math.abs(_[_.length-1].r-j.r)<1e-9;){if(_[_.length-1].l<=j.l){j.skip=!0;break}_.pop()}if(!j.skip){for(;_.length>=2;){let $=_[_.length-2],K=_[_.length-1];if((K.r-$.r)*(j.l-$.l)-(K.l-$.l)*(j.r-$.r)<=0)_.pop();else break}_.push(j)}}let V=_.map(P=>P.r),U=_.map(P=>P.l);return{inner:T,outer:L,front:G,top:z,profile:{rs:V,ls:U}}}),m=h.slice();for(let y=0;y<N;y++){if(m[y])continue;let M=-1,T=-1,L=0;for(let v=1;v<=N;v++){let D=(y-v+N*2)%N;if(m[D]){M=D;break}}for(let v=1;v<=N;v++){let D=(y+v)%N;if(m[D]){T=D,L=v;break}}if(M<0||T<0)continue;let G=0;for(let v=1;v<=N;v++){let D=(y-v+N*2)%N;if(h[D]){G=v;break}}if(G-1+L>_t)continue;let _=a[M],V=a[T],U=G/(G+L),P=_.inner+(V.inner-_.inner)*U,j=_.outer+(V.outer-_.outer)*U,$=_.front+(V.front-_.front)*U,K=_.top+(V.top-_.top)*U;a[y]={inner:P,outer:j,front:$,top:K,profile:{rs:[P,j],ls:[$,K]}}}for(let y=0;y<N;y++)a[y]&&(m[y]=!0);let S=360/N,x=[],C=m.filter(Boolean).length,B=[];if(C===N)B.push({start:0,len:N});else{let y=0;for(;m[y];)y=(y+1)%N;let M=-1;for(let T=0;T<=N;T++){let L=(y+T)%N,G=T<N&&m[L];if(G&&M<0)M=L;else if(!G&&M>=0){let z=(L-M+N)%N||N;B.push({start:M,len:z}),M=-1}}}for(let y of B){if(y.len*S<Nt&&y.len<N)continue;let M=y.len===N,T=new Float64Array(y.len),L=new Float64Array(y.len),G=new Float64Array(y.len),z=new Float64Array(y.len),_=[];for(let v=0;v<y.len;v++){let D=a[(y.start+v)%N];T[v]=D.inner,L[v]=D.outer,G[v]=D.front,z[v]=D.top,_.push(D.profile??{rs:[D.inner,D.outer],ls:[D.front,D.top]})}let V=re(T,M),U=re(L,M),P=re(G,M),j=re(z,M);for(let v=0;v<y.len;v++)V[v]>T[v]&&(V[v]=T[v]),U[v]<L[v]&&(U[v]=L[v]),V[v]>U[v]-1e-6&&(V[v]=Math.max(0,U[v]-1e-6)),j[v]<P[v]&&(j[v]=P[v]);let $={startBin:y.start,binCount:y.len,closed:M,innerR:V,outerR:U,frontLevelM:P,topLevelM:j,profiles:_},K=(v,D,H)=>{let Z=_[v],X=Z.rs,W=Z.ls;if(D<=X[0]){W[0]>H&&(W[0]=H);return}if(D>=X[X.length-1]){W[W.length-1]>H&&(W[W.length-1]=H);return}for(let Y=0;Y+1<X.length;Y++)if(D<=X[Y+1]){W[Y]>H&&(W[Y]=H),W[Y+1]>H&&(W[Y+1]=H);return}};for(let v=0;v<y.len;v++){let D=f[(y.start+v)%N];if(D)for(let H of D.samples){K(v,H.r,H.levelM);let Z=M?(v-1+y.len)%y.len:v-1,X=M?(v+1)%y.len:v+1;Z>=0&&K(Z,H.r,H.levelM),X<y.len&&K(X,H.r,H.levelM)}}x.push($)}x.reduce((y,M)=>y+M.binCount*S,0)<kt||p.push({arcs:x,sectionIds:d.members.map(y=>y.sectionId),innerRMedian:k,outerRMedian:E})}if(!p.length)return null;if(p.sort((d,f)=>d.innerRMedian-f.innerRMedian),t){let d=p[p.length-1].outerRMedian;if(Math.hypot(t.x-l.x,t.y-l.y)>.9*d)return null}return{centre:l,binCount:N,binStepDeg:360/N,rings:p}}function jt(e,t,n,o){let r=e.binStepDeg,i=n/r-.5-t.startBin;i=(i%e.binCount+e.binCount)%e.binCount,i>t.binCount-1&&(t.closed?i=i-t.binCount<t.binCount-i?0:t.binCount-1:i=i-(t.binCount-1)<e.binCount-i?t.binCount-1:0);let s=Math.floor(i),u=t.closed?(s+1)%t.binCount:Math.min(t.binCount-1,s+1),l=i-s,b=c=>{let p=t.profiles[c],d=p.rs,f=p.ls;if(o<=d[0])return f[0];if(o>=d[d.length-1])return f[f.length-1];for(let h=0;h+1<d.length;h++)if(o<=d[h+1]){let R=d[h+1]-d[h],I=R>1e-9?(o-d[h])/R:0;return f[h]+(f[h+1]-f[h])*I}return f[f.length-1]};return b(s)*(1-l)+b(u)*l}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Ft="ABCDEFGHJKLMNPQRSTUVWXYZ",Bt="abcdefghijklmnopqrstuvwxyz";function de(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function ke(e,t){let n=t.startAt-1,o=e+n;if(t.scheme==="numbers")return String(o+1);let r=t.skipAmbiguous?Ft:Ne;return de(o,r)}function q(e,t=!1){let n=t?Bt:Ne;return de(Math.max(0,Math.floor(e)-1),n)}var Gt=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function pe(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Gt)for(;t>=o;)n+=r,t-=o;return n}function Ut(e,t){let n=e.length;return e.map((o,r)=>{let i=t.reverse?n-1-r:r;return{...o,label:ke(i,t)}})}function Ht(e){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(t,n)=>Math.hypot(t-e.x,n-e.y),gradientAt:(t,n)=>{let o=t-e.x,r=n-e.y,i=Math.hypot(o,r);return i<1e-9?[0,0]:[o/i,r/i]}}}function Vt(e,t){if(!e.length)return null;let n=0,o=0,r=0;for(let f of e)n+=f.x,o+=f.y,r+=Math.hypot(f.x-t.x,f.y-t.y);let i=e.length;n/=i,o/=i,r/=i;let s=e[0],u=-1;for(let f of e){let h=Math.hypot(f.x-n,f.y-o);h>u&&(u=h,s=f)}let l=s.x-n,b=s.y-o,c=Math.hypot(l,b);c>1e-9?(l/=c,b/=c):(l=1,b=0);let p=[...e].sort((f,h)=>(f.x-n)*l+(f.y-o)*b-((h.x-n)*l+(h.y-o)*b)),d=0;for(let f of p){let h=Math.hypot(f.x-n,f.y-o);h>d&&(d=h)}return{pts:p,cx:n,cy:o,radius:d,depth:r}}function Le(e,t,n){let o=e.pts;if(o.length===1)return Math.hypot(t-o[0].x,n-o[0].y);let r=1/0;for(let i=0;i+1<o.length;i++){let s=o[i],u=o[i+1],l=u.x-s.x,b=u.y-s.y,c=l*l+b*b,p=c>1e-12?((t-s.x)*l+(n-s.y)*b)/c:0;p<0?p=0:p>1&&(p=1);let d=Math.hypot(t-(s.x+p*l),n-(s.y+p*b));d<r&&(r=d)}return r}var ie=8;function zt(e,t,n){let o=new Array(ie).fill(1/0),r=new Array(ie).fill(-1);for(let c=0;c<e.length;c++){let p=e[c],d=Math.hypot(t-p.cx,n-p.cy)-p.radius;for(let f=0;f<ie;f++)if(d<o[f]){for(let h=ie-1;h>f;h--)o[h]=o[h-1],r[h]=r[h-1];o[f]=d,r[f]=c;break}}let i=new Array(3).fill(1/0),s=new Array(3).fill(-1);for(let c of r){if(c<0)continue;let p=Le(e[c],t,n);for(let d=0;d<3;d++)if(p<i[d]){for(let f=2;f>d;f--)i[f]=i[f-1],s[f]=s[f-1];i[d]=p,s[d]=c;break}}if(s[0]<0)return 0;if(i[0]<1e-6)return e[s[0]].depth;let u=i[0]*2.2,l=0,b=0;for(let c=0;c<3;c++){let p=s[c];if(p<0||i[c]>u)continue;let d=1/(i[c]*i[c]);l+=d*e[p].depth,b+=d}return b>0?l/b:e[s[0]].depth}function $t(e){let t=(o,r)=>zt(e,o,r),n=(o,r)=>{let i=1/0,s=-1;for(let u=0;u<e.length;u++){let l=e[u];if(Math.hypot(o-l.cx,r-l.cy)-l.radius>=i)continue;let b=Le(l,o,r);b<i&&(i=b,s=u)}return s};return{kind:"rows",rowCount:e.length,rows:e,nearestRow:n,depthAt:t,gradientAt:(o,r)=>{let i=(t(o+.5,r)-t(o-.5,r))/1,s=(t(o,r+.5)-t(o,r-.5))/(2*.5),u=Math.hypot(i,s);return u<1e-9?[0,0]:[i/u,s/u]}}}function Wt(e,t){let n=[];for(let o of e){let r=Vt(o.points,t);r&&n.push(r)}return n.length<2?Ht(t):(n.sort((o,r)=>o.depth-r.depth),$t(n))}var Kt=/^\d{4}-\d{2}-\d{2}$/;function Xt(e){let t=Date.parse(e);return Number.isFinite(t)?Kt.test(e)?t+864e5:t:null}function De(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=Xt(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function je(e){return e.status!=="draft"&&e.status!=="retracted"}function Yt(e){return e==="exact-seat"?"Exact seat in the model":e==="row-representative"?"Representative row evidence":e==="section-representative"?"Representative section evidence":e==="floor-representative"?"Representative floor evidence":"Representative venue evidence"}function qt(e){if(!e)return"No assessment date supplied";let t=new Date(e);return Number.isFinite(t.getTime())?`Assessed ${t.toISOString().slice(0,10)}`:"No assessment date supplied"}function Jt(){return{headline:"Generated view \xB7 unverified",model:"No geometry or event-configuration verification supplied",reality:"No real-world check supplied",coverage:"Selected chart seat",provenance:"Chart-derived model",freshness:"No current organizer-approved evidence matches this Event, venue revision, or renewal window",limitations:["Generated view is not surveyed sightline truth."]}}function Qt(e){let t=qt(e.assessedAt);if(!e.validUntil)return t;let n=Date.parse(e.validUntil);return Number.isFinite(n)?`${t} \xB7 valid until ${e.validUntil.slice(0,10)}`:t}function Zt(e,t={}){if(!e||!je(e)||!De(e,t.now))return Jt();let n=e.evidenceKind==="synthetic-model",o=e.modelLevel==="configuration-verified"?"Event configuration verified":e.modelLevel==="geometry-verified"?"Venue geometry verified":n?"Versioned synthetic model":"Generated model \xB7 not verified",r=e.realityLevel==="actual-build-checked"?"Actual event build reality checked":e.realityLevel==="comparable-build-reference"?"Comparable-build reference only":"No real-world check supplied",i=n?"Synthetic model evidence":e.modelLevel==="configuration-verified"?"Configuration verified":e.modelLevel==="geometry-verified"?"Geometry verified":"Generated view \xB7 unverified",s=[...e.limitations??[],...n?["Synthetic demo; not surveyed or venue-certified."]:[]],u=e.modeledTarget?`${e.modeledTarget.label} \xB7 ${e.modeledTarget.clearRayCount}/${e.modeledTarget.totalRayCount} target rays clear \xB7 ${e.modeledTarget.classification} in bounded model \xB7 ${e.modeledTarget.methodLabel}`+(e.modeledTarget.occluderLabels?.length?` \xB7 modeled occluders: ${e.modeledTarget.occluderLabels.join(", ")}`:""):void 0;return u&&s.push("Modeled target is not a percentage of the show visible."),{headline:i,model:o,reality:r,coverage:Yt(e.coverage),provenance:e.sourceLabel??e.approvedByRole??"Source not supplied",freshness:Qt(e),limitations:s,...u?{modeledTarget:u}:{}}}function en(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function ee(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",u=e.seatNumbering?.endAt,l=e.seatCount;if(i==="updown"||i==="updown-descending"){let f=Math.ceil(l/2),h=i==="updown"?t<f?n+2*t:n-1+2*(l-t):t<f?n+2*(f-1-t):n+1+2*(t-f);return`${s}${h}`}let b=i==="odd"||i==="even"?2:r,c=u!=null&&Number.isFinite(u)?u-(l-1)*b:n,p=o==="center"?en(l)[t]:o==="rtl"?l-1-t:t,d;switch(i){case"odd":{let f=c%2===1?c:c+1;d=String(f+p*2);break}case"even":{let f=c%2===0?c:c+1;d=String(f+p*2);break}case"roman":d=pe(c+p*r);break;case"letters-upper":d=q(c+p*r,!1);break;case"letters-lower":d=q(c+p*r,!0);break;default:d=String(c+p*r);break}return`${s}${d}`}function Fe(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function he(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${ee(e,t)}`}function be(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(e.seatDisplayLabelMode==="number")return ee(e,t);if(!n)return`${e.displayLabel||e.label}-${ee(e,t)}`;let r=Fe(n),i=n.displayOffset+t;return`${n.displayLabel}-${ee(r,i)}`}function tn(e,t,n){return Math.max(t,Math.min(n,e))}function nn(e){return tn(e,0,1)}function Be(e){let t=nn(e);return t*t*(3-2*t)}var no=Math.PI/180;function F(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function me(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}var J=Math.PI*2;function Q(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function on(e,t,n){let o=t-e;if(n){for(;o<0;)o+=J;for(;o>=J;)o-=J}else{for(;o>0;)o-=J;for(;o<=-J;)o+=J}return o}function rn(e){return e.end}function ge(e){if(e.version!==1||e.closed!==!0||!Q(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!Q(n.end))return!1;if(n.kind==="line"){if(F(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!Q(n.control1)||!Q(n.control2)||F(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!Q(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(F(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(F(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||F(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return F(t,e.start)<=1e-4}function sn(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function cn(e,t=2){if(!ge(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let s=Math.atan2(r.y-i.center.y,r.x-i.center.x),u=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),l=on(s,u,i.clockwise),b=Math.max(2,Math.ceil(Math.abs(l)*i.radius/n));for(let c=1;c<=b;c+=1){let p=s+l*c/b;o.push({x:i.center.x+Math.cos(p)*i.radius,y:i.center.y+Math.sin(p)*i.radius})}}else{let s=F(r,i.control1)+F(i.control1,i.control2)+F(i.control2,i.end),u=Math.max(2,Math.ceil(s/n));for(let l=1;l<=u;l+=1)o.push(sn(r,i,l/u))}r=i.end}return F(o[o.length-1],o[0])<=1e-4&&o.pop(),o}function an(e,t,n){return He(e,r=>({x:r.x+t,y:r.y+n}))}function He(e,t,n=1,o=!1){return{...e,start:t(e.start),segments:e.segments.map(r=>r.kind==="line"?{...r,end:t(r.end)}:r.kind==="arc"?{...r,center:t(r.center),radius:r.radius*Math.abs(n),clockwise:o?!r.clockwise:r.clockwise,end:t(r.end)}:{...r,control1:t(r.control1),control2:t(r.control2),end:t(r.end)})}}function ln(e){return e.map(t=>t===0?0:-t)}var Ve=45,ye=150,un=60;function ze(e){let t=Ve/100;if(e<=t)return ye;let n=Math.min(1,(e-t)/(1-t));return ye-n*(ye-un)}var Ge=.5523;function Ue(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function fn(e){let t=[],n=[];for(e.forEach((o,r)=>{Q(o)&&(t.length&&Ue(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&Ue(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function dn(e,t,n){return We(e,{cornerSmoothing:t,...n})}var $e=.5,pn=4/3;function hn(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let s=-r/i,u=o/i,l=n*pn;return{kind:"bezier",control1:{x:e.x+o/3+s*l,y:e.y+r/3+u*l},control2:{x:e.x+o*2/3+s*l,y:e.y+r*2/3+u*l},end:{...t}}}function We(e,t){let{points:n,sourceIndex:o}=fn(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,s=t.edgeCurvature,u=new Array(r).fill(0);if(s?.length)for(let g=0;g<r;g+=1){let w=s[o[g]];u[g]=Number.isFinite(w)?Math.min(100,Math.max(-100,w))/100:0}let l=u.some(g=>Math.abs(g)>1e-6);if(i<=0&&!l)return null;let b=t.wideAngleThresholdDeg??ze(i),c=[];for(let g=0;g<r;g+=1)c[g]=F(n[g],n[(g+1)%r]);let p=new Array(r).fill(0);for(let g=0;g<r;g+=1){let w=n[(g-1+r)%r],a=n[g],m=n[(g+1)%r],S={x:w.x-a.x,y:w.y-a.y},x={x:m.x-a.x,y:m.y-a.y},C=Math.hypot(S.x,S.y),B=Math.hypot(x.x,x.y);if(C<=1e-9||B<=1e-9)continue;let A=Math.min(1,Math.max(-1,(S.x*x.x+S.y*x.y)/(C*B))),y=Math.acos(A)*180/Math.PI;if(y<b)continue;let M=Be((y-b)/(180-b));p[g]=i*M*.5*Math.min(C,B)}for(let g=0;g<r;g+=1){let w=(g+1)%r,a=p[g]+p[w];if(a>c[g]&&a>1e-9){let m=c[g]/a;p[g]*=m,p[w]*=m}}let d=new Array(r),f=new Array(r);for(let g=0;g<r;g+=1){let w=n[(g-1+r)%r],a=n[g],m=n[(g+1)%r];if(p[g]<=1e-6){d[g]={...a},f[g]={...a};continue}let S=F(a,w)||1,x=F(a,m)||1;d[g]={x:a.x+(w.x-a.x)/S*p[g],y:a.y+(w.y-a.y)/S*p[g]},f[g]={x:a.x+(m.x-a.x)/x*p[g],y:a.y+(m.y-a.y)/x*p[g]}}if(p.every(g=>g<=1e-6)&&!l)return null;let h=[],R={...f[0]},I=R,O=(g,w)=>{if(F(I,g)<=1e-9)return;let a=u[w];Math.abs(a)>1e-6?h.push(hn(I,g,a*$e*c[w])):h.push({kind:"line",end:{...g}}),I=g};for(let g=1;g<=r;g+=1){let w=g%r,a=n[w];O(d[w],(g-1)%r),p[w]>1e-6&&F(d[w],f[w])>1e-9&&(h.push({kind:"bezier",control1:me(d[w],a,Ge),control2:me(f[w],a,Ge),end:{...f[w]}}),I=f[w])}if(!h.length)return null;let k=h[h.length-1];F(k.end,R)>1e-9&&(k.kind==="line"?k.end={...R}:h.push({kind:"line",end:{...R}}));let E={version:1,closed:!0,start:R,segments:h};return ge(E)?E:null}function bn(e){let t=[],n=e.start;for(let r of e.segments)t.push(n),n=r.end;let o=[];for(let r=e.segments.length-1;r>=0;r-=1){let i=e.segments[r],s=t[r];i.kind==="line"?o.push({kind:"line",end:{...s}}):i.kind==="arc"?o.push({kind:"arc",center:{...i.center},radius:i.radius,clockwise:!i.clockwise,end:{...s}}):o.push({kind:"bezier",control1:{...i.control2},control2:{...i.control1},end:{...s}})}return{version:1,closed:!0,start:{...e.start},segments:o}}function Ke(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,s=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+s*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+s*e.end.y}}function Xe(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[Ke(e,.5)];let o=Array.from({length:n+1},(l,b)=>Ke(e,b/n)),r=new Float64Array(o.length);for(let l=1;l<o.length;l+=1){let b=o[l].x-o[l-1].x,c=o[l].y-o[l-1].y;r[l]=r[l-1]+Math.hypot(b,c)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],u=1;for(let l=0;l<t;l+=1){let b=i*l/(t-1);for(;u<r.length-1&&r[u]<b;)u+=1;let c=r[u-1],p=r[u],d=p===c?0:(b-c)/(p-c);s.push({x:o[u-1].x+(o[u].x-o[u-1].x)*d,y:o[u-1].y+(o[u].y-o[u-1].y)*d})}return s}function Ye(e,t){return`${e.label}-${t+1}`}function mn(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function yn(e,t){let n=e.chairNumbering,o=n?.start??1,r=mn(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?q(Math.max(1,o)+r):String(o+r)}function qe(e,t){let n=yn(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}var Qe=.02291666666666667,uo=1/Qe,gn=58,Me=gn*Qe;var xn=3,Je=0,xe=120,Sn=0,Mn=45,wn=7;function Se(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function vn(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=wn?e:xn}function Ze(e,t={}){let n=Se(t.floorBaseHeightM,Je,xe,0),o=Math.min(xe,n+vn(e.elevation)*Me),r=e.height===void 0?o:Se(e.height,Je,xe,o),i=Se(e.rake,Sn,Mn,0);return{height:r,rake:i}}function we(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;var te=16;function Ie(e,t,n,o){let r=n*se,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function ot(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return Xe(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let b=0;b<t;b++)s.push(Ie(b*n,0,r,i));return s}let u=o/(t-1)*se,l=n/(2*Math.sin(Math.abs(u)/2));for(let b=0;b<t;b++){let c=b*u,p=l*Math.sin(c),d=-l+l*Math.cos(c);s.push(Ie(p,d,r,i))}return s}function rt(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function In(e,t){let n=rt(e);return ot(e).map((o,r)=>{let i=n.get(r),s=we(i),u=he(e,r,i),l={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:u,displayLabel:be(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(l).some(b=>b!==void 0&&b!==!1&&b!=="")?l:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function it(e){let t=[];for(let n of In(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 Pn(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function An(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(c=>[c.index,c])),r=(c,p,d,f)=>{let h=o.get(c),R=we(h),I=h?.label??Ye(e,c);return{index:c,label:I,displayLabel:h?.displayLabel??qe(e,c),x:p+(h?.dx??0),y:d+(h?.dy??0),categoryKey:h?.categoryKey??e.categoryKey,skipped:!!h?.skip,accessible:R.length>0,accessibility:R,wheelchairSpaceType:h?.wheelchairSpaceType,commercial:h?.commercial,glyph:h?.glyph,viewUrl:h?.viewFromSeatUrl,viewMeta:h?.viewFromSeatUrl?h.viewFromSeatMeta:void 0,labelStyle:h?.labelStyle,...f?{side:f}:{}}};if(e.shape==="round"){let c=(e.radius??40)+te,p=e.rotation*se,d=Math.max(0,Math.min(360,e.seatArc??360));if(d>=360||n===1){for(let I=0;I<n;I++){let O=p+I/n*2*Math.PI;t.push(r(I,e.center.x+c*Math.cos(O),e.center.y+c*Math.sin(O)))}return t}let f=d*se,h=(2*Math.PI-f)/2,R=p+h;for(let I=0;I<n;I++){let O=R+I/(n-1)*f;t.push(r(I,e.center.x+c*Math.cos(O),e.center.y+c*Math.sin(O)))}return t}let i=e.width??80,s=e.height??50,u=Pn(e),l=["top","bottom","left","right"],b=0;for(let c of l){let p=u[c];for(let d=0;d<p;d++){let f,h;c==="top"?(f=-i/2+(d+.5)*i/p,h=-s/2-te):c==="bottom"?(f=-i/2+(d+.5)*i/p,h=s/2+te):c==="left"?(f=-i/2-te,h=-s/2+(d+.5)*s/p):(f=i/2+te,h=-s/2+(d+.5)*s/p);let R=Ie(f,h,e.rotation,e.center);t.push(r(b++,R.x,R.y,c))}}return t}function st(e){return An(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 ct(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function et(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,u=t[r].x,l=t[r].y;s>e.y!=l>e.y&&e.x<(u-i)*(e.y-s)/(l-s)+i&&(n=!n)}return n}function Rn(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let s=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),u=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=u+1e-7})}function Pe(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function tt(e,t,n){return et(e,t)&&!Pe(n).some(o=>et(e,o)||Rn(e,o))}function ve(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function Cn(e){switch(e.type){case"row":{let t=ot(e),n=rt(e),o=0,r=0,i=0;for(let s=0;s<t.length;s++){let u=n.get(s);u?.skip||(o+=t[s].x+(u?.dx??0),r+=t[s].y+(u?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ve(e.points);case"section":return ve(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ve(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 nt(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function En(e,t){if(e.type!=="gaArea"||!nt(e.points,t.outline))return!1;let n=Pe(e.holes),o=Pe(t.holes);return n.length===o.length&&n.every((r,i)=>nt(r,o[i]))}function Ae(e,t,n=e.filter(r=>r.type==="section"),o=Cn(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(s=>(s.logicalSectionId??s.id)===r&&(En(t,s)||tt(o,s.outline,s.holes))):void 0)??n.find(s=>tt(o,s.outline,s.holes))}function at(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 ce(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}var lt="__sl_ga__";var On=lt,Re=1e5;function Tn(e,t){return`${On}${encodeURIComponent(e)}__${t+1}`}function _n(e){let t=e.inventorySegments;if(t===void 0)return!0;if(!Array.isArray(t)||t.length<1||t.length>256)return!1;let n=0,o=new Map;for(let r of t){if(!r||typeof r.sourceAreaId!="string"||!r.sourceAreaId.trim()||r.sourceAreaId.length>160||!Number.isInteger(r.startIndex)||r.startIndex<0||!Number.isInteger(r.count)||r.count<1||r.startIndex+r.count>Re||(n+=r.count,n>Re))return!1;let i=o.get(r.sourceAreaId)??[],s=r.startIndex+r.count;if(i.some(u=>r.startIndex<u.end&&s>u.start))return!1;i.push({start:r.startIndex,end:s}),o.set(r.sourceAreaId,i)}return n===e.capacity}function Nn(e){let t=Math.min(Re,Math.max(0,Math.floor(e.capacity)));return e.inventorySegments===void 0?t?[{sourceAreaId:e.id,startIndex:0,count:t}]:[]:_n(e)?e.inventorySegments.map(n=>({...n})):[]}var kn=100,wo=`An area sold to one party holds at most ${kn} guests.`;function Ln(e){return e.variableOccupancy?"variable":e.bookAsWhole?"whole":null}function ut(e){return Dn(e,2)}function Dn(e,t){return t===2&&Ln(e)&&e.inventorySegments===void 0?e.label.trim()?[e.label]:[]:Nn(e).flatMap(n=>Array.from({length:n.count},(o,r)=>Tn(n.sourceAreaId,n.startIndex+r)))}var ae="__ungrouped__";function jn(e){return e.type==="row"?it(e).map(t=>t.label):e.type==="table"?st(e).map(t=>t.label):e.type==="booth"?ct(e).map(t=>t.label):e.type==="gaArea"?ut(e):[]}function ft(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function Fn(e){return e.displayLabel||e.label||"Section"}function Ce(e){let t=new Map;for(let n of ce(e)){if(n.type!=="section")continue;let o=n.logicalSectionId??n.id;t.has(o)||t.set(o,{id:o,label:Fn(n),zone:n.zone})}return t}function Bn(e){let t=new Map;for(let n of ce(e)){if(n.type!=="section")continue;let o=n.logicalSectionId??n.id,r=n.entrance?.trim();r&&!t.has(o)&&t.set(o,r)}return t}function Gn(e){let t=new Map;for(let[n,o]of Ce(e))t.set(n,o.label);return t}function dt(e){let t=new Map;for(let n of at(e)){let o=n.objects.filter(r=>r.type==="section");if(o.length)for(let r of n.objects){if(!ft(r))continue;let i=Ae(n.objects,r,o);i&&t.set(r.id,i.logicalSectionId??i.id)}}return t}function pt(e,t){let n=ce(e),o=n.filter(u=>u.type==="section"),r=new Map;for(let[u,l]of Ce(e))r.set(u,{id:u,label:l.label,zone:l.zone,seatCount:0,objectIds:[],seatLabels:[]});let i={id:ae,label:"Other seats",seatCount:0,objectIds:[],seatLabels:[]},s=new Map;for(let u of n){if(!ft(u))continue;let l=jn(u);if(l.length===0)continue;let b;if(t)b=t.get(u.id);else{let p=Ae(n,u,o);b=p?p.logicalSectionId??p.id:void 0}let c=b?r.get(b):i;c.seatCount+=l.length,c.objectIds.push(u.id),c.seatLabels.push(...l),s.set(u.id,c.id)}return{sections:[...r.values()],ungrouped:i.objectIds.length?i:null,objectToSection:s}}function Un(e){return pt(e,null)}function ht(e){return pt(e,dt(e))}function bt(e,t){return t.has(e.id)||!!e.logicalSectionId&&t.has(e.logicalSectionId)||!!e.zone&&t.has(e.zone)}function mt(e,t){let n=new Set;if(!t.size)return n;let{sections:o,ungrouped:r,objectToSection:i}=ht(e),s=new Set,u=new Map(o.map(b=>[b.id,b.zone]));for(let b of o){let c=u.get(b.id);(t.has(b.id)||c&&t.has(c))&&s.add(b.id)}let l=!!r&&t.has(ae);for(let[b,c]of i)(s.has(c)||l&&c===ae)&&n.add(b);return n}function Hn(e,t){if(!t.size)return e;let n=mt(e,t),o=t instanceof Set?t:new Set(t),r=s=>!(n.has(s.id)||s.type==="section"&&bt(s,o));if(e.floors&&e.floors.length){let s=!1,u=e.floors.map(l=>{let b=l.objects.filter(r);return b.length!==l.objects.length&&(s=!0),b.length===l.objects.length?l:{...l,objects:b}});return s?{...e,floors:u,objects:u[0].objects}:e}let i=e.objects.filter(r);return i.length===e.objects.length?e:{...e,objects:i}}0&&(module.exports={DEFAULT_SECTION_CORNER_SMOOTHING,MAX_EDGE_SAGITTA_RATIO,TIER_HEIGHT_M,UNGROUPED_ID,applyHidden,arcLevelAt,bearingDeg,buildSectionRake,computeSections,computeSectionsPerFloor,cornerSmoothingThresholdDeg,distanceToPolyline,fitBowlProfile,fitCircle,hiddenObjectIds,indexLabel,isSectionHidden,logicalNumberingRow,reflectEdgeCurvature,relabelRows,resolveSection,reverseSectionOutlinePath,sampleSectionOutlinePath,seatConfidenceDisclosure,seatDisplayLabel,seatInventoryLabel,seatLabelPart,sectionCornerSmoothingPath,sectionEntrancesById,sectionGeometry,sectionIdentitiesById,sectionLabelsById,sectionOutlinePathFrom,sectionOwnersByObject,sectionPathSegmentEnd,toBijectiveBase,toLetters,toRoman,transformSectionOutlinePath,translateSectionOutlinePath,validSectionOutlinePath});
|
|
1
|
+
"use strict";var le=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var xt=Object.getOwnPropertyNames;var St=Object.prototype.hasOwnProperty;var wt=(e,t)=>{for(var n in t)le(e,n,{get:t[n],enumerable:!0})},Mt=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xt(t))!St.call(e,r)&&r!==n&&le(e,r,{get:()=>t[r],enumerable:!(o=gt(t,r))||o.enumerable});return e};var vt=e=>Mt(le({},"__esModule",{value:!0}),e);var zn={};wt(zn,{DEFAULT_SECTION_CORNER_SMOOTHING:()=>ze,MAX_EDGE_SAGITTA_RATIO:()=>We,TIER_HEIGHT_M:()=>we,UNGROUPED_ID:()=>ae,applyHidden:()=>Vn,arcLevelAt:()=>Ft,bearingDeg:()=>_e,buildSectionRake:()=>Kt,computeSections:()=>Hn,computeSectionsPerFloor:()=>bt,cornerSmoothingThresholdDeg:()=>$e,distanceToPolyline:()=>fe,fitBowlProfile:()=>jt,fitCircle:()=>te,hiddenObjectIds:()=>yt,indexLabel:()=>ke,isSectionHidden:()=>mt,logicalNumberingRow:()=>Fe,reflectEdgeCurvature:()=>un,relabelRows:()=>Ht,resolveSection:()=>Tt,reverseSectionOutlinePath:()=>mn,sampleSectionOutlinePath:()=>an,seatConfidenceDisclosure:()=>en,seatDisplayLabel:()=>be,seatDisplayParts:()=>Be,seatInventoryLabel:()=>he,seatLabelPart:()=>ie,sectionCornerSmoothingPath:()=>pn,sectionEntrancesById:()=>Gn,sectionGeometry:()=>et,sectionIdentitiesById:()=>Ce,sectionLabelsById:()=>Un,sectionOutlinePathFrom:()=>Ke,sectionOwnersByObject:()=>pt,sectionPathSegmentEnd:()=>sn,toBijectiveBase:()=>de,toLetters:()=>q,toRoman:()=>pe,transformSectionOutlinePath:()=>Ve,translateSectionOutlinePath:()=>ln,validSectionOutlinePath:()=>ge});module.exports=vt(zn);function Ee(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 fe(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],s=e[r+1],u=s.x-i.x,l=s.y-i.y,b=u*u+l*l,c=b>1e-12?((t-i.x)*u+(n-i.y)*l)/b:0;c<0?c=0:c>1&&(c=1);let p=t-(i.x+c*u),d=n-(i.y+c*l);if(Math.abs(p)>=o||Math.abs(d)>=o)continue;let f=Math.hypot(p,d);f<o&&(o=f)}return o}function It(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let s=Math.hypot(i.x-t,i.y-n);s>r&&(r=s)}return{cx:t,cy:n,r}}function Oe(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function ue(e,t){let n=1/0;for(let o of Ee(e)){let r=fe(t,o.x,o.y);r<n&&(n=r)}for(let o of Ee(t)){let r=fe(e,o.x,o.y);r<n&&(n=r)}return n}function Pt(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let c of e)n+=c.x,o+=c.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let c of e){let p=Math.hypot(c.x-n,c.y-o);p>r&&(r=p,i=c)}let s=i.x-n,u=i.y-o,l=Math.hypot(s,u);l>1e-9?(s/=l,u/=l):(s=1,u=0);let b=e.map((c,p)=>({p:c,i:p,t:(c.x-n)*s+(c.y-o)*u})).sort((c,p)=>c.t-p.t);return{pts:b.map(c=>c.p),seatIndices:b.map(c=>t[c.i])}}function te(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let k of e)n+=k.x,o+=k.y;n/=t,o/=t;let r=0,i=0,s=0,u=0,l=0,b=0,c=0;for(let k of e){let E=k.x-n,g=k.y-o;r+=E*E,s+=g*g,i+=E*g,u+=E*E*E,l+=g*g*g,b+=E*g*g,c+=g*E*E}let p=r*s-i*i;if(Math.abs(p)<1e-9)return null;let d=(u+b)/2,f=(l+c)/2,h=(d*s-f*i)/p,R=(f*r-d*i)/p,I=h+n,O=R+o;return!Number.isFinite(I)||!Number.isFinite(O)?null:{cx:I,cy:O}}var At=.15;function Rt(e){if(e.length<2)return null;let t=e.map(M=>{let a=0,m=0;for(let S of M.pts)a+=S.x,m+=S.y;return{x:a/M.pts.length,y:m/M.pts.length}}),n=0,o=0;for(let M of t)n+=M.x,o+=M.y;n/=t.length,o/=t.length;let r=0,i=0,s=0;for(let M of t){let a=M.x-n,m=M.y-o;r+=a*a,i+=a*m,s+=m*m}let u=r+s,l=r*s-i*i,b=u/2+Math.sqrt(Math.max(0,u*u/4-l)),c,p;Math.abs(i)>1e-12?(c=b-s,p=i):r>=s?(c=1,p=0):(c=0,p=1);let d=Math.hypot(c,p);if(!(d>1e-12))return null;c/=d,p/=d;let f=0,h=0,R=0;for(let M of e){if(M.pts.length<2)continue;let a=M.pts[0],m=M.pts[M.pts.length-1],S=m.x-a.x,x=m.y-a.y,C=Math.hypot(S,x);if(!(C>1e-9))continue;let B=S/C,A=x/C;f+=(B*B-A*A)*C,h+=2*B*A*C,R+=C}if(R>0&&Math.hypot(f,h)>=Et*R){let M=Math.atan2(h,f)/2,a=Math.cos(M),m=Math.sin(M);Math.abs(c*a+p*m)>Ot&&(c=-m,p=a)}let I=1/0,O=-1/0,k=[];for(let M of e){let a=1/0,m=-1/0;for(let S of M.pts){let x=S.x*c+S.y*p;x<a&&(a=x),x>m&&(m=x),x<I&&(I=x),x>O&&(O=x)}k.push(m-a)}let E=O-I;return E>1e-9?(k.sort((M,a)=>M-a),k[Math.min(k.length-1,Math.floor(k.length*.9))]/E<=Ct?{x:c,y:p}:null):null}var Ct=.35,Et=.8,Ot=.7;function Tt(e,t,n,o){let r=new Map;for(let a of n){let m=t[a],S=m.rowId||`__seat-${a}`,x=r.get(S);x||(x={pts:[],idx:[]},r.set(S,x)),x.pts.push({x:m.x,y:m.y}),x.idx.push(a)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[a,m]of r){let S=Pt(m.pts,m.idx),x=0;for(let C of S.pts)x+=Math.hypot(C.x-o.x,C.y-o.y);i.push({id:a,pts:S.pts,seatIndices:S.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:x/S.pts.length})}let s=i.map(a=>It(a.pts)),u=i.length<=256?i.length*(i.length-1)/2:0,l=u?new Float64Array(u):null;l?.fill(Number.NaN);let b=l?new Map(i.map((a,m)=>[a,m])):null,c=(a,m)=>(a>m&&([a,m]=[m,a]),a*(2*i.length-a-1)/2+(m-a-1)),p=(a,m)=>{if(!l)return ue(i[a].pts,i[m].pts);let S=c(a,m),x=l[S];if(!Number.isNaN(x))return x;let C=ue(i[a].pts,i[m].pts);return l[S]=C,C},d=(a,m)=>b?p(b.get(a),b.get(m)):ue(a.pts,m.pts),f=[];for(let a=0;a<i.length;a++){let m=1/0;for(let S=0;S<i.length;S++){if(a===S||Oe(s[a],s[S])>=m)continue;let x=p(a,S);x<m&&(m=x)}Number.isFinite(m)&&f.push(m)}f.sort((a,m)=>a-m);let h=f.length?f[Math.floor(f.length/2)]:1,R=Math.max(h*1.8,1e-6),I=i.map(()=>[]);for(let a=0;a<i.length;a++)for(let m=a+1;m<i.length;m++)Oe(s[a],s[m])>R||p(a,m)<=R&&(I[a].push(m),I[m].push(a));let O=0;for(let a=0;a<i.length;a++){if(i[a].blockId!==-1)continue;let m=O++,S=[a];for(i[a].blockId=m;S.length;){let x=S.pop();for(let C of I[x])i[C].blockId===-1&&(i[C].blockId=m,S.push(C))}}let k=new Map;for(let a of i){let m=k.get(a.blockId)??[];m.push(a),k.set(a.blockId,m)}let E=[];for(let a of i){if(a.pts.length<4)continue;let m=te(a.pts);m&&(!Number.isFinite(m.cx)||!Number.isFinite(m.cy)||E.push({x:m.cx,y:m.cy}))}let g=E.length>=2?(()=>{let a=E.map(x=>x.x).sort((x,C)=>x-C),m=E.map(x=>x.y).sort((x,C)=>x-C),S=Math.floor(E.length/2);return{cx:a[S],cy:m[S]}})():null;if(g){let a=A=>Math.hypot(A.x-g.cx,A.y-g.cy),m=1/0,S=-1/0,x=[];for(let A of i){let y=1/0,w=-1/0;for(let T of A.pts){let L=a(T);L<y&&(y=L),L>w&&(w=L)}x.push(w-y),y<m&&(m=y),w>S&&(S=w)}let C=S-m;x.sort((A,y)=>A-y);let B=x[Math.min(x.length-1,Math.floor(x.length*.9))];if(C>1e-9&&B/C<=At){let A=i.map(P=>{let j=0;for(let $ of P.pts)j+=a($);return{row:P,radius:j/P.pts.length}}),y=0,w=0;for(let P of A)y+=P.radius,w+=P.row.focalDistance;y/=A.length,w/=A.length;let T=0;for(let P of A)T+=(P.radius-y)*(P.row.focalDistance-w);if(T<0)for(let P of A)P.radius=-P.radius;let G=1/0;for(let P of A)P.radius<G&&(G=P.radius);A.sort((P,j)=>P.radius-j.radius);let z=-1,_=-1/0,V=C/Math.max(1,A.length)*.5,U=[];for(let P of A)P.radius-_>V&&(z++,_=P.radius),P.row.ordinal=z,P.row.blockDepth=P.radius-G,U.push(P.row);return{sectionId:e,rows:U,blockCount:O}}}let M=[];for(let[,a]of k){let m=Rt(a);if(m){let S=A=>{let y=0;for(let w of A.pts)y+=w.x*m.x+w.y*m.y;return y/A.pts.length};a.sort((A,y)=>S(A)-S(y)),a.length>=2&&a[0].focalDistance>a[a.length-1].focalDistance&&a.reverse();let x=[],C=h*.5;for(let A of a){let y=x[x.length-1];y&&Math.abs(S(A)-S(y[0]))<C?y.push(A):x.push([A])}let B=0;for(let A=0;A<x.length;A++){if(A>0){let y=1/0;for(let w of x[A-1])for(let T of x[A])y=Math.min(y,d(w,T));B+=y}for(let y of x[A])y.ordinal=A,y.blockDepth=B,M.push(y)}}else{let S=1/0;for(let x of a)x.focalDistance<S&&(S=x.focalDistance);a.sort((x,C)=>x.focalDistance-C.focalDistance);for(let x=0;x<a.length;x++)a[x].ordinal=x,a[x].blockDepth=Math.max(0,a[x].focalDistance-S),M.push(a[x])}}return{sectionId:e,rows:M,blockCount:O}}var _t=Math.PI/180,N=96,Nt=6,kt=60,Lt=150,Te=.2,Dt=.35;function _e(e,t){let n=Math.atan2(t.x-e.x,t.y-e.y)/_t;return n<0?n+360:n}function ne(e){if(!e.length)return NaN;let t=[...e].sort((n,o)=>n-o);return t[Math.floor(t.length/2)]}function oe(e,t,n=2){let o=e.length,r=new Float64Array(o);for(let i=0;i<o;i++){let s=0,u=0;for(let l=-n;l<=n;l++){let b=i+l;if(t)b=(b%o+o)%o;else if(b<0||b>=o)continue;s+=e[b],u++}r[i]=s/u}return r}function jt(e,t){let n=e.filter(d=>d.rows.length>=1);if(n.length<1)return null;let o=[],r=0,i=0,s=0;for(let d of n)for(let f of d.rows){for(let h of f.pts)r+=h.x,i+=h.y,s++;if(f.pts.length>=4){let h=te(f.pts);h&&Number.isFinite(h.cx)&&Number.isFinite(h.cy)&&o.push({x:h.cx,y:h.cy})}}if(!s)return null;let u={x:r/s,y:i/s},l=u;if(o.length>=8){let d=ne(o.map(O=>O.x)),f=ne(o.map(O=>O.y)),h=0;for(let O of n)for(let k of O.rows)for(let E of k.pts){let g=Math.hypot(E.x-u.x,E.y-u.y);g>h&&(h=g)}let R=0,I=h*.2;for(let O of n)for(let k of O.rows)for(let E of k.pts)Math.hypot(E.x-d,E.y-f)<I&&R++;Math.hypot(d-u.x,f-u.y)<=h&&R/s<.01&&(l={x:d,y:f})}let b=[];for(let d of n){let f={sectionId:d.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let h of d.rows)for(let R of h.pts){let I=Math.hypot(R.x-l.x,R.y-l.y),O=Math.min(N-1,Math.floor(_e(l,R)/(360/N)));f.samples.push({r:I,bin:O,levelM:h.levelM}),I<f.rMin&&(f.rMin=I),I>f.rMax&&(f.rMax=I)}f.samples.length&&b.push(f)}if(!b.length)return null;b.sort((d,f)=>d.rMin+d.rMax-(f.rMin+f.rMax));let c=[];for(let d of b){let f=!1;for(let h of c){let R=Math.min(d.rMax,h.rMax)-Math.max(d.rMin,h.rMin),I=Math.min(d.rMax-d.rMin,h.rMax-h.rMin);if(I>1e-9&&R>=Dt*I){h.members.push(d),h.rMin=Math.min(h.rMin,d.rMin),h.rMax=Math.max(h.rMax,d.rMax),f=!0;break}}f||c.push({members:[d],rMin:d.rMin,rMax:d.rMax})}let p=[];for(let d of c){let f=new Array(N).fill(null);for(let y of d.members)for(let w of y.samples){let T=f[w.bin];T||(T={samples:[]},f[w.bin]=T),T.samples.push({r:w.r,levelM:w.levelM})}let h=f.map(y=>!!y);if(!h.filter(Boolean).length)continue;let I=[],O=[];for(let y of f){if(!y)continue;let w=1/0,T=-1/0;for(let L of y.samples)L.r<w&&(w=L.r),L.r>T&&(T=L.r);I.push(w),O.push(T)}let k=ne(I),E=ne(O);if(!(k>=Te*E)||!(E>0))continue;let g=[...I].sort((y,w)=>y-w);if(!(g[Math.floor(g.length*.1)]>=Te*E))continue;let a=f.map(y=>{if(!y)return null;let w=[...y.samples].sort((P,j)=>P.r-j.r),T=w[0].r,L=w[w.length-1].r,G=w[0].levelM,z=-1/0;for(let P of w)P.levelM>z&&(z=P.levelM);let _=[];for(let P of w){let j={r:P.r,l:P.levelM};for(;_.length&&Math.abs(_[_.length-1].r-j.r)<1e-9;){if(_[_.length-1].l<=j.l){j.skip=!0;break}_.pop()}if(!j.skip){for(;_.length>=2;){let $=_[_.length-2],K=_[_.length-1];if((K.r-$.r)*(j.l-$.l)-(K.l-$.l)*(j.r-$.r)<=0)_.pop();else break}_.push(j)}}let V=_.map(P=>P.r),U=_.map(P=>P.l);return{inner:T,outer:L,front:G,top:z,profile:{rs:V,ls:U}}}),m=h.slice();for(let y=0;y<N;y++){if(m[y])continue;let w=-1,T=-1,L=0;for(let v=1;v<=N;v++){let D=(y-v+N*2)%N;if(m[D]){w=D;break}}for(let v=1;v<=N;v++){let D=(y+v)%N;if(m[D]){T=D,L=v;break}}if(w<0||T<0)continue;let G=0;for(let v=1;v<=N;v++){let D=(y-v+N*2)%N;if(h[D]){G=v;break}}if(G-1+L>Nt)continue;let _=a[w],V=a[T],U=G/(G+L),P=_.inner+(V.inner-_.inner)*U,j=_.outer+(V.outer-_.outer)*U,$=_.front+(V.front-_.front)*U,K=_.top+(V.top-_.top)*U;a[y]={inner:P,outer:j,front:$,top:K,profile:{rs:[P,j],ls:[$,K]}}}for(let y=0;y<N;y++)a[y]&&(m[y]=!0);let S=360/N,x=[],C=m.filter(Boolean).length,B=[];if(C===N)B.push({start:0,len:N});else{let y=0;for(;m[y];)y=(y+1)%N;let w=-1;for(let T=0;T<=N;T++){let L=(y+T)%N,G=T<N&&m[L];if(G&&w<0)w=L;else if(!G&&w>=0){let z=(L-w+N)%N||N;B.push({start:w,len:z}),w=-1}}}for(let y of B){if(y.len*S<kt&&y.len<N)continue;let w=y.len===N,T=new Float64Array(y.len),L=new Float64Array(y.len),G=new Float64Array(y.len),z=new Float64Array(y.len),_=[];for(let v=0;v<y.len;v++){let D=a[(y.start+v)%N];T[v]=D.inner,L[v]=D.outer,G[v]=D.front,z[v]=D.top,_.push(D.profile??{rs:[D.inner,D.outer],ls:[D.front,D.top]})}let V=oe(T,w),U=oe(L,w),P=oe(G,w),j=oe(z,w);for(let v=0;v<y.len;v++)V[v]>T[v]&&(V[v]=T[v]),U[v]<L[v]&&(U[v]=L[v]),V[v]>U[v]-1e-6&&(V[v]=Math.max(0,U[v]-1e-6)),j[v]<P[v]&&(j[v]=P[v]);let $={startBin:y.start,binCount:y.len,closed:w,innerR:V,outerR:U,frontLevelM:P,topLevelM:j,profiles:_},K=(v,D,H)=>{let Z=_[v],X=Z.rs,W=Z.ls;if(D<=X[0]){W[0]>H&&(W[0]=H);return}if(D>=X[X.length-1]){W[W.length-1]>H&&(W[W.length-1]=H);return}for(let Y=0;Y+1<X.length;Y++)if(D<=X[Y+1]){W[Y]>H&&(W[Y]=H),W[Y+1]>H&&(W[Y+1]=H);return}};for(let v=0;v<y.len;v++){let D=f[(y.start+v)%N];if(D)for(let H of D.samples){K(v,H.r,H.levelM);let Z=w?(v-1+y.len)%y.len:v-1,X=w?(v+1)%y.len:v+1;Z>=0&&K(Z,H.r,H.levelM),X<y.len&&K(X,H.r,H.levelM)}}x.push($)}x.reduce((y,w)=>y+w.binCount*S,0)<Lt||p.push({arcs:x,sectionIds:d.members.map(y=>y.sectionId),innerRMedian:k,outerRMedian:E})}if(!p.length)return null;if(p.sort((d,f)=>d.innerRMedian-f.innerRMedian),t){let d=p[p.length-1].outerRMedian;if(Math.hypot(t.x-l.x,t.y-l.y)>.9*d)return null}return{centre:l,binCount:N,binStepDeg:360/N,rings:p}}function Ft(e,t,n,o){let r=e.binStepDeg,i=n/r-.5-t.startBin;i=(i%e.binCount+e.binCount)%e.binCount,i>t.binCount-1&&(t.closed?i=i-t.binCount<t.binCount-i?0:t.binCount-1:i=i-(t.binCount-1)<e.binCount-i?t.binCount-1:0);let s=Math.floor(i),u=t.closed?(s+1)%t.binCount:Math.min(t.binCount-1,s+1),l=i-s,b=c=>{let p=t.profiles[c],d=p.rs,f=p.ls;if(o<=d[0])return f[0];if(o>=d[d.length-1])return f[f.length-1];for(let h=0;h+1<d.length;h++)if(o<=d[h+1]){let R=d[h+1]-d[h],I=R>1e-9?(o-d[h])/R:0;return f[h]+(f[h+1]-f[h])*I}return f[f.length-1]};return b(s)*(1-l)+b(u)*l}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Bt="ABCDEFGHJKLMNPQRSTUVWXYZ",Gt="abcdefghijklmnopqrstuvwxyz";function de(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function ke(e,t){let n=t.startAt-1,o=e+n;if(t.scheme==="numbers")return String(o+1);let r=t.skipAmbiguous?Bt:Ne;return de(o,r)}function q(e,t=!1){let n=t?Gt:Ne;return de(Math.max(0,Math.floor(e)-1),n)}var Ut=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function pe(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Ut)for(;t>=o;)n+=r,t-=o;return n}function Ht(e,t){let n=e.length;return e.map((o,r)=>{let i=t.reverse?n-1-r:r;return{...o,label:ke(i,t)}})}function Vt(e){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(t,n)=>Math.hypot(t-e.x,n-e.y),gradientAt:(t,n)=>{let o=t-e.x,r=n-e.y,i=Math.hypot(o,r);return i<1e-9?[0,0]:[o/i,r/i]}}}function zt(e,t){if(!e.length)return null;let n=0,o=0,r=0;for(let f of e)n+=f.x,o+=f.y,r+=Math.hypot(f.x-t.x,f.y-t.y);let i=e.length;n/=i,o/=i,r/=i;let s=e[0],u=-1;for(let f of e){let h=Math.hypot(f.x-n,f.y-o);h>u&&(u=h,s=f)}let l=s.x-n,b=s.y-o,c=Math.hypot(l,b);c>1e-9?(l/=c,b/=c):(l=1,b=0);let p=[...e].sort((f,h)=>(f.x-n)*l+(f.y-o)*b-((h.x-n)*l+(h.y-o)*b)),d=0;for(let f of p){let h=Math.hypot(f.x-n,f.y-o);h>d&&(d=h)}return{pts:p,cx:n,cy:o,radius:d,depth:r}}function Le(e,t,n){let o=e.pts;if(o.length===1)return Math.hypot(t-o[0].x,n-o[0].y);let r=1/0;for(let i=0;i+1<o.length;i++){let s=o[i],u=o[i+1],l=u.x-s.x,b=u.y-s.y,c=l*l+b*b,p=c>1e-12?((t-s.x)*l+(n-s.y)*b)/c:0;p<0?p=0:p>1&&(p=1);let d=Math.hypot(t-(s.x+p*l),n-(s.y+p*b));d<r&&(r=d)}return r}var re=8;function $t(e,t,n){let o=new Array(re).fill(1/0),r=new Array(re).fill(-1);for(let c=0;c<e.length;c++){let p=e[c],d=Math.hypot(t-p.cx,n-p.cy)-p.radius;for(let f=0;f<re;f++)if(d<o[f]){for(let h=re-1;h>f;h--)o[h]=o[h-1],r[h]=r[h-1];o[f]=d,r[f]=c;break}}let i=new Array(3).fill(1/0),s=new Array(3).fill(-1);for(let c of r){if(c<0)continue;let p=Le(e[c],t,n);for(let d=0;d<3;d++)if(p<i[d]){for(let f=2;f>d;f--)i[f]=i[f-1],s[f]=s[f-1];i[d]=p,s[d]=c;break}}if(s[0]<0)return 0;if(i[0]<1e-6)return e[s[0]].depth;let u=i[0]*2.2,l=0,b=0;for(let c=0;c<3;c++){let p=s[c];if(p<0||i[c]>u)continue;let d=1/(i[c]*i[c]);l+=d*e[p].depth,b+=d}return b>0?l/b:e[s[0]].depth}function Wt(e){let t=(o,r)=>$t(e,o,r),n=(o,r)=>{let i=1/0,s=-1;for(let u=0;u<e.length;u++){let l=e[u];if(Math.hypot(o-l.cx,r-l.cy)-l.radius>=i)continue;let b=Le(l,o,r);b<i&&(i=b,s=u)}return s};return{kind:"rows",rowCount:e.length,rows:e,nearestRow:n,depthAt:t,gradientAt:(o,r)=>{let i=(t(o+.5,r)-t(o-.5,r))/1,s=(t(o,r+.5)-t(o,r-.5))/(2*.5),u=Math.hypot(i,s);return u<1e-9?[0,0]:[i/u,s/u]}}}function Kt(e,t){let n=[];for(let o of e){let r=zt(o.points,t);r&&n.push(r)}return n.length<2?Vt(t):(n.sort((o,r)=>o.depth-r.depth),Wt(n))}var Xt=/^\d{4}-\d{2}-\d{2}$/;function Yt(e){let t=Date.parse(e);return Number.isFinite(t)?Xt.test(e)?t+864e5:t:null}function De(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=Yt(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function je(e){return e.status!=="draft"&&e.status!=="retracted"}function qt(e){return e==="exact-seat"?"Exact seat in the model":e==="row-representative"?"Representative row evidence":e==="section-representative"?"Representative section evidence":e==="floor-representative"?"Representative floor evidence":"Representative venue evidence"}function Jt(e){if(!e)return"No assessment date supplied";let t=new Date(e);return Number.isFinite(t.getTime())?`Assessed ${t.toISOString().slice(0,10)}`:"No assessment date supplied"}function Qt(){return{headline:"Generated view \xB7 unverified",model:"No geometry or event-configuration verification supplied",reality:"No real-world check supplied",coverage:"Selected chart seat",provenance:"Chart-derived model",freshness:"No current organizer-approved evidence matches this Event, venue revision, or renewal window",limitations:["Generated view is not surveyed sightline truth."]}}function Zt(e){let t=Jt(e.assessedAt);if(!e.validUntil)return t;let n=Date.parse(e.validUntil);return Number.isFinite(n)?`${t} \xB7 valid until ${e.validUntil.slice(0,10)}`:t}function en(e,t={}){if(!e||!je(e)||!De(e,t.now))return Qt();let n=e.evidenceKind==="synthetic-model",o=e.modelLevel==="configuration-verified"?"Event configuration verified":e.modelLevel==="geometry-verified"?"Venue geometry verified":n?"Versioned synthetic model":"Generated model \xB7 not verified",r=e.realityLevel==="actual-build-checked"?"Actual event build reality checked":e.realityLevel==="comparable-build-reference"?"Comparable-build reference only":"No real-world check supplied",i=n?"Synthetic model evidence":e.modelLevel==="configuration-verified"?"Configuration verified":e.modelLevel==="geometry-verified"?"Geometry verified":"Generated view \xB7 unverified",s=[...e.limitations??[],...n?["Synthetic demo; not surveyed or venue-certified."]:[]],u=e.modeledTarget?`${e.modeledTarget.label} \xB7 ${e.modeledTarget.clearRayCount}/${e.modeledTarget.totalRayCount} target rays clear \xB7 ${e.modeledTarget.classification} in bounded model \xB7 ${e.modeledTarget.methodLabel}`+(e.modeledTarget.occluderLabels?.length?` \xB7 modeled occluders: ${e.modeledTarget.occluderLabels.join(", ")}`:""):void 0;return u&&s.push("Modeled target is not a percentage of the show visible."),{headline:i,model:o,reality:r,coverage:qt(e.coverage),provenance:e.sourceLabel??e.approvedByRole??"Source not supplied",freshness:Zt(e),limitations:s,...u?{modeledTarget:u}:{}}}function tn(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function ie(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",s=e.seatNumbering?.prefix??"",u=e.seatNumbering?.endAt,l=e.seatCount;if(i==="updown"||i==="updown-descending"){let f=Math.ceil(l/2),h=i==="updown"?t<f?n+2*t:n-1+2*(l-t):t<f?n+2*(f-1-t):n+1+2*(t-f);return`${s}${h}`}let b=i==="odd"||i==="even"?2:r,c=u!=null&&Number.isFinite(u)?u-(l-1)*b:n,p=o==="center"?tn(l)[t]:o==="rtl"?l-1-t:t,d;switch(i){case"odd":{let f=c%2===1?c:c+1;d=String(f+p*2);break}case"even":{let f=c%2===0?c:c+1;d=String(f+p*2);break}case"roman":d=pe(c+p*r);break;case"letters-upper":d=q(c+p*r,!1);break;case"letters-lower":d=q(c+p*r,!0);break;default:d=String(c+p*r);break}return`${s}${d}`}function Fe(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function he(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${ie(e,t)}`}function Be(e,t,n,o){if(o?.displayLabel)return null;if(e.seatDisplayLabelMode==="number"||!n)return{row:e.displayLabel||e.label,seat:ie(e,t)};let r=Fe(n);return{row:n.displayLabel,seat:ie(r,n.displayOffset+t)}}function be(e,t,n,o){let r=Be(e,t,n,o);return r?e.seatDisplayLabelMode==="number"?r.seat:`${r.row}-${r.seat}`:o.displayLabel}function nn(e,t,n){return Math.max(t,Math.min(n,e))}function on(e){return nn(e,0,1)}function Ge(e){let t=on(e);return t*t*(3-2*t)}var oo=Math.PI/180;function F(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function me(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}var J=Math.PI*2;function Q(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function rn(e,t,n){let o=t-e;if(n){for(;o<0;)o+=J;for(;o>=J;)o-=J}else{for(;o>0;)o-=J;for(;o<=-J;)o+=J}return o}function sn(e){return e.end}function ge(e){if(e.version!==1||e.closed!==!0||!Q(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!Q(n.end))return!1;if(n.kind==="line"){if(F(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!Q(n.control1)||!Q(n.control2)||F(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!Q(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(F(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(F(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||F(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return F(t,e.start)<=1e-4}function cn(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function an(e,t=2){if(!ge(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let s=Math.atan2(r.y-i.center.y,r.x-i.center.x),u=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),l=rn(s,u,i.clockwise),b=Math.max(2,Math.ceil(Math.abs(l)*i.radius/n));for(let c=1;c<=b;c+=1){let p=s+l*c/b;o.push({x:i.center.x+Math.cos(p)*i.radius,y:i.center.y+Math.sin(p)*i.radius})}}else{let s=F(r,i.control1)+F(i.control1,i.control2)+F(i.control2,i.end),u=Math.max(2,Math.ceil(s/n));for(let l=1;l<=u;l+=1)o.push(cn(r,i,l/u))}r=i.end}return F(o[o.length-1],o[0])<=1e-4&&o.pop(),o}function ln(e,t,n){return Ve(e,r=>({x:r.x+t,y:r.y+n}))}function Ve(e,t,n=1,o=!1){return{...e,start:t(e.start),segments:e.segments.map(r=>r.kind==="line"?{...r,end:t(r.end)}:r.kind==="arc"?{...r,center:t(r.center),radius:r.radius*Math.abs(n),clockwise:o?!r.clockwise:r.clockwise,end:t(r.end)}:{...r,control1:t(r.control1),control2:t(r.control2),end:t(r.end)})}}function un(e){return e.map(t=>t===0?0:-t)}var ze=45,ye=150,fn=60;function $e(e){let t=ze/100;if(e<=t)return ye;let n=Math.min(1,(e-t)/(1-t));return ye-n*(ye-fn)}var Ue=.5523;function He(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function dn(e){let t=[],n=[];for(e.forEach((o,r)=>{Q(o)&&(t.length&&He(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&He(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function pn(e,t,n){return Ke(e,{cornerSmoothing:t,...n})}var We=.5,hn=4/3;function bn(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let s=-r/i,u=o/i,l=n*hn;return{kind:"bezier",control1:{x:e.x+o/3+s*l,y:e.y+r/3+u*l},control2:{x:e.x+o*2/3+s*l,y:e.y+r*2/3+u*l},end:{...t}}}function Ke(e,t){let{points:n,sourceIndex:o}=dn(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,s=t.edgeCurvature,u=new Array(r).fill(0);if(s?.length)for(let g=0;g<r;g+=1){let M=s[o[g]];u[g]=Number.isFinite(M)?Math.min(100,Math.max(-100,M))/100:0}let l=u.some(g=>Math.abs(g)>1e-6);if(i<=0&&!l)return null;let b=t.wideAngleThresholdDeg??$e(i),c=[];for(let g=0;g<r;g+=1)c[g]=F(n[g],n[(g+1)%r]);let p=new Array(r).fill(0);for(let g=0;g<r;g+=1){let M=n[(g-1+r)%r],a=n[g],m=n[(g+1)%r],S={x:M.x-a.x,y:M.y-a.y},x={x:m.x-a.x,y:m.y-a.y},C=Math.hypot(S.x,S.y),B=Math.hypot(x.x,x.y);if(C<=1e-9||B<=1e-9)continue;let A=Math.min(1,Math.max(-1,(S.x*x.x+S.y*x.y)/(C*B))),y=Math.acos(A)*180/Math.PI;if(y<b)continue;let w=Ge((y-b)/(180-b));p[g]=i*w*.5*Math.min(C,B)}for(let g=0;g<r;g+=1){let M=(g+1)%r,a=p[g]+p[M];if(a>c[g]&&a>1e-9){let m=c[g]/a;p[g]*=m,p[M]*=m}}let d=new Array(r),f=new Array(r);for(let g=0;g<r;g+=1){let M=n[(g-1+r)%r],a=n[g],m=n[(g+1)%r];if(p[g]<=1e-6){d[g]={...a},f[g]={...a};continue}let S=F(a,M)||1,x=F(a,m)||1;d[g]={x:a.x+(M.x-a.x)/S*p[g],y:a.y+(M.y-a.y)/S*p[g]},f[g]={x:a.x+(m.x-a.x)/x*p[g],y:a.y+(m.y-a.y)/x*p[g]}}if(p.every(g=>g<=1e-6)&&!l)return null;let h=[],R={...f[0]},I=R,O=(g,M)=>{if(F(I,g)<=1e-9)return;let a=u[M];Math.abs(a)>1e-6?h.push(bn(I,g,a*We*c[M])):h.push({kind:"line",end:{...g}}),I=g};for(let g=1;g<=r;g+=1){let M=g%r,a=n[M];O(d[M],(g-1)%r),p[M]>1e-6&&F(d[M],f[M])>1e-9&&(h.push({kind:"bezier",control1:me(d[M],a,Ue),control2:me(f[M],a,Ue),end:{...f[M]}}),I=f[M])}if(!h.length)return null;let k=h[h.length-1];F(k.end,R)>1e-9&&(k.kind==="line"?k.end={...R}:h.push({kind:"line",end:{...R}}));let E={version:1,closed:!0,start:R,segments:h};return ge(E)?E:null}function mn(e){let t=[],n=e.start;for(let r of e.segments)t.push(n),n=r.end;let o=[];for(let r=e.segments.length-1;r>=0;r-=1){let i=e.segments[r],s=t[r];i.kind==="line"?o.push({kind:"line",end:{...s}}):i.kind==="arc"?o.push({kind:"arc",center:{...i.center},radius:i.radius,clockwise:!i.clockwise,end:{...s}}):o.push({kind:"bezier",control1:{...i.control2},control2:{...i.control1},end:{...s}})}return{version:1,closed:!0,start:{...e.start},segments:o}}function Xe(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,s=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+s*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+s*e.end.y}}function Ye(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[Xe(e,.5)];let o=Array.from({length:n+1},(l,b)=>Xe(e,b/n)),r=new Float64Array(o.length);for(let l=1;l<o.length;l+=1){let b=o[l].x-o[l-1].x,c=o[l].y-o[l-1].y;r[l]=r[l-1]+Math.hypot(b,c)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let s=[],u=1;for(let l=0;l<t;l+=1){let b=i*l/(t-1);for(;u<r.length-1&&r[u]<b;)u+=1;let c=r[u-1],p=r[u],d=p===c?0:(b-c)/(p-c);s.push({x:o[u-1].x+(o[u].x-o[u-1].x)*d,y:o[u-1].y+(o[u].y-o[u-1].y)*d})}return s}function qe(e,t){return`${e.label}-${t+1}`}function yn(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function gn(e,t){let n=e.chairNumbering,o=n?.start??1,r=yn(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?q(Math.max(1,o)+r):String(o+r)}function Je(e,t){let n=gn(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}var Ze=.02291666666666667,fo=1/Ze,xn=58,we=xn*Ze;var Sn=3,Qe=0,xe=120,wn=0,Mn=45,vn=7;function Se(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function In(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=vn?e:Sn}function et(e,t={}){let n=Se(t.floorBaseHeightM,Qe,xe,0),o=Math.min(xe,n+In(e.elevation)*we),r=e.height===void 0?o:Se(e.height,Qe,xe,o),i=Se(e.rake,wn,Mn,0);return{height:r,rake:i}}function Me(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;var ee=16;function Ie(e,t,n,o){let r=n*se,i=Math.cos(r),s=Math.sin(r);return{x:o.x+e*i-t*s,y:o.y+e*s+t*i}}function rt(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,s=[];if(e.path)return Ye(e.path,t);if(t<=1)return t===1&&s.push({x:i.x,y:i.y}),s;if(o===0){for(let b=0;b<t;b++)s.push(Ie(b*n,0,r,i));return s}let u=o/(t-1)*se,l=n/(2*Math.sin(Math.abs(u)/2));for(let b=0;b<t;b++){let c=b*u,p=l*Math.sin(c),d=-l+l*Math.cos(c);s.push(Ie(p,d,r,i))}return s}function it(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Pn(e,t){let n=it(e);return rt(e).map((o,r)=>{let i=n.get(r),s=Me(i),u=he(e,r,i),l={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:u,displayLabel:be(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:s.length>0,accessibility:s,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(l).some(b=>b!==void 0&&b!==!1&&b!=="")?l:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function st(e){let t=[];for(let n of Pn(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 An(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function Rn(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(c=>[c.index,c])),r=(c,p,d,f)=>{let h=o.get(c),R=Me(h),I=h?.label??qe(e,c);return{index:c,label:I,displayLabel:h?.displayLabel??Je(e,c),x:p+(h?.dx??0),y:d+(h?.dy??0),categoryKey:h?.categoryKey??e.categoryKey,skipped:!!h?.skip,accessible:R.length>0,accessibility:R,wheelchairSpaceType:h?.wheelchairSpaceType,commercial:h?.commercial,glyph:h?.glyph,viewUrl:h?.viewFromSeatUrl,viewMeta:h?.viewFromSeatUrl?h.viewFromSeatMeta:void 0,labelStyle:h?.labelStyle,...f?{side:f}:{}}};if(e.shape==="round"){let c=(e.radius??40)+ee,p=e.rotation*se,d=Math.max(0,Math.min(360,e.seatArc??360));if(d>=360||n===1){for(let I=0;I<n;I++){let O=p+I/n*2*Math.PI;t.push(r(I,e.center.x+c*Math.cos(O),e.center.y+c*Math.sin(O)))}return t}let f=d*se,h=(2*Math.PI-f)/2,R=p+h;for(let I=0;I<n;I++){let O=R+I/(n-1)*f;t.push(r(I,e.center.x+c*Math.cos(O),e.center.y+c*Math.sin(O)))}return t}let i=e.width??80,s=e.height??50,u=An(e),l=["top","bottom","left","right"],b=0;for(let c of l){let p=u[c];for(let d=0;d<p;d++){let f,h;c==="top"?(f=-i/2+(d+.5)*i/p,h=-s/2-ee):c==="bottom"?(f=-i/2+(d+.5)*i/p,h=s/2+ee):c==="left"?(f=-i/2-ee,h=-s/2+(d+.5)*s/p):(f=i/2+ee,h=-s/2+(d+.5)*s/p);let R=Ie(f,h,e.rotation,e.center);t.push(r(b++,R.x,R.y,c))}}return t}function ct(e){return Rn(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 at(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function tt(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,s=t[o].y,u=t[r].x,l=t[r].y;s>e.y!=l>e.y&&e.x<(u-i)*(e.y-s)/(l-s)+i&&(n=!n)}return n}function Cn(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let s=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),u=(r.x-n.x)**2+(r.y-n.y)**2;return s>=-1e-7&&s<=u+1e-7})}function Pe(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function nt(e,t,n){return tt(e,t)&&!Pe(n).some(o=>tt(e,o)||Cn(e,o))}function ve(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function En(e){switch(e.type){case"row":{let t=rt(e),n=it(e),o=0,r=0,i=0;for(let s=0;s<t.length;s++){let u=n.get(s);u?.skip||(o+=t[s].x+(u?.dx??0),r+=t[s].y+(u?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ve(e.points);case"section":return ve(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ve(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 ot(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function On(e,t){if(e.type!=="gaArea"||!ot(e.points,t.outline))return!1;let n=Pe(e.holes),o=Pe(t.holes);return n.length===o.length&&n.every((r,i)=>ot(r,o[i]))}function Ae(e,t,n=e.filter(r=>r.type==="section"),o=En(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(s=>(s.logicalSectionId??s.id)===r&&(On(t,s)||nt(o,s.outline,s.holes))):void 0)??n.find(s=>nt(o,s.outline,s.holes))}function lt(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 ce(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}var ut="__sl_ga__";var Tn=ut,Re=1e5;function _n(e,t){return`${Tn}${encodeURIComponent(e)}__${t+1}`}function Nn(e){let t=e.inventorySegments;if(t===void 0)return!0;if(!Array.isArray(t)||t.length<1||t.length>256)return!1;let n=0,o=new Map;for(let r of t){if(!r||typeof r.sourceAreaId!="string"||!r.sourceAreaId.trim()||r.sourceAreaId.length>160||!Number.isInteger(r.startIndex)||r.startIndex<0||!Number.isInteger(r.count)||r.count<1||r.startIndex+r.count>Re||(n+=r.count,n>Re))return!1;let i=o.get(r.sourceAreaId)??[],s=r.startIndex+r.count;if(i.some(u=>r.startIndex<u.end&&s>u.start))return!1;i.push({start:r.startIndex,end:s}),o.set(r.sourceAreaId,i)}return n===e.capacity}function kn(e){let t=Math.min(Re,Math.max(0,Math.floor(e.capacity)));return e.inventorySegments===void 0?t?[{sourceAreaId:e.id,startIndex:0,count:t}]:[]:Nn(e)?e.inventorySegments.map(n=>({...n})):[]}var Ln=100,vo=`An area sold to one party holds at most ${Ln} guests.`;function Dn(e){return e.variableOccupancy?"variable":e.bookAsWhole?"whole":null}function ft(e){return jn(e,2)}function jn(e,t){return t===2&&Dn(e)&&e.inventorySegments===void 0?e.label.trim()?[e.label]:[]:kn(e).flatMap(n=>Array.from({length:n.count},(o,r)=>_n(n.sourceAreaId,n.startIndex+r)))}var ae="__ungrouped__";function Fn(e){return e.type==="row"?st(e).map(t=>t.label):e.type==="table"?ct(e).map(t=>t.label):e.type==="booth"?at(e).map(t=>t.label):e.type==="gaArea"?ft(e):[]}function dt(e){return e.type==="row"||e.type==="table"||e.type==="booth"||e.type==="gaArea"}function Bn(e){return e.displayLabel||e.label||"Section"}function Ce(e){let t=new Map;for(let n of ce(e)){if(n.type!=="section")continue;let o=n.logicalSectionId??n.id;t.has(o)||t.set(o,{id:o,label:Bn(n),zone:n.zone})}return t}function Gn(e){let t=new Map;for(let n of ce(e)){if(n.type!=="section")continue;let o=n.logicalSectionId??n.id,r=n.entrance?.trim();r&&!t.has(o)&&t.set(o,r)}return t}function Un(e){let t=new Map;for(let[n,o]of Ce(e))t.set(n,o.label);return t}function pt(e){let t=new Map;for(let n of lt(e)){let o=n.objects.filter(r=>r.type==="section");if(o.length)for(let r of n.objects){if(!dt(r))continue;let i=Ae(n.objects,r,o);i&&t.set(r.id,i.logicalSectionId??i.id)}}return t}function ht(e,t){let n=ce(e),o=n.filter(u=>u.type==="section"),r=new Map;for(let[u,l]of Ce(e))r.set(u,{id:u,label:l.label,zone:l.zone,seatCount:0,objectIds:[],seatLabels:[]});let i={id:ae,label:"Other seats",seatCount:0,objectIds:[],seatLabels:[]},s=new Map;for(let u of n){if(!dt(u))continue;let l=Fn(u);if(l.length===0)continue;let b;if(t)b=t.get(u.id);else{let p=Ae(n,u,o);b=p?p.logicalSectionId??p.id:void 0}let c=b?r.get(b):i;c.seatCount+=l.length,c.objectIds.push(u.id),c.seatLabels.push(...l),s.set(u.id,c.id)}return{sections:[...r.values()],ungrouped:i.objectIds.length?i:null,objectToSection:s}}function Hn(e){return ht(e,null)}function bt(e){return ht(e,pt(e))}function mt(e,t){return t.has(e.id)||!!e.logicalSectionId&&t.has(e.logicalSectionId)||!!e.zone&&t.has(e.zone)}function yt(e,t){let n=new Set;if(!t.size)return n;let{sections:o,ungrouped:r,objectToSection:i}=bt(e),s=new Set,u=new Map(o.map(b=>[b.id,b.zone]));for(let b of o){let c=u.get(b.id);(t.has(b.id)||c&&t.has(c))&&s.add(b.id)}let l=!!r&&t.has(ae);for(let[b,c]of i)(s.has(c)||l&&c===ae)&&n.add(b);return n}function Vn(e,t){if(!t.size)return e;let n=yt(e,t),o=t instanceof Set?t:new Set(t),r=s=>!(n.has(s.id)||s.type==="section"&&mt(s,o));if(e.floors&&e.floors.length){let s=!1,u=e.floors.map(l=>{let b=l.objects.filter(r);return b.length!==l.objects.length&&(s=!0),b.length===l.objects.length?l:{...l,objects:b}});return s?{...e,floors:u,objects:u[0].objects}:e}let i=e.objects.filter(r);return i.length===e.objects.length?e:{...e,objects:i}}0&&(module.exports={DEFAULT_SECTION_CORNER_SMOOTHING,MAX_EDGE_SAGITTA_RATIO,TIER_HEIGHT_M,UNGROUPED_ID,applyHidden,arcLevelAt,bearingDeg,buildSectionRake,computeSections,computeSectionsPerFloor,cornerSmoothingThresholdDeg,distanceToPolyline,fitBowlProfile,fitCircle,hiddenObjectIds,indexLabel,isSectionHidden,logicalNumberingRow,reflectEdgeCurvature,relabelRows,resolveSection,reverseSectionOutlinePath,sampleSectionOutlinePath,seatConfidenceDisclosure,seatDisplayLabel,seatDisplayParts,seatInventoryLabel,seatLabelPart,sectionCornerSmoothingPath,sectionEntrancesById,sectionGeometry,sectionIdentitiesById,sectionLabelsById,sectionOutlinePathFrom,sectionOwnersByObject,sectionPathSegmentEnd,toBijectiveBase,toLetters,toRoman,transformSectionOutlinePath,translateSectionOutlinePath,validSectionOutlinePath});
|