@seatlayer/core 0.71.3 → 0.71.4
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/{categoryInventory-BiUDSvBt.d.ts → categoryInventory-B8CDQtH4.d.ts} +1 -1
- package/dist/{categoryInventory-DBqgM5in.d.cts → categoryInventory-r3OfIEQn.d.cts} +1 -1
- package/dist/{chunk-GK4ILJFB.js → chunk-7KS6TAYH.js} +1 -1
- package/dist/{chunk-A27USMF7.js → chunk-AM2LRFAY.js} +1 -1
- package/dist/chunk-KCFEFP6H.js +1 -0
- package/dist/{chunk-7OJ6SB6V.js → chunk-KPSJDH3N.js} +1 -1
- package/dist/{chunk-FBRBY6NE.js → chunk-LR7WIR5Z.js} +1 -1
- package/dist/chunk-NKYPEBW3.js +1 -0
- package/dist/{chunk-TQWKQGXF.js → chunk-NXFDYBZY.js} +1 -1
- package/dist/{chunk-AB4ALUEW.js → chunk-SKO3DCVB.js} +1 -1
- package/dist/{chunk-652LV66L.js → chunk-YSVXAUOH.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +4 -4
- package/dist/core/chart-ops/index.d.ts +4 -4
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +4 -4
- package/dist/core/inventory/index.d.ts +4 -4
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +5 -4
- package/dist/core/layout/index.d.ts +5 -4
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.d.cts +3 -3
- package/dist/core/quality/index.d.ts +3 -3
- package/dist/core/render-assets/index.d.cts +1 -1
- package/dist/core/render-assets/index.d.ts +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/{eventConfigurations-CA2XhDig.d.ts → eventConfigurations-0OC43JJY.d.ts} +1 -1
- package/dist/{eventConfigurations-Csdxe89O.d.cts → eventConfigurations-ByU_uPeS.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +21 -13
- package/dist/index.d.ts +21 -13
- package/dist/index.js +1 -1
- package/dist/{labeling-CxZWjZBN.d.ts → labeling-B05IJwd2.d.ts} +1 -1
- package/dist/{labeling-DG-Sc8VW.d.cts → labeling-DAGq3u0z.d.cts} +1 -1
- package/dist/{layout-BjTtYIy8.d.ts → layout-DkDRcXvu.d.ts} +102 -60
- package/dist/{layout-CUiLkR8o.d.cts → layout-e0Qe7jmM.d.cts} +102 -60
- package/dist/{renderedQuality-ZDPLvzcZ.d.cts → renderedQuality-BaejczsK.d.cts} +1 -1
- package/dist/{renderedQuality-DrOWtrO-.d.ts → renderedQuality-BwwrqYzX.d.ts} +1 -1
- package/dist/{renderer-DIebhcYo.d.cts → renderer-BNicx5sw.d.ts} +4 -1
- package/dist/{renderer-DtR3EaF4.d.ts → renderer-Duv1HhQg.d.cts} +4 -1
- package/dist/{sections-Bb0L9lDT.d.cts → sections-BjGjR21N.d.cts} +1 -1
- package/dist/{sections-87qiciyN.d.ts → sections-CrX4vq-m.d.ts} +1 -1
- package/dist/{segmentedRowModel-CEP6crcl.d.ts → segmentedRowModel-BOO8w9Ng.d.ts} +1 -1
- package/dist/{segmentedRowModel-BqiM0U65.d.cts → segmentedRowModel-UO_YIQRB.d.cts} +1 -1
- package/dist/{ticketRestrictions-NKWgOV-D.d.cts → ticketRestrictions-DUQrKTpS.d.cts} +2 -2
- package/dist/{ticketRestrictions-Ch3ZKeMR.d.ts → ticketRestrictions-dvlNTwem.d.ts} +2 -2
- package/dist/{types-DNztpn7q.d.cts → types-0yruRsAj.d.cts} +30 -1
- package/dist/{types-DNztpn7q.d.ts → types-0yruRsAj.d.ts} +30 -1
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +8 -8
- package/dist/view3d/index.d.cts +3 -3
- package/dist/view3d/index.d.ts +3 -3
- 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-WXWJZ5DO.js +0 -1
- package/dist/chunk-X3K36XZM.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var x="seatmap.chart";var c=[{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"}],l=new Map(c.map(e=>[e.key,e]));function w(e){return l.get(e)}var d={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function R(e){let t=e?.[0];return t&&d[t]||"#3b82f6"}var u=[{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"}],b=new Map(u.map(e=>[e.key,e]));function I(e){return b.get(e)}var A=8,k=24,g=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],m=new Set(g);function E(e){switch(e.type){case"row":case"table":case"gaArea":case"booth":case"section":return"interactive";case"decorImage":return e.layer==="foreground"?"foreground":"background";case"shape":return e.role&&m.has(e.role)?"surroundings":"background";case"text":return"background";default:return"interactive"}}var T=2e6,p=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,y=/[\s"'<>`\\]/;function
|
|
1
|
+
var x="seatmap.chart";var c=[{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"}],l=new Map(c.map(e=>[e.key,e]));function w(e){return l.get(e)}var d={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function R(e){let t=e?.[0];return t&&d[t]||"#3b82f6"}var u=[{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"}],b=new Map(u.map(e=>[e.key,e]));function I(e){return b.get(e)}var A=8,k=24,g=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],m=new Set(g);function E(e){switch(e.type){case"row":case"table":case"gaArea":case"booth":case"section":return"interactive";case"decorImage":return e.layer==="foreground"?"foreground":"background";case"shape":return e.role&&m.has(e.role)?"surroundings":"background";case"text":return"background";default:return"interactive"}}var T=2e6,p=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,y=/[\s"'<>`\\]/;function S(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return p.test(e);if(y.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function O(e){let t=e.trim();return S(t)?t:null}function f(e){let t=0;for(let r=0,i=e.length;r<i;r+=1){let o=e[r],a=e[(r+1)%i];t+=o.x*a.y-a.x*o.y}return t/2}function D(e){return f(e)*2}function _(e,t,r){let i=!1;for(let o=0,a=e.length-1;o<e.length;a=o++){let n=e[o],s=e[a];n.y>r!=s.y>r&&t<(s.x-n.x)*(r-n.y)/(s.y-n.y)+n.x&&(i=!i)}return i}function v(e){let t=1/0,r=1/0,i=-1/0,o=-1/0,a=!1;for(let n of e)!Number.isFinite(n.x)||!Number.isFinite(n.y)||(a=!0,n.x<t&&(t=n.x),n.y<r&&(r=n.y),n.x>i&&(i=n.x),n.y>o&&(o=n.y));return a?{minX:t,minY:r,maxX:i,maxY:o}:null}function G(e){let t=v(e);return t?h(t):null}function h(e){return{x:e.minX,y:e.minY,width:e.maxX-e.minX,height:e.maxY-e.minY}}function X(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}export{x as a,c as b,w as c,d,R as e,u as f,I as g,A as h,k as i,g as j,E as k,T as l,S as m,O as n,v as o,G as p,X as q,f as r,D as s,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ba as d,oa as b,sa as p,ta as h,ya as I}from"./chunk-
|
|
1
|
+
import{Ba as d,oa as b,sa as p,ta as h,ya as I}from"./chunk-KCFEFP6H.js";var m="__sl_ga__",f=1e5,v=1e5;function j(t,e){return`${m}${encodeURIComponent(t)}__${e+1}`}function S(t){let e=t.inventorySegments;if(e===void 0)return!0;if(!Array.isArray(e)||e.length<1||e.length>256)return!1;let r=0,i=new Map;for(let o of e){if(!o||typeof o.sourceAreaId!="string"||!o.sourceAreaId.trim()||o.sourceAreaId.length>160||!Number.isInteger(o.startIndex)||o.startIndex<0||!Number.isInteger(o.count)||o.count<1||o.startIndex+o.count>f||(r+=o.count,r>f))return!1;let u=i.get(o.sourceAreaId)??[],n=o.startIndex+o.count;if(u.some(s=>o.startIndex<s.end&&n>s.start))return!1;u.push({start:o.startIndex,end:n}),i.set(o.sourceAreaId,u)}return r===t.capacity}function A(t){let e=Math.min(f,Math.max(0,Math.floor(t.capacity)));return t.inventorySegments===void 0?e?[{sourceAreaId:t.id,startIndex:0,count:e}]:[]:S(t)?t.inventorySegments.map(r=>({...r})):[]}function y(t){return A(t).flatMap(e=>Array.from({length:e.count},(r,i)=>j(e.sourceAreaId,e.startIndex+i)))}function M(t,e){if(t.inventorySegments===void 0||e===t.capacity)return t.inventorySegments;if(e<t.capacity)return;let r=A(t);if(!r.length)return;let i=e-t.capacity;if(!i)return r;let u=r.filter(s=>s.sourceAreaId===t.id).reduce((s,a)=>Math.max(s,a.startIndex+a.count),0),n=r[r.length-1];if(n?.sourceAreaId===t.id&&n.startIndex+n.count===u)n.count+=i;else{if(r.length>=256)return;r.push({sourceAreaId:t.id,startIndex:u,count:i})}return r}function R(t){return d(t).filter(e=>e.type==="gaArea")}function N(t){return t.startsWith(m)}var g="__ungrouped__";function x(t){return t.type==="row"?b(t).map(e=>e.label):t.type==="table"?p(t).map(e=>e.label):t.type==="booth"?h(t).map(e=>e.label):t.type==="gaArea"?y(t):[]}function O(t){return t.type==="row"||t.type==="table"||t.type==="booth"||t.type==="gaArea"}function _(t){let e=d(t),r=e.filter(n=>n.type==="section"),i=new Map;for(let n of r){let s=n.logicalSectionId??n.id;i.get(s)||i.set(s,{id:s,label:n.displayLabel||n.label||"Section",zone:n.zone,seatCount:0,objectIds:[],seatLabels:[]})}let o={id:g,label:"Other seats",seatCount:0,objectIds:[],seatLabels:[]},u=new Map;for(let n of e){if(!O(n))continue;let s=x(n);if(s.length===0)continue;let a=I(e,n),c=a?i.get(a.logicalSectionId??a.id):o;c.seatCount+=s.length,c.objectIds.push(n.id),c.seatLabels.push(...s),u.set(n.id,c.id)}return{sections:[...i.values()],ungrouped:o.objectIds.length?o:null,objectToSection:u}}function C(t,e){return e.has(t.id)||!!t.logicalSectionId&&e.has(t.logicalSectionId)||!!t.zone&&e.has(t.zone)}function G(t,e){let r=new Set;if(!e.size)return r;let{sections:i,ungrouped:o,objectToSection:u}=_(t),n=new Set,s=new Map(i.map(c=>[c.id,c.zone]));for(let c of i){let l=s.get(c.id);(e.has(c.id)||l&&e.has(l))&&n.add(c.id)}let a=!!o&&e.has(g);for(let[c,l]of u)(n.has(l)||a&&l===g)&&r.add(c);return r}function U(t,e){if(!e.size)return t;let r=G(t,e),i=e instanceof Set?e:new Set(e),o=n=>!(r.has(n.id)||n.type==="section"&&C(n,i));if(t.floors&&t.floors.length){let n=!1,s=t.floors.map(a=>{let c=a.objects.filter(o);return c.length!==a.objects.length&&(n=!0),c.length===a.objects.length?a:{...a,objects:c}});return n?{...t,floors:s,objects:s[0].objects}:t}let u=t.objects.filter(o);return u.length===t.objects.length?t:{...t,objects:u}}export{f as a,v as b,j as c,S as d,A as e,y as f,M as g,R as h,N as i,g as j,_ as k,C as l,G as m,U as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as se}from"./chunk-CRCGO52K.js";var Bt=40,Gt=1200,Xt=.8,zt=3,Kt=-2,Vt=20,$t=.1,Wt=40,Yt=40,ce=e=>Math.max(1,e.fontSize*.6+(e.letterSpacing??0));function ze(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/ce(e))),r=0;for(let i of n){if(!i.length){r+=1;continue}let c=0;for(let u of i.split(/\s+/)){let s=u.length;c&&c+1+s<=o?c+=1+s:(r+=Math.max(1,Math.ceil(s/o)),c=s%o)}}return Math.max(1,r)}function ae(e){let t=e.background?.padding??0,n=e.text.split(/\r?\n/),o=Math.max(1,...n.map(u=>u.length))*ce(e),r=e.width??o+t*2,i=Math.max(1,r-t*2),c=ze(e,i);return{width:r,height:c*e.fontSize*(e.lineHeight??1.2)+t*2,lineCount:c,padding:t}}var Ke=Math.PI/180;function I(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function Ve(e,t,n){let o=Math.cos(n),r=Math.sin(n),i=e.x-t.x,c=e.y-t.y;return{x:t.x+i*o-c*r,y:t.y+i*r+c*o}}function Jt(e,t){return Ve(e,{x:0,y:0},t*Ke)}function O(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function $e(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function Qt(e){return e.length?$e(e):null}function W(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,c=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+c*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+c*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 fe(e,t,n=192){if(!Number.isInteger(t)||t<1)throw new Error("Path point count must be a positive integer");if(t===1)return[W(e,.5)];let o=Array.from({length:n+1},(s,d)=>W(e,d/n)),r=new Float64Array(o.length);for(let s=1;s<o.length;s+=1){let d=o[s].x-o[s-1].x,a=o[s].y-o[s-1].y;r[s]=r[s-1]+Math.hypot(d,a)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let c=[],u=1;for(let s=0;s<t;s+=1){let d=i*s/(t-1);for(;u<r.length-1&&r[u]<d;)u+=1;let a=r[u-1],h=r[u],m=h===a?0:(d-a)/(h-a);c.push({x:o[u-1].x+(o[u].x-o[u-1].x)*m,y:o[u-1].y+(o[u].y-o[u-1].y)*m})}return c}function T(e,t){return{x:e.x+t.x,y:e.y+t.y}}function F(e,t){return{x:e.x-t.x,y:e.y-t.y}}function R(e,t){return{x:e.x*t,y:e.y*t}}function B(e,t=13){return Array.from({length:t},(n,o)=>W(e,o/(t-1)))}function le(e,t){let n=Math.max(0,Math.min(1,t))*(e.length-1),o=Math.min(e.length-2,Math.floor(n));return O(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=[le(e,o)];for(let c=1;c<e.length-1;c+=1){let u=c/(e.length-1);u>o+1e-9&&u<r-1e-9&&i.push(e[c])}return i.push(le(e,r)),i}function de(e,t){let n=[[0,1],[1,2],[2,3],[3,0]],o=0,r=Number.POSITIVE_INFINITY;n.forEach(([m,b],p)=>{let y=I(O(e[m],e[b],.5),t);y<r&&(r=y,o=p)});let i=e[o],c=e[(o+1)%4],u=e[(o+2)%4],s=e[(o+3)%4],d=O(i,c,.5),a=F(t,d),h=Math.max(1e-9,Math.hypot(a.x,a.y));return{p0:i,p1:c,p2:u,p3:s,normal:R(a,1/h),depth:(I(i,s)+I(c,u))/2}}function he(e){let{p0:t,p1:n,p2:o,p3:r,normal:i,depth:c}=e,u=F(n,t),s=F(o,r),d=c*.22,a=c*.12;return{nearPath:{start:t,control1:T(T(t,R(u,1/3)),R(i,d)),control2:T(T(t,R(u,2/3)),R(i,d)),end:n},farPath:{start:o,control1:T(T(r,R(s,2/3)),R(i,a)),control2:T(T(r,R(s,1/3)),R(i,a)),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((p,y)=>T(p,y),{x:0,y:0});o.x/=4,o.y/=4;let r=I(e[0],e[1]),i=I(e[0],e[3]),c=n==="auto"?r>i*1.25&&I(o,t)>i?"bezier":"tapered":n;if(c==="rectangle")return{mode:c,outline:e.map(p=>({...p}))};let u=de(e,t),{p0:s,p1:d,p2:a,p3:h}=u;if(c==="tapered")return{mode:c,outline:[T(s,R(F(d,s),.14)),T(s,R(F(d,s),1-.14)),a,h]};let{nearPath:m,farPath:b}=he(u);return{mode:c,outline:[...B(m),...B(b).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=de(e,t),{p0:i,p1:c,p2:u,p3:s}=r,d=o==="bezier"?he(r):null,a=d?B(d.nearPath):null,h=d?B(d.farPath).reverse():null,m=Math.min(.055,.18/(n+1));return Array.from({length:n},(b,p)=>{let y=(p+1)/(n+1),f=y-m/2,g=y+m/2;return a&&h?[...ue(a,f,g),...ue(h,f,g).reverse()]:[O(i,c,f),O(i,c,g),O(s,u,g),O(s,u,f)]})}function We(e,t,n){let o=n.x-t.x,r=n.y-t.y,i=o*o+r*r,c=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+c*o),e.y-(t.y+c*r))}function Ye(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 c=We(e,o[i],o[r]);c<n&&(n=c)}return n}function me(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,c=t[o].y,u=t[r].x,s=t[r].y;c>e.y!=s>e.y&&e.x<(u-i)*(e.y-c)/(s-c)+i&&(n=!n)}return n}function qe(e,t,n){let o=me(e,t)&&!n.some(i=>me(e,i)),r=Ye(e,[t,...n]);return o?r:-r}function L(e,t,n,o,r){let i=qe({x:e,y:t},o,r);return{x:e,y:t,h:n,d:i,max:i+n*Math.SQRT2}}var Y=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,c=i+1,u=r;if(i<t.length&&t[i].max>t[u].max&&(u=i),c<t.length&&t[c].max>t[u].max&&(u=c),u===r)break;[t[u],t[r]]=[t[r],t[u]],r=u}}return n}};function pe(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 sn(e,t){return Math.max(0,pe(e)-(t??[]).reduce((n,o)=>n+pe(o),0))}function ye(e,t){let n=t??[];if(!e.length)return{point:{x:0,y:0},radius:0};if(e.length<3){let y=e.reduce((g,w)=>g+w.x,0)/e.length,f=e.reduce((g,w)=>g+w.y,0)/e.length;return{point:{x:y,y:f},radius:0}}let o=1/0,r=1/0,i=-1/0,c=-1/0;for(let y of e)y.x<o&&(o=y.x),y.y<r&&(r=y.y),y.x>i&&(i=y.x),y.y>c&&(c=y.y);let u=i-o,s=c-r,d=Math.min(u,s);if(!(d>0))return{point:{x:(o+i)/2,y:(r+c)/2},radius:0};let a=Math.max(u,s)/150,h=new Y,m=d/2;for(let y=o;y<i;y+=d)for(let f=r;f<c;f+=d)h.push(L(y+m,f+m,m,e,n));let b=L(o+u/2,r+s/2,0,e,n),p=0;for(;h.size;){let y=h.pop();if(!y)break;y.d>b.d&&(b=y),!(y.max-b.d<=a)&&(p>=4e3||(p+=1,m=y.h/2,h.push(L(y.x-m,y.y-m,m,e,n)),h.push(L(y.x+m,y.y-m,m,e,n)),h.push(L(y.x-m,y.y+m,m,e,n)),h.push(L(y.x+m,y.y+m,m,e,n))))}return{point:{x:b.x,y:b.y},radius:Math.max(0,b.d)}}function Je(e,t,n){return Math.max(t,Math.min(n,e))}function an(e,t,n){return e<t?t:e>n?n:e}function Qe(e){return Je(e,0,1)}function be(e){let t=Qe(e);return t*t*(3-2*t)}var k=Math.PI*2;function j(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function Ze(e,t,n){let o=t-e;if(n){for(;o<0;)o+=k;for(;o>=k;)o-=k}else{for(;o>0;)o-=k;for(;o<=-k;)o+=k}return o}function dn(e){return e.end}function Se(e){if(e.version!==1||e.closed!==!0||!j(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||!j(n.end))return!1;if(n.kind==="line"){if(I(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!j(n.control1)||!j(n.control2)||I(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!j(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(I(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(I(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||I(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return I(t,e.start)<=1e-4}function et(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 hn(e,t=2){if(!Se(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 c=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),s=Ze(c,u,i.clockwise),d=Math.max(2,Math.ceil(Math.abs(s)*i.radius/n));for(let a=1;a<=d;a+=1){let h=c+s*a/d;o.push({x:i.center.x+Math.cos(h)*i.radius,y:i.center.y+Math.sin(h)*i.radius})}}else{let c=I(r,i.control1)+I(i.control1,i.control2)+I(i.control2,i.end),u=Math.max(2,Math.ceil(c/n));for(let s=1;s<=u;s+=1)o.push(et(r,i,s/u))}r=i.end}return I(o[o.length-1],o[0])<=1e-4&&o.pop(),o}function we(e,t,n){return tt(e,r=>({x:r.x+t,y:r.y+n}))}function tt(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 nt=45,q=150,ot=60;function rt(e){let t=nt/100;if(e<=t)return q;let n=Math.min(1,(e-t)/(1-t));return q-n*(q-ot)}var xe=.5523;function ge(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function it(e){let t=[],n=[];for(e.forEach((o,r)=>{j(o)&&(t.length&&ge(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&ge(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}function mn(e,t,n){return lt(e,{cornerSmoothing:t,...n})}var st=.5,ct=4/3;function at(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 c=-r/i,u=o/i,s=n*ct;return{kind:"bezier",control1:{x:e.x+o/3+c*s,y:e.y+r/3+u*s},control2:{x:e.x+o*2/3+c*s,y:e.y+r*2/3+u*s},end:{...t}}}function lt(e,t){let{points:n,sourceIndex:o}=it(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,c=t.edgeCurvature,u=new Array(r).fill(0);if(c?.length)for(let l=0;l<r;l+=1){let P=c[o[l]];u[l]=Number.isFinite(P)?Math.min(100,Math.max(-100,P))/100:0}let s=u.some(l=>Math.abs(l)>1e-6);if(i<=0&&!s)return null;let d=t.wideAngleThresholdDeg??rt(i),a=[];for(let l=0;l<r;l+=1)a[l]=I(n[l],n[(l+1)%r]);let h=new Array(r).fill(0);for(let l=0;l<r;l+=1){let P=n[(l-1+r)%r],S=n[l],M=n[(l+1)%r],E={x:P.x-S.x,y:P.y-S.y},C={x:M.x-S.x,y:M.y-S.y},A=Math.hypot(E.x,E.y),_=Math.hypot(C.x,C.y);if(A<=1e-9||_<=1e-9)continue;let H=Math.min(1,Math.max(-1,(E.x*C.x+E.y*C.y)/(A*_))),D=Math.acos(H)*180/Math.PI;if(D<d)continue;let $=be((D-d)/(180-d));h[l]=i*$*.5*Math.min(A,_)}for(let l=0;l<r;l+=1){let P=(l+1)%r,S=h[l]+h[P];if(S>a[l]&&S>1e-9){let M=a[l]/S;h[l]*=M,h[P]*=M}}let m=new Array(r),b=new Array(r);for(let l=0;l<r;l+=1){let P=n[(l-1+r)%r],S=n[l],M=n[(l+1)%r];if(h[l]<=1e-6){m[l]={...S},b[l]={...S};continue}let E=I(S,P)||1,C=I(S,M)||1;m[l]={x:S.x+(P.x-S.x)/E*h[l],y:S.y+(P.y-S.y)/E*h[l]},b[l]={x:S.x+(M.x-S.x)/C*h[l],y:S.y+(M.y-S.y)/C*h[l]}}if(h.every(l=>l<=1e-6)&&!s)return null;let p=[],y={...b[0]},f=y,g=(l,P)=>{if(I(f,l)<=1e-9)return;let S=u[P];Math.abs(S)>1e-6?p.push(at(f,l,S*st*a[P])):p.push({kind:"line",end:{...l}}),f=l};for(let l=1;l<=r;l+=1){let P=l%r,S=n[P];g(m[P],(l-1)%r),h[P]>1e-6&&I(m[P],b[P])>1e-9&&(p.push({kind:"bezier",control1:O(m[P],S,xe),control2:O(b[P],S,xe),end:{...b[P]}}),f=b[P])}if(!p.length)return null;let w=p[p.length-1];I(w.end,y)>1e-9&&(w.kind==="line"?w.end={...y}:p.push({kind:"line",end:{...y}}));let x={version:1,closed:!0,start:y,segments:p};return Se(x)?x:null}function pn(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],c=t[r];i.kind==="line"?o.push({kind:"line",end:{...c}}):i.kind==="arc"?o.push({kind:"arc",center:{...i.center},radius:i.radius,clockwise:!i.clockwise,end:{...c}}):o.push({kind:"bezier",control1:{...i.control2},control2:{...i.control1},end:{...c}})}return{version:1,closed:!0,start:{...e.start},segments:o}}function bn(e,t,n){let o=[];for(let r=0;r<e.length-1;r+=1){let i=e[r],c=e[r+1],u=Math.hypot(c.x-i.x,c.y-i.y);if(u<=0)continue;let s=Math.max(1,Math.round(u/n)),d=u/s,a=Math.atan2(c.y-i.y,c.x-i.x),h=r===0,b=(r>0?t[r-1]:void 0)==="break"?2:1,p=h?{...i}:{x:i.x+Math.cos(a)*d*b,y:i.y+Math.sin(a)*d*b},y=h?s+1:Math.max(1,s-(b-1));o.push({origin:p,rotation:a*180/Math.PI,seatCount:y,seatSpacing:d})}return o}function xn(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 gn(e){return e.reduce((t,n)=>t+n.seatCount,0)}function Pe(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,b)=>m.segmentedRow.componentIndex-b.segmentedRow.componentIndex),c=i[0]?.segmentedRow?.componentCount??0,u=i[0]?.segmentedRow;if(!u||!(c>=2&&i.length===c&&u?.boundaryBefore==="start"&&i.every((m,b)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===o&&m.segmentedRow.componentCount===c&&m.segmentedRow.componentIndex===b&&m.segmentedRow.repeatLabelOnComponents===u.repeatLabelOnComponents&&(b===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===u.displayLabel)))continue;let d=i.reduce((m,b)=>m+b.seatCount,0),a=0,h=0;for(let m of i)m.segmentedRow.boundaryBefore==="break"&&(a+=1),t.set(m.id,{groupId:o,adjacencyOffset:a,displayOffset:h,displayLabel:u.displayLabel,totalSeats:d,canonical:i[0],viewFromSeatUrl:u.viewFromSeatUrl,viewFromSeatMeta:u.viewFromSeatMeta,confidenceEvidence:u.confidenceEvidence}),a+=m.seatCount,h+=m.seatCount}return t}var Me="ABCDEFGHIJKLMNOPQRSTUVWXYZ",ut="ABCDEFGHJKLMNPQRSTUVWXYZ",ft="abcdefghijklmnopqrstuvwxyz";function ve(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 dt(e,t){let n=t.startAt-1,o=e+n;if(t.scheme==="numbers")return String(o+1);let r=t.skipAmbiguous?ut:Me;return ve(o,r)}function J(e,t=!1){let n=t?ft:Me;return ve(Math.max(0,Math.floor(e)-1),n)}var ht=[[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 Ie(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of ht)for(;t>=o;)n+=r,t-=o;return n}function wn(e,t){let n=e.length;return e.map((o,r)=>{let i=t.reverse?n-1-r:r;return{...o,label:dt(i,t)}})}function mt(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 Q(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",c=e.seatNumbering?.prefix??"",u=e.seatNumbering?.endAt,s=e.seatCount;if(i==="updown"||i==="updown-descending"){let b=Math.ceil(s/2),p=i==="updown"?t<b?n+2*t:n-1+2*(s-t):t<b?n+2*(b-1-t):n+1+2*(t-b);return`${c}${p}`}let d=i==="odd"||i==="even"?2:r,a=u!=null&&Number.isFinite(u)?u-(s-1)*d:n,h=o==="center"?mt(s)[t]:o==="rtl"?s-1-t:t,m;switch(i){case"odd":{let b=a%2===1?a:a+1;m=String(b+h*2);break}case"even":{let b=a%2===0?a:a+1;m=String(b+h*2);break}case"roman":m=Ie(a+h*r);break;case"letters-upper":m=J(a+h*r,!1);break;case"letters-lower":m=J(a+h*r,!0);break;default:m=String(a+h*r);break}return`${c}${m}`}function pt(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Ee(e,t,n){return n?.label??`${e.label}-${Q(e,t)}`}function Z(e,t,n,o){if(o?.displayLabel)return o.displayLabel;if(!n)return`${e.displayLabel??e.label}-${Q(e,t)}`;let r=pt(n),i=n.displayOffset+t;return`${n.displayLabel}-${Q(r,i)}`}var G=.02291666666666667,In=1/G,yt=58,bt=yt*G,Ce=0,Te=3,Oe=0,ee=120,xt=0,gt=45,St=7,X=1.2;function te(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function En(e){return Number.isFinite(e)?Math.max(Ce,Math.min(Te,Math.round(e))):Ce}function wt(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=St?e:Te}function Re(e,t={}){let n=te(t.floorBaseHeightM,Oe,ee,0),o=Math.min(ee,n+wt(e.elevation)*bt),r=e.height===void 0?o:te(e.height,Oe,ee,o),i=te(e.rake,xt,gt,0);return{height:r,rake:i}}function Ae(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 _e(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],c=e[r+1],u=c.x-i.x,s=c.y-i.y,d=u*u+s*s,a=d>1e-12?((t-i.x)*u+(n-i.y)*s)/d:0;a<0?a=0:a>1&&(a=1);let h=Math.hypot(t-(i.x+a*u),n-(i.y+a*s));h<o&&(o=h)}return o}function Pt(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 c=Math.hypot(i.x-t,i.y-n);c>r&&(r=c)}return{cx:t,cy:n,r}}function Le(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function ne(e,t){let n=1/0;for(let o of Ae(e)){let r=_e(t,o.x,o.y);r<n&&(n=r)}for(let o of Ae(t)){let r=_e(e,o.x,o.y);r<n&&(n=r)}return n}function Mt(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let a of e)n+=a.x,o+=a.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let a of e){let h=Math.hypot(a.x-n,a.y-o);h>r&&(r=h,i=a)}let c=i.x-n,u=i.y-o,s=Math.hypot(c,u);s>1e-9?(c/=s,u/=s):(c=1,u=0);let d=e.map((a,h)=>({p:a,i:h,t:(a.x-n)*c+(a.y-o)*u})).sort((a,h)=>a.t-h.t);return{pts:d.map(a=>a.p),seatIndices:d.map(a=>t[a.i])}}function vt(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let w of e)n+=w.x,o+=w.y;n/=t,o/=t;let r=0,i=0,c=0,u=0,s=0,d=0,a=0;for(let w of e){let x=w.x-n,l=w.y-o;r+=x*x,c+=l*l,i+=x*l,u+=x*x*x,s+=l*l*l,d+=x*l*l,a+=l*x*x}let h=r*c-i*i;if(Math.abs(h)<1e-9)return null;let m=(u+d)/2,b=(s+a)/2,p=(m*c-b*i)/h,y=(b*r-m*i)/h,f=p+n,g=y+o;return!Number.isFinite(f)||!Number.isFinite(g)?null:{cx:f,cy:g}}var It=.15;function Et(e){if(e.length<2)return null;let t=e.map(w=>{let x=0,l=0;for(let P of w.pts)x+=P.x,l+=P.y;return{x:x/w.pts.length,y:l/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,c=0;for(let w of t){let x=w.x-n,l=w.y-o;r+=x*x,i+=x*l,c+=l*l}let u=r+c,s=r*c-i*i,d=u/2+Math.sqrt(Math.max(0,u*u/4-s)),a,h;Math.abs(i)>1e-12?(a=d-c,h=i):r>=c?(a=1,h=0):(a=0,h=1);let m=Math.hypot(a,h);if(!(m>1e-12))return null;a/=m,h/=m;let b=1/0,p=-1/0,y=[];for(let w of e){let x=1/0,l=-1/0;for(let P of w.pts){let S=P.x*a+P.y*h;S<x&&(x=S),S>l&&(l=S),S<b&&(b=S),S>p&&(p=S)}y.push(l-x)}let f=p-b;return f>1e-9?(y.sort((w,x)=>w-x),y[Math.min(y.length-1,Math.floor(y.length*.9))]/f<=Ct?{x:a,y:h}:null):null}var Ct=.35;function ke(e,t,n,o){let r=new Map;for(let f of n){let g=t[f],w=g.rowId||`__seat-${f}`,x=r.get(w);x||(x={pts:[],idx:[]},r.set(w,x)),x.pts.push({x:g.x,y:g.y}),x.idx.push(f)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[f,g]of r){let w=Mt(g.pts,g.idx),x=0;for(let l of w.pts)x+=Math.hypot(l.x-o.x,l.y-o.y);i.push({id:f,pts:w.pts,seatIndices:w.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:x/w.pts.length})}let c=i.map(f=>Pt(f.pts)),u=[];for(let f=0;f<i.length;f++){let g=1/0;for(let w=0;w<i.length;w++){if(f===w||Le(c[f],c[w])>=g)continue;let x=ne(i[f].pts,i[w].pts);x<g&&(g=x)}Number.isFinite(g)&&u.push(g)}u.sort((f,g)=>f-g);let s=u.length?u[Math.floor(u.length/2)]:1,d=Math.max(s*1.8,1e-6),a=i.map(()=>[]);for(let f=0;f<i.length;f++)for(let g=f+1;g<i.length;g++)Le(c[f],c[g])>d||ne(i[f].pts,i[g].pts)<=d&&(a[f].push(g),a[g].push(f));let h=0;for(let f=0;f<i.length;f++){if(i[f].blockId!==-1)continue;let g=h++,w=[f];for(i[f].blockId=g;w.length;){let x=w.pop();for(let l of a[x])i[l].blockId===-1&&(i[l].blockId=g,w.push(l))}}let m=new Map;for(let f of i){let g=m.get(f.blockId)??[];g.push(f),m.set(f.blockId,g)}let b=[];for(let f of i){if(f.pts.length<4)continue;let g=vt(f.pts);g&&(!Number.isFinite(g.cx)||!Number.isFinite(g.cy)||b.push({x:g.cx,y:g.cy}))}let p=b.length>=2?(()=>{let f=b.map(x=>x.x).sort((x,l)=>x-l),g=b.map(x=>x.y).sort((x,l)=>x-l),w=Math.floor(b.length/2);return{cx:f[w],cy:g[w]}})():null;if(p){let f=S=>Math.hypot(S.x-p.cx,S.y-p.cy),g=1/0,w=-1/0,x=[];for(let S of i){let M=1/0,E=-1/0;for(let C of S.pts){let A=f(C);A<M&&(M=A),A>E&&(E=A)}x.push(E-M),M<g&&(g=M),E>w&&(w=E)}let l=w-g;x.sort((S,M)=>S-M);let P=x[Math.min(x.length-1,Math.floor(x.length*.9))];if(l>1e-9&&P/l<=It){let S=i.map(v=>{let U=0;for(let Xe of v.pts)U+=f(Xe);return{row:v,radius:U/v.pts.length}}),M=0,E=0;for(let v of S)M+=v.radius,E+=v.row.focalDistance;M/=S.length,E/=S.length;let C=0;for(let v of S)C+=(v.radius-M)*(v.row.focalDistance-E);if(C<0)for(let v of S)v.radius=-v.radius;let _=1/0;for(let v of S)v.radius<_&&(_=v.radius);S.sort((v,U)=>v.radius-U.radius);let H=-1,D=-1/0,$=l/Math.max(1,S.length)*.5,ie=[];for(let v of S)v.radius-D>$&&(H++,D=v.radius),v.row.ordinal=H,v.row.blockDepth=v.radius-_,ie.push(v.row);return{sectionId:e,rows:ie,blockCount:h}}}let y=[];for(let[,f]of m){let g=Et(f);if(g){let w=l=>{let P=0;for(let S of l.pts)P+=S.x*g.x+S.y*g.y;return P/l.pts.length};f.sort((l,P)=>w(l)-w(P)),f.length>=2&&f[0].focalDistance>f[f.length-1].focalDistance&&f.reverse();let x=0;for(let l=0;l<f.length;l++)l>0&&(x+=ne(f[l-1].pts,f[l].pts)),f[l].ordinal=l,f[l].blockDepth=x,y.push(f[l])}else{let w=1/0;for(let x of f)x.focalDistance<w&&(w=x.focalDistance);f.sort((x,l)=>x.focalDistance-l.focalDistance);for(let x=0;x<f.length;x++)f[x].ordinal=x,f[x].blockDepth=Math.max(0,f[x].focalDistance-w),y.push(f[x])}}return{sectionId:e,rows:y,blockCount:h}}function He(e){return e?e.accessibility&&e.accessibility.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var K=Math.PI/180,Ot=9,N=16;function re(e,t,n,o){let r=n*K,i=Math.cos(r),c=Math.sin(r);return{x:o.x+e*i-t*c,y:o.y+e*c+t*i}}function Ue(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,c=[];if(e.path)return fe(e.path,t);if(t<=1)return t===1&&c.push({x:i.x,y:i.y}),c;if(o===0){for(let d=0;d<t;d++)c.push(re(d*n,0,r,i));return c}let u=o/(t-1)*K,s=n/(2*Math.sin(Math.abs(u)/2));for(let d=0;d<t;d++){let a=d*u,h=s*Math.sin(a),m=-s+s*Math.cos(a);c.push(re(h,m,r,i))}return c}function Tt(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Fn(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 Rt(e,t){let n=Tt(e);return Ue(e).map((o,r)=>{let i=n.get(r),c=He(i),u=Ee(e,r,i),s={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:u,displayLabel:Z(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:c.length>0,accessibility:c,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(s).some(d=>d!==void 0&&d!==!1&&d!=="")?s:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle}})}function Be(e){let t=[];for(let n of Rt(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 At(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 Ge(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(a=>[a.index,a])),r=(a,h,m,b)=>{let p=o.get(a),y=He(p),f=p?.label??`${e.label}-${a+1}`,g=e.displayLabel??e.label;return{index:a,label:f,displayLabel:p?.displayLabel??`${g}-${a+1}`,x:h+(p?.dx??0),y:m+(p?.dy??0),categoryKey:p?.categoryKey??e.categoryKey,skipped:!!p?.skip,accessible:y.length>0,accessibility:y,wheelchairSpaceType:p?.wheelchairSpaceType,commercial:p?.commercial,glyph:p?.glyph,viewUrl:p?.viewFromSeatUrl,viewMeta:p?.viewFromSeatUrl?p.viewFromSeatMeta:void 0,labelStyle:p?.labelStyle,...b?{side:b}:{}}};if(e.shape==="round"){let a=(e.radius??40)+N,h=e.rotation*K,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||n===1){for(let f=0;f<n;f++){let g=h+f/n*2*Math.PI;t.push(r(f,e.center.x+a*Math.cos(g),e.center.y+a*Math.sin(g)))}return t}let b=m*K,p=(2*Math.PI-b)/2,y=h+p;for(let f=0;f<n;f++){let g=y+f/(n-1)*b;t.push(r(f,e.center.x+a*Math.cos(g),e.center.y+a*Math.sin(g)))}return t}let i=e.width??80,c=e.height??50,u=At(e),s=["top","bottom","left","right"],d=0;for(let a of s){let h=u[a];for(let m=0;m<h;m++){let b,p;a==="top"?(b=-i/2+(m+.5)*i/h,p=-c/2-N):a==="bottom"?(b=-i/2+(m+.5)*i/h,p=c/2+N):a==="left"?(b=-i/2-N,p=-c/2+(m+.5)*c/h):(b=i/2+N,p=-c/2+(m+.5)*c/h);let y=re(b,p,e.rotation,e.center);t.push(r(d++,y.x,y.y,a))}}return t}function Hn(e){return e.bookAsWhole||e.variableOccupancy?Math.max(0,Math.round(e.seatCount)):Ge(e).filter(t=>!t.skipped).length}function _t(e){return Ge(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 Lt(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth"}]}function je(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,c=t[o].y,u=t[r].x,s=t[r].y;c>e.y!=s>e.y&&e.x<(u-i)*(e.y-c)/(s-c)+i&&(n=!n)}return n}function kt(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 c=(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 c>=-1e-7&&c<=u+1e-7})}function V(e,t,n){return je(e,t)&&!(n??[]).some(o=>je(e,o)||kt(e,o))}function Un(e,t){return ye(e,t).point}function oe(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 jt(e){switch(e.type){case"row":{let t=Be(e);if(!t.length)return{x:e.origin.x,y:e.origin.y};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return oe(e.points);case"section":return oe(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?oe(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 Ne(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function Nt(e,t){if(e.type!=="gaArea"||!Ne(e.points,t.outline))return!1;let n=e.holes??[],o=t.holes??[];return n.length===o.length&&n.every((r,i)=>Ne(r,o[i]))}function Dt(e,t){let n=e.filter(c=>c.type==="section"),o="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0,r=jt(t);return(o?n.find(c=>(c.logicalSectionId??c.id)===o&&(Nt(t,c)||V(r,c.outline,c.holes))):void 0)??n.find(c=>V(r,c.outline,c.holes))}function Ft(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 Bn(e,t){let n=Ft(e);return(t?n.find(o=>o.id===t):n[0])?.objects??[]}function Ht(e){return e.floors&&e.floors.length?e.floors.flatMap(t=>t.objects):e.objects}function Ut(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:e.holes.map(r)}:{}};case"section":return{...e,outline:r(e.outline),...e.outlinePath?{outlinePath:we(e.outlinePath,t,n)}:{},...e.holes?{holes:e.holes.map(r)}:{}};case"text":return{...e,position:o(e.position)};case"shape":return{...e,...e.points?{points:r(e.points)}:{},...e.x!=null?{x:e.x+t}:{},...e.y!=null?{y:e.y+n}:{}};case"decorImage":return{...e,x:e.x+t,y:e.y+n}}}function Gn(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 c of o.objects)n.push(i===0?c:Ut(c,0,i))}),{...e,objects:n,floors:void 0}}function De(e,t,n,o,r,i,c,u,s){let d=[],a=Pe(e),h=p=>!p?.eventConfigurationId||p.eventConfigurationId===o&&(p.eventConfigurationVersion===void 0||p.eventConfigurationVersion===s),m=p=>se(p,{activeConfigurationId:o,activeConfigurationVersion:s,activeBasisSha256:r,now:u}),b=(p,y)=>m(p)?{...p,coverage:y}:void 0;for(let p of e){let y=[];if(p.type==="row"?y=Be(p):p.type==="table"?y=_t(p):p.type==="booth"&&(y=Lt(p)),!y.length)continue;for(let l of y)l.viewUrl&&!h(l.viewMeta)&&(l.viewUrl=void 0,l.viewMeta=void 0);if(p.type==="row"){let l=a.get(p.id);if(l){let P=new Map((p.overrides??[]).map(S=>[S.index,S]));for(let S of y){let M=Number(S.id.slice(S.id.lastIndexOf(":")+1));if(!Number.isInteger(M))continue;S.logicalRowId=l.groupId,S.logicalSeatIndex=l.adjacencyOffset+M,P.get(M)?.displayLabel||(S.displayLabel=Z(p,M,l)),!S.viewUrl&&l.viewFromSeatUrl&&h(l.viewFromSeatMeta)&&(S.viewUrl=l.viewFromSeatUrl,S.viewMeta=l.viewFromSeatMeta);let E=P.get(M)?.confidenceEvidence;S.confidenceEvidence=b(E,"exact-seat")??b(p.confidenceEvidence,"row-representative")??b(l.confidenceEvidence,"row-representative")}}}let f=Dt(e,p),g=f?.viewFromSeatUrl,x=(f?.zone?t?.find(l=>l.id===f.zone):void 0)?.focalPoint??n;for(let l of y){if(!l.confidenceEvidence){let P=Number(l.id.slice(l.id.lastIndexOf(":")+1)),S=(p.type==="row"||p.type==="table")&&Number.isInteger(P)?p.overrides?.find(M=>M.index===P)?.confidenceEvidence:void 0;l.confidenceEvidence=b(S,"exact-seat")??(p.type==="row"?b(p.confidenceEvidence,"row-representative"):void 0)}l.confidenceEvidence??=b(f?.confidenceEvidence,"section-representative")??(c?b(c.evidence,c.coverage):void 0),!l.viewUrl&&g&&h(f?.viewFromSeatMeta)&&(l.viewUrl=g,l.viewMeta=f?.viewFromSeatMeta),!l.viewUrl&&i&&h(i.meta)&&(l.viewUrl=i.url,l.viewMeta=i.meta),f&&(l.sectionId=f.logicalSectionId??f.id),f?.zone&&(l.zoneId=f.zone),x&&(l.focalPoint={...x})}d.push(...y)}return d}function Xn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,c=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,u=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,s=De(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,c,u,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Fe(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,s);for(let d of s)d.floorId=r.id;o.push(...s)}return o}let n=De(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&&Fe(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),n}function Fe(e,t,n,o){let r=e.filter(a=>a.type==="section"),i=n>0||r.some(a=>a.height!==void 0||a.rake!==void 0||(a.elevation??0)>0);if(!r.length||!i||!t){for(let a of o)a.eyeHeightM=n+X;return}let c=new Array(o.length),u=new Map,s=new Map;for(let a=0;a<o.length;a++){let h=o[a],b=(h.sectionId?r.find(y=>y.id===h.sectionId)??r.find(y=>y.logicalSectionId===h.sectionId&&V({x:h.x,y:h.y},y.outline,y.holes)):void 0)??r.find(y=>V({x:h.x,y:h.y},y.outline,y.holes))??null;if(c[a]=b,!b)continue;u.has(b.id)||u.set(b.id,Re(b,{floorBaseHeightM:n}));let p=s.get(b.id);p?p.push(a):s.set(b.id,[a])}let d=new Array(o.length).fill(void 0);for(let[a,h]of s){let m=u.get(a);if(!m)continue;let b=m.rake>0?Math.tan(m.rake*Math.PI/180):0,p=ke(a,o,h,t);for(let y of p.rows){let f=y.blockDepth*G*b,g=m.height+f;for(let w of y.seatIndices)d[w]=g}}for(let a=0;a<o.length;a++){let h=o[a],m=c[a];if(!m){h.eyeHeightM=n+X;continue}let b=u.get(m.id);h.eyeHeightM=(d[a]??b.height)+X}}var z=40;function zn(e,t){let n=t?.freeText==="exclude",o=1/0,r=1/0,i=-1/0,c=-1/0,u=(s,d)=>{s<o&&(o=s),d<r&&(r=d),s>i&&(i=s),d>c&&(c=d)};for(let s of Ht(e))if(s.type==="row"){let d=new Map((s.overrides??[]).map(a=>[a.index,a]));Ue(s).forEach((a,h)=>{let m=d.get(h);m?.skip||u(a.x+(m?.dx??0),a.y+(m?.dy??0))})}else if(s.type==="gaArea")for(let d of s.points)u(d.x,d.y);else if(s.type==="section")for(let d of s.outline)u(d.x,d.y);else if(s.type==="decorImage")u(s.x,s.y),u(s.x+s.width,s.y+s.height);else if(s.type==="shape")if(s.points&&s.points.length)for(let d of s.points)u(d.x,d.y);else s.x!=null&&s.y!=null&&s.width!=null&&s.height!=null&&(u(s.x,s.y),u(s.x+s.width,s.y+s.height));else if(s.type==="table"){let d=N+Ot,a=s.shape==="round"?(s.radius??40)+d:Math.max((s.width??80)/2,(s.height??50)/2)+d;u(s.center.x-a,s.center.y-a),u(s.center.x+a,s.center.y+a)}else if(s.type==="booth"){let d=Math.max(s.width,s.height)/2;u(s.center.x-d,s.center.y-d),u(s.center.x+d,s.center.y+d)}else if(s.type==="text"){if(n)continue;let d=ae(s);u(s.position.x,s.position.y),u(s.position.x+d.width,s.position.y+d.height)}for(let s of[e.referenceImage,e.backgroundImage]){if(!s)continue;let{center:d,width:a}=s,h=a*3/4;u(d.x-a/2,d.y-h/2),u(d.x+a/2,d.y+h/2)}if(!isFinite(o)){let s=e.focalPoint??{x:0,y:0};return{x:s.x-200,y:s.y-200,width:400,height:400}}return{x:o-z,y:r-z,width:i-o+z*2,height:c-r+z*2}}export{Bt as a,Gt as b,Xt as c,zt as d,Kt as e,Vt as f,$t as g,Wt as h,Yt as i,ae as j,Jt as k,$e as l,Qt as m,W as n,tn as o,fe as p,nn as q,on as r,Ye as s,pe as t,sn as u,ye as v,Je as w,an as x,dn as y,Se as z,hn as A,we as B,tt as C,nt as D,rt as E,mn as F,st as G,lt as H,pn as I,bn as J,xn as K,gn as L,Pe as M,ve as N,dt as O,J as P,Ie as Q,wn as R,Q as S,pt as T,Ee as U,Z as V,G as W,In as X,bt as Y,Ce as Z,Te as _,Oe as $,ee as aa,xt as ba,gt as ca,St as da,X as ea,En as fa,Re as ga,_e as ha,vt as ia,ke as ja,N as ka,Ue as la,Fn as ma,Rt as na,Be as oa,At as pa,Ge as qa,Hn as ra,_t as sa,Lt as ta,je as ua,V as va,Un as wa,jt as xa,Dt as ya,Ft as za,Bn as Aa,Ht as Ba,Ut as Ca,Gn as Da,Xn as Ea,zn as Fa};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ia as Y}from"./chunk-
|
|
1
|
+
import{ia as Y}from"./chunk-KCFEFP6H.js";function nn(c){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(l,a)=>Math.hypot(l-c.x,a-c.y),gradientAt:(l,a)=>{let e=l-c.x,f=a-c.y,i=Math.hypot(e,f);return i<1e-9?[0,0]:[e/i,f/i]}}}function tn(c,l){if(!c.length)return null;let a=0,e=0,f=0;for(let n of c)a+=n.x,e+=n.y,f+=Math.hypot(n.x-l.x,n.y-l.y);let i=c.length;a/=i,e/=i,f/=i;let u=c[0],R=-1;for(let n of c){let o=Math.hypot(n.x-a,n.y-e);o>R&&(R=o,u=n)}let b=u.x-a,m=u.y-e,d=Math.hypot(b,m);d>1e-9?(b/=d,m/=d):(b=1,m=0);let y=[...c].sort((n,o)=>(n.x-a)*b+(n.y-e)*m-((o.x-a)*b+(o.y-e)*m)),t=0;for(let n of y){let o=Math.hypot(n.x-a,n.y-e);o>t&&(t=o)}return{pts:y,cx:a,cy:e,radius:t,depth:f}}function Z(c,l,a){let e=c.pts;if(e.length===1)return Math.hypot(l-e[0].x,a-e[0].y);let f=1/0;for(let i=0;i+1<e.length;i++){let u=e[i],R=e[i+1],b=R.x-u.x,m=R.y-u.y,d=b*b+m*m,y=d>1e-12?((l-u.x)*b+(a-u.y)*m)/d:0;y<0?y=0:y>1&&(y=1);let t=Math.hypot(l-(u.x+y*b),a-(u.y+y*m));t<f&&(f=t)}return f}var U=8;function en(c,l,a){let e=new Array(U).fill(1/0),f=new Array(U).fill(-1);for(let d=0;d<c.length;d++){let y=c[d],t=Math.hypot(l-y.cx,a-y.cy)-y.radius;for(let n=0;n<U;n++)if(t<e[n]){for(let o=U-1;o>n;o--)e[o]=e[o-1],f[o]=f[o-1];e[n]=t,f[n]=d;break}}let i=new Array(3).fill(1/0),u=new Array(3).fill(-1);for(let d of f){if(d<0)continue;let y=Z(c[d],l,a);for(let t=0;t<3;t++)if(y<i[t]){for(let n=2;n>t;n--)i[n]=i[n-1],u[n]=u[n-1];i[t]=y,u[t]=d;break}}if(u[0]<0)return 0;if(i[0]<1e-6)return c[u[0]].depth;let R=i[0]*2.2,b=0,m=0;for(let d=0;d<3;d++){let y=u[d];if(y<0||i[d]>R)continue;let t=1/(i[d]*i[d]);b+=t*c[y].depth,m+=t}return m>0?b/m:c[u[0]].depth}function on(c){let l=(e,f)=>en(c,e,f),a=(e,f)=>{let i=1/0,u=-1;for(let R=0;R<c.length;R++){let b=c[R];if(Math.hypot(e-b.cx,f-b.cy)-b.radius>=i)continue;let m=Z(b,e,f);m<i&&(i=m,u=R)}return u};return{kind:"rows",rowCount:c.length,rows:c,nearestRow:a,depthAt:l,gradientAt:(e,f)=>{let i=(l(e+.5,f)-l(e-.5,f))/1,u=(l(e,f+.5)-l(e,f-.5))/(2*.5),R=Math.hypot(i,u);return R<1e-9?[0,0]:[i/R,u/R]}}}function bn(c,l){let a=[];for(let e of c){let f=tn(e.points,l);f&&a.push(f)}return a.length<2?nn(l):(a.sort((e,f)=>e.depth-f.depth),on(a))}var rn=Math.PI/180,h=96,sn=6,ln=60,cn=150,$=.2,an=.35;function fn(c,l){let a=Math.atan2(l.x-c.x,l.y-c.y)/rn;return a<0?a+360:a}function z(c){if(!c.length)return NaN;let l=[...c].sort((a,e)=>a-e);return l[Math.floor(l.length/2)]}function J(c,l,a=2){let e=c.length,f=new Float64Array(e);for(let i=0;i<e;i++){let u=0,R=0;for(let b=-a;b<=a;b++){let m=i+b;if(l)m=(m%e+e)%e;else if(m<0||m>=e)continue;u+=c[m],R++}f[i]=u/R}return f}function hn(c,l){let a=c.filter(t=>t.rows.length>=1);if(a.length<1)return null;let e=[],f=0,i=0,u=0;for(let t of a)for(let n of t.rows){for(let o of n.pts)f+=o.x,i+=o.y,u++;if(n.pts.length>=4){let o=Y(n.pts);o&&Number.isFinite(o.cx)&&Number.isFinite(o.cy)&&e.push({x:o.cx,y:o.cy})}}if(!u)return null;let R={x:f/u,y:i/u},b=R;if(e.length>=8){let t=z(e.map(D=>D.x)),n=z(e.map(D=>D.y)),o=0;for(let D of a)for(let j of D.rows)for(let F of j.pts){let W=Math.hypot(F.x-R.x,F.y-R.y);W>o&&(o=W)}let B=0,S=o*.2;for(let D of a)for(let j of D.rows)for(let F of j.pts)Math.hypot(F.x-t,F.y-n)<S&&B++;Math.hypot(t-R.x,n-R.y)<=o&&B/u<.01&&(b={x:t,y:n})}let m=[];for(let t of a){let n={sectionId:t.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let o of t.rows)for(let B of o.pts){let S=Math.hypot(B.x-b.x,B.y-b.y),D=Math.min(h-1,Math.floor(fn(b,B)/(360/h)));n.samples.push({r:S,bin:D,levelM:o.levelM}),S<n.rMin&&(n.rMin=S),S>n.rMax&&(n.rMax=S)}n.samples.length&&m.push(n)}if(!m.length)return null;m.sort((t,n)=>t.rMin+t.rMax-(n.rMin+n.rMax));let d=[];for(let t of m){let n=!1;for(let o of d){let B=Math.min(t.rMax,o.rMax)-Math.max(t.rMin,o.rMin),S=Math.min(t.rMax-t.rMin,o.rMax-o.rMin);if(S>1e-9&&B>=an*S){o.members.push(t),o.rMin=Math.min(o.rMin,t.rMin),o.rMax=Math.max(o.rMax,t.rMax),n=!0;break}}n||d.push({members:[t],rMin:t.rMin,rMax:t.rMax})}let y=[];for(let t of d){let n=new Array(h).fill(null);for(let r of t.members)for(let p of r.samples){let x=n[p.bin];x||(x={samples:[]},n[p.bin]=x),x.samples.push({r:p.r,levelM:p.levelM})}let o=n.map(r=>!!r);if(!o.filter(Boolean).length)continue;let S=[],D=[];for(let r of n){if(!r)continue;let p=1/0,x=-1/0;for(let A of r.samples)A.r<p&&(p=A.r),A.r>x&&(x=A.r);S.push(p),D.push(x)}let j=z(S),F=z(D);if(!(j>=$*F)||!(F>0))continue;let W=[...S].sort((r,p)=>r-p);if(!(W[Math.floor(W.length*.1)]>=$*F))continue;let V=n.map(r=>{if(!r)return null;let p=[...r.samples].sort((w,k)=>w.r-k.r),x=p[0].r,A=p[p.length-1].r,P=p[0].levelM,N=-1/0;for(let w of p)w.levelM>N&&(N=w.levelM);let M=[];for(let w of p){let k={r:w.r,l:w.levelM};for(;M.length&&Math.abs(M[M.length-1].r-k.r)<1e-9;){if(M[M.length-1].l<=k.l){k.skip=!0;break}M.pop()}if(!k.skip){for(;M.length>=2;){let L=M[M.length-2],v=M[M.length-1];if((v.r-L.r)*(k.l-L.l)-(v.l-L.l)*(k.r-L.r)<=0)M.pop();else break}M.push(k)}}let C=M.map(w=>w.r),_=M.map(w=>w.l);return{inner:x,outer:A,front:P,top:N,profile:{rs:C,ls:_}}}),O=o.slice();for(let r=0;r<h;r++){if(O[r])continue;let p=-1,x=-1,A=0;for(let s=1;s<=h;s++){let g=(r-s+h*2)%h;if(O[g]){p=g;break}}for(let s=1;s<=h;s++){let g=(r+s)%h;if(O[g]){x=g,A=s;break}}if(p<0||x<0)continue;let P=0;for(let s=1;s<=h;s++){let g=(r-s+h*2)%h;if(o[g]){P=s;break}}if(P-1+A>sn)continue;let M=V[p],C=V[x],_=P/(P+A),w=M.inner+(C.inner-M.inner)*_,k=M.outer+(C.outer-M.outer)*_,L=M.front+(C.front-M.front)*_,v=M.top+(C.top-M.top)*_;V[r]={inner:w,outer:k,front:L,top:v,profile:{rs:[w,k],ls:[L,v]}}}for(let r=0;r<h;r++)V[r]&&(O[r]=!0);let X=360/h,K=[],q=O.filter(Boolean).length,Q=[];if(q===h)Q.push({start:0,len:h});else{let r=0;for(;O[r];)r=(r+1)%h;let p=-1;for(let x=0;x<=h;x++){let A=(r+x)%h,P=x<h&&O[A];if(P&&p<0)p=A;else if(!P&&p>=0){let N=(A-p+h)%h||h;Q.push({start:p,len:N}),p=-1}}}for(let r of Q){if(r.len*X<ln&&r.len<h)continue;let p=r.len===h,x=new Float64Array(r.len),A=new Float64Array(r.len),P=new Float64Array(r.len),N=new Float64Array(r.len),M=[];for(let s=0;s<r.len;s++){let g=V[(r.start+s)%h];x[s]=g.inner,A[s]=g.outer,P[s]=g.front,N[s]=g.top,M.push(g.profile??{rs:[g.inner,g.outer],ls:[g.front,g.top]})}let C=J(x,p),_=J(A,p),w=J(P,p),k=J(N,p);for(let s=0;s<r.len;s++)C[s]>x[s]&&(C[s]=x[s]),_[s]<A[s]&&(_[s]=A[s]),C[s]>_[s]-1e-6&&(C[s]=Math.max(0,_[s]-1e-6)),k[s]<w[s]&&(k[s]=w[s]);let L={startBin:r.start,binCount:r.len,closed:p,innerR:C,outerR:_,frontLevelM:w,topLevelM:k,profiles:M},v=(s,g,I)=>{let H=M[s],T=H.rs,E=H.ls;if(g<=T[0]){E[0]>I&&(E[0]=I);return}if(g>=T[T.length-1]){E[E.length-1]>I&&(E[E.length-1]=I);return}for(let G=0;G+1<T.length;G++)if(g<=T[G+1]){E[G]>I&&(E[G]=I),E[G+1]>I&&(E[G+1]=I);return}};for(let s=0;s<r.len;s++){let g=n[(r.start+s)%h];if(g)for(let I of g.samples){v(s,I.r,I.levelM);let H=p?(s-1+r.len)%r.len:s-1,T=p?(s+1)%r.len:s+1;H>=0&&v(H,I.r,I.levelM),T<r.len&&v(T,I.r,I.levelM)}}K.push(L)}K.reduce((r,p)=>r+p.binCount*X,0)<cn||y.push({arcs:K,sectionIds:t.members.map(r=>r.sectionId),innerRMedian:j,outerRMedian:F})}if(!y.length)return null;if(y.sort((t,n)=>t.innerRMedian-n.innerRMedian),l){let t=y[y.length-1].outerRMedian;if(Math.hypot(l.x-b.x,l.y-b.y)>.9*t)return null}return{centre:b,binCount:h,binStepDeg:360/h,rings:y}}function dn(c,l,a,e){let f=c.binStepDeg,i=a/f-.5-l.startBin;i=(i%c.binCount+c.binCount)%c.binCount,i>l.binCount-1&&(l.closed?i=i-l.binCount<l.binCount-i?0:l.binCount-1:i=i-(l.binCount-1)<c.binCount-i?l.binCount-1:0);let u=Math.floor(i),R=l.closed?(u+1)%l.binCount:Math.min(l.binCount-1,u+1),b=i-u,m=d=>{let y=l.profiles[d],t=y.rs,n=y.ls;if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];for(let o=0;o+1<t.length;o++)if(e<=t[o+1]){let B=t[o+1]-t[o],S=B>1e-9?(e-t[o])/B:0;return n[o]+(n[o+1]-n[o])*S}return n[n.length-1]};return m(u)*(1-b)+m(R)*b}export{bn as a,fn as b,hn as c,dn as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as b}from"./chunk-
|
|
1
|
+
import{n as b}from"./chunk-7KS6TAYH.js";var l="seatlayer.event-configuration/1",p="seatlayer.event-configuration-export/1",c=100,_=120,S=1e5,k=1e4,y=/^[a-f0-9]{64}$/,x=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function d(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function u(e,n){return typeof e=="string"&&e.length>=1&&e.length<=n&&e.normalize("NFKC").trim()===e}function E(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function v(e){return!Array.isArray(e)||e.length>S||!e.every(n=>u(n,c))?null:[...new Set(e)].sort()}function C(e){return!d(e)||!u(e.chartId,c)||!u(e.version,c)||e.sha256!==void 0&&(typeof e.sha256!="string"||!y.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function m(e,n,t){return typeof e=="number"&&Number.isFinite(e)&&e>=n&&e<=t}function V(e){return d(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&m(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function j(e,n){if(e===void 0)return;if(!Array.isArray(e)||e.length>k)return null;let t=new Set(n),s=new Set,i=new Set,r=0,a=[];for(let o of e){if(!d(o)||!u(o.id,c)||!u(o.objectId,c)||!t.has(o.objectId)||!x.has(String(o.kind))||!m(o.heightM,.05,50)||o.baseElevationM!==void 0&&!m(o.baseElevationM,-10,100))return null;let f=V(o.occlusion);if(!f||s.has(o.id)||i.has(o.objectId))return null;let g=o.contentImageUrl===void 0?void 0:typeof o.contentImageUrl=="string"?b(o.contentImageUrl):null;if(o.contentImageUrl!==void 0&&(!g||o.kind!=="screen"||++r>1))return null;s.add(o.id),i.add(o.objectId),a.push({id:o.id,objectId:o.objectId,kind:o.kind,heightM:o.heightM,...o.baseElevationM!==void 0?{baseElevationM:o.baseElevationM}:{},occlusion:f,...g?{contentImageUrl:g}:{}})}return a.sort((o,f)=>o.id.localeCompare(f.id))}function I(e){let n=[];if(!d(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==l&&n.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${l}`}),u(e.id,c)||n.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),u(e.label,_)||n.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),E(e.version)||n.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let t=C(e.baseVenue);t||n.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let s=d(e.overlay)?e.overlay:null,i=v(s?.objectIds),r=v(s?.productionKillSeatIds),a=i?j(s?.productionElements,i):null;return(!s||!i||!r)&&n.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),a===null&&n.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),n.length||!t||!i||!r||a===null?{issues:n}:{issues:n,value:{schema:l,id:e.id,label:e.label,version:e.version,baseVenue:t,overlay:{objectIds:i,productionKillSeatIds:r,...a!==void 0?{productionElements:a}:{}}}}}function R(e){let n=I(e);return n.value?{ok:!0,value:n.value}:{ok:!1,issues:n.issues}}function P(e){if(!d(e))return{ok:!1,issues:[{code:"invalid_export",path:"",message:"Export must be an object"}]};let n=[];e.schema!==p&&n.push({code:"unsupported_schema",path:"schema",message:`Export schema must be ${p}`}),(typeof e.contentSha256!="string"||!y.test(e.contentSha256))&&n.push({code:"invalid_checksum",path:"contentSha256",message:"Export checksum must be a lowercase SHA-256 digest"});let t=I(e.configuration);return n.push(...t.issues),n.length||!t.value||typeof e.contentSha256!="string"?{ok:!1,issues:n}:{ok:!0,value:{schema:p,configuration:t.value,contentSha256:e.contentSha256}}}function A(e){return JSON.stringify({schema:l,id:e.id,label:e.label,version:e.version,baseVenue:{chartId:e.baseVenue.chartId,version:e.baseVenue.version,...e.baseVenue.sha256?{sha256:e.baseVenue.sha256}:{}},overlay:{objectIds:[...new Set(e.overlay.objectIds)].sort(),productionKillSeatIds:[...new Set(e.overlay.productionKillSeatIds)].sort(),...e.overlay.productionElements!==void 0?{productionElements:[...e.overlay.productionElements].sort((n,t)=>n.id.localeCompare(t.id)).map(n=>({id:n.id,objectId:n.objectId,kind:n.kind,heightM:n.heightM,...n.baseElevationM!==void 0?{baseElevationM:n.baseElevationM}:{},occlusion:n.occlusion,...n.contentImageUrl?{contentImageUrl:n.contentImageUrl}:{}}))}:{}}})}function N(e,n){let t=[];e.baseVenue.chartId!==n.chartId&&t.push({code:"base_venue_mismatch",message:"Configuration belongs to a different base venue"}),e.baseVenue.version!==n.version&&t.push({code:"base_venue_version_mismatch",message:"Configuration was authored against a different venue version"}),e.baseVenue.sha256&&!n.sha256?t.push({code:"base_venue_checksum_missing",message:"Venue checksum is required for this configuration"}):e.baseVenue.sha256&&e.baseVenue.sha256!==n.sha256&&t.push({code:"base_venue_checksum_mismatch",message:"Venue bytes do not match the configuration base"});let s=new Set(n.objectIds);for(let r of e.overlay.objectIds)s.has(r)||t.push({code:"overlay_object_missing",message:`Production object ${r} is missing from the base venue`,targetId:r});if(n.objectTypes)for(let r of e.overlay.productionElements??[])n.objectTypes.get(r.objectId)!=="shape"&&t.push({code:"production_element_not_shape",message:`Production element ${r.id} must reference base-venue shape geometry`,targetId:r.objectId});let i=new Set(n.seatIds);for(let r of e.overlay.productionKillSeatIds)i.has(r)||t.push({code:"production_kill_seat_missing",message:`Production-kill seat ${r} is missing from the base venue`,targetId:r});return{compatible:t.length===0,issues:t}}var w={draft:new Set(["review","archived"]),review:new Set(["draft","approved","archived"]),approved:new Set(["published","archived"]),published:new Set(["archived"]),archived:new Set};function T(e,n){return e===n||w[e].has(n)}function L(e,n,t){return!E(t)||t>=n.version?null:e.find(s=>s.id===n.id&&s.version===t&&s.status==="published")??null}function O(e){return e.floors?.length?e.floors.flatMap(n=>n.objects):e.objects}function h(e,n,t){if(!(!e||typeof e!="object")){if(Array.isArray(e)){for(let s of e)h(s,n,t);return}for(let[s,i]of Object.entries(e)){if(s==="eventConfigurationId"){u(i,c)?n.add(i):i!==void 0&&t.add(String(i));continue}if(s==="eventConfigurationIds"){if(!Array.isArray(i))t.add(String(i));else for(let r of i)u(r,c)?n.add(r):t.add(String(r));continue}h(i,n,t)}}}function U(e,n){let t=C(n);if(!t)return{ok:!1,invalidIds:["baseVenue"]};let s=new Set,i=new Set;if(h(e,s,i),i.size)return{ok:!1,invalidIds:[...i].sort()};let r=O(e);return{ok:!0,configurations:[...s].sort().map(a=>({schema:l,id:a,label:a,version:1,baseVenue:t,overlay:{objectIds:r.filter(o=>o.type==="shape"&&o.eventConfigurationIds?.includes(a)).map(o=>o.id).sort(),productionKillSeatIds:[]}}))}}export{l as a,p as b,R as c,P as d,A as e,N as f,T as g,L as h,U as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ca as B,Fa as F,x as j}from"./chunk-KCFEFP6H.js";var L=.08,X=.045;function E(t,e,n){return{...t,objects:e,floors:void 0,...n?{focalPoint:n}:{},referenceImage:void 0,backgroundImage:void 0}}function T(t,e,n){let o=t.focalPoint??e.focalPoint;return o?o.x:n.x+n.width/2}function Y(t){let e=t.floors??[];if(!e.length)return[];let n=e.map(s=>F(E(t,s.objects,s.focalPoint),{freeText:"exclude"})),a=Math.max(1,...n.map(s=>s.width))*L,r=0;return e.map((s,l)=>{let h=n[l],u=r-(h.y+h.height);return r-=h.height+a,{floorId:s.id,label:s.name??s.id,level:l,levelBadge:l===0?"G":String(l),translation:{x:-T(s,t,h),y:u},bounds:h}})}function _(t,e,n,o){let a=e==="name"?t.label:t.levelBadge;if(!a)return[];let r=Math.max(1,n*X),s=t.bounds.x+t.translation.x,l=t.bounds.y+t.translation.y+r*.4,h=`floor-level-${t.floorId}`,u={type:"text",id:`${h}-text`,text:a,position:{x:s,y:l},fontSize:r,rotation:0,color:o,bold:!0};if(e==="name")return[u];let m=r*.95;return[{type:"shape",id:`${h}-badge`,kind:"ellipse",x:s-m*.35,y:l-m*.3,width:m*2,height:m*2,fill:"transparent",stroke:{color:o,width:Math.max(1,r*.09)},opacity:.8},u]}function z(t,e={}){let n=t.floors;if(!n||n.length<2)return t;let o=Y(t),a=[];n.forEach((u,m)=>{let{x:y,y:S}=o[m].translation;for(let w of u.objects)m>0&&w.type==="shape"&&w.role==="stage"||a.push(B(w,y,S))});let r={...t,objects:a,floors:void 0},s=F(r,{freeText:"exclude"}),l=Math.max(1,s.width,s.height),h=t.theme?.textColor??"#94a3b8";for(let u of o)a.push(..._(u,e.labelStyle??"number",l,h));return{...r,objects:a,referenceImage:void 0,backgroundImage:void 0}}function Q(t){let e=t.floors;if(!e?.length)return null;let n=e.find(r=>r.objects.some(s=>s.type==="shape"&&s.role==="stage"));if(n)return n.id;let o=e[0],a=-1;for(let r of e){let s=F(E(t,r.objects,r.focalPoint),{freeText:"exclude"}),l=s.width*s.height;l>a&&(a=l,o=r)}return o.id}var N=640;function H(t,e){return(t.floors?.length??0)<2?null:!Number.isFinite(e)||e<=0||e>=N?"all":Q(t)}var U=9;function $(t){if(t.kind==="circle")return{hx:t.r,hy:t.r};let e=t.width/2,n=t.height/2,o=t.rotation??0;if(!o)return{hx:e,hy:n};let a=o*Math.PI/180,r=Math.abs(Math.cos(a)),s=Math.abs(Math.sin(a));return{hx:e*r+n*s,hy:e*s+n*r}}function q(t,e,n){let o=e-t.seat.x,a=n-t.seat.y;if(t.shape.kind==="circle")return o*o+a*a<=t.shape.r*t.shape.r;let r=t.shape.rotation??0,s=o,l=a;if(r){let h=-r*Math.PI/180,u=Math.cos(h),m=Math.sin(h);s=o*u-a*m,l=o*m+a*u}return Math.abs(s)<=t.shape.width/2&&Math.abs(l)<=t.shape.height/2}function G(t,e,n,o,a){if(t.shape.kind==="circle"){let d=Math.min(Math.max(t.seat.x,e),o),x=Math.min(Math.max(t.seat.y,n),a),f=t.seat.x-d,b=t.seat.y-x;return f*f+b*b<=t.shape.r*t.shape.r}let r=t.shape.rotation??0;if(!r)return t.seat.x-t.hx<=o&&t.seat.x+t.hx>=e&&t.seat.y-t.hy<=a&&t.seat.y+t.hy>=n;let s=r*Math.PI/180,l=Math.cos(s),h=Math.sin(s),u=t.shape.width/2,m=t.shape.height/2,y=[[-u,-m],[u,-m],[u,m],[-u,m]].map(([d,x])=>[t.seat.x+d*l-x*h,t.seat.y+d*h+x*l]),S=[[e,n],[o,n],[o,a],[e,a]],w=[[1,0],[0,1],[l,h],[-h,l]];for(let[d,x]of w){let f=1/0,b=-1/0;for(let[P,O]of y){let c=P*d+O*x;c<f&&(f=c),c>b&&(b=c)}let M=1/0,I=-1/0;for(let[P,O]of S){let c=P*d+O*x;c<M&&(M=c),c>I&&(I=c)}if(b<M||I<f)return!1}return!0}function W(t,e={}){let n=e.seatRadius??U,o=t.length,a=new Array(o),r=1/0,s=1/0,l=-1/0,h=-1/0,u=0;for(let c=0;c<o;c++){let i=t[c],D=e.shapeOf?.(i)??{kind:"circle",r:n},{hx:g,hy:p}=$(D);a[c]={seat:i,shape:D,hx:g,hy:p},i.x-g<r&&(r=i.x-g),i.y-p<s&&(s=i.y-p),i.x+g>l&&(l=i.x+g),i.y+p>h&&(h=i.y+p),g>u&&(u=g),p>u&&(u=p)}o===0&&(r=0,s=0,l=0,h=0);let m=u>0?u*4:1,y=Math.max(l-r,0),S=Math.max(h-s,0),w=Math.max(64,e.maxCells??o*4),d=m,x=Math.max(1,Math.ceil(y/d)||1),f=Math.max(1,Math.ceil(S/d)||1);for(;x*f>w&&(x>1||f>1);)d*=2,x=Math.max(1,Math.ceil(y/d)||1),f=Math.max(1,Math.ceil(S/d)||1);let b=x*f,M=new Int32Array(b+1),I=0;for(let c=0;c<o;c++){let i=a[c],D=j(Math.floor((i.seat.x-i.hx-r)/d),0,x-1),g=j(Math.floor((i.seat.x+i.hx-r)/d),0,x-1),p=j(Math.floor((i.seat.y-i.hy-s)/d),0,f-1),R=j(Math.floor((i.seat.y+i.hy-s)/d),0,f-1);for(let C=p;C<=R;C++)for(let A=D;A<=g;A++)M[C*x+A+1]++,I++}for(let c=0;c<b;c++)M[c+1]+=M[c];let P=new Int32Array(I),O=M.slice(0,b);for(let c=0;c<o;c++){let i=a[c],D=j(Math.floor((i.seat.x-i.hx-r)/d),0,x-1),g=j(Math.floor((i.seat.x+i.hx-r)/d),0,x-1),p=j(Math.floor((i.seat.y-i.hy-s)/d),0,f-1),R=j(Math.floor((i.seat.y+i.hy-s)/d),0,f-1);for(let C=p;C<=R;C++)for(let A=D;A<=g;A++){let k=C*x+A;P[O[k]++]=c}}return{seats:t,entries:a,minX:r,minY:s,cell:d,cols:x,rows:f,cellStart:M,items:P,stamp:new Int32Array(o),epoch:0}}function tt(t,e,n={}){let{cols:o,rows:a,cell:r,minX:s,minY:l,cellStart:h,items:u,entries:m}=t,y=Math.floor((e.x-s)/r),S=Math.floor((e.y-l)/r);if(y<0||S<0||y>=o||S>=a)return null;let w=S*o+y,d=h[w+1],x=-1,f=1/0;for(let b=h[w];b<d;b++){let M=u[b],I=m[M];if(n.filter&&!n.filter(I.seat.id,I.seat)||!q(I,e.x,e.y))continue;let P=e.x-I.seat.x,O=e.y-I.seat.y,c=P*P+O*O;(c<f||c===f&&M<x)&&(f=c,x=M)}return x<0?null:m[x].seat.id}function et(t,e,n,o={}){if(!(n>0))return null;let{cols:a,rows:r,cell:s,minX:l,minY:h,cellStart:u,items:m,entries:y}=t,S=Math.max(0,Math.floor((e.x-n-l)/s)),w=Math.min(a-1,Math.floor((e.x+n-l)/s)),d=Math.max(0,Math.floor((e.y-n-h)/s)),x=Math.min(r-1,Math.floor((e.y+n-h)/s));if(S>w||d>x)return null;let f=-1,b=n*n,M=t.stamp,I=++t.epoch;for(let P=d;P<=x;P++){let O=P*a;for(let c=S;c<=w;c++){let i=O+c,D=u[i+1];for(let g=u[i];g<D;g++){let p=m[g];if(M[p]===I)continue;M[p]=I;let R=y[p];if(o.filter&&!o.filter(R.seat.id,R.seat))continue;let C=e.x-R.seat.x,A=e.y-R.seat.y,k=C*C+A*A;(k<b||k===b&&p<f)&&(b=k,f=p)}}}return f<0?null:y[f].seat.id}function nt(t,e,n={}){let o=Math.min(e.x,e.x+e.width),a=Math.max(e.x,e.x+e.width),r=Math.min(e.y,e.y+e.height),s=Math.max(e.y,e.y+e.height),l=n.mode??"center",{cols:h,rows:u,cell:m,minX:y,minY:S,cellStart:w,items:d,entries:x}=t,f=Math.max(0,Math.floor((o-y)/m)),b=Math.min(h-1,Math.floor((a-y)/m)),M=Math.max(0,Math.floor((r-S)/m)),I=Math.min(u-1,Math.floor((s-S)/m));if(f>b||M>I)return[];let P=[],O=t.stamp,c=++t.epoch;for(let i=M;i<=I;i++){let D=i*h;for(let g=f;g<=b;g++){let p=D+g,R=w[p+1];for(let C=w[p];C<R;C++){let A=d[C];if(O[A]===c)continue;O[A]=c;let k=x[A];if(n.filter&&!n.filter(k.seat.id,k.seat))continue;(l==="center"?k.seat.x>=o&&k.seat.x<=a&&k.seat.y>=r&&k.seat.y<=s:G(k,o,r,a,s))&&P.push(A)}}}return P.sort((i,D)=>i-D),P.map(i=>x[i].seat.id)}function ot(t){let e=t.cols*t.rows,n=0,o=0;for(let r=0;r<e;r++){let s=t.cellStart[r+1]-t.cellStart[r];s>0&&n++,s>o&&(o=s)}let a=t.items.length;return{cell:t.cell,cols:t.cols,rows:t.rows,cells:e,occupiedCells:n,refs:a,maxPerCell:o,meanPerOccupiedCell:n?a/n:0}}function st(t,e=0){let n=Math.max(1,t.width,t.height),o={x:t.x+t.width/2,y:t.y+t.height/2},a=n*1.55,r=Math.max(n*.82,Math.max(0,e)+n*.45);return{target:o,distance:a,height:r,focalLength:Math.hypot(a,r),yawRad:-8*Math.PI/180}}function v(t,e,n=0){let o=e.x-t.target.x,a=e.y-t.target.y,r=Math.cos(t.yawRad),s=Math.sin(t.yawRad),l=o*r-a*s,u=o*s+a*r-t.distance,m=n-t.height,y=Math.hypot(t.distance,t.height),S=(-t.distance*u-t.height*m)/y,w=(-t.height*u+t.distance*m)/y,d=Math.max(y*.08,S),x=t.focalLength/d;return{x:t.target.x+l*x,y:t.target.y-w*x,depth:d,scale:x}}function at(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function ct(t){let e=t.a*t.d-t.b*t.c;if(!Number.isFinite(e)||Math.abs(e)<1e-9)throw new Error("perspective projection produced a singular affine");let n=t.d/e,o=-t.b/e,a=-t.c/e,r=t.a/e;return{a:n,b:o,c:a,d:r,e:-(n*t.e+a*t.f),f:-(o*t.e+r*t.f)}}function it(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function lt(t,e,n=()=>0){let o=v(t,e,n(e)),a={x:e.x+1,y:e.y},r={x:e.x,y:e.y+1},s=v(t,a,n(a)),l=v(t,r,n(r)),h=s.x-o.x,u=s.y-o.y,m=l.x-o.x,y=l.y-o.y;return{a:h,b:u,c:m,d:y,e:o.x-h*e.x-m*e.y,f:o.y-u*e.x-y*e.y}}function ht(t){let e=Math.hypot(t.a,t.b),n=t.a*t.d-t.b*t.c;return{rotationDeg:Math.atan2(t.b,t.a)*180/Math.PI,scaleX:e,scaleY:n/Math.max(e,1e-9),skewX:(t.a*t.c+t.b*t.d)/Math.max(n,1e-9)}}export{L as a,Y as b,z as c,Q as d,N as e,H as f,U as g,W as h,tt as i,et as j,nt as k,ot as l,st as m,v as n,at as o,ct as p,it as q,lt as r,ht as s};
|